A Greedy Algorithm-Based Method and System for Defending Against Automotive Network Attacks Under Multiple Constraints

By proposing a greedy algorithm-based approach to defend against vehicle network attacks under multiple constraints, this method solves the problems of multidimensional resource constraints and real-time performance in existing technologies, achieving efficient and real-time defense scheduling and improving the robustness and adaptability of vehicle network attack defense.

CN122137622APending Publication Date: 2026-06-02XIAMEN KING LONG UNITED AUTOMOTIVE IND CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XIAMEN KING LONG UNITED AUTOMOTIVE IND CO LTD
Filing Date
2026-03-04
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing automotive network attack defense methods fail to effectively handle multi-dimensional resource constraints and real-time requirements, leading to the failure of defense scheduling schemes in the in-vehicle environment. Furthermore, they lack a comprehensive assessment of multi-dimensional resource costs, making it impossible to dynamically maximize the protection of vehicle information security.

Method used

A greedy algorithm-based approach to defend against network attacks on automobiles under multiple constraints is adopted. By establishing a multi-constraint attack defense model, calculating the normalized comprehensive benefit density, performing iterative greedy selection based on constraint awareness, generating a defense scheduling sequence, and performing dynamic replanning during the defense execution process, the optimal defense is achieved under time and multi-dimensional resource constraints.

Benefits of technology

It achieves efficient and real-time defense scheduling under multi-dimensional resource constraints, avoids defense execution failure due to the exhaustion of resources in one dimension, improves the robustness and adaptability of the system, and meets the millisecond-level real-time requirements for vehicle network attack response.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122137622A_ABST
    Figure CN122137622A_ABST
Patent Text Reader

Abstract

This invention relates to the fields of automotive network security and embedded real-time systems, and particularly to a method and system for automotive network attack defense based on a greedy algorithm under multi-constraints. It is applied to the vehicle-mounted telematics controller (TBOX) and associated vehicle security defense systems. The method includes the following steps: establishing a multi-constraint attack defense model, defining the set of attack events to be processed, the ternary attributes of each attack event, and the upper limit of the multi-constraints currently available in the system; calculating the normalized comprehensive benefit density of each attack event, first converting the multi-dimensional resource consumption into a unified comprehensive cost combined with time, and then calculating the security benefit per unit comprehensive cost based on the comprehensive cost. This invention, by explicitly and systematically introducing multi-dimensional heterogeneous resource constraints into the vehicle attack defense scheduling, extends the scheduling model from an idealized single-dimensional or two-dimensional environment to a real multi-dimensional environment, greatly enhancing the engineering feasibility of the decision results and avoiding defense execution failure due to the exhaustion of resources in one dimension.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of automotive network security and embedded real-time systems, and in particular to a method and system for defending against automotive network attacks based on a greedy algorithm under multiple constraints. Background Technology

[0002] The electronic and electrical architecture of intelligent connected vehicles is becoming increasingly complex. In-vehicle networks face diverse network attack threats such as traffic hijacking, command tampering, and ECU intrusion. In-vehicle security components, especially the telematics controller (TBOX), need to coordinate multiple controller ECUs to perform defensive actions such as traffic filtering, session reset, ECU isolation, and rule updates. The effective execution of these defensive actions not only consumes a certain amount of time, but also depends on limited in-vehicle computing resources such as CPU, memory, hardware security module (HSM), and communication bandwidth.

[0003] Existing research on vehicle network attack defense scheduling based on greedy algorithms or simple priority methods mostly considers only a single-dimensional constraint, which has significant limitations: First, the resource dimension is singular, ignoring the multi-dimensional heterogeneous resource constraints of defense actions in the vehicle environment, which can easily lead to the failure of the scheduling scheme due to the exhaustion of resources in one dimension. Second, the ability to handle constraint conflicts and coupling is weak, and it cannot effectively deal with the coupling relationship between resource consumption and execution time, as well as the coordination problem when multiple resource constraints approach their limits simultaneously. Third, there is a risk of suboptimal decision-making, lacking a comprehensive assessment of the cost of multi-dimensional resources, and the simple criterion of "maximum security benefit per unit time" can easily lead to a decline in overall defense effectiveness. Fourth, it has poor adaptability to embedded environments, and the computational complexity of traditional multi-dimensional knapsack problem exact solution algorithms increases exponentially, which cannot meet the millisecond-level real-time requirements of vehicle network attack response.

[0004] Existing related patents such as CN119299226A, CN120074960A, and CN119051926A do not consider the information security value, execution time, and collaborative scheduling relationship of multi-dimensional system resource occupation of defensive actions, and cannot achieve dynamic maximization of the information security protection level of the whole vehicle under multiple constraints.

[0005] Based on the above background, a method and system for defending against automotive network attacks based on a greedy algorithm under multiple constraints is proposed to solve the problem. Summary of the Invention

[0006] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the description and other accompanying drawings.

[0007] The purpose of this invention is to overcome the above-mentioned shortcomings and provide a method and system for defending against automotive network attacks based on a greedy algorithm under multiple constraints.

[0008] To achieve the above objectives, the technical solution of this invention is: a vehicle network attack defense method based on a greedy algorithm under multiple constraints, applied to the vehicle telematics controller TBOX and associated vehicle security defense system, the method comprising the following steps: S1: Establish a multi-constraint attack defense model, defining the set of attack events to be processed, the ternary attributes of each attack event, and the upper limit of multi-constraints currently available in the system; S2: Calculate the normalized comprehensive benefit density of each attack event. First, convert the multi-dimensional resource consumption into a unified comprehensive cost combined with time, and then calculate the security benefit per unit comprehensive cost based on the comprehensive cost. S3: Based on constraint awareness, iterative greedy selection is performed to screen feasible attack events under time and multi-dimensional resource constraints, and the event with the highest normalized comprehensive benefit density is selected in round by round to generate a defense scheduling sequence. S4: Execute defense actions according to the defense scheduling sequence, and perform dynamic replanning during the defense execution process. When the attack event set, action attribute parameters or system resource constraints change, re-execute steps S1 to S3 to update the defense scheduling sequence.

[0009] In some embodiments, in step S1, the set of attack events to be processed is denoted as E={E1, E2, ..., En}, where n is the number of attack events and n≥1; the ternary attributes include information security weight wi, estimated execution time ti, and multidimensional resource demand vector Ri, where wi is the security protection level improvement value brought by successfully processing attack event Ei and wi>0, ti is the time consumed to complete the defense action corresponding to each event Ei, Ri=[ri1, ri2, ..., rij], m is the system resource dimension and m≥2, and rij is the estimated occupancy of the j-th type of system resource for executing the defense action corresponding to Ei; the upper limit of the multivariate constraints includes the upper limit of the total response time window T and the multidimensional resource available budget vector C=[C1,C2, ..., Cj], where Cj is the total available budget of the j-th type of system resource.

[0010] In some embodiments, the specific process of calculating the normalized comprehensive benefit density in step S2 is as follows: S21: For each type of system resource j, calculate the resource scarcity factor αj. αj is dynamically set based on the historical utilization rate of the system resource, the importance of the resource, or the current remaining proportion. The calculation formula is αj=1 / (current remaining resource amount Cj+ε), where ε is the adjustment amount of other factors, and the value range is 0<ε≤1 to avoid the case where the denominator is 0. S22: For each attack event Ei, calculate the comprehensive cost Costi. The calculation formula is Costi=β*ti+Σj(αj*rij), where β is the weighting coefficient of time cost, used to adjust the relative importance of time and resources in the comprehensive cost, and Σj(αj*rij) is the weighted total resource cost of attack event Ei. S23: For each attack event Ei, calculate the normalized comprehensive benefit density ρi. The calculation formula is ρi=wi / Costi, where ρi is used to quantify the unit comprehensive cost security benefit of the defense action corresponding to the attack event Ei, i.e., "cost-effectiveness".

[0011] In some embodiments, the specific process of performing iterative greedy selection based on constraint awareness in step S3 is as follows: S31: Initialization, setting the selected event set S=∅, used time usedTime=0, and used resource vector usedRes=[0,0,...,0]; S32: Iterative selection, traverse the set E of attack events that are not selected and not marked as infeasible, and perform a fast feasibility check on each candidate attack event Ek. ​​The check condition is usedTime+tk≤T and usedRes[j]+rkj≤Cj for all system resources j. S33: Among all the candidate attack events that have passed the feasibility test, select the event with the largest normalized comprehensive benefit density ρk and denote it as E_best. Add E_best to the set of selected events S and update the used time and used resource vectors, i.e. usedTime+=t_best, usedRes[j]+=r_bestj; S34: Calculate the current remaining resource quantity of the system based on the updated used resource vector, update the resource scarcity factor αj, and recalculate the comprehensive cost Costi and normalized comprehensive benefit density ρi of the remaining unselected attack events based on the updated αj. S35: Repeat steps S32 to S34 until no attack event passes the feasibility test. At this point, the selected event set S is the defense scheduling sequence.

[0012] In some embodiments, in step S4, the triggering conditions for dynamic replanning include the arrival of a new attack event, the system detecting a deviation between the actual and estimated resource consumption, and a change in the upper limit of the total response time window T or the multidimensional resource availability budget vector C. During the dynamic replanning process, steps S1 to S3 are re-executed based on the latest system state parameters to generate an updated defense scheduling sequence and execute it immediately.

[0013] A vehicle network attack defense system based on a greedy algorithm under multiple constraints is deployed in the vehicle-mounted telematics controller (TBOX) to execute vehicle network attack defense methods. The system includes: The multi-dimensional situational awareness module is used to collect attack alarms in real time and determine the three-dimensional attributes of attack events, while continuously monitoring the system's total response time window limit T and the multi-dimensional resource availability budget vector C. The multidimensional greedy scheduling engine, as the core module of the system, is used to calculate the normalized comprehensive benefit density of attack events and generate defense scheduling sequences based on constraint awareness by performing iterative greedy selection. The distributed defense executor is used to receive the defense scheduling sequence, convert it into specific defense instructions, distribute them to the execution nodes of the vehicle network, and monitor the execution status and results of the instructions. The constraint and strategy library stores system resource constraint definitions, resource scarcity factor calculation strategies, information security weight evaluation models, and historical scheduling records, providing data support for the multidimensional greedy scheduling engine.

[0014] In some embodiments, the multi-dimensional situational awareness module includes an attack perception submodule and a resource monitoring submodule. The attack perception submodule is used to collect attack alarm information from the vehicle network, determine the information security weight wi, estimated execution time ti, and multi-dimensional resource demand vector Ri for each attack event based on a preset evaluation model. The resource monitoring submodule is used to collect the system resource status of the vehicle TBOX and each controller in real time, determine the upper limit of the total response time window T and the multi-dimensional resource availability budget vector C, and monitor the deviation between the actual resource consumption and the estimated consumption in real time.

[0015] In some embodiments, the multidimensional greedy scheduling engine includes: The cost and density calculation unit communicates with the multi-dimensional situational awareness module to receive the ternary attributes of attack events and system constraint parameters, and performs calculations on the resource scarcity factor αj, the comprehensive cost Costi, and the normalized comprehensive benefit density ρi. The constraint-aware selection unit, which is connected in communication with the cost and density calculation unit, is used to perform iterative greedy selection and generate a defense scheduling sequence. The resource model update unit is connected to the constraint-aware selection unit and the cost and density calculation unit, respectively. It is used to update the elapsed time, the used resource vector and the current remaining resource quantity of the system after each attack event selection, and feeds back the updated parameters to the cost and density calculation unit to trigger the recalculation of the resource scarcity factor, comprehensive cost and normalized comprehensive benefit density.

[0016] In some embodiments, the distributed defense executor includes an instruction conversion submodule, an instruction distribution submodule, and an execution monitoring submodule. The instruction conversion submodule is used to convert each attack event in the defense scheduling sequence into a defense instruction that can be recognized by the vehicle network execution node. The defense instruction includes at least one of traffic filtering instruction, session reset instruction, ECU isolation instruction, and rule update instruction. The instruction distribution submodule is used to distribute the defense instruction to the corresponding execution node through the vehicle network CAN / FD or Ethernet. The execution node includes at least one of firewall ECU, vehicle gateway, and domain controller. The execution monitoring submodule is used to monitor the execution status and results of the defense instruction in real time. When an execution deviation is detected, feedback information is sent to the multi-dimensional situational awareness module to trigger dynamic replanning.

[0017] In some embodiments, the constraint and policy library is an extensible database that supports adding new system resource constraint dimensions, updating resource scarcity factor calculation strategies, and information security weight evaluation models. The newly added system resource constraint dimensions include at least one of the following: energy consumption of vehicle equipment and impact of functional safety level.

[0018] By adopting the above technical solution, the beneficial effects of the present invention are: 1. Modeling aligned with engineering practice: For the first time, multi-dimensional heterogeneous resource constraints are explicitly and systematically introduced in vehicle-mounted attack defense scheduling, extending the scheduling model from idealized single-dimensional or two-dimensional to a real multi-dimensional environment. This greatly enhances the engineering feasibility of the decision results and effectively avoids defense execution failures caused by the depletion of resources in one dimension.

[0019] 2. High decision-making quality: Through the mechanism of normalized comprehensive benefit density and iteratively updated resource scarcity factor, the system achieves intelligent trade-off between time, security benefits and the consumption of various resources. The system will adaptively avoid bottleneck resources and prioritize defensive actions that consume surplus resources, thereby maximizing the total security benefits under complex constraints.

[0020] 3. Excellent real-time performance: The designed iterative greedy algorithm has a computational complexity of only O(n²*m), which can complete the scheduling calculation within milliseconds, fully meeting the millisecond-level real-time requirements of automotive network attack response and adapting to the computational resource constraints of in-vehicle embedded environments.

[0021] 4. Strong dynamic adaptability: The algorithm has an embedded resource status feedback mechanism, combined with closed-loop optimization of dynamic replanning, which enables the defense system to perceive attack events, resource consumption and system constraint changes in the vehicle network in real time, and update the defense scheduling sequence in a timely manner, thereby improving the robustness and environmental adaptability of the system.

[0022] 5. High scalability: The multivariate constraint model and greedy framework are easy to extend, and new constraint dimensions such as energy consumption and functional safety level impact can be easily incorporated. The system architecture is modular, supports model and policy updates, and provides a foundation for dealing with more complex vehicle safety scenarios in the future.

[0023] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure.

[0024] Undoubtedly, such and other objects of the present invention will become more apparent after the following detailed description of the preferred embodiments, which are illustrated in various accompanying drawings and figures.

[0025] To make the above-mentioned beneficial effects and other objects, features and advantages of the present invention more apparent and understandable, one or more preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0026] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.

[0027] In the accompanying drawings, the same parts use the same reference numerals, and the drawings are schematic and not necessarily drawn to actual scale.

[0028] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only one or more embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on such drawings without creative effort.

[0029] Explanation of key figure labels: Figure 1 This is a flowchart of the automotive network attack defense method based on a greedy algorithm under multiple constraints according to the present invention, showing the four core steps of the method and the specific sub-processes of each step; Figure 2 This is an architecture diagram of the automotive network attack defense system based on a greedy algorithm under multiple constraints, illustrating the four main modules of the system, the internal sub-modules of each module, and the communication connections between modules. Detailed Implementation

[0030] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings and examples, so that the process of how the present invention uses technical means to solve technical problems and achieve technical effects can be fully understood and implemented accordingly. It should be noted that, as long as there is no conflict, the various embodiments and features in the various embodiments of the present invention can be combined with each other, and the resulting technical solutions are all within the protection scope of the present invention.

[0031] Furthermore, numerous specific details are set forth in the following description for illustrative purposes to provide a thorough understanding of the embodiments of the invention. However, it will be apparent to those skilled in the art that the invention may be practiced without the specific details or particular methods described herein.

[0032] Please see Figure 1-2 This invention provides a vehicle network attack defense method based on a greedy algorithm under multiple constraints, applied to the vehicle telematics controller (TBOX) and associated vehicle security defense system. The method includes the following steps: S1: Establish a multi-constraint attack defense model, defining the set of attack events to be processed, the ternary attributes of each attack event, and the upper limit of multi-constraints currently available in the system; Step S1 forms the basis of defense scheduling. By defining the attack event set, the event ternary attribute, and the upper limit of system constraints, the vehicular network attack defense scheduling problem is abstracted into a quantifiable and computable mathematical model. This solves the problem of idealized defense scheduling modeling in existing technologies and its disconnect from engineering practice, and provides a data foundation for subsequent quantitative calculations and greedy decision-making.

[0033] S2: Calculate the normalized comprehensive benefit density of each attack event. First, convert the multi-dimensional resource consumption into a unified comprehensive cost combined with time, and then calculate the security benefit per unit comprehensive cost based on the comprehensive cost. Step S2 is the core quantitative basis for greedy decision-making. By converting the consumption of multi-dimensional resources into a unified comprehensive cost combined with time, and then calculating the safety benefits per unit comprehensive cost, a quantitative evaluation of the "cost-effectiveness" of different defensive actions is achieved. This solves the problem that existing technologies cannot comprehensively evaluate the costs of time and multi-dimensional resources, and provides a scientific selection standard for greedy choices.

[0034] S3: Based on constraint awareness, iterative greedy selection is performed to screen feasible attack events under time and multi-dimensional resource constraints, and the event with the highest normalized comprehensive benefit density is selected in round by round to generate a defense scheduling sequence. Step S3 is the process of generating the defense scheduling sequence. By filtering feasible events round by round and selecting the event with the highest benefit density, an approximately optimal defense scheduling sequence is generated under strict time and multi-dimensional resource constraints. This process has low computational complexity, only O(n²*m), (n is the number of events, m is the resource dimension), and can be completed in milliseconds, meeting the real-time requirements of vehicle network attack response and solving the problem of poor real-time performance of existing algorithms.

[0035] S4: Execute defense actions according to the defense scheduling sequence, and perform dynamic replanning during the defense execution process. When the attack event set, action attribute parameters or system resource constraints change, re-execute steps S1 to S3 to update the defense scheduling sequence. Step S4 is the implementation and optimization of defense scheduling. On the one hand, defense actions are executed according to the generated scheduling sequence to achieve effective defense against attacks on the vehicle network. On the other hand, a dynamic replanning mechanism is introduced to update the scheduling sequence in a timely manner when the system state changes, so that the defense scheduling can adapt to the dynamic changes of the vehicle network. This solves the problem of lack of dynamic adaptability in the existing technology of defense scheduling and improves the robustness of the defense system.

[0036] Through steps S1-S4, a complete vehicle-mounted network attack defense scheduling method is constructed, from modeling and quantitative evaluation to scheduling generation and execution optimization. For the first time, multi-dimensional heterogeneous resource constraints are systematically introduced into vehicle-mounted defense scheduling, thereby realizing constraint-aware real-time greedy scheduling, making the scheduling results more in line with engineering practice, and possessing dynamic optimization capabilities.

[0037] According to some embodiments of this application, optionally, in step S1, the set of attack events to be processed is denoted as E={E1,E2, ..., En}, where n is the number of attack events and n≥1; the ternary attributes include information security weight wi, estimated execution time ti, and multidimensional resource demand vector Ri, where wi is the security protection level improvement value brought by successfully processing attack event Ei and wi>0, ti is the time consumed to complete the defense action corresponding to each event Ei, Ri=[ri1, ri2, ..., rij], m is the system resource dimension and m≥2, and rij is the estimated occupancy of the j-th type of system resource for executing the defense action corresponding to Ei; the multivariate constraint upper limit includes the total response time window upper limit T and the multidimensional resource available budget vector C=[C1,C2, ..., Cj], where Cj is the total available budget of the j-th type of system resource.

[0038] Specifically, the attack event set E={E1,E2,...,En}: defines a set of multiple attack events to be processed detected by the vehicle TBOX, where n is the number of attack events and n≥1. It supports defense scheduling for single and multiple events and is suitable for single and compound attacks on vehicle networks. The three-dimensional attributes quantify each attack event from three dimensions: security benefits (information security weight wi), time cost (estimated execution time ti), and resource cost (multidimensional resource demand vector Ri). wi>0 ensures that the security benefits of the defense action are positive.

[0039] Multi-dimensional constraint upper limit: including the total response time window upper limit T and the multi-dimensional resource availability budget vector C, which quantifies and defines the availability of time resources and multi-dimensional hardware resources of the vehicle system, serving as the core basis for subsequent feasibility verification, ensuring that the generated defense scheduling sequence is within the resource carrying capacity of the vehicle system, and avoiding the failure of defense action execution due to resource exhaustion.

[0040] According to some embodiments of this application, optionally, the j-th type of system resource includes at least two of the following: CPU utilization rate, memory usage, number of HSM operations, and CAN / FD bandwidth utilization rate. The unit of rij matches the unit of measurement of the corresponding system resource, with CPU utilization rate in percentage, memory usage in MB, HSM operation count in times, and communication bus bandwidth utilization rate in percentage.

[0041] Specifically, the system resource types are limited to at least two of the following: CPU utilization, memory usage, HSM operation count, and CAN / FD communication bus bandwidth utilization. These are the core hardware resources of the vehicle-mounted TBOX and vehicle-mounted network, and are also the main resources consumed during the execution of defense actions. They cover core aspects such as vehicle-mounted computing, storage, security encryption, and communication, and are in line with the actual situation of vehicle-mounted engineering.

[0042] The unit of measurement for rij must match the unit of measurement for the corresponding system resources. The specific units for CPU utilization, memory usage, HSM operation count, and communication bus bandwidth utilization must be clearly defined to make the quantification of the multidimensional resource demand vector Ri more standardized and unified, avoid calculation errors caused by inconsistent units, and ensure the accuracy of the calculation of comprehensive cost and benefit density.

[0043] According to some embodiments of this application, optionally, in step S2, the specific process for calculating the normalized comprehensive benefit density is as follows: S21: For each type of system resource j, calculate the resource scarcity factor αj. αj is dynamically set based on the historical utilization rate of the system resource, the importance of the resource, or the current remaining proportion. The calculation formula is αj=1 / (current remaining resource amount Cj+ε), where ε is the adjustment amount of other factors, and the value range is 0<ε≤1 to avoid the case where the denominator is 0. In step S21, the factor is dynamically calculated using the formula αj = 1 / (current remaining resource amount Cj + ε), where ε is an adjustment amount of 0 < ε ≤ 1 to avoid mathematical problems with a denominator of 0. The core design logic of this factor is to give high weight to scarce resources, that is, the less the remaining amount of system resources, the larger the value of αj, so that the consumption of this resource occupies a higher weight in the overall cost. This avoids the excessive consumption of scarce resources when making greedy choices, and solves the bottleneck resource depletion problem caused by not considering resource scarcity in existing technologies.

[0044] S22: For each attack event Ei, calculate the comprehensive cost Costi. The calculation formula is Costi=β*ti+Σj(αj*rij), where β is the weighting coefficient of time cost, used to adjust the relative importance of time and resources in the comprehensive cost, and Σj(αj*rij) is the weighted total resource cost of attack event Ei. In step S22, the time cost (β*ti) and the weighted total resource cost (Σj(αj*rij)) are integrated into a unified comprehensive cost using the formula Costi=β*ti+Σj(αj*rij). Here, β is the weighting coefficient for time cost, which can be flexibly adjusted according to the real-time requirements of the vehicle security scenario. For example, in scenarios with extremely high real-time requirements for attack response, the value of β can be increased to enhance the weight of time cost in the comprehensive cost. This formula achieves unified quantification of time and multi-dimensional resource costs, solving the problem in existing technologies that cannot comprehensively evaluate time and multi-dimensional resource costs.

[0045] S23: For each attack event Ei, calculate the normalized comprehensive benefit density ρi. The calculation formula is ρi=wi / Costi, where ρi is used to quantify the unit comprehensive cost security benefit of the defense action corresponding to the attack event Ei, i.e. "cost-effectiveness". In step S23, the security benefit (wi) is compared with the comprehensive cost (Costi) by the formula ρi=wi / Costi. This quantifies the unit comprehensive cost security benefit of each attack event corresponding to the defense action, i.e., the "cost-effectiveness". The larger the ρi value, the higher the comprehensive cost-effectiveness of the defense action, providing a clear and unique selection criterion for greedy selection.

[0046] Through steps S21-S23, the unified quantification of time and multi-dimensional resource costs and the scientific evaluation of the cost-effectiveness of defensive actions are achieved, providing a core quantitative basis for iterative greedy selection. At the same time, through the dynamic adjustment of resource scarcity factors, the comprehensive cost calculation can adapt to the dynamic changes of system resources, ensuring the real-time nature and accuracy of the evaluation results.

[0047] According to some embodiments of this application, optionally, in step S21, the resource scarcity factor αj changes dynamically with the proportion of the remaining available budget of the corresponding system resources. The lower the proportion of the remaining available budget, the larger the value of αj, so that the consumption of scarce resources occupies a higher weight in the overall cost.

[0048] Specifically, αj changes dynamically with the proportion of remaining available budget for system resources. The proportion of remaining available budget = current remaining resource amount Cj / total available budget. The lower the remaining proportion, the larger the value of αj. The core of this change is scarcity weighting, which amplifies the consumption of scarce resources in the overall cost. Thus, when making a greedy choice, the system will prioritize defensive actions that consume surplus resources and have a high overall benefit density, avoiding excessive consumption of scarce resources and preventing the entire defense scheduling scheme from failing due to the depletion of resources in one dimension.

[0049] According to some embodiments of this application, optionally, in step S3, the specific process of performing iterative greedy selection based on constraint awareness is as follows: S31: Initialization, setting the selected event set S=∅, used time usedTime=0, and used resource vector usedRes=[0,0,...,0]; Step S31 provides an initial state for the iterative greedy selection, ensuring that system resources are unconsumed and selected events are empty before the iteration begins.

[0050] S32: Iterative selection, traverse the set E of attack events that are not selected and not marked as infeasible, and perform a fast feasibility check on each candidate attack event Ek. ​​The check condition is usedTime+tk≤T and usedRes[j]+rkj≤Cj for all system resources j. Step S32 performs a dual feasibility check on each candidate event Ek in terms of time and resources. The check conditions are usedTime+tk≤T and usedRes[j]+rkj≤Cj. Only feasible events that pass the check are retained to ensure that the subsequent selected defense actions are within the system's time and resource constraints and to avoid selecting unexecutable defense actions.

[0051] S33: Among all the candidate attack events that have passed the feasibility test, select the event with the largest normalized comprehensive benefit density ρk and denote it as E_best. Add E_best to the set of selected events S and update the used time and used resource vectors, i.e. usedTime+=t_best, usedRes[j]+=r_bestj; Step S33 is the core of the greedy algorithm, which is to select the current best in each round. By selecting the local best in each round, a globally approximate optimal defense scheduling sequence is finally obtained, which maximizes the total security benefits while ensuring computational efficiency.

[0052] S34: Calculate the current remaining resource quantity of the system based on the updated used resource vector, update the resource scarcity factor αj, and recalculate the comprehensive cost Costi and normalized comprehensive benefit density ρi of the remaining unselected attack events based on the updated αj. Step S34 improves the traditional greedy algorithm by dynamically updating parameters, so that the basis for each round of greedy selection can adapt to the dynamic changes of system resources, thus solving the problem that the traditional greedy algorithm has fixed parameters and cannot cope with dynamic changes in resources.

[0053] S35: Repeat steps S32 to S34 until no attack event can pass the feasibility test. At this point, the selected event set S is the defense scheduling sequence. Step S35 repeats the above steps until there are no feasible events. At this point, the selected event set S is the defense scheduling sequence. The iteration termination condition is clear, ensuring the termination of the algorithm.

[0054] Through steps S31-S35, a near-optimal defense scheduling sequence is generated under time and multi-dimensional resource constraints by iterating through feasibility checks, local optimal selection, and dynamic parameter updates. The algorithm has low computational complexity, only O(n²*m), and can complete the calculation in milliseconds, meeting the real-time requirements of vehicle network attack response. At the same time, through dynamic parameter updates, the scheduling sequence can adapt to the dynamic changes of system resources, thereby improving the scientificity and feasibility of the scheduling scheme.

[0055] According to some embodiments of this application, optionally, in step S4, the triggering conditions for dynamic replanning include the arrival of a new attack event, the system detecting a deviation between the actual and estimated resource consumption, and a change in the upper limit of the total response time window T or the multidimensional resource availability budget vector C. During the dynamic replanning process, steps S1 to S3 are re-executed based on the latest system state parameters to generate an updated defense scheduling sequence and execute it immediately.

[0056] Specifically, the triggering conditions are: the arrival of a new attack event, a deviation between the actual and estimated resource consumption, and a change in T or C. These are the most common system state change scenarios in the process of attack defense of vehicle networks, covering changes in three core dimensions: attack events, resource consumption, and system constraints, to ensure that the system can promptly perceive the dynamic changes of the vehicle network. Execution process: After dynamic replanning is triggered, steps S1 to S3 are re-executed based on the latest system state parameters to generate an updated defense scheduling sequence and execute it immediately. This achieves closed-loop dynamic optimization of defense scheduling, enabling the defense system to adapt to changes in the vehicle network in real time and avoid defense scheduling failure due to changes in system state.

[0057] A vehicle network attack defense system based on a greedy algorithm under multiple constraints is deployed in the vehicle-mounted telematics controller (TBOX) to execute vehicle network attack defense methods. The system includes: The multi-dimensional situational awareness module is used to collect attack alarms in real time and determine the three-dimensional attributes of attack events, while continuously monitoring the system's total response time window limit T and the multi-dimensional resource availability budget vector C. The multi-dimensional situational awareness module is the perception layer of the system, and its function is to collect data and monitor the status. On the one hand, it collects attack alarms and determines the three-dimensional attributes of attack events, providing attack event data for subsequent calculation and scheduling. On the other hand, it continuously monitors the system's time and resource constraint parameters, providing system status data for scheduling, and at the same time monitors resource consumption deviations, providing a trigger basis for dynamic replanning. This solves the problems of incomplete situational awareness and inability to quantify attack events and system status in the existing system.

[0058] The multidimensional greedy scheduling engine, as the core module of the system, is used to calculate the normalized comprehensive benefit density of attack events and generate defense scheduling sequences based on constraint awareness by performing iterative greedy selection. The multidimensional greedy scheduling engine is the core computing layer of the system. As the brain of the system, its core function is to quantify calculation and generate schedules. It receives data collected by the multi-dimensional situational awareness module, calculates the normalized comprehensive benefit density, and performs iterative greedy selection based on constraint awareness to generate defense scheduling sequences. It realizes the transformation from data to scheduling sequences and is the core hardware carrier of the algorithm of this invention.

[0059] The distributed defense executor is used to receive the defense scheduling sequence, convert it into specific defense instructions, distribute them to the execution nodes of the vehicle network, and monitor the execution status and results of the instructions. The distributed defense executor is the system's execution layer. Its core function is scheduling implementation and execution monitoring. It converts scheduling sequences into specific defense instructions and distributes them to the vehicle network execution nodes. At the same time, it monitors the execution status and results of the instructions, realizing the engineering implementation of defense scheduling and thus solving the problem of the disconnect between scheduling schemes and execution links in existing technologies.

[0060] The constraint and strategy library stores system resource constraint definitions, resource scarcity factor calculation strategies, information security weight evaluation models, and historical scheduling records, providing data support for the multidimensional greedy scheduling engine. The constraint and strategy library is the data support layer of the system. Its core function is data storage and strategy support. It stores resource constraint definitions, scarcity factor calculation strategies, weight evaluation models, and historical scheduling records, providing data and strategy support for the calculation and decision-making of the multidimensional greedy scheduling engine. At the same time, historical scheduling records can provide a data foundation for subsequent algorithm optimization.

[0061] The above system constructs a complete vehicle network attack defense system encompassing perception, computation, execution, and support. It enables the hardware-based and engineered execution of defense methods, with each module having a clear division of labor and working collaboratively. This allows the defense methods to be implemented and executed in the vehicle's TBOX. Furthermore, the system architecture is modular, making it easy to implement and maintain.

[0062] According to some embodiments of this application, optionally, the multi-dimensional situational awareness module includes an attack perception submodule and a resource monitoring submodule. The attack perception submodule is used to collect attack alarm information of the vehicle network, and determine the information security weight wi, estimated execution time ti, and multi-dimensional resource demand vector Ri for each attack event based on a preset evaluation model. The resource monitoring submodule is used to collect the system resource status of the vehicle TBOX and each controller in real time, determine the upper limit of the total response time window T and the multi-dimensional resource availability budget vector C, and monitor the deviation between the actual resource consumption and the estimated consumption in real time.

[0063] Specifically, the attack perception submodule is responsible for the perception and quantification of attack events. It collects attack alarm information from the vehicle network, determines the wi, ti, and Ri of attack events based on a preset evaluation model, realizes the quantitative evaluation of attack events, and provides standardized attack event data for subsequent calculations.

[0064] Resource monitoring submodule: It is specifically responsible for monitoring the system resource status, collecting the system resource status of the vehicle TBOX and each controller in real time, determining T and C, and monitoring the deviation between actual and estimated resource consumption. It realizes real-time monitoring of system resource status and provides standardized system status data for scheduling generation and dynamic replanning.

[0065] According to some embodiments of this application, optionally, the multidimensional greedy scheduling engine includes: The cost and density calculation unit communicates with the multi-dimensional situational awareness module to receive the ternary attributes of attack events and system constraint parameters, and performs calculations on the resource scarcity factor αj, the comprehensive cost Costi, and the normalized comprehensive benefit density ρi. The cost and density calculation unit generates αj, Costi, and ρi, which are quantitative calculation units for greedy decision-making. This modularizes the quantitative calculation, thereby improving the system's computational efficiency.

[0066] The constraint-aware selection unit, which is connected in communication with the cost and density calculation unit, is used to perform iterative greedy selection and generate a defense scheduling sequence. The constraint-aware selection unit is used to receive the quantization calculation results, execute the iterative greedy selection process, and generate the defense scheduling sequence. It is the scheduling generation unit of the greedy decision-making and realizes the modularization of scheduling generation.

[0067] The resource model update unit is connected to the constraint-aware selection unit and the cost and density calculation unit, respectively. It is used to update the elapsed time, the used resource vector and the current remaining resource quantity of the system after each attack event selection, and feeds back the updated parameters to the cost and density calculation unit to trigger the recalculation of the resource scarcity factor, comprehensive cost and normalized comprehensive benefit density.

[0068] The resource model update unit, acting as the parameter update hub, updates the elapsed time, used resource vector, and remaining resource quantity after each selection event, and feeds the updated parameters back to the cost and density calculation unit to trigger parameter recalculation, thereby realizing dynamic parameter updates. This is a hardware manifestation of the improvement of the traditional greedy algorithm.

[0069] According to some embodiments of this application, optionally, the distributed defense executor includes an instruction conversion submodule, an instruction distribution submodule, and an execution monitoring submodule. The instruction conversion submodule is used to convert each attack event in the defense scheduling sequence into a defense instruction that can be recognized by the vehicle network execution node. The defense instruction includes at least one of traffic filtering instruction, session reset instruction, ECU isolation instruction, and rule update instruction. The instruction distribution submodule is used to distribute the defense instruction to the corresponding execution node through the vehicle network CAN / FD or Ethernet. The execution node includes at least one of firewall ECU, vehicle gateway, and domain controller. The execution monitoring submodule is used to monitor the execution status and result of the defense instruction in real time. When an execution deviation is detected, feedback information is sent to the multi-dimensional situational awareness module to trigger dynamic replanning.

[0070] Specifically, the instruction conversion submodule is responsible for converting scheduling sequences into defensive instructions. It converts attack events in the defensive scheduling sequence into defensive instructions that can be recognized by the vehicle execution node, including traffic filtering, session reset, ECU isolation, rule update, etc., to realize the engineering conversion of scheduling sequences and solve the problem of incompatibility between scheduling sequences and execution node instruction formats.

[0071] Command distribution submodule: It is specifically responsible for distributing defense commands. It distributes commands to execution nodes such as firewall ECU, vehicle gateway, and domain controller through the vehicle network CAN / FD or Ethernet, so as to achieve accurate distribution of defense commands and adapt to the communication architecture of the vehicle network.

[0072] The execution monitoring submodule is specifically responsible for monitoring and feedback of execution status. It monitors the execution status and results of defense commands in real time. When execution deviations are detected, it sends feedback information to the multi-dimensional situational awareness module to trigger dynamic replanning, thereby realizing closed-loop monitoring of the execution process and improving the reliability of defense execution.

[0073] According to some embodiments of this application, optionally, the constraint and strategy library is an extensible database that supports adding new system resource constraint dimensions, updating resource scarcity factor calculation strategies, and information security weight evaluation models. The newly added system resource constraint dimensions include at least one of vehicle equipment energy consumption and functional safety level impact.

[0074] Specifically, the constraint and policy library is an extensible database, which enhances the system's scalability and future adaptability. This allows the system to easily incorporate new constraint dimensions and update calculation / evaluation models as the vehicle's electronic and electrical architecture evolves, without requiring significant modifications to the overall system architecture. This reduces the cost of system upgrades and maintenance, and provides a foundation for addressing more complex vehicle safety scenarios in the future.

[0075] Example of a car network attack defense system: System Configuration: The automotive network attack defense system based on a greedy algorithm under multiple constraints is deployed on the vehicle-mounted TBOX. The system includes a multi-dimensional situational awareness module, a multi-dimensional greedy scheduling engine, a distributed defense executor, and a constraint and policy library. The multi-dimensional greedy scheduling engine includes a cost and density calculation unit, a constraint awareness selection unit, and a resource model update unit. The vehicle-mounted TBOX communicates with the firewall ECU, body domain controller, and gateway ECU via CAN / FD Ethernet. The system presets a time cost weight coefficient β=1.0, and other factor adjustment amounts ε=0.1.

[0076] System constraint parameters: The multi-dimensional situational awareness module monitors the current upper limits of the system's multi-dimensional constraints as follows: total response time window upper limit T=10ms, CPU available budget C_cpu=70%, memory available increment C_mem=5MB, HSM available number of operations C_hsm=8 times; system resource dimension m=3, namely CPU, memory, and HSM.

[0077] Attack event parameters: The multi-dimensional situational awareness module collected three attack events E1, E2, and E3 to be processed, and determined their ternary attributes as follows: 1. E1: wi=8, ti=2ms, Ri=[30%, 1MB, 0 times]; 2. E2: wi=15, ti=5ms, Ri=[20%, 0.5MB, 3 times]; 3. E3: wi=12, ti=8ms, Ri=[50%, 4MB, 1 time].

[0078] Steps for implementing automotive network attack defense methods: Step S1: Establish a multi-constraint attack defense model: Define the attack event set E={E1,E2,E3}, specify the wi, ti, and Ri for each event, and set the system constraint upper limit T=10ms and C=[80%,5MB,8 times] to complete the modeling.

[0079] Step S2: Calculate the initial normalized comprehensive benefit density: S21: Calculate the initial resource scarcity factor, ensuring the initial remaining resource amount is consistent with the total available budget. α_cpu=1 / (70%+0.1)=1.25, α_mem=1 / (5+0.1)≈0.2, α_hsm=1 / (8+0.1)≈0.125.

[0080] S22: Calculate the overall cost. Cost1=1*2+(1.25*30+0.2*1+0.125*0)=39.7, Cost2=1*5+(1.25*20+0.2*0.5+0.125*3)=30.475, Cost3=1*8+(1.25*50+0.2*4+0.125*1)=71.325.

[0081] S23: Calculate the normalized comprehensive benefit density, ρ1=8 / 39.7≈0.201, ρ2=15 / 30.475≈0.492, ρ3=12 / 71.325≈0.168.

[0082] Step S3: Constraint-aware iterative greedy selection: S31: Initialization, S=∅, usedTime=0, usedRes=[0,0,0]; S32: In the first iteration, E={E1,E2,E3} is traversed. All pass the feasibility test. E2, which has the largest ρ, is selected and added to S. UsedTime=5ms and usedRes=[20%, 0.5MB, 3 times] are updated. The resource model update unit calculates the remaining resources: CPU=50%, memory=4.5MB, HSM=5 times. α_cpu=1 / (50%+0.1)≈1.67, α_mem=1 / (4.5+0.1)≈0.22, α_hsm=1 / (5+0.1)≈0.2. The cost and density calculation unit recalculates the parameters of the remaining events E1 and E3. Cost1'=1*2+(1.67*30+0.22*1+0.2*0)=2+50.32=52.32;ρ1'≈0.153; Cost3'=1*8+(1.67*50+0.22*4+0.2*1)=8+84.38=92.38; ρ3'≈0.130.

[0083] S33: In the second iteration, S={E1,E3} is traversed. E1 passes the feasibility test, while E3 fails because usedTime(5)+8=13>10. E1 is selected to be added to S, and usedTime=7ms and usedRes=[50%,1.5MB,3 times] are updated. The resource model update unit calculates the remaining resources: CPU=30%, memory=3.5MB, HSM=5 times, updates α and recalculates the parameters of E3. E3 still fails the feasibility test.

[0084] S34: Third iteration, no feasible events, iteration terminates, final defense scheduling sequence S=[E2,E1].

[0085] Step S4, Defense Execution and Dynamic Replanning: The distributed defense actuator converts E2 and E1 into corresponding ECU isolation commands and traffic filtering commands, which are then distributed to the gateway ECU and firewall ECU via CAN / FD Ethernet and executed sequentially. During execution, the system monitors resource consumption and attack event status in real time. No new attack events or resource consumption deviations are detected, so there is no need to trigger dynamic replanning. The total security weight is 8 + 15 = 23, maximizing the overall vehicle security protection level.

[0086] In this embodiment, if a traditional one-dimensional greedy algorithm is used to select based solely on w / t, although the result is the same, it does not consider the dynamic changes in resource scarcity, which can easily lead to suboptimal decisions in complex and compound attack scenarios. Furthermore, ignoring resource constraints when making greedy selections may generate infeasible scheduling sequences. The method of this invention achieves constraint-aware greedy decision-making through dynamically updated resource scarcity factors and comprehensive benefit density, maximizing total security gains while ensuring computational efficiency, thus verifying the effectiveness and superiority of this invention.

[0087] It should be understood that the embodiments disclosed herein are not limited to the specific processing steps or materials disclosed herein, but should be extended to equivalent substitutions of such features as understood by those skilled in the art. It should also be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting.

[0088] The term "embodiment" in this specification refers to a specific feature or characteristic described in connection with an embodiment that is included in at least one embodiment of the invention. Therefore, phrases or "embodiments" appearing in various places throughout the specification do not necessarily refer to the same embodiment.

[0089] Furthermore, the described features or characteristics can be incorporated into one or more embodiments in any other suitable manner. In the above description, specific details, such as thickness, quantity, etc., are provided to provide a comprehensive understanding of embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented without the aforementioned specific details or may be implemented using other methods, components, materials, etc.

Claims

1. A method for defending against automotive network attacks based on a greedy algorithm under multiple constraints, characterized in that, The method, applied to an in-vehicle telematics controller (TBOX) and associated in-vehicle security defense system, includes the following steps: S1: Establish a multi-constraint attack defense model, defining the set of attack events to be processed, the ternary attributes of each attack event, and the upper limit of multi-constraints currently available in the system; S2: Calculate the normalized comprehensive benefit density of each attack event. First, convert the multi-dimensional resource consumption into a unified comprehensive cost combined with time, and then calculate the security benefit per unit comprehensive cost based on the comprehensive cost. S3: Based on constraint awareness, iterative greedy selection is performed to screen feasible attack events under time and multi-dimensional resource constraints, and the event with the highest normalized comprehensive benefit density is selected in round by round to generate a defense scheduling sequence. S4: Execute defense actions according to the defense scheduling sequence, and perform dynamic replanning during the defense execution process. When the attack event set, action attribute parameters or system resource constraints change, re-execute steps S1 to S3 to update the defense scheduling sequence.

2. The automotive network attack defense method based on a greedy algorithm under multiple constraints as described in claim 1, characterized in that, In step S1, the set of attack events to be processed is denoted as E={E1, E2, ..., En}, where n is the number of attack events and n≥1; the ternary attributes include information security weight wi, estimated execution time ti, and multidimensional resource demand vector Ri, where wi is the security protection level improvement value brought by successfully processing attack event Ei and wi>0, ti is the time consumed to complete the defense action corresponding to each event Ei, Ri=[ri1, ri2, ..., rij], m is the system resource dimension and m≥2, and rij is the estimated occupancy of the j-th type of system resource for executing the defense action corresponding to Ei; the upper limit of the multivariate constraints includes the upper limit of the total response time window T and the multidimensional resource available budget vector C=[C1,C2, ..., Cj], where Cj is the total available budget of the j-th type of system resource.

3. The vehicle network defense method based on a greedy algorithm under multiple constraints as described in claim 2, characterized in that, In step S2, the specific process for calculating the normalized comprehensive benefit density is as follows: S21: For each type of system resource j, calculate the resource scarcity factor αj. αj is dynamically set based on the historical utilization rate of the system resource, the importance of the resource, or the current remaining proportion. The calculation formula is αj=1 / (current remaining resource amount Cj+ε), where ε is the adjustment amount of other factors, and the value range is 0<ε≤1 to avoid the case where the denominator is 0. S22: For each attack event Ei, calculate the comprehensive cost Costi. The calculation formula is Costi=β*ti+Σj(αj*rij), where β is the weighting coefficient of time cost, used to adjust the relative importance of time and resources in the comprehensive cost, and Σj(αj*rij) is the weighted total resource cost of attack event Ei. S23: For each attack event Ei, calculate the normalized comprehensive benefit density ρi. The calculation formula is ρi=wi / Costi, where ρi is used to quantify the unit comprehensive cost security benefit of the defense action corresponding to the attack event Ei, i.e., "cost-effectiveness".

4. The automotive network attack defense method based on a greedy algorithm under multiple constraints as described in claim 3, characterized in that, In step S3, the specific process of performing iterative greedy selection based on constraint awareness is as follows: S31: Initialization, setting the selected event set S=∅, used time usedTime=0, and used resource vector usedRes=[0,0,...,0]; S32: Iterative selection, traverse the set E of attack events that are not selected and not marked as infeasible, and perform a fast feasibility check on each candidate attack event Ek. ​​The check condition is usedTime+tk≤T and usedRes[j]+rkj≤Cj for all system resources j. S33: Among all the candidate attack events that have passed the feasibility test, select the event with the largest normalized comprehensive benefit density ρk and denote it as E_best. Add E_best to the set of selected events S and update the used time and used resource vectors, i.e. usedTime+=t_best, usedRes[j]+=r_bestj; S34: Calculate the current remaining resource quantity of the system based on the updated used resource vector, update the resource scarcity factor αj, and recalculate the comprehensive cost Costi and normalized comprehensive benefit density ρi of the remaining unselected attack events based on the updated αj. S35: Repeat steps S32 to S34 until no attack event passes the feasibility test. At this point, the selected event set S is the defense scheduling sequence.

5. The automotive network attack defense method based on a greedy algorithm under multiple constraints as described in claim 1, characterized in that, In step S4, the triggering conditions for dynamic replanning include the arrival of new attack events, the system detecting a deviation between actual and estimated resource consumption, and changes in the upper limit of the total response time window T or the multidimensional resource availability budget vector C. During the dynamic replanning process, steps S1 to S3 are re-executed based on the latest system state parameters to generate an updated defense scheduling sequence and execute it immediately.

6. A car network attack defense system based on a greedy algorithm under multiple constraints, characterized in that, Deployed in an in-vehicle telematics controller (TBOX) for executing the vehicle network attack defense method as described in any one of claims 1-5, the system includes: The multi-dimensional situational awareness module is used to collect attack alarms in real time and determine the three-dimensional attributes of attack events, while continuously monitoring the system's total response time window limit T and the multi-dimensional resource availability budget vector C. The multidimensional greedy scheduling engine, as the core module of the system, is used to calculate the normalized comprehensive benefit density of attack events and generate defense scheduling sequences based on constraint awareness by performing iterative greedy selection. The distributed defense executor is used to receive the defense scheduling sequence, convert it into specific defense instructions, distribute them to the execution nodes of the vehicle network, and monitor the execution status and results of the instructions. The constraint and strategy library stores system resource constraint definitions, resource scarcity factor calculation strategies, information security weight evaluation models, and historical scheduling records, providing data support for the multidimensional greedy scheduling engine.

7. The automotive network attack defense system based on a greedy algorithm under multiple constraints as described in claim 6, characterized in that, The multi-dimensional situational awareness module includes an attack perception submodule and a resource monitoring submodule. The attack perception submodule is used to collect attack alarm information from the vehicle network, and determines the information security weight wi, estimated execution time ti, and multi-dimensional resource demand vector Ri for each attack event based on a preset evaluation model. The resource monitoring submodule is used to collect the system resource status of the vehicle TBOX and each controller in real time, determine the upper limit of the total response time window T and the multi-dimensional resource availability budget vector C, and monitor the deviation between the actual resource consumption and the estimated consumption in real time.

8. The automotive network attack defense system based on a greedy algorithm under multiple constraints as described in claim 6, characterized in that, The multidimensional greedy scheduling engine includes: The cost and density calculation unit communicates with the multi-dimensional situational awareness module to receive the ternary attributes of attack events and system constraint parameters, and performs calculations on the resource scarcity factor αj, the comprehensive cost Costi, and the normalized comprehensive benefit density ρi. The constraint-aware selection unit, which is connected in communication with the cost and density calculation unit, is used to perform iterative greedy selection and generate a defense scheduling sequence. The resource model update unit is connected to the constraint-aware selection unit and the cost and density calculation unit, respectively. It is used to update the elapsed time, the used resource vector and the current remaining resource quantity of the system after each attack event selection, and feeds back the updated parameters to the cost and density calculation unit to trigger the recalculation of the resource scarcity factor, comprehensive cost and normalized comprehensive benefit density.

9. The automotive network attack defense system based on a greedy algorithm under multiple constraints as described in claim 6, characterized in that, The distributed defense executor includes an instruction conversion submodule, an instruction distribution submodule, and an execution monitoring submodule. The instruction conversion submodule converts each attack event in the defense scheduling sequence into a defense instruction that can be recognized by the vehicle network execution nodes. The defense instructions include at least one of traffic filtering instructions, session reset instructions, ECU isolation instructions, and rule update instructions. The instruction distribution submodule distributes the defense instructions to the corresponding execution nodes via the vehicle network CAN / FD or Ethernet. The execution nodes include at least one of firewall ECUs, vehicle gateways, and domain controllers. The execution monitoring submodule monitors the execution status and results of the defense instructions in real time. When an execution deviation is detected, it sends feedback information to the multi-dimensional situational awareness module to trigger dynamic replanning.

10. The automotive network attack defense system based on a greedy algorithm under multiple constraints as described in claim 6, characterized in that, The constraint and strategy library is an extensible database that supports adding new system resource constraint dimensions, updating resource scarcity factor calculation strategies, and information security weight evaluation models. The new system resource constraint dimensions include at least one of the following: energy consumption of on-board equipment and impact of functional safety level.