Project local skill constraints and build entry tamper-proofing methods, systems, devices, and media for industrial control applications
Patent Information
- Application Number
- CN202610959680.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-30
- Publication Date
- 2026-09-29
AI Technical Summary
鉴于现有技术的上述缺点、不足,本发明提供一种面向工业控制应用的项目本地技能约束与构建入口防篡改方法、系统、设备及介质,其解决了AI辅助工业控制应用开发过程中,AI可能使用错误开发资源、改动关键构建相关文件而破坏目标平台约束,导致项目构建规则难以保持一致且交付结果不可控的技术问题
首先,本发明通过读取项目配置,获得项目本地技能根、声明技能、目标构建契约、AI可修改范围及受管资产范围,能够在AI代码生成和目标平台构建前明确技能来源、目标平台要求以及文件修改边界。进一步地,通过对声明技能对应的技能描述文件进行合法性校验,并仅从校验通过的技能描述文件中解析受管构建入口和入口约束信息,能够减少AI使用不存在、路径错误或内容异常的技能资源的风险。
Smart Images

Figure CN122837846A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software development technology, and in particular to a method, system, device, and medium for project local skill constraints and anti-tampering of construction entry points for industrial control applications. Background Technology
[0002] With the application of artificial intelligence technology in software development, code generation, automatic compilation, and automatic deployment based on large models are increasingly being used to improve application development efficiency. Existing technologies include solutions that use business logic descriptions, framework code, or natural language operators to assist in code generation, thereby improving code quality; other solutions combine project requirements, layered design, and DevOps tools to complete code generation, compilation, and deployment; furthermore, graphical programming systems for terminal devices can generate source code and complete compilation and flashing through graphical controls.
[0003] However, the aforementioned solutions typically focus on how to generate code, how to organize software engineering processes, or how to automate compilation and deployment, paying insufficient attention to the consistency of project constraints when AI is involved in development. Specifically, in the development of industrial control applications, AI may reference non-existent plugins, tools, or resources in incorrect paths, and may also modify critical files related to compilation, operation, or delivery during code generation or modification, leading to inconsistencies between the subsequent build results and the expected target platform.
[0004] Furthermore, industrial control applications typically exhibit strong determinism regarding the target operating system, processor architecture, runtime environment, output path, and delivery document format. Different projects may also have varying domain rules, build rules, and delivery requirements. Relying solely on generic hints, global tool configurations, or generic automated build processes can easily lead to inconsistencies in rules, unreproducible build processes, or deliverables deviating from engineering requirements during project replication, migration, or multi-person collaboration scenarios.
[0005] Therefore, in the development of AI-assisted industrial control applications, how to allow AI to modify the project source code while preventing it from using incorrect development resources, altering key build-related files, violating target platform requirements, and ensuring that project rules remain consistent in different environments is a technical problem that urgently needs to be solved. Summary of the Invention
[0006] (a) Technical problems to be solved In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides a method, system, device and medium for project local skill constraints and anti-tampering of construction entry for industrial control applications. It solves the technical problem that in the process of AI-assisted industrial control application development, AI may use incorrect development resources and modify key construction-related files, thereby destroying the target platform constraints, resulting in the inconsistency of project construction rules and uncontrollable delivery results.
[0007] (II) Technical Solution To achieve the above objectives, the main technical solutions adopted by the present invention include: In a first aspect, embodiments of the present invention provide a method for preventing tampering of project local skill constraints and construction entry points for industrial control applications, including: Read the project configuration of the industrial control application to obtain the project's local skill roots, declared skills, target construction contracts, AI modifiable scope, and managed asset scope; Perform a validity check on the skill description files corresponding to the declared skills in the skill locations determined by the project's local skill roots or mapped by the project configuration, and parse the managed build entry and entry constraint information from the skill description files that pass the validity check; Based on the entry constraint information, the managed build entry is deployed to the project runtime environment. Anti-tampering attributes or anti-tampering identifiers are configured for the deployed managed build entry, and a binding relationship is established between the managed build entry, the declared skills, and the target build contract. The AI modification boundary is generated based on the AI modifiable scope and the scope of managed assets, and the file writing scope of the AI code generation stage is constrained according to the AI modification boundary, so that the managed build entry point is excluded from the file writing scope. Before building the target platform, perform anti-tampering verification and binding relationship consistency verification on the managed build entry points with anti-tampering attributes or anti-tampering identifiers. After the anti-tampering verification and binding relationship consistency verification pass, the managed construction entry is called to execute the target platform construction for the industrial control application.
[0008] Optionally, read the project configuration of the industrial control application to obtain the project's local skill roots, declared skills, target construction contracts, AI-modifiable scope, and managed asset scope, including: Read and parse the project metadata file, project status file, or project configuration list of industrial control applications to obtain the project root directory, skill root directory field, skill declaration field, target platform field, source code scope field, and managed asset field; Determine the local skill root of the project based on the project root directory and skill root directory fields; The declared skills are determined based on the skill name and skill version constraints in the skill declaration field; Generate a target build contract based on the target platform field, which includes at least one of the following: target operating system, target processor architecture, target triple, delivery file type, and target output location; The AI-modifiable scope is generated based on the source code scope field, which includes at least one of the following: source code directory, configuration file directory, test file directory, application resource directory, and allowed write file types. The scope of managed assets is generated based on the managed asset fields, which include at least one of the following: managed build entry directory, managed runtime asset directory, build-related file directory, project runtime area directory, and prohibited write paths.
[0009] Optionally, the validity of the skill description files corresponding to the declared skills in the skill locations determined by the project's local skill roots or mapped by the project configuration is verified, and the managed build entry and entry constraint information are parsed from the skill description files that pass the validity verification, including: Based on the declared skill name and version constraints, determine the skill directory corresponding to the declared skill in the project's local skill root or in the skill location mapped by the project configuration; Check if skill description files exist in the skill catalog; If a skill description file exists, a validity check is performed, including path range validation, declaration matching validation, format validation, and field integrity validation. If the skill description file does not exist or fails the validity check, diagnostic information will be generated and the process will be prevented from entering the AI code generation stage. When the skill description file passes the validity check, the managed build entry description field in the skill description file is parsed to directly obtain the managed build entry, or the entry reference information is obtained and the managed build entry is determined based on the entry reference information; Parse the entry constraint field in the skill description file to obtain at least one of the following: target construction contract, output contract, required construction assets, runtime constraints, and prohibition of modification constraints, in order to form entry constraint information.
[0010] Optionally, based on the entry constraint information, the managed build entry is deployed to the project runtime environment. Anti-tampering attributes or anti-tampering identifiers are configured on the deployed managed build entry, and a binding relationship is established between the managed build entry, the declared skills, and the target build contract, including: Determine the source path or entry reference information of the managed build entry point in the declared skill that has passed the legality verification, and determine the target location of the managed build entry point in the project runtime environment based on the entry constraint information and in conjunction with the project configuration or project runtime environment; Based on the source path or entry reference information, the managed build entry point is copied, synchronized, or mounted in read-only mode to the target location in the project runtime environment; After the managed build entry point is deployed, the entry point deployment information is recorded. The entry point deployment information includes at least one of the following: source skill, source path, deployment location, deployment time, and entry point integrity information. Configure anti-tamper attributes or anti-tamper identifiers for the managed build entry point to complete the deployment. The anti-tamper attributes or anti-tamper identifiers include at least one of the following: read-only attribute, hash record, signature information, access control information, container read-only mount status, or managed asset identifier. Write the managed build entry point, declared skills, entry point deployment information, tamper-proof attributes or tamper-proof identifiers, and target build contract into the project status or build status; Based on the project status or build status, establish the binding relationship between the managed build entry point, declared skills, and target build contract.
[0011] Optionally, an AI modification boundary is generated based on the AI-modifiable scope and the managed asset scope, and the file writing scope during the AI code generation stage is constrained according to the AI modification boundary, so that the managed build entry point is excluded from the file writing scope, including: Determine the set of writable paths and / or the set of writable file types that are allowed to be written during the AI code generation phase based on the scope of AI modification. Determine the set of managed paths and / or the set of managed file types that are prohibited from being written during the AI code generation phase based on the scope of managed assets; Detect conflicts between the set of writable paths and / or the set of writable file types and the set of managed paths and / or the set of managed file types, and when conflicts exist, exclude the set of managed paths and / or the set of managed file types from the set of writable paths and / or the set of writable file types to generate AI modification boundaries; The boundary constraint information generated during the AI code generation stage is modified based on the AI boundary. The boundary constraint information includes at least one of the following: allowed write paths, prohibited write paths, allowed write file types, prohibited write file types, and managed build entry identifier. During the AI code generation phase, the target path and / or target file type of the file write request are verified based on boundary constraint information; When the target path of a file write request is within the scope of a managed asset or points to a managed build entry point, or when the target file type is a prohibited write file type, the file write request is rejected and boundary violation diagnostic information is output. The file write request is allowed to be executed when the target path and / or target file type of the file write request meet the corresponding allowed conditions in the AI modification boundary, and the target path is not located within the scope of managed assets, does not point to the managed build entry point, and the target file type is not a prohibited file type.
[0012] Optionally, before building the target platform, tamper-proof verification and binding relationship consistency verification are performed on the managed build entry points with tamper-proof attributes or tamper-proof identifiers, including: Before building the target platform, read the managed build entry from the project runtime environment and read the anti-tampering attribute or anti-tampering identifier corresponding to the managed build entry; Based on the anti-tampering attribute or anti-tampering identifier, perform anti-tampering verification on the managed construction entry. The anti-tampering verification includes determining at least one of the following: whether the managed construction entry is kept in a read-only state, whether the hash value is consistent with the record value, whether the signature information matches the pre-stored signature information, whether the access control information is consistent with the record value, whether the container read-only mount state is consistent with the record state, and whether the managed asset identifier exists. Read the binding relationships between the managed build entry point, declared skills, and target build contract; Perform a binding relationship consistency check on the managed build entry point based on the binding relationship. The binding relationship consistency check includes checking whether at least one of the following recorded in the binding relationship—source skill, source path, deployment location, entry point integrity information, anti-tampering attribute or anti-tampering identifier, and target build contract—is consistent with the current managed build entry point, declared skill, and target build contract. When both the anti-tampering verification and the binding relationship consistency verification pass, the target platform construction is allowed; If the anti-tampering verification or binding relationship consistency verification fails, stop the target platform construction and record the abnormal information at the construction entry point.
[0013] Optionally, after the anti-tampering verification and binding relationship consistency verification pass, the managed build entry is invoked to perform target platform construction for the industrial control application, including: After both the anti-tampering verification and the binding relationship consistency verification pass, the target construction contract is read and provided to the managed construction entry point; The managed build entry is invoked to perform target platform construction for industrial control applications, so that the build process generates target platform outputs according to at least one of the target operating system, target processor architecture, target triplet, delivery file type and target output location in the target build contract; During the target platform building process, it is prohibited to use the build entry point generated, replaced, or rewritten by the AI code generation stage as the build entry point; After the target platform is constructed, candidate output locations are determined based on the entry constraint information or the target construction contract, and the target platform outputs for industrial control applications are obtained from the candidate output locations. Perform output contract verification on the target platform outputs, wherein the output contract verification includes verifying at least one of the following: output path, output format, target processor architecture, target operating system, file integrity, and delivery file type; Generate a build summary, which includes at least one of the following: build entry source, entry integrity information, anti-tampering verification result, binding relationship consistency verification result, target build contract, output path, output contract verification result, and build entry exception information when there is a build entry exception.
[0014] Secondly, embodiments of the present invention provide a project local skill constraint and construction entry anti-tampering system for industrial control applications, comprising: The project configuration reading module is used to read the project configuration of industrial control applications and obtain the project's local skill roots, declared skills, target construction contracts, AI modifiable scope, and managed asset scope. The declared skill verification module is used to verify the legality of the skill description files corresponding to the declared skills in the skill locations determined by the project's local skill roots or mapped by the project configuration, and to parse the managed build entry and entry constraint information from the skill description files that pass the legality verification. The managed entry deployment module is used to deploy managed build entry points to the project runtime environment based on entry constraint information, configure anti-tampering attributes or anti-tampering identifiers for the deployed managed build entry points, and establish the binding relationship between managed build entry points, declared skills, and target build contracts. The AI modification boundary control module is used to generate AI modification boundaries based on the AI modifiable scope and the scope of managed assets, and to constrain the file writing scope of the AI code generation stage according to the AI modification boundaries, so that the managed build entry point is excluded from the file writing scope. The entry verification module is used to perform anti-tampering verification and binding relationship consistency verification on managed entry points with anti-tampering attributes or anti-tampering identifiers before building the target platform. The target platform construction module is used to call the managed construction entry to perform target platform construction for industrial control applications after the anti-tampering verification and binding relationship consistency verification have passed.
[0015] Thirdly, embodiments of the present invention provide a project local skill constraint and construction entry anti-tampering device for industrial control applications, comprising: At least one processor; and memory that is communicatively connected to at least one processor; The memory stores instructions that can be executed by at least one processor. When the instructions are executed by at least one processor, the processor performs the project local skill constraints and construction entry anti-tampering method described above for industrial control applications.
[0016] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the project local skill constraints and construction entry anti-tampering method described above for industrial control applications.
[0017] (III) Beneficial Effects The beneficial effects of this invention are: First, by reading the project configuration, this invention obtains the project's local skill roots, declared skills, target build contracts, AI-modifiable scope, and managed asset scope. This allows for the clear definition of skill sources, target platform requirements, and file modification boundaries before AI code generation and target platform construction. Furthermore, by validating the skill description files corresponding to declared skills and only parsing managed build entry points and entry constraint information from valid skill description files, the risk of AI using non-existent, incorrectly pathed, or abnormally contented skill resources can be reduced.
[0018] Subsequently, by deploying managed build entry points based on entry constraint information, configuring anti-tampering attributes or anti-tampering identifiers, and establishing a binding relationship between managed build entry points, declared skills, and target build contracts, a verifiable association can be formed between the source, deployment status, and target build requirements of the build entry points. Simultaneously, by generating AI modification boundaries based on the AI's modifiable scope and the scope of managed assets, and constraining the file writing scope during the AI code generation phase, managed build entry points can be excluded from the AI's writable scope, reducing the possibility of AI rewriting critical build-related files.
[0019] Before building the target platform, by performing anti-tampering verification and binding relationship consistency verification on the managed build entry, problems such as missing build entry, rewriting, abnormal anti-tampering status, or inconsistency of target build contract can be detected in a timely manner. After the above verification is passed, the managed build entry is called to execute the target platform construction, which can improve the consistency of the industrial control application build process, the controllability of the delivery results, and the traceability of the build process.
[0020] In summary, this invention can allow AI to modify project source code while restricting it from breaking the constraints of the build entry point and target platform. This reduces the risk of build failure and delivery deviation in industrial control applications caused by incorrect skills, tampering with the build entry point, or unclear modification boundaries, and improves the consistency of project build rules and the controllability of delivery results. Attached Figure Description
[0021] Figure 1 This is a schematic diagram of the overall process of the method provided in the embodiments of the present invention; Figure 2This is a schematic diagram illustrating the specific process of step S1 of the method provided in this embodiment of the invention; Figure 3 This is a detailed flowchart illustrating step S2 of the method provided in this embodiment of the invention; Figure 4 This is a detailed flowchart illustrating step S3 of the method provided in this embodiment of the invention; Figure 5 This is a detailed flowchart illustrating step S4 of the method provided in this embodiment of the invention; Figure 6 This is a detailed flowchart illustrating step S5 of the method provided in this embodiment of the invention; Figure 7 This is a detailed flowchart illustrating step S6 of the method provided in this embodiment of the invention; Figure 8 This is a schematic diagram of the system provided in an embodiment of the present invention; Figure 9 This is a schematic diagram of the skill constraints and managed construction process provided in an embodiment of the present invention. Detailed Implementation
[0022] To better explain and facilitate understanding of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0023] like Figure 1 As shown in the embodiment of the present invention, a method for preventing tampering of project local skill constraints and build entry points for industrial control applications includes: reading the project configuration of the industrial control application to obtain the project local skill root, declared skills, target build contract, AI-modifiable scope, and managed asset scope; performing legality verification on the skill description files corresponding to the declared skills in the skill locations determined by the project local skill root or mapped by the project configuration, and parsing the managed build entry point and entry constraint information from the skill description files that pass the legality verification; deploying the managed build entry point to the project runtime environment based on the entry constraint information, and performing legality verification on the deployed managed build entry point. The system configures anti-tampering attributes or anti-tampering identifiers for the construction entry point and establishes a binding relationship between the managed construction entry point, declared skills, and the target construction contract. It generates AI modification boundaries based on the AI's modifiable scope and the scope of managed assets, and constrains the file writing scope during the AI code generation stage according to these boundaries, excluding the managed construction entry point from the file writing scope. Before building the target platform, it performs anti-tampering verification and binding relationship consistency verification on the managed construction entry point with anti-tampering attributes or anti-tampering identifiers. After the anti-tampering verification and binding relationship consistency verification pass, it calls the managed construction entry point to execute the target platform construction for the industrial control application.
[0024] First, by reading the project configuration, this invention obtains the project's local skill roots, declared skills, target build contracts, AI-modifiable scope, and managed asset scope. This allows for the clear definition of skill sources, target platform requirements, and file modification boundaries before AI code generation and target platform construction. Furthermore, by validating the skill description files corresponding to declared skills and only parsing managed build entry points and entry constraint information from valid skill description files, the risk of AI using non-existent, incorrectly pathed, or abnormally contented skill resources can be reduced.
[0025] Subsequently, by deploying managed build entry points based on entry constraint information, configuring anti-tampering attributes or anti-tampering identifiers, and establishing a binding relationship between managed build entry points, declared skills, and target build contracts, a verifiable association can be formed between the source, deployment status, and target build requirements of the build entry points. Simultaneously, by generating AI modification boundaries based on the AI's modifiable scope and the scope of managed assets, and constraining the file writing scope during the AI code generation phase, managed build entry points can be excluded from the AI's writable scope, reducing the possibility of AI rewriting critical build-related files.
[0026] Before building the target platform, by performing anti-tampering verification and binding relationship consistency verification on the managed build entry, problems such as missing build entry, rewriting, abnormal anti-tampering status, or inconsistency of target build contract can be detected in a timely manner. After the above verification is passed, the managed build entry is called to execute the target platform construction, which can improve the consistency of the industrial control application build process, the controllability of the delivery results, and the traceability of the build process.
[0027] In summary, this invention can allow AI to modify project source code while restricting it from breaking the constraints of the build entry point and target platform. This reduces the risk of build failure and delivery deviation in industrial control applications caused by incorrect skills, tampering with the build entry point, or unclear modification boundaries, and improves the consistency of project build rules and the controllability of delivery results.
[0028] To better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings.
[0029] Specifically, embodiments of the present invention provide a method for project local skill constraints and tamper-proof construction entry for industrial control applications, comprising: S1. Read the project configuration of the industrial control application to obtain the project's local skill roots, declared skills, target construction contracts, AI modifiable scope, and managed asset scope.
[0030] In this embodiment, the project configuration is used to carry the skill source, target platform, source code scope, and managed asset boundaries of the current industrial control application project, so that after the project is migrated to different devices or build environments, it can still reproduce the same skill parsing rules and build constraints based on the local configuration of the project.
[0031] Furthermore, such as Figure 2 As shown, step S1 includes: S11. Read and parse the project metadata file, project status file, or project configuration list of the industrial control application to obtain the project root directory, skill root directory field, skill declaration field, target platform field, source code scope field, and managed asset field.
[0032] The project metadata M is represented as: M = (project_id, target_os, target_arch, target_triple, skills, source_roots, managed_assets). Here, project_id is the project identifier, used to associate the project root directory and skill root directory fields; target_os, target_arch, and target_triple correspond to the target platform fields, representing the target operating system, target processor architecture, and the target triple formed by the combination of the target architecture, target system, and toolchain environment, respectively; skills correspond to the skill declaration field; source_roots correspond to the source code scope field; and managed_assets correspond to the managed assets field. Similarly, the above fields can also be parsed from the project status file or project configuration manifest.
[0033] S12. Determine the local skill root of the project based on the project root directory and skill root directory fields.
[0034] Specifically, when the skill root directory field is a relative path under the project root directory, the project's local skill root is determined based on the project root directory; when the skill root directory field is an absolute path, mapping path, or dependency package identifier, the location of the corresponding controlled skill is determined according to the project configuration. The project's local skill root can be located within the project or mapped to a read-only dependency package or controlled directory by the project configuration. The parsing result is written to the project status to ensure that subsequent skill verification and build entry points have a definite source.
[0035] To ensure the reliability of skill root locations, the identified project-local skill roots are normalized and their scope is checked to prevent skill roots from being resolved to uncontrolled directories outside the project's allowed scope, thereby reducing the risk of incorrect or non-existent skills being referenced by AI.
[0036] As a result, project-local skills migrate with the project catalog of industrial control applications, or are relocated on the migrated operating devices by the mapping relationship in the project configuration, so that the declared skills can be resolved to the corresponding skill description files, managed build entry points and target build contracts on different operating devices.
[0037] S13. Determine the declared skills based on the skill name and skill version constraints in the skill declaration field.
[0038] The skill declaration field is used to determine the set of skills that are allowed or required for the current project. The skill declaration field includes at least one of the following: skill name, skill version constraint, skill activation status, and a reference identifier used to associate with required managed assets or output requirements. First, the set of declared skills is determined based on the skill name; if the skill declaration field contains a version constraint, the corresponding version of the declared skills is selected from the declared skill set based on the version constraint; if the skill declaration field does not contain a version constraint, the declared skills are determined from the declared skill set according to the skill root position, declaration order, or priority in the project configuration.
[0039] The final declared skill D = (skill_name, skill_root, skill_file, required_assets, output_contract). Here, skill_name represents the name of the declared skill; skill_root points to the location of the skill, and if a skill version constraint exists, points to the location of the skill that satisfies that constraint; skill_file points to the skill description file, and if a skill version constraint exists, points to the skill description file that satisfies that constraint; required_assets describes the build entry points or runtime assets that the skill depends on; and output_contract describes the output requirements corresponding to the skill.
[0040] When the skill declaration field contains a skill version constraint, this constraint serves as a filter for determining the skill_root and skill_file, ensuring that the identified skill root and skill description file correspond to declared skills that meet the version requirements. Skills not included in the declared skill set are not considered available skills for the current project to prevent AI from inferring or referencing undeclared skills.
[0041] S14. Generate a target build contract based on the target platform field, which includes at least one of the target operating system, target processor architecture, target triplet, delivery file type, and target output location.
[0042] The target build contract is used to define the target platform and deliverables for industrial control applications. The target operating system, target processor architecture, and target triplet in the target platform field are used to form platform constraints, while the deliverable file type and target output location are used to form output constraints. The resulting target build contract includes at least one of the following: target operating system, target processor architecture, target triplet, deliverable file type, output file name, target output location, candidate output path, build mode, and runtime environment requirements.
[0043] Based on the target construction contract, the selection of the managed construction entry point, the invocation of the construction phase, and the verification of the construction output can be constrained, preventing AI from bypassing the target operating system, target processor architecture, or target triple requirements by modifying the construction entry point, construction parameters, or output path.
[0044] S15. Generate the AI's modifiable range based on the source code range field. The source code range field includes at least one of the following: source code directory, configuration file directory, test file directory, application resource directory, and allowed write file types.
[0045] The source code scope field determines the source code directory, configuration file directory, test file directory, application resource directory, and allowed file types that AI can write to. The AI modifiable scope, generated from the source code scope field, limits the file write boundaries for AI during business source code implementation, configuration supplementation, and test generation. Simultaneously, the AI modifiable scope excludes managed build entry points and their corresponding managed build scripts, managed runtime assets, target build contract files, and build-related files marked as prohibited from writing. Therefore, the objects AI can write to are limited to application implementation content, excluding managed entry points and key assets used for target platform building.
[0046] S16. Generate the scope of managed assets based on the managed asset field. The managed asset field includes at least one of the following: managed build entry directory, managed runtime asset directory, build-related file directory, project runtime area directory, and prohibited write path.
[0047] The Managed Assets field is used to determine the scope of assets that need to be managed, isolated, protected, or audited by the system. Specifically, the Managed Build Entry Directory determines the scope of build scripts, build command entry points, or build task files; the Managed Runtime Asset Directory determines the scope of runtime startup files, runtime resources, or runtime dependencies; the Build-Related Files Directory determines the scope of build configurations, build templates, or build constraint files; the Project Runtime Area Directory determines the target area for deploying, copying, or running managed build entry points; and the Prohibited Write Paths field determines paths that must not be created, modified, or deleted during the AI implementation phase.
[0048] S2. Perform a validity check on the skill description files corresponding to the declared skills in the skill locations determined by the project's local skill roots or mapped by the project configuration, and parse the managed build entry and entry constraint information from the skill description files that pass the validity check.
[0049] In this embodiment, by validating the skill description file, the AI can be prevented from referencing non-existent skills, skills in the wrong location, or skills with incomplete structures. By parsing the managed build entry from the validated skill description file, the build entry can be derived from the project's local skills or the controlled skill location mapped by the project configuration, rather than being temporarily generated by the AI.
[0050] Furthermore, such as Figure 3 As shown, step S2 includes: S21. Based on the declared skill name and version constraints, determine the skill directory corresponding to the declared skill in the project's local skill root or in the skill location mapped by the project configuration.
[0051] Specifically, based on the identified declared skills, the corresponding skill directory is searched under the project's local skill root. If a skill location mapping relationship is set in the project configuration, the corresponding skill directory is searched in the controlled skill location according to the mapping relationship. For declared skills with version constraints, the skill directory must also match the version requirements; for declared skills without version constraints, the corresponding skill directory is determined according to the skill root location, declaration order, or priority in the project configuration.
[0052] S22. Check if a skill description file exists in the skill catalog.
[0053] Skill description files are files in the skill directory used to declare skill capabilities and managed assets, including SKILL.md or equivalent skill description files. During the check, it is confirmed that the skill description file exists in the skill directory corresponding to the declared skill and can be read, to avoid proceeding to the subsequent AI code generation stage in the event of a missing skill description file. In one embodiment, the existence of a skill description file for a declared skill can be represented as: exists(project / .opencode / skills / s / SKILL.md), where s represents the declared skill, and exists(project / .opencode / skills / s / SKILL.md) indicates that the declared skill s has a skill description file in the project's local skill root directory.
[0054] S23. If a skill description file exists, perform a validity check including path range validation, declaration matching validation, format validation, and field integrity validation.
[0055] Among them, path range verification is used to confirm that the skill description file is not separated from the controlled skill location of the project's local skill root or the project configuration mapping; declaration matching verification is used to confirm that the skill name in the skill description file and the version information when version constraints exist are consistent with the declared skill; format verification is used to confirm that the skill description file can be parsed; field integrity verification is used to confirm that the skill description file contains at least the managed build entry description field and the entry constraint field.
[0056] In format validation, the parsability of a skill description file can be represented as: parseable(SKILL.md). Here, parseable(SKILL.md) indicates that the skill description file has a parsable format.
[0057] In the field integrity validation, the managed build entry description field indicates the path, type, or reference information of the managed build entry; the entry constraint field describes the target platform, output contract, operating conditions, required assets, and prohibited modification requirements applicable to the entry. Through the above validation, only skill description files whose source is within the controlled scope and meet the requirements of declaration matching, format parsability, and field integrity are allowed to enter the parsing process.
[0058] S24. If the skill description file does not exist or fails the validity check, diagnostic information will be generated and entry into the AI code generation stage will be prevented.
[0059] When a skill description file is missing, the path is out of bounds, the format is unparseable, it does not match the declared skill, the version does not meet the requirements, or the managed build entry description field or entry constraint field is missing, skill anomaly diagnostic information is generated. The diagnostic information may include the declared skill name, the expected skill directory, the expected skill description file path, the cause of the detected anomaly, and remediation suggestions. At this point, AI is not allowed to infer skill behavior out of thin air, nor is it allowed to enter the AI code generation stage, thus preventing AI from continuing to generate code based on non-existent or incorrect skills.
[0060] S25. When the skill description file passes the validity check, parse the managed build entry description field in the skill description file to directly obtain the managed build entry, or obtain the entry reference information and determine the managed build entry based on the entry reference information.
[0061] When the managed build entry description field directly specifies the source path, the managed build entry is determined based on that source path. When the managed build entry description field specifies entry reference information, the managed build entry is located in the skill directory, the project's local skill root, or the controlled skill location mapped in the project configuration, based on the entry reference information. Managed build entries include at least one of the following: build script, build command entry, build task file, build tool package file, configuration file used to trigger the target platform build, and target platform build startup file.
[0062] When determining the managed build entry point, the entry path is standardized and confirmed to originate from the declared skill corresponding to a skill description file that has passed legality verification. Therefore, the build entry point originates from a verified local skill in the project or a controlled skill location mapped by the project configuration, rather than being temporarily generated or replaced by AI in the source code area.
[0063] S26. Parse the entry constraint field in the skill description file to obtain at least one of the following: target construction contract, output contract, required construction assets, operational constraints, and prohibition of modification constraints, in order to form entry constraint information.
[0064] Entry constraints are used to limit the usage conditions and subsequent protection methods of the managed build entry. The target build contract describes the target operating system, target processor architecture, target triplet, or target platform requirements applicable to the managed build entry; the output contract describes the delivery file type, output file name, target output location, or candidate output path; the required build assets describe the dependency files, templates, runtime files, or other managed assets that the build entry depends on; the runtime constraints describe the runtime environment, toolchain, or dependency conditions required for the execution of the build entry; and the prohibition on modification constraints describe that the managed build entry, managed runtime assets, or build-related files must not be created, modified, deleted, or overwritten during the AI implementation phase.
[0065] In another embodiment, domain constraints are also parsed from the skill description file. Domain constraints are used to describe the industrial control domain rules, operational boundaries, or business generation constraints corresponding to the declared skill, and serve as prompt boundaries or verification criteria during the AI code generation phase.
[0066] S3. Based on the entry constraint information, deploy the managed build entry to the project runtime environment, configure anti-tampering attributes or anti-tampering identifiers for the deployed managed build entry, and establish the binding relationship between the managed build entry, the declared skills, and the target build contract.
[0067] In this embodiment, the managed build entry point is deployed to the project runtime environment based on the entry point constraint information. The deployed managed build entry point is then configured with status recording and anti-tampering measures to ensure it is recognized as a managed build asset in the project or build state. By establishing a binding relationship between the managed build entry point, declared skills, and target build contract, a basis is provided for subsequent pre-build anti-tampering verification and binding relationship consistency verification.
[0068] Furthermore, such as Figure 4 As shown, step S3 includes: S31. Determine the source path or entry reference information of the managed build entry in the declaration skill that has passed the legality verification, and determine the target location of the managed build entry in the project runtime environment based on the entry constraint information and in conjunction with the project configuration or project runtime environment.
[0069] The target location is determined based on the deployment requirements in the entry constraint information, and in conjunction with the project runtime directory, managed build entry directory, or the build workspace of the project runtime environment in the project configuration.
[0070] S32. Based on the source path or entry reference information, copy, synchronize, or mount the managed build entry to the target location in the project runtime environment.
[0071] During deployment, the managed build entry corresponding to the source path or entry reference information is deployed to the target location according to the requirements indicated by the entry constraint information. When using the copy method, the managed build entry is written to the target location in the project runtime environment; when using the synchronization method, the managed build entry and its associated files are synchronized to the target location; when using the read-only mount method, the managed build entry is mapped to the target location in read-only mode. If the entry constraint information also indicates associated build assets, the corresponding assets are deployed to the managed area in the project runtime environment.
[0072] S33. After the managed build entry point is deployed, record the entry point deployment information of the managed build entry point. The entry point deployment information includes at least one of the following: source skill, source path, deployment location, deployment time, and entry point integrity information.
[0073] Among them, the source skill is used to characterize the declaration skill to which the managed build entry belongs; the source path is used to characterize the original location of the managed build entry in the declaration skill; the deployment location is used to characterize the target location of the managed build entry in the project runtime environment; the deployment time is used to characterize the time when the managed build entry completes copying, synchronization or mounting; the entry integrity information includes at least one of the following: file size, hash value, signature digest and version information.
[0074] S34. Configure anti-tampering attributes or anti-tampering identifiers for the managed build entry point to complete the deployment. The anti-tampering attributes or anti-tampering identifiers include at least one of the following: read-only attributes, hash records, signature information, access control information, container read-only mount status, or managed asset identifiers.
[0075] The aforementioned read-only attributes, access control information, or container read-only mount status are used to restrict the managed build entry from being written to, deleted from, or overwritten; hash records and signature information are used to characterize the content integrity or source credibility of the managed build entry; managed asset identifiers are used to mark the entry as a managed build asset in the project status or build status.
[0076] S35. Write the managed build entry, declared skills, entry deployment information, tamper-proof attributes or tamper-proof identifiers, and target build contract into the project status or build status.
[0077] After being written to the project or build status, the deployment location, source skill, integrity information, tamper-proof attributes or tamper-proof identifier, target build contract, and output contract of the managed build entry are recorded. This means the managed build entry is no longer treated as a regular project file but is managed as a managed build asset. The corresponding managed build asset record is A=(asset_path, source_skill, copied_at, read_only, hash, target_contract). Here, asset_path represents the deployment location of the managed build entry in the project runtime environment, source_skill represents the source skill, copied_at represents the deployment time, read_only represents the read-only attribute or read-only mount status, hash represents the hash record, and target_contract represents the target build contract bound to the managed build entry.
[0078] S36. Based on the written project status or build status, establish the binding relationship between the managed build entry point, declared skills, and target build contract.
[0079] This binding relationship is used to record the source correspondence between the managed build entry and the declared skill, as well as the contract correspondence between the managed build entry and the target build contract, and can be associated with entry integrity information, anti-tampering attributes, or anti-tampering identifiers.
[0080] S4. Generate AI modification boundaries based on the AI modifiable scope and the scope of managed assets, and constrain the file writing scope of the AI code generation stage according to the AI modification boundaries, so that the managed build entry point is excluded from the file writing scope.
[0081] In this embodiment, the AI modification boundary is used to limit the scope of files that can be created, modified, or overwritten during the AI code generation phase. By distinguishing the scope that AI can modify from the scope of managed assets, AI can only act on objects that are allowed to be modified, such as business source code, configuration supplements, test files, or application resources, without performing write operations on managed build entry points, managed running assets, build-related files, and their anti-tampering identifiers.
[0082] Furthermore, such as Figure 5 As shown, step S4 includes: S41. Determine the set of writable paths and / or the set of writable file types that are allowed to be written during the AI code generation stage, based on the scope of AI modification.
[0083] S42. Determine the set of managed paths and / or the set of managed file types that are prohibited from being written during the AI code generation phase, based on the scope of managed assets.
[0084] S43. Detect conflicts between the set of writable paths and / or the set of writable file types and the set of managed paths and / or the set of managed file types, and when conflicts exist, exclude the set of managed paths and / or the set of managed file types from the set of writable paths and / or the set of writable file types to generate AI modification boundaries.
[0085] When generating AI modification boundaries, the system detects path inclusion relationships, path overlap relationships, file type overlap relationships, and managed build entry identifiers. If a path belongs to both the writable path set and the managed path set, or a file type belongs to both the writable file type set and the managed file type set, the managed asset scope takes precedence, and the corresponding path or file type is excluded from the writable scope.
[0086] S44. Generate boundary constraint information for the AI code generation stage based on the AI modified boundary. The boundary constraint information includes at least one of the following: allowed write path, prohibited write path, allowed write file type, prohibited write file type, and managed build entry identifier.
[0087] Specifically, the allowed write paths and allowed write file types indicate the target range that the AI can write to; the prohibited write paths, prohibited write file types, and managed build entry identifier indicate the target range that the AI must not write to, overwrite, or replace. Boundary constraint information is also written to at least one of the following: the cue context during the AI code generation phase, the file system sandbox configuration, or the write agent rules, to constrain the file write range before the AI-generated content is written to disk.
[0088] S45. During the AI code generation phase, the target path and / or target file type of the file write request are verified based on boundary constraint information.
[0089] When initiating file creation, modification, overwriting, or replacement requests during the AI code generation phase, the target path and / or target file type are validated based on boundary constraint information. Validation includes whether the target path is a writable path, whether it falls into a prohibited or managed path, whether the target file type is a writable file type, whether it is a prohibited file type, and whether the target path points to a managed build entry point.
[0090] S46. When the target path of a file write request is within the scope of a managed asset or points to a managed build entry point, or when the target file type is a prohibited write file type, refuse to execute the file write request and output boundary violation diagnostic information.
[0091] Boundary violation diagnostic information includes at least one of the following: the target path of the file write request, the target file type, the triggered write prohibition rule, the corresponding managed asset or managed build entry identifier, and the reason for rejection. By rejecting the file write request, AI is prevented from creating, modifying, overwriting, or replacing managed build entry points, build scripts, managed runtime assets, or build-related files during the code generation phase.
[0092] S47. When the target path and / or target file type of the file write request meet the corresponding allowed conditions in the AI modification boundary, and the target path is not located within the managed asset scope, does not point to the managed build entry point, and the target file type is not a prohibited file type, the file write request is allowed to be executed.
[0093] When a file write request is allowed, the AI write object is limited to the application implementation content, configuration supplements, test content, or application resource content that the AI modification boundary allows. The managed build entry and related managed assets are not created, modified, overwritten, or replaced by AI.
[0094] S5. Before building the target platform, perform anti-tampering verification and binding relationship consistency verification on the managed building entry with anti-tampering attributes or anti-tampering identifiers.
[0095] In this embodiment, the managed build entry is validated before the target platform is built to confirm that it retains its managed state after deployment and remains consistent with the declared skills and the target build contract. This pre-build validation prevents build entries that have been modified, replaced, or de-managed from being used in the target platform build.
[0096] Furthermore, such as Figure 6 As shown, step S5 includes: S51. Before building the target platform, read the managed build entry from the project runtime environment and read the anti-tampering attribute or anti-tampering identifier corresponding to the managed build entry.
[0097] S52. Perform anti-tampering verification on the managed construction entry based on the anti-tampering attribute or anti-tampering identifier. The anti-tampering verification includes at least one of the following: whether the managed construction entry is kept in a read-only state, whether the hash value is consistent with the record value, whether the signature information matches the pre-stored signature information, whether the access control information is consistent with the record value, whether the container read-only mount state is consistent with the record state, and whether the managed asset identifier exists.
[0098] In the anti-tampering verification target construction contract, if the read-only state of the managed construction entry is lifted, the hash value changes, the signature information does not match, the access control information is changed, the container read-only mount state becomes invalid, or the managed asset identifier is missing, the managed construction entry is determined to have failed the anti-tampering verification.
[0099] S53, Read the binding relationship between the managed build entry, declared skills, and target build contract.
[0100] S54. Perform a binding relationship consistency check on the managed build entry based on the binding relationship. The binding relationship consistency check includes checking whether at least one of the following recorded in the binding relationship—source skill, source path, deployment location, entry integrity information, anti-tampering attribute or anti-tampering identifier, and target build contract—is consistent with the current managed build entry, declared skill, and target build contract.
[0101] In the binding relationship consistency check, if the source skill, source path, deployment location, entry integrity information, anti-tampering attribute or anti-tampering identifier, target operating system, target processor architecture, target triplet, output contract or target output location corresponding to the current managed build entry are inconsistent with the binding relationship recorded in the project status or build status, then the binding relationship consistency check is determined to have failed.
[0102] S55. When both the anti-tampering verification and the binding relationship consistency verification pass, the target platform construction is allowed; when either the anti-tampering verification or the binding relationship consistency verification fails, the target platform construction is stopped, and abnormal information at the construction entry point is recorded.
[0103] Among them, abnormal information about the build entry point includes at least one of the following: missing build entry point, build entry point rewritten, inconsistent build entry point source, invalid anti-tampering attribute, missing anti-tampering identifier, or inconsistent target build contract.
[0104] S6. After the anti-tampering verification and binding relationship consistency verification pass, the managed construction entry is called to execute the target platform construction for the industrial control application.
[0105] In this embodiment, the target platform construction is only executed after the managed construction entry point passes the pre-build verification. The entry point called during the construction process is the deployed and managed construction entry point, rather than the construction entry point generated, replaced, or rewritten during the AI code generation stage. This ensures that the industrial control application completes the target platform delivery in accordance with the target construction contract.
[0106] Furthermore, such as Figure 7 As shown, step S6 includes: S61. After the anti-tampering verification and binding relationship consistency verification are both passed, read the target construction contract and provide the target construction contract to the managed construction entry.
[0107] S62. Call the managed build entry to perform target platform construction for industrial control applications, so that the build process generates target platform outputs according to at least one of the target operating system, target processor architecture, target triplet, delivery file type and target output location in the target build contract.
[0108] When the target platform is built, the managed build entry point calls the corresponding build command, build script, build task file or target platform build startup file according to the target build contract, and performs build processing on the source code, configuration or resource files of the industrial control application to generate outputs that match the target platform.
[0109] S63. During the target platform construction process, it is prohibited to use the build entry point generated, replaced, or rewritten by the AI code generation stage as the build entry point.
[0110] During the target platform construction process, only managed build entry points that have passed anti-tampering verification and binding relationship consistency verification are allowed to be called. If it is detected that the entry point to be called is not recorded as a managed build entry point, or that it originates from the AI code generation stage, then that entry point will not be used for the target platform construction.
[0111] S64. After the target platform is constructed, determine the candidate output position according to the entry constraint information or the target construction contract, and obtain the target platform output of industrial control application from the candidate output position.
[0112] The candidate output location includes at least one of the following: the target output location specified in the target build contract, the output directory declared in the entry constraint information, the output path recorded in the build status, or the candidate output path generated by the managed build entry. The target platform output obtained based on the candidate output location includes at least one of the following: executable file, firmware file, image file, library file, configuration package, or other delivery file.
[0113] S65. Perform output contract verification on the target platform output, wherein the output contract verification includes verifying at least one of the following: output path, output format, target processor architecture, target operating system, file integrity, and delivery file type.
[0114] In the output contract verification, it is determined whether the target platform output is located in the output position allowed by the target construction contract or entry constraint information, whether the output format and delivery file type meet the output contract, whether the target processor architecture, target operating system or target triple corresponding to the output is consistent with the target construction contract, and at least one of the hash value, signature digest, file size or other integrity information of the output is verified.
[0115] S66. Generate a build summary, which includes at least one of the following: build entry source, entry integrity information, anti-tampering verification result, binding relationship consistency verification result, target build contract, output path, output contract verification result, and build entry exception information when there is a build entry exception.
[0116] The build summary records the key processes and results of this target platform build. In addition, the build summary may include at least one of the following: build entry type, build entry source skill, build entry hash, target triple, output candidate path, skill version number, and dependency snapshot identifier. The skill version number represents the declared skill version corresponding to the managed build entry, and the dependency snapshot identifier represents the managed dependencies or runtime asset snapshots used during the build.
[0117] Furthermore, embodiments of the present invention provide a project-local skill constraint and build entry anti-tampering system for industrial control applications, comprising: a project configuration reading module, used to read the project configuration of the industrial control application to obtain the project-local skill root, declared skills, target build contract, AI-modifiable scope, and managed asset scope; a declared skill verification module, used to perform legality verification on the skill description files corresponding to the declared skills in the skill locations determined by the project-local skill root or mapped by the project configuration, and to parse the managed build entry and entry constraint information from the skill description files that pass the legality verification; and a managed entry deployment module, used to deploy the managed build entry to the project runtime environment according to the entry constraint information, and to perform management on the deployed managed entry. The system configures anti-tampering attributes or anti-tampering identifiers for the construction entry point and establishes a binding relationship between the managed construction entry point, declared skills, and target construction contract. The AI modification boundary control module generates AI modification boundaries based on the AI modifiable scope and managed asset scope, and constrains the file writing scope during the AI code generation stage according to the AI modification boundaries, excluding the managed construction entry point from the file writing scope. The construction entry point verification module performs anti-tampering verification and binding relationship consistency verification on managed construction entry points with anti-tampering attributes or anti-tampering identifiers before target platform construction. The target platform construction module, after passing the anti-tampering verification and binding relationship consistency verification, calls the managed construction entry point to execute the target platform construction for the industrial control application.
[0118] like Figure 8 As shown, the project configuration reading module, declaration skill verification module, managed entry deployment module, AI modification boundary control module, build entry verification module, and target platform building module work together in sequence to form a continuous processing chain for project metadata, local skill verification, managed asset deployment, prompt boundary generation, AI source code implementation, trusted building, and build summary auditing. Among them, project metadata corresponds to the reading and parsing results of project configuration, including target platform information, declared skill information, and source code scope information; local skill verification corresponds to the process of verifying the existence and legality of skill description files under the project's local skill root; managed asset deployment corresponds to parsing the managed build entry from the verified skills and deploying it to the project runtime environment, while configuring read-only attributes, hash records, and managed identifiers, and establishing a binding relationship between it and the declared skills and target build contracts; prompt boundary generation corresponds to generating AI modification boundaries based on the AI modifiable scope and managed asset scope, thereby dividing the AI modifiable area and the managed constraint area; AI source code implementation corresponds to generating and modifying business source code, configuration, and test files under the boundary constraints; trusted construction corresponds to calling the managed build entry after passing the pre-build verification and executing the target platform construction according to the target build contract; and build summary audit corresponds to recording the source of the build entry, the results of the build process, and the output contract verification results to form traceable build audit information.
[0119] Then, this embodiment of the invention provides a project local skill constraint and construction entry anti-tampering device for industrial control applications, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor performs the project local skill constraint and construction entry anti-tampering method for industrial control applications as described above.
[0120] Furthermore, embodiments of the present invention provide a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are executed by a processor, they implement the project local skill constraints and construction entry anti-tampering method described above for industrial control applications.
[0121] In summary, embodiments of the present invention provide a method, system, device, and medium for preventing tampering of project local skill constraints and construction entry points for industrial control applications. For example... Figure 9 As shown, this invention first reads the project configuration of the industrial control application to obtain the project's local skill root, declared skills, target construction contract, AI-modifiable scope, and managed asset scope. It then performs a validity check on the skill description files corresponding to the declared skills in the skill locations determined by the project's local skill root or mapped by the project configuration to determine whether there are any skill description files that meet the requirements. When a skill is missing or does not meet the verification requirements, it outputs diagnostic information including the skill name, expected path, and reason for the anomaly, and stops entering the AI code generation stage.
[0122] For skills that pass verification, the managed build entry and entry constraint information are parsed from the skill description file, and the managed build entry is deployed to the project runtime environment based on the entry constraint information. Anti-tampering measures such as read-only attributes, hash records, signature verification, access control or managed identifiers are configured for the deployed managed build entry. At the same time, the binding relationship between the managed build entry, the declared skill and the target build contract is established.
[0123] Subsequently, this invention generates AI modification boundaries based on the scope of AI modification and the scope of managed assets, so that the AI code generation stage can only modify application source code, configuration files or test files, but cannot generate, replace or rewrite managed build entry points, thus forming an AI source code implementation process under the constraint of the prompt boundary.
[0124] Before the target platform is built, the managed build entry points with anti-tampering attributes or anti-tampering identifiers undergo anti-tampering verification and binding relationship consistency verification. After all verifications pass, the managed build entry points are invoked to execute the target platform construction for the industrial control application, and the source of the build entry point, the target triplet, the output candidate path, and the output contract verification result are recorded, thus forming a traceable link between the build and audit results. This invention can reduce the risk of non-reproducibility caused by AI using non-existent skills or erroneous build entry points, enable the build rules of industrial control applications to migrate along with the project's local skills, and achieve auditability and reproducibility of the build process through build summaries.
[0125] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0126] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the claims should be interpreted to include both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0127] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, then this invention should also include these modifications and variations.
Claims
1. A method for local skill constraints and tamper-proof construction entry points for industrial control applications, characterized in that, include: Read the project configuration of the industrial control application to obtain the project's local skill roots, declared skills, target construction contracts, AI modifiable scope, and managed asset scope; Perform a validity check on the skill description files corresponding to the declared skills in the skill locations determined by the project's local skill roots or mapped by the project configuration, and parse the managed build entry and entry constraint information from the skill description files that pass the validity check; Based on the entry constraint information, the managed build entry is deployed to the project runtime environment. Anti-tampering attributes or anti-tampering identifiers are configured for the deployed managed build entry, and a binding relationship is established between the managed build entry, the declared skills, and the target build contract. The AI modification boundary is generated based on the AI modifiable scope and the scope of managed assets, and the file writing scope of the AI code generation stage is constrained according to the AI modification boundary, so that the managed build entry point is excluded from the file writing scope. Before building the target platform, perform anti-tampering verification and binding relationship consistency verification on the managed build entry points with anti-tampering attributes or anti-tampering identifiers. After the anti-tampering verification and binding relationship consistency verification pass, the managed construction entry is called to execute the target platform construction for the industrial control application.
2. The method for local skill constraints and anti-tampering of construction entry points for industrial control applications as described in claim 1, characterized in that, Read the project configuration of the industrial control application to obtain the project's local skill roots, declared skills, target construction contracts, AI-modifiable scope, and managed asset scope, including: Read and parse the project metadata file, project status file, or project configuration list of industrial control applications to obtain the project root directory, skill root directory field, skill declaration field, target platform field, source code scope field, and managed asset field; Determine the local skill root of the project based on the project root directory and skill root directory fields; The declared skills are determined based on the skill name and skill version constraints in the skill declaration field; Generate a target build contract based on the target platform field, which includes at least one of the following: target operating system, target processor architecture, target triple, delivery file type, and target output location; The AI-modifiable scope is generated based on the source code scope field, which includes at least one of the following: source code directory, configuration file directory, test file directory, application resource directory, and allowed write file types. The scope of managed assets is generated based on the managed asset fields, which include at least one of the following: managed build entry directory, managed runtime asset directory, build-related file directory, project runtime area directory, and prohibited write paths.
3. The method for local skill constraints and anti-tampering of construction entry points for industrial control applications as described in claim 1, characterized in that, The system performs a validity check on the skill description files corresponding to the declared skills in the skill locations determined by the project's local skill roots or mapped by the project configuration. It then parses the managed build entry point and entry point constraint information from the valid skill description files, including: Based on the declared skill name and version constraints, determine the skill directory corresponding to the declared skill in the project's local skill root or in the skill location mapped by the project configuration; Check if skill description files exist in the skill catalog; If a skill description file exists, a validity check is performed, including path range validation, declaration matching validation, format validation, and field integrity validation. If the skill description file does not exist or fails the validity check, diagnostic information will be generated and the process will be prevented from entering the AI code generation stage. When the skill description file passes the validity check, the managed build entry description field in the skill description file is parsed to directly obtain the managed build entry, or the entry reference information is obtained and the managed build entry is determined based on the entry reference information; Parse the entry constraint field in the skill description file to obtain at least one of the following: target construction contract, output contract, required construction assets, runtime constraints, and prohibition of modification constraints, in order to form entry constraint information.
4. The method for local skill constraints and anti-tampering of construction entry points for industrial control applications as described in claim 1, characterized in that, Based on the entry constraint information, the managed build entry point is deployed to the project runtime environment. Anti-tampering attributes or anti-tampering identifiers are configured for the deployed managed build entry point, and a binding relationship is established between the managed build entry point, declared skills, and target build contract, including: Determine the source path or entry reference information of the managed build entry point in the declared skill that has passed the legality verification, and determine the target location of the managed build entry point in the project runtime environment based on the entry constraint information and in conjunction with the project configuration or project runtime environment; Based on the source path or entry reference information, the managed build entry point is copied, synchronized, or mounted in read-only mode to the target location in the project runtime environment; After the managed build entry point is deployed, the entry point deployment information is recorded. The entry point deployment information includes at least one of the following: source skill, source path, deployment location, deployment time, and entry point integrity information. Configure anti-tamper attributes or anti-tamper identifiers for the managed build entry point to complete the deployment. The anti-tamper attributes or anti-tamper identifiers include at least one of the following: read-only attribute, hash record, signature information, access control information, container read-only mount status, or managed asset identifier. Write the managed build entry point, declared skills, entry point deployment information, tamper-proof attributes or tamper-proof identifiers, and target build contract into the project status or build status; Based on the project status or build status, establish the binding relationship between the managed build entry point, declared skills, and target build contract.
5. The method for local skill constraints and anti-tampering of construction entry points for industrial control applications as described in claim 1, characterized in that, Based on the AI's modifiable scope and the scope of managed assets, an AI modification boundary is generated. This boundary then constrains the file writing scope during the AI code generation phase, excluding the managed build entry point from the file writing scope. This includes: Determine the set of writable paths and / or the set of writable file types that are allowed to be written during the AI code generation phase based on the scope of AI modification. Determine the set of managed paths and / or the set of managed file types that are prohibited from being written during the AI code generation phase based on the scope of managed assets; Detect conflicts between the set of writable paths and / or the set of writable file types and the set of managed paths and / or the set of managed file types, and when conflicts exist, exclude the set of managed paths and / or the set of managed file types from the set of writable paths and / or the set of writable file types to generate AI modification boundaries; The boundary constraint information generated during the AI code generation stage is modified based on the AI boundary. The boundary constraint information includes at least one of the following: allowed write paths, prohibited write paths, allowed write file types, prohibited write file types, and managed build entry identifier. During the AI code generation phase, the target path and / or target file type of the file write request are verified based on boundary constraint information; When the target path of a file write request is within the scope of a managed asset or points to a managed build entry point, or when the target file type is a prohibited write file type, the file write request is rejected and boundary violation diagnostic information is output. The file write request is allowed to be executed when the target path and / or target file type of the file write request meet the corresponding allowed conditions in the AI modification boundary, and the target path is not located within the scope of managed assets, does not point to the managed build entry point, and the target file type is not a prohibited file type.
6. The method for local skill constraints and anti-tampering of construction entry points for industrial control applications as described in claim 1, characterized in that, Before building the target platform, perform anti-tampering verification and binding relationship consistency verification on managed build entry points with anti-tampering attributes or anti-tampering identifiers, including: Before building the target platform, read the managed build entry from the project runtime environment and read the anti-tampering attribute or anti-tampering identifier corresponding to the managed build entry; Based on the anti-tampering attribute or anti-tampering identifier, perform anti-tampering verification on the managed construction entry. The anti-tampering verification includes determining at least one of the following: whether the managed construction entry is kept in a read-only state, whether the hash value is consistent with the record value, whether the signature information matches the pre-stored signature information, whether the access control information is consistent with the record value, whether the container read-only mount state is consistent with the record state, and whether the managed asset identifier exists. Read the binding relationships between the managed build entry point, declared skills, and target build contract; Perform a binding relationship consistency check on the managed build entry point based on the binding relationship. The binding relationship consistency check includes checking whether at least one of the following recorded in the binding relationship—source skill, source path, deployment location, entry point integrity information, anti-tampering attribute or anti-tampering identifier, and target build contract—is consistent with the current managed build entry point, declared skill, and target build contract. When both the anti-tampering verification and the binding relationship consistency verification pass, the target platform construction is allowed; If the anti-tampering verification or binding relationship consistency verification fails, stop the target platform construction and record the abnormal information at the construction entry point.
7. The method for local skill constraints and anti-tampering of construction entry points for industrial control applications as described in claim 6, characterized in that, After the anti-tampering verification and binding relationship consistency verification pass, the managed build entry is invoked to execute the target platform construction for the industrial control application, including: After both the anti-tampering verification and the binding relationship consistency verification pass, the target construction contract is read and provided to the managed construction entry point; The managed build entry is invoked to perform target platform construction for industrial control applications, so that the build process generates target platform outputs according to at least one of the target operating system, target processor architecture, target triplet, delivery file type and target output location in the target build contract; During the target platform building process, it is prohibited to use the build entry point generated, replaced, or rewritten by the AI code generation stage as the build entry point; After the target platform is constructed, candidate output locations are determined based on the entry constraint information or the target construction contract, and the target platform outputs for industrial control applications are obtained from the candidate output locations. Perform output contract verification on the target platform outputs, wherein the output contract verification includes verifying at least one of the following: output path, output format, target processor architecture, target operating system, file integrity, and delivery file type; Generate a build summary, which includes at least one of the following: build entry source, entry integrity information, anti-tampering verification result, binding relationship consistency verification result, target build contract, output path, output contract verification result, and build entry exception information when there is a build entry exception.
8. A project-based local skill constraints and tamper-proof construction entry system for industrial control applications, characterized in that, include: The project configuration reading module is used to read the project configuration of industrial control applications and obtain the project's local skill roots, declared skills, target construction contracts, AI modifiable scope, and managed asset scope. The declared skill verification module is used to verify the legality of the skill description files corresponding to the declared skills in the skill locations determined by the project's local skill roots or mapped by the project configuration, and to parse the managed build entry and entry constraint information from the skill description files that pass the legality verification. The managed entry deployment module is used to deploy managed build entry points to the project runtime environment based on entry constraint information, configure anti-tampering attributes or anti-tampering identifiers for the deployed managed build entry points, and establish the binding relationship between managed build entry points, declared skills, and target build contracts. The AI modification boundary control module is used to generate AI modification boundaries based on the AI modifiable scope and the scope of managed assets, and to constrain the file writing scope of the AI code generation stage according to the AI modification boundaries, so that the managed build entry point is excluded from the file writing scope. The entry verification module is used to perform anti-tampering verification and binding relationship consistency verification on managed entry points with anti-tampering attributes or anti-tampering identifiers before building the target platform. The target platform construction module is used to call the managed construction entry to perform target platform construction for industrial control applications after the anti-tampering verification and binding relationship consistency verification have passed.
9. A project-based local skill constraints and tamper-proof construction entry device for industrial control applications, characterized in that, include: At least one processor; and memory that is communicatively connected to at least one processor; The memory stores instructions that can be executed by at least one processor. When the instructions are executed by at least one processor, the at least one processor performs the project local skill constraint and construction entry anti-tampering method for industrial control applications as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing computer-executable instructions thereon, characterized in that, When the computer-executable instructions are executed by the processor, they implement the project local skill constraints and construction entry anti-tampering method for industrial control applications as described in any one of claims 1 to 7.