Ship navigation system fault injection hardware-in-the-loop test method, system and equipment

By employing a hardware-in-the-loop testing method, and utilizing fault injection operators to modify simulation data at the data interface layer, a fault simulation data set is generated, and key performance indicators are obtained in real time. This solves the reliability and comprehensiveness issues of ship navigation system testing in existing technologies, and achieves safe and controllable system testing.

CN122239686APending Publication Date: 2026-06-19BEIJING DIGITAL YIZHI TECH DEV CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING DIGITAL YIZHI TECH DEV CO LTD
Filing Date
2026-05-25
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing ship navigation system testing methods cannot comprehensively and reliably assess the system's fault tolerance and recovery capabilities. Pure simulation lacks real hardware interface characteristics, while actual ship sea trials are high-risk, costly, and have uncontrollable failure scenarios.

Method used

This paper provides a hardware-in-the-loop testing method for fault injection in ship navigation systems. By initializing test scenario data and fault test plans, simulation is performed based on ship models and sea state parameters. The simulation data is modified at the data interface layer using fault injection operators to generate a fault simulation data set. Key performance indicators are acquired in real time, triggering event management strategies for system evaluation.

Benefits of technology

It enables controllable fault injection without affecting the safety of physical equipment, comprehensively covers fault scenarios, provides realistic and reliable system testing, and can quantitatively evaluate the safety, stability and fault tolerance performance of ship navigation systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122239686A_ABST
    Figure CN122239686A_ABST
Patent Text Reader

Abstract

This invention provides a hardware-in-the-loop testing method, system, and device for fault injection in ship navigation systems, relating to the technical field of ship navigation system testing. The method includes: initializing test scenario data for the ship navigation system and setting a fault test plan; obtaining a simulation data set based on the test scenario data; modifying parameters according to the fault test plan to obtain a fault simulation data set corresponding to the fault type; sending the fault simulation data set to the ship navigation system and acquiring the key performance indicators of the ship navigation system in real time; and performing performance evaluation based on the key performance indicators to obtain the test results of the ship navigation system. This invention achieves comprehensive and reliable system testing of ship navigation systems through controllable scenario configuration combined with simulation operation and controllable fault injection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of ship navigation system testing, and more specifically, to a hardware-in-the-loop testing method, system, and equipment for fault injection in ship navigation systems. Background Technology

[0002] With the rapid development of intelligent shipping and unmanned vessel technologies, the ship navigation system, as a core platform integrating multi-source sensing, intelligent decision-making, and execution control, is crucial for ensuring navigation safety. Ships operate in complex marine environments for extended periods, making them susceptible to malfunctions such as sensor drift, communication anomalies, actuator failures, and sudden environmental changes. If the system cannot quickly identify and handle these issues, it can easily lead to navigation deviations, collisions, or even safety accidents.

[0003] In related technologies, testing of ship navigation systems mainly employs two methods: pure simulation and actual sea trials. However, pure simulation lacks the characteristics of real hardware interfaces and cannot reproduce real operating conditions such as hardware latency and signal noise; while actual sea trials are high-risk, costly, and involve uncontrollable failure scenarios, making it difficult to systematically reproduce various extreme failures and comprehensively assess the system's fault tolerance and recovery capabilities. Therefore, existing ship navigation system testing methods are insufficient to meet the verification needs of ship navigation systems in the current era of intelligent shipping. Summary of the Invention

[0004] The problem addressed by this invention is how to conduct comprehensive and reliable system testing of ship navigation systems.

[0005] To address the aforementioned problems, this invention provides a method, system, and device for hardware-in-the-loop testing of fault injection in ship navigation systems.

[0006] In a first aspect, the present invention provides a hardware-in-the-loop testing method for fault injection in a ship navigation system, comprising: Initialize the test scenario data of the ship navigation system and set the fault test plan of the ship navigation system. The test scenario data includes the ship model, sea state parameters, and initial navigation state parameters. The fault test plan includes the fault type and the injection strategy corresponding to the fault type. Based on the ship model, the sea state parameters, and the initial navigation state parameters, a simulation operation is performed to obtain the simulation data set of the ship navigation system. According to the fault type and the corresponding injection strategy, the simulation data set is intercepted and parameterized at the data interface layer of the ship navigation system to obtain the fault simulation data set corresponding to the fault type. The fault simulation data set is sent to the ship navigation system, and the key performance indicators of the ship navigation system under the fault type are obtained in real time. Based on the key performance indicators, a preset event management strategy corresponding to the fault type is triggered to obtain complete test data of the ship navigation system under the fault type; Based on the complete test data of the fault type, the performance of the ship navigation system is evaluated to obtain a system evaluation score for the ship navigation system, and the test result of the ship navigation system is determined based on the system evaluation score.

[0007] Optionally, the simulation run based on the ship model, the sea state parameters, and the initial navigation state parameters to obtain the simulation data set of the ship navigation system includes: Based on the ship model, the sea state parameters, and the initial navigation state parameters, a joint simulation is performed to obtain the sensor data, communication data, control commands, and environmental parameters of the ship navigation system. The simulation data set of the ship navigation system is constructed based on the sensor data, communication data, control commands, and environmental parameters of the ship navigation system.

[0008] Optionally, the step of intercepting and parametrically modifying the simulation data set at the data interface layer of the ship navigation system according to the fault type and the corresponding injection strategy to obtain the fault simulation data set corresponding to the fault type includes: Based on the injection strategy corresponding to the fault type, determine the fault injection operator corresponding to the fault type; At the fault trigger time corresponding to the fault type, the simulation data set is intercepted at the data interface layer of the ship navigation system. The fault injection operator injects fault data of the fault type into the simulation data set to generate the fault simulation data set.

[0009] Optionally, the step of injecting fault data of the fault type into the simulation dataset through the fault injection operator to generate the fault simulation dataset includes: When the fault type is a sensor fault, the fault injection operator is used to add bias data and / or noise data to the sensor data in the simulation dataset to generate the fault simulation dataset. When the fault type is a communication fault, the fault injection operator adds delay data and / or packet loss data to the communication data in the simulation dataset to generate the fault simulation dataset. When the fault type is a propulsion system fault, the fault injection operator adds zero-setting data and / or decay data and / or delay data to the control instructions of the simulation data set to generate the fault simulation data set. When the fault type is an environmental fault, the fault injection operator is used to add perturbation data and / or delete some information of the environmental parameters in the simulation dataset to generate the fault simulation dataset.

[0010] Optionally, sending the fault simulation data set to the ship navigation system and acquiring the key performance indicators of the ship navigation system under the fault type in real time includes: The fault simulation data set is sent to the ship navigation system in real time. The system response data output by the ship navigation system under the excitation of the fault simulation data set is received and collected. The system response data includes at least the ship's real-time trajectory, heading, speed, rudder angle, propeller speed and system alarm information. Based on the system response data, one or more of the key performance indicators under the fault type are determined. The key performance indicators include at least one of the following: trajectory tracking deviation, heading control overshoot error, thruster status anomaly index, navigation control command anomaly value, collision risk index, and runaway risk probability.

[0011] Optionally, the step of triggering a preset event management strategy corresponding to the fault type based on the key performance indicators to obtain complete test data of the ship navigation system under the fault type includes: The key performance indicators are compared with the preset safety thresholds corresponding to the key performance indicators; When the key performance indicator exceeds the preset safety threshold, the event management strategy corresponding to the fault type is triggered; After the event management strategy is triggered, the entire link data of the ship navigation system is collected synchronously based on a unified time base; A test signature is generated based on the end-to-end data using a hash function; Based on the full-link data and the test signature, construct the complete test data for the fault type.

[0012] Optionally, the step of performing a performance evaluation on the ship navigation system based on the complete test data of the fault type to obtain a system evaluation score for the ship navigation system includes: The complete test data for the fault type is analyzed to determine the safety index, stability index, and fault tolerance performance index of the ship navigation system under each fault type. The safety index, stability index, and fault tolerance performance index under each fault type are quantified to obtain quantified values ​​of the safety index, stability index, and fault tolerance performance index. By using a pre-defined templated scoring model, the system evaluation score of the ship navigation system under the fault type is obtained by weighting the quantified values ​​of the safety index, the stability index, and the fault tolerance performance index.

[0013] Optionally, determining the test result of the ship navigation system based on the system evaluation score includes: The system evaluation score is compared with a preset scoring range, which includes a normal range, a warning range, and an abnormal range. The test result of the ship navigation system for the fault type is determined based on the preset scoring range into which the system evaluation score falls; Specifically, when the system evaluation score is within the normal range, the test result for the fault type is determined to be passed; When the system evaluation score is within the warning range, the test result for the fault type is determined to be a warning; When the system evaluation score is in the abnormal range, the test result for the fault type is determined to be unsuccessful.

[0014] Secondly, the present invention provides a hardware-in-the-loop testing system for injecting faults into a ship navigation system, comprising: An initialization unit is used to initialize the test scenario data of the ship navigation system and set the fault test plan of the ship navigation system. The test scenario data includes the ship model, sea state parameters, and initial navigation state parameters. The fault test plan includes the fault type and the injection strategy corresponding to the fault type. The simulation unit is used to perform simulation based on the ship model, the sea state parameters, and the initial navigation state parameters to obtain a set of simulation data for the ship navigation system. The fault injection unit is used to intercept and parametrically modify the simulation data set at the data interface layer of the ship navigation system according to the fault type and the injection strategy corresponding to the fault type, so as to obtain the fault simulation data set corresponding to the fault type. The data acquisition unit is used to send the fault simulation data set to the ship navigation system and acquire the key performance indicators of the ship navigation system under the fault type in real time. The data integration unit is used to trigger a preset event management strategy corresponding to the fault type based on the key performance indicators, and obtain complete test data of the ship navigation system under the fault type. An evaluation unit is used to evaluate the performance of the ship navigation system based on the complete test data of the fault type, obtain a system evaluation score for the ship navigation system, and determine the test result of the ship navigation system based on the system evaluation score.

[0015] Thirdly, the present invention provides an electronic device, comprising: a processor and a memory, wherein the memory is used to store a computer program; When the computer program is loaded by the processor, it causes the processor to execute the hardware-in-the-loop test method for injecting faults into the ship navigation system as described above.

[0016] The hardware-in-the-loop testing method, system, and equipment for ship navigation system fault injection of the present invention can construct a test environment that closely matches actual navigation by initializing test scenario data and setting fault test plans, and achieve standardized arrangement of fault scenarios, providing stable and controllable preconditions for testing. By conducting simulation operation based on ship model, sea state parameters, and initial navigation state parameters, a simulation data set that closely matches the actual navigation state can be generated, ensuring the authenticity and representativeness of the test data. By intercepting and parameterizing the simulation data set at the data interface layer to generate a fault simulation data set, it is possible to achieve this without affecting the safety of physical equipment. This invention enables the controlled injection of various faults, effectively mitigating the risks of real-ship testing and compensating for the lack of realism in pure simulation. By inputting fault simulation data sets into the ship's navigation system and acquiring key performance indicators in real time, it can intuitively and in real-time reflect the system's operating status under fault conditions, providing a quantitative basis for performance assessment. By triggering corresponding event management strategies based on key performance indicators and acquiring complete test data, it can fully record the entire process of fault injection, system response, and anomaly handling. Based on the complete test data, system performance evaluation is conducted, and test results are obtained, enabling a comprehensive, objective, and quantitative evaluation of the safety, stability, and fault tolerance performance of the ship's navigation system. In summary, this invention forms a closed-loop and complete test link through controllable scenario configuration, realistic simulation operation, safe fault injection, real-time indicator acquisition, full-process data recording, and systematic performance evaluation. It retains the real characteristics of hardware-in-the-loop while achieving comprehensive coverage and precise control of fault scenarios, thereby enabling comprehensive and reliable system testing of the ship's navigation system. Attached Figure Description

[0017] Figure 1 This is one of the flowcharts illustrating the hardware-in-the-loop testing method for fault injection in a ship navigation system according to an embodiment of the present invention. Figure 2This is a schematic diagram of fault injection according to another embodiment of the present invention; Figure 3 A second schematic diagram of a hardware-in-the-loop testing method for fault injection in a ship navigation system, according to another embodiment of the present invention; Figure 4 This is a schematic diagram of a hardware-in-the-loop test system for injecting faults into a ship navigation system, according to another embodiment of the present invention. Detailed Implementation

[0018] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Although some embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the accompanying drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.

[0019] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.

[0020] The term "comprising" and its variations as used herein are open-ended, meaning "including but not limited to"; the term "based on" means "at least partially based on"; the term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments"; and the term "optionally" means "optional embodiments". Definitions of other terms will be given in the following description. It should be noted that the concepts of "first," "second," etc., mentioned in this invention are used only to distinguish different devices, modules, or units, and are not intended to limit the order of functions performed by these devices, modules, or units or their interdependencies.

[0021] It should be noted that the terms "a" and "a plurality of" used in this invention are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0022] Combination Figure 1 As shown in the figure, an embodiment of the present invention provides a hardware-in-the-loop testing method for fault injection in a ship navigation system, comprising: Initialize the test scenario data of the ship navigation system and set the fault test plan of the ship navigation system. The test scenario data includes the ship model, sea state parameters, and initial navigation state parameters. The fault test plan includes the fault type and the injection strategy corresponding to the fault type.

[0023] Specifically, the test scenario data includes ship models, sea state parameters, and initial navigation state parameters, aiming to simulate a specific navigation environment (such as nearshore areas, specific sea states, and ship load conditions). The fault test plan can be defined through a fault orchestration table or script, specifically including fault types and corresponding injection strategies. The injection strategy includes start and end times, target objects, intensity curves, and cancellation strategies, enabling programmable and time-sequential orchestration of various fault scenarios and providing accurate input data for systematic and repeatable fault injection testing. In a preferred embodiment of the invention, regarding scenario data, it is necessary to select a ship model of the corresponding tonnage and type, set marine environmental parameters such as wind, waves, current, visibility, and sea state levels, and configure navigation state parameters such as the ship's initial position, heading, speed, rudder angle, and rotational speed, so that the simulation environment closely approximates the actual operating conditions of the target ship. In terms of fault test planning, it is necessary to clarify the types of faults to be injected, and at the same time determine the triggering time, target, duration, intensity change mode and cancellation conditions of each type of fault, so as to form an executable and repeatable fault execution plan, and provide a unified execution basis and control standard for subsequent full-process testing.

[0024] Simulations are performed based on the ship model, the sea state parameters, and the initial navigation state parameters to obtain a set of simulation data for the ship navigation system.

[0025] Specifically, simulations are performed based on the ship model, sea state parameters, and initial navigation state parameters to obtain a simulation data set for the ship's navigation system. Using the configured ship model, environmental parameters, and navigation state as input, the simulation module is driven to simulate the ship's real-time motion behavior under a set environment. It outputs raw data including sensor information, communication information, control commands, and environmental parameters, which serves as the simulation data set, providing a standard data source for subsequent fault injection. In a preferred embodiment of the invention, scene initialization information is used as input, and real-time simulation calculations are performed through the ship simulation module. The ship simulation module internally calls the ship's hydrodynamic model, propulsion model, ship controller model, and environmental model for joint calculations, outputting data according to a fixed simulation cycle. The generated simulation data set consists of raw, real data without any added interference or anomalies, including ship sensor measurement data, communication transmission data, system control command data, and external environmental parameter data. It can completely reflect the ship's motion state and system operation state under ideal fault-free conditions, providing a benchmark data source and comparison reference for subsequent fault injection operations.

[0026] According to the fault type and the corresponding injection strategy, the simulation data set is intercepted and parameterized at the data interface layer of the ship navigation system to obtain the fault simulation data set corresponding to the fault type.

[0027] Specifically, regarding fault injection, this invention does not modify the internal logic of the simulation model. Instead, it intercepts and parametrically modifies the simulation data set at the data interface layer of the ship's navigation system to obtain the fault simulation data set corresponding to the fault type. It is worth noting that this step is performed at the data transmission interface between the ship's navigation system and the data source, requiring real-time interception and temporary storage of the normally transmitted simulation data set. Based on the pre-set fault type and injection strategy, a corresponding fault handling method is selected. The intercepted raw data undergoes parametric modifications such as numerical bias, random noise superposition, data loss, command attenuation, transmission delay, and data freezing. This allows the modified data to accurately reproduce the characteristics of sensor faults, communication faults, propulsion system faults, or environmental faults, ultimately generating a fault simulation data set matching the target fault type, used to simulate various abnormal operating conditions that may occur in actual ship operation.

[0028] The fault simulation data set is sent to the ship navigation system, and the key performance indicators of the ship navigation system under the fault type are obtained in real time.

[0029] Specifically, the modified fault simulation dataset is used as the input signal and connected to the actual data interface of the ship's navigation system. This allows the ship's navigation system to operate under fault data excitation, simulating the working state when a real fault occurs. During this process, the operational information output by the ship's navigation system is continuously collected and analyzed to extract key performance indicators that characterize the system's working state. These indicators include trajectory tracking deviation, heading control overshoot error, propeller operating status, control command changes, collision risk level, and runaway risk probability. These indicators directly reflect the real-time performance and response of the ship's navigation system under the corresponding fault excitation.

[0030] Based on the key performance indicators, a preset event management strategy corresponding to the fault type is triggered to obtain complete test data of the ship navigation system under the fault type.

[0031] Specifically, key performance indicators acquired in real time are assessed, and event management strategies matching the current fault type are automatically triggered based on the assessment results. These actions include initiating system degradation control, adjusting the fault injection rhythm, and terminating simulation operation. Throughout the fault injection and system response process, simulation time, fault parameters, interface data, control variables, system state machine status, alarm information, and event triggering information are recorded synchronously using a unified time base. This multi-dimensional information is integrated and summarized to form complete, traceable, and reproducible test data covering the entire testing cycle.

[0032] Based on the complete test data of the fault type, the performance of the ship navigation system is evaluated to obtain a system evaluation score for the ship navigation system, and the test result of the ship navigation system is determined based on the system evaluation score.

[0033] Specifically, using complete test data as the analysis object, the safety, stability, and fault tolerance performance of the ship's navigation system under fault conditions are quantitatively calculated to obtain a comprehensive system evaluation score. Based on the score range, the test results are divided into different levels, and the failed scenarios, fault triggering conditions, abnormal system behavior, and reproduction steps are recorded. Finally, standardized test conclusions are formed, completing the overall performance assessment of the ship's navigation system under fault conditions.

[0034] The hardware-in-the-loop (HIL) testing method for fault injection in ship navigation systems of this invention constructs a test environment closely resembling actual navigation by initializing test scenario data and setting fault test plans, and achieves standardized arrangement of fault scenarios, providing stable and controllable preconditions for testing. By conducting simulation operations based on ship models, sea state parameters, and initial navigation state parameters, a simulation data set closely resembling real navigation conditions can be generated, ensuring the authenticity and representativeness of the test data. Furthermore, by intercepting and parameterizing the simulation data set at the data interface layer to generate a fault simulation data set, various fault simulation data sets can be generated without affecting the safety of physical equipment. Controllable injection of faults effectively avoids the risks of real-ship testing and compensates for the lack of realism in pure simulation. By inputting fault simulation data sets into the ship's navigation system and acquiring key performance indicators in real time, the system's operating status under fault conditions can be reflected intuitively and in real time, providing a quantitative basis for performance judgment. By triggering corresponding event management strategies based on key performance indicators and acquiring complete test data, the entire process of fault injection, system response, and anomaly handling can be fully recorded. Based on the complete test data, system performance evaluation can be carried out and test results can be obtained, enabling a comprehensive, objective, and quantitative evaluation of the safety, stability, and fault tolerance performance of the ship's navigation system. In summary, this invention forms a closed-loop and complete test link through controllable scenario configuration, realistic simulation operation, safe fault injection, real-time indicator acquisition, full-process data recording, and systematic performance evaluation. It retains the real characteristics of hardware-in-the-loop while achieving comprehensive coverage and precise control of fault scenarios, thereby enabling comprehensive and reliable system testing of the ship's navigation system.

[0035] Optionally, the simulation run based on the ship model, the sea state parameters, and the initial navigation state parameters to obtain the simulation data set of the ship navigation system includes: Based on the ship model, the sea state parameters, and the initial navigation state parameters, a joint simulation is performed to obtain the sensor data, communication data, control commands, and environmental parameters of the ship navigation system. The simulation data set of the ship navigation system is constructed based on the sensor data, communication data, control commands, and environmental parameters of the ship navigation system.

[0036] Specifically, the process of simulating and obtaining a simulation dataset based on a ship model, sea state parameters, and initial navigation state parameters is accomplished using a ship simulation module. This module integrates a ship hydrodynamic model, a propulsion model, a ship controller model, and an environmental model. During joint simulation, a time base and timestamp uniformly established by the host computer are used as the synchronization reference. The timing alignment of each module is maintained through the NTP protocol. The initialized ship model parameters, sea state parameters, and initial navigation state parameters are used as simulation input conditions to drive the models to collaboratively perform real-time calculations. During the simulation, multi-source data characterizing the ship's operating state and external environmental conditions are continuously output. Sensor data includes GPS positioning information, compass heading information, and target perception information such as radar and lidar. Communication data includes transmission data between various units. Control commands include control signals such as rudder angle commands and speed commands output by the ship's navigation system. Environmental parameters include external environmental data such as wind speed, wind direction, current speed, current direction, channel boundaries, and obstacle information. After acquiring the above-mentioned multi-type and multi-dimensional data, the sensor data, communication data, control commands, and environmental parameters are integrated and encapsulated in a time sequence according to a unified timestamp. This constructs a complete, time-aligned simulation data set that can be directly used for subsequent fault injection operations, fully reproducing the data output form of the ship under real fault-free navigation conditions.

[0037] In a preferred embodiment of the present invention, in a near-shore navigation test scenario, a 30,000-ton container ship is selected as the ship model. Sea state parameters of sea state level 3 and wind state level 7 are set. Initial navigation state parameters are configured with initial positions of 29.563523N, 122.223077E, initial heading of 180°, initial speed of 8 knots, initial rudder angle of 0°, and initial propeller speed of 400 rpm. Based on these parameters, a joint simulation is initiated using the ship's hydrodynamic model, propulsion model, and environmental model. Real-time output includes sensor data such as GPS position and heading data, compass data, and radar sensing data; communication data between various ship modules; control commands such as rudder control and propeller control; and environmental parameters such as real-time wind speed, current speed, current direction, and channel boundaries. The sensor data, communication data, control commands, and environmental parameters at the same time are collected and organized according to a unified timestamp to construct a simulation data set for this test scenario.

[0038] In this embodiment of the invention, multi-model joint simulation based on ship model, sea state parameters, and initial navigation state parameters is conducted to generate multi-source raw data that is highly consistent with the actual ship operation, ensuring the authenticity and representativeness of the simulation data set. At the same time, sensor data, communication data, control commands, and environmental parameters are structured according to unified standards, which can realize the time sequence alignment and standardized integration of multi-source data. This provides a reliable, standardized, and complete data foundation for subsequent fault injection operations, effectively improving the accuracy of fault injection and the stability of the testing process, and ensuring that subsequent system response acquisition and performance evaluation have a reliable data premise.

[0039] Optionally, the step of intercepting and parametrically modifying the simulation data set at the data interface layer of the ship navigation system according to the fault type and the corresponding injection strategy to obtain the fault simulation data set corresponding to the fault type includes: Based on the injection strategy corresponding to the fault type, determine the fault injection operator corresponding to the fault type; At the fault trigger time corresponding to the fault type, the simulation data set is intercepted at the data interface layer of the ship navigation system. The fault injection operator injects fault data of the fault type into the simulation data set to generate the fault simulation data set.

[0040] Specifically, firstly, based on the fault types and injection strategies set in the fault test plan, the corresponding fault injection operators are matched and determined from the preset fault handling rule base. These fault injection operators include bias injection operators, noise injection operators, data loss operators, and data freeze operators for sensor faults; delay injection operators, packet loss operators, and interruption operators for communication faults; command attenuation operators, execution delay operators, and failure operators for propulsion system faults; and parameter disturbance operators and information loss operators for environmental faults. When the preset fault trigger time corresponding to the fault type is reached, the fault injection unit injects the transmitted simulation dataset at the data interface layer between the ship simulation module and the ship navigation system. The simulation dataset is captured and temporarily stored in real time. Then, based on the characteristics of the fault type and the injection requirements, the corresponding fault injection operator is invoked to perform operations such as numerical modification, signal disturbance, data discarding, delay processing, and parameter superposition on the sensor data, communication data, control commands, and environmental parameters in the captured simulation dataset. This accurately injects the fault data representing the corresponding fault type into the original simulation dataset, enabling the modified data to fully reproduce the real fault characteristics such as sensor drift, communication interruption, servo failure, and sudden environmental changes. Finally, a fault simulation dataset that perfectly matches the target fault type is generated. The entire process is completed at the data interface layer without altering the simulation module or the ship's navigation system structure. Figure 2As shown, the present invention can simulate the injection of four major categories of faults through the fault injection unit, specifically including: sensor faults, including CPS module (heading, position) faults, target perception equipment such as radar / lidar / camera faults and compass faults; communication faults, including communication loss and communication delays; propulsion system faults, including servo motor faults and propeller faults; and environmental faults, including water flow environment faults, wind flow environment faults and waterway environment faults.

[0041] In a preferred embodiment of the present invention, based on the aforementioned fault types, the fault injection unit intercepts and parametrically modifies sensing data, communication data, control commands, and environmental input data in real time at the data interface layer of the ship's intelligent navigation system, and injects multiple types of faults by constructing abnormal data. Specifically, at each simulation moment... First, obtain the simulation dataset. ,in Indicates at time The realistic simulation data set output by the ship simulation module includes sensor data, communication data, control commands, and environmental parameters. Subsequently, the corresponding fault type and parameter set are selected according to the fault test plan. The original data is processed by predefined fault injection operators to generate a fault data set. Its expression is: ; in, Indicates at time The set of fault simulation data after the injection fault. This represents a collection of fault data, including fault type, fault severity, duration, and triggering conditions. Indicates the current simulation time. This indicates a fault injection operator.

[0042] In another preferred embodiment of the present invention, regarding the injection of GPS offset and satellite loss faults, specifically, the injection strategy is set to cause a GPS offset fault to occur after 5 minutes of simulation, where the GPS-feedback location at the Yangtze River estuary does not match the actual location, lasting for 2 minutes; and then, after 10 minutes of simulation, the GPS satellite will be lost, lasting for 1 minute. Therefore, as planned, when the simulation reaches 5 minutes, the GPS malfunctions, lasting for 2 minutes, and when the simulation reaches 10 minutes, the GPS satellite will be lost, lasting for 1 minute.

[0043] In this embodiment of the invention, by matching the corresponding fault injection operator according to the fault type and accurately intercepting and modifying the simulation data at the data interface layer, various typical faults can be reproduced under safe and controllable conditions, avoiding the safety risks and cost losses of actual ship fault testing. At the same time, relying on a unified time base to ensure that the fault triggering time and the data modification sequence are accurately aligned, the fault simulation data set is highly close to the real fault form, providing real, controllable and reproducible fault excitation conditions for testing the fault tolerance performance and response capability of ship navigation systems.

[0044] Optionally, the step of injecting fault data of the fault type into the simulation dataset through the fault injection operator to generate the fault simulation dataset includes: When the fault type is a sensor fault, the fault injection operator is used to add bias data and / or noise data to the sensor data in the simulation dataset to generate the fault simulation dataset. When the fault type is a communication fault, the fault injection operator adds delay data and / or packet loss data to the communication data in the simulation dataset to generate the fault simulation dataset. When the fault type is a propulsion system fault, the fault injection operator adds zero-setting data and / or decay data and / or delay data to the control instructions of the simulation data set to generate the fault simulation data set. When the fault type is an environmental fault, the fault injection operator is used to add perturbation data and / or delete some information of the environmental parameters in the simulation dataset to generate the fault simulation dataset.

[0045] Specifically, when the fault type is a sensor fault, the corresponding fault injection operator processes sensor data such as GPS positioning data, compass data, radar data, lidar data, and camera sensing data in the simulation dataset. This is achieved by superimposing time-varying or constant bias data onto the original real measurements, superimposing random noise data with zero mean and fixed variance, setting the data to null values, or maintaining constant frozen values ​​to reproduce fault patterns such as GPS satellite loss, position offset, and sensing data loss. When the fault type is a communication fault, the corresponding fault injection operator performs delay processing or packet loss processing on the communication transmission data in the simulation dataset. This is achieved by setting a fixed delay duration to add delayed data, discarding data packets according to a set probability to add lost data, or directly clearing communication data within a specified time period to simulate communication interruption, thereby reproducing faults such as communication delay, packet loss, out-of-order delivery, and congestion. When the fault type is a propulsion system fault, the corresponding fault injection operator targets the simulation dataset... The control commands, such as the servo control command and the thruster control command, are modified in the simulation. This is achieved by setting the commands to zero to simulate actuator failure, proportionally attenuating the commands with an attenuation coefficient less than 1, and adding delayed data by delaying the execution of the control commands. This process reproduces faults such as servo failure, decreased thruster control accuracy, and delayed control command response. When the fault type is an environmental fault, the corresponding fault injection operator processes environmental parameters such as wind speed, wind direction, current velocity, current direction, channel boundary, and obstacle information in the simulation dataset. This is done by adding abrupt or fluctuating disturbances to add disturbance data, and directly deleting current direction, current velocity, channel boundary, or obstacle information to achieve partial information loss, thereby reproducing faults such as sudden wind and current changes and loss of environmental information. Throughout the entire process, the original simulation dataset is intercepted and parameterized in real time at the data interface layer. Different operators are used to process the data in the corresponding dimensions according to different fault types, ultimately generating a fault simulation dataset that can accurately represent the characteristics of the corresponding fault type.

[0046] In a preferred embodiment of the present invention, in response to a sensor fault, the fault injection unit modifies the sensor data to generate fault data. Specifically, this includes adding a bias amount to the original data using a bias injection method, resulting in: ; in, Indicates at time The actual sensor measurement value, This indicates the deviation that changes over time or remains constant. Indicates at time Fault data.

[0047] By injecting noise and superimposing random perturbations into the data, we obtain: ; in, Indicates at time The actual sensor measurement value, This indicates that the mean is zero and the variance is... random noise, Indicates at time Fault data.

[0048] By setting data to null or invalid values ​​to indicate missing sensor data, or by freezing data at a certain moment... Then keep the data constant, that is: ; in, Indicates the time when the fault was triggered. The sensor output value at the moment the fault was triggered. Indicates at time Fault data.

[0049] Furthermore, abnormal target injection can be achieved by constructing an additional target dataset and merging it with the simulation dataset, as expressed below: ; in, Indicates at time Artificially generated target data set Indicates at time The simulation dataset, Indicates at time A collection of fault simulation data.

[0050] To address communication failures, data packets are processed within the data transmission link. This is achieved through delay injection, which delays the data reception time. ; in, Indicates the time of data transmission. Indicates the delay time. Indicates the data reception time.

[0051] Or through packet loss, using probability. Discard packets, among which This indicates the probability of packet loss.

[0052] Alternatively, the data set can be made empty within a specified time interval by interrupting communication. ; in, Indicates time The set of communication data, This represents an empty set.

[0053] In response to propulsion system failures, the fault injection unit modifies the control commands and generates execution commands. Specifically, this includes setting the control commands to zero or a fixed value, thereby causing the actuator to fail.

[0054] Alternatively, the control output can be reduced by proportional attenuation: ; in, Represents the attenuation coefficient, satisfying , Indicates the ship's navigation system at time Output control commands, Indicates at time The fault execution instruction.

[0055] Alternatively, control commands can be delayed through deferred execution. Execution after: ; in, Indicates the control delay time. Indicates the ship's navigation system at time Output control commands, Indicates at time The fault execution instruction.

[0056] To address environmental faults, abnormal environment inputs are achieved by modifying the environmental parameters in the simulation module, resulting in fault environment parameters, which are expressed as follows: ; in, Indicates at time Environmental parameters (including wind speed, flow velocity, flow direction, etc.). This indicates the amount of environmental disturbance. Indicates at time The fault environment parameters, or by deleting some environmental information, can be used to achieve missing environmental data: ; in, Indicates at time The removed environmental information Indicates at time Fault environment parameters, Indicates at time Environmental parameters.

[0057] In this embodiment of the invention, by using corresponding fault injection operators according to fault type to modify data of different dimensions in the simulation dataset in a targeted manner, the injection of typical faults is made precise, parameterized, and controllable. This ensures that the fault morphology is highly consistent with the actual faults on the ship, and can comprehensively cover the abnormal scenarios that the ship's navigation system may encounter without damaging the hardware or causing navigation risks. At the same time, the classified injection method makes the fault logic clear and the data disturbances explicit, providing a stable, standard, and reliable fault stimulus data foundation for subsequent system response monitoring, fault tolerance performance evaluation, and fault reproduction testing.

[0058] Optionally, sending the fault simulation data set to the ship navigation system and acquiring the key performance indicators of the ship navigation system under the fault type in real time includes: The fault simulation data set is sent to the ship navigation system in real time. The system response data output by the ship navigation system under the excitation of the fault simulation data set is received and collected. The system response data includes at least the ship's real-time trajectory, heading, speed, rudder angle, propeller speed and system alarm information. Based on the system response data, one or more of the key performance indicators under the fault type are determined. The key performance indicators include at least one of the following: trajectory tracking deviation, heading control overshoot error, thruster status anomaly index, navigation control command anomaly value, collision risk index, and runaway risk probability.

[0059] Specifically, the fault simulation data set generated by the fault injection unit is first sent in real time to the sensing and control input terminal of the ship's navigation system through a standard data interface. This causes the ship's navigation system to enter a working state consistent with the real fault scenario under the excitation of the fault data and output corresponding system response data. The host computer receives and collects the system response data in real time. The collected content includes at least multi-dimensional status information such as the ship's real-time trajectory, real-time heading, speed, rudder angle, propeller speed, and alarm information generated by the system itself. After the above system response data collection is completed, the host computer, as the data processing core, processes the collected data based on unified calculation rules. The raw response data is parsed and processed to extract and quantify key performance indicators under the fault type. The key performance indicators specifically include at least one of the following: trajectory tracking deviation, heading control overshoot error, thruster status anomaly index, navigation control command anomaly value, collision risk index, and runaway risk probability. Through structured extraction and quantitative calculation of system response data, intuitive operational status information is transformed into standardized indicators that are comparable, evaluable, and monitorable. This provides accurate and objective data basis for subsequent event triggering, fault judgment, and system performance evaluation. The entire process maintains real-time and synchronization, and all data is accompanied by a unified timestamp to ensure time sequence consistency.

[0060] In a preferred embodiment of the present invention, in the test scenario of GPS fault injection, a fault simulation data set including GPS position offset and satellite loss characteristics is sent to the ship navigation system in real time. The host computer synchronously receives and collects system response data such as the ship's real-time trajectory, heading, speed, rudder angle, propeller speed, and system alarm information. Based on the collected data, calculations are performed to obtain key performance indicators such as trajectory tracking deviation, heading control overshoot error, collision risk index, and runaway risk probability, which are used to reflect the real-time operating status of the ship navigation system under sensor fault excitation.

[0061] In this embodiment of the invention, by inputting the fault simulation data set into the ship navigation system in real time and collecting comprehensive system response data, the dynamic behavior of the system under fault conditions is realistically reproduced. At the same time, the original operating data is transformed into standardized key performance indicators such as trajectory deviation, heading overshoot, and collision risk, realizing the quantitative expression of system status. This provides a unified, objective, and comparable evaluation benchmark for real-time monitoring, event triggering, and subsequent performance evaluation, effectively improving the accuracy, comparability, and traceability of test results.

[0062] Optionally, the step of triggering a preset event management strategy corresponding to the fault type based on the key performance indicators to obtain complete test data of the ship navigation system under the fault type includes: The key performance indicators are compared with the preset safety thresholds corresponding to the key performance indicators; When the key performance indicator exceeds the preset safety threshold, the event management strategy corresponding to the fault type is triggered; After the event management strategy is triggered, the entire link data of the ship navigation system is collected synchronously based on a unified time base; A test signature is generated based on the end-to-end data using a hash function; Based on the full-link data and the test signature, construct the complete test data for the fault type.

[0063] Specifically, firstly, key performance indicators acquired in real time, such as trajectory tracking deviation, heading control overshoot error, thruster status anomaly index, navigation control command anomaly value, collision risk index, and runaway risk probability, are compared item by item with corresponding preset safety thresholds. When any key performance indicator exceeds the preset safety threshold, an event management strategy matching the current fault type is immediately triggered. The event management strategy may include initiating degraded control, adjusting the fault injection sequence, terminating simulation operation, and issuing safety alarms. After triggering the event management strategy, the entire link of the ship's navigation system is synchronously collected using a unified time base as the absolute time reference. The data, specifically the end-to-end data, encompasses unified synchronization timestamps, fault injection script versions and random seeds, interface interaction data, navigation control quantities, system state machine states, and various alarm information. This achieves full-dimensional time-series alignment of fault triggering time, system response process, and strategy execution actions. A hash function is used to perform hash operations on the aforementioned synchronously collected end-to-end data to generate a unique and tamper-proof test signature, which is used to ensure the integrity, authenticity, and traceability of the test data. Finally, the time-series aligned end-to-end data and the unique test signature are integrated and encapsulated to jointly construct complete test data that is reproducible, verifiable, and traceable under the current fault type.

[0064] In a preferred embodiment of the present invention, the end-to-end data includes recording simulation time. Interference injection script version / random seed Interface data Control quantity State machine states and alarm information And generate a unique test signature. To ensure the integrity and traceability of experimental data, among which, This refers to a hash function, which maps input data of arbitrary length to a hash value of fixed length. This mechanism allows for precise tracking of the fault trigger moment and system response, ensuring the reproducibility of experiments and the reliability of data.

[0065] In this embodiment of the invention, events are automatically triggered by comparing key performance indicators with thresholds, which can respond promptly to abnormal system states and ensure the safety of the testing process. By synchronously collecting full-link data with a unified time base and generating test signatures using hash functions, accurate time alignment, complete information retention, and data tamper-proofing can be achieved throughout the testing process. This significantly improves the traceability, reproducibility, and reliability of test data, providing solid and reliable data support for subsequent fault location, performance evaluation, and regression testing.

[0066] Optionally, the step of performing a performance evaluation on the ship navigation system based on the complete test data of the fault type to obtain a system evaluation score for the ship navigation system includes: The complete test data for the fault type is analyzed to determine the safety index, stability index, and fault tolerance performance index of the ship navigation system under each fault type. The safety index, stability index, and fault tolerance performance index under each fault type are quantified to obtain quantified values ​​of the safety index, stability index, and fault tolerance performance index. By using a pre-defined templated scoring model, the system evaluation score of the ship navigation system under the fault type is obtained by weighting the quantified values ​​of the safety index, the stability index, and the fault tolerance performance index.

[0067] Specifically, firstly, the complete test data under different fault types are analyzed in time sequence. From information such as trajectory tracking deviation, heading control overshoot error, thruster state anomaly index, collision risk index, runaway risk probability, system response delay, alarm processing logic, and fault recovery capability, the safety indicators, stability indicators, and fault tolerance performance indicators of the ship's navigation system under the corresponding faults are extracted and determined. Among them, the safety indicators are used to characterize whether the ship is in a dangerous state such as collision, runaway, or yaw under the fault condition, and the stability indicators are used to characterize the control smoothness and output fluctuation of the system under fault disturbances. Fault tolerance performance indicators are used to characterize the system's ability to identify, handle, degrade, control, and recover from faults. After the indicators are extracted, the three types of indicators are normalized, quantified, and graded to obtain quantified values ​​for safety, stability, and fault tolerance performance that can be used for calculation. Then, based on a templated scoring model, the three types of quantified values ​​are weighted and summed according to a preset weight allocation rule. That is, the safety, stability, and fault tolerance performance quantified values ​​are weighted and superimposed according to the set weight coefficients to finally obtain a unique system evaluation score for the ship navigation system under the current fault type. In a preferred embodiment of the present invention, safety indicators are used to determine whether the ship has safety risks such as collision, yaw, loss of control, or grounding under fault conditions. These mainly include the collision risk index, loss of control risk probability, whether the trajectory tracking deviation exceeds the limit, whether the heading deviation exceeds the limit, the minimum safe distance from obstacles / target ships, whether the navigation area exceeds the channel boundary, the number of emergency alarm triggers, and whether uncontrollable movement occurs under fault conditions. Stability indicators are used to determine whether the system's control is smooth, oscillating, or frequently abrupt under fault conditions. These mainly include heading control overshoot error, speed fluctuation amplitude, rudder angle command jitter frequency, thruster speed fluctuation degree, number of sudden changes in control command output, system response delay stability, data transmission jitter and disorder, and the stability of control output during a fault. Fault tolerance indicators are used to determine whether the system can identify faults, degrade operation, automatically recover, and continue safe navigation. These mainly include fault detection and identification time, automatic fault isolation success rate, whether the degraded control mode starts normally, fault recovery success rate and recovery time, handling capability when multiple faults overlap, effectiveness of backup strategies after sensor / communication failure, the duration the system remains controllable during the fault's duration, and the system's ability to return to normal after the fault is cleared.

[0068] In a preferred embodiment of the present invention, the system evaluation score is calculated based on a templated scoring method, comprehensively considering security, stability, and fault tolerance performance. ; in, This indicates the system evaluation score under the fault type. Quantification of safety indicators The weight value, Quantification of stability index The weight value, Quantification of fault tolerance performance index The weight value.

[0069] In this embodiment of the invention, by analyzing complete test data and extracting three core indicators—safety, stability, and fault tolerance—the key performance dimensions of the ship navigation system under fault conditions are fully covered. A quantitative processing and template-based weighted scoring model is adopted to transform complex system response information into system evaluation scores, thereby achieving standardization of the evaluation process, quantification of results, and objectification of conclusions. This provides clear and reusable evaluation criteria for test result determination, defect location, and regression testing.

[0070] Optionally, determining the test result of the ship navigation system based on the system evaluation score includes: The system evaluation score is compared with a preset scoring range, which includes a normal range, a warning range, and an abnormal range. The test result of the ship navigation system for the fault type is determined based on the preset scoring range into which the system evaluation score falls; Specifically, when the system evaluation score is within the normal range, the test result for the fault type is determined to be passed; When the system evaluation score is within the warning range, the test result for the fault type is determined to be a warning; When the system evaluation score is in the abnormal range, the test result for the fault type is determined to be unsuccessful.

[0071] Specifically, firstly, the system evaluation score is numerically matched and compared with a pre-set scoring range, which is divided into three levels: normal, warning, and abnormal. Then, based on the specific scoring range in which the system evaluation score falls, the test result of the ship's navigation system for the current fault type is directly determined. When the system evaluation score is in the normal range, it indicates that the safety, stability, and fault tolerance performance of the ship's navigation system under this fault type meet the preset design requirements, and the test result is determined to be passed. When the system evaluation score is in the warning range, it indicates that some indicators of the ship's navigation system are close to the critical value under this fault type, and although no safety risk has been caused, there are potential defects, and the test result is determined to be a warning. When the system evaluation score is in the abnormal range, it indicates that the ship's navigation system has obvious control failures, excessive safety risks, or fault tolerance failures under this fault type, and the test result is determined to be failed.

[0072] In this embodiment of the invention, the test results are determined by comparing the system evaluation score with a three-level preset scoring range. This achieves the standardization, quantification, and visualization of the test conclusions, which can intuitively, clearly, and objectively reflect the performance qualification status of the ship navigation system under the corresponding fault. At the same time, it clearly distinguishes three result levels: pass, warning, and fail. This facilitates the rapid determination of whether the system meets the application requirements and provides a clear basis for defect rectification, regression testing, and system iteration.

[0073] In summary, combining Figure 3 As shown, the hardware-in-the-loop test process for fault injection in a ship navigation system begins after the equipment starts up. First, a unified time base is established to create a global synchronized time reference. Then, the equipment and communication functions are checked to confirm that the hardware and communication links are normal. Next, scenario initialization is performed, loading basic scenario data such as the ship model, sea state, wind, waves, current, visibility, and ship navigation status. Then, a fault test plan and orchestration plan are set, selecting fault types such as sensor faults, communication faults, propulsion system faults, or environmental faults, and planning their triggering sequences and parameters. Simulation is started, driving the ship model and environmental model to run collaboratively. Fault injection is then executed at the data interface layer. The system intercepts and modifies simulation data according to a preset strategy, generating fault simulation data and injecting it into the system under test. Online monitoring and event triggering involve real-time acquisition of system response data and determination of whether a preset safety threshold has been triggered; if triggered, event management strategies are executed. Data acquisition and tracing involve synchronously collecting end-to-end data using a unified time base and generating test signatures to construct complete test data. Finally, through batch iteration, faults are reconfigured according to requirements, and multiple rounds or combinations of faults are tested. Finally, system evaluation is performed, calculating system evaluation scores based on complete test data for each fault type and determining the test results, completing the entire closed-loop testing process. It is worth noting that batch iteration can be achieved through recombining the injection strategy until the test is complete.

[0074] Combination Figure 4 As shown, another embodiment of the present invention provides a hardware-in-the-loop test system for injecting faults into a ship navigation system, comprising: An initialization unit is used to initialize the test scenario data of the ship navigation system and set the fault test plan of the ship navigation system. The test scenario data includes the ship model, sea state parameters, and initial navigation state parameters. The fault test plan includes the fault type and the injection strategy corresponding to the fault type. The simulation unit is used to perform simulation based on the ship model, the sea state parameters, and the initial navigation state parameters to obtain a set of simulation data for the ship navigation system. The fault injection unit is used to intercept and parametrically modify the simulation data set at the data interface layer of the ship navigation system according to the fault type and the injection strategy corresponding to the fault type, so as to obtain the fault simulation data set corresponding to the fault type. The data acquisition unit is used to send the fault simulation data set to the ship navigation system and acquire the key performance indicators of the ship navigation system under the fault type in real time. The data integration unit is used to trigger a preset event management strategy corresponding to the fault type based on the key performance indicators, and obtain complete test data of the ship navigation system under the fault type. An evaluation unit is used to evaluate the performance of the ship navigation system based on the complete test data of the fault type, obtain a system evaluation score for the ship navigation system, and determine the test result of the ship navigation system based on the system evaluation score.

[0075] The hardware-in-the-loop test system for injecting faults into the ship navigation system of the present invention has the same advantages over the prior art as the aforementioned hardware-in-the-loop test method for injecting faults into the ship navigation system, and will not be repeated here.

[0076] Another embodiment of the present invention provides an electronic device comprising: a processor and a memory, wherein the memory is used to store a computer program; When the computer program is loaded by the processor, it causes the processor to execute the hardware-in-the-loop test method for injecting faults into the ship navigation system as described above.

[0077] The electronic device of the present invention has the same advantages over the prior art as the aforementioned hardware-in-the-loop test method for injecting faults into the ship navigation system, and will not be repeated here.

[0078] While the present invention has been disclosed above, its scope of protection is not limited thereto. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention, and all such changes and modifications will fall within the scope of protection of the present invention.

Claims

1. A hardware-in-the-loop testing method for fault injection in a ship navigation system, characterized in that, include: Initialize the test scenario data of the ship navigation system and set the fault test plan of the ship navigation system. The test scenario data includes the ship model, sea state parameters, and initial navigation state parameters. The fault test plan includes the fault type and the injection strategy corresponding to the fault type. Based on the ship model, the sea state parameters, and the initial navigation state parameters, a simulation operation is performed to obtain the simulation data set of the ship navigation system. According to the fault type and the corresponding injection strategy, the simulation data set is intercepted and parameterized at the data interface layer of the ship navigation system to obtain the fault simulation data set corresponding to the fault type. The fault simulation data set is sent to the ship navigation system, and the key performance indicators of the ship navigation system under the fault type are obtained in real time. Based on the key performance indicators, a preset event management strategy corresponding to the fault type is triggered to obtain complete test data of the ship navigation system under the fault type; Based on the complete test data of the fault type, the performance of the ship navigation system is evaluated to obtain a system evaluation score for the ship navigation system, and the test result of the ship navigation system is determined based on the system evaluation score.

2. The hardware-in-the-loop testing method for fault injection in a ship navigation system according to claim 1, characterized in that, The simulation operation based on the ship model, the sea state parameters, and the initial navigation state parameters yields a simulation data set for the ship navigation system, including: Based on the ship model, the sea state parameters, and the initial navigation state parameters, a joint simulation is performed to obtain the sensor data, communication data, control commands, and environmental parameters of the ship navigation system. The simulation data set of the ship navigation system is constructed based on the sensor data, communication data, control commands, and environmental parameters of the ship navigation system.

3. The hardware-in-the-loop testing method for fault injection in a ship navigation system according to claim 1, characterized in that, The step involves intercepting and parametrically modifying the simulation data set at the data interface layer of the ship navigation system according to the fault type and the corresponding injection strategy, to obtain the fault simulation data set corresponding to the fault type, including: Based on the injection strategy corresponding to the fault type, determine the fault injection operator corresponding to the fault type; At the fault trigger time corresponding to the fault type, the simulation data set is intercepted at the data interface layer of the ship navigation system. The fault injection operator injects fault data of the fault type into the simulation data set to generate the fault simulation data set.

4. The hardware-in-the-loop testing method for fault injection in a ship navigation system according to claim 3, characterized in that, The step of injecting fault data of the fault type into the simulation data set through the fault injection operator to generate the fault simulation data set includes: When the fault type is a sensor fault, the fault injection operator is used to add bias data and / or noise data to the sensor data in the simulation dataset to generate the fault simulation dataset. When the fault type is a communication fault, the fault injection operator adds delay data and / or packet loss data to the communication data in the simulation dataset to generate the fault simulation dataset. When the fault type is a propulsion system fault, the fault injection operator adds zero-setting data and / or decay data and / or delay data to the control instructions of the simulation data set to generate the fault simulation data set. When the fault type is an environmental fault, the fault injection operator is used to add perturbation data and / or delete some information of the environmental parameters in the simulation dataset to generate the fault simulation dataset.

5. The hardware-in-the-loop testing method for fault injection in a ship navigation system according to claim 1, characterized in that, The step of sending the fault simulation data set to the ship navigation system and acquiring the key performance indicators of the ship navigation system under the fault type in real time includes: The fault simulation data set is sent to the ship navigation system in real time. The system response data output by the ship navigation system under the excitation of the fault simulation data set is received and collected. The system response data includes at least the ship's real-time trajectory, heading, speed, rudder angle, propeller speed and system alarm information. Based on the system response data, one or more of the key performance indicators under the fault type are determined. The key performance indicators include at least one of the following: trajectory tracking deviation, heading control overshoot error, thruster status anomaly index, navigation control command anomaly value, collision risk index, and runaway risk probability.

6. The hardware-in-the-loop testing method for fault injection in a ship navigation system according to claim 1, characterized in that, The step of triggering a preset event management strategy corresponding to the fault type based on the key performance indicators to obtain complete test data of the ship navigation system under the fault type includes: The key performance indicators are compared with the preset safety thresholds corresponding to the key performance indicators; When the key performance indicator exceeds the preset safety threshold, the event management strategy corresponding to the fault type is triggered; After the event management strategy is triggered, the entire link data of the ship navigation system is collected synchronously based on a unified time base; A test signature is generated based on the end-to-end data using a hash function; Based on the full-link data and the test signature, construct the complete test data for the fault type.

7. The hardware-in-the-loop testing method for fault injection in a ship navigation system according to claim 1, characterized in that, The process of evaluating the ship's navigation system based on the complete test data of the fault type to obtain a system evaluation score for the ship's navigation system includes: The complete test data for the fault type is analyzed to determine the safety index, stability index, and fault tolerance performance index of the ship navigation system under each fault type. The safety index, stability index, and fault tolerance performance index under each fault type are quantified to obtain quantified values ​​of the safety index, stability index, and fault tolerance performance index. By using a pre-defined templated scoring model, the system evaluation score of the ship navigation system under the fault type is obtained by weighting the quantified values ​​of the safety index, the stability index, and the fault tolerance performance index.

8. The hardware-in-the-loop testing method for fault injection in a ship navigation system according to claim 1, characterized in that, The determination of the test results of the ship navigation system based on the system evaluation score includes: The system evaluation score is compared with a preset scoring range, which includes a normal range, a warning range, and an abnormal range. The test result of the ship navigation system for the fault type is determined based on the preset scoring range into which the system evaluation score falls; Specifically, when the system evaluation score is within the normal range, the test result for the fault type is determined to be passed; When the system evaluation score is within the warning range, the test result for the fault type is determined to be a warning; When the system evaluation score is in the abnormal range, the test result for the fault type is determined to be unsuccessful.

9. A hardware-in-the-loop test system for injecting faults into a ship navigation system, characterized in that, include: An initialization unit is used to initialize the test scenario data of the ship navigation system and set the fault test plan of the ship navigation system. The test scenario data includes the ship model, sea state parameters, and initial navigation state parameters. The fault test plan includes the fault type and the injection strategy corresponding to the fault type. The simulation unit is used to perform simulation based on the ship model, the sea state parameters, and the initial navigation state parameters to obtain a set of simulation data for the ship navigation system. The fault injection unit is used to intercept and parametrically modify the simulation data set at the data interface layer of the ship navigation system according to the fault type and the injection strategy corresponding to the fault type, so as to obtain the fault simulation data set corresponding to the fault type. The data acquisition unit is used to send the fault simulation data set to the ship navigation system and acquire the key performance indicators of the ship navigation system under the fault type in real time. The data integration unit is used to trigger a preset event management strategy corresponding to the fault type based on the key performance indicators, and obtain complete test data of the ship navigation system under the fault type. An evaluation unit is used to evaluate the performance of the ship navigation system based on the complete test data of the fault type, obtain a system evaluation score for the ship navigation system, and determine the test result of the ship navigation system based on the system evaluation score.

10. An electronic device, characterized in that, include: Processor and memory, the memory being used to store computer programs; When the computer program is loaded by the processor, it causes the processor to execute the hardware-in-the-loop test method for injecting faults into a ship navigation system as described in any one of claims 1-8.