Dependency library conflict detection method, device, equipment, storage medium and product
By obtaining module dependency information during the compilation process and uploading it to the global version list, the problem of time-consuming and maintenance difficulties in the existing technology of dependency library conflict detection is solved, and the effect of quickly identifying dependency library conflicts and reducing compilation time is achieved.
Patent Information
- Application Number
- CN202410742794.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-06-11
AI Technical Summary
The conflict detection method of the dependency library during the existing compilation process takes a long time, it is difficult to maintain dependencies between modules, and it is difficult to identify conflicts.
By obtaining the dependency module information of the module and uploading it to the global module version information list, determine whether there is a dependency library conflict based on the dependency module information of each module in the list. Only the dependency relationship of a single module is detected, which reduces the dependency relationship. Complexity and maintenance difficulty.
It realizes rapid identification of dependency library conflicts, reduces compilation time and dependency maintenance costs, and simplifies the management of dependencies between modules.
Smart Images

Figure CN118331587B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of compilation detection technology, and in particular to a dependency library conflict detection method, apparatus, device, storage medium and product. Background Art
[0002] When compiling large-scale projects based on various programming languages, the dependencies between the modules are networked. By determining the dependencies between the modules, the correct compilation order can be ensured, the code reusability can be improved, and the maintenance cost can be reduced.
[0003] In the existing compilation process, in order to ensure the consistency of dependent libraries, conflict detection of dependent libraries is usually performed. The existing conflict detection method is to detect the compiled modules step by step according to the dependency path and generate executable programs. This method is time-consuming, and it is difficult to maintain the dependency relationship between modules. It is also difficult to identify conflicts in dependent libraries.
[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of the present application is to provide a dependency library conflict detection method, device, equipment, storage medium and product, aiming to solve the technical problems of the prior art dependency library conflict detection method having great difficulty in conflict identification and difficulty in maintaining dependency relationships.
[0006] To achieve the above purpose, the present application proposes a dependency library conflict detection method, the dependency library conflict detection method comprising:
[0007] Get the module's dependent module information;
[0008] Upload the dependent module information to the global module version information list;
[0009] Determine whether there is a dependency library conflict based on the dependency module information of each module in the global module version information list.
[0010] In one embodiment, the step of determining whether there is a dependency library conflict based on the dependency module information of each module in the global module version information list includes:
[0011] In the global module version information list, determine a module group that depends on the same module;
[0012] Comparing the dependent module information of each module in each module group;
[0013] When the information comparison of each module group passes, it is determined that there is no dependency library conflict;
[0014] When the information comparison of the module group fails, it is determined that there is a dependency library conflict.
[0015] In one embodiment, when obtaining the dependent module information of a module, the method further includes:
[0016] Obtain the current version information of the module;
[0017] Accordingly, the step of uploading the dependent module information to the global module version information list includes:
[0018] The dependent module information and the current version information are uploaded to the global module version information list.
[0019] In one embodiment, when the information comparison of the module group fails, the step of determining that there is a dependency library conflict includes:
[0020] When there is a module group whose information comparison fails, the module group whose information comparison fails is regarded as a dependency conflict module group;
[0021] Determine the current version information of the target dependency module in the dependency conflict module group, where the target dependency module is a dependency module that all modules in the dependency conflict module group depend on;
[0022] The current version information of the target dependency module is compared with the dependency module information of each module in the dependency conflict module group, and the modules that fail the comparison are regarded as dependency conflict modules, wherein the dependency conflict modules are modules having dependency library conflicts.
[0023] In one embodiment, the step of obtaining the dependent module information of the module includes:
[0024] Performing dependent module detection on the module to determine a list of dependent modules of the module;
[0025] The dependent module list is traversed to determine the dependent module information corresponding to the module.
[0026] In one embodiment, the step of traversing the dependent module list to determine the dependent module information corresponding to the module includes:
[0027] Determine the first dependent module in the dependent module list;
[0028] Determine the dependent module information of the first dependent module;
[0029] The first dependent module is removed from the dependent module list, and the process returns to the step of determining the first dependent module in the dependent module list until it is determined that the dependent module list is empty.
[0030] In addition, to achieve the above purpose, the present application also proposes a dependency library conflict detection device, the dependency library conflict detection device comprising:
[0031] Information acquisition module, used to obtain the module's dependent module information;
[0032] An information management module, used to upload the dependent module information to the global module version information list;
[0033] The conflict detection module is used to determine whether there is a dependency library conflict based on the dependency module information of each module in the global module version information list.
[0034] In addition, to achieve the above-mentioned purpose, the present application also proposes a dependency library conflict detection device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the dependency library conflict detection method as described above.
[0035] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the dependency library conflict detection method described above are implemented.
[0036] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the dependency library conflict detection method described above are implemented.
[0037] One or more technical solutions proposed in this application have at least the following technical effects:
[0038] This application obtains the dependent module information of the module and uploads the dependent module information to the global module version information list; the dependent module information of each module in the global module version information list is used to determine whether there is a dependency library conflict. Since only the dependency relationship of a single module needs to be detected, there is no need to detect the layer-by-layer dependency relationships in the module step by step, which reduces the complexity of the dependency relationship. For each module, only its own dependency library needs to be maintained, which reduces the difficulty of maintaining and identifying the dependency relationship. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0041] Figure 1 A flowchart of a first embodiment of a method for detecting a conflict in a dependency library of the present application is provided;
[0042] Figure 2 A flow chart of the second embodiment of the method for detecting conflicts in a dependency library of the present application;
[0043] Figure 3 A schematic diagram of the data structure of module information in one implementation of the conflict detection method for dependency libraries of the present application;
[0044] Figure 4 A schematic diagram of a dependency library tracking chain in an example of a dependency library conflict detection method of the present application;
[0045] Figure 5 A simplified flow chart of one implementation of a method for detecting conflicts in a dependency library of this application;
[0046] Figure 6 A schematic diagram of the module structure of a conflict detection device for a dependency library according to an embodiment of the present application;
[0047] Figure 7 Schematic diagram of the device structure of the hardware operating environment involved in the library-dependent conflict detection method in the embodiment of the present application.
[0048] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0049] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0050] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0051] The main solution of the embodiment of the present application is: obtain the dependent module information of the module; upload the dependent module information to the global module version information list; determine whether there is a dependent library conflict based on the dependent module information of each module in the global module version information list.
[0052] The current existing technology is to perform full detection step by step according to the dependency path and generate an executable program.
[0053] The present application provides a solution, which is to upload the dependent module information of each module to the global module version information list. By comparing the dependent module information in the module version information list, it is determined whether there is a dependency library conflict. It is only necessary to detect the dependency relationship of a single module, and there is no need to detect the layer-by-layer dependency relationships in the module step by step, which reduces the complexity of the dependency relationship. For each module, it is only necessary to maintain its own dependency library, which reduces the difficulty of maintaining and identifying the dependency relationship.
[0054] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device, a virtual device, etc. that can realize the above functions. The following takes the conflict detection device of the dependency library (referred to as the detection device) as an example to illustrate this embodiment and the following embodiments.
[0055] Based on this, the embodiment of the present application provides a conflict detection method for a dependency library, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the method for conflict detection of dependency libraries of the present application.
[0056] In this embodiment, the dependency library conflict detection method includes steps S10 to S30:
[0057] Step S10, obtaining the dependent module information of the module;
[0058] Step S20, uploading the dependent module information to the global module version information list;
[0059] It should be noted that the above modules can be program units with independent functions, which can have certain functions or interfaces and can be compiled separately. By splitting a large-scale system into multiple modules, the efficiency of system development, debugging and maintenance can be improved.
[0060] It should be explained that when compiling a large-scale project, there may be multiple modules to be compiled. For each module, it may depend on other modules, and it may also be relied upon by other modules as a dependent module. By determining the dependent module information of a module, the module name, version information and other attributes of its dependent modules can be determined.
[0061] It is understandable that, through the dependent module information, it is possible to determine which dependent modules the module corresponds to, as well as information such as the module names and module versions of these dependent modules.
[0062] It should be noted that the above-mentioned global module version information list can be a list for representing the information of each module that needs to be compiled. Through the global module version information list, the module name, module information and other information content of the module, as well as the module name, module information and other information content of the module's dependent modules can be determined.
[0063] In an implementation of the embodiment of the present application, in order to enhance the global module maintenance capability of the system, when obtaining the dependent module information of the module, the method further includes:
[0064] Obtain the current version information of the module;
[0065] Accordingly, the step of uploading the dependent module information to the global module version information list includes:
[0066] The dependent module information and the current version information are uploaded to the global module version information list.
[0067] It is understandable that the above-mentioned current version information may include information content such as the name of the module, the identification number of the module, the version number of the module, the product name described in the module, etc. During compilation, the current version information of the module and the dependent module information of the module are generated, and these information are uploaded to the global module version information list. Through the current version information and dependent module information of each module in the global module version information list, the global dependency graph and the dependent library tracking chain of the module can be determined. Since the present application only detects the information of each module and the dependency information of the module, and does not perform full detection of the dependent modules of the dependent modules of the module step by step, compared with the existing solutions, the present application reduces the difficulty of identifying the dependency relationship between modules.
[0068] Step S30, determining whether there is a dependency library conflict according to the dependency module information of each module in the global module version information list.
[0069] It can be understood that based on the dependent module information in the global module version information list, the dependency graph and the dependent library tracking chain between each module can be determined. Based on the dependency graph and the dependent library tracking chain, it can be determined whether there is a dependent library conflict in the dependent module information of each module.
[0070] In the specific implementation, the detection device can determine whether there is a dependency library conflict during large-scale project compilation based on the information of each dependent module in the global module version information list. Since the dependency library conflict is determined through the dependent module information, there is no need to compile the module globally step by step and in full, which reduces the time required for compilation, the difficulty of identifying dependency library conflicts and the difficulty of maintaining module dependencies.
[0071] The embodiment of the present application obtains the dependent module information of the module and uploads the dependent module information to the global module version information list; the dependent module information of each module in the global module version information list is used to determine whether there is a dependency library conflict. Since only the dependency relationship of a single module needs to be detected, there is no need to detect the dependency relationships in the modules layer by layer, which reduces the complexity of the dependency relationship. For each module, only its own dependency library needs to be maintained, which reduces the difficulty of maintaining and identifying the dependency relationship.
[0072] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 2 The step of determining whether there is a dependency library conflict based on the dependency module information of each module in the global module version information list comprises:
[0073] Step S31, in the global module version information list, determining a module group that depends on the same module;
[0074] It should be noted that when each module is compiled, its own current version information and the dependent module information of the module's dependent library can be uploaded to the global module version information list. By traversing each module that needs to be compiled, the current version information and dependent module information of all modules can be determined.
[0075] It can be understood that by comparing the dependent module information in the global module version information list, it is possible to determine which modules depend on the same module, and then determine the module group.
[0076] For example, there is module A, whose dependent modules include module B and module C; and there is module M, whose dependent modules include module B and module N, then it can be determined that there is a module group that all depends on module B, and the module group includes module A and module M.
[0077] It should be noted that, in the embodiment of the present application, the module group may include two or more modules, and these modules are dependent on at least one identical module.
[0078] In the embodiment of the present application, a module may correspond to an identification number and / or a module name and other information for uniquely identifying a module, and this information can be used to determine whether each module depends on another module.
[0079] In one implementation of the present application, when compiling a module, the current version information of the module can be obtained from git or other paths, and a corresponding version information data structure can be generated. The version information structure can be used as the value of a parameter (referred to as the module parameter) in the module information of the module; at the same time, it can be checked whether the module has a dependent library (that is, a dependent module). For a module that has a dependent library, its dependent module list can be obtained. By traversing each dependent module in the dependent module list, the dependent module information of the module can be determined, and the dependent module information can be used as another parameter (referred to as the dependent parameter) in the module information of the module.
[0080] It can be understood that in the global version information list, the module information of the module can be used to determine its dependency parameters and dependent module information; based on attributes such as the module name or module identification number in the dependent module information, the module information corresponding to the dependent module can be determined in the global version information list; by comparing the dependent module information of the module with the module information corresponding to the dependent module, it can be determined whether the module has a dependency conflict.
[0081] In one implementation of the embodiment of the present application, the current version information of the module can also be exported as a version information file to the target version information storage directory. By distributing the version information file with the module, it is more convenient to obtain the version information.
[0082] It should be understood that the module dependency parameter may be empty, that is, for a single module, there may be no dependent modules. Specifically, the data structure of the module information of the present application may be as follows: Figure 3 As shown (the figure only shows the dependent module information of one dependent module).
[0083] Step S32, comparing the dependent module information of each module in each module group;
[0084] Step S33, when the information comparison of each module group passes, determining that there is no dependency library conflict;
[0085] Step S34: when the information comparison of the module group fails, it is determined that there is a dependency library conflict.
[0086] It can be understood that by comparing the dependent module information of each module in the module group, when the comparison passes, it can be said that there is no conflict in the dependent module information of each module in the module group, that is, there is no dependency library conflict; if the comparison fails, it means that there is conflicting dependent module information in the module group, that is, there is a dependency library conflict.
[0087] It should be understood that through the method of the present application, there is no need to perform a full, step-by-step search, and incremental compilation can be achieved, starting from the conflicting dependency library, while accurately identifying the conflicting dependency library and automatically generating the global dependency relationship of each module.
[0088] It should be noted that, for the convenience of description, the embodiments of the present application and the following embodiments refer to the modules on which the modules in the module group depend as target dependent modules.
[0089] In one implementation of the present application, in order to compare the dependent module information, the detection device can obtain the target dependent module information of each module and determine the version number of the target dependent module information in each module. By comparing the version numbers of the target dependent module information of each module, it can be determined whether the versions of the target dependent modules of each module are the same. If they are the same, it means that there is no dependency library conflict; if there is a difference, it means that there is a module in the module group whose information has not been updated, that is, there is a dependency library conflict. Specifically, you can refer to Figure 4 shown.
[0090] Reference Figure 4 , where there are four modules A, B, C, and D. For module A, its module version number is v0, which belongs to product x; for module B, its version number is v1, and it depends on module A, and the dependent module version number is v0; for module C, its version number is v2, and it depends on module A, and the dependent module version number is v2; for module D, its version number is v0, the corresponding version number of dependent module B is v1, and the corresponding version number of dependent module C is v2. Through the dependency library tracking chain, it can be determined that both module B and module C depend on module A, which is the same module group, and the version numbers of the dependent module A they include are v0 and v2 respectively, which is a conflict.
[0091] In the embodiment of the present application, according to the dependent module information of the module, the dependent library list corresponding to the module can be determined; in the global module version information list, based on these dependent module information, the global dependency tracking chain and dependency graph can be determined. Through the dependency tracking chain or dependency graph, it can be determined whether there is a version conflict.
[0092] In an implementation of the embodiment of the present application, when the information comparison of the module group fails, the step of determining that there is a dependency library conflict includes:
[0093] Step S341, when there is a module group that fails the information comparison, the module group that fails the information comparison is regarded as a dependency conflict module group;
[0094] Step S342, determining the current version information of the target dependent module in the dependency conflict module group, wherein the target dependent module is a dependent module that all modules in the dependency conflict module group depend on;
[0095] Step S343, comparing the current version information of the target dependency module with the dependency module information of each module in the dependency conflict module group, and taking the module that fails the comparison as a dependency conflict module, wherein the dependency conflict module is a module having a dependency library conflict.
[0096] It should be noted that when there is a conflict, a module group that fails information comparison can be determined, and the module group is used as a dependency conflict module group to determine the specific module where the dependency library conflict occurs.
[0097] It is understandable that, for a dependency conflict module group, the name or identification number of the target dependency module in the module group can be determined, and the current version information of the target dependency module can be found in the global module version information list.
[0098] It should be understood that, in the dependency conflict module group, the version information of the target dependency module will be recorded in the dependency module information of each module; by comparing the version information of the target dependency module recorded in each module with the current version information of the target dependency module, if the comparison passes, it can be said that there is no conflict in the module in the dependency conflict module group; if the comparison fails, it means that the information of the module in the dependency conflict module group has not been updated, that is, there is a dependency conflict in the module, and the module is determined to be a dependency conflict module.
[0099] like Figure 5 As shown, Figure 5 A simplified flow chart of one implementation of a method for detecting conflicts in a dependency library of this application;
[0100] Reference Figure 5 , when compiling a module, the detection device can obtain the current version information of the module and detect whether the module has a dependent library; if a dependent library exists, obtain its dependent library list; and obtain the dependent library information of the first dependent library in the dependent library list, and remove the first dependent library from the dependent library list when the acquisition is completed; if the dependent library list is not empty, return to the step of obtaining the dependent library information of the first dependent library; if the dependent library list is empty, generate module information based on the current version information and dependent library information obtained; and inject the generated module information into the global module version information list to perform dependency tracking chain and dependency graph generation, thereby realizing dependency conflict detection. Specifically, the step of obtaining the dependent module information of the module includes:
[0101] Performing dependent module detection on the module to determine a list of dependent modules of the module;
[0102] The dependent module list is traversed to determine the dependent module information corresponding to the module.
[0103] The step of traversing the dependent module list to determine the dependent module information corresponding to the module includes:
[0104] Determine the first dependent module in the dependent module list;
[0105] Determine the dependent module information of the first dependent module;
[0106] The first dependent module is removed from the dependent module list, and the process returns to the step of determining the first dependent module in the dependent module list until it is determined that the dependent module list is empty.
[0107] It can be understood that through the solution of the present application, there is no need to traverse the dependency chain of the modules level by level. Each module only needs to maintain its own dependencies and dependency libraries, which reduces the difficulty and cost of dependency maintenance. At the same time, by uploading the module information to the global module version information list, the global dependencies of each module can be automatically generated. By constructing a dependency tracking chain and a dependency graph, conflicting dependency libraries can be accurately identified, and incremental compilation can be performed at the same time. There is no need to compile each module in full and level by level, which reduces the time cost of compilation.
[0108] The embodiment of the present application determines the module group that depends on the same module in the global module version information list; compares the dependent module information of each module in each module group; when the information comparison of each module group passes, determines that there is no dependency library conflict; when the information comparison of the module group fails, the module group that fails the information comparison is used as the dependency conflict module group; determines the current version information of the target dependent module in the dependency conflict module group, the target dependent module is the dependent module that each module in the dependency conflict module group depends on; compares the current version information of the target dependent module with the dependency module information of each module in the dependency conflict module group, and uses the module that fails the comparison as the dependency conflict module, the dependency conflict module is the module with the dependency library conflict. Since the dependency tracking chain and dependency graph are constructed in the global module version information list, the global module information is quickly compared through the dependency tracking chain or dependency graph, and the module group that depends on the same module is determined, and then the information is compared to determine whether there is a dependency library conflict. Compared with the prior art of compiling each module step by step, in full, and recursively to determine the dependency network structure, the solution of this application is simpler to implement and occupies fewer resources. Each module only needs to maintain its own dependency library, and can also accurately identify conflicting dependency libraries. In addition, the solution of this application can also perform incremental compilation, starting from the conflicting dependency library, reducing the complexity of detection.
[0109] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the conflict detection method of the library dependent on the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.
[0110] This application also provides a dependency library conflict detection device, please refer to Figure 6 , the conflict detection device of the dependency library includes:
[0111] The information acquisition module 10 is used to obtain the dependent module information of the module;
[0112] The information management module 20 is used to upload the dependent module information to the global module version information list;
[0113] The conflict detection module 30 is used to determine whether there is a dependency library conflict based on the dependency module information of each module in the global module version information list.
[0114] The dependency library conflict detection device provided by the present application adopts the dependency library conflict detection method in the above-mentioned embodiment, which can solve the technical problems of the dependency library conflict detection method in the prior art that the conflict identification is difficult and the dependency relationship maintenance is difficult. Compared with the prior art, the beneficial effects of the dependency library conflict detection device provided by the present application are the same as the beneficial effects of the dependency library conflict detection method provided by the above-mentioned embodiment, and the other technical features in the dependency library conflict detection device are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.
[0115] The present application provides a library-dependent conflict detection device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the library-dependent conflict detection method in the above-mentioned embodiment 1.
[0116] Reference below Figure 7 , which shows a schematic diagram of the structure of a dependency library conflict detection device suitable for implementing an embodiment of the present application. The dependency library conflict detection device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7The library-dependent conflict detection device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0117] like Figure 7 As shown, the conflict detection device for library dependency may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the conflict detection device for library dependency are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the conflict detection device of the dependency library to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows the conflict detection device of the dependency library with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0118] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0119] The dependency library conflict detection device provided by the present application adopts the dependency library conflict detection method in the above-mentioned embodiment, which can solve the technical problems of the dependency library conflict detection method in the prior art that the conflict identification is difficult and the dependency relationship maintenance is difficult. Compared with the prior art, the beneficial effects of the dependency library conflict detection device provided by the present application are the same as the beneficial effects of the dependency library conflict detection method provided by the above-mentioned embodiment, and the other technical features in the dependency library conflict detection device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0120] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0121] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0122] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the dependency library conflict detection method in the above-mentioned embodiment.
[0123] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0124] The computer-readable storage medium may be included in the conflict detection device of the dependency library; or may exist independently without being assembled into the conflict detection device of the dependency library.
[0125] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the conflict detection device of the dependency library, the conflict detection device of the dependency library:
[0126] Get the module's dependent module information;
[0127] Upload the dependent module information to the global module version information list;
[0128] Determine whether there is a dependency library conflict based on the dependency module information of each module in the global module version information list.
[0129] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0130] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0131] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0132] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned dependency library conflict detection method, and can solve the technical problems of the prior art dependency library conflict detection method, which is difficult to identify conflicts and difficult to maintain dependency relationships. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the dependency library conflict detection method provided by the above-mentioned embodiment, and will not be elaborated here.
[0133] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned dependency library conflict detection method when executed by a processor.
[0134] The computer program product provided by the present application can solve the technical problems of the conflict detection method of the dependency library in the prior art, which is difficult to identify conflicts and maintain dependency relationships. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as those of the conflict detection method of the dependency library provided by the above embodiment, and will not be elaborated here.
[0135] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for detecting conflicts in a dependency library, characterized in that: The method comprises: Obtaining the dependent module information of the module; the dependent module information includes the dependent module name and dependent module version information; Upload the dependent module information to the global module version information list; Determine whether there is a dependency library conflict according to the dependency module information of each module in the global module version information list; When obtaining the dependent module information of the module, the method further includes: Obtain the current version information of the module; Accordingly, the step of uploading the dependent module information to the global module version information list includes: Upload the dependent module information and the current version information to the global module version information list; The step of determining whether there is a dependency library conflict according to the dependency module information of each module in the global module version information list comprises: In the global module version information list, determine a module group that depends on the same module; Comparing the dependent module information of each module in each module group; When the information comparison of each module group passes, it is determined that there is no dependency library conflict; When there is a module group whose information comparison fails, the module group whose information comparison fails is regarded as a dependency conflict module group; Determine the current version information of the target dependency module in the dependency conflict module group, where the target dependency module is a dependency module that all modules in the dependency conflict module group depend on; Compare the current version information of the target dependency module with the dependency module information of each module in the dependency conflict module group, and use the module that fails the comparison as a dependency conflict module, wherein the dependency conflict module is a module with a dependency library conflict; The step of obtaining the dependent module information of the module includes: Performing dependent module detection on the module to determine a list of dependent modules of the module; Traversing the dependent module list to determine the dependent module information corresponding to the module; The step of traversing the dependent module list to determine the dependent module information corresponding to the module includes: Determine the first dependent module in the dependent module list; Determine the dependent module information of the first dependent module; The first dependent module is removed from the dependent module list, and the process returns to the step of determining the first dependent module in the dependent module list until it is determined that the dependent module list is empty.
2. A conflict detection device for dependency library, characterized in that: The conflict detection device of the dependency library comprises: An information acquisition module is used to acquire the dependent module information of a module; the dependent module information includes the dependent module name and dependent module version information; An information management module, used to upload the dependent module information to the global module version information list; A conflict detection module, used to determine whether there is a dependency library conflict based on the dependency module information of each module in the global module version information list; When obtaining the dependent module information of a module, the information obtaining module is also used to obtain the current version information of the module; Accordingly, the operation of uploading the dependent module information to the global module version information list includes: Upload the dependent module information and the current version information to the global module version information list; The operation of determining whether there is a dependency library conflict according to the dependency module information of each module in the global module version information list includes: In the global module version information list, determine a module group that depends on the same module; Comparing the dependent module information of each module in each module group; When the information comparison of each module group passes, it is determined that there is no dependency library conflict; When there is a module group whose information comparison fails, the module group whose information comparison fails is regarded as a dependency conflict module group; Determine the current version information of the target dependency module in the dependency conflict module group, where the target dependency module is a dependency module that all modules in the dependency conflict module group depend on; Compare the current version information of the target dependency module with the dependency module information of each module in the dependency conflict module group, and use the module that fails the comparison as a dependency conflict module, wherein the dependency conflict module is a module with a dependency library conflict; The operation of obtaining the dependent module information of the module includes: Performing dependent module detection on the module to determine a list of dependent modules of the module; Traversing the dependent module list to determine the dependent module information corresponding to the module; The operation of traversing the dependent module list to determine the dependent module information corresponding to the module includes: Determine the first dependent module in the dependent module list; Determine the dependent module information of the first dependent module; The first dependent module is removed from the dependent module list, and the process returns to the step of determining the first dependent module in the dependent module list until it is determined that the dependent module list is empty.
3. A conflict detection device for a dependency library, characterized in that: The device comprises: A memory, a processor, and a dependency library conflict detection program stored in the memory and executable on the processor, wherein the dependency library conflict detection program is configured to implement the steps of the dependency library conflict detection method as claimed in claim 1.
4. A storage medium, characterized in that: The storage medium stores a dependency library conflict detection program, and when the dependency library conflict detection program is executed by the processor, the steps of the dependency library conflict detection method according to claim 1 are implemented.
5. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the method for detecting conflicts in dependency libraries as claimed in claim 1 are implemented.
