Software component coupling relation management method and system based on knowledge graph and medium
By using a knowledge graph-based approach, intelligent management of software coupling relationships is achieved, solving the problems of low efficiency and error susceptibility in traditional methods, and improving the stability and management efficiency of software systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-03-10
AI Technical Summary
Traditional manual methods cannot comprehensively and timely analyze and monitor the coupling relationships of software systems, resulting in strong subjectivity, low efficiency, and susceptibility to errors. This increases maintenance costs and failure risks, making it difficult to adapt to the rapid iteration and increasing complexity of modern software systems.
By employing a knowledge graph-based approach, a knowledge graph of the software system is constructed to enable the visualization, intelligent analysis, and optimization suggestion management of software coupling relationships. This includes defining software components and coupling relationships, generating or updating the knowledge graph, and generating coupling level suggestions through an exponentially weighted moving average algorithm.
It improves the stability and management efficiency of the software system. Through the coupled management of automation and intelligence, it enhances the ability to identify and assess risks and reduces the subjectivity and error rate of manual analysis.
Smart Images

Figure CN121635944A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of software development and maintenance technology, and relates to a method, system and medium for managing the coupling relationship of software components based on knowledge graphs. Background Technology
[0002] In contemporary software development practice, software systems typically consist of numerous interconnected and collaborative components. The coupling relationships between these components—that is, the degree and manner in which they depend on and influence each other—are one of the core factors determining the overall quality, maintainability, and scalability of the software. Highly coupled component systems often have chaotic structures; a change in one part can have far-reaching consequences, potentially triggering an unpredictable chain of errors and increasing the burden and difficulty of testing and verification. The system also struggles to adapt to new requirements or changes in the technology stack, resulting in high refactoring costs. Furthermore, understanding the system becomes more difficult, leading to high learning costs and a steep learning curve for new team members. Therefore, effectively understanding and scientifically managing the coupling relationships between components is crucial for building robust, understandable, and easily evolving software system clusters.
[0003] However, traditionally, managing software coupling has relied heavily on manual analysis and experience. Engineers typically identify and assess coupling by reading source code, examining module interface documentation, tracking the runtime behavior of software components, or based on their own and their team's accumulated experience. This approach has significant limitations: it is highly subjective (judgments vary greatly among engineers with different levels of experience), inefficient (growing exponentially with system size), and prone to errors and omissions (especially when dealing with complex interactions, transitive dependencies, or high-step changes). Furthermore, traditional methods struggle to establish quantifiable and unified measurement standards. As a result, coupling problems often only surface later, making it difficult to correct design flaws in a timely manner.
[0004] With the further development and popularization of cloud computing, distributed architecture, and microservices, and the rapid iteration of business needs, modern software systems are exhibiting unprecedented scale expansion and a surge in complexity. System component data is increasing dramatically, interaction patterns are becoming more diverse, and systems are in a state of continuous delivery and dynamic evolution. In this context, relying on traditional manual methods to comprehensively and timely analyze and monitor system coupling relationships is becoming increasingly impractical. Subjective, inefficient, and error-prone methods have become one of the bottlenecks in improving the efficiency and quality of software engineering, significantly increasing maintenance costs, system failure risks, and delivery uncertainty.
[0005] Faced with increasingly complex software systems and their continuous evolution, there is an urgent need for a more efficient and accurate method for managing software coupling relationships. This method needs to overcome traditional limitations, possessing the characteristics of automation, objectivity, precision, and quantifiability. It should be able to analyze coupling relationships in large-scale systems in real-time or near real-time, identify hidden dependencies, and provide clear decision support. This will improve the maintainability, scalability, and overall quality of software systems, adapting to the requirements of rapid iteration and continuous evolution in contemporary software. Summary of the Invention
[0006] The technical problem solved by this invention is to address the inability of traditional manual methods to comprehensively and timely analyze and monitor system coupling relationships. Therefore, the purpose of this invention is to provide a software coupling relationship management method, system, and approach based on knowledge graphs. This method constructs a knowledge graph of the software system to achieve visualized display of software coupling relationships, collection of coupling data, intelligent analysis, and management of optimization suggestions, thereby improving risk identification and assessment capabilities and ultimately enhancing the overall stability of the software system.
[0007] Technical solution of the present invention A knowledge graph-based method for managing the coupling relationships of software components includes: Step S1: Define software components; Step S2: Define the coupling relationship; Step S3: Generate or update the knowledge graph; where nodes in the graph represent software components and edges represent the coupling relationships between components; Step S4: Configure software component monitoring; Step S5: Analyze and generate coupling level update suggestions.
[0008] Furthermore, step S1 includes: Step S1.1: Define basic component information; Step S1.2: Define the component coupling level. The coupling level reflects the degree of coupling. The degree of coupling is a decimal between 0 and 1; 0 represents the lowest degree of coupling and 1 represents the highest degree of coupling. Define multiple numerical ranges according to business requirements. Each range is a coupling level.
[0009] Furthermore, step S1.2 includes: Step S1.2.1: Define, edit, and view the coupling level range; Step S1.2.2: Define the coupling level of software components and set the upper and lower limits of the coupling level threshold.
[0010] Furthermore, step S2 includes: Step S2.1: Define the coupling object, that is, specify another defined software component; Step S2.2: Define the coupling type, including but not limited to data coupling type and control coupling type; Step S2.3: Define the coupling direction, including but not limited to defining one software component pointing to another software component.
[0011] Furthermore, step S3 includes: Step S3.1: Generate a coupling relationship view; Step S3.2: Generate a component coupling level analysis view.
[0012] Furthermore, step S4 includes: Step S4.1: Configure the coupling level parameter weight of the software component, and calculate the weight according to one or more parameters sent or received by the component to specify the coupling level; Step S4.2: Collect software component data through the data collector client and report it to the server; Step S4.3: The data collector server stores and analyzes the data reported by each client.
[0013] Furthermore, step S5 includes: Step S5.1: Using the collected data, generate the latest coupling relationship suggestions based on the exponentially weighted moving average algorithm; Step S5.2: Using the collected data, generate the latest coupling level recommendation based on the exponentially weighted moving average algorithm; Step S5.3: Update the coupling relationship and coupling level according to the recommendations in steps S5.1 and S5.2.
[0014] A system applied to the software component coupling relationship management method includes: Software component definition module used to define software components; The coupling relationship definition module is used to define coupling relationships; A graph generation and update module used to generate or update knowledge graphs; A configuration module used to configure monitoring of software components; And an analysis module for analyzing and generating coupling level update recommendations.
[0015] A computer storage medium having computer-executable instructions stored thereon, which, when executed by a processor, implement the method described thereon.
[0016] Beneficial effects This invention provides a knowledge graph-based method, system, and storage medium for managing software component coupling relationships. Based on knowledge graphs, this invention graphically represents complex software component coupling relationships and quantifies the coupling degree between software components, improving analysis efficiency. Through automatic collection of software component coupling level data, it enhances the management efficiency of software coupling degree. Through intelligent data analysis, it provides timely suggestions, improving risk identification and assessment capabilities, thereby enhancing the overall stability of the software system. This invention solves the problems of traditional software coupling relationship management methods, which often rely on manual analysis and experience-based judgment, resulting in high subjectivity, low efficiency, and susceptibility to errors. Specifically, it includes the following advantages: (1) In step S1.1 of step S1 of this application, an automatic identification method for software components is creatively adopted; for online network software, the access party characteristic information is collected through infrastructure such as registration center, configuration center, and gateway, and compared with the defined software component list, and new network components can be automatically identified.
[0017] (2) In step S2.2 of step S2 of this application, a software component dependency inference method is creatively adopted. For online network software, the calling relationship between software is published and statistically analyzed through network monitoring to infer its coupling relationship. For locally running software components, the existence of shared dependency libraries is determined through runtime process monitoring, and then the coupling relationship of software components is inferred. For other software components, their coupling relationship is inferred through static file analysis.
[0018] (3) In step S2.3 of step S2 of this application, a software runtime monitoring method is creatively adopted. By collecting system runtime resource indicators (such as CPU, memory, disk I / O, network I / O, etc.) and application performance indicators (such as request count, response time, error rate, etc.) in real time, the running status of software components is perceived. Through distributed tracing, log collection and analysis, code embedding, etc., the calling relationship between software is perceived. This lays the data foundation for subsequent coupling analysis.
[0019] (4) In step S2.3 of step S2 of this application, edge computing and preprocessing methods are creatively adopted. The data collected by monitoring is preliminarily processed near the monitored software component (on the same hardware) to complete anomaly detection, data cleaning, and index summary calculation. The data obtained after preprocessing is cached locally and pushed after accumulating to a predetermined size or duration. This improves performance and saves resources.
[0020] (5) In step S3 of this application, a dynamic evaluation model for coupling level is established, defining multi-dimensional and multi-level coupling levels, and setting various thresholds in combination with actual conditions. The data monitored during runtime is transformed in real time through preset rules to obtain coupling metadata, and then the coupling level is dynamically updated through an incremental algorithm.
[0021] (6) In step S4.2 of step S4 of this application, a visual decision support method is creatively adopted. Through graph databases, front-end visualization components, etc., software components are presented in the form of "nodes", and the coupling direction and coupling level of software components are presented in the form of "edges". With the help of predefined styles (such as color, thickness, direction, etc.), the actual operation of all software components in the organization is presented in the form of a knowledge graph. By comparing the actual situation with the predefined software importance level, software coupling range, etc., the difference between the expectation and the reality is automatically identified for the user to make decisions. Attached Figure Description
[0022] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0023] The features and illustrative embodiments of various aspects of the present invention will now be described in detail. Numerous specific details are set forth in the following detailed description to provide a thorough understanding of the invention. However, it will be apparent to those skilled in the art that the invention may be practiced without requiring some of these specific details. The following description of embodiments is merely intended to provide a better understanding of the invention by illustrating examples of the invention. The invention is by no means limited to any specific setups and methods set forth below, but covers any improvements, substitutions, and modifications to structures, methods, and devices without departing from the spirit of the invention. Well-known structures and techniques are not shown in the drawings and the following description to avoid unnecessarily obscuring the invention.
[0024] It should be noted that, unless otherwise specified, the embodiments of the present invention and the features thereof can be combined with each other, and the various embodiments can be referenced and cited in each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0025] One embodiment of the present invention is as follows: Figure 1 As shown, a method for managing the coupling relationship of software components based on knowledge graphs is proposed, including: Step S1: Define software components; Step S1 includes: Step S1.1: Define basic component information; Step S1.1 adopts an automatic software component identification method; For online network software, through infrastructure such as registration center, configuration center, and gateway, access party characteristic information is collected and compared with the defined software component list to automatically identify new network components.
[0026] Step S1.2: Define the component coupling level. The coupling level reflects the degree of coupling. The degree of coupling is a decimal between 0 and 1; 0 represents the lowest degree of coupling and 1 represents the highest degree of coupling. Define multiple numerical ranges according to business requirements. Each range is a coupling level.
[0027] Step S1.2 includes: Step S1.2.1: Define, edit, and view the coupling level range; Step S1.2.2: Define the coupling level of software components and set the upper and lower limits of the coupling level threshold.
[0028] Step S2: Define the coupling relationship; Step S2 includes: Step S2.1: Define the coupling object, that is, specify another defined software component; Step S2.2: Define coupling types, including but not limited to data coupling types and control coupling types. This step involves the following methods for inferring software component dependencies: For online network software, network monitoring is used to publish and statistically analyze the call relationships between software components to infer their coupling relationships. For locally running software components, runtime process monitoring is used to determine if there are shared dependency libraries, thereby inferring the software component coupling relationships. For other software components, static file analysis is used to infer their coupling relationships.
[0029] Step S2.3: Define the coupling direction, including but not limited to defining one software component pointing to another. This step employs runtime monitoring methods, using real-time collection of system resource metrics (such as CPU, memory, disk I / O, network I / O, etc.) and application performance metrics (such as request count, response time, error rate, etc.) to perceive the operational status of software components. Through distributed tracing, log collection and analysis, and code instrumentation, the call relationships between software components are perceived. This lays the data foundation for subsequent coupling analysis.
[0030] Simultaneously, this step employs edge computing and preprocessing methods to perform preliminary processing on the monitored data near the monitored software component (on the same hardware), completing anomaly detection, data cleaning, and indicator aggregation calculations. The preprocessed data is cached locally and pushed out only after accumulating to a predetermined size or duration. This improves performance and saves resources.
[0031] Step S3: Generate or update the knowledge graph; wherein nodes in the graph represent software components, and edges represent coupling relationships between components; Step S3 includes: Step S3.1: Generate a coupling relationship view; Step S3.2: Generate a component coupling level analysis view.
[0032] In step S3, a dynamic evaluation model for coupling levels is established, defining multi-dimensional and multi-level coupling levels, and setting thresholds based on actual conditions. The data monitored during runtime is transformed in real-time using preset rules to obtain coupling metadata, and then the coupling levels are dynamically updated using an incremental algorithm.
[0033] Step S4: Configure software component monitoring; Step S4 includes: Step S4.1: Configure the coupling level parameter weight of the software component, and calculate the weight according to one or more parameters sent or received by the component to specify the coupling level; Step S4.2: Collect software component data through the data collector client and report it to the server. This step uses graph databases, front-end visualization components, etc., to represent software components as "nodes" and their coupling direction and coupling level as "edges," supplemented by predefined styles (such as color, thickness, direction, etc.) to present the actual operation of all software components within the organization in the form of a knowledge graph. By comparing the actual situation with the predefined software importance level, software coupling range, etc., the differences between expectations and reality are automatically identified to aid user decision-making.
[0034] Step S4.3: The data collector server stores and analyzes the data reported by each client.
[0035] Step S5: Analyze and generate coupling level update suggestions, wherein step S5 includes: Step S5.1: Using the collected data, generate the latest coupling relationship suggestions based on the exponentially weighted moving average algorithm; Step S5.2: Using the collected data, generate the latest coupling level recommendation based on the exponentially weighted moving average algorithm; Step S5.3: Update the coupling relationship and coupling level according to the recommendations in steps S5.1 and S5.2.
[0036] The second embodiment of this invention is a method for managing the coupling relationship of software components based on knowledge graphs, referring to... Figure 1 As shown, the method performs the following steps: Step S1: Define software components; Specifically, the steps include: Step S1.1: Define basic component information, such as business attributes like component name (softName), type (softType), and responsible organization (supplier). You can also predefine system attributes like the component's network information (softNetInfo) and data storage scale (dataScale) and data throughput scale (throughput).
[0037] Step S1.2: Define the component coupling level. Specifically, the coupling level is a decimal between 0 and 1; 0 represents the lowest coupling level, and 1 represents the highest coupling level. Multiple numerical ranges can be defined according to business requirements, and each range represents a coupling level.
[0038] Step S1.2.1: Define, edit, and view the coupling level range; This can be set in advance according to business needs, such as setting [0,0.3) as low coupling, [0.3,0.7) as medium coupling, and [0.7,1] as high coupling; or it can be left unconfigured for now and set later based on system analysis suggestions.
[0039] Step S1.2.2: Define the coupling level of software components, and set the upper and lower limits of the coupling level threshold. Here, you can set the expected coupling range according to business needs. If the coupling level is exceeded in subsequent monitoring steps, the system will issue a notification for further control.
[0040] Step S2: Define the coupling relationship; Specifically, the steps include: Step S2.1: Define the coupling object, that is, specify another defined software component; Step S2.2: Define the coupling type, including but not limited to data coupling type and control coupling type; Step S2.3: Define the coupling direction, such as one software component pointing to another software component. The coupling relationship can be compared to the concept of vectors; the two software components that generate the coupling relationship are like the two endpoints of a line, which can be determined as the direction.
[0041] Step S3: Generate or update the knowledge graph; where nodes represent software components and edges represent the coupling relationships between components; the generated data is persisted to a traditional relational database or graph database.
[0042] Specifically, the steps include: Step S3.1: Generate a coupling relationship view; This step generates a topology diagram that can be viewed in a browser or client. The nodes in the diagram are software components, and the edges in the diagram are coupling relationships.
[0043] Step S3.2: Component Coupling Level Analysis View; This step generates two topology diagrams, one expected and one actual, where the edges represent the coupling level.
[0044] Step S4: Configure software component monitoring; Specifically, the steps include: Step S4.1: Configure the coupling level parameter weight of the software component, and calculate the weight according to one or more parameters sent or received by the component to specify the coupling level; Step S4.2: Collect software component data through the data collector client and report it to the server; Step S4.3: The data collector server stores and analyzes the data reported by each client; Step S5: Analyze and generate coupling level update suggestions; Specifically, the steps include: Step S5.1: Using the collected data, generate the latest coupling relationship suggestions using the exponentially weighted moving average algorithm; Step S5.2: Using the collected data, generate the latest coupling level recommendations using an exponentially weighted moving average algorithm; Step S5.3: The coupling relationship and coupling level can be updated according to the recommendations in steps S5.1 and S5.2.
[0045] The third embodiment of the present invention provides a knowledge graph-based software component coupling relationship management method. Specifically, by constructing and analyzing the knowledge graph of the software system, intelligent management of software coupling relationships is achieved, thereby improving risk identification and assessment capabilities and enhancing the overall stability of the software system.
[0046] The software component coupling management relies on two software components: one is a coupling management module running on the server side, which can be integrated with other systems or run independently; the other is a monitoring component running on the client side, used for data reporting. Developers can also develop their own client-side logic for data reporting according to the coupling management standard.
[0047] First, define software components in the server-side coupling management module based on actual business needs. These components include, but are not limited to, interfaces, classes, modules, and services. Add functional descriptions, parameter definitions, and data types to enrich the information of each component. The core of this step is to assign a unique software identifier (appId) to each component. Next, define the predefined coupling relationships and coupling levels for each component, as well as the expected upper and lower limits of the coupling level. Then, define the coupling relationships, coupling types, and coupling directions between this component and other components. Based on the above predefined information, generate or update the initial knowledge graph.
[0048] Then, after completing the basic definitions, configure the client monitoring component to automatically collect coupling relationship information between components during software component runtime, such as network target address access counts, network I / O, response time, and local call counts. The monitoring client will temporarily store this raw data locally, periodically aggregate the raw data, and then report it to the server. Based on the collected raw information, the server will first persist the behavioral and characteristic data of the software component in chronological order. Then, it will calculate the actual coupling level in near real-time and automatically discover newly generated coupling relationships. The server-side coupling management module compares the actual coupling data with the coupling relationships and upper and lower limits defined by the user's prevention settings, marking coupling relationships that meet the expectations as healthy and coupling relationships that exceed the expectations as abnormal. The system will proactively prompt the differences and provide new coupling relationship suggestions, which the administrator can use to update the knowledge graph.
[0049] A fourth embodiment of the present invention provides a system applied to the software component coupling relationship management method, comprising: Software component definition module used to define software components; The coupling relationship definition module is used to define coupling relationships; A graph generation and update module used to generate or update knowledge graphs; A configuration module used to configure monitoring of software components; And an analysis module for analyzing and generating coupling level update recommendations.
[0050] The last embodiment of the present invention is a computer storage medium storing computer-executable instructions thereon, which, when executed by a processor, implement the method described thereon.
[0051] In summary, the software component coupling relationship management method, system, and storage medium based on knowledge graphs provided by this invention graphically represent complex software component coupling relationships and digitize the coupling degree between software components, thereby improving analysis efficiency. Through automatic collection of software component coupling level data, the management efficiency of software coupling degree is improved. Through intelligent data analysis, timely suggestions are made, enhancing risk identification and assessment capabilities, and ultimately improving the overall stability of the software system. This invention solves the problems of traditional software coupling relationship management methods, which often rely on manual analysis and experience-based judgment, resulting in high subjectivity, low efficiency, and susceptibility to errors.
[0052] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should be covered within the protection scope of the present invention.
Claims
1. A knowledge graph based software component coupling relationship management method, characterized in that, Comprising: Step S1: defining software components; Step S2: defining coupling relationships; Step S3: generating or updating a knowledge graph; Wherein the nodes in the graph represent software components, and the edges represent coupling relationships between components; Step S4: configuring software component monitoring; Step S5: analyzing and generating coupling level update suggestions.
2. The method of claim 1, wherein, The step S1 includes: Step S1.1: defining component basic information; Step S1.2: defining component coupling levels, which reflect coupling degrees, wherein the coupling degree is a decimal between 0 and 1; 0 represents the lowest coupling degree, and 1 represents the highest coupling degree; according to business definition, multiple numerical ranges are defined, and each range is a coupling level.
3. The method of claim 2, wherein, The step S1.2 includes: Step S1.2.1: coupling level range definition, editing, and viewing; Step S1.2.2: software component coupling level definition, coupling level threshold upper and lower limit setting.
4. The method of claim 3, wherein, The step S2 includes: Step S2.1: defining coupling objects, i.e., specifying another defined software component; Step S2.2: defining coupling types, including but not limited to data coupling types and control coupling types; Step S2.3: defining coupling directions, including but not limited to defining one software component pointing to another software component.
5. The method of claim 4, wherein, The step S3 includes: Step S3.1: generating a coupling relationship view; Step S3.2: generating a component coupling level analysis view.
6. The method of claim 5, wherein, The step S4 includes: Step S4.1: software component coupling level parameter weight configuration, specifying coupling level calculation weights according to one or more parameters sent or received by the component; Step S4.2: collecting software component data through a data collector client and reporting to the server; Step S4.3: data collector server, storing and analyzing the reporting data of each client.
7. The method of claim 6, wherein, The step S5 includes: Step S5.1: generating the latest coupling relationship suggestions according to the exponential weighted moving average algorithm based on the collected data; Step S5.2: generating the latest coupling level suggestions according to the exponential weighted moving average algorithm based on the collected data; Step S5.3: updating the coupling relationship and coupling level according to the suggestions of steps S5.1 and S5.
2.
8. A system for applying the software component coupling relationship management method of claim 7, wherein, Comprising: A software component definition module for defining software components; A coupling relationship definition module for defining coupling relationships; A graph generation and update module for generating or updating a knowledge graph; A configuration module for configuring software component monitoring; And an analysis module for analyzing and generating coupling level update suggestions.
9. A computer storage medium having computer executable instructions stored thereon, the computer executable instructions being executed by a processor to implement the method of any one of claims 1-7.