Analog circuit fault diagnosis method and system based on multi-modal and knowledge graph

CN122815152APending Publication Date: 2026-09-25NANJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611320615.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-28
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

[0005]为了解决现有方案中的图谱定义不清、离散频谱签名碰撞、知识检索噪声、软故障及多故障难分以及诊断结论缺少可追溯测试依据的问题,本申请提供了一种基于多模态与知识图谱的模拟电路故障诊断方法及系统,该方法把波特图视觉令牌、候选故障子图和诊断指令输入采用位置相关加权焦点损失微调的多模态模型,输出故障类别、频谱观察、判断依据和置信度,实现测试频谱、图谱证据与诊断结论的可追溯关联

Benefits of technology

[0143]本申请以波特图视觉令牌和频谱参数双分支表示同一测试响应,既保留连续曲线中的高维形态信息,又保留可由工程人员核查的定量频谱依据。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122815152A_ABST
    Figure CN122815152A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of analog and mixed signal integrated circuit electrical performance testing, fault diagnosis, knowledge graph retrieval and multi-modal artificial intelligence, and discloses an analog circuit fault diagnosis method and system based on multi-modal and knowledge graph, which comprises the following steps: obtaining a test spectrum to generate a polar plot, extracting a spectrum feature vector, determining a nominal feature and an abnormal judgment statistical threshold, comparing the extracted spectrum feature vector with a fault-free nominal feature vector, generating a binary feature signature and a continuous offset signature, constructing a test spectrum knowledge graph, extracting a hybrid retrieval and a candidate subgraph, combining multi-modal diagnosis prompts, obtaining multi-modal diagnosis prompts, inputting the multi-modal diagnosis prompts into a multi-modal model fine-tuned by analog circuit fault samples, and outputting a structured diagnosis report. The application realizes traceable association of test spectrum, graph evidence and diagnosis conclusion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the fields of electrical performance testing, fault diagnosis, knowledge graph retrieval, and multimodal artificial intelligence technology for analog and mixed-signal integrated circuits. Specifically, it relates to a fault diagnosis method and system for analog circuits based on multimodal and knowledge graphs. Background Technology

[0002] Analog circuits have continuous device parameters and complex fault propagation paths. Open circuits, short circuits, parameter drift, and concurrent faults in different components can produce overlapping amplitude and phase responses in the frequency domain. Existing testing procedures typically involve obtaining the amplitude and phase responses using frequency sweep testing equipment, and then engineers observe the 3 dB bandwidth, peak gain, roll-off slope, resonant peak, and phase changes in the Bode plot to determine the fault. This process relies on experience and is difficult to maintain a stable diagnostic speed and consistency in batch testing.

[0003] Traditional machine learning methods typically extract manually statistical features from test spectra and output fault labels, while deep learning methods can directly process Bode plot images. While these methods can achieve classification, the output is usually an opaque category or score, failing to provide test evidence for the category, the location of the faulty component, and feasible repair operations. Multimodal large models can jointly process images and text and generate natural language descriptions, but general-purpose models lack specialized knowledge regarding analog circuit components, fault modes, and measurable spectral deviations.

[0004] Existing multimodal knowledge graph fault diagnosis solutions typically perform cross-modal comparative learning on vibration, text, and infrared images, followed by classification using graph neural networks or state-space models. Existing integrated circuit testing solutions can also utilize circuit topology diagrams to generate test cases or fuse simulation and hardware data. For the frequency sweep testing scenario addressed in this application, existing solutions still have the following shortcomings: First, there is a lack of specific rules for mapping the dual signatures formed by the same frequency sweep response to the relationships between component, fault, and test signatures; second, the discrete signature space is small, making it prone to collisions where different faults share signatures; third, the ordinary cross-entropy training of the general language model does not distinguish between fault category tokens and spectrum inference tokens, and the contribution of a few difficult-to-distinguish faults and long inference fields to the training is insufficient. Summary of the Invention

[0005] To address the problems of unclear spectrum definition, discrete spectrum signature collision, knowledge retrieval noise, difficulty in distinguishing soft faults and multiple faults, and lack of traceable test evidence for diagnostic conclusions in existing solutions, this application provides a method and system for diagnosing analog circuit faults based on multimodal and knowledge graph approaches. This method uses a multimodal model with position-related weighted focus loss fine-tuning to input Bode plot visual tokens, candidate fault subgraphs, and diagnostic instructions, and outputs fault category, spectrum observation, judgment basis, and confidence level, thereby achieving traceable association between test spectrum, spectrum evidence, and diagnostic conclusions.

[0006] To achieve the above objectives, this application employs the following technical solution:

[0007] This application discloses a fault diagnosis method for analog circuits based on multimodal and knowledge graph approaches. The method is characterized by its focus on electrical measurement and fault diagnosis during integrated circuit manufacturing, testing, and maintenance. Specifically, the method includes the following steps:

[0008] Step 1: Test Spectrum Acquisition: Acquire the amplitude-frequency response sample value sequence and phase-frequency response sample value sequence of the analog circuit under test within a predetermined frequency range, and generate a frequency sampling grid and a Bode plot with uniform image size based on the amplitude-frequency response sample value sequence and phase-frequency response sample value sequence. ;

[0009] Step 2, Dual-branch feature extraction: Extract the Bode plot generated in Step 1. The representation is sequentially converted into pixel tensors and image patch representations, then mapped to a visual token matrix via a visual encoder, spatial merging operator, and projection layer. Simultaneously, a 24-dimensional spectral feature vector is extracted from the amplitude frequency response sample value sequence and the phase frequency response sample value sequence. ;

[0010] Step 3: Determination of Nominal Characteristics and Anomaly Judgment Statistical Thresholds: For the same circuit topology as the analog circuit under test, fault-free Monte Carlo simulations are performed using independent first and second random seed streams; the amplitude-frequency response sample value sequences and phase-frequency response sample value sequences obtained from each simulation are processed sequentially according to Step 1 and Step 2 to form the first set of fault-free samples and the second set of fault-free samples; based on the inclusion The first group of fault-free samples determines the fault-free nominal feature vector, based on the inclusion of... The second group of fault-free samples in the sample set determines the statistical threshold for anomaly judgment;

[0011] Step 4, Dual Signature Generation: The extracted spectral feature vector from Step 2 is used to generate the dual signature. Compared with the fault-free nominal feature vector determined in step 3, a binary feature signature representing the spectrum anomaly category is generated based on the anomaly judgment statistical threshold determined in step 3, and a continuous offset signature representing the direction and degree of spectrum anomaly is generated.

[0012] Step 5: Construction and Update of Test Spectrum Knowledge Graph: Based on the fault-free nominal feature vector and anomaly judgment statistical threshold obtained in Step 3, Steps 1, 2 and 4 are executed respectively for analog circuit fault samples with known fault labels to form a valid sample dataset with circuit topology identifier, coarse-grained fault category, binary feature signature and continuous offset signature; based on the valid sample dataset, class prototypes of each combination of circuit topology and fault category are calculated, and a test spectrum knowledge graph is constructed during the first processing. When there is an existing test spectrum knowledge graph, the test spectrum knowledge graph is updated according to the newly added valid samples. The test spectrum knowledge graph includes component nodes, fault nodes and test signature mapping represented by fault node attributes and relation endpoints, and the component nodes, fault nodes and test signature mapping are associated through relations.

[0013] Step 6: Hybrid Retrieval and Candidate Subgraph Extraction: Based on the topology identifier of the analog circuit under test, filter the test spectrum knowledge graph constructed or updated in Step 5. Perform numerical candidate retrieval using the continuous offset signature or the binary feature signature. Merge and rearrange the candidate rankings of one or more actually activated retrieval channels, and select the top-ranked subgraph with the highest rearrangement score. Using faulty nodes as seeds, nodes are expanded along similar fault relationships and coarse-grained category relationships. The rearranged candidates are then deduplicated with the expanded nodes to form a candidate fault subgraph. It is a preset positive integer;

[0014] Step 7, Multimodal Diagnostic Hint Combination: Read diagnostic instructions from the pre-established and stored diagnostic instruction template, and combine the visual token matrix. The structured context of the candidate fault subgraph in step 6 and the diagnostic instructions are combined to form a multimodal diagnostic prompt;

[0015] Step 8: Multimodal model fine-tuning and diagnostic output: Using analog circuit fault training samples, position-dependent weighted focus loss, and low-rank adaptation, the parameters of the multimodal model are finely tuned efficiently; the multimodal diagnostic prompts obtained in Step 7 are input into the fine-tuned multimodal model, and a structured diagnostic report is output. The structured diagnostic report includes at least the fault category, spectrum observation results, judgment basis, and confidence level.

[0016] A further improvement of this application is that, in step 2, the Bode plot generated in step 1 is... Convert to RGB image and scale pixels, then normalize pixels to obtain pixel tensors. ; Pixel tensor The image is divided into non-overlapping blocks and represented by a visual encoder. Extract image patch features and perform spatial merging operator After merging, by the projection layer Mapping to the text embedding dimension of the multimodal model yields the visual token matrix. :

[0017]

[0018] .

[0019] A further improvement of this application is that, in step 2, the amplitude-frequency response sample value sequence is... and phase frequency response sample value sequence Extracting spectral feature vectors The spectral feature vector comprises 24-dimensional features, including peak amplitude, minimum amplitude, amplitude range, 3dB bandwidth, phase range, dominant frequency, full-band dB amplitude sum of squares statistic, mean, population standard deviation, maximum value, minimum value, and sum of squares of the inverse discrete transform derived sequence, as well as low-frequency dB amplitude sum of squares, mid-frequency dB amplitude sum of squares, high-frequency dB amplitude sum of squares, low-frequency slope, high-frequency slope, phase at peak frequency, phase slope, amplitude skewness, amplitude kurtosis, number of local peaks, peak sharpness, and the ratio of the mid-frequency band to the low- and high-frequency dB amplitude sum of squares. Specifically, it includes the following steps:

[0020] Step 2.1, let Peak amplitude Minimum amplitude Amplitude range 3dB bandwidth Phase range Dominant frequency Statistical measure of the sum of squares of dB amplitude across the entire frequency band Calculate according to the following formula:

[0021]

[0022]

[0023]

[0024]

[0025]

[0026]

[0027]

[0028]

[0029]

[0030] in, For frequency point index, This represents the total number of frequency sampling points. A set of frequency point indices with an amplitude not less than 3dB of the peak amplitude; when 3dB bandwidth , Indicates dB amplitude The frequency index of the point where the maximum value is obtained. Indicates the dominant frequency. Indicates the lowest frequency in the sweep range. Indicates the highest frequency in the sweep range. Indicates the first Log-uniform frequency points, For the first Complex transfer function at a frequency point To output complex voltage, For input complex voltage, The dB amplitude Phase for angles: , The arctangent operation represents the operation that preserves quadrant information;

[0031] Step 2.2: To obtain the derived sequence statistics related to the overall shape of the complex frequency response, first set the dB amplitude... Restore to linear amplitude and control phase by angle Convert to radians, then perform an inverse discrete Fourier transform to obtain the linear amplitude. :

[0032]

[0033]

[0034]

[0035] in, For the reason and Reconstructed complex spectrum samples, The imaginary unit, This represents the inverse discrete Fourier transform. Indicates taking the real part, For derived sequence index and ; Extracting the inverse discrete transform derived sequence. mean Inverse Discrete Transform Derived Sequence Overall standard deviation Inverse Discrete Transform Derived Sequence maximum value Inverse Discrete Transform Derived Sequence minimum value and inverse discrete transform derived sequence Sum of squares They are respectively:

[0036]

[0037]

[0038]

[0039]

[0040] ;

[0041] Step 2.3, let , and These represent the low-frequency index set, mid-frequency index set, and high-frequency index set, respectively, and the sum of squares of the dB amplitude in the low-frequency band. Mid-frequency band dB amplitude sum of squares Sum of squared dB amplitude in high-frequency band Calculate according to the following formula:

[0042]

[0043]

[0044]

[0045] For any set of frequency point indices ,make The sequence to be fitted In the The value of each frequency sampling point The sequence to be fitted In the The values ​​of each frequency sampling point are taken, and let and Each is an index set Inside and The mean of the first-order least squares fit is defined, and the slope operator is defined. :

[0046]

[0047]

[0048]

[0049]

[0050]

[0051] in, For a set of frequency point indices, For frequency point index set The number of frequency points included, when any frequency point index set When there are fewer than two valid points within the interior, let the corresponding slope be... =0, For low-frequency slope, For high-frequency slopes, The phase at the peak frequency, The phase slope; This is a sequence of amplitude-frequency response sample values. This is a sequence of phase frequency response sample values;

[0052] Step 2.4, let Let be the average amplitude across the entire frequency band. Indicates the order of the central moment, dB amplitude sequence order central moments ,exist At that time, amplitude skewness Amplitude kurtosis Number of local peaks Peak sharpness The ratio of the sum of squares of the dB amplitude in the mid-frequency band to that in the low- and high-frequency bands Calculate according to the following formula:

[0053]

[0054]

[0055]

[0056]

[0057]

[0058] in, For calculating the number of local peaks The indicator function takes the value 1 if the condition is true, and 0 otherwise; when At that time, and Set it to 0 or classify the sample as invalid; when the peak is located at the endpoint of the inverse discrete transform derived sequence, let For instances ranging from 1 Hz to 10 MHz, BL, BM, and BH can correspond to 1 Hz to 100 Hz, 100 Hz to 10 kHz, and 10 kHz to 10 MHz, respectively.

[0059] A further improvement in this application is that step 3 specifically includes the following steps:

[0060] Step 3.1: Execute using the first random seed stream. In each fault-free Monte Carlo simulation, the spectral response obtained from each simulation is processed sequentially according to steps 1 and 2 to obtain the first set of fault-free samples. Based on the first set of fault-free samples, the next... Fault-free nominal characteristics:

[0061]

[0062] in, This represents the number of fault-free samples in the first group. This is the index for the first set of fault-free samples. In the first group of fault-free samples, the first The first fault-free sample dimensional features, This is the nominal feature vector of fault-free operation;

[0063] Step 3.2: Execute using a second random seed stream that is independent of the first random seed stream. In the second fault-free Monte Carlo simulation, the spectral response obtained from each simulation is processed sequentially according to steps 1 and 2 to obtain the second set of fault-free samples. Let the second group of fault-free samples be the first one in the second group of fault-free samples. The characteristics of each sample are: relative bandwidth deviation Absolute deviation of peak amplitude and phase range deviation for:

[0064]

[0065]

[0066]

[0067] in, This indicates that the 95th percentile of the corresponding deviation statistic for the second group of fault-free samples was obtained. , and These are the statistical thresholds for anomaly detection, namely, relative bandwidth deviation, absolute peak amplitude deviation, and absolute phase range deviation. This is an index for statistical threshold types used for anomaly detection.

[0068] A further improvement of this application is that, in step 4, the binary signature is a five-bit binary signature:

[0069]

[0070]

[0071]

[0072]

[0073]

[0074] in, For indicator functions, binary signatures , Indicates bandwidth offset, Indicates amplitude change, Indicates phase anomaly, Indicates signal loss and It represents the fluctuation state of the sequence derived from the inverse discrete transform;

[0075] The continuous offset signature The first to 12th dimensions of the 24-dimensional spectral feature vector are compared with the corresponding fault-free nominal features. The normalized offset is constituted for the first 3D features, first calculate the normalized offset , and then obtain the first 2D continuous offset :

[0076]

[0077]

[0078] in, The spectral feature vector to be measured The Dimensional features, To determine the preset positive small quantity of the near-zero nominal value, , This indicates that four decimal places will be retained when storing the data.

[0079] A further improvement in this application is that step 5 specifically includes the following steps:

[0080] Step 5.1: Obtain analog circuit fault samples with known fault labels; for each analog circuit fault sample, execute Step 1 to obtain the amplitude-frequency response sampling value sequence, phase-frequency response sampling value sequence, and Bode plot; execute Step 2 to obtain the visual token matrix and spectral feature vector; and execute Step 4 based on the fault-free nominal feature vector and anomaly judgment statistical threshold determined in Step 3 to generate binary feature signatures and continuous offset signatures, thereby forming an effective sample dataset with circuit topology identifiers, coarse-grained fault categories, binary feature signatures, and continuous offset signatures; perform stratified sampling according to coarse-grained fault categories, using a fixed random seed to divide 70% of the entire effective sample dataset into a training candidate set and 30% into a test set; then use a fixed random seed to randomly shuffle the training candidate set, and divide 10% of the training candidate set into a validation set; the remaining 90% of the training candidate set is used as the final training set, so that the final training set, validation set, and test set account for approximately 63%, 7%, and 30% of the entire effective sample dataset, respectively; for each circuit topology and fault category combination in the final training set, calculate the continuous offset signature class center of the combination. And select the signature class center with continuous offset. The training sample with the smallest Euclidean distance is used as the center sample or class prototype. :

[0081]

[0082]

[0083] in, This indicates a combination of circuit topology and fault category. This represents the set of sample indices in the final training set representing the combination of circuit topology and fault category. , Indicates the first The twelve-dimensional continuous offset signature of each training sample is used to determine the representative signature of the fault category by combining the five-bit binary feature signature of the central sample or class prototype with the twelve-dimensional continuous offset signature.

[0084] Step 5.2: Establish a fault node and write the circuit topology identifier, component identifier, fault mode, coarse-grained fault category, fault description, five-bit binary feature signature and twelve-dimensional continuous offset signature into the attributes of the fault node.

[0085] Step 5.3: Establish a component node for each component identifier, establish a fault relationship between the component node and the corresponding fault node, write the representative signature into the corresponding fault node to form a test signature mapping, and record the association between the fault node and the test signature mapping based on the spectrum deviation relationship caused by the fault.

[0086] Step 5.4: Generate similar fault relationships between fault nodes corresponding to different fault modes of the same component, and generate coarse-grained category relationships between fault nodes in the same circuit topology and belonging to the same coarse-grained fault category.

[0087] A further improvement in this application is that step 6 specifically includes the following steps:

[0088] Step 6.1: First, use the topology identifier of the circuit under test to filter out fault nodes that do not belong to the circuit under test. Assume that there are a total of [number missing] fault nodes after filtering. The faulty node with a valid continuous offset signature, the first The consecutive offset signatures of the candidate fault nodes are as follows: Calculate the mean of the continuous shifts in each dimension of the map. and overall standard deviation :

[0089]

[0090]

[0091]

[0092]

[0093]

[0094]

[0095]

[0096] in, For querying the continuous offset signature of the analog circuit under test, These are respectively querying consecutive offset signatures and the first The first consecutive offset signature of the candidate fault node dimensional components, The first in the atlas Mean and population standard deviation of continuous offsets; These are the standardized query component and candidate component, respectively; For querying and the Euclidean distance between candidate faulty nodes The corresponding numerical similarity; This represents the number of candidate faulty nodes with valid consecutive offset signatures after filtering. Index of candidate faulty nodes. Dimension index for consecutive offset signatures, To prevent a stability constant with a standard deviation of zero; the numerical channels are configured according to... From childhood to adulthood or by Arrange the candidates from largest to smallest;

[0097] Step 6.2: When consecutive offset signatures are unavailable, use the following five-bit binary signature weighted Hamming distance as the fallback path:

[0098]

[0099] in, For the first The first query binary signature Bit, For the first The first candidate binary signature Bit, For the first The non-negative weight of the bit and ;

[0100] Step 6.3: Based on the binary feature signature and continuous offset signature obtained in Step 4, automatically generate a query anomaly description without component identifiers, fault modes, and actual fault labels using a preset text template. This anomaly description summarizes the anomaly type, direction, and degree of the spectrum under test. When the automatic anomaly description is available, activate the semantic vector cosine retrieval channel and the term statistical cosine retrieval channel, and combine the query anomaly description with the first term in the test spectrum knowledge graph. Each candidate fault description is input into the same semantic encoder to obtain a semantic vector of the query anomaly description. and the Semantic vectors describing candidate faults The similarity obtained by semantic vector cosine similarity retrieval is:

[0101]

[0102] The term statistical cosine retrieval channel uses unary and bigram terms to establish TF-IDF weights for the query anomaly description and fault description sets. Cosine similarity of terms They are respectively:

[0103]

[0104]

[0105] in, To set the total number of fault description documents, For terms In the document word frequency in For included terms The number of documents, To prevent the default non-negative small quantity in zero-norm division, for TF-IDF weights, for TF-IDF weights;

[0106] Step 6.4: The semantic vector obtained in Step 6.3 and TF-IDF weights The resulting vectors undergo L2 normalization before retrieval. The normalized cosine similarity is obtained from the vector dot product. If automatic anomaly description is unavailable, the semantic vector cosine retrieval channel and the term statistical cosine retrieval channel are disabled, leaving only the numerical channel. Each enabled channel generates candidate rankings, which are then weighted and merged using a reciprocal sorting method.

[0107]

[0108] in, To return candidates The set of enabled search channels as a candidate In the passage The rankings starting from 1 in the middle. It is a positive smoothing constant. For channel non-negative weights and No candidate returned The channel does not generate scoring items;

[0109] Step 6.5: Calculate the comprehensive re-ranking score for the top twenty candidates after fusion:

[0110]

[0111] Take the overall rearrangement score The highest front Each faulty node is used as a seed set. , Let be a positive integer, and let the fault relationship subgraph consist of nodes. Pointing to node The edge weight is Then the transition matrix and seed personalized vector for:

[0112]

[0113]

[0114]

[0115] For nodes with no outgoing edges, the transition probability of nodes with no outgoing edges is determined according to a personalized vector. The assignment is iterative on the directed graph of fault nodes, which consists of similar fault relationships and coarse-grained category relationships. until Or reach the maximum number of iterations, where, The convergence threshold, The damping coefficient is selected after excluding seed nodes. One extended fault node;

[0116] Step 6.6: Remove duplicates from the rearranged candidates and expanded nodes to form a candidate fault subgraph containing fault name, component identifier, fault mode, signature, description, score and association relationship.

[0117] A further improvement of this application is that, in step 8, the multimodal model employs a position-dependent weighted focus loss during fine-tuning, causing the classification tokens and inference tokens in the structured diagnostic report to have different loss weights. Specifically, this includes the following steps:

[0118] Step 8.1: For the target structured diagnostic report in the training samples, the first one that belongs to the classification token or reasoning token... One valid target token, based on the true vocabulary category of the valid target token. Calculate labeled smooth cross-entropy loss :

[0119]

[0120] in, The label smoothing coefficient. For the first The true category of a valid token, For multimodal models of vocabulary items Predicted probability:

[0121]

[0122] in, For the first A multimodal model of a single location for vocabulary items The output logit, For vocabulary size;

[0123] Step 8.2, let Indicates the multimodal model for the 3rd... Determine the confidence level of each real target token and calculate the focus loss. And calculate the total loss. :

[0124]

[0125]

[0126] in, The total number of valid target token positions used in loss calculation within the target structured diagnostic report. Focusing parameters for difficult samples The larger the value, the higher the relative contribution of the low-confidence target token; The position-related weight of each valid target token for

[0127]

[0128] Among them, let Let be the set of prompts, padding, visual placeholders, and other mask locations that do not participate in loss calculation, and let be the set of target token locations corresponding to the fault category field. This refers to the set of target token locations corresponding to the spectrum observation, judgment criteria, and confidence level fields, and... , 𝒞 and They do not overlap. For fault category token weights, For inference token weight, and 0;

[0129] A further improvement in this application is that, in step 8, the multimodal model employs low-rank adaptation for efficient parameter fine-tuning; for the basic weight matrix of the linear layer to be adapted... ,freeze Only the reduced-dimensional low-rank matrix and the increased-dimensional low-rank matrix are trained, and the low-rank weights are updated. and the updated weight matrix for:

[0130]

[0131]

[0132] in, It is a positive scaling factor. The rank of the low-rank fitting matrix and satisfying , , , For a dimension-reduced low-rank matrix, For a low-rank matrix of increased dimension, and These are the input and output dimensions of the linear layers to be adapted, respectively. The linear layers to be adapted include query, key, value, and output attention projection layers, as well as gating, dimensionality-upgrading, and dimensionality-downgrading feedforward projection layers.

[0133] This application provides a system for analog circuit fault diagnosis based on multimodal and knowledge graph methods, including:

[0134] The test spectrum acquisition module is used to acquire the amplitude frequency response sample value sequence and the phase frequency response sample value sequence of the analog circuit under test and generate a Bode plot;

[0135] The dual-branch feature module is used to map the Bode plot into a visual token matrix through image patching, visual encoding, spatial merging operators, and projection layers. And obtain the spectral feature vector from the amplitude frequency response sample value sequence and the phase frequency response sample value sequence;

[0136] The dual signature generation module is used to perform fault-free Monte Carlo simulation for the same circuit topology using independent first and second random seed streams. It determines the fault-free nominal feature vector based on the first set of fault-free samples, determines the anomaly judgment statistical threshold based on the second set of fault-free samples, and generates binary feature signature and continuous offset signature.

[0137] The graph construction and storage module is used to calculate the continuous offset signature class center for each combination of circuit topology and fault category, select the center sample with the smallest Euclidean distance to the continuous offset signature class center as the class prototype sample, determine the binary feature signature and continuous offset signature of the class prototype sample as the representative signature, and establish the component node, fault node, test signature mapping, and the relationship between the component having a fault, the fault causing spectral deviation, similar faults, and the same coarse-grained category.

[0138] The hybrid retrieval and subgraph expansion module is used to perform circuit topology filtering, numerical candidate retrieval, optional semantic vector cosine retrieval and term statistical cosine retrieval, inverse sorting fusion, candidate reordering, and node expansion based on similar fault relationships and coarse-grained category relationships; and to remove duplicates between reordered candidates and expanded nodes to form a candidate fault subgraph;

[0139] The prompt fusion module is used to read diagnostic instructions from a pre-established and stored diagnostic instruction template, and combine the visual token matrix, the structured context of the candidate fault subgraph, and the diagnostic instructions into a multimodal diagnostic prompt;

[0140] The model training module is used to efficiently fine-tune the parameters of multimodal models using position-dependent weighted focus loss and low-rank adaptation.

[0141] The diagnostic report generation module is used to input the multimodal diagnostic prompts into the fine-tuned multimodal model and output a structured diagnostic report.

[0142] The beneficial effects of this application are:

[0143] This application uses a dual-branch representation of the same test response using Bode plot visual tokens and spectral parameters, which preserves both the high-dimensional morphological information in the continuous curve and the quantitative spectral basis that can be verified by engineers.

[0144] This application employs both five-bit binary signature and twelve-dimensional continuous offset signature. The binary signature provides anomaly type interpretation, while the continuous offset signature preserves the anomaly direction and strength, reducing the impact of signature collisions caused by different faults in the finite binary space.

[0145] This application defines a test spectrum knowledge graph by means of component nodes, fault nodes, test signature mapping, and deterministic representative sample selection and relationship generation rules, so that the graph content can be reproduced from circuit design data, fault injection records and spectrum calculation results, and can be incrementally updated when a new circuit is added.

[0146] This application uses topological filtering, numerical retrieval, optional semantic and term retrieval, ranking fusion, rearrangement and graph relation expansion to form candidate fault subgraphs step by step, avoiding the inclusion of all fault knowledge in the context and reducing false detections caused by a single distance metric.

[0147] This application employs a combined loss of labeled smoothing, focus modulation, and inference token weighting to reduce the dominance of easily classifiable tokens on the total loss and improve the training contribution of soft faults, multi-faults, and complete diagnostic chains.

[0148] This application achieves domain fine-tuning by updating only a few parameters through low-rank adaptation, making it easy to save and switch adaptation parameters for different product lines on test workstations or resource-constrained devices.

[0149] The structured output of this application limits the fault category, spectrum observation, judgment criteria, and confidence level to fixed fields, which facilitates the parsing of test software and manual review. Attached Figure Description

[0150] Figure 1 This is a schematic diagram of the overall process of this application.

[0151] Figure 2 This is a schematic diagram of the analog circuit fault diagnosis system of this application.

[0152] Figure 3 This is a schematic diagram of the test spectrum knowledge graph nodes, test signature mapping, and relationships in an embodiment of this application.

[0153] Figure 4 This is a schematic diagram of the binary feature signature and continuous offset signature generation process according to an embodiment of this application.

[0154] Figure 5 This is a schematic diagram of the hybrid retrieval, rearrangement, and candidate fault subgraph expansion process in an embodiment of this application.

[0155] Figure 6 This is a schematic diagram of the multimodal model training and combination loss calculation process according to an embodiment of this application. Detailed Implementation

[0156] The embodiments of this application will be disclosed below with reference to the drawings. For clarity, many practical details will be described in the following description. However, it should be understood that these practical details should not be used to limit this application. That is, in some embodiments of this application, these practical details are not necessary. In addition, for the sake of simplicity, some conventional structures and components will be shown in the drawings in a simple schematic manner.

[0157] This application discloses a system for diagnosing analog circuit faults based on multimodal and knowledge graph methods. The multimodal approach in this invention includes at least a visual modality derived from a Bode plot, a numerical feature modality calculated from the amplitude-frequency response and phase-frequency response, and a structured text modality derived from candidate fault subgraphs. The visual modality is used to identify continuous curve shapes, the numerical feature modality provides verifiable measurement deviations, and the structured text modality provides graphical evidence between components, fault modes, and test phenomena. Multiple voltage or current channels of the same type do not automatically constitute the multimodal approach described in this invention. Hard faults include open circuits, short circuits, and functional interruptions caused by abnormal connections; soft faults include continuous deviations of resistance, capacitance, or active device parameters relative to their nominal values; multiple faults refer to the simultaneous presence of two or more faults. The association between fault nodes and test signatures is generated by spectral calculations of the corresponding samples, not solely based on manually generated free text. The analog circuit fault diagnosis system of this application includes: a test spectrum acquisition module, used to acquire the amplitude frequency response sample value sequence and the phase frequency response sample value sequence of the analog circuit under test and generate a Bode plot; and a dual-branch feature module, used to map the Bode plot into a visual token matrix through image block division, visual encoding, spatial merging operator and projection layer. The system generates a spectrum feature vector from the amplitude-frequency response sample value sequence and the phase-frequency response sample value sequence. A dual-signature generation module performs fault-free Monte Carlo simulations using independent first and second random seed streams for the same circuit topology. It determines the fault-free nominal feature vector based on the first set of fault-free samples, determines the anomaly judgment statistical threshold based on the second set of fault-free samples, and generates a binary feature signature and a continuous offset signature. A spectrum construction and storage module calculates the continuous offset signature class center for each circuit topology and fault category combination, selects the center sample with the smallest Euclidean distance to the continuous offset signature class center as the class prototype sample, determines the binary feature signature and continuous offset signature of the class prototype sample as the representative signature, and establishes a mapping of component nodes, fault nodes, test signatures, and the spectrum of components with faults and fault-induced frequencies. The system includes: a multimodal diagnostic prompt module; a hybrid retrieval and subgraph expansion module; a circuit topology filtering module; a numerical candidate retrieval module; an optional semantic vector cosine retrieval module; a term statistical cosine retrieval module; a reciprocal sorting fusion module; a candidate reordering module; a node expansion module based on similar fault relationships and coarse-grained category relationships; a model training module; a model training module; a diagnostic report generation module; and a diagnostic report generation module. The module inputs the multimodal diagnostic prompts into the fine-tuned multimodal model and outputs a structured diagnostic report. The module also includes components for: a bias analysis, similar fault analysis, and coarse-grained category relationships; a hybrid retrieval and subgraph expansion module; a circuit topology filtering, numerical candidate retrieval, optional semantic vector cosine retrieval, term statistical cosine retrieval, reciprocal sorting fusion, candidate reordering, and node expansion based on similar fault relationships and coarse-grained category relationships; and a deduplication module to form a candidate fault subgraph.

[0158] like Figure 1 As shown, this application is a fault diagnosis method for analog circuits based on multimodal and knowledge graphs. The fault diagnosis method for analog circuits is aimed at electrical measurement and fault diagnosis in the process of integrated circuit manufacturing, testing and maintenance. In this embodiment, a common-emitter amplifier and a Sallen-Key bandpass filter are selected as the test objects. All samples use the same frequency sampling points, 448×448 pixel canvas and drawing style. For measured data from the same product, the amplitude axis and phase axis range can also be fixed according to the training set statistics.

[0159] Specifically, the analog circuit fault diagnosis method includes the following steps:

[0160] Step 1: Test Spectrum Acquisition: Acquire the amplitude-frequency response sample value sequence and phase-frequency response sample value sequence of the analog circuit under test within a predetermined frequency range, and generate a frequency sampling grid and a Bode plot with uniform image size based on the amplitude-frequency response sample value sequence and phase-frequency response sample value sequence. The process involves applying AC excitation to the analog circuit under test within a predetermined frequency range using a frequency sweep test device or circuit simulator, acquiring the complex response at each frequency point, calculating the amplitude-frequency response and phase-frequency response, and generating a Bode plot according to a uniform frequency sampling grid, image size, and plotting style. In this embodiment, the predetermined frequency ranges from 1 Hz to 10 MHz.

[0161] In a reproducible example, the normal manufacturing tolerance for resistors is within ±8% of the nominal value, and for capacitors, it is within ±15% of the nominal value. Environmental disturbances of 5%, 10%, 15%, or 20% can also be applied to non-faulty components. A resistor short circuit is approximated by 1 Ω, an open circuit by 1 MΩ, a capacitor short circuit by a large capacitance value, and an open circuit by 1 pF. The soft parameters of upward and downward bias are achieved at 1.5 times and 0.5 times the nominal value, respectively. The above values ​​are specific examples; actual applications can be adjusted according to the range of the testing instrument and the circuit manufacturing process.

[0162] Each sample record includes the circuit topology identifier, faulty component identifier, fault mode, coarse-grained fault category, parameter variations, frequency sequence, amplitude sequence, and phase sequence, and is bound to a unique data index. A validity check is performed on the raw responses, removing samples with missing frequency points, non-finite amplitude or phase values, and those where the simulation has not converged. Subsequently, a stratified approach based on fault category is used, dividing the training and test sets into 70% and 30% portions, respectively, with a random seed of 42; 10% is reserved in the training set as a validation set. The data generation procedure... The default parameter is 111, meaning 111 samples are generated for each fault category and corresponding disturbance configuration. This embodiment ultimately generates 7437 tagged samples, including 3996 common-emitter amplifiers and 3441 Sallen-Key filters. The samples include normal, hard faults, soft faults, and concurrent multi-faults; the basic data format saves concurrent multi-faults as a composite fault category, and the graph parser uses "multi" as the corresponding logical element identifier, which does not represent a single physical element. If the data source further provides structured element and pattern fields for each sub-fault, relationships to multiple physical element nodes can be established in the extended graph.

[0163] In the hardware test implementation, a vector network analyzer can be used, or a sweep frequency test setup can be constructed using a function generator and a dual-channel oscilloscope; the excitation terminal and the output measurement terminal are connected to a common ground, and the excitation amplitude is selected within the effective value range of 10 mV to 100 mV without causing the circuit under test to leave the small-signal operating region. The test fixture first performs a through-circuit calibration, and if necessary, performs open-circuit, short-circuit, and load calibrations; the complex amplitude and phase of the input and output are measured synchronously at each frequency point, according to... The transfer function is calculated, and the average of the complex responses from at least three repeated frequency sweeps is taken before proceeding to the same feature extraction process.

[0164] Step 2, Dual-branch feature extraction: Extract the Bode plot generated in Step 1. It is sequentially converted into pixel tensors and image patch representations, and then mapped through a visual encoder, spatial merging operator, and projection layer to a visual token matrix representing the shape of the spectral curve. Simultaneously, a 24-dimensional spectral feature vector is extracted from the amplitude frequency response sample value sequence and the phase frequency response sample value sequence. The Bode plot is normalized in size and pixels and then input into the visual encoder to obtain a visual token that represents low-frequency attenuation, passband flatness, resonance peak, high-frequency roll-off, cutoff frequency and phase change.

[0165] Specifically, the Bode plot generated in step 1 Convert to RGB image and scale to 448×448 pixels, then perform pixel normalization to obtain pixel tensors. ; Pixel tensor The image is represented by 16×16 pixel non-overlapping blocks, and then processed by a visual encoder. Image patch features are extracted and processed using a 2×2 spatial merging operator. After merging, by the projection layer Mapping to the text embedding dimension of the multimodal model yields the visual token matrix. :

[0166]

[0167] .

[0168] From the amplitude frequency response sample value sequence and phase frequency response sample value sequence Extracting spectral feature vectors The spectral feature vector includes twenty-four features, including peak amplitude, minimum amplitude, amplitude range, 3dB bandwidth, phase range, dominant frequency, full-band dB amplitude sum of squares statistic, mean, population standard deviation, maximum value, minimum value and sum of squares of the inverse discrete transform derived sequence, as well as low-frequency dB amplitude sum of squares, mid-frequency dB amplitude sum of squares, high-frequency dB amplitude sum of squares, low-frequency slope, high-frequency slope, phase at peak frequency, phase slope, amplitude skewness, amplitude kurtosis, number of local peaks, peak sharpness and the ratio of the mid-frequency dB amplitude sum of squares to the low- and high-frequency dB amplitude sums.

[0169] Step 2 specifically includes the following steps:

[0170] Step 2.1, let Peak amplitude Minimum amplitude Amplitude range 3dB bandwidth Phase range Dominant frequency Statistical measure of the sum of squares of dB amplitude across the entire frequency band Calculate according to the following formula:

[0171]

[0172]

[0173]

[0174]

[0175]

[0176]

[0177]

[0178]

[0179]

[0180] in, For frequency point index, This represents the total number of frequency sampling points. A set of frequency point indices with an amplitude not less than 3dB of the peak amplitude; when 3dB bandwidth , Indicates dB amplitude The frequency index of the point where the maximum value is obtained. Indicates the dominant frequency. Indicates the lowest frequency in the sweep range. Indicates the highest frequency in the sweep range. Indicates the first Log-uniform frequency points, For the first Complex transfer function at a frequency point To output complex voltage, For input complex voltage, The dB amplitude Phase for angles: , The arctangent operation represents the operation that preserves quadrant information;

[0181] Step 2.2: To obtain the derived sequence statistics related to the overall shape of the complex frequency response, first set the dB amplitude... Restore to linear amplitude and control phase by angle Convert to radians, then perform an inverse discrete Fourier transform to obtain the linear amplitude. :

[0182]

[0183]

[0184]

[0185] in, For the reason and Reconstructed complex spectrum samples, The imaginary unit, This represents the inverse discrete Fourier transform. Indicates taking the real part, For derived sequence index and ; This is a sequence derived from the inverse discrete transform. It is a statistically derived sequence obtained from spectrum calculations, and is not equivalent to the measured time-domain waveform. Extraction of the inverse discrete transform derived sequence. mean Inverse Discrete Transform Derived Sequence Overall standard deviation Inverse Discrete Transform Derived Sequence maximum value Inverse Discrete Transform Derived Sequence minimum value and inverse discrete transform derived sequence Sum of squares They are respectively:

[0186]

[0187]

[0188]

[0189]

[0190] ;

[0191] Step 2.3, let , and These represent the low-frequency index set, mid-frequency index set, and high-frequency index set, respectively, and the sum of squares of the dB amplitude in the low-frequency band. Mid-frequency band dB amplitude sum of squares Sum of squared dB amplitude in high-frequency band Calculate according to the following formula:

[0192]

[0193]

[0194]

[0195] For any set of frequency point indices ,make The sequence to be fitted In the The value of each frequency sampling point The sequence to be fitted In the The values ​​of each frequency sampling point are taken, and let and Each is an index set Inside and The mean of the first-order least squares fit is defined, and the slope operator is defined. :

[0196]

[0197]

[0198]

[0199]

[0200]

[0201] in, For a set of frequency point indices, For frequency point index set The number of frequency points included, when any frequency point index set When there are fewer than two valid points within the interior, let the corresponding slope be... =0, For low-frequency slope, For high-frequency slopes, The phase at the peak frequency, The phase slope; This is a sequence of amplitude-frequency response sample values. This is a sequence of phase frequency response sample values;

[0202] Step 2.4, let Let be the average amplitude across the entire frequency band. Indicates the order of the central moment, dB amplitude sequence order central moments ,exist At that time, amplitude skewness Amplitude kurtosis Number of local peaks Peak sharpness The ratio of the sum of squares of the dB amplitude in the mid-frequency band to that in the low- and high-frequency bands Calculate according to the following formula:

[0203]

[0204]

[0205]

[0206]

[0207]

[0208] in, For calculating the number of local peaks The indicator function takes the value 1 if the condition is true, and 0 otherwise; when At that time, and Set it to 0 or classify the sample as invalid; when the peak is located at the endpoint of the inverse discrete transform derived sequence, let For examples ranging from 1 Hz to 10 MHz, , and It can correspond to 1 Hz to 100 Hz, 100 Hz to 10 kHz and 10 kHz to 10 MHz respectively.

[0209] Step 3: Determination of Nominal Characteristics and Anomaly Judgment Statistical Thresholds: For the same circuit topology as the analog circuit under test, fault-free Monte Carlo simulations are performed using independent first and second random seed streams; the amplitude-frequency response sample value sequences and phase-frequency response sample value sequences obtained from each simulation are processed sequentially according to Step 1 and Step 2 to form the first set of fault-free samples and the second set of fault-free samples; based on the inclusion The first group of fault-free samples determines the fault-free nominal feature vector, based on the inclusion of The second set of fault-free samples determines the statistical thresholds for anomaly detection in bandwidth, peak amplitude, and phase range.

[0210] like Figure 4 As shown, step 3 specifically includes the following steps:

[0211] Step 3.1: Execute using the first random seed stream. In each fault-free Monte Carlo simulation, the spectral response obtained from each simulation is processed sequentially according to steps 1 and 2 to obtain the first set of fault-free samples. Based on the first set of fault-free samples, the next... Fault-free nominal characteristics:

[0212]

[0213] in, This represents the number of fault-free samples in the first group. This is the index for the first set of fault-free samples. In the first group of fault-free samples, the first The first fault-free sample dimensional features, This is the nominal feature vector of fault-free operation;

[0214] Step 3.2: Execute using a second random seed stream that is independent of the first random seed stream. In the second fault-free Monte Carlo simulation, the spectral response obtained from each simulation is processed sequentially according to steps 1 and 2 to obtain the second set of fault-free samples. Let the second group of fault-free samples be the first group of fault-free samples. The characteristics of each sample are: relative bandwidth deviation Absolute deviation of peak amplitude and phase range deviation for:

[0215]

[0216]

[0217]

[0218] in, This indicates that the 95th percentile of the corresponding deviation statistic for the second group of fault-free samples was obtained. , and These are the statistical thresholds for anomaly detection, namely, relative bandwidth deviation, absolute peak amplitude deviation, and absolute phase range deviation. For anomaly detection statistical threshold type index, in one instance =100、 =10000; The typical range is 0.05 to 0.20. The typical range is 1 dB to 6 dB. The typical range is 5° to 30°. Nominal features and thresholds are cached separately according to circuit topology and recalculated when circuit parameters, frequency ranges, or feature algorithm versions change.

[0219] Step 4, Dual Signature Generation: The extracted spectral feature vector from Step 2 is used to generate the dual signature. Compared with the fault-free nominal feature vector determined in step 3, a binary feature signature representing the category of spectral anomaly is generated based on the anomaly judgment statistical threshold determined in step 3, and a continuous offset signature representing the direction and degree of spectral anomaly is generated. Here, the binary feature signature is a five-bit binary feature signature:

[0220]

[0221]

[0222]

[0223]

[0224]

[0225] The continuous offset signature The first to 12th dimensions of the 24-dimensional spectral feature vector are compared with the corresponding fault-free nominal features. The normalized offset is constituted for the first 3D features, first calculate the normalized offset , and then obtain the first 2D continuous offset :

[0226]

[0227]

[0228] in, The spectral feature vector to be measured The dimensional features, To determine the preset positive small quantity of the near-zero nominal value, , This indicates that four decimal places are retained during storage, in one instance. When the fault-free nominal feature vector Larger than the preset small amount At that time, the first 2D continuous offset Otherwise This aligns with the near-zero processing of the data generation process. Both the map and the sample to be tested simultaneously store binary feature signatures. and continuous offset signature : Used to display anomaly categories and to fall back to the previous search when consecutive signatures are missing. Used for default continuous numerical retrieval. Together, they address signature collisions caused by the fact that the five-bit binary space has a maximum of 32 combinations, while there may be more than 32 fault entries.

[0229] Step 5: Construction and Update of Test Spectrum Knowledge Graph: Based on the fault-free nominal feature vector and anomaly judgment statistical threshold obtained in Step 3, Steps 1, 2, and 4 are executed respectively for analog circuit fault samples with known fault labels to form a valid sample dataset with circuit topology identifier, coarse-grained fault category, binary feature signature, and continuous offset signature. Based on the valid sample dataset, class prototypes of each combination of circuit topology and fault category are calculated. A test spectrum knowledge graph is constructed during the first processing. When there is an existing test spectrum knowledge graph, it is updated according to the newly added valid samples. The test spectrum knowledge graph includes component nodes, fault nodes, and test signature mappings represented by fault node attributes and relation endpoints. Component nodes, fault nodes, and test signature mappings are associated through relationships. In Step 5, component nodes include circuit topology identifier, component identifier, number of fault modes, and fault mode list, where multi is used as the logical component identifier for concurrent multi-faults. Fault nodes include circuit topology identifier, component identifier, fault mode, coarse-grained fault category, fault description, and binary feature signature. and continuous offset signature The test signature mapping is represented by the endpoint identifiers of the causeDeviation relationship caused by the fault spectrum deviation, and does not fabricate a set of independent nodes that do not exist in the code data structure.

[0230] The test spectrum knowledge graph constructed in step 5 is stored in a JSON structured file, relational database, or graph database. Each time it is generated, the uniqueness of the node identifier, the signature dimension, and the validity of the relation endpoint identifier are verified. When adding a new circuit, only the component nodes, fault nodes, test signature mappings, and relationships of the circuit need to be added. The visual encoder and diagnostic report interface are not changed. Compared with general knowledge graphs, the key difference of this graph is that each fault node is bound to a double signature representative value determined by repeatable frequency sweep samples. The test signature mapping can serve as a direct retrieval bridge from the data under test to the fault entity.

[0231] like Figure 3 As shown, step 5 specifically includes the following steps:

[0232] Step 5.1: Obtain analog circuit fault samples with known fault labels; for each analog circuit fault sample, execute Step 1 to obtain the amplitude-frequency response sampling value sequence, phase-frequency response sampling value sequence, and Bode plot; execute Step 2 to obtain the visual token matrix and spectral feature vector; and execute Step 4 based on the fault-free nominal feature vector and anomaly judgment statistical threshold determined in Step 3 to generate binary feature signatures and continuous offset signatures, thereby forming an effective sample dataset with circuit topology identifiers, coarse-grained fault categories, binary feature signatures, and continuous offset signatures; perform stratified sampling according to coarse-grained fault categories, using a fixed random seed to divide 70% of the entire effective sample dataset into a training candidate set and 30% into a test set; then use a fixed random seed to randomly shuffle the training candidate set, and divide 10% of the training candidate set into a validation set; the remaining 90% of the training candidate set is used as the final training set, so that the final training set, validation set, and test set account for approximately 63%, 7%, and 30% of the entire effective sample dataset, respectively; for each circuit topology and fault category combination in the final training set, calculate the continuous offset signature class center of the combination. And select the signature class center with continuous offset. The training sample with the smallest Euclidean distance is used as the center sample or class prototype. :

[0233]

[0234]

[0235] in, This indicates a combination of circuit topology and fault category. This represents the set of sample indices in the final training set representing the combination of circuit topology and fault category. , Indicates the first The twelve-dimensional continuous offset signature of each training sample is used to determine the representative signature of the fault category by combining the five-bit binary feature signature of the central sample or class prototype with the twelve-dimensional continuous offset signature.

[0236] Step 5.2: Establish a fault node and write the circuit topology identifier, component identifier, fault mode, coarse-grained fault category, fault description, five-bit binary feature signature and twelve-dimensional continuous offset signature into the attributes of the fault node.

[0237] Step 5.3: Establish a component node for each component identifier, and establish a fault relationship between the component node and the corresponding fault node. Write the representative signature into the corresponding fault node to form a test signature mapping, and record the association between the fault node and the test signature mapping based on the spectrum deviation relationship caused by the fault. The test signature identifier is the relation endpoint and corresponds to the binary feature signature and continuous offset signature attribute in the fault node, so that the measurable spectrum deviation constitutes a direct retrieval bridge from the measured data to the fault node.

[0238] Step 5.4: Generate similar fault relationships between fault nodes corresponding to different fault modes of the same component, and generate coarse-grained category relationships between fault nodes in the same circuit topology and belonging to the same coarse-grained fault category.

[0239] Step 6: Hybrid Retrieval and Candidate Subgraph Extraction: Based on the topology identifier of the analog circuit under test, filter the test spectrum knowledge graph constructed or updated in Step 5. Perform numerical candidate retrieval using the continuous offset signature or the binary feature signature. Merge and rearrange the candidate rankings of one or more actually activated retrieval channels, and select the top-ranked subgraph with the highest rearrangement score. Using faulty nodes as seeds, nodes are expanded along similar fault relationships and coarse-grained category relationships. The rearranged candidates are then deduplicated with the expanded nodes to form a candidate fault subgraph. It is a preset positive integer;

[0240] like Figure 5 As shown, step 6 specifically includes the following steps:

[0241] Step 6.1: First, use the topology identifier of the circuit under test to filter out fault nodes that do not belong to the circuit under test. Assume that there are a total of [number missing] fault nodes after filtering. The faulty node with a valid continuous offset signature, the first The consecutive offset signatures of the candidate fault nodes are as follows: Calculate the mean of the continuous offset in each dimension of the map. and population standard deviation :

[0242]

[0243]

[0244]

[0245]

[0246]

[0247]

[0248]

[0249] in, For querying the continuous offset signature of the analog circuit under test, These are respectively querying consecutive offset signatures and the first The first consecutive offset signature of the candidate fault node dimensional components, The first in the atlas Mean and population standard deviation of continuous offset; These are the standardized query component and candidate component, respectively; For querying and the Euclidean distance between candidate faulty nodes The corresponding numerical similarity; This represents the number of candidate faulty nodes with valid consecutive offset signatures after filtering. Index of candidate faulty nodes. Dimension index for consecutive offset signatures, To prevent a stability constant with a standard deviation of zero; the numerical channels are configured according to... From childhood to adulthood or by Candidates are sorted from largest to smallest; query signatures and candidate signatures use the same set. and This aims to reduce the unintended dominance of distance by features with different dimensions and different degrees of dispersion.

[0250] Step 6.2: When consecutive offset signatures are unavailable, use the following five-bit binary signature weighted Hamming distance as the fallback path:

[0251]

[0252] in, For the first The first query binary signature Bit, For the first The first candidate binary signature Bit, For the first The non-negative weight of the bit and In this embodiment of the application, [0.25, 0.30, 0.15, 0.20, 0.10] are selected;

[0253] Step 6.3: Based on the binary feature signature and continuous offset signature obtained in Step 4, automatically generate a query anomaly description without component identifiers, fault modes, and actual fault labels using a preset text template. This anomaly description summarizes the anomaly type, direction, and degree of the spectrum under test. When the automatic anomaly description is available, activate the semantic vector cosine retrieval channel and the term statistical cosine retrieval channel, and combine the query anomaly description with the first term in the test spectrum knowledge graph. Each candidate fault description is input into the same semantic encoder to obtain a semantic vector of the query anomaly description. and the Semantic vectors describing candidate faults The similarity obtained by semantic vector cosine similarity retrieval is:

[0254]

[0255] The term statistical cosine retrieval channel uses unary and bigram terms to establish TF-IDF weights for the query anomaly description and fault description sets. Cosine similarity of terms They are respectively:

[0256]

[0257]

[0258] in, To set the total number of fault description documents, For terms In the document word frequency in For included terms The number of documents, To prevent the default non-negative small quantity in zero-norm division, for TF-IDF weights for TF-IDF weights;

[0259] Step 6.4: The semantic vector obtained in Step 6.3 and TF-IDF weights The resulting vectors undergo L2 normalization before retrieval. The normalized cosine similarity is obtained from the vector dot product. If automatic anomaly description is unavailable, the semantic vector cosine retrieval channel and the term statistical cosine retrieval channel are disabled, leaving only the numerical channel. Each enabled channel generates candidate rankings, which are then weighted and merged using a reciprocal sorting method.

[0260]

[0261] in, To return candidates The set of enabled search channels as a candidate In the passage The rankings starting from 1 in the middle. It is a positive smoothing constant. For channel non-negative weights and No candidate returned The channel that does not generate a score item; when all three channels are enabled, the preferred one is... =60, numerical, semantic, and term channel weights The values ​​are 0.5, 0.3, and 0.2 respectively; to ensure consistent fusion scale across different enabling configurations, the enabled channels can be adjusted accordingly. Perform normalization;

[0262] Step 6.5: Calculate the comprehensive re-ranking score for the top twenty candidates after fusion:

[0263]

[0264] Overall Rearrangement Score The three fixed weights correspond to the compatible implementation; Influenced solely by term channel ranking Not in style Repeated scoring, closing semantic channels The engineering implementation can also re-normalize the retained items. The overall rearrangement score is then calculated. The highest front Each faulty node is used as a seed set. , For positive integers, in this embodiment, Suppose the fault relationship subgraph consists of nodes. Pointing to node The edge weight is Then the transition matrix and seed personalized vector for:

[0265]

[0266]

[0267]

[0268] For nodes with no outgoing edges, the transition probability of nodes with no outgoing edges is determined according to a personalized vector. The assignment is iterative on the directed graph of fault nodes, which consists of similar fault relationships and coarse-grained category relationships. until Or reach the maximum number of iterations, where, The convergence threshold, The damping coefficient, in this embodiment, can be taken as 0.85. The maximum number of iterations is 200. After excluding the seed node, the first node is selected. In this embodiment, there are several extended faulty nodes. =2; Then, along the fault relationships and test signature mappings of the components, the corresponding component identifiers and signature attributes are associated respectively. The comprehensive re-ranking score is calculated for the candidates after inverse sorting and fusion. The comprehensive re-ranking score is a weighted sum of numerical similarity, semantic similarity when enabled, and inverse sorting fusion score, and the corresponding weight is determined according to the actual enabled retrieval channel; Using the fault nodes with the highest comprehensive re-ranking scores as seeds, personalized PageRank is performed on the fault relationship subgraph formed by the similarTo relationship and the same coarse-grained category relationship to obtain extended fault nodes that have multi-hop associations with the seed fault nodes; After deduplication of the re-ranked candidates and extended fault nodes, a candidate fault subgraph is formed, and after truncation according to the upper limit of the number of candidates and the upper limit of the multimodal model context length, the multimodal diagnostic prompts are injected;

[0269] Step 6.6: Remove duplicates from the rearranged candidates and expanded nodes to form a candidate fault subgraph containing fault name, component identifier, fault mode, signature, description, score and association relationship.

[0270] Step 7, Multimodal Diagnostic Hint Combination: Read diagnostic instructions from the pre-established and stored diagnostic instruction template, and combine the visual token matrix. The structured context of the candidate fault subgraph in step 6 and the diagnostic instructions are combined to form a multimodal diagnostic prompt;

[0271] Step 8: Multimodal Model Fine-tuning and Diagnostic Output: Using analog circuit fault training samples, position-dependent weighted focus loss, and low-rank adaptation, the multimodal model is efficiently fine-tuned. The multimodal diagnostic prompts obtained in Step 7 are input into the fine-tuned multimodal model, and a structured diagnostic report is output. The structured diagnostic report includes at least the fault category, spectral observation results, judgment criteria, and confidence level. In this step, the multimodal model uses position-dependent weighted focus loss during fine-tuning, giving the classification token and inference token in the structured diagnostic report different loss weights.

[0272] like Figure 6As shown, the training samples include a Bode plot, diagnostic instructions, and a target diagnostic report. The plot context can be empty during training, but candidate fault subplot contexts can be injected during inference. The target report uses fixed fields: Fault class, Observation, Evidence, and Confidence. The Chinese implementation corresponds to the fault category, observation, evidence, and confidence level. The processor converts the Bode plot into visual tokens and feeds the visual tokens and text tokens into the multimodal generation model. When constructing labels, the labels for user prompts, system prompts, fill positions, and visual placeholder tokens are set to -100 to exclude them from the loss; only the assistant target report token is retained. Specifically, the following steps are included:

[0273] Step 8.1: For the target structured diagnostic report in the training samples, the first one that belongs to the classification token or reasoning token... One valid target token, based on the true vocabulary category of the valid target token. Calculate labeled smooth cross-entropy loss :

[0274]

[0275] in, The label smoothing coefficient. For the first The true category of a valid token, For multimodal models of vocabulary items Predicted probability:

[0276]

[0277] in, For the first A multimodal model of a single location for vocabulary items The output logit, For vocabulary size;

[0278] Step 8.2, let Indicates the multimodal model for the 1st... Determine the confidence level of each real target token and calculate the focus loss. And calculate the total loss. :

[0279]

[0280]

[0281] in, The total number of valid target token positions used in loss calculation within the target structured diagnostic report. Focusing parameters for difficult samples The larger the value, the higher the relative contribution of the low-confidence target token.

[0282] The training data processor searches for the Fault class field prefix in the complete token sequence, starting from the assistant response and proceeding backwards. It identifies the valid tokens corresponding to this prefix and their category content as the classification interval, and defines the interval from the end of the classification interval to the last unmasked target token as the inference interval. Thus, the Observation, Evidence, and Confidence fields fall within the inference interval. If field prefix location fails, it degenerates into applying the first weight to all valid target tokens. The position-related weight of each valid target token for

[0283]

[0284] Among them, let Let be the set of prompts, padding, visual placeholders, and other mask locations that do not participate in loss calculation, and let be the set of target token locations corresponding to the fault category field. This refers to the set of target token locations corresponding to the spectrum observation, judgment criteria, and confidence level fields, and... , 𝒞 and They do not overlap. For fault category token weights, For inference token weights such as spectrum observation, judgment criteria, and confidence level, and 0; In this embodiment, the label smoothing coefficient can be selected within the range of 0 to 0.2. In this embodiment, it is selected as 0. =0.1, focusing parameters are selected within the range of 0 to 5, and this embodiment uses... =2、 =1、 =2, with a weight of 0 for hints, padding, visual placeholders, and other mask positions.

[0285] In step 8, the multimodal model employs low-rank adaptation for efficient parameter fine-tuning; for the basic weight matrix of the linear layer to be adapted... ,freeze Only the reduced-dimensional low-rank matrix and the increased-dimensional low-rank matrix are trained, and the low-rank weights are updated. and the updated weight matrix for:

[0286]

[0287]

[0288] in, It is a positive scaling factor. The rank of the low-rank fitting matrix and satisfying Let the original weight matrix be... , , , For a dimension-reduced low-rank matrix, For a low-rank matrix of increased dimension, and These are the input and output dimensions of the linear layer to be adapted, respectively.

[0289] This embodiment uses the Qwen3.5-9B multimodal generative model as the base model. , , , , , and Insert the module into the low-rank adaptation matrix.

[0290] The linear layers to be adapted include query, key, value, and output attention projection layers, as well as gated, dimensionality-upgrading, and dimensionality-reducing feedforward projection layers. The linear layers to be adapted include at least one of the attention projection layers of a multimodal model, and / or at least one of the gated projection layer, dimensionality-upgrading projection layer, and dimensionality-reducing projection layer of a feedforward network. and Based on the matrix dimension of the target model, the size of the training samples, and computational resources, in this embodiment, =32、 =64, drop rate 0.05, can be used on devices with sufficient video memory. =64、 =128. Training was performed using the AdamW optimizer with a peak learning rate of 128. = Preheating steps Approximately 10% of the total steps S, the cosine learning rate is scheduled as follows:

[0291]

[0292] The maximum gradient norm is set to 1.0, training is conducted for 5 epochs, and the effective batch size is 8. Bf16, gradient checkpointing, and efficient attention can be used to reduce GPU memory or time overhead. The model names and training values ​​mentioned above are specific examples and are not intended to limit the base model type, low-rank matrix rank, or number of training epochs.

[0293] During inference, the test spectrum acquisition module simultaneously sends the same test response to both the visual branch and the parameter branch. After the parameter branch generates a dual signature, the hybrid retrieval and subgraph expansion module form a candidate fault subgraph; the prompt fusion module organizes the circuit topology, candidate fault knowledge, and output constraints in a predetermined order. The basic online configuration disables the semantic and terminology channels, using only dual-signature numerical retrieval; the text channel is only enabled when the anomaly description can be automatically generated from measured deviations. Real fault labels, real component labels, or real coarse-grained categories used for comparative analysis in the offline evaluation script must not be included in the online query context. The multimodal model can employ greedy decoding or low-temperature decoding to reduce fluctuations from multiple generation of the same input.

[0294] The generated results are parsed by the test workstation from the Fault class, Observation, Evidence, and Confidence fields. Optional post-processing implementations can request manual review or supplementary testing when fields are missing or the confidence level is below a predetermined threshold, such as narrowing the frequency sweep range, increasing the frequency point density, or measuring the static operating point; this post-processing does not change the aforementioned dual-signature retrieval and multimodal generation process.

[0295] Stratified training and testing were performed on the aforementioned 7437 samples using a random seed of 42. Evaluation metrics included overall accuracy, macro-average F1, and circuit-specific accuracy. Overall accuracy measures the proportion of correctly classified samples; macro-average F1 assigns equal weight to each fault category and reflects the ability to identify a few categories such as soft faults and multiple faults; circuit-specific accuracy is used to determine the model's adaptability to different topologies.

[0296] Table 1 Comparison of main diagnostic methods based on analytical simulation data

[0297]

[0298] The values ​​listed in Table 1 are independent test results on analytical transfer function simulation data. The results for the LoRA multimodal model are not injected with the spectral context and are only used to verify efficient parameter fine-tuning and the structured output module; they do not represent the performance of the complete spectral enhancement chain. The results show that the model achieves classification performance close to that of a black-box classifier while outputting spectral observations, judgment criteria, and confidence levels; these results should not be taken as conclusions regarding hardware-measured accuracy. The macro-average F1 score being lower than the overall accuracy is mainly related to soft faults, spectral overlap due to multiple faults, and sample imbalance.

[0299] The following is an exemplary reasoning process, rather than the measured records outside of Table 1. For open-circuit faults in the Sallen-Key bandpass filter, if the measured spectrum exhibits deepening low-frequency attenuation and high-frequency roll-off, the parameter branch writes the deviations in bandwidth, peak amplitude, slope, and phase range into a continuous signature, and sets the bandwidth offset and amplitude change in the binary signature; the retrieval module can return candidates such as corresponding open-circuit faults and soft offsets of the same component, and expand the candidate subgraph along the similarTo relationship. The multimodal model generates hard fault categories, observations, evidence, and confidence levels accordingly.

[0300] In another exemplary inference process, the soft offset of the common-emitter amplifier bias resistor can manifest as a decrease in gain with a small change in cutoff characteristics. A five-bit binary signature may be identical to other amplitude degradation faults, but a twelve-dimensional continuous offset signature preserves differences in peak amplitude, minimum amplitude, 3 dB bandwidth, dominant frequency, and inverse discrete transform derived sequence statistics; the graph node attributes provide component identification, fault mode, and dual-signature evidence, from which the multimodal model generates soft fault categories and corresponding observations, evidence, and confidence levels.

[0301] This invention is not limited to common-emitter amplifiers and Sallen-Key filters, but is also applicable to operational amplifiers, filters, data converters, power management circuits, and other analog or mixed-signal circuits capable of obtaining amplitude-frequency and phase-frequency responses. The visual encoder, multimodal model, spectrogram storage format, continuous signature dimension, number of retrieval channels, channel weights, PageRank parameter, and low-rank adaptation parameter can all be adjusted while preserving the core relationships of bi-branch features, test spectrum mapping, candidate subgraph enhancement, and position-dependent training loss.

[0302] In scenarios where only the Bode plot is available but the original numerical response is unavailable, the frequency, amplitude, and phase sequences can be recovered through curve digitization before parameter branching is executed. In scenarios with fewer graph entries, only continuous numerical retrieval can be enabled while semantic, term, and graph traversal channels are disabled. In compatible scenarios where continuous signatures are unavailable, a five-bit binary signature-weighted Hamming retrieval can be used. These degradation methods do not alter the underlying technical principle of combining visual tokens, test knowledge, and structured diagnostics.

[0303] The above description is merely an 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 principle of this application should be included within the scope of the claims of this application.

Claims

1. A fault diagnosis method for analog circuits based on multimodal and knowledge graph approaches, characterized in that: The analog circuit fault diagnosis method is aimed at electrical measurement and fault diagnosis in the integrated circuit manufacturing, testing, and maintenance process. Specifically, the analog circuit fault diagnosis method includes the following steps: Step 1: Test Spectrum Acquisition: Acquire the amplitude frequency response sample value sequence and phase frequency response sample value sequence of the analog circuit under test within a predetermined frequency range, and generate a Bode plot based on the amplitude frequency response sample value sequence and phase frequency response sample value sequence. ; Step 2, Dual-branch feature extraction: Extract the Bode plot generated in Step 1. The representation is sequentially converted into pixel tensors and image patch representations, then mapped to a visual token matrix via a visual encoder, spatial merging operator, and projection layer. Simultaneously, spectral feature vectors are extracted from the amplitude frequency response sample value sequence and the phase frequency response sample value sequence. ; Step 3: Determination of Nominal Characteristics and Anomaly Judgment Statistical Thresholds: For the same circuit topology as the analog circuit under test, fault-free Monte Carlo simulations are performed using independent first and second random seed streams; the amplitude-frequency response sample value sequences and phase-frequency response sample value sequences obtained from each simulation are processed sequentially according to Step 1 and Step 2 to form the first set of fault-free samples and the second set of fault-free samples; based on the inclusion The first group of fault-free samples determines the fault-free nominal feature vector, based on the inclusion of... The second group of fault-free samples in the sample set determines the statistical threshold for anomaly judgment; Step 4, Dual Signature Generation: The extracted spectral feature vector from Step 2 is used to generate the dual signature. Compared with the fault-free nominal feature vector determined in step 3, a binary feature signature representing the spectrum anomaly category is generated based on the anomaly judgment statistical threshold determined in step 3, and a continuous offset signature representing the direction and degree of spectrum anomaly is generated. Step 5: Construction and Update of Test Spectrum Knowledge Graph: Based on the fault-free nominal feature vector and anomaly judgment statistical threshold obtained in Step 3, Steps 1, 2 and 4 are executed respectively for analog circuit fault samples with known fault labels to form a valid sample dataset with circuit topology identifier, coarse-grained fault category, binary feature signature and continuous offset signature; based on the valid sample dataset, class prototypes of each combination of circuit topology and fault category are calculated, and a test spectrum knowledge graph is constructed during the first processing. When there is an existing test spectrum knowledge graph, the test spectrum knowledge graph is updated according to the newly added valid samples. The test spectrum knowledge graph includes component nodes, fault nodes and test signature mapping represented by fault node attributes and relation endpoints, and the component nodes, fault nodes and test signature mapping are associated through relations. Step 6: Hybrid Retrieval and Candidate Subgraph Extraction: Based on the topology identifier of the analog circuit under test, filter the test spectrum knowledge graph constructed or updated in Step 5. Perform numerical candidate retrieval using the continuous offset signature or the binary feature signature. Merge and rearrange the candidate rankings of one or more actually activated retrieval channels, and select the top-ranked subgraph with the highest rearrangement score. Using faulty nodes as seeds, nodes are expanded along similar fault relationships and coarse-grained category relationships. The rearranged candidates are then deduplicated with the expanded nodes to form a candidate fault subgraph. It is a preset positive integer; Step 7, Multimodal Diagnostic Hint Combination: Read diagnostic instructions from the pre-established and stored diagnostic instruction template, and combine the visual token matrix. The structured context of the candidate fault subgraph in step 6 and the diagnostic instructions are combined to form a multimodal diagnostic prompt; Step 8, Multimodal Model Fine-tuning and Diagnostic Output: Using analog circuit fault training samples, position-dependent weighted focus loss, and low-rank adaptation, the parameters of the multimodal model are fine-tuned. Input the multimodal diagnostic prompts obtained in step 7 into the fine-tuned multimodal model and output a structured diagnostic report. The structured diagnostic report includes at least the fault category, spectrum observation results, judgment basis, and confidence level.

2. The analog circuit fault diagnosis method based on multimodal and knowledge graph as described in claim 1, characterized in that: In step 2, the Bode plot generated in step 1 is... Convert to RGB image and scale pixels, then normalize pixels to obtain pixel tensors. ; Pixel tensor The image is divided into non-overlapping blocks and represented by a visual encoder. Extract image patch features and perform spatial merging operator After merging, by the projection layer Mapping to the text embedding dimension of the multimodal model yields the visual token matrix. : 。 3. The analog circuit fault diagnosis method based on multimodal and knowledge graph as described in claim 2, characterized in that: In step 2, from the amplitude-frequency response sample value sequence and phase frequency response sample value sequence Extracting spectral feature vectors The spectral feature vector comprises 24-dimensional features, including peak amplitude, minimum amplitude, amplitude range, 3dB bandwidth, phase range, dominant frequency, full-band dB amplitude sum of squares statistic, mean, population standard deviation, maximum value, minimum value, and sum of squares of the inverse discrete transform derived sequence, as well as low-frequency dB amplitude sum of squares, mid-frequency dB amplitude sum of squares, high-frequency dB amplitude sum of squares, low-frequency slope, high-frequency slope, phase at peak frequency, phase slope, amplitude skewness, amplitude kurtosis, number of local peaks, peak sharpness, and the ratio of the mid-frequency band to the low- and high-frequency dB amplitude sum of squares. Specifically, it includes the following steps: Step 2.1, let Peak amplitude Minimum amplitude Amplitude range 3dB bandwidth Phase range Dominant frequency Statistical measure of the sum of squares of dB amplitude across the entire frequency band Calculate according to the following formula: in, For frequency point index, This represents the total number of frequency sampling points. A set of frequency point indices with an amplitude not less than 3dB of the peak amplitude; when 3dB bandwidth , Indicates dB amplitude The frequency index of the point where the maximum value is obtained. Indicates the dominant frequency. Indicates the lowest frequency in the sweep range. Indicates the highest frequency in the sweep range. Indicates the first Log-uniform frequency points, For the first Complex transfer function at a frequency point To output complex voltage, For input complex voltage, The dB amplitude Phase for angles: , The arctangent operation represents the operation that preserves quadrant information; Step 2.2: Set the dB amplitude Restore to linear amplitude and control phase by angle Convert to radians, then perform an inverse discrete Fourier transform to obtain the linear amplitude. : in, For the reason and Reconstructed complex spectrum samples, The imaginary unit, This represents the inverse discrete Fourier transform. Indicates taking the real part, For derived sequence index and ; Extracting the inverse discrete transform derived sequence. mean Inverse Discrete Transform Derived Sequence Overall standard deviation Inverse Discrete Transform Derived Sequence maximum value Inverse Discrete Transform Derived Sequence minimum value and inverse discrete transform derived sequence Sum of squares They are respectively: ; Step 2.3, let , and These represent the low-frequency index set, mid-frequency index set, and high-frequency index set, respectively, and the sum of squares of the dB amplitude in the low-frequency band. Mid-frequency band dB amplitude sum of squares Sum of squared dB amplitude in high-frequency band Calculate according to the following formula: For any set of frequency point indices ,make The sequence to be fitted In the The value of each frequency sampling point The sequence to be fitted In the The values ​​of each frequency sampling point are taken, and let and Each is an index set Inside and The mean of the first-order least squares fit is defined, and the slope operator is defined. : in, For a set of frequency point indices, For frequency point index set The number of frequency points included, when any frequency point index set When there are fewer than two valid points within the interior, let the corresponding slope be... =0, For low-frequency slope, For high-frequency slopes, The phase at the peak frequency, The phase slope; This is a sequence of amplitude-frequency response sample values. This is a sequence of phase frequency response sample values; Step 2.4, let Let be the average amplitude across the entire frequency band. Indicates the order of the central moment, dB amplitude sequence order central moments ,exist At that time, amplitude skewness Amplitude kurtosis Number of local peaks Peak sharpness The ratio of the sum of squares of the dB amplitude in the mid-frequency band to that in the low- and high-frequency bands Calculate according to the following formula: in, For calculating the number of local peaks The indicator function takes the value 1 if the condition is true, and 0 otherwise; when At that time, and Set to 0 or classify the sample as invalid; when the peak is located at the endpoint of the inverse discrete transform derived sequence, let .

4. The analog circuit fault diagnosis method based on multimodal and knowledge graph as described in claim 3, characterized in that: Step 3 specifically includes the following steps: Step 3.1: Execute using the first random seed stream. In each fault-free Monte Carlo simulation, the spectral response obtained from each simulation is processed sequentially according to steps 1 and 2 to obtain the first set of fault-free samples. Based on the first set of fault-free samples, the next... Fault-free nominal characteristics: in, This represents the number of fault-free samples in the first group. This is the index for the first set of fault-free samples. In the first group of fault-free samples, the first The first fault-free sample Dimensional features, This is the nominal feature vector of fault-free operation; Step 3.2: Execute using a second random seed stream that is independent of the first random seed stream. In the second fault-free Monte Carlo simulation, the spectral response obtained from each simulation is processed sequentially according to steps 1 and 2 to obtain the second set of fault-free samples. Let the second group of fault-free samples be the first group of fault-free samples. The characteristics of each sample are: relative bandwidth deviation Absolute deviation of peak amplitude and phase range deviation for: in, This indicates that the 95th percentile of the corresponding deviation statistic for the second group of fault-free samples was obtained. , and These are the statistical thresholds for anomaly detection, namely, relative bandwidth deviation, absolute peak amplitude deviation, and absolute phase range deviation. This is an index for statistical threshold types used for anomaly detection.

5. The analog circuit fault diagnosis method based on multimodal and knowledge graph as described in claim 4, characterized in that: In step 4, the binary signature is a five-bit binary signature: in, For indicator functions, binary signatures , Indicates bandwidth offset, Indicates amplitude change, Indicates phase anomaly, Indicates signal loss and It represents the fluctuation state of the sequence derived from the inverse discrete transform; The continuous offset signature The first to 12th dimensions of the 24-dimensional spectral feature vector are compared with the corresponding fault-free nominal features. The normalized offset is constituted for the first 3D features, first calculate the normalized offset , and then obtain the first 2D continuous offset : in, The spectral feature vector to be measured The Dimensional features, To determine the preset positive small quantity of the near-zero nominal value, , This indicates that four decimal places will be retained when storing the data.

6. The analog circuit fault diagnosis method based on multimodal and knowledge graph as described in claim 5, characterized in that: Step 5 specifically includes the following steps: Step 5.1: Obtain analog circuit fault samples with known fault labels; for each analog circuit fault sample, execute Step 1 to obtain the amplitude frequency response sample value sequence, phase frequency response sample value sequence, and Bode plot; execute Step 2 to obtain the visual token matrix and spectral feature vector; and execute Step 4 based on the fault-free nominal feature vector and anomaly judgment statistical threshold determined in Step 3 to generate binary feature signature and continuous offset signature, thereby forming a valid sample dataset with circuit topology identification, coarse-grained fault category, binary feature signature, and continuous offset signature; perform stratified sampling according to the coarse-grained fault category, dividing 70% of the entire valid sample dataset into a training candidate set and 30% into a test set; randomly shuffle the training candidate set, and divide 10% of the training candidate set into a validation set; the remaining 90% of the training candidate set is used as the final training set, so that the final training set, validation set, and test set account for approximately 63%, 7%, and 30% of the entire valid sample dataset, respectively; For each combination of circuit topology and fault category in the final training set, calculate the continuous offset signature class center of that combination. And select the signature class center with continuous offset. The training sample with the smallest Euclidean distance is used as the center sample or class prototype. : in, This indicates a combination of circuit topology and fault category. This represents the set of sample indices in the final training set representing the combination of circuit topology and fault category. , Indicates the first The continuous offset signature of each training sample is used to determine the representative signature of the fault category by combining the binary feature signature of the central sample or class prototype with the continuous offset signature. Step 5.2: Establish a fault node and write the circuit topology identifier, component identifier, fault mode, coarse-grained fault category, fault description, binary feature signature, and continuous offset signature into the attributes of the fault node; Step 5.3: Establish a component node for each component identifier, establish a fault relationship between the component node and the corresponding fault node, write the representative signature into the corresponding fault node to form a test signature mapping, and record the association between the fault node and the test signature mapping based on the spectrum deviation relationship caused by the fault. Step 5.4: Generate similar fault relationships between fault nodes corresponding to different fault modes of the same component, and generate coarse-grained category relationships between fault nodes in the same circuit topology and belonging to the same coarse-grained fault category.

7. The analog circuit fault diagnosis method based on multimodal and knowledge graph as described in claim 6, characterized in that: Step 6 specifically includes the following steps: Step 6.1: First, use the topology identifier of the circuit under test to filter out fault nodes that do not belong to the circuit under test. Assume that there are a total of [number missing] fault nodes after filtering. The faulty node with a valid continuous offset signature, the first The consecutive offset signatures of the candidate fault nodes are as follows: Calculate the mean of the continuous offset in each dimension of the map. and population standard deviation : in, For querying the continuous offset signature of the analog circuit under test, These are respectively querying consecutive offset signatures and the first The first consecutive offset signature of the candidate fault node dimensional components, The first in the atlas Mean and population standard deviation of continuous offset; These are the standardized query component and candidate component, respectively; For querying and the Euclidean distance between candidate faulty nodes Numerical similarity; This represents the number of candidate faulty nodes with valid consecutive offset signatures after filtering. Index of candidate faulty nodes. Dimension index for consecutive offset signatures, To prevent a stability constant with a standard deviation of zero; the numerical channels are configured according to... From childhood to adulthood or by Arrange the candidates from largest to smallest; Step 6.2: When consecutive offset signatures are unavailable, use the following five-bit binary signature weighted Hamming distance as the fallback path: in, For the first The first query binary signature Bit, For the first The first candidate binary signature Bit, For the first The non-negative weight of the bit and ; Step 6.3: Based on the binary feature signature and continuous offset signature obtained in Step 4, automatically generate a query anomaly description without component identifiers, fault modes, and actual fault labels using a preset text template. This anomaly description summarizes the anomaly type, direction, and degree of the spectrum under test. When the automatic anomaly description is available, activate the semantic vector cosine retrieval channel and the term statistical cosine retrieval channel, and combine the query anomaly description with the first term in the test spectrum knowledge graph. Each candidate fault description is input into the same semantic encoder to obtain a semantic vector of the query anomaly description. and the Semantic vectors describing candidate faults The similarity obtained by semantic vector cosine similarity retrieval is: The term statistical cosine retrieval channel uses unary and bigram terms to establish TF-IDF weights for the query anomaly description and fault description sets. Cosine similarity of terms They are respectively: in, To set the total number of fault description documents, For terms In the document word frequency in For included terms The number of documents, To prevent the default non-negative small quantity in zero-norm division, for TF-IDF weights, for TF-IDF weights; Step 6.4: The semantic vector obtained in Step 6.3 and TF-IDF weights The resulting vectors undergo L2 normalization before retrieval. The normalized cosine similarity is obtained from the vector dot product. If automatic anomaly description is unavailable, the semantic vector cosine retrieval channel and the term statistical cosine retrieval channel are disabled, leaving only the numerical channel. Each enabled channel generates candidate rankings, which are then weighted and merged using a reciprocal sorting method. in, To return candidates The set of enabled search channels as a candidate In the passage The rankings starting from 1 in the middle. It is a positive smoothing constant. For channel non-negative weights and No candidate returned The channel does not generate scoring items; Step 6.5: Calculate the comprehensive re-ranking score for the top twenty candidates after fusion: Take the overall rearrangement score The highest front Each faulty node is used as a seed set. , Let be a positive integer, and let the fault relationship subgraph consist of nodes. Pointing to node The edge weight is Then the transition matrix and seed personalized vector for: For nodes with no outgoing edges, the transition probability of nodes with no outgoing edges is determined according to a personalized vector. The assignment is iterative on the directed graph of fault nodes, which consists of similar fault relationships and coarse-grained category relationships. until Or reach the maximum number of iterations, where, The convergence threshold, The damping coefficient is selected after excluding seed nodes. One extended fault node; Step 6.6: Remove duplicates from the rearranged candidates and expanded nodes to form a candidate fault subgraph containing fault name, component identifier, fault mode, signature, description, score and association relationship.

8. The analog circuit fault diagnosis method based on multimodal and knowledge graph as described in claim 7, characterized in that: In step 8, the multimodal model employs a position-dependent weighted focus loss during fine-tuning, assigning different loss weights to the classification tokens and inference tokens in the structured diagnostic report. This specifically includes the following steps: Step 8.1: For the target structured diagnostic report in the training samples, the first one that belongs to the classification token or reasoning token... One valid target token, based on the true vocabulary category of the valid target token. Calculate labeled smooth cross-entropy loss : in, The label smoothing coefficient. For the first The true category of a valid token, For multimodal models of vocabulary items Predicted probability: in, For the first A multimodal model of a single location for vocabulary items The output logit, For vocabulary size; Step 8.2, let Indicates the multimodal model for the 1st... Determine the confidence level of each real target token and calculate the focus loss. And calculate the total loss. : in, The total number of valid target token positions used in loss calculation within the target structured diagnostic report. For difficult sample focusing parameters, the first The position-related weight of each valid target token for Among them, let Let be the set of mask positions for hints, padding, and visual placeholders that do not participate in loss calculation, and let be the set of target token positions corresponding to the fault category field. This refers to the set of target token locations corresponding to the spectrum observation, judgment criteria, and confidence level fields, and... , 𝒞 and They do not overlap. For fault category token weights, For inference token weight, and 0.

9. The analog circuit fault diagnosis method based on multimodal and knowledge graph as described in claim 1, characterized in that: In step 8, the multimodal model uses low-rank adaptation for parameter fine-tuning; for the basic weight matrix of the linear layer to be adapted... ,freeze Only the reduced-dimensional low-rank matrix and the increased-dimensional low-rank matrix are trained, and the low-rank weights are updated. and the updated weight matrix for: in, It is a positive scaling factor. The rank of the low-rank fitting matrix and satisfying , , , For a dimension-reduced low-rank matrix, For a low-rank matrix of increased dimension, and These are the input and output dimensions of the linear layers to be adapted, respectively. The linear layers to be adapted include query, key, value, and output attention projection layers, as well as gating, dimension-up, and dimension-down feedforward projection layers.

10. A system for implementing the analog circuit fault diagnosis method based on multimodal and knowledge graph as described in any one of claims 1-9, characterized in that: Analog circuit fault diagnosis system includes: The test spectrum acquisition module is used to acquire the amplitude frequency response sample value sequence and the phase frequency response sample value sequence of the analog circuit under test and generate a Bode plot; The dual-branch feature module is used to map the Bode plot into a visual token matrix through image patching, visual encoding, spatial merging operators, and projection layers. And obtain the spectral feature vector from the amplitude frequency response sample value sequence and the phase frequency response sample value sequence; The dual signature generation module is used to perform fault-free Monte Carlo simulation for the same circuit topology using independent first and second random seed streams. It determines the fault-free nominal feature vector based on the first set of fault-free samples, determines the anomaly judgment statistical threshold based on the second set of fault-free samples, and generates binary feature signature and continuous offset signature. The graph construction and storage module is used to calculate the continuous offset signature class center for each combination of circuit topology and fault category, select the center sample with the smallest Euclidean distance to the continuous offset signature class center as the class prototype sample, determine the binary feature signature and continuous offset signature of the class prototype sample as the representative signature, and establish the component node, fault node, test signature mapping, and the relationship between the component having a fault, the fault causing spectral deviation, similar faults, and the same coarse-grained category. The hybrid retrieval and subgraph expansion module is used to perform circuit topology filtering, numerical candidate retrieval, optional semantic vector cosine retrieval and term statistical cosine retrieval, inverse sorting fusion, candidate reordering, and node expansion based on similar fault relationships and coarse-grained category relationships; and to remove duplicates between reordered candidates and expanded nodes to form a candidate fault subgraph; The prompt fusion module is used to read diagnostic instructions from a pre-established and stored diagnostic instruction template, and combine the visual token matrix, the structured context of the candidate fault subgraph, and the diagnostic instructions into a multimodal diagnostic prompt; The model training module is used to efficiently fine-tune the parameters of multimodal models using position-dependent weighted focus loss and low-rank adaptation. The diagnostic report generation module is used to input the multimodal diagnostic prompts into the fine-tuned multimodal model and output a structured diagnostic report.