Component verification method, computer equipment and computer program product

By performing multi-dimensional verification of component dependencies in client application development, the application stability problem caused by complex component dependencies is solved, and the stability and reliability of the application are achieved.

CN119537118APending Publication Date: 2025-02-28BEIJING JIDU TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411688674.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

During the development of client applications, as the application scale expands, the dependencies between components become complex, which can easily lead to application stability problems, compilation errors and runtime crashes.

Method used

Provides a component verification method, by obtaining the dependencies to be verified between the component to be verified and other components, and verifying these dependencies under multiple dependency detection dimensions (such as circular dependency detection, version detection, hierarchical detection and invalid dependency detection) to ensure their rationality.

Benefits of technology

Automatically verify the rationality of component dependencies, ensure the stability and reliability of the application, and avoid stability problems and errors caused by improper dependency configuration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537118A_ABST
    Figure CN119537118A_ABST
Patent Text Reader

Abstract

The invention provides a component verification method, computer equipment and a computer program product, which are applied to the field of computers, and the method comprises the following steps: obtaining a to-be-verified dependency relationship between a to-be-verified component and other components; under at least one dependency detection dimension, verifying the rationality of the dependency relationship to be verified in the main project of the target client; under the condition that the verification result corresponding to each dependency detection dimension is passed, determining that the verification of the to-be-verified dependency relationship is passed, and assembling and compiling the to-be-verified component and the main project to realize the calling of the to-be-verified component; in this way, the rationality of the component dependency relationship can be automatically verified, so that the stability and reliability of the application are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a component verification method, a computer device, and a computer program product. Background Art

[0002] In the process of client application development, developers usually use third-party libraries and internal components to speed up development. However, as the scale of applications expands, the dependencies between components become increasingly complex. If the dependencies are not configured properly, it may cause application stability problems, compilation errors, and even crashes at runtime. Therefore, it is very necessary to detect the dependencies between components during the development process. Summary of the invention

[0003] The embodiments of the present disclosure at least provide a component verification method, a computer device, and a computer program product.

[0004] In a first aspect, an embodiment of the present disclosure provides a component verification method, including:

[0005] Get the dependency relationship between the component to be verified and other components to be verified;

[0006] Verifying the rationality of the dependency relationship to be verified in the main project of the target client under at least one dependency detection dimension;

[0007] When the verification results corresponding to each dependency detection dimension are all verified, it is determined that the dependency relationship to be verified is verified, and the component to be verified is assembled and compiled with the main project to implement the call of the component to be verified.

[0008] In a possible implementation, verifying the rationality of the dependency relationship to be verified in the main project of the target client under at least one dependency detection dimension includes:

[0009] Based on the dependency to be verified, the initial configuration file of the target client main project is updated to obtain a target configuration file; wherein the initial configuration file includes the dependency between the initial components included in the main project;

[0010] Constructing a directed acyclic graph for characterizing dependency relationships between components based on the target configuration file, wherein nodes of the directed acyclic graph are components, edges are dependency relationships between components, and the components include the initial component and the component to be verified;

[0011] Based on the directed acyclic graph, the rationality of the dependency relationship to be verified in the main project of the target client is verified under the at least one dependency detection dimension.

[0012] In a possible implementation, the dependency detection dimension includes a circular dependency detection dimension;

[0013] The verifying the rationality of the dependency relationship to be verified in the main project of the target client under the at least one dependency detection dimension based on the directed acyclic graph includes:

[0014] Determine a first target node in the directed acyclic graph; wherein other nodes that depend on the first target node are empty;

[0015] Deleting the edge connecting the first target node and the first target node to update the directed acyclic graph;

[0016] Returning to the step of determining the first target node until a new first target node cannot be determined;

[0017] When the updated directed acyclic graph does not include a closed loop, it is determined that the dependency relationship to be verified passes verification under the circular dependency detection dimension.

[0018] In a possible implementation, the dependency to be verified includes a first dependency and / or a second dependency, wherein the first dependency is the relationship between the component to be verified and a first component on which the component to be verified depends, and the second dependency is the relationship between the component to be verified and a second component that depends on the component to be verified.

[0019] In a possible implementation manner, the dependency relationship to be verified includes a component identifier of the first component and / or a component identifier of the second component; the dependency detection dimension includes an invalid dependency detection dimension;

[0020] The verifying the rationality of the dependency relationship to be verified in the main project of the target client under at least one dependency detection dimension includes:

[0021] Based on the initial configuration file, verifying the authenticity of the component identification of the first component and / or the component identification of the second component;

[0022] In the event that the authenticity verification fails, it is determined that the dependency to be verified fails verification under the invalid dependency detection dimension.

[0023] In a possible implementation, the dependency detection dimension includes a version detection dimension;

[0024] The target configuration file also includes version information of other components that each component depends on;

[0025] The verifying the rationality of the dependency relationship to be verified in the main project of the target client under the at least one dependency detection dimension based on the directed acyclic graph includes:

[0026] Determine a second target node in the directed acyclic graph; wherein the second target node is a node having multiple third target nodes that depend on the second target node;

[0027] Determine whether the version information of the second target nodes that each third target node depends on is consistent;

[0028] If not, it is determined that verification of the dependency to be verified has failed under the version detection dimension.

[0029] In a possible implementation, the dependency detection dimension includes a level detection dimension;

[0030] The method further comprises:

[0031] Obtaining first-level information of the component to be verified;

[0032] The method of updating the initial configuration file of the target client main project based on the dependency relationship to be verified to obtain the target configuration file includes:

[0033] Based on the dependency to be verified and the first-level information, the initial configuration file of the target client main project is updated to obtain a target configuration file; wherein the initial configuration file also includes the second-level information of each of the initial components;

[0034] The verifying the rationality of the dependency relationship to be verified in the main project of the target client under at least one dependency detection dimension includes:

[0035] When it is detected that the hierarchical information of each component and the hierarchical information of other components on which each component depends do not conform to the preset hierarchical dependency rule, it is determined that the verification of the dependency relationship to be verified fails under the hierarchical detection dimension.

[0036] In a possible implementation, the hierarchical dependency rules include dependency rules between different hierarchies and / or dependency rules between each component and components of other hierarchies.

[0037] In a possible implementation, the at least one dependency detection dimension includes multiple ones of a circular dependency detection dimension, a version detection dimension, a level detection dimension, and an invalid dependency detection dimension;

[0038] The verifying the rationality of the dependency relationship to be verified in the main project of the target client under at least one dependency detection dimension includes:

[0039] Determine the detection order of each dependent detection dimension;

[0040] According to the detection order, the rationality of the dependency relationship to be verified in the main project of the target client is verified in each dependency detection dimension in turn,

[0041] The detection sequence includes a circular dependency detection dimension, a version detection dimension, an invalid dependency detection dimension, and a level detection dimension.

[0042] In a second aspect, an embodiment of the present disclosure further provides a computer device, comprising: a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the machine-readable instructions are executed by the processor to perform the steps of the above-mentioned first aspect, or any possible implementation of the first aspect.

[0043] In a third aspect, an embodiment of the present disclosure further provides a computer program product, including a computer program, which, when executed, implements the method described in the above-mentioned first aspect, or any possible implementation manner of the first aspect.

[0044] In the component verification method, computer device and computer program product provided by the embodiments of the present disclosure, after the development of the component to be verified is completed and before the component to be developed is assembled into the main project, the rationality of the dependency relationship between the component to be verified and other components in the main project can be verified from at least one dependency detection dimension. In this way, the rationality of the component dependency relationship can be automatically checked, thereby ensuring the stability and reliability of the application.

[0045] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.

[0047] Figure 1 A flowchart of a component verification method provided by an embodiment of the present disclosure is shown;

[0048] Figure 2An example diagram of a directed acyclic graph provided by an embodiment of the present disclosure is shown;

[0049] Figure 3 An example diagram of another directed acyclic graph provided by an embodiment of the present disclosure is shown;

[0050] Figure 4 A schematic diagram of the structure of a computer device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure claimed for protection, but merely represents selected embodiments of the present disclosure.

[0052] Research has found that in the process of client application development, developers usually use third-party libraries and internal components to speed up development. However, as the scale of applications expands, the dependencies between components become increasingly complex. If the dependencies are not configured properly, it may cause application stability problems, compilation errors, and even crashes during runtime. Therefore, it is very necessary to detect the dependencies between components during the development process.

[0053] Based on the above research, the present disclosure provides a component verification method, a computer device and a computer program product. After the development of the component to be verified is completed and before the component to be developed is assembled into the main project, the rationality of the dependency relationship between the component to be verified and other components in the main project can be verified from at least one dependency detection dimension. In this way, the rationality of the component dependency relationship can be automatically checked, thereby ensuring the stability and reliability of the application.

[0054] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0055] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.

[0056] It can be understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the personal information involved in the present disclosure (including but not limited to attribute information, facial images, etc.) is obtained with the authorization of the user. Specifically, it can be through a pop-up window in the page, information push, etc., sending a prompt message requesting authorization to the user, and obtaining the above personal information after the user agrees to the authorization.

[0057] To facilitate understanding of this embodiment, a component verification method disclosed in the embodiment of the present disclosure is first introduced in detail. The execution subject of the component verification method provided in the embodiment of the present disclosure is generally a computer device with certain computing capabilities, and the computer device includes, for example: a terminal device or a server or other processing device, and the terminal device can be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementations, the component verification method can be implemented by a processor calling a computer-readable instruction stored in a memory.

[0058] See also Figure 1 FIG. 1 is a flowchart of a component verification method provided by an embodiment of the present disclosure, wherein the method includes steps 101 to 103, wherein:

[0059] Step 101: Obtain the dependency relationship between the component to be verified and other components to be verified.

[0060] Step 102: Under at least one dependency detection dimension, verify the rationality of the dependency relationship to be verified in the main project of the target client.

[0061] Step 103: When the verification results corresponding to each dependency detection dimension are all verified, it is determined that the dependency relationship to be verified is verified, and the component to be verified is assembled and compiled with the main project to implement the call of the component to be verified.

[0062] The following is a detailed description of the above steps.

[0063] For step 101,

[0064] The component to be verified may be a component that is independently developed and not assembled into the main project of the target client. Optionally, the component to be verified may correspond to a certain functional module, such as an account module, a login module, a Bluetooth module, etc.

[0065] In actual applications, after the development of the component to be verified is completed, the R&D personnel can manually input the dependency relationship to be verified between the component to be verified and other components; or, after the development of the component to be verified is completed, the code portion of the component to be verified can be automatically identified to determine the dependency relationship to be verified between the component to be verified and other components.

[0066] Here, the other components may be other components that have been developed or other components under development. The dependency relationship to be verified between the component to be verified and other components may include a first dependency relationship and / or a second dependency relationship, wherein the first dependency relationship is the relationship between the component to be verified and the first component on which the component to be verified depends, and the second dependency relationship is the relationship between the component to be verified and the second component that depends on the component to be verified.

[0067] For step 102,

[0068] In a possible implementation, verifying the rationality of the dependency to be verified in the main project of the target client under at least one dependency detection dimension may include: based on the dependency to be verified, updating the initial configuration file of the main project of the target client to obtain a target configuration file; wherein the initial configuration file includes the dependency relationships between the initial components included in the main project; constructing a directed acyclic graph for characterizing the dependency relationships between components based on the target configuration file, wherein the nodes of the directed acyclic graph are components, the edges are the dependency relationships between components, and the components include the initial components and the components to be verified; based on the directed acyclic graph, verifying the rationality of the dependency to be verified in the main project of the target client under the at least one dependency detection dimension.

[0069] The initial configuration file may include the dependency relationships between the initial components currently assembled in the main project. Optionally, updating the initial configuration file of the target client main project based on the dependency relationships to be verified may refer to adding the dependency relationships to be verified to the initial configuration file to obtain the target configuration file. Accordingly, the target configuration file may include the dependency relationships between the initial components and the dependency relationships to be verified between the component to be verified and other components.

[0070] In one possible implementation, the nodes in the directed acyclic graph are components, the edges are dependencies between components, and the direction of the edges is determined based on the dependencies between the components. For example, if component A depends on component B, the direction of the edge between node A and node B is from node A to node B.

[0071] It should be noted that, since the target configuration file includes the dependencies between the initial components and the dependencies between the components to be verified and other components to be verified, the dependencies between the components represented by the directed acyclic graph also include the dependencies between the initial components and the dependencies between the components to be verified and other components to be verified.

[0072] In a possible implementation manner, the dependency detection dimension may include at least one of the following dimensions:

[0073] Circular dependency detection dimension, version detection dimension, level detection dimension, and invalid dependency detection dimension.

[0074] Among them, the circular dependency detection dimension is used to detect whether each node in the directed acyclic graph contains circular dependencies; the version detection dimension is used to detect whether there is a version conflict between the same node that multiple nodes depend on; the hierarchical detection dimension is used to detect whether multiple nodes comply with the hierarchical dependency rules; the invalid dependency detection dimension is used to detect whether the dependency relationship between each component actually exists.

[0075] Specifically, when the dependency detection dimension includes a cyclic dependency detection dimension, based on the directed acyclic graph, when verifying the rationality of the dependency relationship to be verified in the main project of the target client under the at least one dependency detection dimension, the following steps may be included:

[0076] Step a1, determining a first target node in the directed acyclic graph; wherein other nodes that depend on the first target node are empty.

[0077] Step a2: Delete the edge connecting the first target node and the first target node to update the directed acyclic graph.

[0078] Step a3: Return to the step of determining the first target node until a new first target node cannot be determined.

[0079] Step a4: When the updated directed acyclic graph does not include a closed loop, determine whether the dependency relationship to be verified has passed verification under the circular dependency detection dimension.

[0080] The first target node can also be understood as a node in the directed acyclic graph that does not have an edge pointing to the node. Figure 2The figure shows an example of a directed acyclic graph provided by the present disclosure. No node depends on node A, that is, there is no edge pointing to node A, so node A can be the first target node.

[0081] The edge connected to the first target node may refer to the edge from the first target node to other nodes. Figure 2 In the example shown, node A is the first target node, and the edge from node A to node B and the edge from node A to node C are the edges connected to the first target node.

[0082] In a possible implementation manner, when determining the first target node, each node in the directed acyclic graph may be traversed to determine whether it is the first target node. In this implementation manner, multiple first target nodes may be determined during each traversal process, and correspondingly, when deleting edges based on the above step a2, multiple edges may be deleted at the same time. After each traversal is completed and the edge connecting the first target node and the first target node is deleted, each node in the updated directed acyclic graph may be traversed again until a new first target node cannot be determined.

[0083] In another possible implementation, when determining the first target node, the nodes in the directed acyclic graph can be traversed one by one. After detecting that any node is the first target node, the traversal is stopped, and the edges connecting the first target node and the first target node are deleted. Then, the other nodes are traversed until the new first target node cannot be determined.

[0084] by Figure 2 Taking the directed acyclic graph shown in the figure as an example, the first target node is determined to be node A. After deleting the edge connecting node A and node A, node C is the first target node. After deleting the edge connecting node C and node C, node B is the first target node. After deleting the edge connecting node B and node B, node D is the first target node, and then node E is the first target node. It can be seen that in Figure 2 In the directed acyclic graph shown, each node can be the first target node, so Figure 2 There are no circular dependencies in the directed acyclic graph shown.

[0085] by Figure 3 Taking the directed acyclic graph shown as an example, after determining the A node and the C node as the first target node in turn, the B, D, and E nodes form a closed loop, so there is a circular dependency between the B, D, and E nodes.

[0086] In this way, the circular dependency in the target configuration file can be detected, thereby preventing the component to be verified from affecting the stability of the main project after being assembled into the main project of the target client.

[0087] Optionally, the target configuration file also includes version information of other components that each component depends on. In a possible implementation, when the dependency detection dimension includes a version detection dimension, based on the directed acyclic graph, when verifying the rationality of the dependency relationship to be verified in the main project of the target client under at least one dependency detection dimension, the second target node in the directed acyclic graph can be first determined; wherein, the second target node is a node that has multiple third target nodes that depend on the node; then determine whether the version information of the second target node on which each third target node depends is consistent; if not, determine that the verification of the dependency relationship to be verified under the version detection dimension fails; if consistent, determine that the verification of the dependency relationship to be verified under the version detection dimension passes.

[0088] Exemplary, continued Figure 2 In the directed acyclic graph shown, nodes A and C depend on node B, so node B is the second target node. For node B, it can be determined whether the version information of node B that node A depends on is consistent with the version information of node B that node C depends on; accordingly, node D and node E are also second target nodes, and the consistency of version information can be detected based on the same method.

[0089] In this way, the component versions that each component depends on can be detected to avoid version conflicts caused by different components relying on different versions of the same component, which affects the stability of the application.

[0090] In the case where the dependency detection dimension includes a hierarchical detection dimension, detection may also be performed based on hierarchical information of each component.

[0091] Specifically, the first-level information of the component to be verified can also be obtained (for example, it can be obtained synchronously when obtaining the dependency to be verified). Correspondingly, when the initial configuration file of the target client main project is updated based on the dependency to be verified and the target configuration file is obtained, the initial configuration file of the target client main project can be updated based on the dependency to be verified and the first-level information to obtain the target configuration file; wherein, the initial configuration file also includes the second-level information of each of the initial components; then, when verifying the rationality of the dependency to be verified in the main project of the target client, it can include determining that the verification of the dependency to be verified has failed under the hierarchical detection dimension when it is detected that the hierarchical information of each component and the hierarchical information of other components on which each component depends do not comply with the preset hierarchical dependency rules.

[0092] Different levels can be used to characterize the basic degree of a component, or in other words, the functional complexity of a component. The higher the component level, the more complex the function; the lower the level, the simpler and more basic the function.

[0093] The preset hierarchical dependency rules may include dependency rules between different hierarchies and / or dependency rules between each component and components of other hierarchies.

[0094] Exemplarily, dependency rules between different levels may mean that components at any level can only depend on components at a level lower than that level, and components at the lowest level can depend on components at the same level. Dependency rules between components and components at other levels may mean that for components A and B at the same level, component A can depend on other components at the same level and components at other levels lower than that level, and component B can only depend on components at other levels lower than that level.

[0095] Specific hierarchical dependency rules can be set according to actual conditions. Here, the purpose of setting hierarchical dependency rules between different levels is to avoid the generation of circular dependencies. If the lower level can rely on the higher level components, and the components at the same level are mutually dependent, then as the number of components increases in the subsequent development of the target client, the complexity of the main project will also increase, so circular dependencies may inevitably occur, thereby affecting the stability of the main project.

[0096] In another possible implementation, the dependency to be verified may include the component identifier of the first component and / or the component identifier of the second component. Since the dependency to be verified may be manually input by a developer, the component identifier in the dependency to be verified may be wrong. Therefore, the authenticity of the dependency to be verified may also be verified, that is, verification may be performed on the invalid dependency detection dimension.

[0097] Specifically, the initial configuration file may include the component identification of each component, and then based on the initial configuration file, the authenticity of the component identification of the first component and / or the component identification of the second component may be verified; if the authenticity verification fails, it is determined that the dependency to be verified has failed verification under the invalid dependency detection dimension.

[0098] Exemplarily, if the component identifier of the first component and / or the component identifier of the second component is the identifier in the initial configuration file, it can be determined that the dependency to be verified is successfully verified under the invalid dependency detection dimension; otherwise, it is determined that the dependency to be verified fails to be verified under the invalid dependency detection dimension.

[0099] In this way, the authenticity of the component identification in the dependency to be verified can be verified, avoiding the impact of component identification errors on the verification of other dependency detection dimensions of the dependency to be verified.

[0100] Optionally, when the at least one dependency detection dimension includes multiple ones of a circular dependency detection dimension, a version detection dimension, a level detection dimension, and an invalid dependency detection dimension, when verifying the rationality of the dependency relationship to be verified in the main project of the target client, the detection order of each dependency detection dimension can be determined first; and then, according to the detection order, the rationality of the dependency relationship to be verified in the main project of the target client is verified in each dependency detection dimension in turn.

[0101] Optionally, the above detection order may include a circular dependency detection dimension, a version detection dimension, an invalid dependency detection dimension, and a level detection dimension. Here, the detection order is only used as an example. In actual applications, different detection orders can be set according to actual needs.

[0102] Alternatively, in the case where the at least one dependency detection dimension includes multiple ones of a circular dependency detection dimension, a version detection dimension, a level detection dimension, and an invalid dependency detection dimension, when verifying the rationality of the dependency relationship to be verified in the main project of the target client, the dependency relationship to be verified can be verified in parallel under each dependency detection dimension, thereby improving the verification efficiency.

[0103] For step 103,

[0104] If the detection result corresponding to any dependency detection dimension is verification failure, it can be determined that the verification of the dependency to be verified has failed. If the verification results corresponding to multiple dependency detection dimensions are all verification passed, it can be determined that the verification of the dependency to be verified has passed.

[0105] Optionally, under at least one dependency detection dimension, after verifying the rationality of the dependency relationship to be verified in the main project of the target client, a verification report can also be generated based on the verification result; wherein, when the verification result is a verification failure, the verification report can include the dependency problem.

[0106] For example, if, during the circular dependency detection, it is detected that a directed acyclic graph contains a closed loop, the existence of the closed loop dependency, as well as the names of the components of the closed loop dependency and the dependency relationships, can be indicated in the verification report.

[0107] Optionally, when the verification result is that the verification is passed, the component to be verified can be assembled with the main project and then compiled to implement the call of the component to be verified.

[0108] In the component verification method provided by the embodiment of the present disclosure, after the development of the component to be verified is completed and before the component to be developed is assembled into the main project, the rationality of the dependency relationship between the component to be verified and other components in the main project can be verified from at least one dependency detection dimension. In this way, the rationality of the component dependency relationship can be automatically checked, thereby ensuring the stability and reliability of the application.

[0109] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.

[0110] Based on the same technical concept, the embodiment of the present disclosure also provides a computer device. Figure 4 As shown, it is a schematic diagram of the structure of a computer device 400 provided in an embodiment of the present disclosure, including a processor 401, a memory 402, and a bus 403. Among them, the memory 402 is used to store execution instructions, including a memory 4021 and an external memory 4022; the memory 4021 here is also called an internal memory, which is used to temporarily store the operation data in the processor 401, and the data exchanged with the external memory 4022 such as a hard disk. The processor 401 exchanges data with the external memory 4022 through the memory 4021. When the computer device 400 is running, the processor 401 communicates with the memory 402 through the bus 403, so that the processor 401 executes the following instructions:

[0111] Get the dependency relationship between the component to be verified and other components to be verified;

[0112] Verifying the rationality of the dependency relationship to be verified in the main project of the target client under at least one dependency detection dimension;

[0113] When the verification results corresponding to each dependency detection dimension are all verified, it is determined that the dependency relationship to be verified is verified, and the component to be verified is assembled and compiled with the main project to implement the call of the component to be verified.

[0114] In a possible implementation manner, in the instructions executed by the processor 401, verifying the rationality of the dependency relationship to be verified in the main project of the target client under at least one dependency detection dimension includes:

[0115] Based on the dependency to be verified, the initial configuration file of the target client main project is updated to obtain a target configuration file; wherein the initial configuration file includes the dependency between the initial components included in the main project;

[0116] Constructing a directed acyclic graph for characterizing dependency relationships between components based on the target configuration file, wherein nodes of the directed acyclic graph are components, edges are dependency relationships between components, and the components include the initial component and the component to be verified;

[0117] Based on the directed acyclic graph, the rationality of the dependency relationship to be verified in the main project of the target client is verified under the at least one dependency detection dimension.

[0118] In a possible implementation, in the instruction executed by the processor 401, the dependency detection dimension includes a circular dependency detection dimension;

[0119] The verifying the rationality of the dependency relationship to be verified in the main project of the target client under the at least one dependency detection dimension based on the directed acyclic graph includes:

[0120] Determine a first target node in the directed acyclic graph; wherein other nodes that depend on the first target node are empty;

[0121] Deleting the edge connecting the first target node and the first target node to update the directed acyclic graph;

[0122] Returning to the step of determining the first target node until a new first target node cannot be determined;

[0123] When the updated directed acyclic graph does not include a closed loop, it is determined that the dependency relationship to be verified passes verification under the circular dependency detection dimension.

[0124] In one possible implementation, in the instructions executed by the processor 401, the dependency to be verified includes a first dependency and / or a second dependency, wherein the first dependency is the relationship between the component to be verified and a first component on which the component to be verified depends, and the second dependency is the relationship between the component to be verified and a second component that depends on the component to be verified.

[0125] In a possible implementation, in the instruction executed by the processor 401, the dependency relationship to be verified includes a component identifier of the first component and / or a component identifier of the second component; the dependency detection dimension includes an invalid dependency detection dimension;

[0126] The verifying the rationality of the dependency relationship to be verified in the main project of the target client under at least one dependency detection dimension includes:

[0127] Based on the initial configuration file, verifying the authenticity of the component identification of the first component and / or the component identification of the second component;

[0128] In the event that the authenticity verification fails, it is determined that the dependency to be verified fails verification under the invalid dependency detection dimension.

[0129] In a possible implementation, in the instruction executed by the processor 401, the dependency detection dimension includes a version detection dimension;

[0130] The target configuration file also includes version information of other components that each component depends on;

[0131] The verifying the rationality of the dependency relationship to be verified in the main project of the target client under the at least one dependency detection dimension based on the directed acyclic graph includes:

[0132] Determine a second target node in the directed acyclic graph; wherein the second target node is a node having multiple third target nodes that depend on the second target node;

[0133] Determine whether the version information of the second target nodes that each third target node depends on is consistent;

[0134] If not, it is determined that verification of the dependency to be verified has failed under the version detection dimension.

[0135] In a possible implementation, in the instruction executed by the processor 401, the dependency detection dimension includes a level detection dimension;

[0136] The instructions executed by the processor 401 also include:

[0137] Obtaining first-level information of the component to be verified;

[0138] The method of updating the initial configuration file of the target client main project based on the dependency relationship to be verified to obtain the target configuration file includes:

[0139] Based on the dependency to be verified and the first-level information, the initial configuration file of the target client main project is updated to obtain a target configuration file; wherein the initial configuration file also includes the second-level information of each of the initial components;

[0140] The verifying the rationality of the dependency relationship to be verified in the main project of the target client under at least one dependency detection dimension includes:

[0141] When it is detected that the hierarchical information of each component and the hierarchical information of other components on which each component depends do not conform to the preset hierarchical dependency rule, it is determined that the verification of the dependency relationship to be verified fails under the hierarchical detection dimension.

[0142] In a possible implementation, in the instructions executed by the processor 401, the hierarchical dependency rules include dependency rules between different hierarchies and / or dependency rules between each component and components of other hierarchies.

[0143] In a possible implementation, in the instructions executed by the processor 401, the at least one dependency detection dimension includes multiple ones of a circular dependency detection dimension, a version detection dimension, a level detection dimension, and an invalid dependency detection dimension;

[0144] The verifying the rationality of the dependency relationship to be verified in the main project of the target client under at least one dependency detection dimension includes:

[0145] Determine the detection order of each dependent detection dimension;

[0146] According to the detection order, the rationality of the dependency relationship to be verified in the main project of the target client is verified in each dependency detection dimension in turn,

[0147] The detection sequence includes a circular dependency detection dimension, a version detection dimension, an invalid dependency detection dimension, and a level detection dimension.

[0148] The present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the component verification method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.

[0149] The embodiments of the present disclosure also provide a computer program product, which carries a program code. The instructions included in the program code can be used to execute the steps of the component verification method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.

[0150] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).

[0151] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.

[0152] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0153] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0154] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0155] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be based on the protection scope of the claims.

Claims

1. A component verification method, characterized in that: include: Get the dependency relationship between the component to be verified and other components to be verified; Verifying the rationality of the dependency relationship to be verified in the main project of the target client under at least one dependency detection dimension; When the verification results corresponding to each dependency detection dimension are all verified, it is determined that the dependency relationship to be verified is verified, and the component to be verified is assembled and compiled with the main project to implement the call of the component to be verified.

2. The method according to claim 1, characterized in that: The verifying the rationality of the dependency relationship to be verified in the main project of the target client under at least one dependency detection dimension includes: Based on the dependency to be verified, the initial configuration file of the target client main project is updated to obtain a target configuration file; wherein the initial configuration file includes the dependency between the initial components included in the main project; Constructing a directed acyclic graph for characterizing dependency relationships between components based on the target configuration file, wherein nodes of the directed acyclic graph are components, edges are dependency relationships between components, and the components include the initial component and the component to be verified; Based on the directed acyclic graph, the rationality of the dependency relationship to be verified in the main project of the target client is verified under the at least one dependency detection dimension.

3. The method according to claim 2, characterized in that The dependency detection dimension includes a circular dependency detection dimension; The verifying the rationality of the dependency relationship to be verified in the main project of the target client under the at least one dependency detection dimension based on the directed acyclic graph includes: Determine a first target node in the directed acyclic graph; wherein other nodes that depend on the first target node are empty; Deleting the edge connecting the first target node and the first target node to update the directed acyclic graph; Returning to the step of determining the first target node until a new first target node cannot be determined; When the updated directed acyclic graph does not include a closed loop, it is determined that the dependency relationship to be verified passes verification under the circular dependency detection dimension.

4. The method according to claim 2, characterized in that: The dependency to be verified includes a first dependency and / or a second dependency, the first dependency being the relationship between the component to be verified and a first component on which the component to be verified depends, and the second dependency being the relationship between the component to be verified and a second component that depends on the component to be verified.

5. The method according to claim 4, characterized in that The dependency relationship to be verified includes a component identifier of the first component and / or a component identifier of the second component; the dependency detection dimension includes an invalid dependency detection dimension; The verifying the rationality of the dependency relationship to be verified in the main project of the target client under at least one dependency detection dimension includes: Based on the initial configuration file, verifying the authenticity of the component identification of the first component and / or the component identification of the second component; In the event that the authenticity verification fails, it is determined that the dependency to be verified fails verification under the invalid dependency detection dimension.

6. The method according to any one of claims 2 to 5, characterized in that The dependency detection dimension includes a version detection dimension; The target configuration file also includes version information of other components that each component depends on; The verifying the rationality of the dependency relationship to be verified in the main project of the target client under the at least one dependency detection dimension based on the directed acyclic graph includes: Determine a second target node in the directed acyclic graph; wherein the second target node is a node having multiple third target nodes that depend on the second target node; Determine whether the version information of the second target nodes that each third target node depends on is consistent; If not, it is determined that verification of the dependency to be verified has failed under the version detection dimension.

7. The method according to any one of claims 2 to 5, characterized in that The dependency detection dimension includes a level detection dimension; The method further comprises: Obtaining first-level information of the component to be verified; The method of updating the initial configuration file of the target client main project based on the dependency relationship to be verified to obtain the target configuration file includes: Based on the dependency to be verified and the first-level information, the initial configuration file of the target client main project is updated to obtain a target configuration file; wherein the initial configuration file also includes the second-level information of each of the initial components; The verifying the rationality of the dependency relationship to be verified in the main project of the target client under at least one dependency detection dimension includes: When it is detected that the hierarchical information of each component and the hierarchical information of other components on which each component depends do not conform to the preset hierarchical dependency rule, it is determined that the verification of the dependency relationship to be verified fails under the hierarchical detection dimension.

8. The method according to claim 7, characterized in that The hierarchical dependency rules include dependency rules between different hierarchies and / or dependency rules between each component and components of other hierarchies.

9. The method according to any one of claims 1 to 5, characterized in that The at least one dependency detection dimension includes multiple ones of a circular dependency detection dimension, a version detection dimension, a level detection dimension, and an invalid dependency detection dimension; The verifying the rationality of the dependency relationship to be verified in the main project of the target client under at least one dependency detection dimension includes: Determine the detection order of each dependent detection dimension; According to the detection order, the rationality of the dependency relationship to be verified in the main project of the target client is verified in each dependency detection dimension in turn; The detection sequence includes a circular dependency detection dimension, a version detection dimension, an invalid dependency detection dimension, and a level detection dimension.

10. A computer device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the machine-readable instructions are executed by the processor to perform the steps of the component verification method according to any one of claims 1 to 9.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed, the steps of the component verification method according to any one of claims 1 to 9 are implemented.