Digital twin and domain generalization adaptive fault diagnosis method and system

By introducing thermally induced deformation and dynamic hydraulic models into CNC machine tools for parameter optimization, and combining multi-domain hybrid enhancement technology and listening control circuit, the problems of accuracy and real-time performance in fault diagnosis under dynamic working conditions are solved, and safe and efficient fault diagnosis is achieved.

CN123029876APending Publication Date: 2026-11-03NINGBO GOOGOL INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611461134.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-20
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

In the process of machining complex CNC machine tools, the accuracy of fault diagnosis under dynamic working conditions is affected by dynamic fluctuations. Furthermore, the real-time updating and deployment of digital twin models suffer from computational resource contention and diagnostic blind spots, leading to increased safety risks.

Method used

By combining the thermal deformation compensation correlation model and the dynamic hydraulic penalty correlation model, the radial stiffness and contact damping of the bearing are optimized to narrow the search space. The fault diagnosis model is retrained using multi-domain hybrid enhancement technology, and the model weights are non-intrusively thermally loaded by the listening control circuit to eliminate the blind zone of edge diagnosis.

Benefits of technology

It achieves high-precision fault diagnosis under dynamic working conditions, shortens the model parameter update time, reduces the sensitivity of the diagnostic network to a single working condition, eliminates diagnostic blind spots, and ensures the safety and continuous monitoring of the machine tool processing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123029876A_ABST
    Figure CN123029876A_ABST
Patent Text Reader

Abstract

The application discloses a digital twin and field generalization adaptive fault diagnosis method and system. The method comprises the following steps: collecting real-time monitoring data and working condition parameters of a precision machining equipment (S101); outputting twin prediction data based on a preset digital twin model to calculate a working condition change index and a mismatch degree (S102); triggering a hierarchical updating mechanism according to the joint determination result of the working condition change index and the mismatch degree (S103); optimizing key parameters of the digital twin model and generating simulation data (S104); combining the monitoring data and the simulation data for multi-domain hybrid enhancement to retrain a fault diagnosis model (S105); and issuing the updated fault diagnosis model to an execution end for real-time fault diagnosis (S106). The application can realize accurate diagnosis of the equipment under dynamic working conditions, narrow the optimization space and eliminate the diagnosis blind area when the edge controller is not loaded with heat.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of intelligent manufacturing equipment, machine tool control and digital control systems, and more specifically, to an adaptive fault diagnosis method and system based on digital twins and domain generalization. Background Technology

[0002] With the advancement of intelligent manufacturing equipment and industrial sensing technology, data-driven fault diagnosis technology has been widely applied in precision machining equipment. In complex CNC machine tool machining processes, dynamic fluctuations in operating parameters often lead to data distribution differences unseen during the training phase, affecting the accuracy of fault diagnosis. To adapt to unknown target domains, existing domain adaptation or generalization techniques typically fuse data from multiple source domains. However, under dynamic operating conditions, the characteristics exhibited by the same fault under different cutting loads or speeds are prone to overlap or distortion.

[0003] Furthermore, if digital twin models rely solely on black-box optimization at the algorithm level, the vast search space for model parameters and slow model update iteration speed fail to meet the real-time requirements of industrial field status perception and control. When updated parameters and network weights are deployed to the edge controller, the high-frequency acquisition of operational data at the edge often leads to model overload based on conventional microprocessor architecture, causing computational resource contention and halting the forward inference process. This diagnostic blind spot generated during the cutting process increases the safety risk of equipment collisions under dynamic operating conditions. Summary of the Invention

[0004] This embodiment provides an adaptive fault diagnosis method and system based on digital twins and domain generalization. It can reduce the parameter search space by utilizing hard constraints of physical boundaries and achieve seamless hot loading of model weights, eliminating diagnostic blind spots at the edge.

[0005] This application provides an adaptive fault diagnosis method based on digital twins and domain generalization, including: Collect real-time monitoring data and operating parameters of precision machining equipment; Based on a pre-set digital twin model, output twin prediction data, calculate the working condition change index, and calculate the mismatch between the twin prediction data and the real-time monitoring data; A graded update mechanism is triggered based on the joint determination result of the working condition change index and the mismatch degree; When a significant operating condition drift and severe mismatch are determined to occur, the key parameters of the digital twin model are optimized, and simulation data is generated based on the updated digital twin model. The real-time monitoring data and the simulation data are combined to perform multi-domain hybrid enhancement, and the enhanced data is used to retrain the fault diagnosis model; The updated fault diagnosis model is then sent to the execution end.

[0006] Specifically, the step of triggering a graded update mechanism based on the joint determination result of the working condition change index and the mismatch degree includes: The working condition change index is compared with a first threshold, and the mismatch degree is compared with a second threshold; When the working condition change index is less than the first threshold and the mismatch degree is less than the second threshold, the current parameter state of the fault diagnosis model is maintained; When the working condition change index is greater than or equal to the first threshold and the mismatch degree is greater than or equal to the second threshold, it is determined that a significant working condition drift and severe mismatch have been triggered, and temperature data is obtained from the distributed thermocouple array attached to the front end of the spindle of the precision machining equipment, and pressure data is obtained from the hydraulic transmitter attached to the drawbar cylinder circuit.

[0007] Specifically, the key parameters for optimizing the digital twin model include: A thermal deformation compensation correlation model is established between the temperature data and the bearing radial stiffness contained in the digital twin model. A dynamic hydraulic penalty correlation model is established by combining the pressure data with the contact damping contained in the digital twin model. The parameter optimization constraint model is jointly constructed using the thermally induced deformation compensation correlation model and the dynamic hydraulic penalty correlation model. Based on the real-time monitoring data, the actual frequency domain response signal is extracted, and based on the digital twin model, the twin frequency domain prediction signal is extracted. An error vector is constructed based on the spectral difference and spectral geometric distance characteristics between the actual frequency domain response signal and the twin frequency domain prediction signal; Under the boundary constraints of the parameter optimization constraint model, a hybrid optimization algorithm of particle swarm optimization and gradient descent is adopted to synchronously iteratively update the radial stiffness and contact damping of the bearing based on the error vector.

[0008] Specifically, the step of combining the real-time monitoring data and the simulation data for multi-domain hybrid enhancement, and then retraining the fault diagnosis model using the enhanced data, includes: Source domain features are extracted based on the real-time monitoring data, and target domain features are extracted based on the simulation data; Extract the mixed weight coefficients according to the preset distribution sampling rules; The source domain features and the target domain features are weighted and interpolated using the hybrid weight coefficients to generate multi-domain hybrid features and corresponding hybrid labels. The multi-domain hybrid features are input into the fault diagnosis model for iterative forward propagation training.

[0009] Specifically, the step of extracting the mixed weight coefficients according to the preset distribution sampling rules includes calling a preset Dirichlet distribution sampling function to generate the mixed weight coefficients; The retraining of the fault diagnosis model using the enhanced data includes: A domain adversarial loss function is introduced into the feature extraction network layer of the fault diagnosis model to calculate the distribution difference metric between the source domain features and the target domain features. A classification prediction loss function is introduced into the classification output layer of the fault diagnosis model; A contrast regularization loss function is introduced into the feature extraction network layer to increase the inter-class distance of features and reduce the intra-class distance of features, generating a metric penalty term; The weight parameters of the fault diagnosis model are updated by combining the distribution difference metric, the classification error generated by the classification prediction loss function, and the metric penalty term, and then using the backpropagation algorithm.

[0010] This application also provides an adaptive fault diagnosis system based on digital twins and domain generalization, comprising: A sensor group is installed on a precision machining equipment. The sensor group includes a distributed thermocouple array installed at the front end of the spindle and a hydraulic transmitter installed in the drawbar cylinder circuit to collect real-time monitoring data and operating parameters. The first processor is communicatively connected to the sensor group and is configured to receive the real-time monitoring data and the operating condition parameters, calculate the working condition change index and mismatch degree, optimize the key parameters of the digital twin model, and retrain the fault diagnosis model to generate an updated weight matrix. The second processor is communicatively connected to the sensor group and the first processor, and is configured to receive the real-time monitoring data and the weight matrix, perform forward inference calculations of the fault diagnosis model, and output diagnostic instructions.

[0011] Specifically, the first processor adopts a reduced instruction set computing processor architecture; The second processor adopts a field-programmable gate array architecture, and the second processor is internally divided into an independent first memory area and a second memory area; The first storage area is configured to load the currently active fault diagnosis model and perform the forward inference calculation; The second storage area is configured as a shadow buffer update area; After the first processor calculates and generates the weight matrix in the background, it writes the weight matrix into the second storage area in the second processor and sends a verification pass and a suspension wait signal to the second processor.

[0012] Specifically, the system also includes: The listening control circuit is electrically connected to the CNC control bus of the precision machining equipment and the chip select pin of the second processor, respectively. The listening control circuit is configured to parse the machining program instructions on the CNC control bus in real time. When the monitoring and control circuit detects a spindle stop command or a tool change command, it generates a trigger level signal. The listening control circuit uses the trigger level signal to pull down the chip select pin of the second processor, forcing the network inference read pointer of the second processor to switch from the first memory area to the second memory area, so that the weight matrix in the second memory area takes effect immediately.

[0013] This application also provides a computing device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the aforementioned adaptive fault diagnosis method of digital twin and domain generalization.

[0014] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned adaptive fault diagnosis method based on digital twins and domain generalization.

[0015] The technical solution of this application embodiment has the following technical effects: By applying physical boundary constraints to the optimization of bearing radial stiffness and contact damping through the thermal deformation compensation correlation model and the dynamic hydraulic penalty correlation model, the parameter search space is reduced and invalid solutions that violate the normality of material softening under heat are eliminated, compressing the parameter update iteration time of the digital twin model to the second level, meeting the real-time requirements of state perception and control in industrial sites; by performing weighted interpolation of source domain features and target domain features through multi-domain hybrid enhancement, and combining the domain adversarial loss function, classification prediction loss function and contrast regularization loss function... The loss function is used to retrain the fault diagnosis model, reducing the sensitivity of the diagnostic network to a single working condition and filling the feature gaps under unknown cutting conditions. This improves the cross-domain generalization ability and diagnostic accuracy of the fault diagnosis model under dynamic conditions. By using a dual-zone ping-pong buffer in the first and second storage areas in conjunction with a listening control circuit, the model weights are non-intrusively hot-loaded within the safe idle time interval when the machine tool spindle stops or changes tools. This eliminates the diagnostic blind spot at the moment of weight deployment at the edge, ensuring continuous monitoring safety throughout the entire cutting process and avoiding the risk of machine collision caused by model overload under dynamic conditions. Attached Figure Description

[0016] Figure 1 This is a flowchart of the adaptive fault diagnosis method provided in the embodiments of this application.

[0017] Figure 2 This is a closed-loop adaptive logic flowchart provided in the embodiments of this application.

[0018] Figure 3 This is a flowchart of the dynamic parameter update logic provided in the embodiments of this application.

[0019] Figure 4 This is a flowchart of the network model training method provided in the embodiments of this application. Detailed Implementation

[0020] To make the objectives and technical solutions of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.

[0021] In one embodiment of this application, an adaptive fault diagnosis method based on digital twins and domain generalization is provided. This method enables model self-correction and rapid deployment after detecting operational condition drift, balancing high-precision online diagnostic calculations with dynamic evolution. Figure 1 As shown, the method includes the following specific execution steps: Step S101: Collect real-time monitoring data and operating parameters of the precision machining equipment. Specifically, multi-source operating data is continuously collected at fixed intervals by sensing units installed on the target precision machining equipment. The collected data includes: high-frequency vibration signals of the spindle system, bearing temperature at the front end of the spindle, and current signals of the spindle drive motor. To ensure sufficiently detailed sampling resolution and capture transient high-frequency vibration characteristics caused by minor damage or loosening, the data acquisition frequency is constrained to 1kHz. After acquiring the raw data sequence, wavelet transform and Kalman filtering algorithms are used to assimilate and denoise the mixed data, eliminating the masking interference of workshop environmental noise on weak signals. The clean signal obtained after processing is written into the system's shared knowledge base in real time, and the spindle speed, feed rate, and depth of cut issued by the current CNC program are recorded as corresponding operating parameter labels.

[0022] Step S102: Based on a pre-set digital twin model, output twin prediction data, calculate the working condition change index, and the mismatch between the twin prediction data and the real-time monitoring data. In the analysis phase of the first processor, a distance metric logic is constructed to address the working condition drift phenomenon. By extracting historical benchmark parameter vectors from the shared knowledge base, a Mahalanobis distance space operation is performed between the currently acquired working condition parameter vector and the benchmark vector, outputting the working condition change index. The calculation logic for this index is as follows: .

[0023] Wherein, WCC represents the working condition variation index, used to describe the nonlinear shift of external physical parameters caused by mechanical operation, and is used as a trigger threshold for comparison and judgment in the first processor; WC t This represents a vector of operating parameters recorded by the system at the current moment, such as the spindle speed; WC t-1 Σ represents the vector of operating parameters at the previous sampling time or under historical calibration benchmarks; Σ represents the covariance matrix derived from the system's historical normal processing data; Σ -1 This represents the inverse of the covariance matrix. Its inclusion in the calculation model is based on the physical principle of automatically eliminating absolute value interference caused by differences in physical dimensions between the spindle speed and feed rate, ensuring that the calculation results accurately reflect fluctuations in the working conditions. For milling thin-walled aluminum alloy parts, the typical range of spindle speed parameters can be configured between 3000 and 8000 revolutions per minute.

[0024] In addition to extracting external condition offsets, the system also calculates the relative deviation (i.e., mismatch) between the model's predicted spectrum in virtual space and the equipment's actual response spectrum in physical space based on the state of the internal drive feedback signal of the digital twin model. Here, the system extracts the vertical vibration spectrum of the spindle drive end output by the digital twin model as a key response evaluation quantity, and uses the Kullback-Leibler divergence to measure the probability distribution difference between the digital twin's predicted spectrum and the actual measured spectrum. This allows the system to calculate whether the lower bound of the current virtual mapping model's coverage of physical mechanical properties has been broken.

[0025] Step S103: Based on the joint determination result of the working condition change index and the mismatch degree, a graded update is triggered. Combined with... Figure 2 The logical flow involves the system reading two key computational metrics generated from the preceding steps and executing parallel decision tree logic. Specifically, Figure 2The closed-loop adaptive logic flow shown includes a monitoring and preprocessing module, an analysis module for calculating the working condition change index and mismatch degree, a classification judgment module, and three parallel branches for updating the digital twin model, generating training data, and retraining the fault diagnosis network. The outputs of the three parallel branches are sent to the edge for execution by the deployment module and written into the knowledge base module. The knowledge base module then feeds back the updated data to the monitoring and preprocessing module and the analysis module, forming a closed loop. In the connection relationship indicated by the arrows, the output of the monitoring and preprocessing module is connected to the input of the analysis module, the output of the analysis module is connected to the input of the hierarchical judgment module, and the three judgment branches of the hierarchical judgment module are respectively connected to the inputs of the updated digital twin model, the generated training data, and the retraining fault diagnosis network. Specifically, when the operating condition change index is less than a first threshold and the mismatch degree is greater than or equal to a second threshold, the hierarchical judgment module connects to the updated digital twin model via the corresponding judgment branch; when the operating condition change index is greater than or equal to the first threshold and the mismatch degree is less than the second threshold, the hierarchical judgment module connects to the generated training data via the corresponding judgment branch; and when the operating condition change index is greater than or equal to the first threshold and the mismatch degree is greater than or equal to the second threshold, the hierarchical judgment module connects to the retraining fault diagnosis network via the corresponding judgment branch. The diagnostic network's outputs from the three parallel branches converge at the input of the deployment module. The negative decision branch of the hierarchical decision module is directly connected to the input of the deployment module, allowing the current fault diagnosis model to be deployed to the edge for execution without passing through the three parallel branches. This saves computational overhead for updating the digital twin model and retraining the fault diagnosis network when the operating conditions do not meet the update requirements. The output of the deployment module is connected to the input of the knowledge base module. The knowledge base module has two feedback loops connected to the inputs of the monitoring and preprocessing module and the analysis module, respectively. These loops return updated data to the monitoring and preprocessing module and the analysis module, enabling the monitoring and preprocessing module to re-execute data acquisition and preprocessing, and the analysis module to re-execute the calculation of the operating condition change index and mismatch degree, thereby maintaining the continuous operation of the closed-loop adaptive update process. Specifically, the operating condition change index is compared with a first threshold, and the mismatch degree is compared with a second threshold. In actual production scenarios, the first threshold is defined as the Euclidean distance limit characterizing normal load fluctuations, and the second threshold is defined as the critical prediction error metric that triggers an alarm.

[0026] When the working condition change index is less than the first threshold and the mismatch degree is less than the second threshold, it indicates that the current cutting state disturbance is still within the generalization tolerance range of the fault diagnosis model. At this time, the network model does not make any adjustments, maintains the current parameter state of the fault diagnosis model, and continues to perform subsequent forward inference.

[0027] When the working condition change index is greater than or equal to the first threshold and the mismatch is greater than or equal to the second threshold, it is determined that the current cutting process has triggered significant working condition drift and the digital twin model has suffered severe mismatch. Under this condition, the original network model and its underlying digital twin base have lost their guiding significance. In this case, the control logic drives the external data communication bus to activate specific sensing channels to obtain gradient temperature data along the spindle axis from a distributed thermocouple array attached to the front end of the precision machining equipment, and pressure pulsation data from a diaphragm hydraulic transmitter attached to the broach cylinder circuit. Mathematical optimization is then restricted back to the physical realm, providing a physical hardware benchmark for the next constraint step. It should be noted that if the determination result is that the working condition change index exceeds the threshold but the mismatch is only slightly different, to balance the computational overhead at the edge, the system is configured to allow skipping the digital twin model reconstruction step and directly executing the subsequent data generation action for enhanced features.

[0028] Step S104: When a significant operational condition drift and severe mismatch are determined to have occurred, the key parameters of the digital twin model are optimized, and simulation data is generated based on the updated digital twin model. The optimization logic is as follows: Figure 3 As shown. Specifically, Figure 3 The dynamic parameter update logic shown includes: first, executing the step of calculating the error vector E, constructing the error vector based on the actual machine frequency domain response signal and the twin frequency domain prediction signal; then executing the parameter sensitivity analysis step, determining the key parameters to be updated under the boundary constraints of the parameter optimization constraint model; subsequently executing the objective function construction step, establishing a minimization objective function with the error vector as the variable; then executing the hybrid algorithm optimization step, using a hybrid optimization algorithm of particle swarm optimization and gradient descent to iteratively update the key parameters; finally executing the convergence check step, if the convergence condition is not met, returning to the parameter sensitivity analysis step to continue iteration, and if the convergence condition is met, sequentially executing the twin model parameter update step and the simulation sample generation step. In the digital twin model update, if only the conventional unconstrained mathematical descent algorithm is used, the excessive contact freedom of the mechanical structure will cause long solution space oscillations. Therefore, this embodiment introduces a dual-dimensional physical field constraint on the sensitive parameters of the spindle bearing system.

[0029] A thermally induced deformation compensation correlation model is established by combining the temperature data collected in step S103 with the bearing radial stiffness included in the digital twin model. Specifically, the thermally induced deformation compensation correlation model is calculated as follows: .

[0030] Among them, K radialThe formula represents the real-time radial stiffness of the bearing after the introduction of a thermal compensation mechanism; K0 represents the initial static stiffness value of the bearing under normal temperature calibration conditions; ∇T(x) represents the temperature gradient vector distributed along the axial direction of the main shaft, collected by a distributed thermocouple array; t0 and t represent the start and end times of temperature integration monitoring, respectively; β represents the thermodynamic expansion attenuation factor pre-determined based on experiments on the bearing ring and ball materials. In this embodiment, for a specific high-speed angular contact ball bearing, the attenuation factor β can be configured as a constant between 0.005 and 0.02. The physical basis for introducing this formula is that the algorithm for forcibly constraining the non-uniform temperature field measured in practice reduces the upper bound of the stiffness value search and eliminates invalid solutions that violate the principle of material softening under heat.

[0031] Furthermore, a dynamic hydraulic penalty correlation model is established by combining the pressure data with the contact damping included in the digital twin model. Specifically, the dynamic hydraulic penalty correlation model is calculated as follows: .

[0032] Among them, C contact The following parameters represent the contact damping of the spindle and tool holder under high-speed centrifugal force: C0 represents the initial contact damping value when the spindle and tool holder are under nominal hydraulic preload; ΔP represents the real-time pressure pulsation value of the drawbar cylinder captured by the diaphragm hydraulic transmitter, which represents the instantaneous decay of the elastic potential energy of the internal disc spring; γ represents the fluid-structure interaction conversion coefficient that maps fluid pressure to solid-state mechanical damping coefficient. In this embodiment, the conversion coefficient γ can be exemplarily taken as 0.15 to 0.35, depending on the specific cutting fluid viscosity and cylinder diameter. In the dynamic hydraulic penalty correlation model, a hard constraint is applied to the damping by real-time tension decay monitoring, narrowing the parameter search range in the optimization process.

[0033] Furthermore, a parameter optimization constraint model is constructed by jointly using the thermal deformation compensation correlation model and the dynamic hydraulic penalty correlation model. Based on the real-time monitoring data, the actual machine frequency domain response signal is extracted, and based on the digital twin model, the twin frequency domain prediction signal is extracted in the virtual space. Subsequently, Fourier transform operations are performed on the two signals respectively to extract their amplitude spectrum and phase spectrum features. The Euclidean distance between the amplitude spectrum features is calculated as the spectral difference, and the cosine similarity of the phase spectrum features in the complex plane is calculated and converted into a spectral geometric distance feature representing the phase alignment. Finally, the spectral difference and spectral geometric distance features are linearly concatenated to generate a multidimensional error vector. Specifically, the error vector feature concatenation is calculated as follows: .

[0034] Where E represents the multidimensional error vector formed by splicing; P DTP represents the twin frequency domain prediction signal extracted from the digital twin model. R The frequency domain response signal extracted from equipment operation data represents the actual machine frequency response signal; ρ represents the operator for calculating the difference in Kullback-Leibler divergence between two distributions; D g This represents the spectral geometric distance characteristics calculated above; α and β represent the weighting coefficients used to balance the proportions of amplitude and phase differences, respectively. In specific implementations, α is preferably configured as 0.6, and β is preferably configured as 0.4. It should be noted that β here represents the weighting coefficient used to balance the proportions of amplitude and phase differences, which has a different meaning from the thermodynamic expansion attenuation factor in the aforementioned thermal deformation compensation correlation model. The basis for constructing this error vector is that time-domain waveform comparison alone is easily masked by the initial phase of processing, while the dual constraints of amplitude and phase in the frequency domain can accurately map the resonant frequency drift of the mechanical structure.

[0035] Furthermore, under the boundary constraints of the parameter optimization constraint model, a hybrid optimization algorithm combining particle swarm optimization and gradient descent is employed to synchronously iteratively update the bearing radial stiffness and contact damping based on the error vector. The system performs the construction operation of the minimization objective function. During the process of constructing the minimization objective function with E as the variable: .

[0036] Where θ represents the set of model parameters to be solved; x represents the input environmental state constraints. Under the boundary constraints of the parameter optimization constraint model, a hybrid optimization algorithm of particle swarm optimization and gradient descent is adopted. In the global search phase, the particle swarm optimization algorithm is used to perform 20 generations of population iteration, with the population size limited to 50 to avoid getting trapped in local minima. After large-scale convergence, the gradient descent phase is switched to perform local precise convergence, with the local optimization learning rate parameter set to 0.01. Finally, the radial stiffness and contact damping of the bearing are synchronously iteratively updated according to the above error vector. When the objective function meets the threshold requirement, the loop is exited, and the iterative output value is solidified into the model. Based on this parameter state, a large number of multi-source simulation data segments are reconstructed in the background. Through this mechanism, the parameter update iteration time of the digital twin model is compressed to the second range.

[0037] Step S105: Combine the monitoring data and the simulation data to perform multi-domain hybrid enhancement, and retrain the fault diagnosis model using the enhanced data. Extract source domain features based on the real-time monitoring data, and extract target domain features based on the simulation data. Extract hybrid weight coefficients according to a preset distribution sampling rule. Use the hybrid weight coefficients to perform weighted interpolation calculations on the source domain features and the target domain features to generate multi-domain hybrid features and corresponding hybrid labels. Figure 4 As shown, this step reduces the diagnostic network's sensitivity to single operating conditions. Specifically, Figure 4 The training logic of the network model shown includes: extracting source domain features based on real-time monitoring data, extracting target domain features based on simulation data, and generating mixed weight coefficients by calling the Dirichlet distribution sampling function; performing weighted interpolation calculation on the source domain features and target domain features using the mixed weight coefficients to generate multi-domain mixed features; performing bidirectional mixed interpolation operation on labels to generate mixed labels; inputting the multi-domain mixed features into the feature extraction network layer of the fault diagnosis model; calculating the contrast regularization loss function, domain adversarial loss function, and classification prediction cross-entropy loss respectively, and jointly aggregating them into a triple loss, updating the weight parameters of the fault diagnosis model through backpropagation. Historical monitoring source domain features and simulation-generated target domain features are extracted separately. The system does not use fixed scaling factors, but instead calls a preset Dirichlet distribution sampling function to extract a set of mixed weight coefficients that are guaranteed to be non-negative and sum to 1. Using the computing unit pre-installed in the first processor, weighted interpolation calculation is performed on the mixed weight coefficients, source domain features, and target domain features. Specifically, the feature enhancement logic of the feature weighted interpolation enhancement operation is as follows: .

[0038] The system performs bidirectional hybrid interpolation operations on the tags. The tag enhancement logic includes bidirectional interpolation of category and domain. ; .

[0039] Where, x mix This represents the multi-domain hybrid feature matrix generated through interpolation and fusion; x k d represents the original time-frequency feature vector extracted from the k-th source operating condition domain; mix This represents the soft label result of the fused hybrid domain; d k This indicates the independent source domain label to which this operating condition belongs; y mix This represents the fused hybrid fault category label result; y k Represents a discrete fault determination one-hot code tag; μ k represents the interpolation weight coefficients generated through the Dirichlet distribution; K represents the total number of source domains simultaneously participating in interpolation aliasing. By simultaneously implementing convex combination mixing in the dimensions of features, domain identification, and fault determination, mathematical interpolation is used to fill the feature gaps between unknown cutting speeds and known test conditions.

[0040] The synthesized multi-domain hybrid features are input into the feature extraction network layer of the fault diagnosis model. This network layer mainly consists of five multi-scale deep convolutional layers and three cascaded fully connected layers. To ensure the feature extractor remains stable under different operating conditions, a triple hybrid loss function is constructed to implement inverse constraints.

[0041] A contrast-based regularization loss function is introduced into the feature extraction network layer to increase the inter-class distance of features and decrease the intra-class distance of features, generating a penalty term. Its calculation logic is as follows: ; .

[0042] Among them, L intra L represents the intra-class compactness loss value of feature samples of the same class in the latent space; inter G(x) represents the heterogeneous separability loss value between feature clusters of different categories; G(x) represents the nonlinear vector output by the convolutional network layer in the feature map space; c represents the specific fault type number that the current computation focuses on; m represents a manually set threshold constant to maintain the class safety margin; μ c1 With μ c2 Let c1 and c2 represent the geometric centroid vectors of clusters c1 and c2, respectively. The physical constraint of this metric penalty term is that it requires that the same type of damage features be tightly compressed together in the geometric manifold space, regardless of whether the operating conditions are low or high, to avoid being erroneously dispersed due to changes in operating conditions.

[0043] A domain adversarial loss function is introduced into the feature extraction network layer of the fault diagnosis model to calculate a measure of the distribution difference between the source domain features and the target domain features. Specifically, the calculation is performed as follows: .

[0044] Among them, L adv denoted by , D() represents the distribution difference measure output through adversarial game logic; D() represents the fully connected multi-domain discriminator operator with additional access; and E represents the mathematical expectation. It should be noted that the E here represents the mathematical expectation, which differs from the meaning of the multidimensional error vector E in the aforementioned error vector calculation formula. The function of this loss function is to confuse the discriminator, thus removing information about rotational speed and load from the low-level features extracted by the network.

[0045] A classification prediction loss function is introduced into the classification output layer of the fault diagnosis model. The distribution difference metric, the classification error generated by the classification prediction loss function, and the penalty term are jointly aggregated, and the weight parameters of the fault diagnosis model are updated using a backpropagation algorithm. Specifically, the calculation is performed as follows: .

[0046] Among them, L total L represents the overall triple optimization objective value guiding the gradient descent of network weights; clsThis represents the cross-entropy loss for conventional classification prediction. During the backpropagation phase, the batch size is forcibly set to 128, and the number of training epochs is limited to 200. The learning rate parameter is initially set to 0.001 and automatically decays by half after every 50 epochs. This retraining mechanism achieves robust diagnostic support across physical environment fluctuations while ensuring fault discrimination accuracy.

[0047] Step S106 involves sending the updated fault diagnosis model to the execution end for real-time fault diagnosis. After generating diagnostic model weights with high domain generalization capabilities, these weights are packaged and transmitted via a low-latency communication protocol to a hardware carrier deployed on the machine tool. This method achieves the integration of model evolution with closed-loop feedback of edge control commands.

[0048] In another embodiment of this application, to meet the online deployment requirements of the aforementioned adaptive fault diagnosis method under extremely dynamic operating conditions and to avoid the instantaneous interruption of real-time data monitoring during weight deployment, a digital twin and domain-generalized adaptive fault diagnosis system is provided. This system not only provides a conventional data acquisition environment but also controls the reload timing of the algorithm at the hardware bus level.

[0049] The system comprises a sensor array, a first processor, and a second processor. The sensor array is positioned at key stress points of the precision machining equipment. In addition to deploying wideband vibration pickups, it includes the aforementioned temperature and pressure sensing matrix, namely a distributed thermocouple array positioned on the outer wall of the spindle front labyrinth ring and the front bearing housing, and a thin-film hydraulic transmitter connected in series in the drawbar cylinder circuit. A matching A / D high-frequency sampling conversion circuit module enables data acquisition at a reference frequency up to 25.6kHz and the transmission of data to subsequent computing components. It should be noted that 25.6kHz is the sampling reference frequency for high-frequency vibration signals, while the aforementioned 1kHz is the continuous acquisition frequency for regular operating data; both are set according to the frequency band of the acquired signals. The aforementioned sensing devices provide basic operating parameters and real-time monitoring data for the establishment of the physical constraint model.

[0050] The first processor maintains a high-speed communication connection with the aforementioned sensor group and performs calculations using a high-frequency reduced instruction set. As the computing center, the first processor is configured to carry and receive real-time monitoring data sequences in the background, perform the aforementioned calculation of the operating condition change index and model state mismatch discrimination, and subsequently, schedule matrix computing power in an isolated operating system thread to perform hybrid parameter optimization and retraining of the deep generalized network on the digital twin model. After undergoing the aforementioned hybrid algorithm and stochastic gradient convergence iterations, the processor generates an updated overall network weight matrix data packet.

[0051] The second processor communicates with the sensor group and the first processor via a bus. The architecture of the second processor is a field-programmable gate array architecture compiled based on a gate-level hardware description language. Its function is to read the high-frequency vibration sensing stream, perform forward network matrix multiplication and addition inference, and convert the diagnostic judgment results into control commands within a millisecond delay.

[0052] Furthermore, to address the data frame corruption and security blind spots caused by the instantaneous weight matrix handover, the system employs memory block planning on the second processor, dividing it into two independently operating and physically bus-isolated storage areas: a first storage area and a second storage area. The first storage area is permanently locked by a hardware pointer and configured to load currently activated older version fault diagnosis model network node data, continuously executing forward inference using parallel multiply-accumulators. The second storage area is permanently configured as a shadow buffer update area in a dormant receiving state.

[0053] After the first processor completes the generation of the new weight matrix in its background thread, it writes the matrix stream asynchronously and with low priority to the second memory area within the second processor via an internal communication protocol. Since the write operation falls within a separate shadow buffer update area, this update behavior does not preempt the clock cycles for cache reads and writes in the first memory area, ensuring the continuous operation of the old model. After the data is written to disk, the first processor performs cyclic redundancy check. Upon confirming that the write is error-free, it does not actively switch the memory pointer but sends a check pass and suspend / wait control level signal to the arbitrator inside the second processor.

[0054] If a simple change in the memory read address occurs at the moment when the tool is cutting material at a high feed rate, even a slight read / write pause can trigger an alarm. Therefore, this embodiment further includes an independent monitoring and control circuit. The input pins of this circuit module are connected in parallel to the CNC control bus below the machine tool body using optocouplers, and its output is electrically connected to the chip select pin of the second processor at a low level.

[0055] The main structure of the monitoring control circuit includes an instruction matching register and edge triggers. During the system initialization and configuration phase, the instruction matching register is pre-programmed with two instruction set codes representing the absolute safety clearance of the machine tool: the first binary code corresponding to the machine tool spindle stop action command, and the second binary code corresponding to the automatic tool change action command.

[0056] During the full-speed operation of the machining program, the monitoring control circuit continuously performs high-frequency extraction on the plaintext machining program instructions flowing through the CNC control bus, and sends the intercepted instruction words and the aforementioned solidified first binary code and second binary code into a hardware comparator to perform a very low-latency bitwise XOR comparison. As long as the comparison results are inconsistent, the edge end will not take any switching action.

[0057] Once the machine tool enters the tool retraction and tool change phase according to the cutting process, the monitoring control circuit captures the spindle stop command or tool change command issued on the CNC bus, and the comparison result becomes consistent. At this time, the command matching register is in the conducting state, outputting a high-frequency enable signal to the subsequent edge trigger. After receiving the enable signal, the edge trigger undergoes a level toggle, generating a trigger level signal. This trigger level signal is routed through the base plate to the chip select pin of the second processor and pulled low.

[0058] During the timing of the pin level drop, a low-level hardware hardwired switch is triggered, switching the network inference read pointer of the multiply-accumulator array from the original first memory area to the second memory area filled with new data. After the switch is completed, the original first memory area is marked as discarded and converted into the shadow buffer update area for the next round.

[0059] By employing the aforementioned non-sensory hot-loading method that utilizes strong coupling between machining idle code and edge hardware dual-zone ping-pong cache, it is ensured that diagnostic weights, when replaced by new ones at edge nodes, fall within the safe waiting period when the machine tool is no longer in contact with cutting. This method eliminates the diagnostic blind spots caused by memory switching in a pure software environment within a complex operating system, ensuring continuous monitoring safety throughout the entire cutting process. It should be noted that the specific architectural combinations of reduced instruction set computing (RISC) and gate arrays described above are merely examples. Those skilled in the art can also achieve the optimization objectives for security deployment of this application by using heterogeneous coprocessing modules with equivalent physical resource isolation capabilities.

[0060] In another embodiment of this application, a computing device is provided. This computing device is typically deployed in a control cabinet in an industrial workshop or within a centralized cloud analysis server. The computing device includes a memory and a processor connected via a system bus. The memory is configured with a non-volatile storage medium for persistently storing and embedding relevant operating system images and data acquisition and analysis subroutines. The processor is configured to retrieve and execute a corresponding computer program from the memory after receiving system power and completing the boot process. When the computer program is read and executed within the arithmetic logic unit, it enables the processor to automatically call its interface to acquire physical operating data fed from external sensors, strictly replicating all calculation and logical judgment processes within the digital twin and domain-generalized adaptive fault diagnosis methods disclosed in the foregoing embodiments, and realizing state estimation, generalized interpolation, and error closed-loop optimization.

[0061] In another embodiment of this application, a computer-readable storage medium is provided. This storage medium is a non-transient physical medium carrier with long-term information storage capabilities, such as flash memory chips, disk arrays, or optical discs. Computer program code instructions are burned into and stored within it. When this program code instruction is accessed, read, compiled, and executed by the processor of an external device, it can utilize the basic computing power interface of the operating platform to rigorously reproduce all the timing actions and data state change mechanisms of the aforementioned digital twin and domain-generalized adaptive fault diagnosis methods.

[0062] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. An adaptive fault diagnosis method based on digital twins and domain generalization, characterized in that, include: Collect real-time monitoring data and operating parameters of precision machining equipment; Based on a pre-set digital twin model, output twin prediction data, calculate the working condition change index, and calculate the mismatch between the twin prediction data and the real-time monitoring data; A graded update mechanism is triggered based on the joint determination result of the working condition change index and the mismatch degree; When a significant operating condition drift and severe mismatch are determined to occur, the key parameters of the digital twin model are optimized, and simulation data is generated based on the updated digital twin model. The real-time monitoring data and the simulation data are combined to perform multi-domain hybrid enhancement, and the enhanced data is used to retrain the fault diagnosis model; The updated fault diagnosis model is then sent to the execution end.

2. The method as described in claim 1, characterized in that, The step of triggering a graded update mechanism based on the joint determination result of the working condition change index and the mismatch degree includes: comparing the working condition change index with a first threshold and comparing the mismatch degree with a second threshold; When the working condition change index is less than the first threshold and the mismatch degree is less than the second threshold, the current parameter state of the fault diagnosis model is maintained; When the working condition change index is greater than or equal to the first threshold and the mismatch degree is greater than or equal to the second threshold, it is determined that a significant working condition drift and severe mismatch have been triggered, and temperature data is obtained from the distributed thermocouple array attached to the front end of the spindle of the precision machining equipment, and pressure data is obtained from the hydraulic transmitter attached to the drawbar cylinder circuit.

3. The method as described in claim 2, characterized in that, The key parameters for optimizing the digital twin model include: establishing a thermally induced deformation compensation correlation model between the temperature data and the bearing radial stiffness included in the digital twin model; A dynamic hydraulic penalty correlation model is established by combining the pressure data with the contact damping contained in the digital twin model. The parameter optimization constraint model is jointly constructed using the thermally induced deformation compensation correlation model and the dynamic hydraulic penalty correlation model; The actual frequency domain response signal is extracted based on the real-time monitoring data, and the twin frequency domain prediction signal is extracted based on the digital twin model. An error vector is constructed based on the spectral difference and spectral geometric distance characteristics between the actual frequency domain response signal and the twin frequency domain prediction signal; Under the boundary constraints of the parameter optimization constraint model, a hybrid optimization algorithm of particle swarm optimization and gradient descent is adopted to synchronously iteratively update the radial stiffness and contact damping of the bearing based on the error vector.

4. The method as described in claim 1, characterized in that, The step of combining the real-time monitoring data and the simulation data for multi-domain hybrid enhancement, and retraining the fault diagnosis model using the enhanced data, includes: extracting source domain features based on the real-time monitoring data, and extracting target domain features based on the simulation data. Extract the mixed weight coefficients according to the preset distribution sampling rules; The source domain features and the target domain features are weighted and interpolated using the hybrid weight coefficients to generate multi-domain hybrid features and corresponding hybrid labels. The multi-domain hybrid features are input into the fault diagnosis model for iterative forward propagation training.

5. The method as described in claim 4, characterized in that, The step of extracting the mixed weight coefficients according to the preset distribution sampling rules includes calling the preset Dirichlet distribution sampling function to generate the mixed weight coefficients; The step of retraining the fault diagnosis model using the enhanced data includes: introducing a domain adversarial loss function into the feature extraction network layer of the fault diagnosis model, and calculating a distribution difference metric between the source domain features and the target domain features; A classification prediction loss function is introduced into the classification output layer of the fault diagnosis model; A contrast regularization loss function is introduced into the feature extraction network layer to increase the inter-class distance of features and reduce the intra-class distance of features, thereby generating a metric penalty term. The weight parameters of the fault diagnosis model are updated by combining the distribution difference metric, the classification error generated by the classification prediction loss function, and the metric penalty term, and then using the backpropagation algorithm.

6. An adaptive fault diagnosis system based on digital twins and domain generalization, characterized in that, include: A sensor group is installed on a precision machining equipment. The sensor group includes a distributed thermocouple array installed at the front end of the spindle and a hydraulic transmitter installed in the drawbar cylinder circuit to collect real-time monitoring data and operating parameters. The first processor is communicatively connected to the sensor group and is configured to receive the real-time monitoring data and the operating condition parameters, calculate the working condition change index and mismatch degree, optimize the key parameters of the digital twin model, and retrain the fault diagnosis model to generate an updated weight matrix. The second processor is communicatively connected to the sensor group and the first processor, and is configured to receive the real-time monitoring data and the weight matrix, perform forward inference calculations of the fault diagnosis model, and output diagnostic instructions.

7. The adaptive fault diagnosis system for digital twins and domain generalization as described in claim 6, characterized in that, The first processor adopts a reduced instruction set computing processor architecture; The second processor adopts a field-programmable gate array architecture, and the second processor is internally divided into an independent first memory area and a second memory area; The first storage area is configured to load the currently active fault diagnosis model and perform the forward inference calculation; The second storage area is configured as a shadow buffer update area; After the first processor calculates and generates the weight matrix in the background, it writes the weight matrix into the second storage area in the second processor and sends a verification pass and a suspension wait signal to the second processor.

8. The adaptive fault diagnosis system for digital twins and domain generalization as described in claim 7, characterized in that, Also includes: The listening control circuit is electrically connected to the CNC control bus of the precision machining equipment and the chip select pin of the second processor, respectively. The listening control circuit is configured to parse the machining program instructions on the CNC control bus in real time. When the monitoring and control circuit detects a spindle stop command or a tool change command, it generates a trigger level signal. The listening control circuit uses the trigger level signal to pull down the chip select pin of the second processor, forcing the network inference read pointer of the second processor to switch from the first memory area to the second memory area, so that the weight matrix in the second memory area takes effect immediately.

9. A computing device, characterized in that, The method includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method as described in any one of claims 1 to 5.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 5.