A software defect information fusion method and system based on multi-source data
By constructing a cross-modal defect feature set and combining it with code dependency graphs and state evolution graphs, the problems of surge in model parameters and temporal misalignment in multi-source data defect analysis were solved. This enabled efficient and accurate location and dynamic repair of cross-platform software defects, improving the efficiency and accuracy of defect analysis.
Patent Information
- Application Number
- CN202510711073.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-29
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-05-29
AI Technical Summary
Existing technologies for multi-source data defect analysis suffer from a surge in model parameters, a large hyperparameter combination space, strong dependence on labeled data, difficulty in adapting to new data sources or code architecture changes during software development, and difficulty in resolving temporal misalignment and semantic conflicts in cross-modal data, resulting in low efficiency and poor accuracy in defect information fusion.
By constructing code dependency graphs, state evolution graphs, and user feedback text, 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 defect location probability distribution. Finally, a dynamic repair strategy is used to achieve accurate location and repair of cross-platform software defects.
It enables efficient and accurate location and dynamic repair of software defects across platforms, improves the accuracy of defect location and the reliability of repair, solves the problems of data fragmentation, coordination deviation and computational redundancy in existing technologies, and supports real-time adaptation to changes in the software development process.
Smart Images

Figure CN120632770B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software defect information fusion technology, and in particular to a method and system for software defect information fusion based on multi-source data. Background Technology
[0002] With the exponential growth in the complexity of software systems, defect detection and prediction face multi-dimensional challenges. Modern software engineering involves heterogeneous information from multiple sources, such as code repositories, test logs, user behavior data, and static analysis results. Traditional methods based on a single data source struggle to comprehensively capture the correlations and dynamic evolution patterns 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 from different dimensions. There is an urgent need for an analysis method that integrates multi-source data to achieve accurate defect localization, root cause tracing, and risk prediction. Furthermore, real-time requirements necessitate that the fusion method 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 of multi-source data is a deep learning-based multimodal fusion model. This method constructs a hierarchical feature extraction network to process different data sources separately, and then uses attention mechanisms or graph neural networks to fuse cross-modal features. For example, a pre-trained language model is used to extract semantic features from code, combined with a convolutional neural network to process log sequence data, and finally, a graph neural network is used to model the correlation between code structure and execution path to form a comprehensive defect prediction index. This type of method has achieved higher accuracy and recall than traditional single-source models in some scenarios.
[0004] While deep learning models have shown potential in multi-source fusion, significant bottlenecks remain. Multimodal networks require dedicated sub-modules for different data sources, leading to a surge in model parameters and a vast hyperparameter combination space, necessitating extensive tuning with large amounts of labeled data and computational resources. Heterogeneous data, such as the abstract semantics of code text and the temporal features of logs, are difficult to align deeply, and attention mechanisms are susceptible to noise interference, limiting the representational power of the fused features. Existing models are mostly trained offline, making it difficult to adapt in real-time to new data sources or code architecture changes during software development, and their strong dependence on labeled data restricts their application in sparsely labeled scenarios. These shortcomings indicate an 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] This application provides a software defect information fusion method and system based on multi-source data to solve the problems of low efficiency and poor accuracy of software defect information fusion in the prior art.
[0006] Firstly, this application provides a method for fusing software defect information based on multi-source data, including:
[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 sequence, and user feedback text;
[0008] Based on the association between the static code features and the historical defect library, a code dependency graph is constructed. The logical association between code entities in the code dependency graph is used to define the runtime log time sequence. The runtime log time sequence is spatiotemporally aligned with the software defect triggering nodes in the user feedback text to generate a context association matrix.
[0009] The physical state parameters of distributed hardware nodes in the synchronous acquisition software are dynamically coupled with the context association matrix to generate a state evolution map.
[0010] By fusing the code dependency graph, state evolution graph, and user feedback text, a cross-modal defect feature set is generated;
[0011] Based on the cross-modal defect feature set, a defect location probability distribution is generated, 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 cross-platform software defect information.
[0012] Optionally, the step of generating a cross-modal defect feature set by fusing the code dependency graph, state evolution graph, and user feedback text includes:
[0013] Extract the structural connections between the code in the code dependency graph, and generate structural weight coefficients based on the call depth and dependency strength of the code;
[0014] The periodic fluctuation pattern of hardware resource consumption data in the state evolution graph is analyzed, and the abnormal physical state intervals associated with the software operation stage are identified based on the periodic fluctuation pattern.
[0015] The natural language description in the user feedback text is matched with the identifier of the code, and a semantic conflict feature vector is generated based on the difference between the natural language description and the identifier in the matching result.
[0016] The amplitude range of the physical state anomaly interval is adjusted based on the structural weight coefficient, and the adjusted physical state anomaly interval is concatenated with the semantic conflict feature vector to generate a multi-dimensional fusion feature.
[0017] Based on the structural connection relationship, topological constraints are applied to the multi-dimensional fusion features to output a cross-modal defect feature set.
[0018] Optionally, adjusting the amplitude range of the physical state anomaly interval based on the structural weight coefficients, and concatenating the adjusted physical state anomaly interval with the semantic conflict feature vector to generate a multi-dimensional fusion feature includes:
[0019] Based on the code call depth, the structural weight coefficients are converted into adjustment coefficients for the abnormal physical state intervals according to a progressively decreasing rule.
[0020] The numerical range of the physical state anomaly interval is proportionally adjusted based on the adjustment coefficient to obtain the adjusted physical state anomaly interval.
[0021] The adjusted physical state anomaly interval is connected to the semantic conflict feature vector in a preset order to generate multidimensional data. The dimensionality ratio of the multidimensional data is dynamically allocated according to the structural connection relationship between the codes.
[0022] The multidimensional data is nonlinearly transformed and encoded to generate multidimensional fusion features with a unified quantization range.
[0023] Optionally, the step of concatenating the adjusted physical state anomaly interval with the semantic conflict feature vector in a preset order to generate multidimensional data, wherein the dimensionality ratio of the multidimensional data is dynamically allocated according to the structural connection relationship between the code, includes:
[0024] Based on the code call depth, a segmentation rule is set, and the values in the adjusted physical state abnormal interval are divided into multiple continuous value segments according to the segmentation rule. The values of the semantic conflict feature vector are also split into multiple feature groups according to the segmentation rule.
[0025] Based on the number of directly associated nodes in the structural connection relationship between the codes, the 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, the step of generating a defect location probability distribution based on the cross-modal defect feature set, and analyzing the abnormal segmentation results of the physical state parameters through the defect location probability distribution to determine the dynamic repair results of cross-platform software defect information includes:
[0027] Based on the feature vector distribution of each code in the cross-modal defect feature set, the defect localization probability distribution of the code-level propagation path is calculated;
[0028] The defect location probability distribution is matched with the abnormal segmentation results of the physical state parameters by region overlap, and target code regions whose region overlap exceeds a preset threshold are filtered out.
[0029] Based on the upstream and downstream call chains of the target code region in the code dependency graph, a patch code fragment compatible with the upstream and downstream call chains is selected from the preset repair strategy library. According to the injection order and version constraints of the patch code fragment, a dynamic repair result is output.
[0030] Optionally, the step of selecting a patch code fragment compatible with the upstream and downstream call chains from a preset repair strategy library based on the upstream and downstream call chains of the target code region in the code dependency graph includes:
[0031] 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, and match the injection position of each patch in the preset repair strategy library to filter candidate patches that cover the upstream and downstream call chains;
[0032] Verify the correspondence between the response parameters of the candidate patches and the interface parameter definitions, and filter version adaptation patches that are compatible with the current version based on the historical version evolution records in the code dependency graph;
[0033] Analyze the conflict relationship between the runtime environment dependencies of the version adaptation patch and the current software environment, remove the version adaptation patches with conflicts, sort the remaining version adaptation patches, and generate patch code snippets.
[0034] Optionally, the synchronous acquisition software collects the physical state parameters of distributed hardware nodes and dynamically couples these physical state parameters with the context association matrix to generate a state evolution graph, including:
[0035] By collecting physical status parameters of distributed hardware nodes in the software, the physical status parameters include time-series data streams of central processing unit occupancy, storage resource allocation status, and power supply voltage fluctuation values.
[0036] The time-series data stream is divided into physical state segments according to the sampling time window, and the code execution path is parsed based on the runtime log time sequence. The physical state segments and the code execution path are input into the context association matrix for multi-dimensional encoding to generate a joint feature vector.
[0037] Based on the correlation strength between the code execution path and the physical state fragment in the joint feature vector, a state evolution map is constructed.
[0038] Secondly, this application provides a software defect information fusion system based on multi-source data, comprising:
[0039] The acquisition module acquires multi-source heterogeneous data from the cross-platform software runtime environment. The multi-source heterogeneous data includes static code features, runtime log time sequence, and user feedback text.
[0040] The 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 sequence using the logical association between code entities in the code dependency graph, and aligns the runtime log time sequence with the software defect triggering nodes in the user feedback text in time and space to generate a context association matrix.
[0041] The acquisition module 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 map.
[0042] The fusion module generates a cross-modal defect feature set by fusing the code dependency graph, state evolution graph, and user feedback text.
[0043] The determination module generates a defect location probability distribution based on the cross-modal defect feature set, and analyzes the abnormal segmentation results of the physical state parameters through the defect location probability distribution to determine the dynamic repair results of cross-platform software defect information.
[0044] Thirdly, embodiments of this application provide a computing device, including a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are to be invoked 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] Fourthly, embodiments of this application provide a computer storage medium storing a computer program, which, when executed by a computer, implements a software defect information fusion method based on multi-source data as described in the first aspect.
[0046] This application embodiment acquires multi-source heterogeneous data from a cross-platform software runtime environment. This 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 between the static code features and a historical defect database. The runtime log time-series sequences are defined using the logical relationships between code entities in the code dependency graph. These sequences are then spatiotemporally aligned with software defect triggering nodes in the user feedback text to generate a context association matrix. Simultaneously, physical state parameters of distributed hardware nodes in the software are collected, and these 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 results of the physical state parameters are analyzed using this defect location probability distribution to determine the dynamic repair results 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 sequences, and user feedback text, covering three key dimensions: code logic, runtime behavior, and user perception. A code dependency graph is generated based on the correlation between static code features and a historical defect database, revealing the call paths between modules and the patterns of defect propagation, providing structured constraints for parsing log time-series sequences. By aligning the runtime log time-series sequences with the defect triggering nodes in user feedback text in a spatiotemporal manner, a mapping between code execution paths and user operation scenarios is established, resolving the problem of cross-modal data time-series misalignment. Real-time monitoring of hardware resource consumption and environmental parameters, combined with a context association matrix to generate a state evolution graph, captures coupling anomalies between the physical environment and software behavior. Features from the code dependency graph, state evolution graph, and user feedback text are fused to construct a unified feature space representing defect propagation paths, hardware coupling anomalies, and semantic conflicts. Based on the cross-modal feature set, defect propagation probabilities are quantified, and target code regions are selected based on physical state anomaly segmentation results. Precise dynamic repair is achieved through version compatibility patch injection.
[0049] Furthermore, structural connection relationships between modules in the code dependency graph are extracted to generate structural weight coefficients. Periodic fluctuation patterns of hardware resource consumption in the state evolution graph are analyzed to identify physical anomaly intervals. User feedback text and code identifiers are matched to generate semantic conflict feature vectors. The amplitude of physical anomalies is adjusted based on structural weights and concatenated with semantic features. Finally, a cross-modal defect feature set is generated through topological constraints. By dynamically correcting physical anomaly parameters with structural weights, accurately aligning semantic conflict features with code logic, and fusing topological constraints on multimodal data, this approach addresses the issues of missing hardware environment parameters, semantic association gaps, and lagging repair strategies in existing technologies, significantly improving the accuracy of cross-platform defect localization and the reliability of repair.
[0050] These or other aspects of this application will become more apparent in the following description of the embodiments. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0052] Figure 1 A flowchart of a software defect information fusion method based on multi-source data provided in this application is shown;
[0053] Figure 2 This paper presents a schematic diagram of the structure of a software defect information fusion system based on multi-source data provided in this application.
[0054] Figure 3 A schematic diagram of the structure of a computing device provided in this application is shown. Detailed Implementation
[0055] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0056] In some of the processes described in the specification, claims, and accompanying drawings of this application, multiple operations appearing in a specific order are included. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or may be executed in parallel. The operation numbers, such as 101, 102, etc., are merely used to distinguish different operations and do not themselves represent any execution order. Furthermore, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first," "second," etc., in this document are used to distinguish different messages, devices, modules, etc., and do not represent a chronological order, nor do they limit "first" and "second" to different types.
[0057] This application addresses the challenge of cross-platform software defect localization by proposing a dynamic analysis method that integrates multi-source data. It constructs a code dependency graph based on a historical defect database and defines the log time-series structure using code entity logic. Natural language processing (NLP) is used to analyze defect triggering scenarios in user feedback, aligning them spatiotemporally with log timestamps and code nodes to generate a unified contextual association matrix representing multi-source data. Hardware parameters are simultaneously collected and dynamically coupled to the association matrix using time-series fluctuation analysis to construct a state evolution graph. By fusing the code graph, evolution graph, and user feedback to extract cross-modal features, and through probability distribution modeling and anomaly segmentation analysis, a repair plan is dynamically generated. This method solves the problems of data fragmentation, coordination bias, and computational redundancy in existing technologies, achieving efficient and accurate defect localization and repair.
[0058] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0059] Figure 1 This application provides a flowchart of a software defect information fusion method based on multi-source data, as illustrated in the embodiments of this application. Figure 1 As shown, the method includes:
[0060] 101. Obtain multi-source heterogeneous data in the cross-platform software runtime environment, wherein the multi-source heterogeneous data includes static code features, runtime log time sequence, and user feedback text;
[0061] In this step, static code features refer to structured data, including control flow graphs, function call relationships, and code complexity, which are used to describe the code's logical structure and inter-module dependencies.
[0062] Runtime log time sequence is a stream of software runtime events recorded by timestamps, including dynamic behavioral data such as thread states, exception events, and resource utilization.
[0063] User feedback text is a description of defects submitted by users through the interface, including the operation scenario and the abnormal phenomenon.
[0064] In this embodiment, static code features are obtained by parsing the source code using static code analysis tools to extract the abstract syntax tree, control flow graph, and dependencies, such as using syntax parsing-based algorithms to identify function call chains. Runtime log time-series sequences are captured in real-time by a log collection framework, sorted by timestamps, and associated with contextual information, such as collecting abnormal events in a distributed system through a log collection and analysis platform. User feedback text needs to be cleaned and annotated using natural language processing techniques, such as using pre-trained language models to perform entity recognition and sentiment analysis on the text, extracting keywords and scene descriptions related to the defects. Finally, the three types of data are uniformly stored as multi-source heterogeneous data, ensuring 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 latency and device response timeouts in real time, forming a timestamped log sequence; text from user feedback such as "bedroom lights cannot be remotely turned off" and "air conditioner status update delay" are semantically analyzed to extract keywords such as "delay" and "no response," and correlated with abnormal time periods in the logs. The integration of these three types of data forms a multi-source dataset containing code structure, runtime exceptions, 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 sequence using the logical association between code entities in the code dependency graph, and align the runtime log time sequence with the software defect triggering nodes in the user feedback text in time and space to 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, which marks 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 the corresponding code nodes.
[0069] Spatiotemporal alignment matches log event timestamps with the time windows of defect-triggered actions in user feedback, thus linking code execution with user behavior.
[0070] In this embodiment, the code dependency graph is constructed based on static code features, using a graph database to store classes, methods, and their call relationships, and incorporating a historical defect database to mark high-risk nodes (such as functions that have previously experienced memory leaks). The runtime log time series is divided into multiple segments by time windows, and a dynamic time warping algorithm is used to align them with the defect time points mentioned in user feedback; for example, matching "payment timeout" feedback with database connection timeout events in the logs. The context association matrix integrates the logical relationships in the code dependency graph, the temporal distribution of log events, and the semantic features of user feedback using tensor decomposition technology to generate a three-dimensional matrix. Each element in the matrix represents the association strength between a specific code entity and the defect described by the user within a certain time window.
[0071] The code dependency graph shows that the "Device Status Synchronization" method calls two sub-modules: "Gateway Communication Protocol Parsing" and "Device Command Issuance," and the historical defect database has recorded a "protocol parsing timeout" issue. During the period when users reported "bedroom lights could not be turned off," logs showed frequent "gateway communication latency exceeded threshold" events. Aligning the logs with the feedback time points using a dynamic time warping algorithm revealed that the latency events overlapped with the execution time of the "protocol parsing" sub-module. In the generated context association matrix, the "protocol parsing" module showed the strongest correlation with user feedback, indicating that it is likely the root cause of the defect.
[0072] 103. Synchronously collect the physical state parameters of the distributed hardware nodes in the software, and dynamically couple the physical state parameters with the context association matrix to generate a state evolution map;
[0073] In this step, physical status parameters include hardware indicators such as CPU utilization, memory allocation status, server temperature, and power supply voltage fluctuation.
[0074] Dynamic coupling combines physical parameter time-series data with the code-log-user association matrix to analyze the correlation patterns between hardware status and software behavior.
[0075] The state evolution graph is a dynamic topology graph generated by fusing physical parameters and contextual correlation matrices, which reveals the correlation between hardware state and software defects.
[0076] In this embodiment, physical state parameters are collected using a distributed monitoring tool, which collects the CPU utilization of server nodes and normalizes it to 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, detecting whether the peak CPU utilization coincides with the execution time of high-load methods in the code dependency graph. The state evolution graph is constructed based on a graph neural network, where nodes represent hardware or code entities, and edge weights represent the strength of state influence. If a server's memory leak causes slow code execution, a high-weight edge will be generated in the graph from that server node to the relevant code entity.
[0077] Monitoring revealed that the network latency of a certain gateway node fluctuated drastically during the period reported by users, with high peak CPU utilization. Temporal convolutional network analysis showed that the latency peaks completely overlapped with the execution time of the "protocol parsing" module, and this module consumed a significant amount of CPU resources. In the state evolution graph, the edge weight between the gateway node and the "protocol parsing" module increased significantly, and this was correlated with the "latency" issue reported by users, indicating that insufficient hardware resources and code logic defects jointly caused the problem.
[0078] 104. By fusing the code dependency graph, state evolution graph, and user feedback text, a cross-modal defect feature set is generated;
[0079] In this step, the state evolution graph is a dynamic topology graph generated by fusing physical parameters and contextual correlation matrices, revealing the correlation between hardware state and software defects.
[0080] The cross-modal defect feature set is a unified feature set that integrates code structure, hardware state, and user semantics. It includes the embedding vector of the code dependency graph, the topological index of the state evolution graph, and the semantic vector of user feedback.
[0081] In this embodiment, code modality features are transformed into low-dimensional vectors from code dependency graphs using graph embedding algorithms; state modality features extract indicators such as node degree centrality and clustering coefficients from state evolution graphs; and user feedback modality features generate text semantic vectors using pre-trained language models. 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 vector of the "protocol parsing" module in the code dependency graph shows that its code complexity exceeds the limit; the state evolution graph shows that the gateway node has the highest degree centrality in the entire system; the semantic vector of user feedback highlights the keywords "latency" and "protocol". After weighting through the attention mechanism, the cross-modal feature set indicates that the excessive gateway load causes the "protocol parsing" module to take too long to execute, and the module itself contains redundant loop logic, requiring optimization of both the code and hardware configuration.
[0083] 105. Generate a defect location probability distribution based on the cross-modal defect feature set, and analyze the abnormal segmentation results of the physical state parameters through the defect location probability distribution to determine the dynamic repair results of cross-platform software defect information.
[0084] In this step, the defect location probability distribution quantifies the defect propagation probability of each code module and combines it with physical anomaly areas to filter target modules.
[0085] Anomaly segmentation uses clustering algorithms to divide abnormal regions of physical state parameters.
[0086] The dynamic fix result is to select compatibility patches based on the dependency chain of the target module and inject fix code according to version constraints.
[0087] In this embodiment, the defect location probability distribution is calculated using a Bayesian network, combining code complexity, historical defect rate, and current hardware status to predict the defect probability. Anomaly segmentation employs a density clustering algorithm to identify outliers in physical parameters, generating 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 set analysis showed an excessively high probability of defects in the "protocol parsing" module. Anomaly segmentation revealed that both network latency and CPU utilization at the gateway node exceeded normal thresholds. The system automatically triggered a repair process: migrating some device command distribution tasks to a less overloaded backup gateway; using a patch generation tool to simplify the loop logic of the "protocol parsing" module; and releasing updated code through a canary rollout while monitoring latency and CPU utilization in real time. After the repair, gateway latency decreased, user-reported issues disappeared, and the functionality of other devices was not affected.
[0089] In summary, steps 101 to 105, using a smart home control system as an example, accurately pinpointed the coupling issue between code defects in the "protocol parsing" module and gateway resource bottlenecks by integrating code, logs, user feedback, and hardware status data. The remediation strategy simultaneously optimized code logic and hardware load distribution, improving system response speed and reducing user complaint rates. Its core value lies in breaking the limitations of a single data source, achieving root cause localization of complex defects through cross-modal analysis, and supporting automated closed-loop remediation, significantly improving the reliability and operational efficiency of cross-platform software.
[0090] To address the issues of accuracy and scenario adaptability in cross-modal defect feature extraction within software systems, this paper extracts structural weight coefficients from the code dependency graph through static code analysis, identifies periodic anomaly intervals in hardware resources using temporal clustering algorithms, and generates semantic conflict feature vectors by matching user feedback text with code identifiers using natural language processing techniques. Finally, a dynamic weighting mechanism is used to fuse the three types of features to generate a cross-modal defect feature set under topological constraints. In some embodiments, step 104, which involves fusing the code dependency graph, state evolution graph, and user feedback text to generate the cross-modal defect feature set, includes:
[0091] 201. Extract the structural connection relationships between each piece of code in the code dependency graph, and generate structural weight coefficients based on the call depth and dependency strength of the code;
[0092] In step 201, structural connectivity refers to the logical relationships between functions, classes, or modules in the code dependency graph, such as calls, inheritance, and parameter passing, including direct and indirect dependencies. Call depth is the number of nested levels in the code hierarchy. Dependency strength reflects the tightness of the dependencies between code entities and is quantified by metrics such as call frequency and parameter passing complexity.
[0093] In this embodiment, static code analysis tools are 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, recording the call level of each node. Second, the call frequency between modules is counted by combining dynamic execution logs, and the complexity of logical branches is evaluated using cyclomatic complexity to quantify the dependency strength. Finally, a linear weighted model is used to fuse call depth and dependency strength to generate a structure weight coefficient matrix. For example, the communication module, due to its high-frequency calls and involvement of multi-threaded synchronization, has a significantly higher weight coefficient than other modules.
[0094] 202. Analyze the periodic fluctuation pattern of hardware resource consumption data in the state evolution graph, and identify the abnormal physical state intervals associated with the software operation stage based on the periodic fluctuation pattern.
[0095] In step 202, the periodic fluctuation pattern refers to the regular change in hardware resource consumption over time, such as during daily peak load periods or task scheduling cycles. The abnormal physical state interval is the period during which resource consumption deviates from the normal fluctuation range, such as sustained high usage due to memory leaks.
[0096] In this embodiment, the system collects the periodic fluctuation patterns of memory and processor consumption data during system operation, and separates long-term trends and short-term fluctuations using a time series decomposition algorithm. The mean and standard deviation of the data within the window are calculated using a sliding window statistical method, and outliers are identified by combining this with threshold judgment. Furthermore, adjacent outliers are merged using morphological filtering to form continuous physical state anomaly intervals. For example, if a network communication interruption causes the processor load to continuously exceed the limit during peak hours, the system marks this as a physical state anomaly interval and associates it with communication module call anomalies.
[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 words and phrases in the user feedback text that describe the defect, such as "voice control response delay." The code identifier is the name of a 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 functionality, such as the deviation between the delay description and the expected performance of the response function.
[0099] In this embodiment, a pre-trained natural language model is used to semantically encode identifiers in user text and code comments, and the similarity between keywords and code functions is calculated. Dependency parsing is used to extract action and object relationships from user descriptions and compares them with code logic branches. If timeout retries or exception handling are not implemented in the code, a high-dimensional semantic conflict feature vector is generated. For example, if a user feedback "night mode failure" maps to logic in the code that does not handle network disconnection, the "missing exception handling" dimension in the semantic conflict feature vector will be significantly higher.
[0100] 204. Adjust the amplitude range of the physical state anomaly interval based on the structural weight coefficient, and concatenate the adjusted physical state anomaly interval with the semantic conflict feature vector to generate a multi-dimensional fusion feature.
[0101] In step 204, the physical state anomaly interval is the period during which resource consumption deviates from the normal fluctuation range, such as persistent high usage caused by memory leaks. Amplitude range adjustment involves scaling the numerical range of the physical anomaly interval based on the structural weight coefficients; for example, reducing the anomaly value of frequently called modules to minimize interference. The multi-dimensional fusion feature is a joint representation vector integrating structural, resource, and semantic features.
[0102] In this embodiment, the amplitude of the abnormal interval is first adjusted according to the weight of the code structure. For example, the peak processor load of the communication module is amplified by a weight coefficient to highlight its importance. Then, the adjusted resource consumption data is concatenated with the semantic conflict vector to form a high-dimensional fusion feature. To avoid dimensional redundancy, principal component analysis is used for dimensionality reduction, retaining key features as the final multi-dimensional fusion feature. For example, after concatenating the load anomaly caused by communication timeout with the "no response" semantic conflict, dimensionality reduction yields a low-dimensional feature that clearly points to the interface function that has not implemented a timeout retry mechanism.
[0103] 205. Apply topological constraints to the multi-dimensional fusion features based on the structural connection relationship, and output a cross-modal defect feature set.
[0104] In step 205, topological constraints restrict feature distribution based on code structure connections; 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 this embodiment, a graph-structured network is constructed, using a code dependency graph as the adjacency matrix and fusion features as node attributes. Information from adjacent nodes is aggregated through message passing. For example, after the abnormal features of the temperature control module are supplemented by neighboring nodes of the communication module, an interface call timeout problem is identified. Simultaneously, regularization constraints are designed to ensure that features are smooth and continuous in the topology, avoiding interference from logically unrelated modules. Finally, a cross-modal defect feature set is output, such as locating the communication interface's failure to implement an exponential backoff retry mechanism, and associating it with the "frequent disconnections" problem reported by users.
[0106] Here is a specific example:
[0107] An air conditioning system experienced a "no response after setting temperature" issue, with user feedback pointing to the temperature control module. This module has a three-layer call depth, relies on a communication interface, and is frequently called, thus receiving high weight. Abnormal processor load was observed during peak daily hours, coinciding with user actions. User "no response" feedback mapped to the temperature setting interface, but the code failed to handle network latency. Merging the high-weighted load anomaly with the semantic conflict of "unhandled latency" pointed to the communication interface. The dependency graph showed a strong correlation between the communication module and temperature control, ultimately revealing that the interface lacked timeout retry logic.
[0108] In summary, steps 201 to 205 quantify module importance through code structure weighting and combine resource consumption patterns with user semantic conflicts to achieve multi-dimensional collaborative defect analysis. In smart home scenarios, this method accurately distinguishes between normal load fluctuations and real faults, such as temperature control failure caused by communication anomalies. Semantic conflict extraction bridges the gap between user feedback and code logic, while topological constraints ensure the rationality of features within the system architecture. In practical applications, the efficiency of air conditioning system fault location is significantly improved, the false alarm rate is reduced, and a scalable framework is provided for multi-device collaborative diagnosis.
[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. The structural weight coefficients are converted into adjustment coefficients for physical anomaly intervals using a progressively decreasing function. Cross-modal features are uniformly quantized through nonlinear encoding to form multi-dimensional fused data. In some embodiments, step 204, which involves adjusting the amplitude range of the physical state anomaly interval based on the structural weight coefficients and concatenating the adjusted physical state anomaly interval with the semantic conflict feature vector to generate multi-dimensional fused features, includes:
[0110] 301. Based on the code call depth, convert the structural weight coefficients into adjustment coefficients for the abnormal physical state intervals according to the rule of decreasing layer by layer;
[0111] In step 301, the call depth refers to the hierarchical nesting relationship of code modules, such as the number of levels at which the main control module calls sub-functional modules. The adjustment coefficient is a value generated based on the call depth and is used to quantify the influence weight of different levels of modules on anomaly detection.
[0112] In this embodiment, the hierarchical call relationships between modules are extracted by recursively traversing the code dependency graph. A progressively decreasing rule is used to convert the call depth into an adjustment coefficient. The top-level module is assigned the highest initial coefficient, and the coefficient decreases exponentially with each additional layer of nesting. Simultaneously, the coefficients are normalized based on the dynamic call frequency of the modules to ensure that deeply nested modules with high-frequency calls retain reasonable weights. Finally, a set of adjustment coefficients matching the code structure is generated.
[0113] 302. Based on the adjustment coefficient, the numerical range of the physical state abnormality interval is proportionally adjusted to obtain the adjusted physical state abnormality interval;
[0114] In step 302, the abnormal physical state range refers to the data range that exceeds the normal threshold during equipment operation, such as excessively high temperature or abnormal humidity. The proportional adjustment scales the numerical range of the abnormal range based on an adjustment coefficient; for example, abnormal values from high-weight modules require a wider monitoring amplitude.
[0115] In this embodiment, the numerical range of the physical state anomaly interval is linearly scaled. Taking a communication module as an example, if its adjustment coefficient is high, the abnormal load peak corresponding to that module is amplified proportionally. Simultaneously, a robust statistical method is used to filter noise interference, ensuring that the adjusted interval reflects both the importance of the module and the accuracy of the data distribution. The final output is a smoothed physical state anomaly interval.
[0116] 303. Connect the adjusted physical state anomaly interval with the semantic conflict feature vector in a preset order to generate multidimensional data. The dimensionality 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 that integrates numerical values of abnormal intervals and semantic conflict vectors, such as concatenating time-series load data and semantic difference measures. Dynamic allocation adjusts the proportion of features in different dimensions according to the connection relationships in the code structure, such as increasing the proportion of features from strongly dependent modules.
[0118] In this embodiment, the adjusted abnormal interval data, such as time-series waveforms, are concatenated with semantic conflict vectors along the channel dimension. Based on the module connectivity of the code dependency graph, such as the number of sub-modules associated with a given module, the feature dimensions are dynamically weighted. Modules with high connectivity have their feature weights increased, while modules with low connectivity have their weights decreased. Principal component analysis is used to remove redundant dimensions, retaining key features to form compact multidimensional data.
[0119] 304. Perform nonlinear transformation encoding on the multidimensional data to generate multidimensional fusion features with a unified quantization range.
[0120] In step 304, nonlinear transformation coding performs a nonlinear mapping on multidimensional data to unify the quantization scale of different modal features. Unifying the quantization range means that all features are ultimately compressed to the same numerical range, which facilitates subsequent model processing.
[0121] In this embodiment, a nonlinear activation function, such as the hyperbolic tangent function, is used to normalize the multidimensional data, compressing it to a uniform numerical range. A self-attention mechanism is introduced to calculate the association weights of cross-modal features, such as the association strength between anomalous load and semantic conflict, and feature fusion is performed through a fully connected neural network. Finally, multidimensional fused features with uniform scale and consistent semantics are generated for defect classification and localization.
[0122] Here is a specific example:
[0123] When a smart air conditioning system experienced a "no response after temperature setting" issue, analyzing the code dependency graph revealed a deep hierarchy in the temperature control main module's communication interface calls. A high adjustment coefficient was generated based on the high-frequency call characteristics. An abnormal load was detected at the communication interface; the peak value was amplified by the adjustment coefficient, and sensor noise was filtered out while retaining the valid abnormal range. The adjusted load data was concatenated with the semantic vector generated from the user's "no response" feedback, and the feature weights were increased according to the communication module's connectivity. A fusion feature was generated through non-linear encoding, pinpointing the missing timeout retry mechanism in the communication interface, and the system automatically pushed a fix patch.
[0124] In summary, steps 301 to 304, by invoking the weight coefficients of the deep generation module and combining dynamic allocation with nonlinear coding, achieve accurate fusion of cross-modal features. In smart home scenarios, this can distinguish between normal load fluctuations and genuine defects, and correlate user feedback semantics with code logic. For example, the "no response" problem of an air conditioning system can be accurately mapped to an unhandled anomaly in the communication module, avoiding misjudgments caused by the separation of code and physical state in traditional methods. Through dynamic weight adjustment and robust filtering, the efficiency of defect localization in complex systems is significantly improved, providing a scalable framework for multi-device collaborative diagnosis.
[0125] To address the structural adaptability issue of multimodal feature fusion in smart home systems, physical anomaly numerical segments are divided based on code call depth, and semantic feature vectors are simultaneously split into feature groups. Graph neural networks are used to analyze the number of directly related nodes in the code dependency graph, dynamically allocating the connection ratio between numerical segments and feature groups to achieve a strong correlation between data dimensions and code topology. In some embodiments, step 303, which involves connecting the adjusted physical state anomaly intervals and the semantic conflict feature vectors in a preset order to generate multidimensional data, wherein the dimensionality ratio of the multidimensional data is dynamically allocated based on the structural connection relationships between the codes, includes:
[0126] 401. Based on the code call depth, set segmentation rules, divide the values in the adjusted physical state abnormal interval into multiple continuous value segments according to the segmentation rules, and split the values of the semantic conflict feature vector into multiple feature groups according to the segmentation rules.
[0127] In step 401, the segmentation rule is a strategy for dividing data segments based on code call depth. Modules with deeper call depths correspond to finer-grained data segmentation. Continuous numerical segments are continuous data units cut according to the segmentation rule within an abnormal physical state interval, such as segments of a time-series load waveform. Feature groups are sets of sub-vectors split according to the same segmentation rule within semantically conflicting feature vectors, such as the separation of action descriptions and state descriptions in user feedback.
[0128] In this embodiment, segmentation rules are set according to the call depth of code modules, with shallower modules corresponding to coarse-grained segments and deeper modules corresponding to fine-grained segments. The adjusted physical state anomaly interval data is uniformly divided into multiple continuous numerical segments according to a time window, and semantic conflict feature vectors are split into feature groups with the same number of segments. For example, the main control module has fewer segments, and its corresponding abnormal data segments and semantic feature groups are longer; the communication interface module has more segments, and its data segments and feature groups are shorter.
[0129] 402. Based on the number of directly associated nodes in the structural connection relationship between the codes, dynamically allocate the connection ratio between the continuous numerical segments and the feature groups, 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 associated 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 associated with three modules: sensor, communication, and user interface. The connection ratio is the weight allocation ratio between numerical segments and feature groups when concatenating them. For example, modules with more associated nodes are assigned a higher ratio. Alternating arrangement means sequentially and cross-concatenating numerical segments and feature groups to form a heterogeneous data stream.
[0131] In this embodiment, the statistical code relies on the number of directly related nodes of the current module in the graph. If a module has many related nodes, a higher connection ratio is allocated to the numerical segments of that module, while the proportion of feature groups is reduced; conversely, the proportion of numerical segments is reduced. Subsequently, the numerical segments and feature groups are alternately arranged according to the connection ratio. For example, an abnormal load data segment is inserted first, followed by the corresponding semantic conflict feature, and this process is repeated until completion to generate multidimensional data. Through dynamic ratio allocation, the feature expression of strongly related modules is ensured to be more prominent.
[0132] Here is a specific example:
[0133] After an air conditioning system experienced a "temperature adjustment delay" issue, the code dependency graph was analyzed. The temperature control main module had a shallow call depth, divided into three segments; the sensor interface had a deeper call depth, divided into five segments. The adjusted central processing unit load anomaly data was segmented into three segments, and the user-reported "delay" semantic vector was split into three groups. The temperature control module directly connects to the communication and sensor modules, with two nodes, and the ratio of numerical segments to feature groups is three to one. The load data segments and semantic feature groups are alternately concatenated according to this ratio, generating multidimensional data with alternating arrangements of "load peak, delayed action, load fluctuation, and status anomaly." After model analysis, the multidimensional data was identified as causing the main control module's response delay due to the sensor interface's unoptimized data polling frequency.
[0134] In summary, steps 401 to 402 achieve efficient fusion of multimodal data by invoking depth-adaptive data granularity and dynamically allocating feature proportions based on code structure. In smart home scenarios, this method accurately correlates physical anomalies with user semantic conflicts. For example, air conditioner temperature adjustment delay can be reflected as both a processor load anomaly segment and a description of "delay" action in user feedback, enhancing the causal relationship between features through alternating arrangements. Dynamic proportion allocation avoids redundant data interference, improves the model's ability to analyze complex dependencies, and makes defect localization more closely aligned with the actual system architecture. In practical applications, the efficiency of root cause analysis of air conditioning system failures is significantly improved, the false detection rate is reduced, and a reliable basis is provided for multi-device collaborative optimization.
[0135] To address the accuracy issue of cross-modal defect localization and dynamic repair in smart home systems, a Bayesian network is used to calculate the code-level defect propagation probability distribution, combined with physical state anomaly segmentation results to filter target code regions. Based on the upstream and downstream call chains of the target code, patches with compatible interface parameters are matched from the repair strategy library, and environmental conflicts are eliminated through version evolution graphs to form a dynamic repair scheme. In some embodiments, step 105, which involves generating a defect localization probability distribution based on the cross-modal defect feature set and analyzing the anomaly segmentation results of the physical state parameters using the defect localization probability distribution to determine the dynamic repair results of cross-platform software defect information, includes:
[0136] 501. Based on the feature vector distribution of each code in the cross-modal defect feature set, calculate the defect location probability distribution of the code-level propagation path;
[0137] In step 501, the cross-modal defect feature set is a multimodal defect representation that integrates code feature vectors and physical state parameters, such as the joint features of the code logic complexity of the air conditioning control module and the abnormal load of the central processing unit. The code-level propagation path is the potential path for defects to spread through the call chain in the code dependency graph; for example, anomalies in the temperature regulation function may affect the interface stability of the communication module. The defect location probability distribution quantifies the numerical probability that each code module has a defect, and maps the feature distribution to the defect propagation relationship through a probability model.
[0138] In this embodiment, a graph structure learning algorithm is used to transform 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, the communication module has a significantly higher defect probability than independent modules due to its complex call chain and abnormal resource consumption. Finally, a heatmap of defect location probability distribution is generated, marking high-risk code regions.
[0139] 502. Match the region overlap between the defect location probability distribution and the abnormal segmentation results of the physical state parameters, and filter the target code regions whose region overlap exceeds a preset threshold.
[0140] In step 502, the anomaly segmentation result is the division of the abnormal time period and spatial range (physical state parameters). Region overlap matching is the assessment of the spatiotemporal alignment between the defect probability distribution and the physical anomaly region. For example, the high defect probability period of a certain module coincides with the peak period of processor load.
[0141] In this embodiment, morphological segmentation is used to extract continuous abnormal intervals from the physical anomaly data, the defect probability distribution is mapped to the same time axis, and the similarity of overlapping regions is calculated. For example, if the overlap between the defect probability curve of the temperature control module and the abnormal period of the sensor data exceeds a preset threshold, it is determined to be a target code region. Random interference is eliminated by dynamically adjusting the threshold to ensure reliable matching results.
[0142] 503. Based on the upstream and downstream call chains of the target code region in the code dependency graph, select patch code fragments compatible with the upstream and downstream call chains from the preset repair strategy library, and output dynamic repair results according to the injection order and version constraints of the patch code fragments.
[0143] In step 503, the upstream and downstream call chains refer to the predecessor and successor modules of the target code region in the dependency relationship. The repair strategy library is a predefined collection of code patches, including thread optimization, exception handling, and other repair solutions compatible with the system architecture.
[0144] In this embodiment, the upstream and downstream call chains of the target code region are traversed to identify critical path nodes. Adaptive patches are selected from the patch library based on a dependency conflict detection algorithm, for example, injecting exception handling logic into interfaces that do not implement timeout retries. Patches are dynamically injected into the system using hot deployment technology, outputting dynamic repair results, ensuring that the repair process does not interrupt service, and verifying the compatibility of patches with upstream and downstream modules.
[0145] Here is a specific example:
[0146] When a smart air conditioning system exhibited an issue of "abnormal temperature fluctuations in night mode," cross-modal feature analysis revealed a strong correlation between the peak value of the defect probability distribution in the night mode control module and the temperature sensor interface. Matching showed that the periods of abnormal sensor data completely overlapped with the peak defect probability, pinpointing the sensor data parsing module as the target area. Tracing the call chain to the missing data verification logic node, a data smoothing filter patch was selected from the repair library, dynamically injected into the system, and its communication protocol compatibility was verified. After the repair, the temperature fluctuation issue disappeared, and the system load returned to normal.
[0147] In summary, steps 501 to 503 quantify the defect propagation path using a probabilistic model and accurately locate the root cause of the problem by combining spatiotemporal overlap matching, achieving cross-modal collaborative analysis of code logic and physical state. The dynamic repair strategy intelligently selects compatible patches based on the system call chain, avoiding the 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 linked to sensor data processing defects and can be quickly addressed by injecting adaptive filtering algorithms. Through hot deployment and dependency verification, the safety and system stability of the repair process are ensured, providing self-healing capabilities for IoT devices, reducing manual maintenance costs, and extending device lifespan.
[0148] To address 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 filter candidate patches covering the chain. The patch interface type is parsed using an abstract syntax tree, and version-compatible patches are selected based on historical version evolution records. Finally, a priority ranking is generated using a dependency conflict detection model. In some embodiments, step 503, based on the upstream and downstream call chains of the target code region in the code dependency graph, selects patch code fragments compatible with the upstream and downstream call chains from a preset repair strategy library, including:
[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, and match the injection position of each patch in the preset repair strategy library to filter candidate patches that cover the upstream and downstream call chains.
[0150] In step 601, the upstream and downstream call chains are the execution links formed by the predecessor and successor nodes of code modules in the dependency graph. Interface parameter definitions are the data types and format specifications passed during inter-module calls; for example, the temperature value parameter of a sensor interface is a floating-point type with a limited range. The injection location is the specific insertion point of the patch code in the call chain, such as the insertion location of the exception retry logic in the communication module.
[0151] In this embodiment, a depth-first search algorithm is used to parse the code dependency graph and extract the complete upstream and downstream call chain of the target module, including its predecessor modules and dependent successor modules. Symbol table resolution technology is employed to extract the parameter definitions of each interface in the call chain, such as function names, parameter types, and return value structures. These parameter definitions are then semantically matched with patch metadata in a pre-defined repair strategy library to filter out candidate patches covering key nodes in the call chain. For example, for patches addressing communication interface timeout exceptions, patches containing socket connection parameters and supporting asynchronous retry mechanisms must be matched to ensure that the injection location covers the entire data sending and receiving chain.
[0152] 602. Verify the correspondence between the response parameters of the candidate patch and the interface parameter definition, and filter version adaptation patches that are compatible with the current version based on the historical version evolution record in the code dependency graph;
[0153] In step 602, the response parameters are data structures returned after the patch execution, such as the number of retries and status codes returned by the timeout retry patch. The historical version evolution record is a log of interface changes to the code module in different versions, such as records of communication protocol parameter extensions.
[0154] In this embodiment, the evolution path of interface parameters is extracted by tracing back the historical change records of the target module through a version control system. The response parameters of candidate patches are validated for type and structure, such as verifying whether the returned status code is an integer and whether the error message is a string. Semantic difference technology is used to compare the patch parameters with the interface definition of the current version, eliminating incompatible patches due to missing fields or type conflicts, and retaining version-compatible patches. For example, if a communication protocol in a historical version added an authentication field, patch versions that support this field are selected, excluding older patches that do not contain this field.
[0155] 603. Analyze the conflict relationship between the runtime environment dependencies of the version adaptation patch and the current software environment, remove the version adaptation patches with conflicts, sort the remaining version adaptation patches, and generate patch code snippets.
[0156] In step 603, runtime environment dependencies are the system configuration conditions required for the patch to function correctly, such as the operating system kernel version and third-party library versions. Conflicts occur when patch dependencies are incompatible with the current system environment, for example, a dependency on a higher version compiler while the current environment only supports a lower version.
[0157] In this embodiment, the dependency list in the patch declaration file is parsed, including dynamic link library versions and runtime environment requirements. A dependency graph is compared with the current system environment configuration to identify conflicting dependencies; for example, a patch might require a newer version of an encryption algorithm library while the current system only supports an older 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 prioritized, followed by patches with low resource consumption. Finally, patch code snippets are generated in priority order to ensure optimal repair effect and system stability.
[0158] Here is a specific example:
[0159] A smart air conditioning system experienced frequent restarts due to abnormal temperature sensor data parsing. Analysis of the temperature control module's call chain revealed its reliance on three modules: sensor data acquisition, filtering algorithms, and communication protocols. Patches in the repair library, categorized as "data verification enhancement" and "communication protocol fault tolerance," were matched to identify candidate patches covering all nodes. Verification revealed that some patches' return parameters did not match the input type of the current filtering algorithm, while others were marked as obsolete due to incompatibility with the new communication protocol. Patches supporting protocol fault tolerance and with compatible parameters were retained. A patch dependent on a new data processing framework, while the current system ran an older framework, was removed. The remaining patches were sorted by "data verification takes precedence over protocol fault tolerance," generating a final patch queue. After injecting the data verification patch, abnormal data was intercepted and filtered, significantly reducing the system restart frequency.
[0160] In summary, steps 601 to 603 achieve precise adaptation between the patch injection location and the system architecture through full-link call chain analysis and semantic matching of interface parameters; combined with version evolution backtracking and dependency conflict detection, they ensure patch compatibility with the current environment. In smart home scenarios, this method can effectively solve the system crash problem caused by patch and module parameter mismatch in traditional methods. For example, legacy issues from protocol upgrades in air conditioning systems can be avoided by filtering historically compatible patch versions to prevent functional abnormalities. By dynamically sorting and optimizing the patch injection order, root cause defects are prioritized for repair, significantly improving system stability and repair efficiency, providing IoT devices with safe and reliable online hot-fix capabilities, reducing maintenance costs, and extending device lifespan.
[0161] To address patch dependency conflicts and deployment order optimization issues, a multi-source data synchronous acquisition framework is designed. Hardware parameters are segmented into state fragments and co-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, 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. By collecting physical status parameters of distributed hardware nodes in the software, the physical status parameters include time-series data streams of central processing unit occupancy rate, storage resource allocation status, and power supply voltage fluctuation values;
[0163] In step 701, distributed hardware nodes are physical device units deployed in a dispersed manner within the 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 the hardware nodes during operation, including time-series data reflecting the device's health status, such as CPU resource consumption, memory usage, and power supply voltage fluctuations. The time-series data stream is a continuously collected set of physical state parameters in a time-series format, containing timestamps, parameter values, and data quality identifiers.
[0164] In this embodiment, the real-time status of hardware nodes is acquired using multi-source heterogeneous data acquisition technology. For devices supporting communication protocols, the CPU utilization and storage resource allocation data are directly read via interface calls; for nodes without open protocols, external sensors are deployed to collect power supply voltage fluctuation values. A sliding window mechanism is used to denoise the raw data, and outliers are removed to generate a time-series data stream with timestamps. For example, voltage fluctuation data from a temperature control terminal is acquired via a Hall sensor, converted from analog to digital, and uploaded to the central processing unit at a frequency of seconds.
[0165] 702. The time-series data stream is divided into physical state segments according to the sampling time window, and the code execution path is parsed based on the runtime log time-series sequence. The physical state segments and the code execution path are input into the context association matrix for multi-dimensional encoding to generate a joint feature vector.
[0166] In step 702, the physical state segment is a subset of physical state parameters divided according to a time window, representing the operational 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 flow of business logic and resource scheduling relationships. The context association matrix is a multi-dimensional data structure used to encode the relationship between physical state and code logic, revealing the coupling characteristics of hardware performance and software behavior.
[0167] In this embodiment, the time-series data stream is dynamically segmented into windows, with the window length dynamically adjusted according to the device type. Runtime logs are parsed synchronously to extract function call stacks, thread switching records, etc., 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, constructing a context association matrix. For example, the peak CPU utilization of the air conditioning control module is strongly correlated with frequent calls to the temperature calibration function and is given a higher weight in the matrix. Finally, the matrix is encoded into a joint feature vector containing spatiotemporal features.
[0168] 703. Based on the correlation strength between the code execution path and the physical state fragment in the joint feature vector, construct a state evolution map.
[0169] In step 703, the association strength is a quantitative indicator of the coupling degree 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, and includes nodes, edges, and weight attributes.
[0170] In this embodiment, a graph neural network is used to perform topological modeling of the joint feature vector. Physical state segments and code execution paths are mapped to graph nodes, and the correlation strength between nodes is calculated using cosine similarity as edge weights. A time-sliding window mechanism is introduced to establish cross-time period state transition relationships. For example, the decreasing trend of CPU utilization in an air conditioning system during three consecutive time periods in cooling mode forms a "high load, high load, and low load" state transition path. Finally, a visualized state evolution graph containing device health and anomaly propagation paths is generated.
[0171] Here is a specific example:
[0172] After a central air conditioning system experienced intermittent heating failure, distributed node data was collected, including CPU occupancy on the main control board, storage resource fluctuations, and abnormal power supply fluctuations detected by voltage sensors. Data was segmented into five-minute windows, and log analysis revealed frequent calls to invalid calibration functions when the heating mode was triggered. A correlation matrix showed a high correlation between voltage fluctuations and calibration function calls. A state evolution graph was generated, revealing the path leading to an infinite loop in the calibration function due to voltage anomalies, pinpointing a coupling defect between power module aging and software fault tolerance. After replacing the power module and injecting a voltage threshold detection patch, the system returned to stable operation.
[0173] In summary, steps 701 to 703, through multimodal data fusion and spatiotemporal correlation modeling, achieve a precise depiction of the collaborative state of the smart home system's hardware and software. In the central air conditioning case, this method effectively identifies the coupling defect between power hardware degradation and the lack of software fault-tolerant logic, overcoming the limitations of traditional single-dimensional diagnosis. The state evolution graph provides a visualized anomaly propagation path, supporting root cause analysis and predictive maintenance. In practical applications, system fault location efficiency is improved, maintenance costs are reduced, and technical support is provided for the full lifecycle management of complex IoT devices.
[0174] Figure 2 This application provides a schematic diagram of the structure of a software defect information fusion system based on multi-source data, as shown in the embodiments of this application. Figure 2 As shown, the system includes:
[0175] The acquisition module 21 acquires multi-source heterogeneous data in the cross-platform software runtime environment. The multi-source heterogeneous data includes static code features, runtime log time sequence, and user feedback text.
[0176] The 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 sequence using the logical association between code entities in the code dependency graph, and aligns the runtime log time sequence with the software defect triggering nodes in the user feedback text in time and space 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 map.
[0178] The fusion module 24 generates a cross-modal defect feature set by fusing the code dependency graph, state evolution graph, and user feedback text.
[0179] The determination module 25 generates a defect location probability distribution based on the cross-modal defect feature set, and analyzes the abnormal segmentation results of the physical state parameters through the defect location probability distribution to determine the dynamic repair results of cross-platform software defect information.
[0180] Figure 2 The aforementioned software defect information fusion system based on multi-source data can execute... Figure 1 The implementation principle and technical effects of the software defect information fusion method based on multi-source data described in the illustrated embodiment will not be repeated here. The specific methods by which each module and unit performs operations in the software defect information fusion system based on multi-source data in the above embodiments have been described in detail in the embodiments related to this method, and will not be elaborated upon here.
[0181] In one possible design, Figure 2 The software defect information fusion system based on multi-source data in the illustrated embodiment 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 invoked and executed by the processing component 32.
[0183] The processing component 32 is used for the above Figure 1 The embodiment describes a method for fusing software defect information based on multi-source data.
[0184] The processing component 32 may include one or more processors to execute computer instructions to complete all or part of the steps in the above-described method. Alternatively, the processing component may 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-described method.
[0185] 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 storage 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 storage, flash memory, magnetic disk, or optical disk.
[0186] Of course, computing devices may also include other components, such as input / output interfaces, display components, communication components, etc.
[0187] Input / output interfaces provide interfaces between processing components and peripheral interface modules, which can be output devices, input devices, etc.
[0188] The communication components are configured to facilitate wired or wireless communication between computing devices and other devices.
[0189] The computing device can be a physical device or an elastic computing host provided by a cloud computing platform. In this case, the computing device can refer to a cloud server, and the aforementioned processing components, storage components, etc., can be basic server resources rented or purchased from the cloud computing platform.
[0190] This application also provides a computer storage medium storing a computer program, which, when executed by a computer, can perform the above-described functions. Figure 1 The embodiment shown is a software defect information fusion method based on multi-source data.
[0191] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing 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. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0193] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0194] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for fusing software defect information 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 sequence, and user feedback text; Based on the association between the static code features and the historical defect library, a code dependency graph is constructed. The logical association between code entities in the code dependency graph is used to define the runtime log time sequence. The runtime log time sequence is spatiotemporally aligned with the software defect triggering nodes in the user feedback text to generate a context association matrix. The physical state parameters of distributed hardware nodes in the synchronous acquisition software are dynamically coupled with the context association matrix to generate a state evolution map. By fusing the code dependency graph, state evolution graph, and user feedback text, a cross-modal defect feature set is generated; Based on the cross-modal defect feature set, a defect location probability distribution is generated, 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 cross-platform software defect information. The step of generating a cross-modal defect feature set by fusing the code dependency graph, state evolution graph, and user feedback text includes: Extract the structural connections between the code in the code dependency graph, and generate structural weight coefficients based on the call depth and dependency strength of the code; The periodic fluctuation pattern of hardware resource consumption data in the state evolution graph is analyzed, and the abnormal physical state intervals associated with the software operation stage are identified based on the periodic fluctuation pattern. The natural language description in the user feedback text is matched with the identifier of the code, and a semantic conflict feature vector is generated based on the difference between the natural language description and the identifier in the matching result. The amplitude range of the physical state anomaly interval is adjusted based on the structural weight coefficient, and the adjusted physical state anomaly interval is concatenated with the semantic conflict feature vector to generate a multi-dimensional fusion feature. Based on the structural connection relationship, topological constraints are applied to the multi-dimensional fusion features to output a cross-modal defect feature set.
2. The method according to claim 1, characterized in that, The adjustment of the amplitude range of the physical state anomaly interval based on the structural weight coefficient, followed by concatenation of the adjusted physical state anomaly interval with the semantic conflict feature vector to generate a multi-dimensional fusion feature, includes: Based on the code call depth, the structural weight coefficients are converted into adjustment coefficients for the abnormal physical state intervals according to a progressively decreasing rule. The numerical range of the physical state anomaly interval is proportionally adjusted based on the adjustment coefficient to obtain the adjusted physical state anomaly interval. The adjusted physical state anomaly interval is connected to the semantic conflict feature vector in a preset order to generate multidimensional data. The dimensionality ratio of the multidimensional data is dynamically allocated according to the structural connection relationship between the codes. The multidimensional data is nonlinearly transformed and encoded to generate multidimensional fusion features with a unified quantization range.
3. The method according to claim 2, characterized in that, The step of concatenating the adjusted physical state anomaly interval with the semantic conflict feature vector in a preset order to generate multidimensional data, wherein the dimensionality ratio of the multidimensional data is dynamically allocated according to the structural connection relationship between the code, includes: Based on the code call depth, a segmentation rule is set, and the values in the adjusted physical state abnormal interval are divided into multiple continuous value segments according to the segmentation rule. The values of the semantic conflict feature vector are also split into multiple feature groups according to the segmentation rule. Based on the number of directly associated nodes in the structural connection relationship between the codes, the 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.
4. The method according to claim 1, characterized in that, The process of generating a defect location probability distribution based on the cross-modal defect feature set, and analyzing the abnormal segmentation results of the physical state parameters through the defect location probability distribution to determine the dynamic repair results of cross-platform software defect information includes: Based on the feature vector distribution of each code in the cross-modal defect feature set, the defect localization probability distribution of the code-level propagation path is calculated; The defect location probability distribution is matched with the abnormal segmentation results of the physical state parameters by region overlap, and target code regions whose region overlap exceeds a preset threshold are filtered out. Based on the upstream and downstream call chains of the target code region in the code dependency graph, a patch code fragment compatible with the upstream and downstream call chains is selected from the preset repair strategy library. According to the injection order and version constraints of the patch code fragment, a dynamic repair result is output.
5. The method according to claim 4, characterized in that, The step of selecting patch code fragments compatible with the upstream and downstream call chains in the code dependency graph based on the target code region includes: 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, and match the injection position of each patch in the preset repair strategy library to filter candidate patches that cover the upstream and downstream call chains; Verify the correspondence between the response parameters of the candidate patches and the interface parameter definitions, and filter version adaptation patches that are compatible with the current version based on the historical version evolution records in the code dependency graph; Analyze the conflict relationship between the runtime environment dependencies of the version adaptation patch and the current software environment, remove the version adaptation patches with conflicts, sort the remaining version adaptation patches, and generate patch code snippets.
6. The method according to claim 1, characterized in that, The synchronous acquisition software collects the physical state parameters of distributed hardware nodes and dynamically couples these physical state parameters with the context association matrix to generate a state evolution graph, including: By collecting physical status parameters of distributed hardware nodes in the software, the physical status parameters include time-series data streams of central processing unit occupancy, storage resource allocation status, and power supply voltage fluctuation values. The time-series data stream is divided into physical state segments according to the sampling time window, and the code execution path is parsed based on the runtime log time sequence. The physical state segments and the code execution path are input into the context association matrix for multi-dimensional encoding to generate a joint feature vector. Based on the correlation strength between the code execution path and the physical state fragment in the joint feature vector, a state evolution map is constructed.
7. A software defect information fusion system based on multi-source data, applied to the software defect information fusion method based on multi-source data according to any one of claims 1-6, characterized in that, include: The acquisition module acquires multi-source heterogeneous data from the cross-platform software runtime environment. The multi-source heterogeneous data includes static code features, runtime log time sequence, and user feedback text. The 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 sequence using the logical association between code entities in the code dependency graph, and aligns the runtime log time sequence with the software defect triggering nodes in the user feedback text in time and space to generate a context association matrix. The acquisition module 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 map. The fusion module generates a cross-modal defect feature set by fusing the code dependency graph, state evolution graph, and user feedback text. The determination module generates a defect location probability distribution based on the cross-modal defect feature set, and analyzes the abnormal segmentation results of the physical state parameters through the defect location probability distribution to determine the dynamic repair results of cross-platform software defect information.
8. 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 invoked 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 6.
9. A computer storage medium, characterized in that, The device contains a computer program that, when executed by a computer, implements a software defect information fusion method based on multi-source data as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Software source code defect detection method and system, electronic equipment and storage medium
CN113641586A
Software defect positioning method and device based on multiple views
CN119396687A