Attitude calculation method based on attitude dynamics and inertial navigation technology in ship

By performing time-series preprocessing, spectral feature analysis, and nonlinear self-correction methods on the inertial measurement unit within the ship's internal environment, a stable attitude sequence is generated, solving the problems of interference and error accumulation in the ship's internal attitude calculation and achieving high-precision and continuous attitude data output.

CN121761875APending Publication Date: 2026-03-31SHIP INFORMATION RES CENT (NO 714 RES INST OF CHINA STATE SHIPBUILDING CORP)
View PDF 0 Cites 2 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-13
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

In the complex dynamic environment inside a ship, the attitude calculation results of the inertial measurement unit (IMU) are easily affected by the metal structure and mechanical vibration, and the small errors caused by inertial integration calculations gradually accumulate over time, making it difficult to maintain continuous stability.

Method used

A continuous attitude sequence is generated by using a method based on inertial measurement unit (IMU) time-series preprocessing, spectral feature analysis, discrete dynamic constraints, and nonlinear self-correction to suppress measurement interference and integral accumulation error. This includes time-series constrained attitude sequence generation, dynamic weighting of environmental adaptation parameters, nonlinear self-correction, and anomaly detection.

Benefits of technology

It achieves high-precision, continuous and stable attitude data calculation in complex ship interior environments, enhancing the system's dynamic response and the accuracy and continuity of attitude calculation in high-noise environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121761875A_ABST
    Figure CN121761875A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of inertial navigation, in particular to a ship interior attitude resolving method based on attitude dynamics and inertial navigation technology, which comprises the following steps: acquiring attitude data in real time and performing time sequence preprocessing on the attitude data to obtain a time sequence constraint attitude sequence; spectral features of the internal environment of the ship are extracted online, and environment adaptation parameters are generated based on the spectral features; based on the time sequence constraint attitude sequence, taking the attitude vector at the current moment as an initial value to form a discrete dynamic constraint framework, and introducing second-order difference of historical three-frame attitudes and environment adaptation parameters to generate a preliminary attitude sequence; residual errors in the initial attitude sequence are eliminated through nonlinear self-correction, and a corrected attitude sequence is generated; and performing continuity verification and anomaly detection on the corrected attitude sequence to generate a final output continuous attitude sequence. According to the invention, attitude calculation can suppress measurement interference and reduce integral accumulative errors at the same time in a ship environment, and high-precision and stable attitude data can be obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of inertial navigation technology, and in particular to an attitude calculation method for ships based on attitude dynamics and inertial navigation technology. Background Technology

[0002] In the operational environment inside a ship, inertial measurement units (IMUs) are typically used as core sensors to achieve precise attitude perception of personnel or equipment. IMUs usually integrate three-axis accelerometers and three-axis gyroscopes, enabling real-time acquisition of the target's linear acceleration and angular velocity information. Using inertial navigation algorithms, the velocity change of the target can be obtained by integrating the acceleration data, while the attitude change information can be obtained by integrating the angular velocity data. Further combined with the initial attitude or position, the IMU can output the target's attitude data in three-dimensional space, such as Euler angles or rotational states represented by quaternions. This information reflects the target's pitch, roll, and yaw angles, providing a foundation for subsequent attitude control, motion analysis, or positioning. The high sampling rate and real-time characteristics of the IMU enable it to continuously track the target's motion state in the confined space inside a ship.

[0003] In existing technologies, filtering methods or dynamic models are typically used to process the data acquired by the IMU to improve attitude estimation accuracy. For example, Kalman filtering, by fusing accelerometer and gyroscope data, suppresses random noise and corrects short-term drift; complementary filtering uses low-pass filtering to process acceleration data and high-pass filtering to process angular velocity data to obtain smooth attitude estimation results; some methods also utilize simplified dynamic models or external auxiliary sensors (such as magnetometers, vision sensors, or ultra-wideband positioning systems) to correct the attitude. These methods can obtain relatively stable attitude estimation results and achieve basic attitude tracking in general open or indoor environments.

[0004] However, in the internal environment of a ship, the complex metal structure and mechanical vibrations can continuously interfere with IMU measurements. At the same time, the small errors caused by inertial integration calculations will gradually accumulate over time, causing the attitude calculation results to deviate and making it difficult to maintain continuous stability. Summary of the Invention

[0005] This application provides a method for attitude calculation inside a ship based on attitude dynamics and inertial navigation technology. This method effectively processes attitude data acquired by the IMU in the complex dynamic environment inside a ship, enabling attitude calculation to simultaneously suppress measurement interference and reduce integration accumulation errors, thereby obtaining high-precision, continuous, and stable attitude data. The technical solution provided in this application is as follows:

[0006] Firstly, this application provides a method for attitude calculation inside a ship based on attitude dynamics and inertial navigation technology, including:

[0007] The attitude data is collected in real time by inertial measurement unit and the attitude data is preprocessed in time to obtain the time-constrained attitude sequence.

[0008] The spectral characteristics of the ship's internal environment are extracted online, and environmental adaptation parameters are generated based on these spectral characteristics.

[0009] Based on the temporal constraint attitude sequence, the attitude vector at the current moment is used as the initial value. Discrete dynamic constraints are constructed by the attitude difference with the previous moment and the two moments before. At the same time, the second-order difference of the attitude of the three historical frames is introduced to smooth high-frequency changes and instantaneous jumps. The observed attitude, continuity constraints and second-order difference results are dynamically weighted according to the environmental adaptation parameters to obtain the preliminary attitude vector at the current sampling moment and generate the preliminary attitude sequence.

[0010] Residual errors in the initial attitude sequence are eliminated through nonlinear self-calibration to generate a calibrated attitude sequence;

[0011] The continuity of the corrected attitude sequence is verified and anomalies are detected to generate the final output continuous attitude sequence.

[0012] In a specific feasible implementation, attitude data is acquired in real time based on an inertial measurement unit and the attitude data is preprocessed temporally to obtain a temporally constrained attitude sequence, including:

[0013] The inertial measurement unit (IMU) is used to acquire the attitude data of the target object in real time. The attitude data includes three-axis angular velocity data ω. i =[ω x (i),ω y (i),ω z (i) and triaxial acceleration data a i =[a x (i),a y (i),a z (i)], where index i represents the i-th sampling time t i The adjacent sampling interval is Δt i =t i -t i-1 ;

[0014] The acceleration vector a at each sampling time point i After normalization, the unit gravity direction vector is obtained.

[0015]

[0016] Introducing acceleration reliability weight w i :

[0017]

[0018] Where g0 is the standard gravitational acceleration, σ a This is the tolerance threshold for acceleration amplitude deviation;

[0019] Introducing a sampling time drift correction factor:

[0020]

[0021] in, It represents the moving average value over several past frame sampling intervals, and γ is the drift correction coefficient.

[0022] In a specific feasible implementation, the process of acquiring attitude data in real time based on an inertial measurement unit and performing temporal preprocessing on the attitude data to obtain a temporally constrained attitude sequence further includes:

[0023] Calculate the target's rotation increment within the current sampling interval using angular velocity data. The rotation increment at the current moment is calculated using the trapezoidal integral method:

[0024]

[0025] Where, ω i-1 This represents the angular velocity observation at the previous moment;

[0026] Define the acceleration-guided correction vector as follows:

[0027]

[0028] Where × represents the vector cross product operation, and β is the attitude correction gain coefficient. This is the direction vector of unit gravity at the previous moment;

[0029] Current time t i The timing-constrained attitude increments are as follows:

[0030]

[0031] Where 1 = [1,1,1] T η represents the unit correction vector uniformly distributed across the three attitude axes. i 1 represents time drift compensation distributed proportionally across the three rotational components, calculated based on incremental recursion of the current attitude vector:

[0032]

[0033] in, These represent the attitude angle vectors after timing constraint correction, corresponding to pitch, roll, and yaw angles, respectively. Let represent the attitude vector obtained after temporal constraints and corrections at the previous time step; after temporal constraints and attitude calculations, the generated temporally consistent attitude sequence is denoted as .

[0034] In a specific feasible implementation, the online extraction of spectral characteristics of the ship's internal environment and the generation of environmental adaptation parameters based on these spectral characteristics include:

[0035] Real-time extraction of various sensor data x(t) from the ship's internal environment, x(t) = [x1(t), x2(t), ..., x m [x1(t)] represents multiple environmental signal data collected from different sensors at time t, where x1(t), x2(t), ..., xt... m (t) represent the raw data output by the vibration, noise, temperature and humidity, and acceleration sensors, respectively;

[0036] The spectral information of various environmental signals is extracted by converting them from the time domain to the frequency domain using Fast Fourier Transform. Let X(ω) be the spectrum of the environmental signal, and its calculation formula is as follows:

[0037]

[0038] Where X(ω) represents the representation of the environmental signal x(t) in the frequency domain, ω is the frequency, N is the number of sampling points of the signal, and t is the time index;

[0039] After obtaining the spectral characteristics, the environmental adaptation parameter α(t) is generated by calculating the energy distribution of different frequency bands. The method for generating the environmental adaptation parameter α(t) is as follows:

[0040]

[0041] Where, |X(ω)| 2 ω represents the energy density of the spectrum. l and ω h These represent the lower and upper limits of the interference frequency band, ω0 and ω, respectively. m These are the lower and upper limits of the reference frequency band.

[0042] In a specific implementation scheme, based on the temporal constraint attitude sequence, using the attitude vector at the current moment as the initial value, discrete dynamic constraints are constructed by differencing the attitude at the previous moment and the two moments prior. Simultaneously, the second-order difference of the attitude from three historical frames is introduced to smooth high-frequency changes and instantaneous jumps. The observed attitude, continuity constraints, and second-order difference results are dynamically weighted according to the environmental adaptation parameters to obtain the preliminary attitude vector at the current sampling moment and generate a preliminary attitude sequence, including:

[0043] The obtained timing constraint attitude angle vector As the observation input, the basic predicted attitude at the current moment is calculated, and the attitude vector of the initial solution is set as P. i Then, in the discrete time step Δt i Internally, basic predictions are made using angular velocity increments:

[0044]

[0045] in, Let represent the initial attitude angle vector at time i, corresponding to pitch angle, roll angle and yaw angle respectively; Δt represents the initial attitude vector at the previous moment; i Indicates the current sampling interval. This represents the attitude change increment obtained by integrating the angular velocity;

[0046] Introducing historical attitude difference to construct discrete dynamic constraint C i :

[0047]

[0048] in, The initial attitude is given at the first two time points, λ is the continuity adjustment coefficient, and a second-order difference smoothing term D is introduced. i It is defined as the first-order difference-plus-difference of the poses of the three historical frames:

[0049]

[0050] By combining basic prediction, continuity constraints, and second-order difference smoothing, and introducing environmental adaptation parameters to dynamically allocate weights, a preliminary attitude update formula is obtained:

[0051]

[0052] Among them, P i (prelim) This represents the initial attitude solution result at the current moment. The resulting initial attitude sequence can be represented as follows:

[0053] In one specific implementation, eliminating residual errors in the initial attitude sequence and generating a corrected attitude sequence through nonlinear self-calibration includes:

[0054] Calculate the deviation vector R between the pose of each frame and the moving average pose of the previous three frames. i :

[0055]

[0056] Among them, R i =[r x (i),r y (i),rz [(i)] represents the instantaneous residual of the current pose relative to the historical pose;

[0057] Introducing nonlinear self-correcting increment ΔP i (nl) By combining the designed nonlinear function f(·) with an exponential weighted correction mechanism, adaptive suppression of residuals is achieved.

[0058]

[0059] Where, f(R) i )=tanh(R i ) is a nonlinear mapping function, and η is the residual suppression coefficient. This indicates element-wise multiplication.

[0060] The nonlinear correction increment is superimposed with the initial attitude to generate the corrected attitude vector P. i (corrected) =P i (prelim) -ΔP i (nl) The minus sign indicates correction along the residual direction, and the corrected attitude vector sequence is P. (corrected) .

[0061] In a specific feasible implementation, the continuity verification and anomaly detection of the corrected attitude sequence are performed to generate the final output continuous attitude sequence, including:

[0062] Continuity verification is performed on the pose vector of each frame by calculating the pose change amplitude between adjacent frames. This represents the attitude vector after nonlinear self-correction at the previous sampling time. It is determined whether it exceeds a preset continuity threshold. When the change amplitude is within the threshold range, the attitude continuity is considered normal and it is directly included in the final solution sequence. If it exceeds the threshold, an anomaly detection mechanism is triggered to further analyze the attitude of the frame.

[0063] Anomaly detection is performed, including short-term abnormal fluctuations and long-term cumulative anomalies. Short-term abnormal fluctuations are judged by the local average and standard deviation of the sliding window. If the current frame deviates from the local average by more than a set multiple, it is marked as an anomaly. Long-term cumulative anomalies are judged by analyzing the trend of change over several consecutive frames to determine whether there is systematic drift or trend deviation. For detected abnormal frames, corrections are made by interpolation, smoothing, or weighted neighborhood averaging.

[0064] The attitude sequence, after continuity verification and anomaly detection correction, forms the final output continuous attitude solution result P. (final) .

[0065] Secondly, this application provides a ship internal attitude calculation system based on attitude dynamics and inertial navigation technology, which adopts the following technical solution:

[0066] An attitude calculation system for a ship based on attitude dynamics and inertial navigation technology includes:

[0067] The timing preprocessing module is used to collect attitude data in real time based on the inertial measurement unit and perform timing preprocessing on the attitude data to obtain a timing-constrained attitude sequence.

[0068] The environmental parameter generation module is used to extract the spectral characteristics of the ship's internal environment online and generate environmental adaptation parameters based on the spectral characteristics;

[0069] The discrete dynamics constraint module is used to construct discrete dynamic constraints based on the temporal constraint attitude sequence, using the attitude vector at the current moment as the initial value, by the attitude difference with the previous moment and the two moments before that. At the same time, the second-order difference of the attitude of the three historical frames is introduced to smooth high-frequency changes and instantaneous jumps. The observed attitude, continuity constraints and second-order difference results are dynamically weighted according to the environmental adaptation parameters to obtain the preliminary attitude vector at the current sampling moment and generate the preliminary attitude sequence.

[0070] The nonlinear self-calibration module is used to eliminate residual errors in the initial attitude sequence and generate a calibrated attitude sequence through nonlinear self-calibration.

[0071] The attitude output module is used to perform continuity verification and anomaly detection on the corrected attitude sequence, and generate the final output continuous attitude sequence.

[0072] Thirdly, this application provides an electronic device including a processor and a memory; the memory stores a program, which is loaded and executed by the processor to implement an attitude calculation method for ship interiors based on attitude dynamics and inertial navigation technology as described in the first aspect.

[0073] Fourthly, this application provides a computer-readable storage medium storing a program that, when executed by a processor, is used to implement the attitude calculation method for a ship's interior based on attitude dynamics and inertial navigation technology as described in the first aspect.

[0074] The ship's attitude data is acquired in real time using an inertial measurement unit (IMU), and time-series preprocessing is performed to obtain a continuity-constrained attitude data sequence. Then, spectral characteristics of various sensor data, including vibration, noise, temperature, and humidity, are extracted online from the ship's internal environment. Environmental adaptation parameters are generated based on spectral analysis; these parameters quantify the degree of interference from the current environment on the IMU measurement, thus enabling dynamic adaptive adjustment of the attitude calculation process. Next, using the obtained time-series constrained attitude sequence, with the current attitude vector as the initial value, a continuity constraint is constructed by differencing the attitude vector from the previous two timeframes. Simultaneously, the second-order difference of the attitude from three historical frames is introduced. To smooth high-frequency changes and instantaneous jumps, and to dynamically allocate the weights of observed attitude and dynamic constraints in conjunction with environmental adaptation parameters, a preliminary attitude vector is obtained and a preliminary attitude sequence is generated. Then, the preliminary attitude sequence is subjected to nonlinear self-correction, and residual errors caused by observation noise, imperfect dynamic constraint matching, and high-frequency disturbances are eliminated using the residual mapping function and an improved exponential weighted correction mechanism to generate a corrected attitude sequence. Finally, the corrected attitude sequence is subjected to continuity verification and anomaly detection to ensure the continuity and reliability of the output attitude sequence in the complex environment inside the ship, thereby generating a final continuous attitude vector sequence for navigation and control. On the one hand, dynamic weight allocation in the attitude calculation process is achieved through environmental adaptation parameters, which enhances dynamic constraints to suppress abnormal jumps in high-noise environments, while relying more on observation data to enhance dynamic responsiveness when the environment is stable. On the other hand, discrete dynamic continuity constraints and historical difference smoothing ensure that attitude changes are smooth and conform to physical continuity, effectively avoiding sudden changes caused by periodic vibrations or instantaneous impacts. Combined with a nonlinear self-correction mechanism, high-frequency disturbances and integral accumulation errors in the initial attitude sequence are suppressed, thereby significantly improving the accuracy and continuity of attitude calculation, so that the final output attitude sequence can stably and reliably reflect the target attitude in complex ship internal environments.

[0075] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, the preferred embodiments of this application are described in detail below with reference to the accompanying drawings. Attached Figure Description

[0076] Figure 1 This is a flowchart illustrating the attitude calculation method based on attitude dynamics and inertial navigation technology inside the ship in the embodiments of this application.

[0077] Figure 2 This is a schematic diagram of the overall process of the attitude calculation method based on attitude dynamics and inertial navigation technology inside the ship in the embodiments of this application.

[0078] Figure 3 This is a structural block diagram of the attitude calculation system based on attitude dynamics and inertial navigation technology inside the ship, as described in this application embodiment.

[0079] Figure 4 This is a block diagram of an electronic device for attitude calculation based on attitude dynamics and inertial navigation technology inside a ship, as described in this application embodiment. Detailed Implementation

[0080] The specific embodiments of this application will be described in further detail below with reference to the accompanying drawings and examples. The following examples are used to illustrate this application, but are not intended to limit the scope of this application.

[0081] Optionally, this application uses the attitude calculation method based on attitude dynamics and inertial navigation technology provided in various embodiments as an example of its application in electronic devices. The electronic device is a terminal or server. The terminal can be a computer, tablet computer, etc. This embodiment does not limit the type of electronic device.

[0082] Reference Figure 1 This is a flowchart illustrating a method for attitude calculation based on attitude dynamics and inertial navigation technology inside a ship, according to an embodiment of this application. The method includes at least the following steps:

[0083] Step S101: Collect attitude data in real time based on the inertial measurement unit and perform time-series preprocessing on the attitude data to obtain a time-series constrained attitude sequence.

[0084] In step S101, the attitude data of the target object is acquired in real time based on the inertial measurement unit (IMU). The attitude data includes three-axis angular velocity data ω. i =[ω x (i),ω y (i),ω z (i) and triaxial acceleration data a i =[a x (i),a y (i),a z (i)], where index i represents the i-th sampling time t i The adjacent sampling interval is Δt i =t i -t i-1 Angular velocity data reflects the target's rotational rate along the three attitude axes, while acceleration data reflects the target's linear acceleration components and their relationship with the direction of gravity. Due to factors such as vibration, mechanical noise, and unstable sampling intervals within the ship's internal environment, directly using raw attitude data for attitude calculation leads to integral drift and temporal distortion, making it difficult to maintain the continuity and consistency of attitude estimation. Therefore, this step performs temporal preprocessing on the collected attitude data to eliminate non-physical jumps, smooth sampling disturbances in the time dimension, and form an attitude data sequence with time-constrained characteristics.

[0085] Specifically, this step includes the following processing steps in sequence: First, for the acceleration vector a at each sampling time... i After normalization, the unit gravity direction vector is obtained.

[0086]

[0087] This process removes the influence of acceleration amplitude and retains only directional information, which is used to determine whether the acceleration measurement is mainly composed of the gravitational component.

[0088] Subsequently, to distinguish between gravity-dominated scenarios that can be used for attitude correction and scenarios with significant linear acceleration disturbances, an acceleration reliability weight w is introduced. i :

[0089]

[0090] Where g0 is the standard gravitational acceleration, σ a The tolerance threshold for acceleration amplitude deviation is defined as follows: if the current acceleration magnitude is close to g0, then w... i A value close to 1 indicates that the acceleration data primarily reflects the direction of gravity and can be used for subsequent attitude correction; if the deviation is large, then w i A decrease indicates that the acceleration data is strongly influenced by linear acceleration, and its role in attitude correction should be reduced.

[0091] Next, the rotation increment of the target within the current sampling interval is calculated using the angular velocity data. The rotation increment at the current moment is calculated using the trapezoidal integral method:

[0092]

[0093] in, This indicates that during the sampling interval Δt i The rotational angle increment, obtained by integrating the angular velocity, is the main source of attitude change. ω i-1 This represents the angular velocity observation at the previous moment.

[0094] To further suppress drift errors caused by angular velocity integrals and to constrain attitude orientation in a gravity-stabilized scenario, the gravity direction measured by acceleration is used to perform micro-corrections on attitude changes. Assume that the theoretical unit gravity direction vector in the sensor coordinate system can be obtained from the attitude prediction at the previous moment. The acceleration-guided correction vector is defined as follows:

[0095]

[0096] Where × represents the vector cross product operation, and the direction of the result indicates the minimum rotation direction from the theoretical gravity direction to the measured gravity direction; β is the attitude correction gain coefficient, used to control the degree of influence of acceleration correction. Through weight w i The adjustment mechanism automatically suppresses the correction effect when the acceleration contains a strong linear acceleration component, in order to avoid introducing errors.

[0097] Furthermore, due to signal transmission delays and varying computational loads in the ship's cabin environment, IMU sampling interval fluctuations occur. To compensate for the resulting time integration error, a sampling time drift correction factor is introduced.

[0098]

[0099] in, η represents the moving average value over several past frame sampling intervals, where γ is the drift correction coefficient. This factor is used to dynamically correct the accumulated error caused by sampling time fluctuations during integration. When the actual sampling interval deviates from the average value, η... i A small compensation term will be generated to balance the time base drift during integral calculations.

[0100] Finally, combining the contributions from the three parts mentioned above, we obtain the current time t. i Timing-constrained attitude increment:

[0101]

[0102] Where 1 = [1,1,1] T η represents the unit correction vector uniformly distributed across the three attitude axes. i 1 represents time drift compensation proportionally distributed across the three rotational components. Based on this increment, the current attitude vector can be calculated recursively.

[0103]

[0104] in, These represent the attitude angle vectors after timing constraint correction, corresponding to pitch, roll, and yaw angles, respectively. This represents the attitude vector obtained after timing constraints and corrections at the previous moment.

[0105] After time-series constraints and attitude calculation, the generated time-consistent attitude sequence can be denoted as:

[0106] The above processing first involves normalizing the acceleration vector to remove amplitude influence and retain only the directional component, thus obtaining a unit vector representing the gravitational direction. A reliability weight is then established based on the deviation between the acceleration magnitude and the standard gravitational acceleration to determine whether the current acceleration data is primarily composed of the gravitational component. This weight controls the degree of acceleration data participation in attitude correction, avoiding errors introduced by linear acceleration interference. Secondly, the rotation increment within the current sampling interval is calculated using angular velocity data, serving as the primary basis for attitude changes. This is combined with an acceleration-guided micro-correction vector to suppress angular velocity integral drift, thereby maintaining consistency in attitude direction under stable gravity conditions. Furthermore, to address the instability of the IMU sampling interval, a time drift correction factor is introduced to dynamically compensate for integral deviations caused by sampling interval fluctuations, ensuring a consistent time base for attitude calculation. Finally, by integrating the angular velocity integral term, acceleration correction term, and time drift compensation term, a time-constrained corrected attitude increment is obtained, and a continuous, smooth attitude angle sequence is recursively calculated from this. It is worth noting that after preprocessing, the temporally constrained attitude sequence is represented in the form of angular velocity. This does not mean that acceleration information is discarded; rather, the effect of acceleration is "implicitly" reflected in the angular velocity update results through weighted constraints and attitude corrections. In other words, acceleration data in this step is mainly used to correct the angular velocity integral direction, suppress drift errors, and ensure consistency with constraint time, rather than directly participating in the final expression of attitude parameters. The technical advantage of this approach is that it maintains the physical consistency of attitude calculation while avoiding high-frequency noise and non-gravitational component interference from the acceleration signal, thus obtaining an attitude data sequence that combines temporal stability and directional continuity.

[0107] Step S102: Extract the spectral characteristics of the ship's internal environment online and generate environmental adaptation parameters based on the spectral characteristics.

[0108] In step S102, the objective is to extract various sensor data of the ship's internal environment in real time to generate adaptive parameters reflecting the current environmental state. In implementation, multiple environmental sensors pre-installed inside the ship are used to collect data on vibration, noise, temperature and humidity, and other possible physical disturbances within the cabins. These sensors include vibration sensors, noise sensors, temperature and humidity sensors, and acceleration sensors. Vibration sensors are used to collect vibration signals generated by various components within the ship (such as engines, mechanical equipment, and piping systems) in real time. Noise sensors are used to detect the noise level within the cabins, primarily from noise generated by the ship's engines, ventilation equipment, and other electronic devices. Temperature and humidity sensors are used to measure changes in ambient temperature and humidity, and acceleration sensors are used to detect the overall acceleration of the ship, especially during navigation, where the interaction between the ship and waves causes periodic acceleration fluctuations in the hull.

[0109] The data from the aforementioned sensors, acquired and processed in real time, reflects the dynamic changes in the physical environment inside the ship. Let x(t) = [x1(t), x2(t), ..., x...]. m [x1(t)] represents multiple environmental signal data collected from different sensors at time t, where x1(t), x2(t), ..., xt... m (t) represent the raw data output by the vibration, noise, temperature and humidity, and acceleration sensors, respectively.

[0110] Because noise and vibration in the ship's environment are time-varying and exhibit strong periodicity and randomness, direct analysis of time-domain signals is insufficient to effectively reflect their dynamic characteristics. Therefore, this step uses Fast Fourier Transform (FFT) to convert various environmental signals from the time domain to the frequency domain to extract their spectral information. Specifically, the spectrum of the environmental signal is set as X(ω), and its calculation formula is as follows:

[0111]

[0112] Here, X(ω) represents the environmental signal x(t) in the frequency domain, where ω is the frequency, N is the number of sampling points, and t is the time index. Spectral analysis can identify the dominant frequency band and energy distribution of the environmental signal. For example, the high-frequency component of a vibration signal may correspond to the high-speed operating noise of mechanical equipment, while the low-frequency component may be related to the stable motion of a ship or the force of ocean waves. The spectrum of a noise signal can reveal the stability of equipment operation and the regularity of airflow within the cabin. The spectral characteristics of temperature and humidity changes help assess the impact of climate change on ship equipment.

[0113] After obtaining the spectral characteristics, the environmental adaptation parameter α(t) is generated by calculating the energy distribution of different frequency bands. This parameter characterizes the degree of influence of the current environment on subsequent attitude calculations, especially the impact of various interference factors on the IMU (Inertial Measurement Unit) signal within the ship. The method for generating the environmental adaptation parameter α(t) is as follows:

[0114]

[0115] Where, |X(ω)| 2 ω represents the energy density of the spectrum. l and ω h These represent the lower and upper limits of the interference frequency band, ω0 and ω, respectively. m These are the lower and upper limits of the reference frequency band. An adaptive parameter α(t), representing the current environmental noise level, is obtained by calculating the ratio of the energy of the interference frequency band to the energy of the reference frequency band.

[0116] When α(t) is high, it indicates that there is a lot of noise in the environment, which has a strong impact on the IMU data. In this case, it is necessary to suppress the interference from the environment more strongly in the subsequent attitude calculation. When α(t) is low, it indicates that the environment is relatively stable and the signal quality of the IMU data is better, so less data correction is needed.

[0117] Step S103: Based on the temporal constraint attitude sequence, take the attitude vector at the current moment as the initial value, construct discrete dynamic constraints by the attitude difference with the previous moment and the two moments before, and introduce the second-order difference of the attitude of the three historical frames to smooth high-frequency changes and instantaneous jumps. Dynamically assign weights to the observed attitude, continuity constraints and second-order difference results according to the environmental adaptation parameters to obtain the preliminary attitude vector at the current sampling moment and generate the preliminary attitude sequence.

[0118] In step S103, the objective is to utilize the temporal constraint attitude sequence obtained in step S101. Using the environmental adaptation parameters α(t) generated in step S102, an adaptive discrete dynamics model is constructed to achieve a preliminary calculation of the target attitude under the ship's internal operating environment. The input consists of a time-constrained attitude sequence and environmental adaptation parameters. Based on these inputs, a reliable preliminary calculation of the target's attitude is performed on a discrete time scale, outputting a continuous, smooth, and adaptively adjusted preliminary attitude vector sequence according to the current environmental characteristics. To achieve this goal, this step performs calculations at each sampling time t. i The following operations and processes are executed sequentially. All operations are performed in real time on the terminal device, and the result of the previous time step is used as the initial value of the next time step to ensure that a recursion is formed in the linear time sequence.

[0119] First, the obtained timing-constrained attitude angle vectors As the observation input, the basic predicted attitude at the current time is calculated. The initial calculated attitude vector is set as P. i Then, in the discrete time step Δt i Internally, basic predictions are made using angular velocity increments:

[0120]

[0121] Among them, P i (0) =[p x (i),p y (i),p z [(i)] represents the initial attitude angle vector at the i-th moment, which corresponds to the pitch angle, roll angle and yaw angle respectively; Δt represents the initial attitude vector at the previous moment; i Indicates the current sampling interval. This represents the attitude change increment obtained by integrating the angular velocity.

[0122] Subsequently, in order to ensure that the predicted attitude not only reflects the real-time observations but also satisfies the requirement of inertial continuity, it is necessary to introduce historical attitude differences to construct discrete dynamic constraints C. i :

[0123]

[0124] in, The initial attitude is given by λ, which is the continuity adjustment coefficient used to control the strength of the continuity constraint. This term ensures that the attitude change does not occur abruptly when there is periodic vibration or instantaneous impact in the ship's compartments. To further suppress high-frequency vibration and instantaneous jump phenomena, this step also introduces a second-order difference smoothing term D. i It is defined as the first-order difference-plus-difference of the poses of the three historical frames:

[0125]

[0126] This term reflects the acceleration trend of attitude changes over the past three frames, used to suppress jumps caused by high-frequency disturbances and enhance the smoothness of the attitude curve. By combining the basic prediction, continuity constraints, and second-order differential smoothing, and introducing environmental adaptation parameters to dynamically allocate weights, the final preliminary attitude update formula for this step is obtained:

[0127]

[0128] Among them, P i (prelim) This represents the preliminary attitude calculation result at the current moment. The environmental adaptation parameter in the formula controls the weight distribution between angular velocity observation and dynamic continuity correction: when the environmental noise is strong (α(t) is large), it relies more on dynamic constraints to suppress anomalous jumps; when the environment is stable (α(t) is small), the system relies more on angular velocity observation to enhance dynamic responsiveness; κ is the second-order differential smoothing gain coefficient, κD i This ensures continuity and smoothness.

[0129] After the above processing, the resulting preliminary attitude sequence can be represented as follows:

[0130] Each frame All are attitude vectors that have been dynamically constrained and adaptively adjusted by the environment.

[0131] Through the design of step S103, firstly, the discrete dynamics model combined with historical attitude difference is used to ensure the continuity and physical consistency of attitude changes, effectively avoiding abrupt attitude changes when affected by periodic vibrations or instantaneous impacts in the ship's cabins. Secondly, by introducing environmental adaptation parameters, the weights of attitude observations and dynamic constraints are dynamically adjusted according to the intensity of environmental noise. This allows the initial attitude calculation to automatically strengthen constraints and suppress anomalous jumps in noisy environments, while relying more on observations to enhance dynamic responsiveness in stable environments. This mechanism significantly improves the system's adaptability and reliability in complex ship interior environments. Thirdly, the second-order difference smoothing term suppresses high-frequency disturbances and short-term fluctuations, maintaining the temporal smoothness of the initial attitude sequence while reducing the accumulation of errors introduced by environmental interference.

[0132] Step S104: Eliminate residual errors in the initial attitude sequence through nonlinear self-calibration and generate a calibrated attitude sequence.

[0133] In step S104, the target is the preliminary attitude sequence generated in step S103. By eliminating residual errors caused by observation noise, imperfect dynamic constraint matching, and high-frequency disturbances through nonlinear self-calibration, an attitude sequence P with minimized final residuals is generated. (corrected) .

[0134] First, to quantify the residual error of the initial attitude sequence, the deviation vector R between the attitude of each frame and the moving average attitude of the previous three frames is calculated. i :

[0135]

[0136] Among them, R i =[r x (i),r y (i),r z [(i)] represents the instantaneous residual of the current attitude relative to the historical attitude. This residual reflects both the jumps caused by high-frequency disturbances and environmental noise or integral accumulation errors.

[0137] Subsequently, a nonlinear self-correcting increment ΔP was introduced. i (nl) By combining the designed nonlinear function f(·) with the improved exponential weighted correction mechanism, adaptive suppression of residuals is achieved.

[0138]

[0139] Where, f(R) i )=tanh(R iThe nonlinear mapping function () compresses the residuals to the range [-1, 1], ensuring that the correction increment is not too large while retaining the error direction information; η is the residual suppression coefficient, controlling the nonlinear decay as the residual amplitude increases; ° indicates element-wise multiplication, ensuring that the nonlinear function and decay weights consider both the error direction and amplitude. Compared with the traditional exponential weighted average, this formula not only weights and decays historical residuals but also introduces a nonlinear function mapping, ensuring that overcorrection is not caused by large errors while retaining effective adjustment capability for small errors.

[0140] Then, the nonlinear correction increment is superimposed on the initial attitude to generate the corrected attitude vector P. i (corrected) =P i (prelim) -ΔP i (nl) The minus sign indicates correction along the residual direction to eliminate anomalous changes that deviate from the historical continuous trend. The resulting attitude vector sequence... It balances continuity, smoothness, and nonlinear residual suppression, and can significantly reduce the cumulative error introduced by environmental disturbances or initial attitude estimation errors.

[0141] Through the above design, step S104 effectively suppresses residual deviations caused by high-frequency environmental disturbances, observation noise, and preliminary attitude integration errors while preserving the continuity and smoothness of attitude changes. The nonlinear mapping function ensures that overcorrection does not occur under large residual conditions, while still allowing for fine-tuning of small residuals, making the attitude sequence both stable and sensitive. The exponential weighted attenuation mechanism combined with the nonlinear function enables the system to adaptively allocate correction intensity according to the residual amplitude, achieving dual suppression of sudden jumps and environmental disturbances. This design significantly improves the reliability and accuracy of attitude calculation, enabling the corrected attitude sequence to more realistically reflect the continuous motion state of the target within the ship's internal environment.

[0142] Step S105: Perform continuity verification and anomaly detection on the corrected attitude sequence to generate the final output continuous attitude sequence.

[0143] In step S105, the input is the corrected attitude sequence generated in step S104.

[0144] Each frame All are attitude vectors after nonlinear self-calibration. The goal of this step is to perform continuity verification and anomaly detection on the entire calibrated attitude sequence, ensuring that the attitude sequence is smooth and continuous in time, while eliminating possible abnormal fluctuations, and finally generating a continuous attitude solution that can be used directly.

[0145] First, the continuity of the pose vector in each frame is verified. This is done by calculating the magnitude of pose changes between adjacent frames. This represents the attitude vector after nonlinear self-correction at the previous sampling time; it is then used to determine whether it exceeds a preset continuity threshold. The threshold is dynamically set based on the ship's internal motion characteristics and IMU sampling accuracy, used to distinguish between reasonable natural motion changes and abnormal jumps. When the change amplitude is within the threshold range, the attitude continuity is considered normal and can be directly included in the final solution sequence; if it exceeds the threshold, an anomaly detection mechanism is triggered, and the attitude of that frame is further analyzed.

[0146] Anomaly detection is then performed. Anomaly detection includes short-term abnormal fluctuations and long-term cumulative anomalies. Short-term abnormal fluctuations are determined using the local average and standard deviation of a sliding window; if the current frame deviates from the local average by more than a set multiple, it is marked as an anomaly. Long-term cumulative anomalies are determined by analyzing the changing trends of several consecutive frames to identify systematic drift or trend deviations. Detected anomalous frames can be corrected using interpolation, smoothing, or weighted neighborhood averaging to ensure the continuity and smoothness of the attitude sequence.

[0147] Finally, the attitude sequence, after continuity verification and anomaly detection correction, is used to form the final output continuous attitude solution.

[0148] Each frame This is the final attitude calculation result after all steps of processing, explicitly representing the target's pitch, roll, and yaw angles within the ship's internal operating environment. This sequence can be directly used for real-time attitude reference, operation monitoring, or attitude control applications.

[0149] In summary, combining Figure 2In implementation, firstly, ship attitude data is acquired in real time based on the inertial measurement unit (IMU), and the attitude data undergoes temporal preprocessing to obtain an attitude data sequence with continuity constraints. Then, the spectral characteristics of various sensor data, such as vibration, noise, temperature, and humidity, are extracted online from the ship's internal environment. Environmental adaptation parameters are generated based on spectral analysis. These parameters quantify the degree of interference of the current environment on IMU measurements, thereby achieving dynamic adaptive adjustment of the attitude calculation process. Next, using the temporally constrained attitude sequence obtained in step S101, with the current attitude vector as the initial value, continuity constraints are constructed by comparing it with the attitude differences from the previous two moments, while also incorporating three historical frames. The second-order difference of attitude is used to smooth high-frequency changes and instantaneous jumps, and the weights of the observed attitude and dynamic constraints are dynamically allocated in combination with environmental adaptation parameters to obtain a preliminary attitude vector and generate a preliminary attitude sequence. Then, nonlinear self-correction is performed on the preliminary attitude sequence, and residual errors caused by observation noise, imperfect dynamic constraint matching and high-frequency disturbances are eliminated by using the residual mapping function and the improved exponential weighted correction mechanism to generate a corrected attitude sequence. Finally, the corrected attitude sequence is subjected to continuity verification and anomaly detection to ensure the continuity and reliability of the output attitude sequence in the complex environment inside the ship, thereby generating the final continuous attitude vector sequence for navigation and control.

[0150] Through the above design, this application effectively solves the problems of continuous interference from complex metal structures and mechanical vibrations in the ship's internal environment on IMU measurements, as well as attitude drift caused by the accumulation of small errors in inertial integration calculations over time. On the one hand, dynamic weight allocation in the attitude calculation process is achieved through environmental adaptation parameters, enabling the system to enhance dynamic constraints and suppress abnormal jumps in high-noise environments, while relying more on observation data to enhance dynamic responsiveness when the environment is stable. On the other hand, discrete dynamic continuity constraints and historical difference smoothing ensure smooth attitude changes that conform to physical continuity, effectively avoiding abrupt changes caused by periodic vibrations or instantaneous impacts. Combined with a nonlinear self-correction mechanism, high-frequency disturbances and integral accumulation errors in the initial attitude sequence are suppressed, thereby significantly improving the accuracy and continuity of attitude calculation, enabling the final output attitude sequence to stably and reliably reflect the target attitude in complex ship internal environments.

[0151] Figure 3 This is a structural block diagram of a ship's internal attitude calculation system based on attitude dynamics and inertial navigation technology, provided in one embodiment of this application. The system includes at least the following modules:

[0152] The timing preprocessing module is used to collect attitude data in real time based on the inertial measurement unit and perform timing preprocessing on the attitude data to obtain a timing-constrained attitude sequence.

[0153] The environmental parameter generation module is used to extract the spectral characteristics of the ship's internal environment online and generate environmental adaptation parameters based on the spectral characteristics;

[0154] The discrete dynamics constraint module is used to construct discrete dynamic constraints based on the temporal constraint attitude sequence, using the attitude vector at the current moment as the initial value, by the attitude difference with the previous moment and the two moments before that. At the same time, the second-order difference of the attitude of the three historical frames is introduced to smooth high-frequency changes and instantaneous jumps. The observed attitude, continuity constraints and second-order difference results are dynamically weighted according to the environmental adaptation parameters to obtain the preliminary attitude vector at the current sampling moment and generate the preliminary attitude sequence.

[0155] The nonlinear self-calibration module is used to eliminate residual errors in the initial attitude sequence and generate a calibrated attitude sequence through nonlinear self-calibration.

[0156] The attitude output module is used to perform continuity verification and anomaly detection on the corrected attitude sequence, and generate the final output continuous attitude sequence.

[0157] For relevant details, please refer to the above method implementation examples.

[0158] Figure 4 This is a block diagram of an electronic device provided in one embodiment of this application. The device includes at least a processor 401 and a memory 402.

[0159] Processor 401 may include one or more processing cores, such as a quad-core processor or an octa-core processor. Processor 401 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 401 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 401 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 401 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0160] Memory 402 may include one or more computer-readable storage media, which may be non-transitory. Memory 402 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in memory 402 is used to store at least one instruction, which is executed by processor 401 to implement the attitude calculation method based on attitude dynamics and inertial navigation technology for ship interiors provided in the method embodiments of this application.

[0161] In some embodiments, the electronic device may also optionally include: a peripheral device interface and at least one peripheral device. The processor 401, memory 402, and peripheral device interface can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface via a bus, signal line, or circuit board. Indicatively, peripheral devices include, but are not limited to: radio frequency circuits, touch displays, audio circuits, and power supplies.

[0162] Of course, electronic devices may also include fewer or more components, and this embodiment does not limit this.

[0163] Optionally, this application also provides a computer-readable storage medium storing a program that is loaded and executed by a processor to implement the attitude calculation method for ship interior based on attitude dynamics and inertial navigation technology described in the above method embodiments.

[0164] Optionally, this application also provides a computer product including a computer-readable storage medium storing a program, which is loaded and executed by a processor to implement the attitude calculation method for ship interiors based on attitude dynamics and inertial navigation technology described in the above method embodiments.

[0165] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0166] The above embodiments merely illustrate several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for solving the attitude of a ship's interior based on attitude dynamics and inertial navigation technology, characterized in that, The method comprises: Real-time acquisition of attitude data based on an inertial measurement unit and time series preprocessing of the attitude data to obtain a time series constrained attitude sequence; Online extraction of spectral features of the internal environment of the ship and generation of environment adaptation parameters based on the spectral features; Based on the time series constrained attitude sequence, taking the attitude vector at the current time as the initial value, constructing discrete dynamics constraints by differentiating the attitude at the current time and the previous two times, simultaneously introducing the second-order difference of the historical three frames of attitude for smoothing high-frequency changes and instantaneous jumps, and dynamically allocating weights to the observed attitude, continuity constraints and second-order difference results according to the environment adaptation parameters to obtain a preliminary attitude vector at the current sampling time and generate a preliminary attitude sequence; Eliminating residual errors in the preliminary attitude sequence through nonlinear self-correction and generating a corrected attitude sequence; Continuous verification and anomaly detection of the corrected attitude sequence to generate a final output continuous attitude sequence.

2. The method of claim 1, wherein, The real-time acquisition of attitude data based on an inertial measurement unit and the time series preprocessing of the attitude data to obtain a time series constrained attitude sequence comprises: The attitude data of the target object is collected in real time based on an inertial measurement unit, and the attitude data includes three-axis angular velocity data ω i =[ω x (i),ω y (i),ω z (i)] and three-axis acceleration data a i =[a x (i),a y (i),a z (i)], wherein the index i represents an i-th sampling time t i , and the adjacent sampling interval is Δt i =t i -t i-1 . acceleration vector a for each sampling time i normalization processing is performed to obtain a unit gravity direction vector Introducing an acceleration reliability weight w i : where g0 is the standard gravity acceleration, σ a is the tolerance threshold for the acceleration amplitude deviation; Introducing a sampling time drift correction factor: wherein represents a moving average of the past several frame sampling intervals, and γ is a drift correction coefficient.

3. The method of claim 2, wherein, The real-time acquisition of attitude data based on an inertial measurement unit and the time series preprocessing of the attitude data to obtain a time series constrained attitude sequence further comprises: Calculating the rotational increment of the target within the current sampling interval using angular velocity data Calculating the rotational increment at the current time instant using trapezoidal integration where ω i-1 denotes the angular velocity observation at the previous time instant; Defining the acceleration-guided correction vector as: Wherein, x is the vector cross product operation, β is the attitude correction gain coefficient, is the unit gravity direction vector of the previous time; Current time t i The timing constraint postures increment as follows: where 1 = [1, 1, 1] T denotes a unit correction vector uniformly distributed among the three attitude axes; η i 1 represents a time drift compensation equally distributed among the three rotational components, based on incremental recursion to compute the current attitude vector: wherein, denotes the posture angle vector after time constraint correction, corresponding to the pitch angle, roll angle and yaw angle respectively, denotes the posture vector obtained after time constraint and correction at the last time; after time constraint and posture calculation, the time-consistent posture sequence generated is denoted as 4. The method of claim 1, wherein, The online extraction of spectral features of the internal environment of the ship and the generation of environment adaptation parameters based on the spectral features comprises: Real-time extraction of various types of sensor data x(t) of the ship internal environment, x(t) = [x1(t), x2(t),..., x m (t)] represents a plurality of environmental signal data collected from different sensors at time t, wherein x1(t), x2(t),..., x m (t) represent the original data output by vibration, noise, temperature and humidity, and acceleration sensors, respectively; Convert various environmental signals from the time domain to the frequency domain to extract the spectral information of the environmental signals through fast Fourier transform, and set the spectrum of the environmental signal as X(ω), whose calculation formula is as follows: Wherein, X(ω) represents the representation of the environmental signal x(t) in the frequency domain, ω is the frequency, N is the number of signal sampling points, and t is the time index; After obtaining the spectral features, the environmental adaptation parameter α(t) is generated by calculating the energy distribution of different frequency bands, and the generation method of the environmental adaptation parameter α(t) is as follows: where |X(ω)| is the energy density of the spectrum, ω 2 l and ω h are the lower and upper limits of the interfering frequency band, and ω0and ω m are the lower and upper limits of the reference frequency band.​ 5. The method of claim 3, wherein, Based on the time series constrained attitude sequence, taking the attitude vector at the current time as the initial value, constructing discrete dynamics constraints by differentiating the attitude at the current time and the previous two times, simultaneously introducing the second-order difference of the historical three frames of attitude for smoothing high-frequency changes and instantaneous jumps, and dynamically allocating weights to the observed attitude, continuity constraints and second-order difference results according to the environment adaptation parameters to obtain a preliminary attitude vector at the current sampling time and generate a preliminary attitude sequence comprises: The resulting vector of time-constrained attitude angles As an observation input, the base predicted attitude at the current time is calculated, and the attitude vector calculated initially is set as P i Then, at the discrete time step Δt i , the base prediction is performed through the angular velocity increment: where P i (0) = [p x (i), p y (i), p z (i)] represents the preliminary attitude angle vector at the i-th moment, corresponding to the pitch angle, roll angle and yaw angle respectively; represents the preliminary attitude vector at the previous moment; Δt i represents the current sampling interval, represents the attitude change increment obtained by integrating the angular velocity; Introducing a history pose difference to construct discrete dynamic constraint C i : where, are the preliminary poses for the previous two time instants, λ is a continuity adjustment coefficient, and the second-order difference smoothing term D i defined as the first-order difference of the second-order difference of the three previous poses: Through the combination of basic prediction, continuity constraints and second-order difference smoothing, and the introduction of environment adaptation parameters to dynamically allocate weights, the preliminary attitude update formula is obtained: P = P + K (z - H (P) ), wherein P i (prelim) The preliminary attitude solution result at the current moment is represented as P0, and the obtained preliminary attitude sequence is represented as P0 6. The method of claim 5, wherein, The elimination of residual errors in the preliminary attitude sequence through nonlinear self-correction and the generation of a corrected attitude sequence comprises: compute a deviation vector R for each frame pose from a three-frame sliding average of historical poses i : where R i = [r x (i), r y (i), r z (i)] represents the instantaneous residual of the current pose with respect to the historical pose; Introducing nonlinear self-correcting increment ΔP i (nl) , combining the designed nonlinear function f(·) and the exponentially weighted correction mechanism to achieve adaptive residual suppression: where f(R i ) = tanh(R i ) is a nonlinear mapping function, and η is a residual suppression coefficient, denotes element-wise multiplication. The nonlinear correction increment is superimposed with the preliminary pose to generate a corrected pose vector P i (corrected) = P i (prelim) - ΔP i (nl) ; where the minus sign indicates a correction in the residual direction, and the sequence of corrected pose vectors is P (corrected) .

7. The method of claim 6, wherein, The continuous verification and anomaly detection of the corrected attitude sequence to generate a final output continuous attitude sequence comprises: The continuity of each frame of attitude vector is verified by calculating the attitude change amplitude between adjacent frames The attitude vector after nonlinear self-correction at the previous sampling time is represented; whether it exceeds the preset continuity threshold is judged, when the change amplitude is within the threshold range, it is considered that the attitude continuity is normal, and it is directly included in the final calculation sequence; if it exceeds the threshold, the abnormal detection mechanism is triggered, and the frame attitude is further analyzed; Anomaly detection is performed, and the anomaly detection includes short-time abnormal fluctuation and long-time cumulative anomaly. The short-time abnormal fluctuation is determined by local average and standard deviation of a sliding window. If a current frame deviates from the local average by more than a set multiple, the current frame is marked as abnormal. The long-time cumulative anomaly is determined by change trend analysis of consecutive frames. Whether there is systematic drift or trend deviation is determined. For the detected abnormal frame, the abnormal frame is corrected by interpolation, smoothing or weighted neighborhood average. The pose sequence that has been corrected by the continuity verification and the anomaly detection forms a final output continuous pose solution P (final) .

8. A ship internal attitude resolving system based on attitude dynamics and inertial navigation technology, characterized in that, The method comprises: a time sequence preprocessing module, configured to collect attitude data in real time based on an inertial measurement unit and perform time sequence preprocessing on the attitude data to obtain a time sequence constrained attitude sequence; an environment parameter generation module, configured to extract a frequency spectrum feature of an internal environment of a ship online and generate an environment adaptive parameter based on the frequency spectrum feature; a discrete dynamics constraint module, configured to, based on the time sequence constrained attitude sequence, take an attitude vector at a current time as an initial value, construct a discrete dynamics constraint by differentiating the attitude vector at the current time from an attitude vector at a previous time and an attitude vector at a time two times before the previous time, introduce a second-order difference of three historical frames of attitude for smoothing high-frequency changes and instantaneous jumps, and dynamically assign weights to an observed attitude, a continuity constraint and a second-order difference result according to the environment adaptive parameter to obtain a preliminary attitude vector at a current sampling time and generate a preliminary attitude sequence; a nonlinear self-correction module, configured to eliminate residual errors in the preliminary attitude sequence by nonlinear self-correction and generate a corrected attitude sequence; an attitude output module, configured to perform continuity verification and anomaly detection on the corrected attitude sequence to generate a final output continuous attitude sequence.

9. An electronic device, comprising: The device comprises a processor and a memory; the memory stores a program, and the program is loaded and executed by the processor to implement the attitude calculation method based on attitude dynamics and inertial navigation technology in the interior of a ship according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The storage medium stores a program, and the program is executed by the processor to implement the attitude calculation method based on attitude dynamics and inertial navigation technology in the interior of a ship according to any one of claims 1 to 7.

Citation Information

Cited By

  • Borehole three-dimensional center line trajectory reconstruction method and measuring probe

    CN122215736A

  • Borehole three-dimensional center line trajectory reconstruction method and measuring probe

    CN122215736B