Real-time software architecture health degree monitoring method and device based on incremental updating and convolutional neural network, electronic equipment and storage medium

By using incremental updates and convolutional neural networks, the health of the software architecture is monitored in real time, which solves the problems of poor real-time performance and simple linear health measurement in existing technologies. It achieves efficient software architecture quality monitoring and evaluation, reduces analysis lag and repair costs, improves the ability to identify and warn of complex structural patterns, and forms a closed loop of quality governance.

CN121919082APending Publication Date: 2026-04-24ANHUI UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ANHUI UNIVERSITY OF TECHNOLOGY
Filing Date
2025-12-30
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing technologies for software architecture quality monitoring and evaluation suffer from poor real-time performance, delayed analysis, and overly simplistic and linear health measurement models. These technologies fail to reflect the nonlinear characteristics and complex structural patterns of software architecture, resulting in delayed detection of software architecture problems and high repair costs. Furthermore, there is a lack of effective real-time early warning and intervention mechanisms.

Method used

We employ an incremental update and convolutional neural network approach to capture code change events by real-time monitoring of the editing flow in the code development environment. This process generates a set of local dependency changes and performs graph repair. We establish a bidirectional dynamic mapping table and perform pixel and semantic updates. We use a deep convolutional neural network to extract high-dimensional texture features and combine it with nonlinear dynamic formulas to calculate the real-time software architecture health, and then provide dynamic early warnings and interventions.

Benefits of technology

It enables real-time monitoring of software architecture health, reduces analysis lag and repair costs, improves the ability to identify complex structural patterns, forms a closed loop from development process to quality governance, and enhances the ability to express and warn of software architecture health.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121919082A_ABST
    Figure CN121919082A_ABST
Patent Text Reader

Abstract

The invention relates to a real-time software architecture health degree monitoring method based on incremental updating and a convolutional neural network. The real-time software architecture health degree monitoring method comprises the steps of generating a local dependency change set, establishing a bidirectional dynamic mapping table to obtain a dependency structure matrix, inputting the dependency structure matrix to a deep convolutional neural network, and outputting a software architecture topological risk feature vector; calculating the health degree of the real-time software architecture by using a nonlinear dynamic formula; and according to the real-time software architecture health degree, dynamic early warning and intervention are executed. The device comprises a capture module, a creation module, an input module, a calculation module and an execution module. The invention further comprises electronic equipment and a storage medium. According to the real-time software architecture health degree monitoring method and device based on incremental updating and the convolutional neural network, the electronic equipment and the storage medium, the problems that in the prior art, the real-time performance is poor, analysis lags behind, and a health degree quantitative model is too simple and linear in software architecture quality monitoring and evaluation can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of software architecture quality assurance technology, specifically to a real-time software architecture health monitoring method, apparatus, electronic device, and storage medium based on incremental updates and convolutional neural networks. Background Technology

[0002] With the rapid development of the software industry, modern software systems are becoming increasingly large in scale, and the complexity of software architecture is rising exponentially. In the process of pursuing functional implementation, developers may unintentionally introduce non-standard dependencies, causing the system to gradually exhibit undesirable structural characteristics such as high coupling, low cohesion, and circular dependencies, ultimately leading to a decline in the quality of the software architecture.

[0003] Currently, existing technical solutions for monitoring and evaluating software architecture quality have the following limitations:

[0004] (1) Poor real-time performance and delayed analysis. Existing static code analysis tools typically use a full scan mode. Each time an analysis is performed, the entire source code of the project needs to be re-parsed to build a complete abstract syntax tree and dependency graph, which is time-consuming. Moreover, these tools can only be configured to run after code is committed and cannot provide immediate feedback. This lag leads to higher repair costs when software architecture problems are discovered.

[0005] (2) The health measurement model is too simplistic and linear. Existing technologies typically use a simple linear weighting system to score the health of software architecture. This linear model cannot reflect the non-linear characteristics of software architecture failure. In fact, when the coupling or disorder of the software architecture exceeds a certain critical point, its maintenance difficulty and failure risk increase exponentially, and existing measurement methods are unable to capture the process from quantitative change to qualitative change.

[0006] Therefore, existing technologies have shortcomings and need to be improved and developed. Summary of the Invention

[0007] The present invention provides a method, apparatus, electronic device and storage medium for real-time software architecture health monitoring based on incremental updates and convolutional neural networks, which solves the problems of poor real-time performance, analysis lag and overly simple and linear health measurement models in the existing technology for monitoring and evaluating software architecture quality.

[0008] In a first aspect, this invention provides a method for real-time software architecture health monitoring based on incremental updates and convolutional neural networks, comprising:

[0009] Capture code change events from the edit stream in a real-time monitored code development environment to generate local dependency change sets. And the local dependency change set Perform atlas repair; among which, , The node that initiates the dependency relationship. Indicates the end node being pointed to. This represents the incremental change in weight.

[0010] Establish a bidirectional dynamic mapping table To obtain the dependency structure matrix, and based on the local dependency change set Perform pixel updates and semantic updates on the obtained dependency structure matrix;

[0011] The dependency structure matrix is ​​input into a deep convolutional neural network to extract high-dimensional texture features from the dependency structure matrix using convolutional kernels and output a software architecture topology risk feature vector. ;

[0012] Based on the software architecture topology risk feature vector The health of real-time software architecture is calculated using nonlinear dynamics formulas.

[0013] Based on the real-time health status of the software architecture, dynamic early warnings and interventions are implemented.

[0014] Furthermore, the method involves capturing code change events from the edit stream in a real-time monitored code development environment to generate local dependency change sets. And the local dependency change set Perform atlas repair; among which, , The node that initiates the dependency relationship. Indicates the end node being pointed to. The increment values ​​representing the weight changes include:

[0015] Construct an incremental abstract syntax tree based on dirty tags;

[0016] When a code change event is captured by a listener At that time, the smallest syntactic unit where the change occurs is located using a tree structure, and this unit is defined as the set of affected nodes. ;

[0017] right The code within the set undergoes lexical and syntactic analysis to extract its external references and generate a local dependency change set. ;

[0018] In memory-resident global software architecture dependency graph In China, according to renew : ;in, Represents nodes in the global graph arrive The current edge weight, This indicates the current edge weight after executing the graph repair instruction;

[0019] like If the edge does not exist before calculation, then delete the edge. If so, then instantiate the edge.

[0020] Furthermore, a bidirectional dynamic mapping table is established. To obtain the dependency structure matrix, and based on the local dependency change set Performing pixel updates and semantic updates on the obtained dependency structure matrix includes:

[0021] Establish a bidirectional dynamic mapping table ,in For component objects in a software architecture diagram, This is its corresponding row index or column index value in the dependency structure matrix;

[0022] Based on the local dependency change set ,pass The table is located at the coordinates in the dependency structure matrix. And execute the pixel update formula: ,in Corresponding nodes and nodes Row and column indices in a matrix This represents the original grayscale value before the update. This represents the updated grayscale value. This represents a normalization function that maps weight changes to pixel brightness changes.

[0023] For those belonging to the affected node set The components in the code call the encoder interface of the code-large language model to perform semantic updates: ,in Indicates the component that has changed. The new semantic vector, Representation Component This includes the current source code containing the updated content, while keeping the unchanged components. Historical semantic embedding vector constant.

[0024] Furthermore, the dependency structure matrix is ​​input into a deep convolutional neural network to extract high-dimensional texture features from the dependency structure matrix using convolutional kernels and output a software architecture topology risk feature vector. ,include:

[0025] Construct a deep convolutional neural network that includes convolutional layers, pooling layers, and fully connected layers;

[0026] The dependency structure matrix after incremental pixel update and semantic update is used as a single-channel image input to the deep convolutional neural network, and the high-dimensional texture features in the dependency structure matrix are extracted using the convolutional kernel;

[0027] Identify specific visual patterns in the dependency structure matrix to quantify software architecture risk. These specific visual patterns include diagonal clustering patterns representing high cohesion within components and anti-diagonal high grayscale pixel distribution patterns representing cyclic dependencies.

[0028] Output software architecture topology risk feature vector .

[0029] Furthermore, the risk feature vector based on the software architecture topology... The health of real-time software architecture is calculated using nonlinear dynamics formulas, including:

[0030] Calculate the cohesion of the system The calculation formula is: ;in, This represents the total number of row indexes. row index The actual number of internal dependency edges; row index The number of internal classes; This represents the theoretical maximum number of joins within a row index. For row index semantic vectors; For semantic consistency functions; These are the weighting coefficients;

[0031] Calculate system coupling The calculation formula is: ;in, The total number of elements in the entire matrix used for normalization; For the dependency structure matrix from arrive The strength of real-time dependency; Index for the dependent column The PageRank importance index is used to penalize over-coupling to core components;

[0032] The formula for calculating the health of real-time software architecture is as follows: ;in, It is a smoothing constant; The degree of cohesion within the system; The system coupling degree; The software architecture topology risk feature vector The 2-norm.

[0033] Furthermore, the step of performing dynamic early warning and intervention based on the real-time software architecture health status includes:

[0034] Create a length of A sliding time window stores historical health score sequences. And calculate its mean. and standard deviation To characterize the normal fluctuation range;

[0035] Obtain real-time software architecture health Calculate the deviation value , ;

[0036] like The issue was flagged as minor degradation, and a visual warning was displayed in the IDE; settings were adjusted accordingly. The preset system crash threshold, if or If the code is deemed to have committed serious and irreversible corruption, the version control system's hook function will be triggered to forcibly block code submissions in order to prevent irreversible corruption of the software architecture.

[0037] A second aspect of the present invention provides a real-time software architecture health monitoring device based on incremental updates and convolutional neural networks, comprising:

[0038] The capture module is used to capture code change events from the edit stream of a real-time monitored code development environment in order to generate local dependency change sets. And the local dependency change set Perform atlas repair; among which, , The node that initiates the dependency relationship. Indicates the end node being pointed to. This represents the incremental change in weight.

[0039] Create a module to build a bidirectional dynamic mapping table. To obtain the dependency structure matrix, and based on the local dependency change set Perform pixel updates and semantic updates on the obtained dependency structure matrix;

[0040] The input module is used to input the dependency structure matrix into a deep convolutional neural network, so as to extract high-dimensional texture features from the dependency structure matrix using convolutional kernels and output a software architecture topology risk feature vector. ;

[0041] The calculation module is used to calculate the topological risk feature vector of the software architecture. The health of real-time software architecture is calculated using nonlinear dynamics formulas.

[0042] The execution module is used to perform dynamic early warnings and interventions based on the real-time software architecture health status.

[0043] In a third aspect, the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the electronic device implements the real-time software architecture health monitoring method based on incremental updates and convolutional neural networks.

[0044] In a fourth aspect, the present invention provides a computer-readable storage medium for storing a computer program that, when run on a computer, causes the computer to execute the real-time software architecture health monitoring method based on incremental updates and convolutional neural networks.

[0045] Beneficial effects:

[0046] As can be seen from the above technical solutions, the present invention provides a real-time software architecture health monitoring method based on incremental updates and convolutional neural networks, which has the following beneficial effects:

[0047] 1. Real-time performance and cost control were achieved: By shifting the analysis object from the "full-scale project" to the "scope of change impact," monitoring costs are related to the scale of a single change, rather than linearly related to the overall project scale. This helps reduce analysis lag and rework costs in high-frequency editing scenarios. Through incremental AST parsing and matrix pixel-level patching technology, the traditional full-code scanning mode was abandoned, enabling real-time updates to the software architecture status as developers type code.

[0048] 2. The derivation of structural risk identification capabilities was realized: After transforming the dependency topology into a matrix and performing pattern learning, risk identification no longer relies solely on preset rules or single indicators. It can cover complex forms such as combinatorial circular dependencies and core component stress, thereby improving the coverage of architectural anomaly detection. Utilizing the feature extraction capabilities of convolutional neural networks, it can automatically identify complex software architecture topology defects that are difficult to detect using traditional mathematical statistical methods, improving the accuracy of diagnosis.

[0049] 3. The derivation of health-related expressive power was achieved: By incorporating the cohesion / coupling ratio and topological risk vector into the nonlinear health-related model, a stronger response to health decline can be provided when coupling approaches the critical region, helping to characterize the transition process of the architecture from maintainable to unmaintainable. The proposed health-related calculation formula integrates structural metrics, semantic metrics, and CNN features. The introduced PageRank penalty and exponential decay term better reflect the objective law of software entropy increase than a simple linear deduction system.

[0050] 4. Achieve scalable and integrable derivation: Through mapping tables and incremental matrix update mechanisms, the data structure can remain maintainable as the node scale grows, and it can be linked with IDEs, version control and CI access control, thereby enhancing the deployment adaptability in engineering processes.

[0051] 5. Derivation of achieving a closed-loop process governance: Health status is not only used for display, but also for hierarchical early warning and submission interception, so that discovery, feedback and constraint form a closed loop, which helps to move architectural quality control forward to the development process.

[0052] It should be understood that all combinations of the foregoing concepts and the additional concepts described in more detail below can be considered part of the inventive subject matter of this disclosure, provided that such concepts do not contradict each other.

[0053] The foregoing and other aspects, embodiments, and features of the teachings of the present invention will be more fully understood from the following description in conjunction with the accompanying drawings. Other additional aspects of the invention, such as features and / or beneficial effects of exemplary embodiments, will become apparent from the following description or may be learned through practice of specific embodiments according to the teachings of the present invention. Attached Figure Description

[0054] The accompanying drawings are not drawn to scale. In the drawings, each identical or nearly identical component shown in the various figures may be denoted by the same reference numeral. For clarity, not every component is labeled in each figure. Embodiments of various aspects of the invention will now be described by way of example and with reference to the accompanying drawings, wherein:

[0055] Figure 1 This is a flowchart illustrating a real-time software architecture health monitoring method based on incremental updates and convolutional neural networks, as described in this application.

[0056] Figure 2 This is a flowchart of step S102 of a real-time software architecture health monitoring method based on incremental updates and convolutional neural networks in an embodiment of this application.

[0057] Figure 3This is a flowchart of step S104 of a real-time software architecture health monitoring method based on incremental updates and convolutional neural networks in an embodiment of this application.

[0058] Figure 4 This is a flowchart of step S106 of a real-time software architecture health monitoring method based on incremental updates and convolutional neural networks in an embodiment of this application.

[0059] Figure 5 This is a flowchart of step S108 of a real-time software architecture health monitoring method based on incremental updates and convolutional neural networks in an embodiment of this application.

[0060] Figure 6 This is a flowchart of step S110 of a real-time software architecture health monitoring method based on incremental updates and convolutional neural networks in an embodiment of this application.

[0061] Figure 7 This is a schematic diagram of an electronic device according to an embodiment of this application. Detailed Implementation

[0062] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the described embodiments of the present invention without creative effort are within the scope of protection of the present invention. Unless otherwise defined, the technical or scientific terms used herein should have the ordinary meaning understood by those skilled in the art to which this invention pertains.

[0063] The terms "first," "second," and similar words used in the specification and claims of this patent application do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, unless the context clearly indicates otherwise, the singular forms of "an," "a," or "the," etc., do not indicate a quantity limitation, but rather indicate the presence of at least one. Terms such as "comprising" or "including" mean that the element or object preceding "comprising" encompasses the features, integrals, steps, operations, elements, and / or components listed following "comprising" or "including," and do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; these relative positional relationships may change accordingly when the absolute position of the described object changes.

[0064] During the continuous iteration of software systems, development activities are characterized by high-frequency editing, continuous integration, and parallel multi-branching. Dependencies at the architectural level are prone to cumulative shifts during local modifications. When dependencies gradually become disordered, the system will exhibit structural problems such as increased coupling, decreased cohesion, weakened hierarchical boundaries, and circular dependencies, leading to quality risks such as increased maintenance costs, longer defect repair cycles, and hindered version evolution. Therefore, the development process needs a technical means to continuously monitor the health status of the architecture during the change phase, so as to achieve the transformation from "post-event investigation" to "process governance". The existing technologies have the following limitations: (1) Analysis lag and untimely feedback: Existing architecture metrics or static analyses are mostly based on periodic full scans, which usually require complete analysis of the project, reconstruction of dependencies, and calculation of indicators. This is difficult to synchronize with the high-frequency editing rhythm, resulting in a lag in the time of problem exposure and increased repair costs. (2) Health measurement models are difficult to reflect nonlinear risk evolution: Some existing solutions use linear weighting or simple thresholding to summarize multiple indicators, which is difficult to characterize the sudden change characteristics of architectural risks near the critical point and cannot effectively express the deterioration process "from quantitative change to qualitative change". (3) Insufficient ability to identify complex structural patterns: When the system scales up, topological patterns such as circular dependency, excessive coupling, and pressure on core components show a trend of combination and concealment. Traditional rules or single indicators are difficult to reliably identify and provide actionable risk representations. (4) Insufficient governance closed loop: Some tools only provide offline reports and lack dynamic early warning and intervention mechanisms linked with the development environment and version control process, making it difficult to form a closed loop throughout the entire process.

[0065] Therefore, embodiments of the present invention provide a real-time software architecture health monitoring method based on incremental updates and convolutional neural networks, referring to... Figure 1 ,include:

[0066] Step S102: Capture code change events from the edit stream in the real-time monitored code development environment to generate local dependency change sets. and local dependency change sets Perform atlas repair; among which, , The node that initiates the dependency relationship. Indicates the end node being pointed to. This represents the incremental change in weight.

[0067] The editing flow in a code development environment can be interpreted as a sequence of events generated by an Integrated Development Environment (IDE) or editor, including at least file saving, text range changes, syntax tree incremental updates, and build / compile events. Event sources can be IDE plugin interfaces, Language Server Protocol (LSP) events, or file system monitoring events. Dependencies This can be interpreted as static or quasi-static dependencies between components, encompassing at least one or more of the following: import / inclusion, call, inheritance / implementation, type reference, and resource reference. Node granularity is set to components as nodes and classes as sub-levels. Graph patching involves performing edge addition, deletion, and modification operations on the global dependency graph, which is either resident in memory or persistently stored. The control strategy is write locks / version numbers to avoid data contention caused by simultaneous editing of multiple files. By capturing changes and performing partial updates during development, architecture monitoring can be transformed from periodic offline analysis to near real-time feedback, thereby reducing the risk of rework due to delayed problem discovery.

[0068] Step S104: Establish a bidirectional dynamic mapping table To obtain the dependency structure matrix, and based on the local dependency change set Perform pixel updates and semantic updates on the obtained dependency structure matrix.

[0069] By expressing the dependency structure as a computable matrix and performing updates on local changes, the computation path can be kept stable as the system scales up, improving the scalability of continuous monitoring.

[0070] Step S106: Input the dependency structure matrix into a deep convolutional neural network to extract high-dimensional texture features from the dependency structure matrix using convolutional kernels and output a software architecture topology risk feature vector. .

[0071] By introducing a learning-based pattern recognition mechanism to extract risk features from dependent topologies, it is possible to cover complex structural patterns that are difficult to fully define using traditional rules, thereby improving the robustness of risk representation.

[0072] Step S108: Based on the software architecture topology risk feature vector The health of real-time software architecture is calculated using nonlinear dynamics formulas.

[0073] By employing a non-linear form of health metric calculation, a more sensitive response to deterioration trends can be provided in the critical region of the indicator, which helps to express the abrupt characteristics of architectural risk.

[0074] Step S110: Execute dynamic early warning and intervention based on the real-time software architecture health status.

[0075] By using health status results for dynamic early warning and intervention, a closed loop of quality governance can be formed, thereby enhancing the proactive quality assurance capabilities of the development process.

[0076] In some embodiments, code change events are captured from the edit stream of a real-time monitored code development environment to generate local dependency change sets. and local dependency change sets Perform atlas repair; among which, , The node that initiates the dependency relationship. Indicates the end node being pointed to. This represents the incremental change in weight, as referenced. Figure 2 ,include:

[0077] Step S1021: Construct an incremental abstract syntax tree based on dirty tags.

[0078] Step S1022: When a code change event is captured based on the listener At that time, the smallest syntactic unit where the change occurs is located using a tree structure, and this unit is defined as the set of affected nodes. .

[0079] The smallest syntactic unit can be defined as a function, method, class, file-level module, or statement block, and must be consistent with the selected language parser.

[0080] Step S1023: For The code within the set undergoes lexical and syntactic analysis to extract its external references and generate a local dependency change set. .

[0081] The rules for extracting external references are static, such as resolving import / include, calling expressions, and type annotation references based on symbol tables.

[0082] Step S1024: Resident Global Software Architecture Dependency Graph In China, according to renew : ;in, Represents nodes in the global graph arrive The current edge weight, This indicates the current edge weight after executing the graph repair instruction.

[0083] The global graph storage structure can be an adjacency list, a sparse matrix, or a graph database.

[0084] Step S1025: If If the edge does not exist before calculation, then delete the edge. If so, then instantiate the edge.

[0085] By using dirty tagging and minimum syntactic unit location, analysis is performed only on the set of affected nodes, reducing the cost of repeated parsing and improving incremental processing efficiency. Performing incremental weight updates and conditional edge deletion / instantiation on the global dependency graph maintains consistency between the dependency graph and the code state, reducing the inconsistency risks introduced by full reconstruction. Expressing changes in dependency strength provides a unified incremental interface for subsequent matrix updates, facilitating adaptation to different languages ​​and dependency types.

[0086] Implement capture of change events and generation The implementation details of the graph repair chain ensure that subsequent steps can be based on... Directly locate and update the matrix coordinates without rescanning the entire map.

[0087] In some embodiments, a bidirectional dynamic mapping table is established. To obtain the dependency structure matrix, and based on the local dependency change set Perform pixel updates and semantic updates on the obtained dependency structure matrix, refer to Figure 3 ,include:

[0088] Step S1041: Establish a bidirectional dynamic mapping table ,in For component objects in a software architecture diagram, This corresponds to its row or column index value in the dependency structure matrix.

[0089] By using a bidirectional mapping table to stably bind graph nodes to matrix indices, the consistency of matrix positioning can be maintained when nodes are added, deleted, or their size changes, thus improving the determinism of incremental updates.

[0090] Step S1042: Based on local dependency change sets ,pass The table is located at the coordinates in the dependency structure matrix. And execute the pixel update formula: ,in Corresponding nodes and nodes Row and column indices in a matrix This represents the original grayscale value before the update. This represents the updated grayscale value. This represents a normalization function that maps weight changes to pixel brightness changes.

[0091] Through the Performing pixel-level updates can quickly reflect changes in local dependencies in the strength of the matrix structure, reducing the need for full recalculation.

[0092] Step S1043: For nodes belonging to the affected node set The components in the code call the encoder interface of the code-large language model to perform semantic updates: ,in Indicates the component that has changed. The new semantic vector, Representation Component This includes the current source code containing the updated content, while keeping the unchanged components. Historical semantic embedding vector constant.

[0093] The encoder interface is implemented as an encoding model for generating vector representations of code snippets, which can be implemented by a local model, an enterprise-owned model, or an API service.

[0094] By updating semantic vectors only for affected components and reusing historical vectors for unchanged components, the semantic computation overhead can be reduced while maintaining the temporal continuity of semantic representation. Simultaneously preserving structural strength and component semantics provides richer input representations for subsequent topological risk identification.

[0095] In some embodiments, the dependency structure matrix is ​​input to a deep convolutional neural network to extract high-dimensional texture features from the dependency structure matrix using convolutional kernels and output a software architecture topology risk feature vector. , refer to Figure 4 ,include:

[0096] Step S1061: Construct a deep convolutional neural network containing convolutional layers, pooling layers, and fully connected layers.

[0097] Step S1062: Input the dependency structure matrix after incremental pixel update and semantic update as a single-channel image into the deep convolutional neural network, and use the convolution kernel to extract high-dimensional texture features from the dependency structure matrix.

[0098] By inputting the dependency structure matrix as a single-channel image into a convolutional network, spatial patterns of dependency structures can be captured using local receptive fields and hierarchical feature extraction mechanisms, making it suitable for pattern recognition of large-scale dependencies. Preprocessing can be performed before network input, including matrix normalization, handling missing values, sparse matrix compaction, or sparse convolution implementation paths.

[0099] Step S1063: Identify specific visual patterns in the dependency structure matrix to quantify software architecture risk. Specific visual patterns include diagonal clustering patterns representing high cohesion within components and anti-diagonal high grayscale pixel distribution patterns representing circular dependencies.

[0100] By identifying specific patterns such as diagonal clustering and anti-diagonal high grayscale, structural phenomena such as cohesion and cyclicity can be transformed into learnable visual features, thereby improving the ability to identify risks in complex topologies. Diagonal clustering patterns correspond to structural features where dependencies are more concentrated within components and less across components; anti-diagonal high grayscale pixel distribution patterns can correspond to cyclic structures that are mutually dependent or have multiple closed loops.

[0101] Step S1064: Output software architecture topology risk feature vector .

[0102] By outputting risk feature vectors This allows for composable risk intensity representations in subsequent health assessments, rather than relying solely on a single rule or indicator. Risk Feature Vector As input to the subsequent exponential decay term, it is used to apply a risk penalty to the health score, thereby incorporating the degree of topological anomaly into the health score model.

[0103] In some embodiments, based on the software architecture topology risk feature vector The health of real-time software architecture is calculated using nonlinear dynamics formulas, with reference to... Figure 5 ,include:

[0104] Step S1081: Calculate the cohesion of the system The calculation formula is: ;in, This represents the total number of row indexes. row index The actual number of internal dependency edges; row index The number of internal classes; This represents the theoretical maximum number of joins within a row index. For row index semantic vectors; For semantic consistency functions; These are the weighting coefficients.

[0105] Step S1082: Calculate the system coupling degree The calculation formula is: ;in, The total number of elements in the entire matrix used for normalization; For the dependency structure matrix from arrive The strength of real-time dependency; Index for the dependent column The PageRank importance index is used to penalize over-coupling of core components.

[0106] By simultaneously calculating cohesion With coupling degree It can characterize the architecture state from two dimensions: "internal organizational quality of modules" and "dependency pressure between modules". By introducing PageRank importance to penalize the degree of dependency of core components, it helps to identify systemic risks caused by overloaded dependencies of core nodes.

[0107] Step S1083: Calculate the health of the real-time software architecture. The calculation formula is as follows: ;in, It is a smoothing constant; The degree of cohesion within the system; The system coupling degree; Software architecture topology risk feature vector The 2-norm.

[0108] By Introducing a health metric into an exponential term allows for a direct mapping of complex topological risks to factors contributing to declining health, thus enhancing the model's sensitivity to structural anomalies. Through... Compression of nonlinear forms can create a more reasonable gradient change in the critical region to express the trend of health status deteriorating more rapidly with increasing coupling.

[0109] In some embodiments, dynamic early warnings and interventions are performed based on the real-time software architecture health status, referring to... Figure 6 ,include:

[0110] Step S1101: Create a structure with a length of A sliding time window stores historical health score sequences. And calculate its mean. and standard deviation To characterize the normal fluctuation range.

[0111] By using a sliding window to statistically analyze the health sequence, short-term fluctuations can be distinguished from continuous deterioration, reducing false alarms.

[0112] Step S1102: Obtain real-time software architecture health status Calculate the deviation value , .

[0113] pass The value-based grading strategy can provide alerts and management actions based on different levels of severity, thereby improving the operability of intervention strategies.

[0114] Step S1103: If The issue was flagged as minor degradation, and a visual warning was displayed in the IDE; settings were adjusted accordingly. The preset system crash threshold, if or If the code is deemed to have committed serious and irreversible corruption, the version control system's hook function will be triggered to forcibly block code submissions in order to prevent irreversible corruption of the software architecture.

[0115] By linking version control hooks to intercept actions in critical situations, architecture quality gatekeeping can be moved forward to the commit stage, helping to prevent low-quality structures from entering the main branch. The critical value mechanism can set a bottom line constraint on the risk of irreversible corruption, forming a process-oriented quality control.

[0116] In another embodiment, taking the development scenario of a large-scale e-commerce backend system as an example, developers maintain a Java project named E-Shop. This project contains hundreds of class files, and its software architecture is divided into core components such as OrderService, InventoryService, and PaymentService. The following demonstrates the real-time operation flow of the monitoring system provided by this invention when developers modify code in OrderService:

[0117] Step 1: Incremental change capture and map repair.

[0118] 1. Scenario Trigger: The developer opens the OrderService.java file in the IDE and enters a new line of code:

[0119] private InventoryDao inventoryDao;

[0120] The intention of this line of code is to introduce a dependency on the inventory data access object in the order service.

[0121] 2. Incremental Parsing: The monitoring system's background plugin detected the edit event in real time. Using dirty tagging technology, it performed incremental AST parsing to analyze the newly added code snippets in the file. The parser identified it as a FieldDeclaration of type InventoryDao.

[0122] 3. Graph Atomic Repair: The system identifies the set of affected nodes. The generated local dependency change set is This indicates that the dependency weight from the order service to the inventory DAO has increased by 1. The system's global dependency graph in memory. Find the corresponding edge weight it It has been updated from 5 to 6.

[0123] Step 2: Local matrix update and feature mapping.

[0124] 1. Coordinate positioning: The system queries the dynamic mapping table in memory. OrderService corresponding matrix row index InventoryDao corresponds to the column index of the matrix. .

[0125] 2. Pixel-level refresh: The system directly locates the coordinates of the dependent structure matrix. Assuming the original grayscale value of this point... According to the normalization function The new grayscale value is updated to The other pixels in the matrix remain unchanged.

[0126] 3. Semantic Vector Recalculation: The system calls the lightweight CodeBERT model, which only performs embedding encoding on the latest code of OrderService and updates its semantic vector. Other components, such as PaymentService, retain their historical vector values.

[0127] Step 3: Feature depth extraction.

[0128] 1. Visual Input: The refreshed DSM matrix is ​​treated as a single image. A single-channel grayscale image.

[0129] 2. CNN Convolutional Inference: A pre-trained convolutional neural network performs inference on the image. The CNN's convolutional kernels slide across the image.

[0130] Scenario A: If the highlighted areas of the matrix are mainly concentrated in blocky regions near the diagonal, the CNN identifies this as a good high-cohesion pattern and outputs a risk vector. It is close to 0.

[0131] Scenario B: Suppose the developer subsequently added the wrong callback code to OrderService in InventoryDao, causing the matrix coordinates to... It also lit up. At this moment, and This resulted in two bright spots that were symmetrical about the main diagonal. The CNN captured the visual pattern of anti-diagonal symmetrical highlighting, identified it as a circular dependency, and output a risk vector. It rose to 0.9.

[0132] Step 4: Health measurement calculation.

[0133] The system uses the data from the previous steps to perform calculations by substituting it into the formula:

[0134] 1. Calculate the cohesion of the system. Combining semantic vectors Consistency and inner class call density are calculated .

[0135] 2. Calculate the system coupling degree The system discovered that InventoryDao is a core component that many modules depend on. This new dependency on it increases coupling. It increased from 0.3 to 0.35.

[0136] 3. Calculate overall health score :

[0137] If there is no circular dependency: System is healthy.

[0138] If circular dependencies exist: because The penalty item becomes (set up ,but Final health Health level experienced a precipitous drop.

[0139] Step 5: Dynamic Early Warning and Intervention

[0140] 1. Baseline Comparison: The system reads historical window data and identifies the average health level over the past week. Standard deviation .current .

[0141] 2. Calculate the Z-Score: . The value is much greater than 3, and the absolute value of 0.15 is lower than the preset crash threshold. .

[0142] 3. Trigger Blocking: A heatmap pop-up window appears in the sidebar of the IDE editor, highlighting the data in the matrix. and These two dots indicate the message: "A high-risk circular dependency has been detected between OrderService and InventoryDao!"

[0143] Git Interception: When a developer attempts to execute `git commit`, the system's pre-commit hook is triggered, rejecting the commit and returning the error message: "Software architecture health is severely compromised (0.15 < 0.4), please decouple before committing."

[0144] Through the above entire process, this invention successfully intercepted a change that could have led to software architecture corruption during code writing.

[0145] Another embodiment of the present invention provides a real-time software architecture health monitoring device based on incremental updates and convolutional neural networks, comprising:

[0146] The capture module is used to capture code change events from the edit stream of a real-time monitored code development environment in order to generate local dependency change sets. and local dependency change sets Perform atlas repair; among which, , The node that initiates the dependency relationship. Indicates the end node being pointed to. This represents the incremental change in weight.

[0147] Create a module to build a bidirectional dynamic mapping table. To obtain the dependency structure matrix, and based on the local dependency change set Perform pixel updates and semantic updates on the obtained dependency structure matrix.

[0148] The input module is used to input the dependency structure matrix into a deep convolutional neural network, so as to extract high-dimensional texture features from the dependency structure matrix using convolutional kernels and output a software architecture topology risk feature vector. .

[0149] The calculation module is used to calculate the risk feature vector of the software architecture topology. The health of real-time software architecture is calculated using nonlinear dynamics formulas.

[0150] The execution module is used to perform dynamic early warnings and interventions based on the real-time health of the software architecture.

[0151] It should be noted that although several units or sub-units of the device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided and embodied by multiple units.

[0152] Based on the same inventive concept as the above method embodiments, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it enables the electronic device to implement the control method described in the above embodiments.

[0153] In one embodiment, the electronic device may be a server, and in this embodiment, the structure of the electronic device may be as follows: Figure 7 As shown, it includes a memory, a communication module, and one or more processors.

[0154] Memory is used to store computer programs executed by the processor. Memory can be mainly divided into a program storage area and a data storage area. The program storage area can store the operating system and programs required to run instant messaging functions, etc.; the data storage area can store various instant messaging information and operation instruction sets, etc.

[0155] Memory can be volatile memory, such as random access memory (RAM); memory can also be non-volatile memory, such as read-only memory, flash memory, hard disk drive (HDD), or solid-state drive (SSD); or memory can be any other medium capable of carrying or storing a desired computer program having the form of instructions or data structures and accessible by a computer, but is not limited thereto. Memory can be a combination of the above-mentioned types of memory.

[0156] A processor may include one or more central processing units (CPUs) or digital processing units, etc. The processor is used to implement the aforementioned audio data processing methods when it invokes computer programs stored in memory.

[0157] The communication module is used to communicate with terminal devices and other servers.

[0158] This application embodiment does not limit the specific connection medium between the above-described memory, communication module, and processor. This application embodiment... Figure 7 The memory and processor are connected via a bus, and the bus is in... Figure 7 The connections between other components are illustrated with arrows and are for illustrative purposes only, not as limiting information. Buses can be categorized as address buses, data buses, control buses, etc. For ease of description, Figure 7 The text uses only one arrow to describe it, but does not indicate that there is only one bus or one type of bus.

[0159] Based on the same inventive concept as the above-described method embodiments, embodiments of the present invention also provide a computer-readable storage medium for storing a computer program. When the computer program is run on a computer, it enables an electronic device to implement the control methods described in the above embodiments. The computer-readable storage medium can be a readable signal medium or a readable storage medium. A readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.

[0160] Based on the same inventive concept as the above-described method embodiments, embodiments of the present invention also provide a computer program product. The computer program product includes a computer program that, when run on an electronic device, causes the electronic device to perform the steps of the control methods described above according to various exemplary embodiments of this application. The program product may take the form of any combination of one or more readable media. These computer program commands can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the commands executed by the processor of the computer or other programmable data processing device generate a process for implementing... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0161] While the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the invention. Those skilled in the art can make various modifications and refinements without departing from the spirit and scope of the invention. Therefore, the scope of protection of the present invention shall be determined by the claims.

Claims

1. A real-time software architecture health monitoring method based on incremental updates and convolutional neural networks, characterized in that, include: Capture code change events from the edit stream in a real-time monitored code development environment to generate local dependency change sets. And the local dependency change set Perform atlas repair; among which, , The node that initiates the dependency relationship. Indicates the end node being pointed to. This represents the incremental change in weight. Establish a bidirectional dynamic mapping table To obtain the dependency structure matrix, and based on the local dependency change set Perform pixel updates and semantic updates on the obtained dependency structure matrix; The dependency structure matrix is ​​input into a deep convolutional neural network to extract high-dimensional texture features from the dependency structure matrix using convolutional kernels and output a software architecture topology risk feature vector. ; Based on the software architecture topology risk feature vector The health of real-time software architecture is calculated using nonlinear dynamics formulas. Based on the real-time health status of the software architecture, dynamic early warnings and interventions are implemented.

2. The real-time software architecture health monitoring method based on incremental updates and convolutional neural networks according to claim 1, characterized in that, The method captures code change events from the edit stream in the real-time monitored code development environment to generate local dependency change sets. And the local dependency change set Perform atlas repair; among which, , The node that initiates the dependency relationship. Indicates the end node being pointed to. The increment values ​​representing the weight changes include: Construct an incremental abstract syntax tree based on dirty tags; When a code change event is captured by a listener At that time, the smallest syntactic unit where the change occurs is located using a tree structure, and this unit is defined as the set of affected nodes. ; right The code within the set undergoes lexical and syntactic analysis to extract its external references and generate a local dependency change set. ; In memory-resident global software architecture dependency graph In China, according to renew : ;in, Represents nodes in the global graph arrive The current edge weight, This indicates the current edge weight after executing the graph repair instruction; like If the edge does not exist before calculation, then delete the edge. If so, then instantiate the edge.

3. The real-time software architecture health monitoring method based on incremental updates and convolutional neural networks according to claim 1, characterized in that, The establishment of a bidirectional dynamic mapping table To obtain the dependency structure matrix, and based on the local dependency change set Performing pixel updates and semantic updates on the obtained dependency structure matrix includes: Establish a bidirectional dynamic mapping table ,in For component objects in a software architecture diagram, This is its corresponding row index or column index value in the dependency structure matrix; Based on the local dependency change set ,pass The table is located at the coordinates in the dependency structure matrix. And execute the pixel update formula: ,in Corresponding nodes and nodes Row and column indices in a matrix This represents the original grayscale value before the update. This represents the updated grayscale value. This represents a normalization function that maps weight changes to pixel brightness changes. For those belonging to the affected node set The components in the code call the encoder interface of the code-large language model to perform semantic updates: ,in Indicates the component that has changed. The new semantic vector, Representation Component This includes the current source code containing the updated content, while keeping the unchanged components. Historical semantic embedding vector constant.

4. The real-time software architecture health monitoring method based on incremental updates and convolutional neural networks according to claim 1, characterized in that, The dependency structure matrix is ​​input into a deep convolutional neural network to extract high-dimensional texture features from the dependency structure matrix using convolutional kernels and output a software architecture topology risk feature vector. ,include: Construct a deep convolutional neural network that includes convolutional layers, pooling layers, and fully connected layers; The dependency structure matrix after incremental pixel update and semantic update is used as a single-channel image input to the deep convolutional neural network, and the high-dimensional texture features in the dependency structure matrix are extracted using the convolutional kernel; Identify specific visual patterns in the dependency structure matrix to quantify software architecture risk. These specific visual patterns include diagonal clustering patterns representing high cohesion within components and anti-diagonal high grayscale pixel distribution patterns representing cyclic dependencies. Output software architecture topology risk feature vector .

5. The real-time software architecture health monitoring method based on incremental updates and convolutional neural networks according to claim 1, characterized in that, The software architecture topology risk feature vector The health of real-time software architecture is calculated using nonlinear dynamics formulas, including: Calculate the cohesion of the system The calculation formula is: ;in, This represents the total number of row indexes. row index The actual number of internal dependency edges; row index The number of internal classes; This represents the theoretical maximum number of joins within a row index. For row index semantic vectors; For semantic consistency functions; These are the weighting coefficients; Calculate system coupling The calculation formula is: ;in, The total number of elements in the entire matrix used for normalization; For the dependency structure matrix from arrive The strength of real-time dependency; Index for the dependent column The PageRank importance index is used to penalize over-coupling to core components; The formula for calculating the health of real-time software architecture is as follows: ;in, It is a smoothing constant; The degree of cohesion within the system; The system coupling degree; The software architecture topology risk feature vector The 2-norm.

6. The real-time software architecture health monitoring method based on incremental update and convolutional neural network according to claim 1, characterized in that, The step of performing dynamic early warning and intervention based on the real-time software architecture health status includes: Create a length of A sliding time window stores historical health score sequences. And calculate its mean. and standard deviation To characterize the normal fluctuation range; Obtain real-time software architecture health Calculate the deviation value , ; like The issue was flagged as minor degradation, and a visual warning was displayed in the IDE; settings were adjusted accordingly. The preset system crash threshold, if or If the code is deemed to have committed serious and irreversible corruption, the version control system's hook function will be triggered to forcibly block code submissions in order to prevent irreversible corruption of the software architecture.

7. A real-time software architecture health monitoring device based on incremental updates and convolutional neural networks, characterized in that, include: The capture module is used to capture code change events from the edit stream of a real-time monitored code development environment in order to generate local dependency change sets. And the local dependency change set Perform atlas repair; among which, , The node that initiates the dependency relationship. Indicates the end node being pointed to. This represents the incremental change in weight. Create a module to build a bidirectional dynamic mapping table. To obtain the dependency structure matrix, and based on the local dependency change set Perform pixel updates and semantic updates on the obtained dependency structure matrix; The input module is used to input the dependency structure matrix into a deep convolutional neural network, so as to extract high-dimensional texture features from the dependency structure matrix using convolutional kernels and output a software architecture topology risk feature vector. ; The calculation module is used to calculate the topological risk feature vector of the software architecture. The health of real-time software architecture is calculated using nonlinear dynamics formulas. The execution module is used to perform dynamic early warnings and interventions based on the real-time software architecture health status.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it enables the electronic device to implement the real-time software architecture health monitoring method based on incremental updates and convolutional neural networks as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program that, when run on a computer, causes the computer to perform the real-time software architecture health monitoring method based on incremental updates and convolutional neural networks as described in any one of claims 1 to 6.