Software defect information fusion method and system based on multi-source data

By constructing code dependency graphs and state evolution graphs, and combining them with user feedback text, a cross-modal defect feature set is generated, which solves the problems of the surge in model parameters and heterogeneous data alignment in multi-source data defect analysis, and achieves efficient and accurate positioning and dynamic repair of cross-platform software defects.

CN120632770AActive Publication Date: 2025-09-12BEIJING ZHONGKE CHANGFENG TECHNOLOGY CO LTD

Patent Information

Application Number
CN202510711073.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-29
Publication Date
2025-09-12
Estimated Expiration
2045-05-29

AI Technical Summary

Technical Problem

Existing technologies in multi-source data defect analysis have problems such as a surge in model parameters, a huge space of hyperparameter combinations, strong dependence on labeled data, difficulty in real-time adaptation to new data sources or code architecture changes during software development, difficulty in deep alignment of heterogeneous data, and susceptibility of attention mechanisms to noise interference, resulting in low efficiency and poor accuracy in defect information fusion.

Method used

By constructing code dependency graphs, state evolution graphs and user feedback texts, a cross-modal defect feature set is generated. Combining structural weight coefficients and semantic conflict feature vectors, multi-dimensional data fusion is performed to generate a cross-modal defect feature set, and dynamic repairs are performed based on the defect location probability distribution.

Benefits of technology

It achieves efficient and accurate positioning and dynamic repair of cross-platform software defects, improves defect positioning accuracy and repair reliability, and solves the problems of data fragmentation, collaborative deviation and computational redundancy in existing technologies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120632770A_ABST
    Figure CN120632770A_ABST
Patent Text Reader

Abstract

The invention provides a software defect information fusion method and system based on multi-source data. The method comprises the following steps: acquiring static code characteristics, a runtime log sequence and user feedback from cross-platform software; constructing a code dependency graph based on static code features and a historical defect library, defining a log structure through code logic association, and performing space-time alignment with defect trigger nodes fed back by a user to generate a context matrix; synchronously acquiring physical parameters of hardware nodes, and dynamically coupling the physical parameters with the matrix to generate a state evolution graph; fusing the code dependency graph, the state evolution graph and user feedback, and extracting cross-modal defect features; and generating defect positioning probability distribution based on the features, and determining a repair scheme by combining physical parameter anomaly analysis. Through integration of codes, operation states and user feedback, accurate positioning and dynamic repair of defects are realized. According to the technical scheme provided by the invention, the precision and reliability of software defect information fusion can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of software defect information fusion, and in particular to a software defect information fusion method and system based on multi-source data. Background Art

[0002] With the exponential growth in the complexity of software systems, defect detection and prediction face multi-dimensional challenges. Modern software engineering involves multi-source heterogeneous information such as code bases, test logs, user behavior data, and static analysis results. Traditional methods based on a single data source are difficult to fully capture the correlation and dynamic evolution of potential defects. For example, in large-scale distributed systems, code changes, runtime exception logs, test coverage data, and user feedback may each contain defect clues of different dimensions. There is an urgent need for an analysis method that integrates multi-source data to achieve accurate defect location, root cause tracing, and risk prediction. In addition, real-time requirements require that the fusion method have the ability to efficiently process massive amounts of heterogeneous data, while also addressing issues such as data noise, semantic conflicts, and feature redundancy.

[0003] The current mainstream approach for defect analysis using multi-source data is a multimodal fusion model based on deep learning. This approach constructs a hierarchical feature extraction network to process different data sources separately, then uses an attention mechanism or graph neural network to fuse cross-modal features. For example, a pre-trained language model is used to extract code semantic features, combined with a convolutional neural network to process log sequence data. Finally, a graph neural network is used to model the correlation between code structure and execution path, forming a comprehensive defect prediction indicator. In some scenarios, this approach has achieved higher accuracy and recall than traditional single-source models.

[0004] Although deep learning models have shown potential in multi-source fusion, they still face significant bottlenecks. Multimodal networks require the design of dedicated submodules for different data sources, resulting in a surge in the number of model parameters and a huge space for hyperparameter combinations. Tuning relies on large amounts of annotated data and computing resources. Deep alignment of heterogeneous data, such as the abstract semantics of code text and log time series features, is difficult to achieve. The attention mechanism is susceptible to noise interference, which limits the representational ability of fused features. Existing models are mostly based on offline training, making it difficult to adapt in real time to new data sources or code architecture changes during software development. Furthermore, their strong dependence on annotated data restricts their application in scenarios with sparse annotations. These shortcomings demonstrate the urgent need for a multi-source data fusion method that balances efficiency, robustness, and adaptability to overcome the limitations of existing deep learning solutions. Summary of the Invention

[0005] The present application provides a software defect information fusion method and system based on multi-source data, which is used to solve the problems of low efficiency and poor accuracy of software defect information fusion in the prior art.

[0006] In a first aspect, the present application provides a method for fusing software defect information based on multi-source data, comprising:

[0007] Acquire multi-source heterogeneous data in a cross-platform software runtime environment, wherein the multi-source heterogeneous data includes static code features, runtime log time series, and user feedback text;

[0008] A code dependency graph is constructed based on the association between the static code features and the historical defect library. A runtime log time series sequence is defined using the logical association between code entities in the code dependency graph. The runtime log time series sequence is spatially and temporally aligned with the software defect triggering nodes in the user feedback text to generate a context association matrix.

[0009] Synchronously collecting physical state parameters of distributed hardware nodes in the software, and dynamically coupling the physical state parameters with the context association matrix to generate a state evolution graph;

[0010] Generate a cross-modal defect feature set by fusing the code dependency graph, the state evolution graph, and the user feedback text;

[0011] A defect location probability distribution is generated based on the cross-modal defect feature set, and the abnormal segmentation result of the physical state parameter is analyzed through the defect location probability distribution to determine the dynamic repair result of the cross-platform software defect information.

[0012] Optionally, the generating of a cross-modal defect feature set by fusing the code dependency graph, the state evolution graph, and the user feedback text includes:

[0013] Extracting the structural connection relationship between each code in the code dependency graph, and generating a structural weight coefficient according to the call depth and dependency strength of the code;

[0014] Analyzing the periodic fluctuation pattern of the hardware resource consumption data in the state evolution graph, and identifying the abnormal physical state interval associated with the software running stage according to the periodic fluctuation pattern;

[0015] Matching the natural language description in the user feedback text with the identifier of the code, and generating a semantic conflict feature vector based on the difference between the natural language description and the identifier in the matching result;

[0016] Adjusting the amplitude range of the abnormal physical state interval based on the structural weight coefficient, and splicing the adjusted abnormal physical state interval with the semantic conflict feature vector to generate a multi-dimensional fusion feature;

[0017] Topological constraints are performed on the multi-dimensional fusion features according to the structural connection relationship, and a cross-modal defect feature set is output.

[0018] Optionally, adjusting the amplitude range of the abnormal physical state interval based on the structural weight coefficient, and concatenating the adjusted abnormal physical state interval with the semantic conflict feature vector to generate a multi-dimensional fusion feature includes:

[0019] According to the calling depth of the code, the structural weight coefficient is converted into the adjustment coefficient of the abnormal physical state interval according to the layer-by-layer decreasing rule;

[0020] Proportionally adjusting the numerical range of the abnormal physical state interval based on the adjustment coefficient to obtain an adjusted abnormal physical state interval;

[0021] Connecting the adjusted physical state abnormality interval and the semantic conflict feature vector in a preset order to generate multidimensional data, wherein the dimension ratio of the multidimensional data is dynamically allocated according to the structural connection relationship between the codes;

[0022] Nonlinear conversion encoding is performed on the multidimensional data to generate multidimensional fusion features with a unified quantization range.

[0023] Optionally, the step of connecting the adjusted abnormal physical state interval with the semantic conflict feature vector in a preset order to generate multidimensional data, wherein the dimension ratio of the multidimensional data is dynamically allocated according to the structural connection relationship between the codes, includes:

[0024] Setting a segmentation rule according to the call depth of the code, dividing the value in the adjusted physical state abnormality interval into a plurality of continuous value segments according to the segmentation rule, and splitting the value of the semantic conflict feature vector into a plurality of feature groups according to the segmentation rule;

[0025] According to the number of directly associated nodes in the structural connection relationship between the codes, a connection ratio between the continuous numerical segments and the feature groups is dynamically allocated, and the continuous numerical segments and the feature groups are alternately arranged according to the connection ratio to generate multidimensional data.

[0026] Optionally, generating a defect location probability distribution based on the cross-modal defect feature set, and analyzing the abnormal segmentation result of the physical state parameter by using the defect location probability distribution to determine the dynamic repair result of the cross-platform software defect information includes:

[0027] According to the feature vector distribution of each code in the cross-modal defect feature set, the defect location probability distribution of the code level propagation path is calculated;

[0028] Performing regional overlap matching on the defect location probability distribution and the abnormal segmentation result of the physical state parameter, and screening target code regions whose regional overlap exceeds a preset threshold;

[0029] Based on the upstream and downstream call chains of the target code area in the code dependency graph, patch code snippets compatible with the upstream and downstream call chains are selected from a preset repair strategy library, and dynamic repair results are output according to the injection order and version constraints of the patch code snippets.

[0030] Optionally, selecting a patch code snippet compatible with the upstream and downstream call chains of the target code region in the code dependency graph from a preset repair strategy library includes:

[0031] Extracting the execution order and interface parameter definitions of the upstream and downstream call chains of the target code region in the code dependency graph, matching the injection positions of each patch in a preset repair strategy library to screen candidate patches that cover the upstream and downstream call chains;

[0032] Verifying the correspondence between the response parameters of the candidate patch and the interface parameter definition, and screening the version adaptation patch compatible with the current version based on the historical version evolution record in the code dependency graph;

[0033] Analyze the conflict relationship between the operating environment dependencies of the version adaptation patch and the current software environment, eliminate the version adaptation patches with conflicts, and sort the remaining version adaptation patches to generate patch code snippets.

[0034] Optionally, the synchronously collecting physical state parameters of distributed hardware nodes in the software and dynamically coupling the physical state parameters with the context association matrix to generate a state evolution graph includes:

[0035] By collecting physical state parameters of distributed hardware nodes in the software, the physical state parameters include a time series data stream of CPU occupancy rate, storage resource allocation status and power supply voltage fluctuation value;

[0036] Segmenting the time series data stream into physical state segments according to a sampling time window, parsing the code execution path based on the runtime log time series sequence, inputting the physical state segments and the code execution path into the context association matrix for multi-dimensional encoding, and generating a joint feature vector;

[0037] A state evolution graph is constructed based on the correlation strength between the code execution path and the physical state fragment in the joint feature vector.

[0038] In a second aspect, the present application provides a software defect information fusion system based on multi-source data, comprising:

[0039] An acquisition module is used to acquire multi-source heterogeneous data in a cross-platform software running environment, wherein the multi-source heterogeneous data includes static code features, runtime log time series, and user feedback text;

[0040] A generation module constructs a code dependency graph based on the association between the static code features and the historical defect library, defines a runtime log time series sequence using the logical association between code entities in the code dependency graph, and performs spatiotemporal alignment of the runtime log time series sequence with the software defect triggering nodes in the user feedback text to generate a context association matrix;

[0041] An acquisition module synchronously acquires physical state parameters of distributed hardware nodes in the software, and dynamically couples the physical state parameters with the context association matrix to generate a state evolution graph;

[0042] A fusion module generates a cross-modal defect feature set by fusing the code dependency graph, the state evolution graph, and the user feedback text;

[0043] A determination module generates a defect location probability distribution based on the cross-modal defect feature set, analyzes the abnormal segmentation results of the physical state parameters through the defect location probability distribution, and determines the dynamic repair results of the cross-platform software defect information.

[0044] In a third aspect, an embodiment of the present application provides a computing device comprising a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement a software defect information fusion method based on multi-source data as described in the first aspect above.

[0045] In a fourth aspect, an embodiment of the present application provides a computer storage medium storing a computer program. When the computer program is executed by a computer, it implements a software defect information fusion method based on multi-source data as described in the first aspect.

[0046] In an embodiment of the present application, multi-source heterogeneous data in a cross-platform software running environment is obtained, and the multi-source heterogeneous data includes static code features, runtime log time series sequences, and user feedback text; a code dependency graph is constructed based on the association relationship between the static code features and the historical defect library, and a runtime log time series sequence is defined using the logical association relationship between code entities in the code dependency graph, and the runtime log time series sequence is aligned with the software defect triggering nodes in the user feedback text in time and space to generate a context association matrix; the physical state parameters of distributed hardware nodes in the software are synchronously collected, and the physical state parameters are dynamically coupled with the context association matrix to generate a state evolution graph; a cross-modal defect feature set is generated by fusing the code dependency graph, the state evolution graph, and the user feedback text; a defect location probability distribution is generated based on the cross-modal defect feature set, and the abnormal segmentation result of the physical state parameters is analyzed through the defect location probability distribution to determine the dynamic repair result of the cross-platform software defect information.

[0047] The technical solution of this application has the following beneficial effects:

[0048] This application provides a multi-dimensional data foundation for cross-platform defect analysis by integrating static code features, runtime log time series and user feedback text, covering the three key dimensions of code logic, runtime behavior and user perception. Based on the correlation between static code features and historical defect libraries, a code dependency graph is generated to reveal the calling paths and defect propagation rules between modules, providing structural constraints for the analysis of log time series. By aligning the time and space of the runtime log time series sequence with the defect triggering nodes in the user feedback text, an association mapping between the code execution path and the user operation scenario is established to solve the problem of cross-modal data time series misalignment. Real-time monitoring of hardware resource consumption and environmental parameters, combined with the context association matrix to generate a state evolution map, and capture the coupling anomalies between the physical environment and software behavior. The features of the code dependency graph, state evolution map and user feedback text are integrated to construct a unified feature space that characterizes the defect propagation path, hardware coupling anomalies and semantic conflicts. The defect propagation probability is quantified based on the cross-modal feature set, and the target code area is screened in combination with the physical state anomaly segmentation results, and accurate dynamic repair is achieved through version compatibility patch injection.

[0049] Furthermore, the structural connection relationships between modules in the code dependency graph are extracted to generate structural weight coefficients. The periodic fluctuation patterns of hardware resource consumption in the state evolution graph are analyzed to identify physical anomaly intervals. User feedback text is matched with code identifiers to generate semantic conflict feature vectors. The physical anomaly amplitude is adjusted based on the structural weights and combined with the semantic features. Finally, a cross-modal defect feature set is generated through topological constraints. By dynamically correcting physical anomaly parameters through structural weights, accurately aligning semantic conflict features with code logic, and integrating topological constraints with multimodal data, the system addresses the problems of missing hardware environment parameters, semantic association faults, and lagging repair strategies in existing technologies, significantly improving the accuracy of cross-platform defect location and the reliability of repairs.

[0050] These and other aspects of the present application will become more readily apparent from the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0052] Figure 1 A flowchart of a software defect information fusion method based on multi-source data provided by the present application is shown;

[0053] Figure 2 A schematic diagram of the structure of a software defect information fusion system based on multi-source data provided by the present application is shown;

[0054] Figure 3 A schematic structural diagram of a computing device provided by the present application is shown. DETAILED DESCRIPTION

[0055] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0056] In some of the processes described in the specification and claims of this application and the above-mentioned figures, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this document or may be executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any order of execution. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to being different types.

[0057] The technical solution of this application aims to solve the problem of cross-platform software defect location and proposes a dynamic analysis method for multi-source data fusion. It builds a code dependency graph based on the historical defect library and uses code entity logic to define the log time series structure; uses natural language processing technology to analyze the defect triggering scenarios in user feedback, aligns them with log timestamps and code nodes in time and space, and generates a unified context association matrix that represents multi-source data; synchronously collects hardware parameters, dynamically couples them to the association matrix in combination with time series fluctuation analysis, and constructs a state evolution map; integrates code graphs, evolution maps and user feedback to extract cross-modal features, and dynamically generates repair solutions through probability distribution modeling and anomaly segmentation analysis to solve the problems of data fragmentation, collaborative deviation and computational redundancy in existing technologies, and achieve efficient and accurate defect location and repair.

[0058] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.

[0059] Figure 1 The present invention provides a flowchart of a method for fusion of software defect information based on multi-source data. Figure 1 As shown, the method includes:

[0060] 101. Acquire multi-source heterogeneous data in a cross-platform software running environment, wherein the multi-source heterogeneous data includes static code features, runtime log time series, and user feedback text;

[0061] In this step, static code features refer to structured data including control flow graphs, function call relationships, code complexity, etc., which are used to describe the code logical structure and inter-module dependencies.

[0062] The runtime log time series is a stream of software running events recorded by timestamp, including dynamic behavior data such as thread status, exception events, and resource usage.

[0063] User feedback text is the defect description text submitted by the user through the interface, including the operation scenario and abnormal phenomena.

[0064] In an embodiment of the present application, static code features parse the source code through a static code analysis tool to extract the abstract syntax tree, control flow graph and dependencies of the code, such as using an algorithm based on syntax parsing to identify the function call chain. The runtime log time series sequence is captured in real time by the log collection framework, sorted by timestamp and associated with context information, such as collecting abnormal events of the distributed system through the log collection and analysis platform. The user feedback text needs to be cleaned and annotated by natural language processing technology, such as using a pre-trained language model to perform entity recognition and sentiment analysis on the text, and extract keywords and scenario descriptions related to the defect. Finally, the three types of data are uniformly stored as multi-source heterogeneous data to ensure that timestamps, code entities and user descriptions can be cross-indexed.

[0065] In smart home control systems, static code analysis tools parse the core module code, extracting the call chain and dependencies of the "Device Status Synchronization" method. The runtime log collection module records events such as gateway node network delays and device response timeouts in real time, generating a time-stamped log sequence. Semantic analysis of user feedback, such as "bedroom lights cannot be turned off remotely" and "air conditioner status update delay," extracts keywords like "delay" and "no response," and correlates them with the abnormal time periods in the logs. The integration of these three types of data creates a multi-source dataset encompassing code structure, runtime anomalies, and user pain points.

[0066] 102. Construct a code dependency graph based on the association between the static code features and the historical defect library, define a runtime log time series sequence using the logical association between code entities in the code dependency graph, perform spatiotemporal alignment between the runtime log time series sequence and the software defect triggering nodes in the user feedback text, and generate a context association matrix;

[0067] In this step, the code dependency graph is a directed graph with code modules as nodes and call relationships as edges, marking the dependency strength between modules.

[0068] The runtime log timing sequence definition is based on the module call path in the code dependency graph, mapping log events to corresponding code nodes.

[0069] Spatiotemporal alignment matches the log event timestamps with the time windows of the defect-triggering operations in user feedback, correlating code execution with user behavior.

[0070] In an embodiment of the present application, a code dependency graph is constructed based on static code features, using a graph database to store classes, methods, and their calling relationships, and combining with a historical defect library to mark high-risk nodes (such as functions that have had memory leaks). The runtime log time series is divided into multiple segments according to the time window, and the dynamic time warping algorithm is used to align them with the defect time points mentioned in the user feedback, such as matching the "payment timeout" feedback with the database connection timeout event in the log. The context association matrix integrates the logical relationships in the code dependency graph, the time distribution of log events, and the semantic features of user feedback through tensor decomposition technology to generate a three-dimensional matrix. Each element in the matrix represents the strength of association between a specific code entity and the user-described defect within a certain time window.

[0071] The code dependency graph shows that the "Device Status Synchronization" method calls the "Gateway Communication Protocol Parsing" and "Device Command Issuance" submodules, and the historical defect database has recorded a "Protocol Parsing Timeout" issue. During the time period when the user reported that the "bedroom light could not be turned off," logs showed frequent "Gateway Communication Delay Exceeds Threshold" events. Using a dynamic time warping algorithm to align logs with feedback time points, it was discovered that the delay events coincided with the execution time of the "Protocol Parsing" submodule. In the generated contextual association matrix, the "Protocol Parsing" module had the highest correlation strength with the user feedback, indicating that it was the likely root cause of the defect.

[0072] 103. Synchronously collect physical state parameters of distributed hardware nodes in the software, and dynamically couple the physical state parameters with the context association matrix to generate a state evolution graph;

[0073] In this step, the physical status parameters are hardware indicators such as CPU usage, memory allocation status, server temperature, and power supply voltage fluctuation value.

[0074] Dynamic coupling combines physical parameter time series data with the code-log-user association matrix to analyze the correlation pattern between hardware status and software behavior.

[0075] The state evolution map is a dynamic topological map generated by fusing physical parameters and context association matrix, revealing the correlation between hardware status and software defects.

[0076] In an embodiment of the present application, physical state parameters are collected through a distributed monitoring tool, and the CPU utilization of the server node is collected and normalized into a percentage value. The dynamic coupling process uses a temporal convolutional network to analyze the temporal correlation between physical parameters and the context association matrix, and detects whether the CPU utilization peak coincides with the execution time of the high-load method in the code dependency graph. The state evolution map is constructed based on a graph neural network. The nodes represent hardware or code entities, and the edge weights represent the intensity of the state impact. If a server memory leak causes slow code execution, a high-weight edge from the server node to the relevant code entity will be generated in the map.

[0077] Monitoring revealed that the network latency of a particular gateway node fluctuated dramatically during the period of user feedback, with high CPU utilization peaks. Temporal convolutional network analysis revealed that the latency peaks completely overlapped with the execution time of the "Protocol Parser" module, which also consumed significant CPU resources during operation. In the state evolution graph, the edge weight between the gateway node and the "Protocol Parser" module increased significantly, and the user-reported "latency" issues were correlated with this, indicating that insufficient hardware resources and code logic flaws were jointly contributing to the problem.

[0078] 104. Generate a cross-modal defect feature set by fusing the code dependency graph, the state evolution graph, and the user feedback text;

[0079] In this step, the state evolution map is a dynamic topology map generated by fusing physical parameters and context association matrix, which reveals the correlation between hardware status and software defects.

[0080] The cross-modal defect feature set is a unified feature set that integrates code structure, hardware status, and user semantics. It includes the embedding vector of the code dependency graph, the topological indicators of the state evolution graph, and the semantic vector of user feedback.

[0081] In this embodiment, the code modality feature converts the code dependency graph into a low-dimensional vector using a graph embedding algorithm; the state modality feature extracts metrics such as node degree centrality and clustering coefficient from the state evolution graph; and the user feedback modality feature generates text semantic vectors using a pre-trained language model. The cross-modal defect feature fusion stage uses a multi-head attention mechanism to dynamically weight the importance of different modalities and eliminates redundant information through adversarial training.

[0082] The embedding vectors of the "Protocol Parsing" module in the code dependency graph indicate excessive code complexity. The state evolution graph reveals that the gateway node has the highest degree centrality in the entire system. The semantic vectors of user feedback highlight the keywords "latency" and "protocol." Weighted by the attention mechanism, the cross-modal feature set indicates that excessive gateway load causes the "Protocol Parsing" module to execute excessively long tasks. Furthermore, the module itself contains redundant loop logic, necessitating optimization of both code and hardware configuration.

[0083] 105. Generate a defect location probability distribution based on the cross-modal defect feature set, analyze the abnormal segmentation result of the physical state parameter through the defect location probability distribution, and determine a dynamic repair result of the cross-platform software defect information.

[0084] In this step, the defect location probability distribution is to quantify the defect propagation probability of each code module and screen the target module in combination with the physical abnormal area.

[0085] Abnormal segmentation divides the abnormal areas of physical state parameters through clustering algorithm.

[0086] The dynamic repair result is to select a compatibility patch based on the dependency chain of the target module and inject the repair code according to the version constraint.

[0087] In this embodiment, a Bayesian network is used to calculate the probability distribution of defect location, combining code complexity, historical defect rates, and current hardware status to predict defect probability. Anomaly segmentation uses a density clustering algorithm to identify outliers in physical parameters and generate anomaly segmentation results. The dynamic repair result decision module selects strategies such as code patch generation, dynamic resource scheduling, or traffic degradation based on the probability distribution and anomaly segmentation results.

[0088] Cross-modal feature sets indicated an excessively high probability of a defect in the "Protocol Parsing" module. Anomaly segmentation revealed that both gateway node network latency and CPU utilization exceeded normal thresholds. The system automatically triggered a remediation process: some device command delivery tasks were migrated to a lower-loaded backup gateway; a patch generation tool was used to streamline the loop logic in the "Protocol Parsing" module; the code was updated through a grayscale release, and latency and CPU utilization were monitored in real time. Following the remediation, gateway latency was reduced, user-reported issues resolved, and other device functions were not impacted.

[0089] In summary, using a smart home control system as an example, steps 101 to 105 integrate code, logs, user feedback, and hardware status data to precisely locate the coupling between a code defect in the "protocol parsing" module and a gateway resource bottleneck. The remediation strategy simultaneously optimizes code logic and hardware load distribution, improving system responsiveness and reducing user complaints. Its core value lies in breaking the limitations of a single data source, pinpointing the root cause of complex defects through cross-modal analysis, and enabling automated closed-loop remediation, significantly improving the reliability and operational efficiency of cross-platform software.

[0090] In order to solve the accuracy and scenario adaptability problems of cross-modal defect feature extraction in software systems, the structural weight coefficient of the code dependency graph is extracted through static code analysis, and the periodic abnormal interval of hardware resources is identified by combining the time series clustering algorithm. The user feedback text and code identifier are matched using natural language processing technology to generate a semantic conflict feature vector. Finally, the three types of features are fused through a dynamic weighting mechanism to achieve the generation of a cross-modal defect feature set under topological constraints. In some embodiments, the cross-modal defect feature set is generated by fusing the code dependency graph, the state evolution graph and the user feedback text as described in step 104, including:

[0091] 201. Extracting the structural connection relationship between each code in the code dependency graph, and generating a structural weight coefficient according to the call depth and dependency strength of the code;

[0092] In step 201, structural connectivity refers to logical connections between functions, classes, or modules in the code dependency graph, such as calls, inheritance, and parameter transfer, including direct and indirect dependencies. Call depth refers to the number of nested levels of the code hierarchy. Dependency strength reflects the closeness of dependencies between code entities and is quantified by metrics such as call frequency and parameter transfer complexity.

[0093] In an embodiment of the present application, a static code analysis tool is used to extract the call chain and dependency path of the code. First, a breadth-first search is used to traverse the code dependency graph and record the call level of each node; secondly, the call frequency between modules is counted in combination with the dynamic execution log, and the logic branch complexity is evaluated by the cyclomatic complexity to quantify the dependency strength. Finally, a linear weighted model is used to fuse the call depth and dependency strength to generate a structural weight coefficient matrix. For example, the communication module has a significantly higher weight coefficient than other modules because of its high-frequency calls and multi-thread synchronization.

[0094] 202. Analyze the periodic fluctuation pattern of the hardware resource consumption data in the state evolution graph, and identify the abnormal physical state interval associated with the software running stage based on the periodic fluctuation pattern;

[0095] In step 202, a periodic fluctuation pattern is a regular change in hardware resource consumption over time, such as a daily peak load period or a task scheduling cycle. An abnormal physical state interval is a period of time when resource consumption deviates from the normal fluctuation range, such as a sustained high usage caused by a memory leak.

[0096] In an embodiment of the present application, the periodic fluctuation patterns of memory and processor consumption data during system operation are collected, and a time series decomposition algorithm is used to separate long-term trends from short-term fluctuations. A sliding window statistical method is used to calculate the mean and standard deviation of the data within the window, and anomalies are identified by combining threshold determination. Adjacent anomalies are further merged through morphological filtering to form a continuous physical state abnormality interval. For example, if a network communication interruption causes the processor load to continuously exceed the standard during peak hours, the system will mark it as a physical state abnormality interval and associate it with the call abnormality of the communication module.

[0097] 203. Match the natural language description in the user feedback text with the identifier of the code, and generate a semantic conflict feature vector based on the difference between the natural language description and the identifier in the matching result;

[0098] In step 203, the natural language description is the phrase in the user feedback text that describes the defect phenomenon, such as "voice control response delay." The code identifier is the name of the module, function, or variable in the code. The semantic conflict feature vector is a numerical representation that quantifies the difference between the user description and the code function, such as the deviation between the delay description and the expected performance of the response function.

[0099] In an embodiment of the present application, a pre-trained natural language model is used to semantically encode the identifiers of user text and code comments, and the similarity between keywords and code functions is calculated. The action and object relationship in the user description is extracted through dependency syntax analysis and compared with the code logic branch. If the timeout retry or abnormal state processing is not implemented in the code, a high-dimensional semantic conflict feature vector is generated. For example, the user feedback "night mode failure" is mapped to the logic of unhandled network disconnection in the code, and the value of the "missing exception handling" dimension in the semantic conflict feature vector is significantly high.

[0100] 204. Adjust the amplitude range of the abnormal physical state interval based on the structural weight coefficient, and concatenate the adjusted abnormal physical state interval with the semantic conflict feature vector to generate a multi-dimensional fusion feature;

[0101] In step 204, the physical state abnormality interval is a period of time when resource consumption deviates from the normal fluctuation range, such as persistent high usage caused by a memory leak. Amplitude range adjustment involves scaling the numerical range of the physical abnormality interval based on the structural weight coefficient. For example, the abnormal value of a frequently called module is reduced to reduce interference. Multi-dimensional fusion features are a joint representation vector that integrates structural, resource, and semantic features.

[0102] In an embodiment of the present application, the amplitude of the abnormal interval is first adjusted according to the code structure weight. For example, the peak load of the processor of the communication module is amplified according to the weight coefficient to highlight its importance. Subsequently, the adjusted resource consumption data and the semantic conflict vector are spliced ​​into a high-dimensional fusion feature. In order to avoid dimensional redundancy, principal component analysis is used for dimensionality reduction, and key features are retained as the final multi-dimensional fusion feature. For example, after the load anomaly caused by communication timeout is spliced ​​with the "no response" semantic conflict, a low-dimensional feature is obtained after dimensionality reduction, which clearly points to the interface function that does not implement the timeout retry mechanism.

[0103] 205. Perform topological constraints on the multi-dimensional fusion features according to the structural connection relationship, and output a cross-modal defect feature set.

[0104] In step 205, topological constraints restrict feature distribution based on the connectivity of the code structure. For example, features of strongly dependent modules must be adjacent in the vector space. The cross-modal defect feature set is a set of defect features that integrates code structure, resource consumption, and user feedback.

[0105] In an embodiment of the present application, a graph structure network is constructed, with the code dependency graph as the adjacency matrix and the fusion features as the node attributes, and the information of adjacent nodes is aggregated through message passing. For example, after the abnormal features of the temperature control module are supplemented by the neighboring nodes of the communication module, the interface call timeout problem is identified. At the same time, regularization constraints are designed to ensure that the features are smooth and continuous in the topological structure, avoiding interference from logically unrelated modules. Finally, a cross-modal defect feature set is output, such as locating that the communication interface does not implement the exponential backoff retry mechanism, and correlating it with the "frequent disconnection" problem reported by users.

[0106] Here's a specific example:

[0107] An air conditioning system experienced a "no response after setting the temperature" issue, and user feedback pointed to the temperature control module. The temperature control module had a three-layer call depth, relied on the communication interface, and had a high call frequency, thus being assigned a high weight. Abnormal processor load was observed during daily peak hours, with the duration coinciding with user operations. User feedback of "no response" was mapped to the temperature setting interface, but the code did not address network latency. By merging the high-weight load anomaly with the "unhandled delay" semantic conflict, the feature was pointed to the communication interface. The dependency graph showed a strong correlation between the communication module and temperature control, ultimately locating the interface as not implementing timeout retry logic.

[0108] In summary, steps 201 to 205 quantify the importance of modules by weighting the code structure, combining resource consumption patterns with user semantic conflicts to achieve multi-dimensional collaborative defect analysis. In smart home scenarios, this method accurately distinguishes normal load fluctuations from real faults, such as temperature control failure caused by communication anomalies. Semantic conflict extraction bridges the gap between user feedback and code logic, and topological constraints ensure the rationality of features within the system architecture. In practical applications, the efficiency of fault location in air conditioning systems is significantly improved, the false alarm rate is reduced, and a scalable framework is provided for collaborative diagnosis of multiple devices.

[0109] To address the accuracy and scenario adaptability issues of multimodal feature fusion in smart home systems, a mapping rule between code call levels and hardware anomaly amplitudes is designed, and the structural weight coefficients are converted into adjustment coefficients for the physical anomaly intervals according to a layer-by-layer decreasing function. Nonlinear coding is then used to uniformly quantize cross-modal features to form multidimensional fusion data. In some embodiments, step 204 involves adjusting the amplitude range of the physical state anomaly interval based on the structural weight coefficients, concatenating the adjusted physical state anomaly intervals with the semantic conflict feature vector, and generating multidimensional fusion features, including:

[0110] 301. According to the calling depth of the code, convert the structural weight coefficient into the adjustment coefficient of the abnormal physical state interval according to the layer-by-layer decreasing rule;

[0111] In step 301, the call depth is the hierarchical nesting relationship of code modules, such as the number of levels of sub-modules called by the main control module. The adjustment coefficient is a value generated based on the call depth and is used to quantify the influence of modules at different levels on anomaly detection.

[0112] In the embodiments of the present application, the hierarchical calling relationships between modules are extracted by recursively traversing the code dependency graph. The call depth is converted into an adjustment coefficient using a layer-by-layer decreasing rule. The top-level module is assigned the highest initial coefficient, and with each additional layer of nesting, the coefficient decreases exponentially. Simultaneously, the coefficients are normalized based on the dynamic call frequency of the module to ensure that deep modules with high frequency calls retain reasonable weights. Ultimately, a set of adjustment coefficients that matches the code structure is generated.

[0113] 302. Proportionally adjust the numerical range of the abnormal physical state interval based on the adjustment coefficient to obtain an adjusted abnormal physical state interval;

[0114] In step 302, the abnormal physical state interval refers to the data range that exceeds the normal threshold during device operation, such as excessive temperature, abnormal humidity, etc. Scaling is to scale the value range of the abnormal interval based on the adjustment coefficient. For example, the abnormal value of the high-weight module requires a larger monitoring range.

[0115] In this embodiment, the numerical range of the abnormal physical state interval is linearly scaled. For example, if the communication module has a high adjustment coefficient, the abnormal load peak corresponding to that module is amplified by the coefficient. Robust statistical methods are also used to filter out noise interference, ensuring that the adjusted interval reflects the importance of the module while preserving the authenticity of the data distribution. The final output is the smoothed abnormal physical state interval.

[0116] 303. Connect the adjusted physical state abnormality interval and the semantic conflict feature vector in a preset order to generate multidimensional data, wherein the dimension ratio of the multidimensional data is dynamically allocated according to the structural connection relationship between the codes;

[0117] In step 303, multidimensional data is a joint representation of the abnormal interval values ​​and semantic conflict vectors, such as the concatenation of time series load data and semantic difference metrics. Dynamic allocation adjusts the proportion of features in different dimensions based on the connectivity of the code structure, for example, increasing the proportion of features from strongly dependent modules.

[0118] In an embodiment of the present application, the adjusted abnormal interval data, such as the timing waveform and the semantic conflict vector, are spliced ​​according to the channel dimension. Based on the module connectivity of the code dependency graph, such as the number of submodules associated with a module, the feature dimensions are dynamically weighted. The feature weights corresponding to modules with high connectivity are increased, while the weights of modules with low connectivity are decreased. Principal component analysis is used to remove redundant dimensions, retaining key features to form compact multidimensional data.

[0119] 304. Perform nonlinear conversion encoding on the multidimensional data to generate multidimensional fusion features in a unified quantization range.

[0120] In step 304, nonlinear transformation coding is a nonlinear mapping of the multidimensional data to unify the quantization scales of different modal features. Unifying the quantization range means that all features are ultimately compressed into the same numerical range, facilitating subsequent model processing.

[0121] In this embodiment, a nonlinear activation function, such as the hyperbolic tangent function, is used to normalize multidimensional data and compress it to a uniform numerical range. A self-attention mechanism is introduced to calculate the correlation weights of cross-modal features, such as the strength of the association between abnormal load and semantic conflict, and feature fusion is performed using a fully connected neural network. Ultimately, a multidimensional fusion feature with uniform scale and consistent semantics is generated for defect classification and location.

[0122] Here's a specific example:

[0123] When a smart air conditioning system experienced a "no response after setting the temperature" issue, analysis of the code dependency graph revealed that the main temperature control module was calling the communication interface at a high level. This high frequency of calls generated a high adjustment factor. An abnormal load on the communication interface was detected, and the peak value was amplified using the adjustment factor. After filtering sensor noise, the effective abnormal range was retained. The adjusted load data was concatenated with the semantic vector generated from the user feedback "no response," and the feature weight was increased based on the connectivity of the communication module. Nonlinear coding was used to generate fused features, locating the missing timeout retry mechanism on the communication interface. The system then automatically pushed a patch to fix the problem.

[0124] In summary, steps 301 to 304 achieve precise fusion of cross-modal features by calling the deep generation module weight coefficients, combining dynamic allocation and nonlinear coding. In smart home scenarios, it is possible to distinguish between normal load fluctuations and real defects, and associate user feedback semantics with code logic. For example, the "no response" problem of the air-conditioning system can be accurately mapped to the unhandled exception of the communication module, avoiding the misjudgment caused by the separation of code and physical state in traditional methods. Through dynamic weight adjustment and robust filtering, the efficiency of defect location in complex systems is significantly improved, providing a scalable framework for multi-device collaborative diagnosis.

[0125] In order to solve the structural adaptability problem of multimodal feature fusion in smart home systems, the physical abnormality numerical segments are divided based on the code call depth, and the semantic feature vectors are simultaneously split into feature groups. The number of directly associated nodes in the code dependency graph is analyzed using a graph neural network, and the connection ratio between the numerical segments and the feature groups is dynamically allocated to achieve a strong association between the data dimension and the code topology. In some embodiments, the adjusted physical state abnormality interval and the semantic conflict feature vector are connected in a preset order in step 303 to generate multidimensional data, and the dimension ratio of the multidimensional data is dynamically allocated according to the structural connection relationship between the codes, including:

[0126] 401. Set a segmentation rule based on the code call depth, divide the values ​​in the adjusted physical state abnormality interval into multiple continuous value segments according to the segmentation rule, and split the values ​​of the semantic conflict feature vector into multiple feature groups according to the segmentation rule;

[0127] In step 401, the segmentation rule is a strategy for segmenting data based on code call depth. Modules with deeper call depths have finer granularity in their corresponding data segments. A continuous numerical segment is a continuous data unit within an abnormal physical state interval that is segmented according to the segmentation rule, such as a fragment of a time-series load waveform. A feature group is a collection of subvectors within a semantic conflict feature vector that are split according to the same segmentation rule, such as the separation of action descriptions from state descriptions in user feedback.

[0128] In the embodiment of the present application, the segmentation rules are set according to the calling depth of the code module, with modules with shallower depth corresponding to coarse-grained segmentation and modules with deeper calling depth corresponding to fine-grained segmentation. The adjusted physical state abnormal interval data is evenly cut into multiple continuous numerical segments according to the time window, and the semantic conflict feature vector is split into feature groups according to the same number of segments. For example, the main control module has fewer segments, and its corresponding abnormal data segment and semantic feature group are longer; the communication interface module has more segments, and the data segment and feature group are shorter.

[0129] 402. Dynamically allocate a connection ratio between the continuous numerical segments and the feature groups based on the number of directly associated nodes in the structural connection relationship between the codes, and alternately arrange the continuous numerical segments and the feature groups according to the connection ratio to generate multidimensional data.

[0130] In step 402, the number of directly connected nodes is the total number of nodes directly connected to the current module in the code dependency graph. For example, the temperature control module is directly connected to the sensor, communication, and user interface modules. The connection ratio is the weight distribution ratio between the value segments and feature groups when splicing. For example, modules with more connected nodes are assigned a higher weight. Alternating arrangement is to cross-connect the value segments and feature groups in sequence to form a heterogeneous data stream.

[0131] In the embodiment of the present application, the number of directly associated nodes of the current module in the code dependency graph is counted. If a module has a large number of associated nodes, a higher connection ratio is assigned to the numerical segment of the module, and the proportion of the feature group is reduced; otherwise, the numerical segment ratio is reduced. Subsequently, the numerical segments and feature groups are arranged alternately according to the connection ratio. For example, a section of abnormal load data is inserted first, and then the corresponding semantic conflict feature is inserted. The splicing is cyclically spliced ​​until completion to generate multidimensional data. Through dynamic proportional allocation, the feature expression of strongly associated modules is ensured to be more prominent.

[0132] Here's a specific example:

[0133] After a certain air-conditioning system experienced a "temperature adjustment delay" issue, the code dependency graph was analyzed and found that the main temperature control module had a shallow call depth and was divided into three segments; the sensor interface had a deep call depth and was divided into five segments. The adjusted CPU load anomaly data was divided into three segments, and the user feedback "delay" semantic vector was split into three groups. The temperature control module is directly associated with the communication and sensor modules, with two nodes, and the ratio of allocated numerical segments to feature groups is three to one. The load data segments and semantic feature groups are alternately spliced ​​in proportion to generate multidimensional data with "load peaks, delayed actions, load fluctuations, and abnormal states" arranged alternately. After model analysis of the multidimensional data, it was located that the sensor interface did not optimize the data polling frequency, resulting in a response delay in the main control module.

[0134] In summary, steps 401 to 402 achieve efficient fusion of multimodal data by invoking deep adaptive data granularity division and dynamically allocating feature proportions in combination with code structure. In smart home scenarios, this method accurately associates physical anomalies with user semantic conflicts. For example, the delay in air conditioning temperature adjustment can be reflected as an abnormal processor load segment and is also associated with the "delayed" action description in user feedback. The causal relationship between features is enhanced through alternating arrangement. Dynamic proportional allocation avoids redundant data interference, improves the model's ability to parse complex dependencies, and makes defect location more in line with the actual system architecture. In actual applications, the efficiency of root cause analysis of air conditioning system failures has been significantly improved, and the false detection rate has been reduced, providing a reliable basis for the collaborative optimization of multiple devices.

[0135] In order to solve the problem of accuracy in cross-modal defect location and dynamic repair in smart home systems, the code-level defect propagation probability distribution is calculated through a Bayesian network, and the target code area is screened in combination with the physical state abnormal segmentation results. Based on the upstream and downstream call chains of the target code, patches compatible with interface parameters are matched from the repair strategy library, and environmental conflict items are eliminated through the version evolution graph to form a dynamic repair plan. In some embodiments, the defect location probability distribution is generated based on the cross-modal defect feature set in step 105, and the abnormal segmentation results of the physical state parameters are analyzed through the defect location probability distribution to determine the dynamic repair results of the cross-platform software defect information, including:

[0136] 501. Calculate the defect location probability distribution of the code-level propagation path based on the feature vector distribution of each code in the cross-modal defect feature set;

[0137] In step 501, the cross-modal defect feature set is a multimodal defect representation that combines code feature vectors with physical state parameters. For example, it represents the combined features of the code logic complexity and abnormal CPU load of the air conditioning control module. The code hierarchical propagation path is the potential path for the defect to spread through the call chain in the code dependency graph. For example, an abnormal temperature control function may affect the interface stability of the communication module. The defect location probability distribution quantifies the probability of a defect in each code module. The relationship between feature distribution and defect propagation is mapped through a probabilistic model.

[0138] In this embodiment, a graph-structured learning algorithm is used to convert code dependencies into topological vectors, and a cross-modal feature set is constructed by combining physical state anomaly data. A probabilistic network model is used to analyze defect propagation paths and calculate the posterior probability of each code node. For example, communication modules have a significantly higher defect probability than independent modules due to their complex call links and abnormal resource consumption. Ultimately, a heat map of the defect location probability distribution is generated, marking high-risk code areas.

[0139] 502. Match the defect location probability distribution with the abnormal segmentation result of the physical state parameter in terms of regional overlap, and select target code regions whose regional overlap exceeds a preset threshold;

[0140] In step 502, the anomaly segmentation results are the abnormal time period and spatial range divisions based on the physical state parameters. Regional overlap matching assesses the spatiotemporal alignment of the defect probability distribution with the physical anomaly region. For example, if a module's high defect probability period coincides with the processor's peak load period,

[0141] In this embodiment, morphological segmentation is used to extract continuous abnormal intervals from physical anomaly data. The defect probability distribution is then mapped to the same time axis, and the similarity of the overlapping regions is calculated. For example, if the overlap between the defect probability curve for the temperature control module and the abnormal period of sensor data exceeds a preset threshold, the target code region is identified. Dynamically adjusting the threshold eliminates occasional interference and ensures reliable matching results.

[0142] 503. Based on the upstream and downstream call chains of the target code area in the code dependency graph, select patch code snippets compatible with the upstream and downstream call chains from a preset repair strategy library, and output dynamic repair results according to the injection order and version constraints of the patch code snippets.

[0143] In step 503, the upstream and downstream call chains are the predecessor modules and successor modules of the target code region in the dependency relationship. The repair strategy library is a predefined code patch collection that includes repair solutions such as thread optimization and exception handling that are compatible with the system architecture.

[0144] In an embodiment of the present application, the upstream and downstream call chains of the target code area are traversed to identify critical path nodes. Based on a dependency conflict detection algorithm, an adaptation patch is selected from the repair library, for example, to inject exception handling logic into an interface that does not implement a timeout retry. The patch is dynamically injected into the system through hot deployment technology, and the dynamic repair results are output. This ensures that the repair process does not interrupt service and verifies the compatibility of the patch with upstream and downstream modules.

[0145] Here's a specific example:

[0146] When a smart air conditioning system experienced abnormal temperature fluctuations during nighttime mode, cross-modal feature analysis revealed a strong correlation between the peak defect probability distribution in the nighttime mode control module and the temperature sensor interface. Matching revealed that the period of sensor data anomalies completely overlapped with the peak defect probability, identifying the sensor data parsing module as the target area. The call chain was traced back to the missing node in the data validation logic. A data smoothing and filtering patch was selected from a repair library, dynamically injected into the system, and verified for communication protocol compatibility. After the repair, the temperature fluctuation issue was resolved, and the system load returned to normal.

[0147] In summary, steps 501 to 503 quantify the defect propagation path through a probabilistic model, accurately locate the root cause of the problem by combining spatiotemporal overlapping matching, and realize cross-modal collaborative analysis of code logic and physical state. The dynamic repair strategy intelligently selects compatible patches based on the system call chain to avoid resource waste and service interruption caused by traditional full updates. In smart home scenarios, this method significantly improves the efficiency of locating complex defects. For example, intermittent anomalies in air-conditioning systems can be associated with sensor data processing defects and can be quickly injected into adaptive filtering algorithms. Through hot deployment and dependency verification, the security of the repair process and system stability are guaranteed, providing self-healing capabilities for IoT devices, reducing manual maintenance costs and extending the life cycle of equipment.

[0148] In order to solve the accuracy and compatibility issues of patch injection in smart home systems, the execution order and parameter definitions of the target code call chain are extracted, and a graph matching algorithm is used to screen candidate patches covering the chain. The patch interface type is parsed through the abstract syntax tree, and version-compatible patches are screened in combination with historical version evolution records. Finally, a priority ranking is generated through a dependency conflict detection model. In some embodiments, the upstream and downstream call chains of the target code area in the code dependency graph in step 503 are selected from a preset repair strategy library, which includes:

[0149] 601. Extract the execution order and interface parameter definition of the upstream and downstream call chains of the target code region in the code dependency graph, match the injection positions of each patch in the preset repair strategy library to screen candidate patches that cover the upstream and downstream call chains;

[0150] In step 601, the upstream and downstream call chain is the execution link formed by the predecessor and successor nodes of the code module in the dependency graph. Interface parameter definitions specify the data type and format passed during inter-module calls. For example, the temperature parameter of a sensor interface is a floating-point value with a limited range. The injection location is the specific insertion point of the patch code in the call chain, such as the insertion point of the exception retry logic of a communication module.

[0151] In an embodiment of the present application, the code dependency graph is parsed by a deep traversal algorithm to extract the complete upstream and downstream call links of the target module, including the predecessor module it calls and the successor module it depends on. The symbol table parsing technology is used to extract the parameter definitions of each interface in the call chain, such as function name, parameter type and return value structure. The above parameter definitions are semantically matched with the patch metadata in the preset repair strategy library to screen out candidate patches that cover the key nodes of the call chain. For example, for patches with communication interface timeout exceptions, patches that contain socket connection parameters and support asynchronous retry mechanisms must be matched to ensure that their injection positions cover the entire link of data sending and receiving.

[0152] 602. Verify the correspondence between the response parameters of the candidate patch and the interface parameter definition, and select a version adaptation patch compatible with the current version based on the historical version evolution record in the code dependency graph;

[0153] In step 602, the response parameter is the data structure returned after the patch is executed, such as the number of retries and status code returned by the timeout retry patch. The historical version evolution record is the interface change log of the code module in different versions, such as the communication protocol parameter expansion record.

[0154] In an embodiment of the present application, the historical change records of the target module are traced back through the version control system to extract the evolution path of the interface parameters. The response parameters of the candidate patch are checked for type and structure, for example, whether the return status code is an integer and whether the error message is a string. The semantic difference technology is used to compare the patch parameters with the interface definition of the current version, eliminate incompatible patches due to missing fields or type conflicts, and retain version adaptation patches. For example, if the communication protocol in the historical version adds an identity authentication field, the patch version that supports this field is filtered out, and the old version patch that does not include this field is excluded.

[0155] 603 : Analyze the conflict relationship between the operating environment dependency of the version adaptation patch and the current software environment, eliminate the version adaptation patches with conflicts, sort the remaining version adaptation patches, and generate patch code snippets.

[0156] In step 603, runtime dependencies are system configuration conditions required for the patch to run properly, such as the operating system kernel version and third-party library versions. Conflicts are incompatibilities between the patch dependencies and the current system environment, such as requiring a higher-version compiler while the current environment only supports a lower-version one.

[0157] In an embodiment of the present application, the dependency list in the patch declaration file is parsed, such as the dynamic link library version and runtime environment requirements. The current system environment configuration is compared with the dependency graph to identify conflicting dependencies. For example, the patch requires the use of a new version of the encryption algorithm library while the current system only supports the old version. A conflict resolution algorithm is used to eliminate all patches with dependency conflicts, and the remaining patches are sorted in multiple dimensions. Patches with high repair coverage are given priority, followed by patches with low resource consumption. Finally, patch code snippets sorted by priority are generated to ensure optimal repair effect and system stability.

[0158] Here's a specific example:

[0159] After a smart air-conditioning system frequently restarted due to abnormal temperature sensor data parsing, the call chain of the temperature control module was analyzed, and it was found that it relied on three modules: sensor data acquisition, filtering algorithm, and communication protocol. The two types of patches in the "data verification enhancement" and "communication protocol fault tolerance" patches in the matching repair library were matched and repaired to screen out candidate patches that cover all nodes. The verification found that the return parameters of some patches did not match the input type of the current filtering algorithm, and other patches were marked as obsolete because they were not adapted to the new version of the communication protocol. Patches that support protocol fault tolerance and are parameter-compatible are retained. It was detected that a patch relied on the new version of the data processing framework, while the current system was running the old version of the framework, and it was removed. The remaining patches were sorted according to "data verification takes precedence over protocol fault tolerance" to generate the final patch queue. After the data verification patch was injected, the abnormal data was intercepted and filtered, and the frequency of system restarts was significantly reduced.

[0160] In summary, steps 601 to 603 achieve precise adaptation of the patch injection location to the system architecture through full-link analysis of the call chain and semantic matching of interface parameters; combined with version evolution backtracking and dependency conflict detection, the compatibility of the patch with the current environment is ensured. In the smart home scenario, this method can effectively solve the system crash problem caused by the mismatch between patches and module parameters in traditional methods. For example, the legacy problem of protocol upgrade of the air-conditioning system can be avoided by screening historical compatible version patches to avoid functional abnormalities. By dynamically sorting and optimizing the order of patch injection, root cause defects are repaired first, significantly improving system stability and repair efficiency, and providing IoT devices with safe and reliable online hot repair capabilities, reducing operation and maintenance costs and extending the service life of equipment.

[0161] To resolve patch dependency conflicts and deployment order optimization issues, a multi-source data synchronization acquisition framework is designed. Hardware parameters are segmented into state segments, which are jointly encoded with the code execution path parsed from runtime logs. A graph convolutional network is used to model the correlation strength between code entities and hardware states, thereby constructing a dynamic evolution graph. In some embodiments, step 103 involves synchronously acquiring the physical state parameters of distributed hardware nodes in the software and dynamically coupling these physical state parameters with the context association matrix to generate a state evolution graph, including:

[0162] 701. Physical state parameters of distributed hardware nodes are collected in the software, wherein the physical state parameters include a time series data stream of a central processing unit occupancy rate, a storage resource allocation state, and a power supply voltage fluctuation value;

[0163] In step 701, distributed hardware nodes are distributed physical device units within a smart home system, such as smart gateways, temperature control terminals, and sensors, which collaborate through communication protocols. Physical state parameters are dynamic performance indicators of hardware nodes during operation. These include time-series data reflecting the health of the device, such as CPU resource consumption, memory usage, and power supply voltage fluctuations. A time-series data stream is a collection of physical state parameters continuously collected in a time series format, including timestamps, parameter values, and data quality indicators.

[0164] In the embodiments of the present application, the real-time status of hardware nodes is acquired through multi-source heterogeneous data acquisition technology. For devices that support the communication protocol, the interface is directly called to read the CPU occupancy rate and storage resource allocation data. For nodes that are not open to the protocol, external sensors are deployed to collect power supply voltage fluctuations. A sliding window mechanism is used to reduce noise in the raw data, eliminating outliers and generating a time-series data stream with timestamps. For example, voltage fluctuation data from a temperature control terminal is collected via a Hall effect sensor, converted to digital form, and uploaded to the CPU at a frequency of seconds.

[0165] 702. Segment the time series data stream into physical state segments according to the sampling time window, parse the code execution path based on the runtime log time series sequence, input the physical state segments and the code execution path into the context association matrix for multi-dimensional encoding, and generate a joint feature vector;

[0166] In step 702, the physical state segment is a subset of physical state parameters divided into time windows, representing the operating characteristics of the device within a specific time period. The code execution path is the sequence of software module calls recorded in the system runtime log, reflecting the execution process of business logic and resource scheduling. The context association matrix is ​​a multidimensional data structure used to encode the relationship between physical state and code logic, revealing the coupling characteristics between hardware performance and software behavior.

[0167] In an embodiment of the present application, the time series data stream is dynamically windowed, and the window length is dynamically adjusted based on the device type. Runtime logs are synchronously parsed to extract function call stacks, thread switching records, and other information to generate code execution paths. An attention mechanism is used to calculate the association weights between each parameter in the physical state segment and the code execution path, and a context association matrix is ​​constructed. For example, the peak CPU occupancy rate of the air conditioning control module is strongly correlated with the frequent calls to the temperature calibration function, and is therefore assigned a higher weight in the matrix. Ultimately, the matrix is ​​encoded as a joint feature vector containing spatiotemporal features.

[0168] 703. Construct a state evolution graph based on the correlation strength between the code execution path and the physical state segment in the joint feature vector.

[0169] In step 703, the correlation strength is a quantitative indicator of the degree of coupling between the physical state and the code logic in the joint feature vector, calculated using a similarity algorithm. The state evolution graph is a topological network that describes the relationship between device state changes and software behavior evolution based on the time dimension, consisting of nodes, edges, and weight attributes.

[0170] In the embodiment of the present application, a graph neural network is used to perform topological modeling on the joint feature vector. Physical state fragments and code execution paths are mapped to graph nodes, and the correlation strength between nodes is calculated using cosine similarity as the edge weight. A time sliding window mechanism is introduced to establish cross-time state transition relationships. For example, the CPU occupancy rate of an air-conditioning system in cooling mode decreases over three consecutive time periods, forming a "high load, load, and low load" state transition path. Ultimately, a visual state evolution graph is generated that includes device health and abnormal propagation paths.

[0171] Here's a specific example:

[0172] After a central air conditioning system experienced intermittent heating failure, distributed node data was collected, including the CPU usage of the main control board, storage resource fluctuations, and abnormal power supply fluctuations detected by voltage sensors. The data was segmented into five-minute windows, and log analysis revealed frequent calls to invalid calibration functions when heating mode was triggered. A correlation matrix was constructed, showing a high correlation between voltage fluctuations and calibration function calls. A state evolution graph was generated, revealing the path of the calibration function's dead loop caused by voltage anomalies, locating the coupling defect between power module aging and a lack of software fault tolerance. After replacing the power module and injecting a voltage threshold detection patch, the system resumed stable operation.

[0173] In summary, steps 701 to 703 achieve a precise characterization of the coordinated state of the smart home system's hardware and software through multimodal data fusion and spatiotemporal correlation modeling. In the central air conditioning case, this method effectively identifies the coupling defect of power supply hardware degradation and missing software fault-tolerance logic, breaking through the limitations of traditional single-dimensional diagnosis. The state evolution graph provides a visual representation of the anomaly propagation path, supporting root cause analysis and predictive maintenance. In practical applications, this improves system fault location efficiency and reduces maintenance costs, providing technical support for the full lifecycle management of complex IoT devices.

[0174] Figure 2 The present invention provides a structural diagram of a software defect information fusion system based on multi-source data. Figure 2 As shown, the system includes:

[0175] An acquisition module 21 acquires multi-source heterogeneous data in a cross-platform software running environment, wherein the multi-source heterogeneous data includes static code features, runtime log time series, and user feedback text;

[0176] A generation module 22 constructs a code dependency graph based on the association between the static code features and the historical defect library, defines a runtime log time series sequence using the logical association between code entities in the code dependency graph, and performs spatiotemporal alignment of the runtime log time series sequence with the software defect triggering nodes in the user feedback text to generate a context association matrix;

[0177] The acquisition module 23 synchronously acquires the physical state parameters of the distributed hardware nodes in the software, and dynamically couples the physical state parameters with the context association matrix to generate a state evolution graph;

[0178] A fusion module 24 generates a cross-modal defect feature set by fusing the code dependency graph, the state evolution graph, and the user feedback text;

[0179] The determination module 25 generates a defect location probability distribution based on the cross-modal defect feature set, analyzes the abnormal segmentation result of the physical state parameter through the defect location probability distribution, and determines the dynamic repair result of the cross-platform software defect information.

[0180] Figure 2 The software defect information fusion system based on multi-source data can be executed Figure 1 The implementation principles and technical effects of the multi-source data-based software defect information fusion method described in the illustrated embodiment are not further elaborated. The specific manner in which each module and unit performs operations in the multi-source data-based software defect information fusion system described in the above embodiment has been described in detail in the relevant embodiments of the method and will not be further elaborated here.

[0181] In one possible design, Figure 2 The software defect information fusion system based on multi-source data in the embodiment shown can be implemented as a computing device, such as Figure 3 As shown, the computing device may include a storage component 31 and a processing component 32;

[0182] The storage component 31 stores one or more computer instructions, wherein the one or more computer instructions are called and executed by the processing component 32 .

[0183] The processing component 32 is used for the above Figure 1 The embodiment provides a software defect information fusion method based on multi-source data.

[0184] The processing component 32 may include one or more processors to execute computer instructions to perform all or part of the steps in the above method. Of course, the processing component may also be implemented as one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above method.

[0185] The storage component 31 is configured to store various types of data to support operations at the terminal. The storage component can be implemented by any type of volatile or non-volatile memory device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.

[0186] Of course, a computing device may also include other components, such as input / output interfaces, display components, communication components, etc.

[0187] The input / output interface provides an interface between the processing component and the peripheral interface module, which can be an output device, an input device, etc.

[0188] The communication component is configured to facilitate, among other things, wired or wireless communications between the computing device and other devices.

[0189] Among them, the computing device can be a physical device or an elastic computing host provided by a cloud computing platform, etc. In this case, the computing device can refer to a cloud server, and the above-mentioned processing components, storage components, etc. can be basic server resources rented or purchased from the cloud computing platform.

[0190] The present application also provides a computer storage medium storing a computer program, wherein the computer program can achieve the above-mentioned Figure 1 The illustrated embodiment provides a software defect information fusion method based on multi-source data.

[0191] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0192] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0193] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.

[0194] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A software defect information fusion method and system based on multi-source data, characterized in that: include: Acquire multi-source heterogeneous data in a cross-platform software runtime environment, wherein the multi-source heterogeneous data includes static code features, runtime log time series, and user feedback text; A code dependency graph is constructed based on the association between the static code features and the historical defect library. A runtime log time series sequence is defined using the logical association between code entities in the code dependency graph. The runtime log time series sequence is spatially and temporally aligned with the software defect triggering nodes in the user feedback text to generate a context association matrix. Synchronously collecting physical state parameters of distributed hardware nodes in the software, and dynamically coupling the physical state parameters with the context association matrix to generate a state evolution graph; Generate a cross-modal defect feature set by fusing the code dependency graph, the state evolution graph, and the user feedback text; A defect location probability distribution is generated based on the cross-modal defect feature set, and the abnormal segmentation result of the physical state parameter is analyzed through the defect location probability distribution to determine the dynamic repair result of the cross-platform software defect information.

2. The method according to claim 1, characterized in that The cross-modal defect feature set is generated by fusing the code dependency graph, the state evolution graph, and the user feedback text, including: Extracting the structural connection relationship between each code in the code dependency graph, and generating a structural weight coefficient according to the call depth and dependency strength of the code; Analyzing the periodic fluctuation pattern of the hardware resource consumption data in the state evolution graph, and identifying the abnormal physical state interval associated with the software running stage according to the periodic fluctuation pattern; Matching the natural language description in the user feedback text with the identifier of the code, and generating a semantic conflict feature vector based on the difference between the natural language description and the identifier in the matching result; Adjusting the amplitude range of the abnormal physical state interval based on the structural weight coefficient, and splicing the adjusted abnormal physical state interval with the semantic conflict feature vector to generate a multi-dimensional fusion feature; Topological constraints are performed on the multi-dimensional fusion features according to the structural connection relationship, and a cross-modal defect feature set is output.

3. The method according to claim 2, characterized in that The adjusting the amplitude range of the abnormal physical state interval based on the structural weight coefficient, and splicing the adjusted abnormal physical state interval with the semantic conflict feature vector to generate a multi-dimensional fusion feature includes: According to the calling depth of the code, the structural weight coefficient is converted into the adjustment coefficient of the abnormal physical state interval according to the layer-by-layer decreasing rule; Proportionally adjusting the numerical range of the abnormal physical state interval based on the adjustment coefficient to obtain an adjusted abnormal physical state interval; Connecting the adjusted physical state abnormality interval and the semantic conflict feature vector in a preset order to generate multidimensional data, wherein the dimension ratio of the multidimensional data is dynamically allocated according to the structural connection relationship between the codes; Nonlinear conversion encoding is performed on the multidimensional data to generate multidimensional fusion features with a unified quantization range.

4. The method according to claim 3, characterized in that The step of connecting the adjusted abnormal physical state interval with the semantic conflict feature vector in a preset order to generate multidimensional data, wherein the dimension ratio of the multidimensional data is dynamically allocated according to the structural connection relationship between the codes, includes: Setting a segmentation rule according to the call depth of the code, dividing the value in the adjusted physical state abnormality interval into a plurality of continuous value segments according to the segmentation rule, and splitting the value of the semantic conflict feature vector into a plurality of feature groups according to the segmentation rule; According to the number of directly associated nodes in the structural connection relationship between the codes, a connection ratio between the continuous numerical segments and the feature groups is dynamically allocated, and the continuous numerical segments and the feature groups are alternately arranged according to the connection ratio to generate multidimensional data.

5. The method according to claim 1, wherein Generating a defect location probability distribution based on the cross-modal defect feature set, analyzing the abnormal segmentation result of the physical state parameter by using the defect location probability distribution, and determining a dynamic repair result of the cross-platform software defect information includes: According to the feature vector distribution of each code in the cross-modal defect feature set, the defect location probability distribution of the code level propagation path is calculated; Performing regional overlap matching on the defect location probability distribution and the abnormal segmentation result of the physical state parameter, and screening target code regions whose regional overlap exceeds a preset threshold; Based on the upstream and downstream call chains of the target code area in the code dependency graph, patch code snippets compatible with the upstream and downstream call chains are selected from a preset repair strategy library, and dynamic repair results are output according to the injection order and version constraints of the patch code snippets.

6. The method according to claim 5, characterized in that The selecting, based on the upstream and downstream call chains of the target code region in the code dependency graph, patch code snippets compatible with the upstream and downstream call chains from a preset repair strategy library includes: Extracting the execution order and interface parameter definitions of the upstream and downstream call chains of the target code region in the code dependency graph, matching the injection positions of each patch in a preset repair strategy library to screen candidate patches that cover the upstream and downstream call chains; Verifying the correspondence between the response parameters of the candidate patch and the interface parameter definition, and screening the version adaptation patch compatible with the current version based on the historical version evolution record in the code dependency graph; Analyze the conflict relationship between the operating environment dependencies of the version adaptation patch and the current software environment, eliminate the version adaptation patches with conflicts, and sort the remaining version adaptation patches to generate patch code snippets.

7. The method according to claim 1, characterized in that The synchronous acquisition software collects physical state parameters of distributed hardware nodes, and dynamically couples the physical state parameters with the context association matrix to generate a state evolution graph, including: By collecting physical state parameters of distributed hardware nodes in the software, the physical state parameters include a time series data stream of CPU occupancy rate, storage resource allocation status and power supply voltage fluctuation value; Segmenting the time series data stream into physical state segments according to a sampling time window, parsing the code execution path based on the runtime log time series sequence, inputting the physical state segments and the code execution path into the context association matrix for multi-dimensional encoding, and generating a joint feature vector; A state evolution graph is constructed based on the correlation strength between the code execution path and the physical state fragment in the joint feature vector.

8. A software defect information fusion method based on multi-source data, characterized in that: include: An acquisition module is used to acquire multi-source heterogeneous data in a cross-platform software running environment, wherein the multi-source heterogeneous data includes static code features, runtime log time series, and user feedback text; A generation module constructs a code dependency graph based on the association between the static code features and the historical defect library, defines a runtime log time series sequence using the logical association between code entities in the code dependency graph, and performs spatiotemporal alignment of the runtime log time series sequence with the software defect triggering nodes in the user feedback text to generate a context association matrix; An acquisition module synchronously acquires physical state parameters of distributed hardware nodes in the software, and dynamically couples the physical state parameters with the context association matrix to generate a state evolution graph; A fusion module generates a cross-modal defect feature set by fusing the code dependency graph, the state evolution graph, and the user feedback text; A determination module generates a defect location probability distribution based on the cross-modal defect feature set, analyzes the abnormal segmentation results of the physical state parameters through the defect location probability distribution, and determines the dynamic repair results of the cross-platform software defect information.

9. A computing device, characterized in that It includes a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement a software defect information fusion method based on multi-source data as described in any one of claims 1 to 7.

10. A computer storage medium, characterized in that A computer program is stored, and when the computer program is executed by a computer, the method for fusion of software defect information based on multi-source data according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Software source code defect detection method and system, electronic equipment and storage medium

    CN113641586A

  • Software defect positioning method based on enhanced embedded vector semantic representation

    CN116302953A

  • Software defect positioning method and device, equipment, storage medium and computer program

    CN118838834A

  • Software defect positioning method and device based on multiple views

    CN119396687A

  • Software operation anomaly detection method, system, medium, product and equipment

    CN119557629A

Cited By

  • Fault diagnosis agent data preprocessing method and system based on multi-modal alignment

    CN120892239A

  • Software defect processing method, electronic equipment, storage medium and program product

    CN120892321A

  • Power distribution system operation state monitoring method and system based on big data analysis

    CN121508152A

  • Code-level synthetic data generation method combining atlas variation and sandbox feedback and related equipment

    CN122219969A

  • Code-level synthesis data generation method combining map variation and sandbox feedback and related equipment

    CN122219969B