A component dependency relationship generation method, device, equipment and storage medium

By analyzing the code to obtain class information and class call relationships, component dependencies are automatically generated, solving the problem of inaccurate manual component dependency analysis and improving the accuracy and completeness of component dependencies.

CN114816413BActive Publication Date: 2026-07-14BEIJING ZITIAO NETWORK TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING ZITIAO NETWORK TECH CO LTD
Filing Date
2021-01-27
Publication Date
2026-07-14

Smart Images

  • Figure CN114816413B_ABST
    Figure CN114816413B_ABST
Patent Text Reader

Abstract

The present disclosure provides a component dependency relationship generation method, device, equipment and storage medium. The method comprises: obtaining class information in a specified warehouse by analyzing code in the specified warehouse; wherein the class information comprises a corresponding relationship between a class name and a class call relationship, and the class call relationship is used to represent the call relationship of a class with the class name to other classes; determining a class name corresponding to a to-be-processed component from the class information, and obtaining a class call relationship corresponding to the class name; and generating a component dependency relationship corresponding to the to-be-processed component based on the class call relationship corresponding to the class name. The present embodiment can improve the accuracy of generating the component dependency relationship.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing, and in particular to a method, apparatus, device, and storage medium for generating component dependencies. Background Technology

[0002] For a project, the code that implements it is actually componentized, and a component can be considered a sub-functional module that implements the project. When it's necessary to adjust a specific function of the project (such as upgrading or fixing bugs), this can be achieved by modifying the component corresponding to that function. Because project components have dependencies (also known as calling relationships), modifying the current component may affect the development performance of other components that depend on it or introduce unpredictable bugs. In this case, it's necessary to determine the dependencies between the current component and other components.

[0003] Currently, programmers typically rely on code review or development experience to identify dependencies between components; however, this approach is prone to overlooking components and their dependencies, leading to inaccurate identification of component dependencies. Summary of the Invention

[0004] To solve the above-mentioned technical problems, or at least partially solve them, this disclosure provides a method, apparatus, device, and storage medium for generating component dependencies, which can improve the accuracy of the determined component dependencies.

[0005] In a first aspect, this disclosure provides a method for generating component dependencies, the method comprising: analyzing code in a specified repository to obtain class information in the specified repository; wherein the class information includes a correspondence between class names and class call relationships, the class call relationship representing the call relationship between a class with the class name and other classes; determining the class name corresponding to the component to be processed from the class information, and obtaining the class call relationship corresponding to the class name; and generating the component dependency relationship corresponding to the component to be processed based on the class call relationship corresponding to the class name.

[0006] Optionally, the component to be processed belongs to the component list corresponding to the specified repository; generating the component dependency relationship corresponding to the component to be processed based on the class call relationship corresponding to the class name includes:

[0007] Identify the string in the source code corresponding to the class name that ends with a preset first string; wherein the preset first string is used as the external call identifier of the component; replace the preset first string in the string with a preset second string to obtain the replaced string; wherein the preset second string is used as the name identifier of the component; if it is determined that the replaced string belongs to the component list corresponding to the specified repository, then generate the component dependency relationship between the component name and the component to be processed.

[0008] Optionally, before generating the component dependency relationship between the component name and the component to be processed, the method further includes: determining whether the replaced string is the name of the component to be processed; correspondingly, if it is determined that the replaced string belongs to the component list corresponding to the specified repository, generating the dependency relationship between the component name and the component to be processed includes:

[0009] If it is determined that the replaced string belongs to the component list corresponding to the specified repository, and the replaced string is not the name of the component to be processed, then a component dependency relationship between the component name and the component to be processed is generated.

[0010] Optionally, the method further includes: determining whether the preset component dependency rule corresponding to the component to be processed is satisfied based on the component dependency relationship corresponding to the component to be processed; if it is determined that the preset component dependency rule corresponding to the component to be processed is not satisfied, then sending a notification message to the responsible user corresponding to the component to be processed.

[0011] Optionally, the component to be processed belongs to the component list corresponding to the specified repository, and the method further includes: after determining the component dependencies of the components in the component list corresponding to the specified repository, generating a component dependency directed graph; based on the component dependency directed graph, determining whether a component dependency cycle exists; if the component dependency cycle exists, sending notification information to the responsible users corresponding to the components included in the component dependency cycle.

[0012] Optionally, determining whether a component dependency cycle exists based on the directed graph of component dependencies includes: determining whether a component dependency cycle exists by using a depth-first traversal method based on the directed graph of component dependencies.

[0013] Secondly, this disclosure provides a component dependency generation apparatus, the apparatus comprising: a class information acquisition module, configured to obtain class information in a specified repository by analyzing code in a specified repository; wherein the class information includes a correspondence between class names and class call relationships, the class call relationship representing the call relationship between a class with the class name and other classes; a class call relationship acquisition module, configured to determine the class name corresponding to the component to be processed from the class information and obtain the class call relationship corresponding to the class name; and a dependency generation module, configured to generate the component dependency relationship corresponding to the component to be processed based on the class call relationship corresponding to the class name.

[0014] Thirdly, this disclosure provides a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to perform the method described in the first aspect.

[0015] Fourthly, this disclosure provides an apparatus comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method as described in the first aspect.

[0016] Fifthly, this disclosure provides a computer program product including a computer program / instructions that, when executed by a processor, implement the steps of the method as described in the first aspect.

[0017] The technical solution provided in this disclosure has the following advantages compared with the prior art:

[0018] This disclosure provides a method for generating component dependencies. First, by analyzing the code, class information in the specified repository is obtained. The class information includes the correspondence between class names and class call relationships. Then, the class name corresponding to the component to be processed is determined from the class information, and the class call relationship corresponding to the class name is obtained. Finally, based on the class call relationship corresponding to the class name, the component dependency relationship corresponding to the component to be processed is generated.

[0019] Compared to the method of developers manually sorting out component dependencies, in this embodiment, since the class information is automatically analyzed from the code in the repository, the omission of class information can be effectively avoided, thus effectively improving the problem of missing components and their dependencies. Based on this, the component dependencies of the components to be processed are automatically generated according to the class call relationship, which effectively improves the accuracy of component dependency relationships. Attached Figure Description

[0020] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0021] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 A flowchart illustrating a method for generating component dependencies according to an embodiment of this disclosure;

[0023] Figure 2 A flowchart illustrating a method for generating component dependencies corresponding to a component to be processed, provided in an embodiment of this disclosure;

[0024] Figure 3 A component dependency directed graph provided in this disclosure embodiment;

[0025] Figure 4 A schematic diagram of the structure of a component dependency generation device provided in an embodiment of this disclosure;

[0026] Figure 5 This is a schematic diagram of the structure of a component dependency generation device provided in an embodiment of the present disclosure. Detailed Implementation

[0027] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.

[0028] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.

[0029] In this embodiment of the disclosure, modifying a component of a project's functionality can adversely affect other components that depend on that component. Taking a photo-taking project as an example, modifying the filter component may affect prop components that depend on the filter component; for example, it might cause a bug where props cannot be displayed correctly. In this case, programmers need to review the code or rely on their development experience to identify the dependencies between components, and then apply these dependencies to perform subsequent processing, such as adaptive modifications and testing of dependent components. However, manually identifying dependencies is prone to overlooking components and their dependencies, leading to inaccurate dependencies. Inaccurate dependencies can further have unpredictable adverse effects on the project, such as preventing comprehensive modifications and testing of other dependent components, causing the corresponding components to malfunction.

[0030] Therefore, this disclosure provides a method, apparatus, device, and storage medium for generating component dependencies. This technology can be applied to any device that supports code analysis, such as a computer. For ease of understanding, the method for generating component dependencies provided in this disclosure will first be described in detail.

[0031] refer to Figure 1 The flowchart below illustrates a method for generating component dependencies according to an embodiment of this disclosure. The method includes:

[0032] S101: By analyzing the code in the specified repository, class information in the specified repository is obtained; wherein, class information includes the correspondence between class names and class call relationships, and class call relationships are used to represent the call relationship between classes with class names and other classes.

[0033] In this embodiment, a project includes multiple repositories. A repository is a collection of code that implements multiple functions of the project. Each function can be implemented by a component, and each component includes multiple classes; or it can be understood that the code in a repository contains a large number of classes. This embodiment can scan the code in a specified repository corresponding to the received repository name. The code in the specified repository is analyzed using the jsonModel tool to obtain all class information in the specified repository. Class information can be stored using a key-value pair structure, where each key corresponds to a unique value; where the key in the class information is the class name, and the value is the class call relationship. By storing class information using a key-value structure, the correspondence between class names and class call relationships in the class information is determined. In the current class information, the class call relationship is used to represent the call relationship between the current class and other classes. This call relationship can be either the current class calling other classes or other classes calling the current class; in addition, the class call relationship can also include the analysis results such as the current class's attributes, implementation methods, and file information.

[0034] S102: Determine the class name corresponding to the component to be processed from the class information, and obtain the class call relationship corresponding to the class name.

[0035] The component to be processed can be, for example, a component that changes based on user actions, or any component in the component list corresponding to a specified repository. Each component includes an external call class within its multiple classes. Each component uses its own external call class to call other external components; that is, external calls between components are implemented through the external call class.

[0036] The components in this embodiment adopt an MVVM (Model-View-ViewModel) architecture, based on which each component corresponds to a unique external calling class. In one implementation, a component can be recorded using a combination of its name and a string representing the component. Correspondingly, the external calling class included in the component is recorded using a combination of its class name and a string representing the class. For the same component, its component name and the ViewModel's class name are the same, while the component's string and the class's string are different. For example, for component A, it can be recorded as A.component, and the external calling class of component A can be recorded as A.ViewModel.

[0037] In this case, the class name corresponding to the component to be processed can be determined from the class information based on the name of the component to be processed, and the class call relationship corresponding to the determined class name can be obtained based on the correspondence between the class name and the class call relationship.

[0038] S103: Based on the class call relationship corresponding to the class name, generate the component dependency relationship corresponding to the component to be processed.

[0039] For ease of description, this embodiment uses the class name corresponding to the component to be processed determined in step S102 as the target class name. Correspondingly, the target class name corresponds to the target class call relationship, and the target class is determined by the target class name and the target class call relationship. This embodiment first determines all classes that have a call relationship with the target class based on the target class call relationship, and refers to these classes as the call classes of the target class. Then, it determines the components corresponding to the above call classes; it iterates through the components corresponding to the call classes, determining one by one whether each component has a dependency relationship with the component to be processed, and then generates the component dependency relationship corresponding to the component to be processed based on the determination result.

[0040] The component dependency generation method provided in this embodiment first obtains class information from a specified repository by analyzing the code. This class information includes the correspondence between class names and class call relationships. Then, it determines the class name corresponding to the component to be processed from the class information and obtains the class call relationship corresponding to that class name. Finally, based on the class call relationship corresponding to the class name, it generates the component dependency relationship corresponding to the component to be processed. Compared to manual sorting methods with lower accuracy, in this embodiment, since the class information is obtained from the code in the repository, omissions of class information can be effectively avoided, thus effectively improving the problem of omissions of components and their dependencies. Based on this, the component dependency relationship of the component to be processed is automatically generated according to the class call relationship, effectively improving the accuracy of the component dependency relationship.

[0041] In one embodiment, the components to be processed belong to a component list corresponding to a specified repository. The component list records all components to be processed in the specified repository. Each component in the component list needs to be processed individually to generate the component dependencies corresponding to each component. (See reference...) Figure 2 The following is a flowchart of a method for generating component dependency relationships corresponding to components to be processed based on target class call relationships, provided in this embodiment of the disclosure. The method includes:

[0042] S201: Determine the string in the source code corresponding to the class name that ends with a preset first string; where the preset first string is used as the external call identifier of the component, such as ViewModel.

[0043] In the specific implementation, based on the target class call relationship, the source code corresponding to the class name is determined. The determined source code includes: the code of all calling classes that have a call relationship with the target class with the class name; and from the determined source code, a string ending with the preset first string "ViewModel" is selected. The component makes external calls through the external calling class, and the first string is used as the external call identifier of the component, that is, the first string is used as the name identifier of the component's external calling class.

[0044] S202: Replace the preset first string in the string with the preset second string to obtain the replaced string; wherein, the preset second string is used as the name identifier of the component, for example, Component.

[0045] Specifically, the first string "ViewModel," which identifies the class that makes the external call, is replaced with the second string "Component," which identifies the component, resulting in the replaced string. For example, if the string ending with the default first string is "A.ViewModel," then the replaced string will be "A.Component." Since the replaced string includes the second string, which serves as the component's name, it should generally represent the component name.

[0046] S203: If it is determined that the replaced string belongs to the component list corresponding to the specified repository, then generate the dependency relationship between the component name and the component to be processed.

[0047] Considering the different naming habits of programmers in practical applications, other objects that are not classes may also end with the first string. In this case, the replaced string corresponding to the object will definitely not belong to the component list corresponding to the specified repository. Therefore, this embodiment first determines whether the replaced string belongs to the component list corresponding to the specified repository, and if so, generates the dependency relationship between the component name and the component to be processed.

[0048] In one possible scenario, the component name represented by the replaced string might be the name of the component being processed. Clearly, it would be unreasonable for the component to be processed to have a dependency relationship with itself. Therefore, this embodiment can first determine whether the replaced string is indeed the name of the component to be processed before generating the dependency relationship between the component name and the component to be processed.

[0049] After that, if it is determined that the replaced string belongs to the component list corresponding to the specified repository, and the replaced string is not the name of the component to be processed, then the dependency relationship between the component name and the component to be processed is generated.

[0050] Each component in the component list is treated as a component to be processed, and the dependency relationship corresponding to each component to be processed is obtained according to the above steps S201 to S203; then, the component dependency relationship between all components in the component list can be obtained according to the dependency relationship corresponding to each component to be processed.

[0051] After generating component dependencies, this embodiment provides several application examples of component dependencies.

[0052] An optional implementation may be as follows: based on the component dependency relationship corresponding to the component to be processed, determine whether the preset component dependency rule corresponding to the component to be processed is satisfied; if it is determined that the preset component dependency rule corresponding to the component to be processed is not satisfied, then send a notification message to the responsible user corresponding to the component to be processed.

[0053] The above component dependency rules are rules that users configure for the components to be processed, such as: not allowed to be called by other components, not allowed to call other components, and a maximum number of components with calling relationships (e.g., allowed to be called by a maximum of three other components), etc.

[0054] Another alternative implementation may include the following three steps:

[0055] Step 1: After determining the component dependencies of each component in the component list corresponding to the specified repository, generate a directed component dependency graph. The directed component dependency graph consists of multiple nodes connected by directed edges. Nodes in the graph represent components from the component list; two components connected by a directed edge are considered to have a dependency relationship, and the direction of the edge indicates the dependency between the two components; for example, a directed edge from component A to component B indicates that component A depends on component B.

[0056] To better understand the directed graph of component dependencies, please refer to... Figure 3 Examples. Figure 3 The diagram shows a directed graph of component dependencies generated based on the dependencies of component A to be processed. In this directed graph, component A is the central node. Starting from component A, multiple components that have dependencies on it are represented, such as component B and component E that component A depends on, and component C that component B depends on. These will not be listed one by one here.

[0057] Step 2: Based on the directed graph of component dependencies, determine whether a component dependency cycle exists.

[0058] In practical implementation, a depth-first traversal method can be used based on the directed graph of component dependencies to determine whether a component dependency cycle exists. The depth-first traversal method can be understood as starting from a vertex in the directed graph of component dependencies (taking component A as an example), and performing the following steps: visit component A, starting from the unvisited adjacent nodes of component A, and perform a depth-first traversal of the directed graph of component dependencies until all nodes in the directed graph of component dependencies that have a path to component A have been visited. Upon completion of the visit, a visit path is generated. The system then checks whether any visit path is a closed loop, for example... Figure 3 The access path circled by the dashed line is the closed loop state. Multiple components on the access path of the closed loop state form a component dependency loop.

[0059] Step 3: If a component dependency cycle is determined to exist, send notification information to the responsible users corresponding to the components contained in the component dependency cycle.

[0060] When the first component in the component dependency cycle changes, it causes a change in the second component in the same cycle. The change in the second component further affects the change in the third component, and so on. This effect eventually returns to the first component, creating an endless loop. For example... Figure 3 Component A affects component D, component D affects component F, component F affects component A, and so on, repeating the process of component A affecting component D... Therefore, when a component dependency cycle is confirmed to exist, notification messages are sent to the responsible users corresponding to the components included in the dependency cycle to remind them to check whether the dependencies between components are healthy and whether further adjustments are needed.

[0061] In summary, in this embodiment of the disclosure, since the class information is obtained from the code in the repository, the omission of class information can be effectively avoided, thus effectively improving the problem of omission of components and their dependencies. Based on this, the component dependencies of the components to be processed are automatically generated according to the class call relationship, which not only effectively improves the accuracy of the component dependencies, but also reduces the tedious manual sorting work.

[0062] Furthermore, utilizing highly accurate component dependency relationships can have beneficial effects on various application scenarios, such as: improving the testing accuracy of other components in the component dependency relationship; and more effectively detecting the health of dependencies between components based on accurate component dependency relationships, thereby enabling the early detection of unreasonable dependencies and avoiding potential code errors.

[0063] Based on the above method embodiments, this disclosure also provides a component dependency generation apparatus, with reference to... Figure 4This is a schematic diagram of a component dependency generation device provided in an embodiment of the present disclosure. The device includes:

[0064] The class information acquisition module 402 is used to obtain class information in a specified repository by analyzing the code in the specified repository; wherein, the class information includes the correspondence between class names and class call relationships, and the class call relationship is used to represent the call relationship between a class with a class name and other classes;

[0065] The class call relationship acquisition module 404 is used to determine the class name corresponding to the component to be processed from the class information and to obtain the class call relationship corresponding to the class name;

[0066] The dependency generation module 406 is used to generate the component dependency relationship of the component to be processed based on the class call relationship corresponding to the class name.

[0067] In one optional implementation, the component to be processed belongs to the component list corresponding to a specified repository; the dependency generation module 406 is specifically used for:

[0068] Identify the string in the source code corresponding to the class name that ends with a preset first string; the preset first string is used as the external call identifier of the component; replace the preset first string in the string with a preset second string to obtain the replaced string; the preset second string is used as the name identifier of the component; if it is determined that the replaced string belongs to the component list corresponding to the specified repository, then generate the component dependency relationship between the component name and the component to be processed.

[0069] In one optional embodiment, the apparatus further includes a determining module; the determining module is used to:

[0070] Determine if the replaced string is the name of the component to be processed;

[0071] Correspondingly, if it is determined that the replaced string belongs to the component list corresponding to the specified repository, and the replaced string is not the name of the component to be processed, then the component dependency relationship between the component name and the component to be processed is generated.

[0072] In one optional embodiment, the apparatus further includes a first notification module, the first notification module being used for:

[0073] Based on the component dependencies of the component to be processed, determine whether the preset component dependency rules of the component to be processed are met; if it is determined that the preset component dependency rules of the component to be processed are not met, send a notification message to the responsible user of the component to be processed.

[0074] In one optional embodiment, the apparatus further includes a second notification module, the second notification module being used for:

[0075] Once the component dependencies of the components in the component list corresponding to the specified repository are determined, a directed component dependency graph is generated. Based on the directed component dependency graph, it is determined whether a component dependency cycle exists. If a component dependency cycle is determined to exist, notification information is sent to the responsible users corresponding to the components contained in the component dependency cycle.

[0076] In one optional implementation, the second notification module is specifically used to: determine whether a component dependency cycle exists based on the component dependency directed graph using a depth-first traversal method.

[0077] The component dependency generation apparatus provided in this embodiment can effectively avoid the omission of class information because the class information is obtained from the code in the repository. Therefore, it can effectively improve the problem of omission of components and their dependencies. Based on this, the component dependency relationship of the component to be processed is automatically generated according to the class call relationship, which effectively improves the accuracy of the component dependency relationship.

[0078] In addition to the methods and apparatus described above, this disclosure also provides a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to implement the methods described above.

[0079] This disclosure also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the methods described in this disclosure.

[0080] In addition, this disclosure also provides a device for generating component dependencies, see [link to relevant documentation]. Figure 5 As shown, the device may include:

[0081] The device comprises a processor 501, a memory 502, an input device 503, and an output device 504. The number of processors 501 in the component dependency generation device can be one or more. Figure 5 Taking a processor as an example. In some embodiments of this disclosure, the processor 501, memory 502, input device 503, and output device 504 can be connected via a bus or other means, wherein, Figure 5 Taking the example of a connection between China and Israel via a bus.

[0082] The memory 502 can be used to store software programs and modules. The processor 501 executes various functional applications and data processing of the component-dependent generation device by running the software programs and modules stored in the memory 502. The memory 502 may mainly include a program storage area and a data storage area, wherein the program storage area may store the operating system, at least one application program required for a function, etc. In addition, the memory 502 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. The input device 503 can be used to receive input digital or character information, and generate signal inputs related to user settings and function control of the component-dependent generation device.

[0083] Specifically in this embodiment, the processor 501 will load the executable files corresponding to the processes of one or more applications into the memory 502 according to the following instructions, and the processor 501 will run the applications stored in the memory 502, thereby realizing the various functions of the above-mentioned component dependency generation device.

[0084] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0085] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for generating component dependencies, characterized in that, The method includes: By analyzing the code in a specified repository, class information in the specified repository is obtained; wherein, the class information includes the correspondence between class names and class call relationships, the class name is the class name of the class that makes external calls, and the class call relationship is used to represent the call relationship between the class with the class name and other classes; Determine the class name corresponding to the component to be processed from the class information, and obtain the class call relationship corresponding to the class name; Based on the class call relationship corresponding to the class name, a component dependency relationship corresponding to the component to be processed is generated; wherein, generating the component dependency relationship corresponding to the component to be processed based on the class call relationship corresponding to the class name includes: determining a string in the source code corresponding to the class name that ends with a preset first string; wherein, the preset first string is used as an external call identifier for the component; replacing the preset first string in the string with a preset second string to obtain a replaced string; wherein, the preset second string is used as a name identifier for the component; if it is determined that the replaced string belongs to the component list corresponding to the specified repository, then a component dependency relationship between the component name and the component to be processed is generated.

2. The method according to claim 1, characterized in that, The component to be processed belongs to the component list corresponding to the specified repository.

3. The method according to claim 1, characterized in that, Before generating the component dependency relationship between the component name and the component to be processed, the process also includes: Determine whether the replaced string is the name of the component to be processed; Accordingly, if it is determined that the replaced string belongs to the component list corresponding to the specified repository, then generating the dependency relationship between the component name and the component to be processed includes: If it is determined that the replaced string belongs to the component list corresponding to the specified repository, and the replaced string is not the name of the component to be processed, then a component dependency relationship between the component name and the component to be processed is generated.

4. The method according to claim 1, characterized in that, The method further includes: Based on the component dependency relationship corresponding to the component to be processed, determine whether the preset component dependency rule corresponding to the component to be processed is satisfied; If it is determined that the preset component dependency rule corresponding to the component to be processed is not met, a notification message is sent to the responsible user corresponding to the component to be processed.

5. The method according to claim 1, characterized in that, The component to be processed belongs to the component list corresponding to the specified repository, and the method further includes: Once the component dependencies of the components in the component list corresponding to the specified repository are determined, a component dependency directed graph is generated. Based on the aforementioned component dependency directed graph, determine whether a component dependency cycle exists; If the component dependency loop is determined to exist, notification information is sent to the responsible users corresponding to the components contained in the component dependency loop.

6. The method according to claim 5, characterized in that, Determining whether a component dependency cycle exists based on the directed graph of component dependencies includes: Based on the aforementioned directed graph of component dependencies, a depth-first traversal method is used to determine whether a component dependency cycle exists.

7. A device for generating component dependencies, characterized in that, The device includes: The class information acquisition module is used to obtain class information in a specified repository by analyzing the code in the specified repository; wherein, the class information includes the correspondence between class names and class call relationships, the class name is the class name of the class that makes external calls, and the class call relationship is used to represent the call relationship between the class with the class name and other classes; The class call relationship acquisition module is used to determine the class name corresponding to the component to be processed from the class information, and to acquire the class call relationship corresponding to the class name; A dependency generation module is used to generate component dependencies for the component to be processed based on the class call relationship corresponding to the class name. Specifically, the dependency generation module determines a string in the source code corresponding to the class name that ends with a preset first string; the preset first string serves as the component's external call identifier. The preset first string is replaced with a preset second string to obtain a replaced string; the preset second string serves as the component's name identifier. If the replaced string is determined to belong to the component list corresponding to the specified repository, a component dependency relationship is generated between the component name and the component to be processed.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a terminal device, cause the terminal device to perform the method as described in any one of claims 1-6.

9. A device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method as claimed in any one of claims 1-6.

10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method as described in any one of claims 1-6.