Dependency library management method, device, storage medium and computer equipment

By rewriting the dependency library entry module and the dependency library management rules of the listening API, the complex problem of SDK access dependency library management is solved, efficient loading and unified maintenance of the dependency library is realized, maintenance costs are reduced, and development difficulty is simplified.

CN111124526BActive Publication Date: 2024-12-27BEIJING QIHOOD TECHNOLOGY CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN201811295196.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-11-01
Publication Date
2024-12-27
Estimated Expiration
2038-11-01

AI Technical Summary

Technical Problem

The existing SDK access dependency library is complex in management, resulting in high access complexity and high maintenance costs, especially in a multi-dependence library environment that is difficult to effectively manage.

Method used

By establishing a dependency library plug-in, rewriting the dependency library entry module, configuring the dependency library management rules, listening to preset interfaces, rewriting the dependency parsing module according to the dependency library management rules, obtaining dependencies, and loading the dependency library according to the dependency relationship, including judging users Customize the dependency library configuration information and debug library information, and optimize the loading and publishing of the dependency library.

Benefits of technology

It simplifies the complexity of SDK access, optimizes the dependency library management method, reduces maintenance costs, improves the unified maintenance efficiency of SDK projects, and simplifies the development difficulty of dependent library management plug-ins through the monitoring API.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111124526B_ABST
    Figure CN111124526B_ABST
Patent Text Reader

Abstract

The present invention provides a dependency library management method, device, storage medium and computer equipment, wherein the dependency library management method comprises: establishing a dependency library plug-in, rewriting a dependency library entry module in the dependency library plug-in; configuring dependency library management rules in the dependency library entry module; monitoring a preset interface, rewriting a dependency parsing module according to the monitored dependency library management rules, and obtaining a dependency relationship; and loading a dependency library according to the dependency relationship. The present invention simplifies the access complexity of the SDK of the project access party and reduces the later maintenance cost of the project.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a dependency library management method, device, storage medium and computer equipment. Background Art

[0002] The full name of the software development kit SDK is Software Development Kit, which is generally a collection of development tools created by software engineers for specific software packages, software frameworks, hardware platforms, operating systems and other application software. When project developers need to access one or more SDKs, they need to configure different dependency modules in the SDK's dependency library, such as Figure 1 As shown, when developing a mobile application project APP, you need to configure the argus-apm-main module for APM (Application Performance Management) development (i.e. Figure 1 main), argus-apm-aop module (i.e. Figure 1 aop) and argus-apm-okhttp modules (i.e. Figure 1 okhttp shown in the figure), and other modules may be added later. In this way, the SDK access party will have to configure each dependent module to be accessed, and then apply it to the dependency library management plug-in GradlePlugin, which will lead to the complexity of accessing the SDK and high maintenance costs in the future. Summary of the invention

[0003] In view of the above shortcomings, the present invention proposes a dependency library management method, device, storage medium and computer equipment to solve the problem of complex SKD access.

[0004] The dependency library management method proposed by the present invention includes:

[0005] Establish a dependency library plug-in and rewrite the dependency library entry module in the dependency library plug-in;

[0006] Configuring dependency library management rules in the dependency library entry module;

[0007] Listen to the preset interface, rewrite the dependency parsing module according to the monitored dependency library management rules, and obtain the dependency relationship;

[0008] The dependent library is loaded according to the dependency relationship.

[0009] Furthermore, after loading the dependent library according to the dependency relationship, the method further includes:

[0010] Stop monitoring the preset interface.

[0011] Further, the loading of the dependent library according to the dependency relationship includes:

[0012] Determine whether the dependency relationship includes user-defined dependency library configuration information;

[0013] If yes, then load the dependent library according to the user-defined dependent library configuration information;

[0014] If not, load the default dependency library.

[0015] Further, the loading of the dependent library according to the user-defined dependent library configuration information includes:

[0016] If there is no basic dependency library data in the current dependency library, load the basic dependency library;

[0017] If there is no custom dependency library data in the current dependency library, load the custom dependency library.

[0018] Further, the loading of the dependent library according to the dependency relationship includes:

[0019] If the dependency relationship includes debugging library information, the dependent library is loaded according to the debugging library information.

[0020] Further, the loading of the dependent library according to the dependency relationship includes:

[0021] If the dependency relationship includes debugging library information, all dependent libraries are loaded and published locally.

[0022] Furthermore, the preset interface is monitored, and the dependency parsing module is rewritten according to the monitored dependency library management rules to obtain the dependency relationship, including:

[0023] Listen to the DependencyResolutionListener interface, rewrite the beforeResolve module in the DependencyResolutionListener interface function according to the monitored dependency library management rules, and obtain the dependency relationship.

[0024] Furthermore, configuring the dependency library management rules in the dependency library entry module includes:

[0025] Get the dependent libraries of the software development kit;

[0026] According to the dependency configuration relationship of each dependent library, the dependent library management rules are configured in the dependent library entry module.

[0027] The present invention also provides a dependency library management device, the device comprising:

[0028] A plug-in creation module, used to create a dependency library plug-in and rewrite the dependency library entry module in the dependency library plug-in;

[0029] A rule configuration module, used to configure dependency library management rules in the dependency library entry module;

[0030] The monitoring and parsing module is used to monitor the preset interface and rewrite the dependency parsing module according to the monitored dependency library management rules to obtain the dependency relationship;

[0031] The dependency library loading module is used to load the dependency library according to the dependency relationship.

[0032] Furthermore, the device also includes:

[0033] The monitoring stop module is used to stop monitoring the preset interface.

[0034] Furthermore, the dependent library loading module includes:

[0035] A custom judgment unit, used to judge whether the dependency relationship includes user-defined dependency library configuration information;

[0036] A custom dependency library loading unit, used for loading a dependency library according to the user-defined dependency library configuration information when the dependency relationship includes user-defined dependency library configuration information;

[0037] The preset dependency library loading unit is used to load the preset dependency library when the dependency relationship does not include user-defined dependency library configuration information.

[0038] Furthermore, the custom dependency library loading unit includes:

[0039] The basic data loading unit is used to load the basic dependency library if there is no basic dependency library data in the current dependency library;

[0040] The custom data loading unit is used to load the custom dependent library if there is no custom dependent library data in the current dependent library data.

[0041] Furthermore, the dependent library loading module includes:

[0042] The debugging library loading unit is used to load the dependent library according to the debugging library information if the dependency relationship includes debugging library information.

[0043] Furthermore, the dependent library loading module includes:

[0044] The loading and publishing unit is used to load all dependent libraries if the dependency relationship includes debugging library information, and publish all loaded dependent libraries to the local.

[0045] Furthermore, the monitoring and parsing module includes:

[0046] The DependencyResolutionListener interface unit is used to listen to the DependencyResolutionListener interface and rewrite the beforeResolve module in the DependencyResolutionListener interface function according to the monitored dependency library management rules to obtain the dependency relationship.

[0047] The present invention also proposes a computer-readable storage medium on which a computer program is stored, characterized in that when the program is executed by a processor, the dependency library management method described in any one of the above is implemented.

[0048] The present invention further provides a computer device, comprising:

[0049] one or more processors;

[0050] a storage device for storing one or more programs,

[0051] When the one or more programs are executed by the one or more processors, the one or more processors implement any one of the aforementioned dependency library management methods.

[0052] The present invention has the following beneficial effects:

[0053] 1. The present invention simplifies the access complexity of the project access party SDK. No matter how many dependent libraries the access party SDK provides, the SDK developer can manage the dependent libraries in the plug-in; for SDK project developers, the present invention optimizes the access method of the dependent library and facilitates the unified maintenance of the internal version of the SDK project, which not only simplifies the access complexity but also reduces the subsequent maintenance costs.

[0054] 2. The present invention adds dependency library configuration by monitoring the DependencyResolutionListener interface of the API, which not only realizes the method of managing the dependency library according to the user-defined dependency library configuration information, but also helps to simplify the difficulty of developing the dependency library management plug-in.

[0055] Additional aspects and advantages of the present invention will be given in part in the following description, which will become obvious from the following description, or may be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0057] Figure 1 A schematic diagram of configuring dependent modules in the prior art;

[0058] Figure 2 It is a flowchart of an embodiment of a dependency library management method of the present invention;

[0059] Figure 3 A schematic diagram of configuring a dependent module after applying the dependent library management method of the present invention;

[0060] Figure 4 It is a schematic diagram of another specific embodiment of the dependency library management method of the present invention;

[0061] Figure 5 It is a structural schematic diagram of a computer device embodiment of the present invention. DETAILED DESCRIPTION

[0062] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be interpreted as limiting the present invention.

[0063] Those skilled in the art can understand that, unless otherwise stated, the singular forms "a", "an", "said" and "the" used herein may also include plural forms, and the "first" and "second" used herein are only used to distinguish the same technical features, and do not limit the order and quantity of the technical features. It should be further understood that the term "comprising" used in the specification of the present invention means the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.

[0064] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as herein.

[0065] It will be understood by those skilled in the art that the "terminal" and "terminal device" used herein include both devices with wireless signal receivers, which are devices with only wireless signal receivers without transmission capabilities, and devices with receiving and transmitting hardware, which are devices with receiving and transmitting hardware capable of performing two-way communications on a two-way communication link. Such devices may include: cellular or other communication devices, which have a single-line display or a multi-line display or a cellular or other communication device without a multi-line display; PCS (Personal Communications Service), which may combine voice, data processing, fax and / or data communication capabilities; PDA (Personal Digital Assistant), which may include a radio frequency receiver, a pager, Internet / intranet access, a web browser, a notepad, a calendar and / or a GPS (Global Positioning System) receiver; conventional laptop and / or palmtop computers or other devices, which have and / or include a conventional laptop and / or palmtop computer or other device with a radio frequency receiver. The "terminal" or "terminal device" used herein may be portable, transportable, installed in a vehicle (air, sea and / or land), or adapted and / or configured to operate locally, and / or in a distributed form, at any other location on the earth and / or in space. The "terminal" or "terminal device" used herein may also be a communication terminal, an Internet terminal, a music / video playing terminal, such as a PDA, a MID (Mobile Internet Device) and / or a mobile phone with a music / video playing function, or a smart TV, a set-top box and other devices.

[0066] JAVA is an object-oriented programming language with powerful functions and easy to use. However, when developing JAVA projects, the cost of compiling, testing, running, packaging and other steps of the project is very high. When the project needs to cross personnel or departments, the project cost will be doubled due to the inconsistency of the project structure. In the prior art, the cross-platform project management tool Maven is generally used to manage the project construction, dependency management, project information management, etc. of the Java platform. In the management tool Maven, the dependency configuration is a configuration element in its pom file, and the dependencies file in the pom file can contain one or more dependency configuration elements. The transitive dependency mechanism in the dependency configuration can simplify the dependency declaration. In most cases, it is only necessary to clarify the direct dependencies of the project without considering which transitive dependencies will be introduced by all direct dependencies; however, when a conflict occurs, it is necessary to clarify from which dependency path the transitive dependency is introduced, that is, dependency resolution. For example, a project has two dependencies, one is: A->B->C->X, and the other is A->B->X, then it is necessary to clarify which version of the dependency will be referenced. Generally, the following two principles are used for dependency resolution: one is the shortest path first principle. When this principle is uncertain, another principle, the first declarant first principle, is used. The definitions and specifications involved in the management tool Maven, as well as the dependency resolution principles in dependency configuration, are all existing technologies and will not be described here.

[0067] Plugin (Plug-in, addin, add-in, addon or add-on) is a computer application, generally called a plug-in, which interacts with the host application to provide specific functions, enabling third-party developers to extend the host application. Gradle plug-ins are generally provided in three forms: one is to write the plug-in directly in the build.gradle file of Gradle, but the plug-in written in this way cannot be referenced by the build.gradle file of other projects; the other is to create a separate model, the name of this model must be buildSrc, the files in the same project can reference this model, but this model cannot be referenced by other projects; the third is to customize the plug-in in the project, and then upload it to the remote library, and other projects can reference this customized plug-in by adding dependent modules. However, the first two of these three forms cannot encapsulate an SDK plug-in so that other projects can access and call the dependent modules in it. Other projects can only define the required dependent modules by themselves, just like the third method, which leads to high complexity of dependency configuration when a project accesses other SDKs; moreover, when the version of the dependent module in the SDK changes, it also leads to high maintenance costs and easy errors in the project.

[0068] The present invention simplifies the dependency configuration of accessing SDK by rewriting the dependency parsing module by monitoring an interface of the API. The following takes the open source tool Gradle as an example to illustrate the technical solution of the present invention for simplifying the dependency configuration of accessing SDK.

[0069] like Figure 2 In the embodiment shown, the present invention proposes a dependency library management method, comprising the following steps:

[0070] Step S10: Create a dependency library plug-in and rewrite the dependency library entry module in the dependency library plug-in.

[0071] Step S20: configuring dependency library management rules in the dependency library entry module.

[0072] Step S30: monitor the preset interface, rewrite the dependency parsing module according to the monitored dependency library management rules, and obtain the dependency relationship.

[0073] Step S40: Load the dependent library according to the dependency relationship.

[0074] Each step is as follows:

[0075] Step S10: Create a dependency library plug-in and rewrite the dependency library entry module in the dependency library plug-in.

[0076] Gradle is an open source tool for automated project construction based on the concepts of the construction tool Apache Ant and the open source software project management tool Apache Maven. It can be used to build application apps, such as building compilation, packaging and other processes. The user specifies the build rules, and Gradle will automatically build the relevant files of the application according to the specified build rules, such as generating an apk file. Before managing the dependent library, the present invention needs to first configure the dependent library plug-in, and then rewrite the dependent library interface. When the present invention uses the dependent library management plug-in Gradle Plugin to implement the management of the dependent library, you can first customize the Gradle Plugin plug-in, that is, create a dependent library plug-in; then implement the plug-in therein. <project>interface, rewrite the entry method apply(project:Project), that is, rewrite the dependency library entry module to configure the entry management of the dependency library. Since the dependency library management plug-in Gradle Plugin is an existing plug-in, the Plugin <project>The interface implementation method and the rewrite entry method apply(project:Project) are both existing program modules in the plug-in. Their specific code rules can be determined according to the preset rules of the GradlePlugin plug-in, which will not be repeated here.

[0077] Step S20: configuring dependency library management rules in the dependency library entry module.

[0078] The dependency library management rules include custom user rules and default rules. After rewriting apply(project:Project) in the dependency library management entry module according to the preset rules of the Gradle Plugin plug-in, custom user rules can be written in apply(project:Project) as an extension field to facilitate users to extend the configuration of custom dependency library management rules; when custom user rules are not written in apply(project:Project), the default rules of dependency library management are used. In some embodiments, the default rules and the custom user rules can be combined. For example, if a custom user rule is detected, the corresponding custom dependency library management rules are added on the basis of the default rules to simplify the user configuration process.

[0079] The operation of the Gradle Plugin is divided into three stages: initialization stage, configuration stage and operation stage. When compiling the apk file of the application software app, the initialization stage and configuration stage are executed first, and then the corresponding compilation task is executed, and the operation of the compilation task is the runtime. In specific applications, the configuration of the dependency library management rules can be executed in the configuration stage of the Gradle Plugin, which is earlier than the compilation period of the apk; for example, in the configuration stage of the script build.gradle, the following function can be added through apply(project:Project) in the dependency library management entry module to implement custom user rules:

[0080] project.extensions.create(USER_CONFIG,UserConfig::class.java).

[0081] Step S10 is to establish a dependency library plug-in and implement the entry method of the dependency library, namely the apply(project:Project) method. Since the implementation of step S20 needs to be written in apply(project:Project), step S10 is the premise for implementing step S20. If the user does not write the personalized configuration of the custom user rules in this step, the dependency library management rules are configured according to the default configuration rules in the apply(project:Project) method.

[0082] Step S30: monitor the preset interface, rewrite the dependency parsing module according to the monitored dependency library management rules, and obtain the dependency relationship.

[0083] When listening to the preset interface through the Gradle Plugin plug-in, the DependencyResolutionListener interface can be implemented through the static programming language kotlin; when implementing this interface, rewrite the two methods in this interface:

[0084] beforeResolve(dependencies:ResolvableDependencies?)

[0085] afterResolve(dependencies:ResolvableDependencies?)

[0086] Among them, the beforeResolve method is used to rewrite the dependency resolution module in the dependency library plug-in according to the monitored dependency library management rules; for example, during a period of time, monitor whether the user has input a custom dependency library management rule through the DependencyResolutionListener interface; if the user-entered custom dependency library management rules are monitored, the beforeResolve method is rewritten according to the custom dependency library management rules to obtain the resolved dependency relationship, and implement different user-defined business logic in the resolved dependency relationship. Due to the rules of kotlin syntax, when implementing this interface method, all methods in it must be implemented, so the afterResolve method is also rewritten, but the afterResolve method does not do any processing, but is just an empty implementation to meet the rules of kotlin syntax.

[0087] When implementing different business logic according to custom user rules in the rewritten beforeResolve method, it can be implemented through the following code:

[0088]

[0089]

[0090] In the above code, the repository mavenLocal is mainly used to debug the local repository, that is, if the current compilation is in debug mode, the user is allowed to publish the dependent library to the local and configure it in the custom user rule to facilitate testing and debugging, without publishing the version compiled in the debugging phase to JCenter or Maven remote repository every time. Therefore, the present invention also proposes another embodiment: the loading of the dependent library according to the dependency relationship includes:

[0091] If the dependency relationship includes debugging library information, all dependent libraries are loaded and all loaded dependent libraries are published locally.

[0092] As can be seen from the above code, this embodiment can determine whether the currently compiled version has a debug library based on the PluginConfig.userConfig().debugDependencies.isEmpty field; if there is a debug library, it means that the user is currently in the debugging stage. Since the modules used by the user in the debugging stage are large or have large changes, if the dependencies are parsed one by one during each debugging, the debugging efficiency is low. Therefore, this embodiment can skip the parsing stage in the debugging stage, directly load all dependent libraries, and publish all loaded dependent libraries to the local, so as to save the dependency parsing time in the debugging process and improve work efficiency.

[0093] The present invention further proposes another embodiment: the step of loading the dependent library according to the dependency relationship comprises:

[0094] If the dependency relationship includes debugging library information, the dependent library is loaded according to the debugging library information.

[0095] This embodiment can determine whether the dependency resolution module includes user-defined dependency library configuration information based on whether the dependency resolution module includes debug library information, and load the dependency library based on the debug library information, which simplifies the judgment method of the user's customized dependency library configuration information in the debugging stage, which is conducive to improving efficiency. For example, if there is a debug library in the current version, it means that the user is currently in the debugging stage, when the user's customized user configuration rules for debugging can be obtained, that is, the user's customized dependency library configuration information, and the dependency resolution module is rewritten according to the customized user configuration rules, and then the corresponding customized dependency library of the dependency relationship configuration is obtained; if there is no debug library, the user may need to compile and publish the official version, then the default configuration rules and dependency library can be used. Of course, in some embodiments, if there is no debug library, the dependency resolution module may also include customized user configuration rules, and the corresponding dependency library can also be configured according to the customized user configuration rules.

[0096] Step S40: Load the dependent library according to the dependency relationship.

[0097] When the dependency parsing module includes custom dependency library configuration information, the dependency library is loaded according to the user-defined dependency library configuration information to achieve different dependency management; when the user does not make any dependency configuration, the default compilation dependency library can be loaded to increase the compilation speed. Therefore, in one embodiment of the present invention, the loading of the parsed dependency library according to the dependency relationship includes:

[0098] Determine whether the dependency relationship includes user-defined dependency library configuration information;

[0099] If yes, then load the dependent library according to the user-defined dependent library configuration information;

[0100] If not, load the default dependency library.

[0101] In the above code, if the user configures the debugDependencies code block, the user-defined dependency library configuration information is included, and the corresponding Library dependency library configured by the user will be added during configuration. In other embodiments of the present invention, similarly, the user can also use the above code as an example to make different dependency library extensions according to different needs; for example, the user can configure it in the Gradle script of the application APP, that is, it is implemented through step S20; the specific method of use is to configure the following rules in the build.gradle file of the APP:

[0102] apply plugin:'argusapm'

[0103] debugDependencies'com.qihoo360.argusapm:argus-apm-aop:2.0.0.1001'

[0104] The dependency library management method of the present invention simplifies the access complexity of the access party SDK of the project. No matter how many dependency libraries the access party SDK provides, the developer of the SDK can implement the management of the dependency libraries in the plug-in, and the management of all dependency libraries inside the SDK can be achieved only through the apply plugin in the GradlePlugin plug-in. The present invention is equivalent to providing a box for project development users. Users only need to put the required dependency libraries into the box, and do not need to worry about how the placed dependency libraries are loaded. The loading logic is implemented by this plug-in. The dependency library management rules configured by the present invention will eventually implement different business logics in the rewritten beforeResolve method and add them to the application APP of the project development user. At the same time, the present invention can also reduce the upgrade and maintenance costs of the SDK for the access party of the project.

[0105] Figure 3 This is a schematic diagram of how a developer of an SDK project manages a dependent library after adopting the dependent library management method of the present invention; Figure 1 The present invention optimizes the access method of the dependency library. When users develop APP, they can directly implement the main, aop and okhttp modules of the plug-in management diagram of the present invention, which facilitates the unified maintenance of the internal version of the SDK. The access party only needs to apply plugin to implement various dependencies, which simplifies the complexity of access and reduces the subsequent maintenance costs.

[0106] The importance of the present invention lies in finding the right time to add different dependent libraries to the dependent library warehouse, and adding dependent libraries will involve three stages of Gradle operation: because when the user needs to add custom configuration of the dependent library, it occurs after the apply plug-in, so the addition of the dependent library must be added after all configurations are executed; after the configuration stage is executed, there is another method to add dependency configuration: afterEvaluate, but adding Library dependencies in this code block will not have any effect. Therefore, in one embodiment of the present invention, the preset interface is monitored, and the dependency resolution module is rewritten according to the monitored dependency library management rules to obtain the dependency relationship, including:

[0107] Listen to the DependencyResolutionListener interface, rewrite the beforeResolve module in the DependencyResolutionListener interface function according to the monitored dependency library management rules, and obtain the dependency relationship.

[0108] This embodiment adds dependency library configuration by monitoring the DependencyResolutionListener interface of the API, which not only provides a method for loading the dependency library according to the user-defined dependency library configuration information, but also helps to simplify the difficulty of developing the dependency library management plug-in.

[0109] In order to avoid the exception caused by monitoring its own interface, the present invention only monitors the preset interface for a period of time, that is, after rewriting the dependency resolution module through the beforeResolve method, the monitoring is removed. The method of removing the monitoring can be implemented by calling mProject.gradle.removeListener(this). Therefore, the present invention also proposes the following embodiments:

[0110] After the dependent library is loaded according to the dependency relationship, the method further includes:

[0111] Stop monitoring the preset interface.

[0112] This embodiment can monitor the DependencyResolutionListener interface within a period of time to rewrite the configuration in the beforeResolve method; after the rewriting is completed, the monitoring is removed to avoid the abnormality of the plug-in program.

[0113] Based on the above embodiment, the present invention further proposes another embodiment: the step of loading the dependent library according to the user-defined dependent library configuration information includes:

[0114] If there is no basic dependency library data in the current dependency library, load the basic dependency library;

[0115] If there is no custom dependency library data in the current dependency library, load the custom dependency library.

[0116] In different project development processes, the dependency libraries required by the projects may be different. The present invention can classify the dependency libraries into basic dependency libraries and custom dependency libraries according to the frequency of the dependency libraries required for project development. The basic dependency libraries are the dependency libraries required for most project development, for example Figure 1 The argus-apm-main module and argus-apm-aop module described in the previous section; the custom dependency library is an optional dependency library with a slightly lower frequency of use, such as Figure 1 The present invention can load the basic dependency library and the custom dependency library in layers according to the data in the current dependency library, which can avoid repeated loading of the dependency library and improve the compilation and release speed of some application APPs.

[0117] Combination Figure 4 As shown, in another embodiment of the present invention, the dependency library management method further includes:

[0118] Filter files that do not need to be compiled;

[0119] According to the preset weaving rules, modify the data that needs to be weaved in the file cache pool;

[0120] Output the woven data to the specified target directory.

[0121] The InputSourceCutter module in the figure is used to filter files that do not need to be compiled, and can support concurrent AJC compilation; after the filtered files are incrementally cut, they are cached in the file cache pool, and the address in the file cache pool can be / argus-apm-ajx / variantName. When AJC weaving is required, the data to be woven in the file cache pool is woven through multi-threaded concurrent weaving through AjcWeaverManager; the woven data will be output to the specified target directory. This embodiment can cut and weave files while configuring the dependency library rules, thereby improving the compilation efficiency of the project.

[0122] The present invention also provides a dependency library management device, the device comprising:

[0123] A plug-in creation module, used to create a dependency library plug-in and rewrite the dependency library entry module in the dependency library plug-in;

[0124] A rule configuration module, used to configure dependency library management rules in the dependency library entry module;

[0125] The monitoring and parsing module is used to monitor the preset interface and rewrite the dependency parsing module according to the monitored dependency library management rules to obtain the dependency relationship;

[0126] The dependency library loading module is used to load the dependency library according to the dependency relationship.

[0127] In another embodiment of the dependency library management device of the present invention, the device further includes:

[0128] The monitoring stop module is used to stop monitoring the preset interface.

[0129] In another embodiment of the dependency library management device of the present invention, the dependency library loading module includes:

[0130] A custom judgment unit, used to judge whether the dependency relationship includes user-defined dependency library configuration information;

[0131] A custom dependency library loading unit, used for loading a dependency library according to the user-defined dependency library configuration information when the dependency relationship includes user-defined dependency library configuration information;

[0132] The preset dependency library loading unit is used to load the preset dependency library when the dependency relationship does not include user-defined dependency library configuration information.

[0133] In another embodiment of the dependency library management device of the present invention, the custom dependency library loading unit includes:

[0134] The basic data loading unit is used to load the basic dependency library if there is no basic dependency library data in the current dependency library;

[0135] The custom data loading unit is used to load the custom dependent library if there is no custom dependent library data in the current dependent library data.

[0136] In another embodiment of the dependency library management device of the present invention, the dependency library loading module includes:

[0137] The debugging library loading unit is used to load the dependent library according to the debugging library information if the dependency relationship includes debugging library information.

[0138] In another embodiment of the dependency library management device of the present invention, the dependency library loading module includes:

[0139] The loading and publishing unit is used to load all dependent libraries if the dependency relationship includes debugging library information, and publish all loaded dependent libraries to the local.

[0140] In another embodiment of the dependency library management device of the present invention, the monitoring and parsing module includes:

[0141] The DependencyResolutionListener interface unit is used to listen to the DependencyResolutionListener interface and rewrite the beforeResolve module in the DependencyResolutionListener interface function according to the monitored dependency library management rules to obtain the dependency relationship.

[0142] The embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the dependency library management method described in any one of the above is implemented. Wherein, the storage medium includes but is not limited to any type of disk (including floppy disk, hard disk, optical disk, CD-ROM, and magneto-optical disk), ROM (Read-Only Memory), RAM (Random Access Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory, magnetic card or optical card. That is, the storage medium includes any medium that stores or transmits information in a readable form by a device (for example, a computer). It can be a read-only memory, a disk or an optical disk, etc.

[0143] An embodiment of the present invention further provides a computer device, the computer device comprising:

[0144] one or more processors;

[0145] a storage device for storing one or more programs,

[0146] When the one or more programs are executed by the one or more processors, the one or more processors implement any one of the dependency library management methods described above.

[0147] The computer device may be any device having data processing capability, such as a notebook computer, a desktop computer, a server, etc. Figure 5 A schematic diagram of the structure of a computer device embodiment of the present application is shown. Figure 5 In the embodiment, the computer device may include: a processor 101, a memory 102, a communication interface 103, a display 104, an input unit 105, and a communication bus 106, etc. The processor 101, the memory 102, the communication interface 103, the display 104, and the input unit 105 all communicate with each other through the communication bus 106.

[0148] Optionally, the processor 101 may include a central processing unit (CPU), which can implement the main data processing operations of the computer device. Of course, the central processing unit can also be replaced by an application-specific integrated circuit (ASIC), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices. The processor 101 is the control center of the computer device, which uses various interfaces and lines to connect the various parts of the entire computer device, and executes various functions of the computer device and processes data by running or executing software programs and / or modules stored in the memory 102, and calling the data stored in the memory 102, so as to monitor the computer device as a whole. Optionally, the processor 101 may include one or more processing units; preferably, the processor 101 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, the user interface and the application program, and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor may not be integrated into the processor 101.

[0149] The memory 102 can be used to store software programs and modules. The processor 101 executes various functional applications and data processing of the computer device by running the software programs and modules stored in the memory 102. The memory 102 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a software development application, etc.), etc.; the data storage area can store data created according to the use of the computer device (such as a program cache file, etc.), etc. In addition, the memory 102 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0150] The communication interface 103 may be an interface of a communication module, such as an interface of a GSM module.

[0151] The display unit 104 can be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 104 may include a display panel, and optionally, the display panel may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel may cover the display panel, and when the touch panel detects a touch operation on or near it, it is transmitted to the processor 101 to determine the type of touch event, and then the processor 101 provides a corresponding visual output on the display panel according to the type of touch event.

[0152] The input unit 105 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile phone. Specifically, the input unit 105 may include a touch panel and other input devices. The touch panel is also called a touch screen, which can collect the user's touch operation on or near it (such as the user's operation on the touch panel or near the touch panel using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel may include a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 101, and can receive and execute commands sent by the processor 101. In addition, the touch panel can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel, the input unit 105 may also include other input devices, such as one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, etc.

[0153] The computer device also includes a power source (such as a battery) for supplying power to each component; preferably, the power source can be logically connected to the processor 101 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.

[0154] Although not shown, the computer device may also include sensors, cameras, wireless network modules, etc., which are not described in detail here.

[0155] certainly, Figure 5 The computer device structure shown does not constitute a limitation on the computer device. In actual applications, the computer device may include Figure 5 More or fewer components than shown, or combinations of certain components.

[0156] It should be understood that the functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above integrated modules may be implemented in the form of hardware or in the form of software functional modules.

[0157] The above descriptions are only some embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.< / project> < / project>

Claims

1. A dependency library management method, characterized in that: include: Establish a dependency library plug-in and rewrite the dependency library entry module in the dependency library plug-in; Configuring dependency library management rules in the dependency library entry module; Listen to the preset interface, rewrite the dependency parsing module according to the monitored dependency library management rules, and obtain the dependency relationship; Loading the dependent library according to the dependency relationship, wherein loading the dependent library according to the dependency relationship includes: If the dependency relationship includes debug library information, the system is currently in debug state, all dependent libraries are loaded, and all loaded dependent libraries are published locally.

2. The method according to claim 1, characterized in that After the dependent library is loaded according to the dependency relationship, the method further includes: Stop monitoring the preset interface.

3. The method according to claim 1, characterized in that The loading of the dependent library according to the dependency relationship includes: Determine whether the dependency relationship includes user-defined dependency library configuration information; If yes, then load the dependent library according to the user-defined dependent library configuration information; If not, load the default dependency library.

4. The method according to claim 3, characterized in that The loading of the dependent library according to the user-defined dependent library configuration information includes: If there is no basic dependency library data in the current dependency library, load the basic dependency library; If there is no custom dependency library data in the current dependency library, load the custom dependency library.

5. The method according to claim 1, characterized in that The loading of the dependent library according to the dependency relationship includes: If the dependency relationship includes debugging library information, the dependent library is loaded according to the debugging library information.

6. The method according to claim 1, characterized in that The monitoring preset interface rewrites the dependency parsing module according to the monitored dependency library management rules to obtain the dependency relationship, including: Listen to the DependencyResolutionListener interface, rewrite the beforeResolve module in the DependencyResolutionListener interface function according to the monitored dependency library management rules, and obtain the dependency relationship.

7. The method according to claim 1, characterized in that The configuring of dependency library management rules in the dependency library entry module includes: Get the dependent libraries of the software development kit; According to the dependency configuration relationship of each dependent library, the dependent library management rules are configured in the dependent library entry module.

8. A dependency library management device, characterized in that: The device includes: A plug-in creation module, used to create a dependency library plug-in and rewrite the dependency library entry module in the dependency library plug-in; A rule configuration module, used to configure dependency library management rules in the dependency library entry module; The monitoring and parsing module is used to monitor the preset interface and rewrite the dependency parsing module according to the monitored dependency library management rules to obtain the dependency relationship; A dependency library loading module is used to load the dependency library according to the dependency relationship; wherein the dependency library loading module includes a loading and publishing unit, and the loading and publishing unit is used to load all dependency libraries if the dependency relationship includes debug library information and the system is currently in a debugging state, and publish all loaded dependency libraries to the local.

9. The device according to claim 8, characterized in that The device also includes: The monitoring stop module is used to stop monitoring the preset interface.

10. The device according to claim 8, characterized in that The dependent library loading module includes: A custom judgment unit, used to judge whether the dependency relationship includes user-defined dependency library configuration information; A custom dependency library loading unit, used for loading a dependency library according to the user-defined dependency library configuration information when the dependency relationship includes user-defined dependency library configuration information; The preset dependency library loading unit is used to load the preset dependency library when the dependency relationship does not include user-defined dependency library configuration information.

11. The device according to claim 10, characterized in that The custom dependency library loading unit includes: The basic data loading unit is used to load the basic dependency library if there is no basic dependency library data in the current dependency library; The custom data loading unit is used to load the custom dependent library if there is no custom dependent library data in the current dependent library data.

12. The device according to claim 8, characterized in that The dependent library loading module includes: The debugging library loading unit is used to load the dependent library according to the debugging library information if the dependency relationship includes debugging library information.

13. The device according to claim 8, characterized in that The monitoring and parsing module includes: The DependencyResolutionListener interface unit is used to listen to the DependencyResolutionListener interface and rewrite the beforeResolve module in the DependencyResolutionListener interface function according to the monitored dependency library management rules to obtain the dependency relationship.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the dependency library management method as described in any one of claims 1 to 7 is implemented.

15. A computer device, characterized in that: The computer device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the dependency library management method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Automation testing method and system

    CN103412818A

  • Method and device for transferring resources of plug-in

    CN105094849A

  • Marking and explaining system and method for large-data analysis model

    CN105893509A

  • Method and system for maintaining software package dependence relationship

    CN106371838A

  • Loading method of fixed program in communication module

    CN106484471A