Software code security protection method and system based on domestic platform

By obtaining the sensing data flow on the domestic platform and performing millisecond alignment, using reinforcement learning to analyze the device status and code execution paths, real-time security protection rules are generated, and real-time security protection problems of software code and mechanical equipment interaction under the domestic platform are solved, and adaptive and efficient security protection is achieved.

CN120234801BActive Publication Date: 2025-08-19CHINA COLOR BLUEPRINT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510724155.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-03
Publication Date
2025-08-19
Estimated Expiration
2045-06-03

AI Technical Summary

Technical Problem

The real-time security protection capability of software code and mechanical equipment interaction under the domestic platform is insufficient, and the existing static rule base cannot adapt to the dynamically changing equipment operation status, resulting in frequent misjudgment or misjudgment, lack of adaptive capabilities, and affecting the system operation efficiency.

Method used

By acquiring the sensing data flow, using the external clock synchronization module for millisecond alignment, combining the reinforcement learning mechanism in the memory isolation environment to analyze the operation event sequence, generate real-time security protection rules, and dynamically bind them to the kernel layer to form a closed-loop security protection mechanism.

Benefits of technology

It realizes accurate perception of the operating status of mechanical equipment, dynamically identify abnormal execution paths, and generates protection strategies that adapt to complex working conditions to ensure the system maintains optimal operating efficiency while ensuring safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120234801B_ABST
    Figure CN120234801B_ABST
Patent Text Reader

Abstract

The present application provides a software code security protection method and system based on a domestic platform, wherein the method includes: through real-time acquisition of sensor data streams interacting with external mechanical equipment, using an independent clock synchronization module to align device status parameters with the execution nodes of software code instructions at the millisecond level, generating an operation event sequence containing instructions, sensor data and timestamps; in a memory isolation environment, using a reinforcement learning mechanism to analyze sequence dynamic patterns, and constructing real-time security protection rules that reflect the correlation between instruction execution paths and hardware behaviors; through dynamic binding and updating rules of kernel layer environment variables, forming a closed-loop security protection mechanism. The present application improves the real-time security protection capabilities of software code interacting with mechanical equipment on a domestic platform.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of industrial automation control and embedded system security technology, and in particular to a software code security protection method and system based on a domestic platform. Background Art

[0002] In areas such as industrial automation and intelligent manufacturing, domestically produced platforms need to interact with mechanical equipment in real time to ensure the security and reliability of software code execution. Due to the complex operating environment of equipment, software code may cause mechanical failures due to abnormal instructions or external interference.

[0003] Currently, some solutions use a static rule base combined with hardware anomaly detection technology to determine software execution compliance based on a predefined whitelist of code behavior and sensor thresholds. When code behavior or sensor data is detected outside of a preset range, the system triggers an interrupt or alarm, suspending execution of the anomalous process.

[0004] The static rule base cannot adapt to the dynamically changing operating status of the equipment, resulting in frequent misjudgments or missed judgments; at the same time, relying on fixed thresholds makes it difficult to cope with real-time adjustment needs under complex working conditions, and the protection strategy lacks adaptive capabilities, affecting the system's operating efficiency. Summary of the Invention

[0005] The present application provides a software code security protection method and system based on a domestic platform, which is used to solve the problem of poor real-time security protection capability of the interaction between software code and mechanical equipment under the domestic platform in the existing technology.

[0006] In a first aspect, the present application provides a software code security protection method based on a domestic platform, comprising:

[0007] During the execution of the software code of the localized platform, a sensor data stream generated by the interaction between the localized platform and the external mechanical device is obtained, wherein the sensor data in the sensor data stream includes device state parameters associated with the execution of the software code;

[0008] In the external clock synchronization module of the localized platform, the device state parameters are time-aligned with the execution nodes of the software code instructions to generate an operation event sequence, where the software code instructions are function calls, system interface requests, or machine-level operation instructions captured during the operation of the localized platform;

[0009] Through the memory isolation operating environment of the domestic platform, a reinforcement learning mechanism is used to analyze the dynamic pattern of the operation event sequence to generate real-time security protection rules for the software code execution path. The software code execution path is the instruction execution order and branch structure restored from the operation event sequence;

[0010] The real-time security protection rules are dynamically bound to the kernel layer of the domestic platform to dynamically update the real-time security protection rules, and the updated security protection rules are fed back to the kernel layer to form a closed-loop security protection mechanism.

[0011] Optionally, the memory isolation operating environment of the domestic platform is used to analyze the dynamic pattern of the operation event sequence using a reinforcement learning mechanism to generate real-time security protection rules for the software code execution path, including:

[0012] In the memory isolation operating environment of the domestic platform, the device state parameters in the operation event sequence are matched with the execution nodes of the software code instructions frame by frame to screen out continuous event segments corresponding to the software code execution path;

[0013] Extracting, based on the continuous event segments, relevance weights of different instruction nodes in the software code execution path, and constructing dynamic dependency relationships between the instruction nodes and the continuous event segments;

[0014] By using a reinforcement learning mechanism, the software code execution path is divided into multiple stages based on the dynamic dependency relationship;

[0015] In the multi-stage state division process, traversing the branch paths of each stage in the software code execution path to generate path credibility scores of the branch paths;

[0016] A real-time security protection rule is generated according to the path credibility score and the relevance weight.

[0017] Optionally, in the multi-stage state division process, traversing the branch paths of each stage in the software code execution path to generate path credibility scores of the branch paths includes:

[0018] Determining the execution flow of the software code execution path within each stage according to the starting instruction node and the ending instruction node of each stage in the multi-stage state division process;

[0019] In the execution flow, a branch path that conflicts with a change trend of a device state parameter in the dynamic dependency relationship is identified from the software code execution path, and marked as a branch path to be verified;

[0020] For each branch path to be verified, obtaining the measured values of the device state parameters corresponding to all instruction nodes in the branch path to be verified;

[0021] Comparing the measured value with the expected value of the device state parameter in the dynamic dependency relationship node by node;

[0022] According to the comparison result, the number of deviations between the measured value and the expected value is counted, and the influence factor of the number of deviations on the branch path to be verified is calculated in combination with the correlation weight;

[0023] The impact factor is weightedly superimposed on the timing density of the instruction nodes in the branch path to be verified to generate a path credibility score of the branch path to be verified.

[0024] Optionally, generating a real-time security protection rule according to the path credibility score and the relevance weight includes:

[0025] Sort the path credibility scores from high to low and determine the credibility threshold based on the score distribution density, where the score distribution density is the proportion of branch paths within the same score interval;

[0026] According to the credibility threshold, screening out branch paths whose path credibility scores are higher than the credibility threshold and whose relevance weights exceed a preset critical value, to generate a set of paths that are allowed to be executed;

[0027] In the set of allowed execution paths, assigning a dynamic permission level to each branch path according to the instruction node timing density and the relevance weight of the branch path;

[0028] Based on the dynamic permission level, real-time security protection rules are generated.

[0029] Optionally, generating real-time security protection rules based on the dynamic permission level includes:

[0030] generating a permission level mapping table according to a mapping relationship between the dynamic permission level and the process execution priority in the kernel layer;

[0031] Constructing a memory control policy set and a blocking condition set based on the boundary value of the memory access interval and the blocking instruction node pair in the kernel layer;

[0032] The permission level mapping table, the memory control policy set and the blocking condition set are encapsulated into a real-time security protection rule set in a preset format.

[0033] Optionally, in the external clock synchronization module of the localized platform, the device state parameter is time-aligned with the execution node of the software code instruction to generate an operation event sequence, including:

[0034] In the external clock synchronization module of the localization platform, the timestamp of the sensor data from the external mechanical equipment and the timestamp of the instruction execution of the localization platform are received respectively;

[0035] Calculating the offsets of the sensing data timestamp, the instruction execution timestamp and the global time reference respectively through the global time reference of the external clock synchronization module;

[0036] Using the global time base as an axis, within a preset time alignment tolerance range, one-to-one matching is performed between the data points of the device state parameters and the execution nodes of the software code instructions. When the offset difference between the timestamp of the sensor data and the timestamp of the instruction execution does not exceed the time alignment tolerance, the match is determined to be successful.

[0037] Binding and encapsulating the data point and the execution node corresponding to a successful match to generate an operation event unit;

[0038] All the operation event units are arranged in the order of the global time reference to form an operation event sequence.

[0039] Optionally, dynamically binding the real-time security protection rules to the kernel layer of the localized platform to dynamically update the real-time security protection rules includes:

[0040] A rule loading interface is pre-set in the kernel layer of the localized platform, and the permission level mapping table, memory control policy set and blocking condition set of the real-time security protection rule are registered as kernel environment variables through the rule loading interface;

[0041] Establishing a real-time monitoring channel between the kernel layer environment variables and the sensor data stream;

[0042] Comparing, through the real-time monitoring channel, the device status parameter to be updated with the sensor data threshold preset in the blocking condition set;

[0043] When the device status parameter to be updated exceeds the sensor data threshold, a rule update condition is triggered;

[0044] Based on the rule update conditions, the real-time security protection rules are dynamically updated.

[0045] In a second aspect, the present application provides a software code security protection system based on a domestic platform, including:

[0046] an acquisition module, configured to acquire, during the execution of the software code of the localized platform, a sensor data stream generated by the interaction between the localized platform and an external mechanical device, wherein the sensor data in the sensor data stream includes device state parameters associated with the execution of the software code;

[0047] an alignment module for time-aligning the device state parameters with the execution nodes of the software code instructions in the external clock synchronization module of the localized platform to generate an operation event sequence, wherein the software code instructions are function calls, system interface requests, or machine-level operation instructions captured during the operation of the localized platform;

[0048] An analysis module for analyzing the dynamic patterns of the operation event sequence using a reinforcement learning mechanism in the memory isolation operating environment of the domestic platform to generate real-time security protection rules for the software code execution path, where the software code execution path is the instruction execution sequence and branch structure restored from the operation event sequence;

[0049] An update module is used to dynamically bind the real-time security protection rules to the kernel layer of the domestic platform to dynamically update the real-time security protection rules, and feed back the updated security protection rules to the kernel layer to form a closed-loop security protection mechanism.

[0050] In a third aspect, the present application provides a computing device comprising a processor and a memory, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute any software code security protection method based on a domestic platform as described in the first aspect.

[0051] In a fourth aspect, the present application provides a computer storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, a software code security protection method based on a domestic platform as described in any one of the first aspects is implemented.

[0052] In the present application, a software code security protection method based on a domestic platform is provided, the method comprising: during the execution of the software code of the domestic platform, obtaining a sensor data stream generated by the interaction between the domestic platform and an external mechanical device, the sensor data in the sensor data stream including device status parameters associated with the software code execution process; in the external clock synchronization module of the domestic platform, time-aligning the device status parameters with the execution nodes of the software code instructions to generate an operation event sequence, the software code instructions being function calls, system interface requests or machine-level operation instructions captured during the operation of the domestic platform; through the memory isolation operating environment of the domestic platform, using a reinforcement learning mechanism to analyze the dynamic pattern of the operation event sequence, and generating real-time security protection rules for the software code execution path, the software code execution path being the instruction execution order and branch structure restored from the operation event sequence; dynamically binding the real-time security protection rules to the kernel layer of the domestic platform to dynamically update the real-time security protection rules, and feeding back the updated security protection rules to the kernel layer to form a closed-loop security protection mechanism.

[0053] The technical solution provided by this application has the following beneficial effects:

[0054] This application collects the operating status of mechanical equipment in real time, providing a hardware behavior data foundation for safety protection and ensuring that the protection system can perceive changes in the physical environment. Millisecond-level time alignment is achieved through an independent clock module, accurately establishing the causal relationship between code instructions and equipment status, and resolving the misjudgment problem caused by timing misalignment in traditional solutions. Reinforcement learning is used to dynamically model code-hardware interaction patterns in an isolated environment, automatically identifying abnormal execution paths and generating protection strategies that adapt to complex working conditions. Seamless hot loading of protection rules is achieved, and real-time optimization of rules is achieved through sensor data feedback, forming an adaptive protection closed loop of "monitoring-decision-execution."

[0055] Furthermore, this application also matches device status and instruction nodes frame by frame through a memory isolation environment, filters continuous event fragments and constructs dynamic dependencies, divides multi-stage execution path states based on reinforcement learning, and generates real-time protection rules by combining branch path credibility scores and correlation weights.

[0056] In addition, this solution breaks through the limitations of static rules and achieves accurate quantification of the impact weight of code instructions on hardware status; dynamically identifies and scores abnormal branch paths; and adjusts the priority of protection strategies according to real-time working conditions, so that the system maintains optimal operating efficiency while ensuring safety.

[0057] These and other aspects of the present application will become more readily apparent from the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0059] Figure 1 A flowchart of a software code security protection method based on a domestic platform provided in an embodiment of the present application;

[0060] Figure 2 A schematic diagram of the structure of a software code security protection system based on a domestic platform provided in an embodiment of the present application;

[0061] Figure 3 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0062] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0063] In some of the processes described in the specification and claims of this application and the above-mentioned figures, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this document or may be executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any order of execution. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to being different types.

[0064] Researchers have found that in scenarios where domestic platforms and mechanical equipment operate in collaboration, traditional protection methods have difficulty in achieving accurate correlation between software code execution and hardware status changes, and lack the ability to dynamically adjust protection strategies, leading to problems such as high false alarm rates and delayed responses. Based on this, a software code security protection method based on a domestic platform is provided. This method can achieve millisecond-level instruction-sensor data alignment through clock synchronization, use reinforcement learning to analyze the dynamic relationship between code execution paths and device status in a memory isolation environment, and establish kernel-level protection rules that can be updated in real time, forming a closed-loop security protection mechanism for software and hardware collaboration. The technical solution of this application can be applied to domestic platform application scenarios such as industrial automation and intelligent manufacturing that require high real-time security protection.

[0065] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.

[0066] Figure 1 A flowchart of a software code security protection method based on a domestic platform provided in an embodiment of the present application is as follows: Figure 1 As shown, the method includes:

[0067] Step 101: During the execution of the software code of the domestic platform, a sensor data stream generated by the interaction between the domestic platform and an external mechanical device is obtained, where the sensor data in the sensor data stream includes device state parameters associated with the software code execution process.

[0068] In this step, the sensor data stream represents the continuous monitoring data collected by sensors during the operation of the mechanical equipment, including physical quantities such as pressure and temperature. The equipment status parameters represent quantitative indicators of the mechanical equipment's operating status, such as specific parameter values such as motor speed and hydraulic pressure.

[0069] In an embodiment of the present application, various sensors deployed on mechanical equipment collect operating data in real time, and the analog signals output by the sensors are converted into digital signals to form a continuous sensor data stream, among which equipment status parameters associated with software control instructions are screened out, such as the speed data collected synchronously when executing motor control instructions. These parameters will be matched and aligned with subsequent software instructions.

[0070] For example, in a certain CNC machine tool control system, the speed signal is collected by an encoder installed on the spindle motor, and the cutting force data is obtained through a force sensor. When the system executes the "start spindle" command, the motor speed and cutting force at this time are recorded as the status parameters of the associated equipment. These data are transmitted to the data acquisition module of the domestic platform via the field bus.

[0071] Step 102: In the external clock synchronization module of the domestic platform, the device status parameters are time-aligned with the execution nodes of the software code instructions to generate an operation event sequence. The software code instructions are function calls, system interface requests or machine-level operation instructions captured during the operation of the domestic platform.

[0072] In this step, the external clock synchronization module represents a dedicated time synchronization unit independent of the system's master clock. The operation event sequence represents a chronologically ordered sequence of instructions and state data. Software code instructions refer to the actual instruction stream generated during the runtime of the domestic platform: the specific machine instructions or high-level language-based operation instructions (e.g., function calls, system API requests, memory read / write instructions) generated by software code (e.g., industrial control programs or embedded system code) executed on the domestic platform. These instructions are captured in real time by the domestic platform's runtime monitoring modules (e.g., debug interfaces, kernel hooks) and recorded along with their corresponding timestamps, forming an analyzable instruction sequence. An execution node is not simply a point in time; it is a combination of "instruction + context." The instruction itself refers to the specific operation currently being executed (e.g., "open a file" or "write data to a register"). The execution context includes the instruction's timing information (e.g., clock cycle number), hardware environment status (e.g., CPU register values, memory addresses), and associated mechanical sensor data (e.g., the real-time position of the robotic arm when the instruction is executed).

[0073] In an embodiment of the present application, an independent external clock synchronization module is used to assign a unified timestamp to the sensor data and instruction execution, and a time alignment algorithm is used to match the device status parameters with the corresponding software instruction execution nodes. When the time deviation between the two is within the allowable range, they are bound to generate an operation event unit containing the instruction content, status data and precise timestamp, which are arranged in chronological order to form a complete operation event sequence.

[0074] For example, continuing with the CNC machine tool example, the external clock module adds a synchronization timestamp to the "start spindle" instruction and the corresponding speed data. After alignment processing, an operation event unit containing the instruction code, speed value and time information is generated. The same processing is performed when the "feed cutting" instruction is executed, ultimately forming an ordered sequence containing multiple operation events.

[0075] Step 103: Through the memory isolation operating environment of the domestic platform, a reinforcement learning mechanism is used to analyze the dynamic pattern of the operation event sequence to generate real-time security protection rules for the software code execution path. The software code execution path is the instruction execution order and branch structure restored from the operation event sequence.

[0076] In this step, the memory isolation runtime environment represents a dedicated memory area isolated from the main system. The dynamic patterns of the operation event sequence refer to the regular correlations between software instruction execution and device state changes, discovered by analyzing time-aligned instruction-state data combinations. These patterns are derived from statistical learning and feature extraction of the execution order of instruction nodes in historical operation event sequences, the changing trends of device state parameters, and the temporal relationship between the two. Specifically, they manifest as quantifiable features such as typical device parameter change curves when executing specific instruction combinations and state mutations corresponding to abnormal instruction sequences. The software code execution path refers to the instruction execution process topology restored from the operation event sequence, including the main path for normal execution and subpaths generated by conditional branches. This is derived from analyzing the temporal relationships and jump logic of instruction nodes in the operation event sequence to reconstruct the complete code execution trajectory, including path branches corresponding to program structures such as sequential execution, loops, and conditional judgments. Real-time security protection rules are a set of security control policies generated based on dynamic analysis results and take immediate effect. These rules include specific rule entries such as a whitelist of allowed instruction paths, high-risk operation sequences to be blocked, and system permission configurations corresponding to different security levels. These rules are designed to dynamically adjust to changes in the operating environment.

[0077] In an embodiment of the present application, a sequence of operation events is loaded in an isolated memory area, and the correlation between the instruction execution mode and the device state change is analyzed through a reinforcement learning algorithm. The influence weight of different instruction nodes on the device state is calculated, and the multi-stage state is divided according to the strength of the correlation between each instruction in the execution path. The credibility of the branch path in each stage is evaluated, and finally a security protection rule containing an allowed execution path and a blocked path is generated.

[0078] For example, by analyzing the operational event sequence of a CNC machine tool, it was found that when the speed drops beyond the normal range after the "feed cutting" instruction, it is often accompanied by abnormal vibration. The system marks this execution path as high-risk. When the cutting force suddenly changes, the corresponding feed instruction branch is assessed as low-credibility, and a protection rule is generated to prohibit the execution of such abnormal paths.

[0079] Step 104: Dynamically bind the real-time security protection rules to the kernel layer of the domestic platform to dynamically update the real-time security protection rules, and feed back the updated security protection rules to the kernel layer to form a closed-loop security protection mechanism.

[0080] In this step, closed-loop security protection refers to a protection mechanism with feedback regulation capabilities. The kernel layer of a domestically produced platform refers to the core of the independently controllable operating system, encompassing fundamental functional modules such as process scheduling, memory management, and device drivers. It also provides low-level interfaces such as environment variable configuration and system call interception. In this solution, it specifically refers to the collection of core system components capable of receiving and executing security protection rules.

[0081] In an embodiment of the present application, the generated security protection rules are written into the environment variables of the kernel layer through the system interface, and the device status changes are monitored in real time. When abnormal fluctuations are detected, the rule update mechanism is triggered, the path credibility is re-evaluated and the protection strategy is adjusted. The updated rules take effect immediately to form a closed-loop control, ensuring that the protection strategy always matches the current device status.

[0082] For example, when the vibration sensor of the CNC machine tool spindle detects an abnormal signal, the system immediately updates the protection rules to limit the feed rate parameters that may cause vibration, and automatically lifts the limit after the vibration returns to normal. The entire process does not require human intervention.

[0083] This method precisely synchronizes device status with software instructions, establishes a dynamic correlation model between the two, and implements adaptive safety protection based on actual working conditions. It effectively prevents equipment failures caused by code anomalies, improves the reliability and safety of the control system under the domestic platform, and ensures the real-time and accuracy of the protection strategy through a closed-loop update mechanism.

[0084] In order to solve the dynamic security protection problem when software code and mechanical equipment are running in coordination on a domestic platform, in some embodiments, step 103: using the memory isolation operating environment of the domestic platform, a reinforcement learning mechanism is used to analyze the dynamic pattern of the operation event sequence to generate real-time security protection rules for the software code execution path, including:

[0085] Step 201: In the memory isolation operating environment of the domestic platform, the device state parameters in the operation event sequence are matched with the execution nodes of the software code instructions frame by frame to filter out continuous event segments corresponding to the software code execution path.

[0086] In step 201, the device state parameters in the sensor data stream and the device state parameters in the operation event sequence represent the same data entity at different processing stages. The device state parameters in the sensor data stream represent the raw physical quantity data stream directly acquired from mechanical sensors (such as pressure and displacement sensors). These are continuous signals not aligned with code execution time (e.g., 1000 pressure samples per second); they are annotated only with the sensor's own timestamp (not associated with software instructions). The device state parameters in the operation event sequence represent parameter values bound to the execution nodes of software code instructions after clock synchronization of the raw sensor data stream. These are discrete parameter values aligned with the instruction execution time at the millisecond level (e.g., the torque sensor reading at the moment a "motor drive" instruction is executed); they also include additional instruction context (e.g., associated code functions and memory addresses). The continuous quantity representation is determined by a preset time window or number of instruction nodes (e.g., data within 10 consecutive instruction nodes or 200 milliseconds). The specific value is dynamically adjusted based on the scenario and is not fixed. Continuous event segments refer to continuous intervals in which device state parameters and instruction nodes are closely related in time, which are selected from the operation event sequence. They are used to analyze the dynamic dependency between code execution and hardware status.

[0087] In an embodiment of the present application, after the system loads the operation event sequence in the memory isolation area, it uses sliding window technology to intercept data segments according to a fixed time length, and uses a matching algorithm to screen out continuous intervals in which device state changes are highly correlated with instruction execution, eliminate noise interference data, and obtain continuous event segments that reflect the actual control process.

[0088] Step 202: Based on the continuous event segments, extract the relevance weights of different instruction nodes in the software code execution path, and construct a dynamic dependency relationship between the instruction nodes and the continuous event segments.

[0089] In step 202, the instruction node represents the target for further analysis of the execution node, specifically the instruction execution units identified in the continuous event segment that are strongly correlated with device state parameters. New attributes include: relevance weights assigned through dynamic dependency analysis (e.g., the strength of an instruction's impact on sensor values); and path branch attributes in multi-stage state partitioning (e.g., whether an exception handling branch is triggered). This is used to construct the protection rule generation logic for the code execution path. An execution node represents the smallest logical unit that binds a software code instruction to its execution timestamp and associated mechanical sensor data (device state parameters) during the operation of a domestic platform. Components include: software code instructions (e.g., function calls, machine instructions); precise timestamps after clock synchronization; and device state parameters corresponding to instruction execution (e.g., sensor readings). This is used to establish instruction-time-hardware state relationships within the operational event sequence. Execution nodes focus on describing raw relevance during the data collection and alignment phase; instruction nodes focus on describing the analysis target during the rule generation phase. These two represent the same entity at different technical stages. The relevance weight is a parameter that quantifies the degree of influence of an instruction node on the device state. Dynamic dependencies characterize the strength of the causal relationship between instruction execution and state changes.

[0090] In an embodiment of the present application, time-frequency analysis and correlation calculation are performed on each continuous event segment, and the degree of deviation of the device state parameters after the execution of each instruction node is counted. The weight value in the range of 0-1 is obtained through normalization processing, and a mapping relationship matrix of instruction-state changes is established to form a dynamic dependency relationship model.

[0091] Step 203: Using a reinforcement learning mechanism, the software code execution path is divided into multiple stages based on the dynamic dependency relationship.

[0092] In step 203, multi-stage state division refers to dividing the code execution process into several state intervals with different characteristics based on dynamic dependencies. The basis for dividing each stage is the cumulative offset of the device state parameters of the continuous event segments within a preset time window.

[0093] In an embodiment of the present application, the reinforcement learning model analyzes the dynamic dependency matrix, identifies state mutation points and behavior pattern turning points, and divides the execution path into different stages such as initialization, stable operation, and exception handling based on these key nodes. Each stage contains a specific instruction combination and state change characteristics.

[0094] Step 204: During the multi-stage state division process, the branch paths of each stage in the software code execution path are traversed to generate path credibility scores of the branch paths.

[0095] In step 204, the branch paths within each stage of the software code execution path refer to the different execution flows generated by the program control logic within each stage after the multi-stage state division. These include jump paths triggered by conditional statements, exception handling branches, and repeated execution paths generated by loop structures. These branch paths are derived from analyzing the execution order of instruction nodes in the operation event sequence. By identifying control flow change points such as conditional jump instructions and interrupt call instructions in the program and combining them with the corresponding device state parameter change characteristics, all possible execution path branches that the code may take during actual operation are restored. The path credibility score is a quantitative indicator for evaluating the security of branch paths.

[0096] In an embodiment of the present application, the system traverses all possible branch paths in each stage, calculates the instruction compliance and state stability indicators of each path based on dynamic dependencies, and obtains a credibility score of 0-100 points through a comprehensive evaluation using a weighted algorithm.

[0097] Step 205: Generate real-time security protection rules based on the path credibility score and the relevance weight.

[0098] In an embodiment of the present application, the system sets a hierarchical protection strategy based on the scoring results, adds high-scoring paths to the whitelist and assigns operation permissions, sets monitoring warnings for medium-scoring paths, directly blocks low-scoring paths, and generates a rule configuration file that can be loaded into the kernel.

[0099] Here's a specific example:

[0100] In a specific implementation of a CNC machine tool control system, the system first time-aligns the "start spindle" instruction with the corresponding speed data (such as 1200 rpm) and the "feed cut" instruction with the cutting force data (such as 500N), forming an operation event sequence containing instructions, parameter values, and timestamps. In a memory isolation environment, system analysis found that after the "feed cut" instruction is executed, if the speed drops beyond the normal range (calculated as: current speed < reference speed × 0.8, where the reference speed is the average of the last 10 normal cuts), and the cutting force fluctuation exceeds the threshold (cutting force change rate > 50N / m s), the reinforcement learning model calculates the relevance weight of the instruction node to be 0.9 (weight calculation formula: relevance weight = speed deviation coefficient × 0.6 + cutting force fluctuation coefficient × 0.4), and the system divides the execution path into a high-risk stage. When evaluating the credibility of the branch path, if it is detected that the "fast feed" branch path meets the conditions of both speed drop and cutting force fluctuation, the path credibility score is given 30 points (score calculation: basic score 100 points - speed deviation deduction 40 points - cutting force fluctuation deduction 30 points), and finally generates a protection rule to limit the feed rate to no more than 70% of the set value.

[0101] In an embodiment of the present application, the method realizes adaptive security protection based on actual working conditions by establishing a dynamic association model between code execution and device status, effectively preventing and controlling equipment failures caused by abnormalities, and at the same time taking into account system security and operational efficiency through a hierarchical protection mechanism.

[0102] In order to improve the accuracy of the security assessment of the software code execution path in the localized platform, in some embodiments, step 204: in the multi-stage state division process, traversing the branch path of each stage in the software code execution path to generate the path credibility score of the branch path includes:

[0103] Step 301: Determine the execution direction of the software code execution path in each stage according to the starting instruction node and the ending instruction node of each stage in the multi-stage state division process.

[0104] In step 301 , the execution flow refers to all possible instruction execution sequences and jump relationships of the code in a specific stage.

[0105] In an embodiment of the present application, the system extracts all control flow transfer relationships between the start and end instruction nodes based on the stage division results, and enumerates a complete set of execution paths including normal processes, exception handling, conditional branches, etc. through a graph traversal algorithm.

[0106] Step 302: In the execution flow, a branch path that conflicts with the device state parameter change trend in the dynamic dependency is identified from the software code execution path, and marked as a branch path to be verified.

[0107] In step 302, a conflict occurs when the measured change trend of the device state parameter corresponding to the instruction node sequence included in a branch path in the execution flow is inconsistent with the expected trend recorded in the dynamic dependency relationship. For example, if a branch path includes instruction nodes A to B to C, and the dynamic dependency relationship stipulates that the pressure sensor value should increase when executing node A, but the measured data shows that the pressure value decreases or remains unchanged after executing node A, the branch path is marked as a pending branch path. A pending branch path refers to a code execution branch where the actual change in device state differs from the expected model.

[0108] In an embodiment of the present application, the system performs similarity matching on the device status change curve of each branch path with the dynamic dependency model. When the correlation coefficient between the actual parameter change trend and the expected model is lower than the set threshold, the path is marked as a state to be verified.

[0109] Step 303: For each branch path to be verified, obtain the measured values of the device state parameters corresponding to all instruction nodes in the branch path to be verified.

[0110] In step 303, the measured value refers to the device status parameter value actually collected during the execution of the branch path.

[0111] In an embodiment of the present application, the system extracts all sensor data corresponding to the path to be verified from the operation event sequence, including the instantaneous value when the instruction is executed and the change after execution, to form a complete state parameter record of the path.

[0112] Step 304: Compare the measured value with the expected value of the device state parameter in the dynamic dependency relationship node by node.

[0113] In step 304 , the expected value is the theoretical range of variation of the device state calculated based on the dynamic dependency model.

[0114] In an embodiment of the present application, the system calculates the reasonable fluctuation range of the device status parameters after each instruction is executed based on the correlation weight of the instruction node and historical normal data, which serves as a comparison benchmark.

[0115] Step 305: According to the comparison result, the number of deviations between the measured value and the expected value is counted, and the influence factor of the number of deviations on the branch path to be verified is calculated in combination with the correlation weight.

[0116] In step 305 , the impact factor is a comprehensive indicator that quantifies the impact of abnormal deviation on route safety.

[0117] In an embodiment of the present application, the system counts the number of parameter points that exceed the expected range, multiplies it by the relevance weight of the corresponding instruction node, and then divides it by the total number of instructions in the path to obtain a standardized impact factor value.

[0118] Step 306: Perform weighted superposition on the impact factor and the timing density of the instruction nodes in the branch path to be verified to generate a path credibility score for the branch path to be verified.

[0119] In step 306 , the timing density is the number of instruction nodes executed per unit time in the branch path.

[0120] In an embodiment of the present application, the system calculates the average number of instructions per unit time in the path, weights and sums the impact factor and timing density according to a preset ratio, and finally generates a path credibility score in the range of 0-100.

[0121] Here's a specific example:

[0122] During the CNC machine tool processing, the system first identifies that the starting instruction of the "finishing stage" is "turn on coolant" and the ending instruction is "turn off coolant", and determines that this stage contains two execution paths: "conventional feed" and "high-speed feed". When it detects that the spindle speed in the "high-speed feed" path drops sharply from 1200 rpm to 900 rpm (lower than the reference speed 1200×0.8=960 rpm), and the cutting force increases rapidly from 500N to 650N (change rate 60N / ms>threshold 50N / ms), the system marks this path as a branch to be verified; obtains the measured speed values [1200,1150,900] rpm and cutting force values [500,580,650]N corresponding to all instruction nodes in this path; and compares them with the expected values (speed) in the dynamic dependency relationship. The speed should be maintained at [1150,1250] rpm, and the cutting force change rate should be <50 N / ms). A point-by-point comparison revealed one deviation point in the speed (900 rpm) and two deviation points in the cutting force (580 N and 650 N). Based on the correlation weights (speed weight 0.6, cutting force weight 0.4), the impact factor was calculated as (1×0.6+2×0.4) / 3=0.47. Combined with the high timing density of this path (4 instructions / ms), a weighted calculation was performed using an impact factor weight of 70% and a timing density weight of 30%, resulting in a path credibility score of 100×(1-0.47)×0.7+100×(1-0.2)×0.3=58 points (the 0.2 timing density deduction is calculated based on the proportion of the density exceeding the standard value of 3 instructions / ms).

[0123] In the embodiment of the present application, the method achieves accurate identification and hierarchical control of abnormal execution modes through multi-dimensional quantitative evaluation of the security of code branch paths, effectively preventing abnormal operation of equipment due to code logic defects, and avoiding the impact of excessive protection on normal processing efficiency.

[0124] In order to further improve the accuracy and adaptability of the security protection rule generation of the domestic platform, in some embodiments, step 205: generating real-time security protection rules based on the path credibility score and the correlation weight includes:

[0125] Step 401: Sort the path credibility scores from high to low, and determine a credibility threshold based on the score distribution density, where the score distribution density is the ratio of the number of branch paths in the same score interval.

[0126] In step 401, the score distribution density refers to the ratio of the number of branch paths within each score interval to the total number of paths. The credibility threshold is the critical score value for distinguishing safe and risky paths. The branch path proportion refers to the ratio of the number of branch paths within the same score interval to the total number of traversed branch paths (for example, if there are 5 branches with scores of 7-8 and a total of 20 traversed branches, the proportion is 25%).

[0127] In an embodiment of the present application, the system divides the credibility scores of all branch paths into intervals (such as 0-30 points, 31-60 points, 61-100 points), calculates the proportion of the number of paths in each interval, and selects the score corresponding to the point where the proportion drops suddenly as the credibility threshold to ensure that high-risk paths can be effectively identified.

[0128] Step 402: According to the credibility threshold, the branch paths whose path credibility scores are higher than the credibility threshold and whose relevance weights exceed a preset critical value are screened out to generate a set of paths that are allowed to be executed.

[0129] In step 402, the preset threshold is the minimum value of the relevance weight. The set of allowed execution paths is a collection of safe paths that have been double-screened.

[0130] In the embodiment of the present application, the system first screens the paths with scores higher than the credibility threshold, and then selects the paths with relevance weights exceeding the critical value (such as 0.7) to add to the set, ensuring that the selected paths meet the standards in terms of both behavioral safety and hardware impact.

[0131] Step 403: In the set of allowed execution paths, a dynamic permission level is assigned to each branch path according to the instruction node timing density and the association weight of the branch path.

[0132] In step 403, the dynamic permission level is the operation permission level assigned according to the path characteristics.

[0133] In an embodiment of the present application, the system uses temporal density and correlation weight to construct a two-dimensional evaluation matrix, dividing the paths into multiple permission levels. High-density, high-weight paths are assigned high permissions (core parameters can be modified), and low-density, low-weight paths are assigned basic permissions (only read permissions).

[0134] Step 404: Generate real-time security protection rules based on the dynamic permission level.

[0135] In an embodiment of the present application, the system maps the authority level to specific operation restriction rules. For example, a high-authority path can adjust the upper limit of the feed speed, while a low-authority path can only use the default parameters and set an audit mechanism for path switching.

[0136] Here's a specific example:

[0137] During the CNC machine tool processing, the system evaluated 15 processing paths and obtained the following distribution of the credibility scores of each path: 3 paths with scores of 90-100 (accounting for 20%), 5 paths with scores of 70-89 (accounting for 33%), 4 paths with scores of 50-69 (accounting for 27%), 2 paths with scores of 30-49 (accounting for 13%), and 1 path with scores of 0-29 (accounting for 7%). 70 points was selected as the credibility threshold (because the proportion of paths from 70-89 to 50-69 decreased the most); 7 paths with scores ≥ 70 points and correlation weights ≥ 0.8 were selected to form the allowed execution set, including the "finishing-low speed feed" path (score 85 points, weight 0.85) and the "roughing-medium speed feed" path (score 75 points, weight 0.8); according to the timing density (precision), the system selected 7 paths with scores ≥ 70 points and correlation weights ≥ 0.8 to form the allowed execution set. The system uses a weighted authorization value (authority value = timing density × 0.4 + weight × 0.6) to calculate the authorization level (authority value = 3.2 × 0.4 + 0.85 × 0.6 = 0.78) for the finishing path and a Level 3 authorization value (authority value = 4.1 × 0.4 + 0.8 × 0.6 = 0.86) for the roughing path. The resulting protection rule stipulates that Level 3 paths can adjust the speed (±15%) and feed rate (±20%), while Level 2 paths can only adjust the feed rate (±10%). Other paths use fixed parameters. When executing "Finishing - Low Feed," the system allows the operator to fine-tune the feed rate within a 10% range, but prohibits modifying the spindle speed parameter.

[0138] In the embodiment of the present application, the method realizes refined security management of the code execution path through multi-dimensional evaluation and hierarchical control, which not only ensures the effective prevention of high-risk operations, but also guarantees the flexible regulation of normal processing processes, thereby improving the safety and availability of domestic CNC systems.

[0139] To further improve the systematicness and enforceability of the security protection rules of the localized platform, in some embodiments, step 404: generating real-time security protection rules based on the dynamic permission level includes:

[0140] Step 501: Generate a permission level mapping table based on the mapping relationship between the dynamic permission level and the process execution priority in the kernel layer.

[0141] In step 501, the kernel layer, a core component of the domestic platform, refers to the kernel space of the domestic operating system, directly managing hardware resources and process scheduling. Software code execution relies on fundamental services provided by the kernel layer, such as process management (e.g., priority scheduling) and memory access control (e.g., interval boundaries). Process execution priority is a parameter already defined in the kernel layer's environment variables. The permission level mapping table maps dynamic permission levels to kernel process scheduling parameters.

[0142] In this embodiment, the system establishes a three-level permission mapping relationship: Level 1 maps to normal priority, allowing basic operations; Level 2 maps to higher priority, allowing parameter adjustment; Level 3 maps to real-time priority, allowing critical operations. By querying the system scheduling parameter range, a complete mapping table containing permission levels, priority intervals, and a list of available system calls is automatically generated.

[0143] Step 502: Construct a memory control policy set and a blocking condition set based on the boundary value of the memory access interval in the kernel layer and the blocking instruction node pair.

[0144] In step 502, the boundary value of the memory access interval is calculated based on the product of the instruction node timing density and the relevance weight, representing the boundary of the memory address range accessible to the process at the kernel level (e.g., starting address 0x1000, ending address 0x2000). The blocking instruction node is a combination of the starting instruction node and the ending instruction node extracted from the blocking path set, indicating the abnormal code jump behavior to be blocked (e.g., an illegal jump from instruction A to instruction D). The memory control policy set is a set of control rules that define the memory access range for each permission level. The blocking condition set is a combination of the instruction sequence that triggers protection and the sensor threshold.

[0145] In this embodiment, the system divides memory access into zones based on permission levels: Level 1 allows access to user space, Level 2 adds device mapping, and Level 3 allows access to all memory. Blocking conditions analyze historical anomaly data to record dangerous command combinations (e.g., "high-speed feed + cooling off") and corresponding sensor thresholds (vibration > 5 mm / s).

[0146] Step 503: Encapsulate the permission level mapping table, the memory control policy set, and the blocking condition set into a real-time security protection rule set in a preset format.

[0147] In an embodiment of the present application, the system encapsulates the mapping table, control strategy and blocking conditions in a preset format, including three modules: permission definition, memory area, and blocking rules. Hot loading of the configuration is achieved through the kernel module interface to ensure that rule updates do not affect system operation.

[0148] Here's a specific example:

[0149] During the implementation of the CNC machine tool control system, the system first established a mapping between dynamic privilege levels and kernel parameters: Level 3 privilege (roughing - medium-speed feed path) was mapped to a real-time priority value of 80 (range 1-99), allowing up to 90% of CPU usage; Level 2 privilege (finishing - low-speed feed path) was mapped to a normal priority value of -10 (range -20 to 19), limiting CPU usage to no more than 70%. Memory access range boundaries were calculated based on privilege levels: Level 3 allowed access to the entire memory range from 0x00000000 to 0x3fffffff (calculated as: base address 0x00000000 plus privilege value 0.86 × 0x40000000); Level 2 was limited to 0x00000000-0x2ffffff (base address plus privilege value 0.78 × 0x40000000). The blocking condition set recorded instruction combinations as dangerous when the spindle speed exceeded 1500 rpm and vibration exceeded 0.05 mm. Finally, the system encapsulates these rules in a structured text format, which consists of three parts: the permission mapping part records the relationship between levels and kernel parameters, the memory control part defines the accessible address range of each level, and the blocking condition part lists 10 groups of dangerous instructions and sensor threshold combinations.

[0150] In the embodiment of the present application, the method realizes the deep integration of security protection strategy and platform kernel through systematic rule organization and dynamic loading mechanism, which not only ensures the protection effect, but also ensures the real-time and stability of system operation, effectively improving the security protection capability of domestic industrial control systems.

[0151] In order to further improve the time synchronization accuracy between the device status and the software instructions in the localized platform, in some embodiments, step 102: in the external clock synchronization module of the localized platform, the device status parameters are time-aligned with the execution nodes of the software code instructions to generate an operation event sequence, including:

[0152] Step 601: In the external clock synchronization module of the localization platform, the timestamp of the sensing data from the external mechanical equipment and the timestamp of the instruction execution of the localization platform are received respectively.

[0153] In step 601, the sensor data timestamp is the time the sensor data was collected, as recorded by the local clock of the machine. The instruction execution timestamp is the time when the code instruction started executing, as recorded by the localization platform. The sensor data timestamp is generated by the local clock of the machine, while the instruction execution timestamp is generated by the auxiliary timing unit of the localization platform.

[0154] In an embodiment of the present application, the external clock synchronization module receives the sensor data packet (including pressure value and timestamp) from the PLC controller and the instruction execution log (including instruction content and execution time) of the domestic platform through a dedicated interface to ensure the integrity of the original time information.

[0155] Step 602: Calculate the offsets of the sensing data timestamp, the instruction execution timestamp and the global time reference respectively using the global time reference of the external clock synchronization module.

[0156] In step 602, the global time base is a high-precision unified time reference maintained by the external clock synchronization module. The offset is the time difference between each timestamp and the base.

[0157] In an embodiment of the present application, the module uses a precision clock source (such as an atomic clock) as a benchmark to calculate the millisecond difference between the sensor timestamp and the instruction timestamp and the benchmark, for example, the sensor timestamp is 1.2 milliseconds slower than the benchmark, and the instruction timestamp is 0.8 milliseconds faster than the benchmark.

[0158] Step 603: With the global time base as the axis, the data points of the device status parameters are matched one-to-one with the execution nodes of the software code instructions within a preset time alignment tolerance range. When the offset difference between the sensor data timestamp and the instruction execution timestamp does not exceed the time alignment tolerance, the match is determined to be successful.

[0159] In step 603 , the time alignment tolerance is the maximum allowed time matching error range.

[0160] In the embodiment of the present application, a tolerance value of 2 milliseconds is set. When the absolute difference (2.0 ms) between the sensor offset (+1.2 ms) and the instruction offset (-0.8 ms) does not exceed the tolerance, it is determined that the pressure data successfully matches the instruction.

[0161] Step 604: Bind and encapsulate the data point and the execution node corresponding to a successful match to generate an operation event unit.

[0162] In step 604, the operation event unit is a successfully bound instruction-state data combination. Each operation event unit contains at least instruction content, device state parameter value and an alignment timestamp under the global time base.

[0163] In the embodiment of the present application, the successfully matched "start spindle" instruction (execution time T1) and the pressure sensor data (acquisition time T2) are encapsulated into a unit, which includes the instruction code, pressure value and calibrated unified time ((T1+T2) / 2).

[0164] Step 605: Arrange all the operation event units in the order of the global time reference to form an operation event sequence.

[0165] In the embodiment of the present application, the system arranges all event units in a unified time order, such as arranging the "start spindle" event (time T) first, and then arranging the "feed cutting" event (time T+10ms), to form a complete processing process sequence.

[0166] Here's a specific example:

[0167] During the implementation of the CNC machine tool control system, the external clock synchronization module uses the global time base established by the high-precision clock source as a reference (for example, the base time is set to 08:00:00.000). When the system executes the "start spindle" command, the platform command execution timestamp is recorded as 08:00:01.005. At the same time, the speed data 1200 rpm reported by the encoder and its local timestamp 08:00:01.008 are received. The calculated command time offset is +5 milliseconds (08:00:01.005-08:00:00.000), and the speed data offset is +8 milliseconds (08:00:01.008-08:00:00.000). The deviation of 3 milliseconds between the two exceeds the preset 2 millisecond tolerance and is determined to be mismatched. Subsequently, when the "feed cutting" command is executed, the system executes the "start spindle" command. When a command is issued, the platform records the command time 08:00:05.002, and the force sensor reports cutting force data of 500N and a timestamp of 08:00:05.003. The calculated command offset is +2 milliseconds, and the cutting force offset is +3 milliseconds. The deviation of 1 millisecond is within the tolerance range. After successful matching, an operation event unit is generated (command: "Feed Cut", cutting force: 500N, calibration time: 08:00:05.0025). This time value is the average of the two timestamps ((08:00:05.002+08:00:05.003) / 2). Finally, all successfully matched event units are sorted by calibration time, such as the "Feed Cut" event is placed after the "Start Spindle" event, forming a complete sequence of operation events for the machining process, providing an accurate time series data foundation for subsequent analysis.

[0168] In the embodiment of the present application, the method ensures the accurate association between device status and software instructions through high-precision time alignment, provides a reliable timing data basis for subsequent security analysis, and effectively solves the misjudgment problem caused by time asynchrony in traditional methods.

[0169] In order to further improve the dynamic update capability of the security protection rules of the localized platform, in some embodiments, step 104: dynamically binding the real-time security protection rules to the kernel layer of the localized platform to dynamically update the real-time security protection rules includes:

[0170] Step 701: pre-set a rule loading interface in the kernel layer of the localized platform, and register the permission level mapping table, memory control policy set and blocking condition set of the real-time security protection rules as kernel environment variables through the rule loading interface.

[0171] In step 701, the rule loading interface is a dedicated configuration channel provided by the kernel layer for safely injecting protection rules.

[0172] In an embodiment of the present application, the system creates a specific character device file by developing a kernel module, and writes the permission level mapping table, memory control policy and blocking condition set into the kernel environment variable area in a structured data format to ensure that the rule loading process does not interfere with normal system scheduling.

[0173] Step 702: Establish a real-time monitoring channel between the kernel layer environment variables and the sensor data stream.

[0174] In step 702, the real-time monitoring channel is a data path connecting sensor data and kernel rules.

[0175] In an embodiment of the present application, the system uses an interrupt mechanism and shared memory technology to build a monitoring channel. When the sensor data is updated, an interrupt is triggered immediately, and the latest data is passed to the kernel layer through a pre-allocated shared memory area, achieving a microsecond response.

[0176] Step 703: Compare the device status parameter to be updated with the sensor data threshold preset in the blocking condition set through the real-time monitoring channel.

[0177] In step 703, the device state parameter to be updated is the latest sensor data that needs to be evaluated.

[0178] In an embodiment of the present application, the system obtains real-time sensor readings from the monitoring channel (such as the current spindle vibration value of 0.05mm), compares it with the threshold value preset in the blocking condition set (such as the vibration threshold of 0.03mm), and calculates the degree of deviation.

[0179] Step 704: When the device state parameter to be updated exceeds the sensor data threshold, a rule update condition is triggered.

[0180] In step 704, the rule update condition is a criterion for triggering the protection rule adjustment.

[0181] In the embodiment of the present application, when the vibration value is detected to exceed the threshold value (0.03 mm) for three consecutive times and the amplitude of each exceeding the threshold increases by more than 20%, it is determined that the update condition is met and a rule update instruction is generated.

[0182] Step 705: Dynamically update the real-time security protection rules based on the rule update conditions.

[0183] In step 705 , dynamic updating refers to hot replacement of rules without restarting the system.

[0184] In an embodiment of the present application, the system recalculates the security path score based on the latest sensor data analysis results, generates an updated permission mapping table and blocking conditions, and replaces the old rules in the kernel environment variables through atomic operations to ensure that the update process does not interrupt system operation.

[0185] Here's a specific example:

[0186] During the implementation of the CNC machine tool control system, the system loaded the initial security protection rules into the kernel environment variable area through the kernel preset rule configuration interface, including setting the permission level 3 to adjust the speed range by ±10% (1200±120 rpm), and the blocking condition to "vibration value > 0.03 mm and cutting force > 550 N"; establishing a real-time monitoring channel with sensor data. When the vibration value detected in the "finishing" process reaches 0.035 mm, 0.042 mm, and 0.050 mm three times in a row (each time increasing by more than 20%) and the cutting force rises to 580 N, the system determines that the rule update conditions (vibration value > 0.035 mm, 0.042 mm, and 0.050 mm) are met. The dynamic over-limit amplitude = (current value - threshold) / threshold × 100%, with the results of the three calculations being 16.7%, 40%, and 66.7%, respectively); based on analysis of the latest sensor data, a recalculation concluded that the safe speed range should be narrowed to ±5% (1200 ± 60 rpm), and the blocking condition was updated to "vibration > 0.025 mm or cutting force > 500 N"; the system hot-updated the new rules to the kernel through atomic operations, immediately limiting the current machining speed to 1140 rpm. When the vibration drops below 0.02 mm for 10 seconds, the original speed adjustment authority is automatically restored. The entire process does not require downtime and maintains machining continuity.

[0187] In an embodiment of the present application, the method realizes real-time adaptation of protection strategies and device status through a kernel-level dynamic rule binding and update mechanism, effectively preventing security risks caused by rule lags, and ensuring the continuity and stability of the industrial control process.

[0188] Figure 2 A structural diagram of a software code security protection system based on a domestic platform provided in an embodiment of the present application is shown as follows: Figure 2 As shown, the system includes:

[0189] The acquisition module 21 is used to obtain the sensor data stream generated by the interaction between the domestic platform and external mechanical equipment during the execution of the software code of the domestic platform, and the sensor data in the sensor data stream includes device status parameters associated with the software code execution process.

[0190] The alignment module 22 is used to time-align the device status parameters with the execution nodes of the software code instructions in the external clock synchronization module of the domestic platform to generate an operation event sequence. The software code instructions are function calls, system interface requests or machine-level operation instructions captured during the operation of the domestic platform.

[0191] The analysis module 23 is used to analyze the dynamic pattern of the operation event sequence through the memory isolation operating environment of the domestic platform using a reinforcement learning mechanism to generate real-time security protection rules for the software code execution path. The software code execution path is the instruction execution order and branch structure restored from the operation event sequence.

[0192] The update module 24 is used to dynamically bind the real-time security protection rules to the kernel layer of the domestic platform to dynamically update the real-time security protection rules, and feed back the updated security protection rules to the kernel layer to form a closed-loop security protection mechanism.

[0193] Figure 2 The software code security protection system based on the domestic platform can be executed Figure 1 The implementation principle and technical effects of the software code security protection method based on a domestic platform described in the illustrated embodiment will not be elaborated on here. The specific manner in which each module and unit performs operations in the software code security protection system based on a domestic platform in the above embodiment has been described in detail in the embodiment of the method and will not be elaborated on here.

[0194] In one possible design, Figure 2 The software code security protection system based on the domestic platform of the embodiment shown can be implemented as a computing device, such as Figure 3 As shown, the computing device may include a storage component 31 and a processing component 32;

[0195] The storage component 31 stores one or more computer instructions, wherein the one or more computer instructions are called and executed by the processing component 32 .

[0196] The processing component 32 is used to perform the above Figure 1 The embodiment provides a software code security protection method based on a domestic platform.

[0197] The processing component 32 may include one or more processors to execute computer instructions to complete all or part of the steps in the above method. Of course, the processing component may also be implemented as one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above method.

[0198] The storage component 31 is configured to store various types of data to support operations on the terminal. The storage component can be implemented by any type of volatile or non-volatile memory device, or a combination thereof, such as static random-access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.

[0199] Of course, a computing device may also include other components, such as input / output interfaces, display components, communication components, etc.

[0200] The input / output interface provides an interface between the processing component and the peripheral interface module, which can be an output device, an input device, etc.

[0201] The communication component is configured to facilitate, among other things, wired or wireless communications between the computing device and other devices.

[0202] Among them, the computing device can be a physical device or an elastic computing host provided by a cloud computing platform, etc. In this case, the computing device can refer to a cloud server, and the above-mentioned processing components, storage components, etc. can be basic server resources rented or purchased from the cloud computing platform.

[0203] The present application also provides a computer storage medium storing a computer program, wherein the computer program can achieve the above-mentioned Figure 1 The embodiment shown is a software code security protection method based on a domestic platform.

[0204] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0205] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0206] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.

[0207] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A software code security protection method based on a domestic platform, characterized in that: include: During the execution of the software code of the localized platform, a sensor data stream generated by the interaction between the localized platform and the external mechanical device is obtained, wherein the sensor data in the sensor data stream includes device state parameters associated with the execution of the software code; In the external clock synchronization module of the localized platform, the device state parameters are time-aligned with the execution nodes of the software code instructions to generate an operation event sequence, where the software code instructions are function calls, system interface requests, or machine-level operation instructions captured during the operation of the localized platform; Through the memory isolation operating environment of the domestic platform, a reinforcement learning mechanism is used to analyze the dynamic pattern of the operation event sequence to generate real-time security protection rules for the software code execution path. The software code execution path is the instruction execution order and branch structure restored from the operation event sequence; Dynamically binding the real-time security protection rules to the kernel layer of the localized platform to dynamically update the real-time security protection rules, and feeding back the updated security protection rules to the kernel layer to form a closed-loop security protection mechanism; The memory isolation operating environment of the domestic platform uses a reinforcement learning mechanism to analyze the dynamic pattern of the operation event sequence and generate real-time security protection rules for the software code execution path, including: In the memory isolation operating environment of the domestic platform, the device state parameters in the operation event sequence are matched with the execution nodes of the software code instructions frame by frame to screen out continuous event segments corresponding to the software code execution path; Extracting, based on the continuous event segments, relevance weights of different instruction nodes in the software code execution path, and constructing dynamic dependency relationships between the instruction nodes and the continuous event segments; By using a reinforcement learning mechanism, the software code execution path is divided into multiple stages based on the dynamic dependency relationship; In the multi-stage state division process, traversing the branch paths of each stage in the software code execution path to generate path credibility scores of the branch paths; A real-time security protection rule is generated according to the path credibility score and the relevance weight.

2. The method according to claim 1, characterized in that In the multi-stage state division process, traversing the branch paths of each stage in the software code execution path to generate path credibility scores of the branch paths includes: Determining the execution flow of the software code execution path within each stage according to the starting instruction node and the ending instruction node of each stage in the multi-stage state division process; In the execution flow, a branch path that conflicts with a change trend of a device state parameter in the dynamic dependency relationship is identified from the software code execution path, and marked as a branch path to be verified; For each branch path to be verified, obtaining the measured values of the device state parameters corresponding to all instruction nodes in the branch path to be verified; Comparing the measured value with the expected value of the device state parameter in the dynamic dependency relationship node by node; According to the comparison result, the number of deviations between the measured value and the expected value is counted, and the influence factor of the number of deviations on the branch path to be verified is calculated in combination with the correlation weight; The impact factor is weightedly superimposed on the timing density of the instruction nodes in the branch path to be verified to generate a path credibility score of the branch path to be verified.

3. The method according to claim 1, characterized in that Generating a real-time security protection rule according to the path credibility score and the relevance weight includes: Sort the path credibility scores from high to low and determine the credibility threshold based on the score distribution density, where the score distribution density is the proportion of branch paths within the same score interval; According to the credibility threshold, screening out branch paths whose path credibility scores are higher than the credibility threshold and whose relevance weights exceed a preset critical value, to generate a set of paths that are allowed to be executed; In the set of allowed execution paths, assigning a dynamic permission level to each branch path according to the instruction node timing density and the relevance weight of the branch path; Based on the dynamic permission level, real-time security protection rules are generated.

4. The method according to claim 3, characterized in that Generating real-time security protection rules based on the dynamic permission level includes: generating a permission level mapping table according to a mapping relationship between the dynamic permission level and the process execution priority in the kernel layer; Constructing a memory control policy set and a blocking condition set based on the boundary value of the memory access interval and the blocking instruction node pair in the kernel layer; The permission level mapping table, the memory control policy set and the blocking condition set are encapsulated into a real-time security protection rule set in a preset format.

5. The method according to claim 1, wherein In the external clock synchronization module of the localized platform, the device state parameters are time-aligned with the execution nodes of the software code instructions to generate an operation event sequence, including: In the external clock synchronization module of the localization platform, the timestamp of the sensor data from the external mechanical equipment and the timestamp of the instruction execution of the localization platform are received respectively; Calculating the offsets of the sensing data timestamp, the instruction execution timestamp and the global time reference respectively through the global time reference of the external clock synchronization module; Using the global time base as an axis, within a preset time alignment tolerance range, one-to-one matching is performed between the data points of the device state parameters and the execution nodes of the software code instructions. When the offset difference between the timestamp of the sensor data and the timestamp of the instruction execution does not exceed the time alignment tolerance, the match is determined to be successful. Binding and encapsulating the data point and the execution node corresponding to a successful match to generate an operation event unit; All the operation event units are arranged in the order of the global time reference to form an operation event sequence.

6. The method according to claim 1, characterized in that The step of dynamically binding the real-time security protection rules to the kernel layer of the localized platform to dynamically update the real-time security protection rules includes: A rule loading interface is pre-set in the kernel layer of the localized platform, and the permission level mapping table, memory control policy set and blocking condition set of the real-time security protection rule are registered as kernel environment variables through the rule loading interface; Establishing a real-time monitoring channel between the kernel layer environment variables and the sensor data stream; Comparing, through the real-time monitoring channel, the device status parameter to be updated with the sensor data threshold preset in the blocking condition set; When the device status parameter to be updated exceeds the sensor data threshold, a rule update condition is triggered; Based on the rule update conditions, the real-time security protection rules are dynamically updated.

7. A software code security protection system based on a domestic platform, characterized in that: include: an acquisition module, configured to acquire, during the execution of the software code of the localized platform, a sensor data stream generated by the interaction between the localized platform and an external mechanical device, wherein the sensor data in the sensor data stream includes device state parameters associated with the execution of the software code; an alignment module for time-aligning the device state parameters with the execution nodes of the software code instructions in the external clock synchronization module of the localized platform to generate an operation event sequence, wherein the software code instructions are function calls, system interface requests, or machine-level operation instructions captured during the operation of the localized platform; An analysis module for analyzing the dynamic patterns of the operation event sequence using a reinforcement learning mechanism in the memory isolation operating environment of the domestic platform to generate real-time security protection rules for the software code execution path, where the software code execution path is the instruction execution sequence and branch structure restored from the operation event sequence; An update module, configured to dynamically bind the real-time security protection rules to the kernel layer of the localized platform to dynamically update the real-time security protection rules, and feed the updated security protection rules back to the kernel layer to form a closed-loop security protection mechanism; The memory isolation operating environment of the domestic platform uses a reinforcement learning mechanism to analyze the dynamic pattern of the operation event sequence and generate real-time security protection rules for the software code execution path, including: In the memory isolation operating environment of the domestic platform, the device state parameters in the operation event sequence are matched with the execution nodes of the software code instructions frame by frame to screen out continuous event segments corresponding to the software code execution path; Extracting, based on the continuous event segments, relevance weights of different instruction nodes in the software code execution path, and constructing dynamic dependency relationships between the instruction nodes and the continuous event segments; By using a reinforcement learning mechanism, the software code execution path is divided into multiple stages based on the dynamic dependency relationship; In the multi-stage state division process, traversing the branch paths of each stage in the software code execution path to generate path credibility scores of the branch paths; A real-time security protection rule is generated according to the path credibility score and the relevance weight.

8. A computing device, characterized in that It includes a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement a software code security protection method based on a domestic platform as described in any one of claims 1 to 6.

9. A computer storage medium, characterized in that A computer program is stored, and when the computer program is executed by a computer, a software code security protection method based on a domestic platform as described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Intelligent vulnerability mining platform construction method and system based on large model

    CN119760730A

  • Multi-modal feature fusion software supply chain vulnerability intelligent positioning method

    CN120068095A