An air conditioner outdoor unit pre-delivery fault online detection method and system
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-16
- Publication Date
- 2026-08-11
AI Technical Summary
[0005]针对现有技术的缺陷,本申请的目的在于提供一种空调外机出厂前故障在线检测方法与系统,旨在解决现有空调检测存在的诸多局限性的问题
本申请提出一种空调外机出厂前故障在线检测方法,结合基于层次化注意力的对抗重构与对比学习,对抗训练重构模块不断从重构损失基础上提升自己的判断精度;对比学习模块增强训练传入的数据时,通过数据增强构造不同视图,迫使模型学习到对时域/频域增强方式具有不变性的特征,增强获取多参数变量间关系的能力,提升对复杂工况的鲁棒性;层次化编码器加入了层次化编辑器和多头自注意力机制,通过层次化注意力,有效建模长时间跨度的关联,优于仅基于窗口的局部方法;对抗训练重构与对比学习的联合优化,使隐变量对噪声和轻微波动不敏感,降低误报率;模型轻量化设计(如使用LSTM而非复杂Transformer),满足工业场景的实时推理要求。
Smart Images

Figure CN122548435A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of air conditioner outdoor unit fault detection technology, and more specifically, relates to an online fault detection method and system for air conditioner outdoor units before they leave the factory. Background Technology
[0002] Fault diagnosis technology for air conditioning systems began in the 1990s. After nearly thirty years of development, significant progress has been made in related methods and engineering solutions. In recent years, in particular, the deep integration of industrial production and information technology has greatly improved automation levels and production efficiency. However, theoretical research in this field remains relatively lagging, with many areas for improvement. The main challenges currently faced include: insufficient number and types of sensors deployed, making it difficult to obtain enough high-quality data for a comprehensive assessment of equipment status; fault characteristics are often not obvious, lacking a clear distinction between normal and abnormal conditions; and multiple factors are coupled together, resulting in complex and variable operating conditions. These problems severely restrict the accuracy and practicality of fault diagnosis technology and urgently require further breakthroughs.
[0003] Currently, the main method used for air conditioner testing is the average value calculation method under ideal constant temperature environment to determine the judgment threshold. Its core mechanism is to calculate the average power within a specific time window and compare it with a preset threshold to achieve anomaly detection.
[0004] However, this method faces many limitations in practical applications. For example, the sample time for averaging is very short, the number of averaging trolleys is small, and it lacks universality. This leads to significant variations in detection thresholds on the same production line on the same day, making it impossible to fully utilize historical data from trolleys at the same location for knowledge transfer and reuse. Furthermore, it is greatly affected by the ambient temperature of the air conditioning detection environment. Due to the large area occupied by the production line, changes in the location of different trolleys will cause variations in the ambient temperature. Especially when the season differs, such as the significant temperature difference between summer and winter, it will greatly affect the judgment criteria. In addition, the current averaging calculation only uses the trolley power parameter, which cannot fully and comprehensively reflect the status of the air conditioning outdoor unit. Summary of the Invention
[0005] In view of the shortcomings of the existing technology, the purpose of this application is to provide an online fault detection method and system for air conditioner outdoor units before they leave the factory, aiming to solve the many limitations of existing air conditioner testing.
[0006] To achieve the above objectives, in a first aspect, this application provides an online fault detection method for air conditioner outdoor units before they leave the factory, comprising: The power and pressure of a single outdoor air conditioner unit on the production line are sampled at equal intervals and input into the online fault detection model to obtain the reconstruction loss as a score. If the score exceeds the set threshold, the detection result is unqualified; otherwise, the detection result is qualified. The online fault detection model includes a data preprocessing module, a first branch structure, and a second branch structure. The data preprocessing module normalizes and divides the original data into windows to obtain multiple fixed-length sub-sequence samples, which are then output to the first and second branch structures. The first branch structure includes a hierarchical encoder and a reconstruction module. The second branch structure includes a data augmentation module, a hierarchical encoder, and a contrastive learning module. The first and second branch structures share the hierarchical encoder. The hierarchical encoder learns the time-series relationships between and within input sample windows, outputting latent variable features. The reconstruction module generates a reconstructed sequence based on the latent variable features, making it similar in shape to the original sequence, and calculates the reconstruction loss based on the sub-sequence samples and the reconstructed sequence. The data augmentation module performs temporal and frequency-domain augmentation on the input samples to obtain a temporal view and a frequency-domain view, which together constitute a cross-domain positive sample pair. The contrastive learning module calculates the contrastive loss between the latent variable features of the two views. The online fault detection model is trained iteratively until the total loss converges, where the total loss is the weighted sum of the reconstruction loss and the contrast loss.
[0007] Preferably, the hierarchical encoder includes an in-window encoder and an inter-window encoder; the in-window encoder is used to receive samples after the sliding window is divided, extract local temporal features, and output local latent variables at each time step; the inter-window encoder is used to extract global temporal features and output global latent variables by utilizing the context information between multiple windows.
[0008] Preferably, the inter-window encoder is a window feature aggregator based on the mutual information bottleneck. It first outputs a probability distribution about the global state, and then uses the mutual information maximization principle in information theory to force this global distribution to retain sufficient correlation with the local temporal features of each window, while compressing noise that is irrelevant to the task, as follows: (1) Average the encoders within the window along the time dimension to obtain the global features of each window; (2) Output the mean value corresponding to the global features of the window through two linear layers respectively. and variance This forms a Gaussian distribution. ; (3) Introduce a global, learnable latent variable Its prior is a standard normal distribution, and local features of any window are estimated through a discriminator network. With global features Mutual information between them; (4) Maximize the lower bound of the mutual information during training, such that It can capture the most discriminative and stable patterns shared by all windows.
[0009] Preferably, the data augmentation module performs time-domain augmentation and frequency-domain augmentation on each sliding window sample in the same batch, with random augmentation methods, to obtain a time-domain view and a frequency-domain view; wherein, the time-domain augmentation methods include time masking, amplitude scaling, Gaussian noise injection, and time offset; the frequency-domain augmentation methods include Fourier transform, spectrum enhancement, and inverse Fourier transform, and the spectrum enhancement includes: random spectral line masking and spectral line amplitude perturbation.
[0010] Preferably, the reconstruction module is a decoder, used to generate a reconstruction sequence based on the global latent variables output by the inter-window encoder; before calculating the reconstruction error, a smooth and reversible nonlinear time warp is applied to the reconstruction sequence. This allows it to adaptively and optimally align to the original sequence on the time axis, and then measure the spatial error in the aligned coordinate system. At the same time, regularization is applied to the degree of distortion to prevent shape semantics destruction caused by arbitrary distortion. The reconstruction loss consists of a shape alignment term and a distortion regularization term:
[0011]
[0012]
[0013] in, To reconstruct the loss, Original sequence Shape alignment items between the distorted reconstructed sequence, For the distortion regularization term, The regularization coefficient is . For the distortion parameters, For the original time step, To reconstruct the sequence, To warp the time step, Indicates in the reconstruction sequence above Perform differentiable linear interpolation sampling. For window length, It is the second derivative of the twist function.
[0014] Preferably, normalized time coordinates are used. As input, the distorted coordinates are output through a lightweight monotonic neural network. And scale back to the original time range:
[0015] in, It is a monotonically increasing function.
[0016] Preferably, the time-domain view and frequency-domain view are input into the hierarchical encoder to obtain the corresponding latent variables, and the global sequence features are obtained by averaging along the time dimension. Finally, the modified NT-xent loss function is used to calculate the contrast loss between the latent variable features of the two views. :
[0017] in, For positive sample pairs, For cosine similarity, For temperature coefficient, To iterate through all time-domain and frequency-domain features in the batch except for itself, These are the time-domain and frequency-domain features of the sample, respectively. Forming positive sample pairs The number of samples within the same batch; Comparative loss Loss for all positive sample pairs within this batch The average.
[0018] Preferably, the outdoor unit cooling data and heating data of the air conditioner are trained separately.
[0019] To achieve the above objectives, in a second aspect, this application provides an online fault detection system for air conditioner outdoor units before they leave the factory, including a memory and one or more processors; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code including computer instructions; the one or more processors call the computer instructions to cause the system to execute the detection method as described in the first aspect.
[0020] To achieve the above objectives, in a third aspect, this application provides a computer-readable storage medium including instructions that, when executed on an electronic device, cause the electronic device to perform the detection method as described in the first aspect.
[0021] It is understood that the beneficial effects of the second and third aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here.
[0022] Overall, the technical solutions conceived in this application have the following beneficial effects compared with the prior art: This application proposes an online fault detection method for air conditioner outdoor units before they leave the factory. It combines adversarial reconstruction and contrastive learning based on hierarchical attention. The adversarial training reconstruction module continuously improves its judgment accuracy based on reconstruction loss. The contrastive learning module enhances the input data during training by constructing different views through data augmentation, forcing the model to learn features invariant to time / frequency domain augmentation methods, enhancing its ability to acquire relationships between multi-parameter variables, and improving robustness to complex operating conditions. The hierarchical encoder incorporates a hierarchical editor and a multi-head self-attention mechanism, effectively modeling long-term correlations through hierarchical attention, outperforming window-based local methods. The joint optimization of adversarial training reconstruction and contrastive learning makes latent variables insensitive to noise and slight fluctuations, reducing the false alarm rate. The model's lightweight design (e.g., using LSTM instead of a complex Transformer) meets the real-time inference requirements of industrial scenarios. Attached Figure Description
[0023] Figure 1 This is a flowchart of an online fault detection method for an air conditioner outdoor unit before it leaves the factory, provided in an embodiment of this application.
[0024] Figure 2 This is a schematic diagram of the structure of the online fault detection model provided in the embodiments of this application. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0026] In this application, the term "and / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A existing alone, A and B existing simultaneously, and B existing alone. In this application, the symbol " / " indicates that the related objects are in an "or" relationship, for example, A / B means A or B.
[0027] In this application, the terms "first" and "second," etc., are used to distinguish different objects, not to describe a specific order of objects. For example, "first response message" and "second response message," etc., are used to distinguish different response messages, not to describe a specific order of response messages.
[0028] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0029] In the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more, for example, multiple processing units means two or more processing units, multiple elements means two or more elements, etc.
[0030] The embodiments of this application are described below with reference to the accompanying drawings.
[0031] like Figure 1 As shown, this application proposes an online fault detection method for air conditioner outdoor units before they leave the factory, which specifically includes the following steps: S1. Obtain historical data for model training.
[0032] In terms of data preparation, specific types and lengths of data need to be collected. Multiple variable data from the air conditioning production line are collected in real time using sensors. These variables include power and pressure parameters. The outdoor unit testing process is divided into two stages: cooling and heating. The duration for both heating and cooling is set to 101 seconds, and the sampling interval is set to 1 second. Heating and cooling data are trained separately.
[0033] After collecting the data, due to the different units and large differences in the numerical ranges of the variables, it is necessary to perform independent normalization processing on each feature dimension. The maximum value of each feature is calculated from the historical training dataset. and minimum value The original values were normalized using Min-Max normalization. Mapped to Interval:
[0034] After data normalization, the next step is windowing. Even with separate training for heating and cooling data, a data length of 101 is still unsustainable for a graphics card. Therefore, this application employs a sliding window method to divide the data into windows according to a predefined window length. The normalized long sequence is divided into multiple subsequences of fixed length S, with a sliding step size of 1. Then, starting from a length of S... The sequence can generate One sample.
[0035]
[0036] in, For the first A window sample, which is a length of... The subsequence, containing consecutive segments extracted from the original sequence. Data points at each time step. For the index in the original sequence A single data point. This represents the length of the sliding window, i.e., the number of data points contained in each subsequence sample. This represents the total length of the original sequence. This is the sliding step size.
[0037] If the processed data is directly fed into the reconstruction adversarial training module and the contrastive module, it will be impossible to capture the relationships between data over a long period of time. Therefore, this application introduces a hierarchical self-attention contrastive autoencoder network. Figure 2 As shown, after the processed samples enter the model, they first enter the hierarchical encoder, which outputs latent variable features. The information obtained in this way involves the local relationships within the window and the relationships between windows. Then, they enter the dual-decoder reconstruction adversarial training module and the contrastive learning module respectively. The reconstruction loss is obtained through the dual decoder, and the contrastive loss is obtained through the contrastive learning module. The two are combined to obtain the final loss value.
[0038] S2. After processing the data, the divided samples are passed to the hierarchical encoder to learn the time series relationships between and within the windows.
[0039] The hierarchical encoder includes an intra-window encoder and an inter-window encoder; the intra-window encoder is used to receive samples after the sliding window is divided, extract local temporal features, and output local latent variables at each time step; the inter-window encoder is used to extract global temporal features and output global latent variables by utilizing the context information between multiple windows.
[0040] An in-window encoder is used to receive samples after the sliding window has been divided. Output the local latent variable representations for each time step. ,in, For window length, For the dimension of the variable, As the encoding dimension, in one illustrated embodiment, take The specific structure of the in-window encoder includes: input projection and position encoding, and a stack of at least one encoder block. Specifically, the input features are first mapped to a linear layer. In 3D space, the input projection features are obtained. Secondly, to preserve timing position information, a sinusoidal position code is added. The calculation formula for the sinusoidal position code is as follows:
[0041] Obtain the position encoding matrix ,in, For time step index, , For dimensional indexing. Next, position encoding (PE) and projection output. Add them together to obtain the input representation of the encoder block. Next is the stacking of encoders, in one illustrated embodiment, using a single layer. Each encoder block contains a multi-head self-attention sublayer and a feedforward network sublayer, and employs residual connections and layer normalization. The multi-head self-attention sublayer is used to receive the input representation. As input, by dividing into Each attention head is used to compute scaled dot product attention, and the multi-head outputs are concatenated to obtain a weighted context representation. The input represents The query is obtained through three linear transformations. ,key ,value and divided into Size, dimensions of each head In one illustrated embodiment, The feedforward network sublayer is used to receive the weighted context representation. As input, the nonlinear transformation characteristics are obtained through two layers of linear transformation and the ReLU activation function. The residual connection is used to represent the weighted context. and the input representation Element-wise summation is performed to obtain an intermediate representation after residual concatenation. The layer normalization receives this intermediate representation as input and standardizes it by calculating the mean and variance along the feature dimensions to obtain a normalized representation. The final output of the stacked encoder blocks is used as the local temporal feature corresponding to the samples after the sliding window partitioning.
[0042] Preferably, the inter-window encoder employs a window feature aggregator based on the mutual information bottleneck. The core idea is that instead of outputting a deterministic global vector, the inter-window encoder outputs a probability distribution about the global state (such as the mean μ and variance σ of a Gaussian distribution). Then, using the mutual information maximization principle in information theory, sufficient correlation is forced between this global distribution and the local features of each window, while compressing task-irrelevant noise. The specific implementation includes: 1. Encoding window features as a distribution: After averaging within the window, the output is not directly fed into the Transformer, but instead outputs the mean μ_i and variance σ_i corresponding to the window feature through two linear layers, forming a Gaussian distribution z_i~N(μ_i,σ_i^2). 2. Mutual information maximization aggregation: A global, learnable latent variable z_global is introduced, whose prior is a standard normal distribution. A discriminator network is used to estimate the mutual information between the local features z_i of any window and the global feature z_global. During training, this lower bound of mutual information is maximized (e.g., using InfoNCE or JS divergence) so that z_global can capture the most discriminative and stable patterns shared by all windows. Through the above probability distribution-based aggregation method, it is naturally insensitive to abnormal fluctuations in individual windows because the feature distribution of abnormal windows deviates from the overall distribution, and their impact on the global distribution is adaptively suppressed by the variance term, fundamentally solving the shortcomings of simple averaging.
[0043] S3. After obtaining the latent variables, they are passed to the dual-decoder adversarial reconstruction module to enhance the model's ability to remember normal patterns and improve anomaly detection performance.
[0044] The dual-decoder adversarial reconstruction module outputs the reconstruction loss of the first decoder and the reconstruction loss of the second decoder respectively; the first reconstruction loss and the second reconstruction loss are each weighted and summed with the cross-domain comparison loss to form the first joint loss and the second joint loss, which are used to drive the parameter updates of the first decoder and the second decoder respectively.
[0045] Real-world industrial time-series data often exhibits variability such as local time scaling and phase drift. Even if the reconstructed sequence is highly similar to the original sequence in terms of "shape," a slight misalignment on the time axis can lead to extremely high MSE penalties. To address this, this application proposes a shape-aware reconstruction loss under differential homeomorphism regularization. The core idea is to abandon the requirement of "point-by-point alignment" between the reconstructed and original sequences on the time axis. Before calculating the reconstruction error, a smooth and reversible nonlinear time warp is applied to the reconstructed sequence, allowing a "differential homeomorphism" (smooth, reversible nonlinear time warp) transformation between the two sequences on the time axis, enabling them to adaptively and optimally align to the original sequence on the time axis. After optimal alignment, the spatial differences are then calculated. Simultaneously, regularization is applied to the degree of warp to prevent shape semantic destruction caused by arbitrary warping.
[0046] First, parameterization of the time warp function.
[0047] Define a time warp function , the original time step Mapped to warped time step To ensure the smoothness and monotonically increasing property (i.e., the homeomorphism property) of the function, the following structure is adopted: using normalized time coordinates... As input, the distorted coordinates are output through a lightweight monotonic neural network. And scale back to the original time range: ,in, It is a monotonically increasing function with parameters. It contains several trainable weights.
[0048] A simple implementation is to use a construction method that combines multiple monotonic basis functions in a weighted manner, for example: ,in, It is to satisfy Smooth basis functions (such as B-splines or sine functions) to ensure .coefficient Constrained The derivative of is always positive.
[0049] Then, construct the joint loss function.
[0050] Given the original sequence and reconstruct sequence The shape-aware reconstruction loss is composed of a weighted sum of shape alignment and distortion regularization terms. This loss function truly realizes the comparison of "curve shape," fundamentally solving the false alarm problem caused by temporal phase drift, while balancing "smoothness" and "computational efficiency."
[0051] in, This is the regularization coefficient (e.g., set to 0.1). Shape alignment term. Under the influence of the time warp function, the reconstructed sequence is resampled to This was used to capture differences in "shape". Because The output may contain non-integer time coordinates, requiring the use of differentiable linear interpolation (or sinc interpolation) from the discrete time coordinates. The distorted sequence value is obtained from the [process]. The specific formula is:
[0052] in, Indicates in the reconstruction sequence The above uses continuous coordinates Linear interpolation sampling is performed. This term measures the spatial difference between two sequences after optimal time alignment, essentially capturing the similarity of their "waveform shapes." The distortion regularization term... This is to prevent the distortion function from reducing shape loss through extreme stretching or compression (e.g., mapping a nearly flat noise region to a peak position), and introduces a penalty for the degree of distortion.
[0053] An effective option is to penalize the square integral of the second derivative of the twisted function to constrain its curvature:
[0054] The second derivative can be analytically derived using finite difference or continuous spline baseband. This work encourages... Approximate linear mapping (i.e.) Thus, while maintaining similar shapes, we can preserve the original temporal rhythm as much as possible and avoid excessive distortion that is not physical.
[0055] Another optional regularization term is to directly restrict deviations from the identity mapping: However, curvature penalty allows for better uniform time scaling.
[0056] Each time the reconstruction loss is calculated to update the network parameters (encoder, decoder), the optimal warp parameters need to be solved first. This is to minimize the aforementioned objective. This constitutes an inner-level optimization process. Since the twisting parameters consist of only a small number of basis function coefficients (e.g., ... This optimization is extremely lightweight. The specific steps are: for each training sample in the current batch, fix the encoder-decoder parameters, and... Initialize to the corresponding identity mapping (e.g., set all basis coefficients to zero). Then iteratively optimize using a gradient descent algorithm (e.g., Adam). Minimize in a small number of steps (e.g., 10-20 steps) Finally, an approximation was found. Then, the shape alignment loss value at this point is used as the reconstruction loss for that sample, and participates in the gradient backpropagation of the outer network parameters (the process can be stopped). Gradient propagation, or directly using the value after the gradient has stopped.
[0057] After completing the above work, the shape-aware reconstruction loss proposed in this embodiment replaces the traditional MSE as the reconstruction loss term for each of the two decoders. The adversarial training mechanism of the two decoders remains unchanged—the reconstruction result of the first decoder is re-encoded by the encoder and then decoded again by the second decoder, and the difference between it and the original input serves as the penalty term in the loss function of the first decoder and the reward term in the loss function of the second decoder.
[0058] S4. After the original data is augmented, it enters the contrastive learning module to enhance the robustness of latent variable features and improve the model's adaptability to noise, sensor fluctuations and changes in operating conditions.
[0059] Data augmentation, aimed at constructing correlated positive sample pairs, is divided into time-domain augmentation and frequency-domain augmentation. For time-domain augmentation, an augmentation pool containing four basic temporal transformations is designed. Each transformation is applied to a sliding window of samples and dynamically during training. For frequency-domain augmentation, the frequency channels aim to generate a frequency-domain view whose spectrum is perturbed but whose essential physical properties remain unchanged. .
[0060] Temporal enhancement methods are mainly divided into the following four types: (1) Time mask: Simulate short-term sensor failure or data loss. Randomly select a continuous interval on the time axis and set the feature values of all time steps within that interval to zero. Mask length The mask ratio Starting position exist (2) Amplitude scaling: Simulates the fluctuation of sensor sensitivity. Multiply all features at all time steps of the entire window by a uniform random scaling factor. , This transformation makes the model insensitive to changes in absolute amplitude, and instead focuses on the relative changes in curve shape. (3) Gaussian noise injection: Simulate random measurement noise in industrial settings. Add independent and identically distributed Gaussian noise to the window data. Standard deviation (4) Time offset: Introduces a slight phase change. The window is cyclically shifted, with the offset amount... exist Random selection within ( Indicates shifting backward. (This indicates a forward shift). This transformation enables the encoder to learn timing patterns independent of absolute time position.
[0061] Frequency domain enhancement methods are mainly divided into the following enhancement methods: (1) Fourier transform: along the time dimension Perform a real fast Fourier transform (RFFT) independently on each variable dimension to obtain the frequency domain representation. ,in For the frequency domain length. (2) Spectrum enhancement: Apply one or more of the following perturbation operations to the spectrum: Random spectral masking: Randomly select several continuous or discrete frequency components on the frequency domain axis, set their complex values to zero, and simulate the loss of information in a specific frequency band; Spectral amplitude perturbation: Randomly select several frequency components, multiply their amplitudes by a scaling factor. The phase remains unchanged, simulating slight fluctuations in frequency domain energy. (3) Inverse Fourier Transform: Perform an inverse Fourier transform (IRFFT) on the enhanced spectrum to restore the time domain signal. This is the frequency domain enhanced view.
[0062] Thus, for the same original window sample, a temporal view is obtained. and frequency domain view The two constitute a cross-domain positive sample pair.
[0063] Enhanced temporal view and frequency domain view Re-execute Min-Max normalization (using the global extremum of the training set) to bring the numerical range back to normal. Interval. The normalized interval. and The corresponding latent variables are obtained by inputting the hierarchical encoder respectively:
[0064]
[0065]
[0066] in, For the dimension of latent variables.
[0067] The global sequence features are obtained by averaging the latent variables along the time dimension.
[0068]
[0069]
[0070] Then we calculate the projection and cross-domain contrast loss.
[0071] global sequence features and Input the projection head separately to obtain normalized projection features. In one illustrated embodiment, the projection head comprises: two MLP layers, the first layer... +ReLU, second layer The output is then L2 normalized.
[0072] The cross-domain contrastive loss employs an improved NT-Xent loss, aiming to narrow the gap between time-domain and frequency-domain features while widening the gap between cross-domain feature pairs and other samples. This constitutes a strong constraint of "one signal, two domains, one essence".
[0073] Within a batch, samples from the same window We consider cross-domain feature pairs of different samples as positive sample pairs and cross-domain feature pairs of different samples as negative sample pairs. Specifically, for batch sizes of... A total of samples were obtained. Each sample has one projection feature (each sample has one time-domain feature). and a frequency domain feature For positive sample pairs Calculate the loss:
[0074] in, The cosine similarity is used (already guaranteed to be equivalent by L2 normalization). For temperature coefficient (in this embodiment, it is taken as...) ), Iterate through all time-domain and frequency-domain features in the batch, excluding itself. In the definition of a positive sample pair, The loss is calculated and summed symmetrically. Cross-domain comparison loss. This is the average loss of all positive sample pairs within the batch. This loss function forces the representation of a signal in the time domain to be close to its representation in the frequency domain, while pushing it away from the cross-domain representations of other samples.
[0075] During training, the encoder is forced to learn invariant features that can simultaneously explain both "temporal evolution patterns" (tested by time-domain augmentation) and "spectral structure" (tested by frequency-domain augmentation), and these two must be semantically consistent. This cross-modal constraint is far more stringent than the comparison within a single domain and can capture deep-seated features that reflect the physical essence.
[0076] After obtaining the reconstruction loss and contrastive loss, the contrastive loss is compared with the reconstruction loss of the dual-decoder adversarial training module. and We then perform a weighted summation to arrive at the final optimization objective:
[0077] in, As a balance factor, this embodiment takes The loss function was adjusted experimentally to make the magnitudes of the two types of losses comparable. This joint loss function was then applied to the two decoder paths, forming two independent but shared encoder optimization objectives. Specifically: First loss function The expression applied to decoder1 is:
[0078] in, The reconstruction loss of decoder 1 is calculated using the shape-aware reconstruction loss described in this embodiment.
[0079] Second loss function For Decoder2, the expression is:
[0080] in, The reconstruction loss for decoder 2 is also calculated using the shape-aware reconstruction loss. Among the two loss functions, the contrast loss... They share the same cross-domain comparison loss value.
[0081] Historical data from the outdoor unit of the air conditioner is input into the network, and the network parameters are trained using a joint optimization method of reconstruction error and contrastive loss until the loss function converges. In one illustrated embodiment, the F1 score is considered to have converged when it no longer improves over multiple consecutive epochs.
[0082] Application phase: A computer is installed on the air conditioner testing production line, and the trained model is deployed on the computer. The sensor collects data from a single air conditioner on the production line in real time. After processing, the data is transmitted to the deployed testing software through the host computer. The model infers a score after fusing reconstruction loss and contrast loss based on the data, which is used to determine whether the outdoor unit is qualified. If it exceeds the set threshold, it is unqualified, otherwise it is not.
[0083] During the training phase, the online fault detection model uses a weighted sum of reconstruction loss and contrast loss as the total loss for joint optimization; during the inference phase, only the reconstruction loss is used as the scoring criterion for anomaly detection.
[0084] It should be understood that the above-described device is used to execute the methods in the above embodiments. The implementation principle and technical effect of the corresponding program modules in the device are similar to those described in the above methods. The working process of the device can be referred to the corresponding process in the above methods, and will not be repeated here.
[0085] Based on the methods in the above embodiments, this application provides an electronic device that may include a processor, a communications interface, a memory, and a communication bus, wherein the processor, communications interface, and memory communicate with each other via the communication bus. The processor may invoke logical instructions stored in the memory to execute the methods in the above embodiments.
[0086] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
[0087] Based on the methods in the above embodiments, this application provides a computer-readable storage medium storing a computer program that, when run on a processor, causes the processor to execute the methods in the above embodiments.
[0088] Based on the methods in the above embodiments, this application provides a computer program product that, when run on a processor, causes the processor to execute the methods in the above embodiments.
[0089] It is understood that the processor in the embodiments of this application can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. A general-purpose processor can be a microprocessor or any conventional processor.
[0090] The method steps in this application embodiment can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, portable hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can reside in an ASIC.
[0091] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0092] It is understood that the various numerical designations used in the embodiments of this application are merely for the convenience of description and are not intended to limit the scope of the embodiments of this application.
[0093] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A method for online fault detection of an air conditioner outdoor unit before it leaves the factory, characterized in that, include: The power and pressure of a single outdoor air conditioner unit on the production line are sampled at equal intervals and input into the online fault detection model to obtain the reconstruction loss as a score; If the score exceeds the set threshold, the test result is unqualified; otherwise, the test result is qualified. The online fault detection model includes: a data preprocessing module, a first branch structure, and a second branch structure. The data preprocessing module processes the original data sequentially through normalization and windowing to obtain multiple fixed-length sub-sequence samples, which are then output to the first and second branch structures. The first branch structure sequentially includes a hierarchical encoder and a reconstruction module. The second branch structure sequentially includes a data augmentation module, a hierarchical encoder, and a contrastive learning module. The first and second branch structures share the hierarchical encoder. The hierarchical encoder learns the time-series relationships between and within input sample windows, outputting latent variable features. The reconstruction module generates a reconstructed sequence based on the latent variable features, making it similar in shape to the original sequence, and calculates the reconstruction loss based on the sub-sequence samples and the reconstructed sequence. The data augmentation module performs temporal and frequency-domain augmentation on the input samples to obtain a temporal view and a frequency-domain view, which together constitute a cross-domain positive sample pair. The contrastive learning module calculates the contrastive loss between the latent variable features of the two views. The online fault detection model is trained iteratively until the total loss converges, where the total loss is the weighted sum of the reconstruction loss and the contrast loss.
2. The detection method as described in claim 1, characterized in that, The hierarchical encoder includes an intra-window encoder and an inter-window encoder; the intra-window encoder is used to receive samples after the sliding window is divided, extract local temporal features, and output local latent variables at each time step; the inter-window encoder is used to extract global temporal features and output global latent variables by utilizing the context information between multiple windows.
3. The detection method as described in claim 2, characterized in that, The inter-window encoder is a window feature aggregator based on the mutual information bottleneck. It first outputs a probability distribution about the global state, and then uses the mutual information maximization principle in information theory to force this global distribution to retain sufficient correlation with the local temporal features of each window, while compressing task-irrelevant noise, as follows: (1) Average the encoders within the window along the time dimension to obtain the global features of each window; (2) Output the mean value corresponding to the global features of the window through two linear layers respectively. and variance This forms a Gaussian distribution. ; (3) Introduce a global, learnable latent variable Its prior is a standard normal distribution, and local features of any window are estimated through a discriminator network. With global features Mutual information between them; (4) Maximize the lower bound of the mutual information during training, such that It can capture the most discriminative and stable patterns shared by all windows.
4. The detection method as described in claim 1, characterized in that, The data augmentation module performs time-domain augmentation and frequency-domain augmentation on each sliding window sample in the same batch, with random augmentation methods, to obtain time-domain and frequency-domain views. The time-domain augmentation methods include time masking, amplitude scaling, Gaussian noise injection, and time offset. The frequency-domain augmentation methods include Fourier transform, spectrum enhancement, and inverse Fourier transform. The spectrum enhancement includes random spectral line masking and spectral line amplitude perturbation.
5. The detection method as described in claim 3, characterized in that, The reconstruction module is a decoder used to generate a reconstruction sequence based on the global latent variables output by the inter-window encoder; before calculating the reconstruction error, a smooth and reversible nonlinear time warp is applied to the reconstruction sequence. This allows it to adaptively and optimally align to the original sequence on the time axis, and then measure the spatial error in the aligned coordinate system. At the same time, regularization is applied to the degree of distortion to prevent shape semantics destruction caused by arbitrary distortion. The reconstruction loss consists of a shape alignment term and a distortion regularization term: in, To reconstruct the loss, Original sequence Shape alignment items between the distorted reconstructed sequence, For the distortion regularization term, The regularization coefficient is . For the distortion parameters, For the original time step, To reconstruct the sequence, To warp the time step, Indicates in the reconstruction sequence above Perform differentiable linear interpolation sampling. For window length, It is the second derivative of the twist function.
6. The detection method as described in claim 5, characterized in that, normalized time coordinates As input, the distorted coordinates are output through a lightweight monotonic neural network. And scale back to the original time range: in, It is a monotonically increasing function.
7. The detection method as described in claim 1, characterized in that, The time-domain view and frequency-domain view are input into the hierarchical encoder to obtain the corresponding latent variables. The global sequence features are obtained by averaging along the time dimension. Finally, the modified NT-xent loss function is used to calculate the contrastive loss between the two view latent variable features. : in, For positive sample pairs, For cosine similarity, For temperature coefficient, To iterate through all time-domain and frequency-domain features in the batch except for itself, These are the time-domain and frequency-domain features of the sample, respectively. Forming positive sample pairs The number of samples within the same batch; Comparative loss Loss for all positive sample pairs within this batch The average.
8. The detection method as described in claim 1, characterized in that, The air conditioner outdoor unit's cooling and heating data are trained separately.
9. An online fault detection system for air conditioner outdoor units before they leave the factory, characterized in that, Includes memory and one or more processors; The memory is coupled to the one or more processors, and the memory is used to store computer program code, the computer program code including computer instructions; The one or more processors invoke the computer instructions to cause the system to perform the detection method as described in any one of claims 1 to 8.
10. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on an electronic device, the electronic device performs the detection method as described in any one of claims 1 to 8.