Naval vessel fault expert knowledge management system based on large language model
By identifying the periodic characteristics of ship data through spectrum and autocorrelation analysis and dynamically adjusting the allocation of privacy budget, the problem of periodic data privacy loss in ship fault knowledge management is solved, and the synergistic optimization of privacy protection and intelligent diagnosis is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-03-10
AI Technical Summary
Existing methods for managing ship malfunction knowledge fail to establish a dynamic identification and correction mechanism for periodic data privacy losses in differential privacy control, leading to distorted privacy budgets and potentially resulting in unauthorized access and leakage of sensitive information.
By identifying the main harmonic frequencies and physical periods of ship data through spectrum analysis and autocorrelation analysis, dynamically calculating the privacy loss amplification factor, and adjusting the data release schedule and privacy budget allocation, a ship fault expert knowledge management system based on a large language model is established.
It significantly reduces the risk of privacy leaks caused by periodic data releases, improves the efficiency of privacy budget utilization, and ensures the safety of ship operations and the efficiency and accuracy of large language model question answering reasoning.
Smart Images

Figure CN121637560A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of privacy computing technology, and more specifically, to a ship fault expert knowledge management system based on a large language model. Background Technology
[0002] Modern warships generate vast amounts of time-series data during operation from their propulsion, auxiliary machinery, and electrical systems. This data, combined with expert knowledge, can be used for fault diagnosis and health prediction. To enable multi-party sharing and question-and-answer reasoning, ship support systems often employ differential privacy mechanisms to protect sensor data and maintenance logs. However, traditional differential privacy algorithms are often based on independent samples, calculating only the noise disturbance of a single data query, while ignoring the strong periodicity and temporal correlation of ship operational data. When this relevant data is continuously released for expert question-and-answer purposes, privacy losses are no longer simply additive but amplified by the inherent periodicity of the signal, causing the system to expose sensitive operational information unnoticed.
[0003] In the practice of ship support platforms, vibration, rotational speed, and power signals all contain fixed physical periods, which form a stable synchronization relationship with the data release time window. When the release rhythm is close to the physical period, the statistics between adjacent windows highly overlap and correlate, leading to a concentrated increase in actual privacy losses. At this point, even if the platform manages access permissions according to the preset budget, budget underestimation may still occur due to hidden time correlations. Furthermore, this periodic amplification not only alters the data sensitivity distribution but also causes the chain-like expert question-and-answer system to expose system operating patterns when continuously calling historical reasoning results, thereby weakening the confidentiality of the ship support system.
[0004] Existing methods for managing ship malfunction knowledge often employ fixed time windows and uniform budget allocation strategies in differential privacy control, failing to establish a dynamic identification and correction mechanism for periodic data privacy losses. Because the privacy budget fails to accurately reflect actual losses, the platform's access control module may generate implicit unauthorized behavior within the scope of legitimate access. For example, experts may obtain sensitive inferences close to actual operating conditions by repeatedly calling the inference chain during question-and-answer sessions. This budget distortion cannot be resolved using traditional anonymization or hierarchical permission methods. Summary of the Invention
[0005] This invention provides a ship fault expert knowledge management system based on a large language model, which solves the technical problems mentioned in the background.
[0006] This invention provides a ship fault expert knowledge management system based on a large language model, including: The data acquisition module acquires continuous monitoring data from the ship's fault correlation system, performs spectrum analysis and autocorrelation analysis on the continuous monitoring data, determines the main harmonic frequency, physical period and harmonic energy ratio, and generates periodic parameters containing the main harmonic frequency, physical period and harmonic energy ratio. The data processing module calculates the privacy loss multiplier for each time window based on the period parameter, the preset time window length, and the initial time step. Under the condition of meeting the preset data release throughput requirements, it selects the time step that minimizes the privacy loss multiplier and applies constraints to avoid being associated with the physical period as an integer multiple or near-integer multiple, thus obtaining a secure release rhythm. The privacy budget calculation module obtains the preset nominal privacy budget, combines the privacy loss multiplier with the nominal privacy budget, and determines the total effective privacy budget. The privacy budget allocation module allocates the privacy budget for each time window based on the importance weight of expert knowledge Q&A and the sensitivity of the data, within the limit of the actual effective total privacy budget. The noise-adding module adds noise to the statistical results of each time window according to the privacy budget of each time window, and outputs the results according to the security release rhythm for reference in the fault reasoning thinking chain of the large language model.
[0007] The beneficial effects of this invention include: identifying the main harmonic frequencies and physical periods of ship data through spectrum analysis and autocorrelation analysis, establishing a periodic parameter model, thereby dynamically calculating the privacy loss amplification factor during data release, and automatically adjusting the release rhythm and privacy budget allocation. Compared with traditional differential privacy methods with fixed windows and uniform budgets, this invention significantly reduces the risk of privacy leakage caused by periodic data releases, improves the efficiency of privacy budget utilization, and ensures that while protecting the safety of ship operations and sensitive information, it can still maintain the efficiency and accuracy of large language model question-answering reasoning, achieving synergistic optimization of privacy protection and intelligent diagnostic performance. Attached Figure Description
[0008] Figure 1 This is a module diagram of the ship fault expert knowledge management system based on a large language model according to the present invention. Detailed Implementation
[0009] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the subject matter described herein, and changes may be made to the function and arrangement of the elements discussed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the examples. Furthermore, features described in some examples may be combined in other examples.
[0010] like Figure 1 As shown, the ship fault expert knowledge management system based on a large language model includes: The data acquisition module acquires continuous monitoring data from the ship's fault correlation system, performs spectrum analysis and autocorrelation analysis on the continuous monitoring data, determines the main harmonic frequency, physical period and harmonic energy ratio, and generates periodic parameters containing the main harmonic frequency, physical period and harmonic energy ratio. The data processing module calculates the privacy loss multiplier for each time window based on the period parameter, the preset time window length, and the initial time step. Under the condition of meeting the preset data release throughput requirements, it selects the time step that minimizes the privacy loss multiplier and applies constraints to avoid being associated with the physical period as an integer multiple or near-integer multiple, thus obtaining a secure release rhythm. The privacy budget calculation module obtains the preset nominal privacy budget, combines the privacy loss multiplier with the nominal privacy budget, and determines the total effective privacy budget. The privacy budget allocation module allocates the privacy budget for each time window based on the importance weight of expert knowledge Q&A and the sensitivity of the data, within the limit of the actual effective total privacy budget. The noise-adding module adds noise to the statistical results of each time window according to the privacy budget of each time window, and outputs the results according to the security release rhythm for reference in the fault reasoning thinking chain of the large language model.
[0011] In one embodiment of the present invention, continuous monitoring data of a ship fault correlation system is acquired, and spectrum analysis and autocorrelation analysis are performed on the continuous monitoring data to determine the main harmonic frequency, physical period, and harmonic energy ratio, generating periodic parameters including the main harmonic frequency, physical period, and harmonic energy ratio, including: The values of continuous monitoring data at each discrete moment, the number of samples involved in the calculation, and the time sampling interval between adjacent discrete moments are obtained. The sampling frequency is determined based on the time sampling interval, where the sampling frequency is the reciprocal of the time sampling interval. Spectral analysis is performed on the continuous monitoring data to calculate an approximate power spectral density. This approximate power spectral density is calculated by taking the values of the continuous monitoring data at each discrete time, the time sampling interval, and the frequency variable to be evaluated. Specifically, it is calculated by adding the square of the sum of the products of the continuous monitoring data values at each discrete time and the cosine of the frequency variable, the corresponding discrete time number, and the time sampling interval, to the square of the sum of the products of the continuous monitoring data values at each discrete time and the sine of the frequency variable, the corresponding discrete time number, and the time sampling interval, and then dividing by the number of samples. The frequency variable to be evaluated ranges from zero to half the sampling frequency. Within this range, the frequency that maximizes the approximate power spectral density is selected as the main harmonic frequency. Autocorrelation analysis is performed on the continuous monitoring data to calculate the normalized autocorrelation function. This normalized autocorrelation function is calculated using the continuous monitoring data values at each discrete time, the sample mean of the continuous monitoring data, and the positive time delay variable. Specifically, the difference between the continuous monitoring data values at each discrete time and the sample mean is multiplied by the difference between the continuous monitoring data values at the corresponding time delay and the sample mean. All these products are then summed to obtain the numerator. The sum of the squares of the differences between the continuous monitoring data values at each discrete time point and the sample mean is used as the denominator; the ratio of the numerator to the denominator is the normalized autocorrelation function; the positive time delay variable is in the range of being greater than zero and less than the product of the number of samples and the time sampling interval; within the range of being greater than zero and less than the product of the number of samples and the time sampling interval, the time delay that maximizes the normalized autocorrelation function is selected as the physical period. Calculate the primary harmonic energy, which is the value of the approximate power spectral density at the primary harmonic frequency; calculate the total energy, which is the integral value of the approximate power spectral density over the range from zero to half the sampling frequency; calculate the harmonic energy ratio, which is the ratio of the primary harmonic energy to the total energy. The periodic parameter consists of the main harmonic frequency, the physical period, and the proportion of harmonic energy.
[0012] Continuous monitoring data refers to the monitoring data values (such as temperature and vibration amplitude) collected at multiple discrete time points by ship fault-related systems (such as power and navigation systems), with the unit depending on the monitoring type (such as degrees Celsius and millimeters).
[0013] The sample size refers to the total number of discrete monitoring data used for spectrum analysis and autocorrelation analysis. It needs to be set according to the analysis accuracy (e.g., take 1000 samples, but no less than 500 to ensure the reliability of the results).
[0014] The time sampling interval refers to the time difference between two adjacent discrete monitoring moments, in seconds. It is determined by the sensor's preset sampling frequency (e.g., a sampling frequency of 100 Hz corresponds to an interval of 0.01 seconds) and can be read from the sensor parameter configuration.
[0015] Sampling frequency refers to the number of times a sensor collects data per unit time, measured in Hertz. It reflects the density of data collection; the higher the frequency, the more refined the data, but the larger the storage capacity. Specifically, the sampling frequency is equal to one divided by the time sampling interval between adjacent discrete moments.
[0016] The approximate power spectral density refers to the signal power within a unit frequency range, measured in units of (monitoring data units)² / Hertz, and is used to reflect the signal strength of different frequency components. Specifically, the process involves six steps: First, for each discrete time point, multiply the monitoring data value at that time point by the frequency variable to be evaluated, multiply by the corresponding discrete time point number, and multiply by the cosine of the time sampling interval. The results from all times are summed to obtain the first sum. Second, the square of the first sum is calculated to obtain the first squared value. Third, for each discrete time point, the monitoring data value at that time point is multiplied by the frequency variable to be evaluated, multiply by the corresponding discrete time point number, and multiply by the sine of the time sampling interval. The results from all times are summed to obtain the second sum. Fourth, the square of the second sum is calculated to obtain the second squared value. Fifth, the first squared value and the second squared value are added together to obtain the total sum. Sixth, the total sum is divided by the number of samples used in the calculation; the result is the approximate power spectral density.
[0017] The frequency variable to be evaluated refers to the candidate frequency used to calculate the power spectral density, in Hertz. It must be within the range of zero to half the sampling frequency (due to the sampling theorem, frequencies above this range are meaningless), and can be selected at fixed intervals (e.g., 0.1 Hertz interval).
[0018] The main harmonic frequency refers to the frequency corresponding to the strongest harmonic in the ship's monitoring signal, measured in Hertz, and reflects the main periodic characteristics of the signal (such as the propeller blade passing frequency). Specifically, the first step is to select multiple frequency variables to be evaluated at fixed intervals within the range of zero to half the sampling frequency; the second step is to calculate the approximate power spectral density value corresponding to each frequency variable to be evaluated; the third step is to compare all the approximate power spectral density values and select the frequency variable with the largest value, which is the main harmonic frequency.
[0019] The sample mean of continuous monitoring data refers to the average value of all discrete time-time monitoring data used in the calculation. The unit is the same as that of the monitoring data. It is used to eliminate the influence of the overall data bias on the autocorrelation analysis. Specifically, the first step is to add up the monitoring data values of all discrete time-times to obtain the data sum. The second step is to divide the data sum by the number of samples used in the calculation. The result is the sample mean of continuous monitoring data.
[0020] Positive time delay variables refer to the time difference used to measure the correlation between data at the current moment and data at a later moment. The unit is seconds. The value must be greater than zero and less than the number of samples multiplied by the time sampling interval (to avoid exceeding the total data duration).
[0021] The normalized autocorrelation function (NEC) measures the similarity of signals under different time delays. Its value ranges from -1 to 1; the closer the value is to 1, the stronger the similarity of the signals under that delay. Specifically, the steps are as follows: First, calculate the numerator: For each discrete time point, calculate the difference between the monitored data value at that time and the sample mean, then multiply this difference by the difference between the monitored data value at the corresponding time delay and the sample mean, and sum all the products. Second, calculate the denominator: For each discrete time point, calculate the square of the difference between the monitored data value at that time and the sample mean, and sum all the squares. Third, divide the numerator by the denominator; the result is the normalized autocorrelation function.
[0022] The physical period refers to the time interval of the main periodic changes in the ship's monitoring signal, measured in seconds. It is inversely related to the main harmonic frequency (e.g., a physical period of 0.5 seconds corresponds to a main harmonic frequency of 2 Hz), reflecting the inherent periodic characteristics of the equipment's operation. Specifically, the first step is to select multiple positive time delay variables at fixed intervals within a range greater than zero and less than the number of samples multiplied by the time sampling interval. The second step is to calculate the normalized autocorrelation function corresponding to each positive time delay variable. The third step is to compare all the normalized autocorrelation functions and select the positive time delay variable with the largest value, which is the physical period.
[0023] The primary harmonic energy refers to the signal power corresponding to the primary harmonic frequency, and its unit is (monitoring data unit)² / Hertz, reflecting the energy intensity of the primary harmonic component; specifically, the approximate value of the power spectral density corresponding to the primary harmonic frequency is directly read, and this value is the primary harmonic energy.
[0024] Total energy refers to the total power of the monitored signal across all effective frequency ranges, measured in units of (monitoring data units)² / Hertz, and is used to measure the overall energy level of the signal. Specifically, the first step is to divide the range from zero to half the sampling frequency into several small intervals (e.g., 1000 intervals; the more intervals, the higher the accuracy). The width between each interval is equal to (half the sampling frequency minus zero) divided by the number of intervals. The second step is to calculate the approximate power spectral density corresponding to the midpoint of each interval. The third step is to calculate the approximate energy value of each interval by multiplying its width by the approximate power spectral density value at the midpoint. The fourth step is to sum the approximate energy values of all intervals; the result is the total energy.
[0025] The harmonic energy ratio refers to the proportion of the main harmonic energy in the total signal energy. The value ranges from zero to one. The closer the value is to one, the more significant the main harmonic component is. Specifically, the harmonic energy ratio is equal to the main harmonic energy divided by the total energy.
[0026] In one embodiment of the present invention, based on a period parameter, a preset time window length, and an initial time step, the privacy loss multiplier for each time window is calculated, including: Get the preset time window length and the preset initial time step; Calculate the number of window overlaps, which is the integer part of the time window length divided by the initial time step; define the overlap weight, for each lag number starting from 1, the overlap weight is 1 minus the ratio of that lag number to the number of window overlaps; Estimate the correlation function. The estimated correlation function is the product of the square of the harmonic energy ratio, 2π multiplied by the time delay, and then divided by the cosine of the physical period, where the time delay is the product of the lag index and the initial time step. Calculate the privacy loss multiplier factor, which is 1 plus twice the sum of the sums from 1 to the number of window overlaps minus 1. This summation is the sum of the products of the overlap weight corresponding to each lag number and the correlation function estimate corresponding to that lag number.
[0027] The preset time window length refers to the pre-set time interval length used to divide the continuous monitoring data of the ship. The unit is seconds. It needs to be set according to the time granularity requirements of fault diagnosis (such as short-term faults require short windows, and long-term trends require long windows), for example, set to 10 seconds or 20 seconds.
[0028] The preset initial time step refers to the pre-set time interval between two adjacent time windows, in seconds. It affects the data release frequency (the smaller the step, the more frequent the release). It needs to be set in conjunction with the privacy budget consumption rate, for example, set to 2 seconds or 5 seconds.
[0029] The number of window overlaps refers to the number of time steps in which two adjacent time windows overlap in time, reflecting the degree of window overlap, and is a positive integer. Specifically, the number of window overlaps is equal to the preset time window length divided by the preset initial time step, and the integer part of the calculation result is taken (only the integer part is retained and the decimal part is discarded).
[0030] The lag number is a number used to distinguish different degrees of window overlap. The value starts from 1 and does not exceed the number of overlapping windows minus 1 (because the summation ends at the number of overlapping windows minus 1). For example, when the number of overlapping windows is 5, the lag numbers are 1, 2, 3, and 4.
[0031] Overlap weight refers to the weight that measures the degree of impact of time window overlap on privacy loss under different lag numbers. The value ranges from 0 to 1 (the smaller the lag number, the greater the weight and the stronger the overlap effect). Specifically, the overlap weight is equal to 1 minus (lag number divided by the number of overlapping windows).
[0032] Time delay refers to the actual time difference between two related data windows corresponding to the lag sequence number, in seconds, reflecting the time span of data correlation; specifically, time delay equals the lag sequence number multiplied by the preset initial time step.
[0033] The correlation function estimate measures the correlation of ship monitoring data under time delay. The value ranges from 0 to the square of the harmonic energy ratio (since the cosine value ranges from -1 to 1, it is taken as positive due to the periodicity of ship data). Specifically, the correlation function estimate is equal to (the square of the harmonic energy ratio) multiplied by (2π multiplied by the time delay and then divided by the cosine value of the physical period).
[0034] The privacy loss multiplier factor is a coefficient that reflects the amplification of privacy loss caused by the combination of overlapping time windows and periodic correlation of data. It takes a value greater than or equal to 1 (the larger the coefficient, the more significant the amplification of privacy loss). Specifically, the first step is to calculate the product of the overlap weight and the estimated value of the correlation function for each lag number (from 1 to the number of overlapping windows minus 1). The second step is to add all the above products together to get the sum. The third step is to add 1 to (2 multiplied by the sum) and the final result is the privacy loss multiplier factor.
[0035] In one embodiment of the present invention, under the condition of meeting preset data release throughput requirements, a time step that minimizes the privacy loss multiplicative factor is selected, and constraints are imposed to avoid correlation with the physical cycle in integer or near-integer multiples, to obtain a secure release rhythm, including: For each candidate time step, the corresponding privacy loss multiplier is calculated. The calculation process is as follows: the number of window overlaps is determined based on the time window length and the candidate time step; the overlap weight is determined based on the lag number and the number of window overlaps; the correlation function estimate is determined based on the harmonic energy ratio, physical period, lag number, and candidate time step; the overlap weights corresponding to each lag number are multiplied by the correlation function estimate and summed; the sum is then multiplied by 2 and added by 1 to obtain the privacy loss multiplier corresponding to that candidate time step. Set throughput constraints such that the candidate time step is no greater than the reciprocal of the minimum release frequency; Set near-integer avoidance constraints, the difference between the ratio of candidate time step to physical period and any fraction with an integer numerator and an integer denominator from 1 to the upper limit of rational denominators is not less than the near-integer avoidance tolerance; Among the candidate time steps that satisfy the throughput constraint and the near-integer avoidance constraint, the candidate time step with the smallest privacy loss multiplication factor is selected as the selected time step. Starting with the initial release time, the time of the nth release is the initial release time plus the product of the selected time step and n, where n is a non-negative integer, thus forming a safe release rhythm.
[0036] The candidate time step refers to the potential time step used to screen the safe release rhythm. The unit is seconds. It needs to cover the actual possible release intervals (e.g., from 1 second to 10 seconds, generated at 0.5-second intervals) to provide alternatives for subsequent constraint screening. Specifically, the candidate time step is generated from a preset range (e.g., from 1 second to 10 seconds) at fixed intervals (e.g., 0.5 seconds). The number generated is set according to the accuracy requirements (e.g., 19 candidate values).
[0037] The privacy loss multiplier for the candidate time step refers to the privacy loss multiplier calculated by replacing the initial time step with the candidate time step, reflecting the privacy amplification risk under that candidate time step.
[0038] Throughput constraints refer to the constraints that ensure the data release frequency is not lower than the real-time requirements of fault diagnosis (too long a release interval will cause diagnostic delays); specifically, the throughput constraint is that the candidate time step is less than or equal to (one divided by the minimum release frequency).
[0039] The minimum release frequency refers to the preset minimum data release frequency (in seconds) that meets the real-time requirements of fault diagnosis. For example, if short-term fault diagnosis requires at least one release every 5 seconds, the minimum release frequency is 0.2 times / second. Specifically, the minimum release frequency is set according to the real-time requirements of fault diagnosis. For short-term faults (such as shaft jamming), the minimum release frequency is set to 0.2-0.5 times / second, and for long-term trend monitoring (such as gear wear), the minimum release frequency is set to 0.05-0.2 times / second.
[0040] The near-integer avoidance constraint refers to the constraint that avoids the candidate time step from being associated with an integer multiple or near-integer multiple of the physical period (to prevent data correlation from amplifying privacy losses). Specifically, for each candidate time step, first calculate its ratio to the physical period; then enumerate all fractions with numerators of arbitrary integers and denominators of integers from 1 to the upper limit of rational denominators; if the difference between the ratio and any fraction is less than the near-integer avoidance tolerance, then the candidate time step does not satisfy the constraint; otherwise, it does.
[0041] The upper limit of rational denominators refers to the limitation on the maximum value of the denominator in integers / integer fractions (such as 1 to 10) to avoid excessive computation caused by infinitely enumerating fractions. Specifically, the upper limit of rational denominators is set according to the measurement accuracy of the physical cycle. When the measurement error of the physical cycle is less than 1%, it is set to 8-10; when the error is 1%-5%, it is set to 5-8; and when the error is greater than 5%, it is set to 1-5.
[0042] The near-integer avoidance tolerance refers to the threshold value for judging whether a value is a near-integer multiple (e.g., 0.05). If the difference is less than this value, it is considered a near-integer multiple and should be avoided. Specifically, the near-integer avoidance tolerance is set according to the privacy risk tolerance. For high privacy requirements (such as core propulsion systems), the tolerance is set to 0.05-0.08, and for general requirements (such as auxiliary systems), the tolerance is set to 0.08-0.1.
[0043] The selected time step refers to the time step ultimately used to generate a secure release schedule, balancing throughput requirements, harmonic avoidance requirements, and minimizing privacy risks. Specifically, the first step is to select a set of candidate time steps that simultaneously satisfy the constraints of candidate time step ≤ the reciprocal of the minimum release frequency and near-integer avoidance. The second step is to calculate the privacy loss multiplier for each candidate time step in the set. The third step is to select the candidate time step with the smallest multiplier, which is the selected time step.
[0044] The initial release time refers to the moment when the data is first released (such as the moment when the time window data processing is completed for the first time after the system starts up), which can be preset to the system startup time or the end time of the first complete time window.
[0045] The time of the nth release refers to the specific time point of the nth data release, where n is a non-negative integer (0 corresponds to the initial release time, 1 corresponds to the initial time + the selected step size, and so on). Specifically, the time of the nth release is equal to the initial release time plus (the selected time step size multiplied by n), where the value of n ranges from 0 to the integer part of (total monitoring duration minus the time window length) divided by the selected time step size (to avoid exceeding the data range).
[0046] The safe release rhythm refers to the time sequence set of all nth release times, used to standardize the time nodes of data release and adapt to the continuous calling requirements of the fault reasoning thinking chain of large language models.
[0047] In one embodiment of the present invention, obtaining a preset nominal privacy budget, combining the privacy loss multiplication factor with the nominal privacy budget, and determining the total effective privacy budget includes: Obtain the privacy loss multiplier for each time window, the selected time step, the time window length, the preset nominal privacy budget for each time window, and the preset release period length for budget calculation; Calculate the number of time windows. The number of time windows is the difference between the length of the release period and the length of the time window, divided by the selected time step, and the integer part is then added to the integer part. Calculate the total nominal privacy budget, which is the sum of the nominal privacy budgets for all time windows; The actual effective privacy budget is calculated by multiplying the privacy loss multiplier for each time window by the nominal privacy budget for that time window, and then summing all the multiplication results together.
[0048] The privacy loss multiplier for each time window refers to the privacy loss amplification coefficient corresponding to each time window, reflecting the degree of privacy risk caused by the periodicity and overlap of the data in that window.
[0049] The nominal privacy budget for each preset time window refers to the theoretical privacy protection strength index (in ε units in differential privacy) set in advance for a single time window. The value range is usually 0.1-1 (the smaller the value, the stronger the privacy protection and the lower the data utility). It needs to be set in combination with the utility requirements of fault reasoning.
[0050] The preset release time period length for budget accounting refers to the pre-set time range (in seconds or hours) used to calculate the total consumption of privacy budget, such as 1 hour or 3600 seconds, which needs to cover the complete cycle of fault diagnosis (such as the monitoring cycle in a patrol).
[0051] The number of time windows refers to the total number of time windows that completely cover the preset release period, divided according to the selected time step and time window length. Specifically, the first step is to calculate the difference between the release period length and the time window length; the second step is to divide the difference by the selected time step and take the integer part of the result (only the integer part is kept and the decimal part is discarded); the third step is to add 1 to the integer part, and the final result is the number of time windows.
[0052] The total nominal privacy budget refers to the sum of the nominal privacy budgets for all time windows within the preset release period, reflecting the theoretical total allocation of the privacy budget; specifically, the total nominal privacy budget is equal to the sum of the preset nominal privacy budgets for each time window (the number of sums is the number of time windows).
[0053] The actual effective privacy budget refers to the total actual privacy budget consumption within the preset release period, after considering the privacy loss multiplied by the increment factor for each window, reflecting the true degree of privacy risk; specifically, the actual effective privacy budget is equal to the sum of the products of privacy loss multiplied by the increment factor for each time window and the nominal privacy budget for that window, and the sum of the products of the above for all windows.
[0054] In one embodiment of the present invention, under the constraint of the total effective privacy budget, the privacy budget for each time window is allocated according to the importance weight of expert knowledge Q&A and data sensitivity, including: Obtain the total effective privacy budget, the number of time windows, the privacy loss multiplier for each time window, the preset importance weight of expert knowledge Q&A for each time window, and the data sensitivity of each time window. The data sensitivity is the maximum change in the statistical results of the time window for a single record. Set the amount of privacy budget to be allocated for each time window, and calculate the weighted expected error cost. Specifically, the importance weight of expert knowledge Q&A in each time window is multiplied by twice the square of the ratio of the data sensitivity of that time window to the amount of privacy budget to be allocated. The above calculation results for all time windows are summed to obtain the weighted expected error cost. Set allocation constraints: the sum of the products of the privacy loss multiplier for all time windows and the corresponding privacy budget allocation for each time window shall not exceed the total effective privacy budget, and the amount of privacy budget to be allocated for each time window shall be greater than 0; determine the Lagrange multiplier by: calculating the 2 / 3 power of the privacy loss multiplier for each time window, multiplying it by the 1 / 3 power of the product of twice the importance weight of the expert knowledge Q&A for that time window and the square of the data sensitivity for that time window, summing the above calculation results for all time windows, dividing the summation result by the total effective privacy budget, and finally using the cube of the result as the Lagrange multiplier; The optimal privacy budget allocation for each time window is calculated as follows: the product of twice the importance weight of expert knowledge questions and answers in that time window and the square of the data sensitivity in that time window is calculated, divided by the product of the Lagrange multiplier and the privacy loss multiplier for that time window, and the result raised to the power of 1 / 3 is taken as the optimal privacy budget allocation for that time window.
[0055] The preset importance weight of expert knowledge Q&A for each time window refers to a pre-set coefficient that measures the importance of data in a single time window to expert fault Q&A, with a value range of 0.1-0.9. Fault-critical data windows (such as shaft vibration anomaly windows) have high weights, while ordinary data windows (such as ambient temperature windows) have low weights. Specifically, the weight of fault-critical windows (such as propulsion system vibration windows) is set at 0.7-0.9, and the weight of ordinary auxiliary windows (such as ventilation data windows) is set at 0.3-0.5, based on the correlation between data and faults in the ship fault diagnosis manual.
[0056] Data sensitivity for each time window refers to the maximum change in the statistical result (such as mean or peak) of a single time window caused by the change of a single monitoring data point within the window. The unit is the same as the statistical result. The higher the sensitivity, the more privacy budget is needed to offset the risk of leakage. Specifically, if the statistic is the mean of the window data, the data sensitivity is equal to (the maximum monitoring data value within the window minus the minimum monitoring data value) divided by the number of data points in the window; if the statistic is the peak of the window data, the data sensitivity is equal to the maximum monitoring data value within the window minus the minimum monitoring data value.
[0057] The privacy budget allocation for each time window refers to the privacy budget for a single time window that is temporarily set and used to calculate the cost of error. It is the initial variable for subsequent optimization, and the initial value can be set as the total effective privacy budget divided by the number of time windows.
[0058] The weighted expected error cost is a comprehensive indicator that measures the impact of data noise error on expert Q&A under the current budget allocation scheme. The smaller the value, the smaller the impact of the error. Specifically, the first step is to calculate the importance weight of expert Q&A in each time window by multiplying it by the square of (2 times the data sensitivity of the window divided by the amount of privacy budget to be allocated in the window). The second step is to add the above calculation results for all time windows. The final result is the weighted expected error cost.
[0059] The allocation constraints refer to the two conditions that the budget allocation must meet: first, the total actual privacy consumption does not exceed the total amount; and second, each window has a budget (to avoid a lack of privacy protection).
[0060] The Lagrange multiplier refers to the intermediate variable used to solve the optimization problem of minimizing error cost + total budget constraint, and is used to derive the optimal budget allocation. Specifically, the first step is to calculate the privacy loss multiplier of the window to the power of 2 / 3 square of the factor for each time window, and then multiply it by the power of 1 / 3 of the product of the importance weight of the expert knowledge questions and answers in the window and the square of the data sensitivity in the window. The second step is to sum the above calculation results for all time windows to obtain the summation result. The third step is to divide the summation result by the actual effective privacy budget to obtain the ratio. The fourth step is to use the cube of the ratio as the Lagrange multiplier.
[0061] The optimal privacy budget allocation for each time window refers to the final budget for a single time window obtained through optimization, taking into account both error costs and privacy risks. It can be directly used to add noise to the data in that window. Specifically, the steps are as follows: First, calculate the product of twice the importance weight of the expert knowledge questions and answers in that time window and the square of the data sensitivity in that time window; Second, calculate the product of the Lagrange multiplier and the privacy loss multiplier for that time window; Third, divide the result of the first step by the result of the second step to obtain the quotient; Fourth, use the third power of the quotient as the optimal privacy budget allocation for that time window.
[0062] In one embodiment of the present invention, the statistical results of the corresponding time window are noise-added according to the privacy budget of each time window, and output according to the security release rhythm for reference in the fault reasoning thought chain of the large language model, including: Obtain the release times, time window lengths, optimal privacy budget allocations, and data sensitivity of each time window within the selected time step and security release rhythm; determine the dataset for each time window, where the dataset for the i-th time window is the set of data in continuous monitoring data that falls within the range of the sum of the (i-1)-th release time and the time window length of the security release rhythm. Obtain a preset statistical function, execute the statistical function on the dataset for each time window, and obtain the un-noiseed statistical results for each time window; Calculate the noise scale for each time window, which is the data sensitivity of that time window divided by the optimal privacy budget allocation for that time window. Generate Laplace noise for each time window, which has zero mean and a scale equal to the noise scale of the corresponding time window; Calculate the noisy publication value for each time window. The noisy publication value for each time window is the unnoisy statistical result of that time window plus the Laplacian noise of the corresponding time window. Determine the output time for each time window, where the output time of the i-th time window is the (i-1)-th release time of the safe release rhythm; output the noise-added release value for each time window according to its output time.
[0063] The dataset for each time window refers to the set of original continuous monitoring data within the corresponding time window, which is the basis for calculating statistical results. Specifically, for the i-th time window, first find the (i-1)-th release time in the safety release rhythm; then calculate the termination time by adding the time window length to that time; finally, extract all data in the continuous monitoring data between the (i-1)-th release time and the termination time to form the dataset for that window.
[0064] The preset statistical functions refer to the pre-defined mathematical functions used to extract fault features from the window dataset, which need to be adapted to the ship's fault diagnosis requirements. Specifically, there are three commonly used statistical functions: first, the window data mean: summing all data values in the window dataset and dividing by the number of data points; second, the window data peak value: selecting the data with the largest value from the window dataset; and third, the window data variance: first calculating the window data mean, then calculating the square of the difference between each data point and the mean, summing them and dividing by the number of data points. The selection depends on the fault type, such as selecting the peak value for vibration faults and the mean value for power trends.
[0065] Unnoised statistical results refer to the original feature values of the window dataset after calculation by a statistical function without the addition of privacy protection noise, reflecting the true characteristics of the window data. Specifically, the dataset of each time window is substituted into a preset statistical function (such as mean or peak value), and the result obtained according to the calculation rules of the statistical function is the unnoised statistical result of that window.
[0066] The noise scale refers to the parameter used to generate Laplace noise, which determines the strength of the noise (the larger the scale, the stronger the noise, the better the privacy protection, but the lower the data utility); specifically, the noise scale for each time window is equal to the data sensitivity of that window divided by the optimal privacy budget allocation for that window.
[0067] Laplace noise refers to privacy-preserving noise added to unnoised statistical results. It conforms to the Laplace distribution and ensures that the data satisfies differential privacy. Specifically, a random number generation tool (such as the laplace function in the NumPy library) is used to generate a random number with a mean of zero and a scale parameter equal to the noise scale of the corresponding window. This random number is the Laplace noise of that window.
[0068] The noisy release value refers to the window feature value that can be released externally after adding privacy noise, for use by large language models for inference; specifically, the noisy release value of each time window is equal to the unnoisy statistical result of that window plus the Laplacian noise of that window.
[0069] The output time of each time window refers to the specific time point at which the noisy release value is output. It needs to be aligned with the safe release rhythm and adapted to the model inference sequence. Specifically, for the i-th time window, its output time is equal to the (i-1)-th release time in the safe release rhythm.
[0070] Outputting denoised release values at preset output times refers to the operation of transmitting denoised release values to the large language model at preset output times, ensuring that the model acquires inference data in a timely manner.
[0071] The embodiments of this example have been described above. However, this example is not limited to the specific implementation methods described above. The specific implementation methods described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms based on the guidance of this example, and all of them are within the protection scope of this example.
Claims
1. A warship fault expert knowledge management system based on a large language model, characterized in that, include: The data acquisition module acquires continuous monitoring data from the ship's fault correlation system, performs spectrum analysis and autocorrelation analysis on the continuous monitoring data, determines the main harmonic frequency, physical period and harmonic energy ratio, and generates periodic parameters containing the main harmonic frequency, physical period and harmonic energy ratio. The data processing module calculates the privacy loss multiplier for each time window based on the period parameter, the preset time window length, and the initial time step. Under the condition of meeting the preset data release throughput requirements, it selects the time step that minimizes the privacy loss multiplier and applies constraints to avoid being associated with the physical period as an integer multiple or near-integer multiple, thus obtaining a secure release rhythm. The privacy budget calculation module obtains the preset nominal privacy budget, combines the privacy loss multiplier with the nominal privacy budget, and determines the total effective privacy budget. The privacy budget allocation module allocates the privacy budget for each time window based on the importance weight of expert knowledge Q&A and the sensitivity of the data, within the limit of the actual effective total privacy budget. The noise-adding module adds noise to the statistical results of each time window according to the privacy budget of each time window, and outputs the results according to the security release rhythm for reference in the fault reasoning thinking chain of the large language model.
2. The large language model-based warship fault expert knowledge management system according to claim 1, characterized in that, Continuous monitoring data from the ship's fault correlation system is acquired. Spectrum analysis and autocorrelation analysis are performed on the continuous monitoring data to determine the dominant harmonic frequency, physical period, and harmonic energy percentage. Periodic parameters containing the dominant harmonic frequency, physical period, and harmonic energy percentage are generated, including: The values of continuous monitoring data at each discrete moment, the number of samples involved in the calculation, and the time sampling interval between adjacent discrete moments are obtained. The sampling frequency is determined based on the time sampling interval, where the sampling frequency is the reciprocal of the time sampling interval. Spectral analysis is performed on the continuous monitoring data to calculate an approximate power spectral density. This approximate power spectral density is calculated by taking the values of the continuous monitoring data at each discrete time, the time sampling interval, and the frequency variable to be evaluated. Specifically, it is calculated by adding the square of the sum of the products of the continuous monitoring data values at each discrete time and the cosine of the frequency variable, the corresponding discrete time number, and the time sampling interval, to the square of the sum of the products of the continuous monitoring data values at each discrete time and the sine of the frequency variable, the corresponding discrete time number, and the time sampling interval, and then dividing by the number of samples. The frequency variable to be evaluated ranges from zero to half the sampling frequency. Within this range, the frequency that maximizes the approximate power spectral density is selected as the main harmonic frequency. Autocorrelation analysis is performed on the continuous monitoring data to calculate the normalized autocorrelation function. This normalized autocorrelation function is calculated using the continuous monitoring data values at each discrete time, the sample mean of the continuous monitoring data, and the positive time delay variable. Specifically, the difference between the continuous monitoring data values at each discrete time and the sample mean is multiplied by the difference between the continuous monitoring data values at the corresponding time delay and the sample mean. All these products are then summed to obtain the numerator. Square the sum of the difference between the value of the continuous monitoring data at each discrete time and the sample mean as the denominator; the ratio of the numerator to the denominator is the normalized autocorrelation function; the value of the positive time delay variable is greater than zero and less than the product of the sample number and the time sampling interval; in the range greater than zero and less than the product of the sample number and the time sampling interval, the time delay that makes the normalized autocorrelation function maximum is selected as the physical period; Calculate the main harmonic energy, the main harmonic energy is the value of the power spectral density approximation at the main harmonic frequency; calculate the total energy, the total energy is the integral value of the power spectral density approximation in the range of zero to one half of the sampling frequency; calculate the harmonic energy ratio, the harmonic energy ratio is the ratio of the main harmonic energy to the total energy; The period parameter is composed of the main harmonic frequency, the physical period and the harmonic energy ratio. 3.The large language model-based warship fault expert knowledge management system according to claim 2, characterized in that, Based on the period parameter, the preset time window length and the initial time step, the privacy loss multiplication factor of each time window is calculated, including: Obtain the preset time window length and the preset initial time step; Calculate the window overlap number, the window overlap number is the integer part of the time window length divided by the initial time step; define the overlap weight, for each lag order starting from 1, the overlap weight is 1 minus the ratio of the lag order to the window overlap number.
4. The large language model-based warship fault expert knowledge management system according to claim 3, characterized in that, Based on the period parameter, the preset time window length and the initial time step, the privacy loss multiplication factor of each time window is calculated, further including: Estimate the correlation function, the correlation function estimate is the product of the square of the harmonic energy ratio and 2π times the time delay divided by the cosine value of the physical period, wherein the time delay is the product of the lag order and the initial time step; Calculate the privacy loss multiplication factor, the privacy loss multiplication factor is 1 plus 2 times the summation result from 1 to the window overlap number minus 1, the summation result is the sum of the product of the overlap weight corresponding to each lag order and the correlation function estimate corresponding to the lag order.
5. The large language model-based warship fault expert knowledge management system according to claim 4, characterized in that, Under the condition of meeting the preset data release throughput requirement, select the time step that makes the privacy loss multiplication factor minimum, and impose a constraint to avoid forming an integer multiple or a near integer multiple with the physical period, to obtain the safe release rhythm, including: For each candidate time step, calculate the corresponding privacy loss multiplication factor, the calculation process is: determine the window overlap number according to the time window length and the candidate time step, determine the overlap weight according to the lag order and the window overlap number, determine the correlation function estimate according to the harmonic energy ratio, the physical period, the lag order and the candidate time step, multiply the overlap weight corresponding to each lag order and the correlation function estimate corresponding to the lag order, then sum, multiply the summation result by 2 and add 1 to obtain the privacy loss multiplication factor corresponding to the candidate time step.
6. The large language model-based warship fault expert knowledge management system according to claim 5, characterized in that, Under the condition of meeting the preset data release throughput requirement, select the time step that makes the privacy loss multiplication factor minimum, and impose a constraint to avoid forming an integer multiple or a near integer multiple with the physical period, to obtain the safe release rhythm, further including: Set the throughput constraint condition, the candidate time step is not greater than the reciprocal of the minimum release frequency; The ratio of the candidate time step to the physical period is not less than the difference between the integer that is any molecule and the denominator of 1 to the upper limit of the rational denominator, and the near-integer avoidance tolerance; Among the candidate time steps that meet the throughput constraint condition and the near-integer avoidance constraint condition, the candidate time step with the minimum privacy loss multiplication factor is selected as the selected time step; The initial release time is taken as the starting point, and the time of the nth release is the initial release time plus the product of the selected time step and n, where n is a non-negative integer, thereby forming a safe release rhythm.
7. The large language model-based warship fault expert knowledge management system according to claim 6, characterized in that, The nominal privacy budget is obtained, the privacy loss multiplication factor is combined with the nominal privacy budget, and the actual effective privacy budget total is determined, including: The privacy loss multiplication factor, the selected time step, the time window length, the preset nominal privacy budget of each time window, and the preset release time period length for budget accounting are obtained. The number of time windows is calculated, which is the difference between the release time period length and the time window length, divided by the selected time step, and then taking the integer part, and then adding 1 to the integer part.
8. The large language model-based warship fault expert knowledge management system according to claim 7, characterized in that, The nominal privacy budget is obtained, the privacy loss multiplication factor is combined with the nominal privacy budget, and the actual effective privacy budget total is determined, including: The nominal privacy budget total is calculated, which is the sum of the nominal privacy budgets of all time windows; The actual effective privacy budget total is calculated, which is the product of the privacy loss multiplication factor of each time window and the nominal privacy budget of the corresponding time window, and then the sum of all multiplication results. 9.The large language model-based warship fault expert knowledge management system according to claim 8, wherein, Under the limitation of the actual effective privacy budget total, the privacy budget of each time window is allocated according to the importance weight of expert knowledge and the data sensitivity, including: The actual effective privacy budget total, the number of time windows, the privacy loss multiplication factor of each time window, and the preset importance weight of expert knowledge and data sensitivity of each time window are obtained, and the data sensitivity is the maximum change amplitude of the statistical result of the time window to a single record; The allocated privacy budget allocation of each time window is set, and the weighted expected error cost is calculated, which is: the importance weight of expert knowledge of each time window multiplied by the square of the ratio of twice the data sensitivity of the time window to the allocated privacy budget allocation, and the sum of the calculation results of all time windows is obtained. The allocation constraint condition is set, the sum of the product of the privacy loss multiplication factor of each time window and the allocated privacy budget of the corresponding time window does not exceed the total amount of the actual effective privacy budget, and the allocated privacy budget of each time window is greater than 0; the Lagrange multiplier is determined, specifically: the 2 / 3 power of the privacy loss multiplication factor of each time window is calculated, multiplied by the 1 / 3 power of the product of 2 times the importance weight of the expert knowledge and answer of the time window and the square of the data sensitivity of the time window, the sum of the calculation results of all time windows is summed, and the sum is divided by the total amount of the actual effective privacy budget, and finally the 3 power of the result is taken as the Lagrange multiplier; The optimal privacy budget allocation of each time window is calculated, specifically: the product of 2 times the importance weight of the expert knowledge and answer of the time window and the square of the data sensitivity of the time window is calculated, divided by the product of the Lagrange multiplier and the privacy loss multiplication factor of the time window, and the 1 / 3 power of the result is taken as the optimal privacy budget allocation of the time window.
10. The large language model-based warship fault expert knowledge management system according to claim 9, characterized in that, According to the privacy budget of each time window, the statistical results of the corresponding time window are processed by adding noise, and are output according to the safe release rhythm for large language model fault reasoning thought chain reference, including: The selected time step, the release time included in the safe release rhythm, the time window length, the optimal privacy budget allocation of each time window, and the data sensitivity of each time window are obtained; the data set of each time window is determined, and the data set of the i-th time window is the data set in the continuous monitoring data, the time is in the range of the i-1th release time to the sum of the i-1th release time and the time window length of the safe release rhythm; A preset statistical function is obtained, and the statistical function is executed on the data set of each time window to obtain the un-noised statistical result of each time window; The noise scale of each time window is calculated, and the noise scale of each time window is the data sensitivity of the time window divided by the optimal privacy budget allocation of the time window; The Laplace noise of each time window is generated, and the Laplace noise is zero mean and the scale is equal to the noise scale of the corresponding time window; The noise-added release value of each time window is calculated, and the noise-added release value of each time window is the un-noised statistical result of the time window plus the Laplace noise of the corresponding time window; The output time of each time window is determined, and the output time of the i-th time window is the i-1th release time of the safe release rhythm; the noise-added release value of the corresponding time window is output according to the output time of each time window.