A method, device, electronic device and readable storage medium for recommending dependency packages

By obtaining the build file information input by the user and using the association rule mining algorithm to match dependent packages, the problem of missing, redundant or conflicting dependent packages in software development is solved, and software quality and development efficiency are improved.

CN112182199BActive Publication Date: 2024-10-01CHINA CITIC BANK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010947659.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-10
Publication Date
2024-10-01
Estimated Expiration
2040-09-10

AI Technical Summary

Technical Problem

During the software development process, dependency packages in build files often have missing, redundant or conflicting issues, resulting in low efficiency and low quality of software development and construction.

Method used

By obtaining the build file information input by the user, and using the pre-built build file dependency package knowledge base and association rule mining algorithm, it matches and recommends fully or partially matching target dependency packages to avoid missing, redundant or conflicting dependency packages.

Benefits of technology

It improves software development efficiency and ensures the accuracy and completeness of dependent packages, thereby improving software quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112182199B_ABST
    Figure CN112182199B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of software engineering and intelligent software development, and in particular to a dependency package recommendation method, device, electronic device and readable storage medium, the method comprising obtaining build file information input by a user; matching a target dependency package having a target dependency relationship with the input build file; wherein the target dependency package is stored in a pre-built build file dependency package knowledge base; and recommending the target dependency package to the user. The dependency package recommendation method disclosed in the present application can recommend fully or partially matched dependency packages for the user to choose based on the build file input by the user in real time, so as to improve software development efficiency, avoid missing, redundant or conflicting dependency packages, and thus improve software quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of software engineering and intelligent software development, and in particular to a dependency package recommendation method, device, electronic device and readable storage medium. Background Art

[0002] With the rapid development of the Internet industry, the demand and quality requirements for software are getting higher and higher, and the design patterns of software are becoming more and more complex, which poses new challenges to software development. Improving software quality has become one of the most important issues in the field of software engineering. For some software projects, the built software can be codeless, but must contain Maven, Ivy, Gradle, or SBT build files, such as pom.xml, build.xml, build.gradle, and build.sbt. However, inaccurate dependencies often appear in the build files of software development, such as missing, redundant, or conflicting dependencies, which brings inconvenience to the development and construction of software. Summary of the invention

[0003] The purpose of this application is to solve at least one of the above technical defects. The technical solution adopted by this application is as follows:

[0004] In a first aspect, an embodiment of the present application provides a dependency package recommendation method, the method comprising:

[0005] Get the build file information entered by the user;

[0006] Match target dependency packages that have target dependency relationships with the input build file;

[0007] The target dependency package is stored in a pre-built build file dependency package knowledge base;

[0008] The target dependency package is recommended to the user.

[0009] Optionally, the building of the dependency package knowledge base includes:

[0010] Extract the dependency information dataset of the build file samples in the software repository;

[0011] Using an association rule mining algorithm to obtain frequent item sets of the dependency information data set;

[0012] The dependent package knowledge base is constructed according to the association rules of the non-empty subsets of the frequent itemsets that meet the preset confidence.

[0013] Optionally, the acquiring the frequent itemsets of the dependency information data set by using an association rule mining algorithm includes:

[0014] The frequency of scanning the dependency information dataset to obtain target dependencies;

[0015] The data set whose frequency meets the preset threshold is determined as a frequent 1-item set;

[0016] Determine frequent 2-item sets based on the association rules of at least two frequent 1-item sets;

[0017] An iterative algorithm is used to determine the frequent K itemsets.

[0018] Optionally, constructing the dependency package knowledge base according to the association rule of the non-empty subset of the preset confidence frequent item set includes:

[0019] Select the target non-empty subset of frequent K itemsets;

[0020] When the confidence of all non-empty subsets of the K-item set and the target non-empty subset meets the preset confidence;

[0021] Then output the dependency rules between the target non-empty subset and other non-empty subsets of the K-item set;

[0022] A dependency package knowledge base is constructed according to the frequent K-item sets and the output dependency rules.

[0023] Optionally, before matching the target dependency package having a target dependency relationship with the input build file, the method further includes:

[0024] According to the acquired build file information input by the user, a target dependency package of a target dependency relationship is extracted from the dependency package knowledge base using a dependency package recommendation engine;

[0025] The target dependency package option component is generated using the target dependency package.

[0026] Optionally, the method further comprises:

[0027] Displaying the target dependency package option component on an interface to recommend it to a user;

[0028] The target dependency package option component receives a user operation instruction and matches the target dependency package; wherein the user operation instruction is used to select a target dependency package.

[0029] Optionally, the method further comprises:

[0030] The constructed construction file knowledge base can accept user-defined modifications; wherein the modifications include: adding, deleting, updating, and modifying the association rules and / or construction file samples.

[0031] In a second aspect, an embodiment of the present application provides a dependency package recommendation device, the device comprising: the device comprising: a reading module, a matching module, a storage module and a recommendation module, wherein:

[0032] The reading module is used to obtain the construction file information input by the user;

[0033] The matching module is used to match a target dependency package having a target dependency relationship with the input build file; the target dependency package is stored in a pre-built build file dependency package knowledge base;

[0034] The storage module is used to store the constructed build file dependency package knowledge base.

[0035] The recommendation module is used to recommend the target dependency package to the user.

[0036] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory;

[0037] The memory is used to store operation instructions;

[0038] The processor is used to execute the above-mentioned dependency package recommendation method by calling the operation instruction.

[0039] In a fourth aspect, a computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for recommending dependency packages is implemented.

[0040] The dependency package recommendation scheme disclosed in the embodiment of the present application obtains the build file information input by the user; matches the target dependency package that has a target dependency relationship with the input build file; wherein the target dependency package is stored in a pre-built build file dependency package knowledge base; and recommends the target dependency package to the user. The beneficial effect brought by the technical solution provided in the embodiment of the present application is that the dependency package recommendation method based on the dependency package recommendation method disclosed in the present application can recommend completely or partially matched dependency packages for the user to choose according to the build file input by the user in real time, so as to improve the efficiency of software development, avoid missing, redundancy or conflict of dependency packages, and thus improve the quality of software. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.

[0042] Figure 1 A flowchart of a dependency package recommendation method provided in an embodiment of the present application;

[0043] Figure 2 A schematic diagram of the structure of a dependency package recommendation device provided in an embodiment of the present application;

[0044] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] The embodiments of the present application are described in detail below, and examples of the embodiments 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 application, and cannot be interpreted as limiting the present invention.

[0046] Those skilled in the art will appreciate that, unless otherwise stated, the singular forms "a", "an", "said" and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to 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. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0047] To more clearly describe the embodiments of the present application, some definitions, concepts or devices that may be used in the embodiments are introduced below:

[0048] Maven is a project management tool that includes a Project Object Model, a set of standards, a Project Lifecycle, a Dependency Management System, and logic for running plugin goals defined in lifecycle phases. When you use Maven, you describe your project with a well-defined Project Object Model, and then Maven can apply cross-cutting logic from a set of shared (or custom) plugins. Maven has a lifecycle that is invoked when you run mvn install. This command tells Maven to execute a series of ordered steps until it reaches the lifecycle you specify. One of the effects of traversing the lifecycle journey is that Maven runs many default plugin goals that accomplish tasks such as compiling and creating a JAR file.

[0049] pom is the abbreviation of Project Object Model, which is a project file in Maven that can be used to manage and configure dependencies, organizational information, project authorization, remote repositories, etc. A Maven project can have no code, but it cannot have pom.xml.

[0050] sbt uses a few concepts to support its flexible and powerful build definition. The code directory structure generated by sbt is similar to that of Maven, except that there is an additional project directory. The outermost layer is the build.sbt file for the entire project, and there is plugin.sbt in the project directory to control the loading of plugins.

[0051] Only one build.gradle is placed in a project. Build.gradle can be understood as a Project framework, which provides basic configuration for a project.

[0052] IvyIDEA is a plug-in for the Eclipse integrated development environment that supports Ivy. Apache Ivy is an excellent tool for managing (recording, tracking, parsing and reporting) project dependencies, which can be tightly integrated with Apache Ant.

[0053] Gradle is a JVM-based build tool. It is a general and flexible build tool that supports Maven and Ivy repositories, supports transitive dependency management, and does not require remote repositories or pom.xml and ivy.xml configuration files. It is based on Groovy, and the build script is written in Groovy.

[0054] Dependency is a collection of environments needed for development and program operation. Including software, plug-ins, etc. We usually save the dependencies we need to use in a file named requirements.txt. If we want to run our project in other environments, we can install all the dependencies at once directly through instructions. Dependency package, a program package required for a plug-in to run normally. It can be said that it is a plug-in of plug-in A, which is automatically installed when plug-in A is installed.

[0055] Apriori algorithm is the first association rule mining algorithm and also the most classic algorithm. It uses an iterative method of layer-by-layer search to find the relationship between item sets in the database to form rules. The process consists of connection (matrix-like operation) and pruning (removing unnecessary intermediate results). The concept of item set in this algorithm is a set of items. A set containing K items is a k-item set. The frequency of an item set is the number of transactions containing the item set, which is called the frequency of the item set. If an item set meets the minimum support, it is called a frequent item set.

[0056] In the embodiment of the present application, the user is a software project developer.

[0057] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems will be described in detail below with reference to the accompanying drawings. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.

[0058] In order to make the purpose, technical solutions and advantages of this application clearer, Figure 1 A flowchart of a dependency package recommendation method provided by an embodiment of the present application is disclosed, such as Figure 1 As shown, the dependency package recommendation method includes:

[0059] S101. Obtain the build file information input by the user. In the embodiment of the present application, the implementation process of obtaining the build file input by the user is mainly to obtain the user's build file in Maven, Ivy, Gradle, or SBT, and extract the dependency package input by the user in real time in the build file.

[0060] S102, matching a target dependency package having a target dependency relationship with the input build file; wherein the target dependency package is stored in a pre-built build file dependency package knowledge base;

[0061] In an optional embodiment of the present application, the building of a dependency package knowledge base includes:

[0062] Extract dependency information datasets of sample build files in software repositories;

[0063] The frequent item sets of the dependency information data set are obtained by using an association rule mining algorithm; wherein the association rule mining algorithm may adopt an Apriori algorithm; the specific implementation process is:

[0064] Step 1: Scan the dependency information dataset to obtain the frequency of target dependency relationships;

[0065] Step 2: Determine the data set whose frequency meets the preset threshold as a frequent 1-item set;

[0066] Step 3, determine the frequent 2-item sets according to the association rules of at least two frequent 1-item sets;

[0067] Step 4: Use an iterative algorithm to determine the frequent K-item sets, that is, repeat the iterative algorithm of steps 2-3 above to obtain the frequent k-item sets. If the frequent k-item set is empty, the set of frequent k-1 item sets is returned as the algorithm result, and the algorithm ends. Based on the frequent k-item set, link to generate candidate k+1 item sets.

[0068] Step 5: Construct the dependency package knowledge base according to the association rules of the non-empty subsets of the frequent itemsets with preset credibility. The specific implementation process is: Constructing the dependency package knowledge base according to the association rules of the non-empty subsets of the frequent itemsets with preset credibility includes:

[0069] Step 5-1, select a target non-empty subset of the frequent K-itemset; wherein the target non-empty subset is every non-empty subset of the frequent K-itemset;

[0070] Step 5-2: When the confidence of all non-empty subsets of the K-item set and the target non-empty subset meets the preset confidence, the dependency rules of the target non-empty subset and other non-empty subsets of the K-item set are output; that is, for each frequent K-item set, each of its non-empty subsets S and all its non-empty subsets I are selected, then when support(I) / support(S)≥minconf, when the target non-empty subset S is identified, IS is matched, that is, other non-empty subsets of the frequent K-item set other than S are output.

[0071] Step 5-3: construct a dependency package knowledge base according to the frequent K-item sets and the output dependency rules.

[0072] S103: recommend the target dependency package to the user.

[0073] In an optional embodiment of the present application, before matching the target dependency package having a target dependency relationship with the input build file, the method further includes:

[0074] According to the acquired build file information input by the user, a target dependency package of a target dependency relationship is extracted from the dependency package knowledge base using a dependency package recommendation engine;

[0075] The target dependency package option component is generated using the target dependency package.

[0076] In an optional embodiment of the present application, the method further includes:

[0077] Displaying the target dependency package option component on an interface to recommend it to a user;

[0078] The target dependency package option component receives a user operation instruction and matches the target dependency package; wherein the user operation instruction is used to select a target dependency package.

[0079] In an optional embodiment of the present application, the method further includes:

[0080] The constructed construction file knowledge base can accept user-defined modifications; wherein the modifications include: adding, deleting, updating, and modifying the association rules and / or construction file samples.

[0081] In an optional embodiment, for dependencies that implement the same type of functionality, the dependency class library should not appear as a runtime dependency at the same time, that is, it should be declared as an optional dependency. This feature is recommended for development frameworks and public technical component classes to provide application parties with selection capabilities. It is not recommended to use optional dependencies for specific application systems, and it should be determined that only one dependency is used. For example, a general cache processing interface is defined in the cache component, and Caffeine or Ehcache can be used for remote cache implementation, then these two dependencies should be declared as optional in the dependency management of the cache component.

[0082] based on Figure 1 The embodiment shown provides a dependency package recommendation method. Figure 2 A dependency package recommendation device provided by an embodiment of the present application is shown. Figure 2 As shown, the device mainly includes: the device includes: 201 reading module, 202 matching module, 203 storage module and 204 recommendation module, wherein,

[0083] The reading module 201 is used to obtain the construction file information input by the user;

[0084] The matching module 202 is used to match a target dependency package having a target dependency relationship with the input build file; the target dependency package is stored in a pre-built build file dependency package knowledge base;

[0085] The storage module 203 is used to store the constructed build file dependency package knowledge base.

[0086] The 204 recommendation module is used to recommend the target dependency package to the user.

[0087] In an optional embodiment, the device further comprises a construction module, wherein the reading module is used to extract a dependency information data set of a construction file sample in a software warehouse; and is also used to obtain a frequent item set of the dependency information data set using an association rule mining algorithm;

[0088] The construction module is used to construct the dependent package knowledge base according to the association rules of the non-empty subsets of the frequent itemsets that meet the preset confidence.

[0089] In an optional embodiment, the apparatus further comprises a determination module, wherein the reading module is specifically configured to scan the dependency information data set to obtain the frequency of the target dependency relationship;

[0090] The determination module is used to determine a data set whose frequency meets a preset threshold as a frequent 1-item set; to determine a frequent 2-item set according to an association rule of at least two frequent 1-item sets; and to determine a frequent K-item set using an iterative algorithm.

[0091] In an optional embodiment, the construction module further includes a selection unit, an output unit and a construction unit, wherein:

[0092] The selection unit is used to select a target non-empty subset of the frequent K-item set;

[0093] The output unit is used to output the dependency rule between the target non-empty subset and other non-empty subsets of the K-item set when the confidence of all non-empty subsets of the K-item set and the target non-empty subset meets the preset confidence;

[0094] The construction unit is used to construct a dependency package knowledge base according to the frequent K-item sets and the output dependency rules.

[0095] In an optional embodiment, the device also includes a generation module, wherein the reading module is further used to extract the target dependency package of the target dependency relationship from the dependency package knowledge base using a dependency package recommendation engine based on the acquired build file information input by the user; and the production module is used to generate a target dependency package option component using the target dependency package.

[0096] In an optional embodiment, the device further comprises a display module, wherein the display module is used to display the target dependency package option component on an interface for recommendation to a user;

[0097] The recommendation module is used to match the target dependency package after the target dependency package option component receives a user operation instruction; wherein the user operation instruction is used to select the target dependency package.

[0098] In an optional embodiment, the construction module also includes an editing unit, wherein the editing unit is also used to control the constructed construction file knowledge base to accept user-defined modifications; wherein the modifications include: adding, deleting, updating, and modifying the association rules and / or construction file samples.

[0099] It can be understood that the above modules of the dependency package recommendation device in this embodiment have the function of implementing Figure 1 The functions of the corresponding steps of the method in the embodiment shown in . The function can be implemented by hardware, or by hardware executing the corresponding software. The hardware or software includes one or more modules corresponding to the above functions. The above modules can be software and / or hardware, and the above modules can be implemented separately or integrated with multiple modules. For the functional description of the above modules, please refer to Figure 1 The corresponding description of the method in the embodiment shown in will not be repeated here.

[0100] An embodiment of the present application provides an electronic device, including a processor and a memory;

[0101] A memory, used for storing operation instructions;

[0102] The processor is used to execute the dependency package recommendation method provided in any embodiment of the present application by calling an operation instruction.

[0103] As an example, Figure 3 A schematic diagram of the structure of an electronic device applicable to the embodiment of the present application is shown. Figure 3 As shown, the electronic device 2000 includes: a processor 2001 and a memory 2003. The processor 2001 and the memory 2003 are connected, such as through a bus 2002. Optionally, the electronic device 2000 may also include a transceiver 2004. It should be noted that in actual applications, the transceiver 2004 is not limited to one, and the structure of the electronic device 2000 does not constitute a limitation on the embodiments of the present application.

[0104] The processor 2001 is applied in the embodiment of the present application to implement the method shown in the above method embodiment. The transceiver 2004 may include a receiver and a transmitter. The transceiver 2004 is applied in the embodiment of the present application to implement the function of the electronic device of the embodiment of the present application communicating with other devices when executed.

[0105] Processor 2001 may be a CPU (Central Processing Unit), a general purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 2001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0106] The bus 2002 may include a path to transmit information between the above components. The bus 2002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 2002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0107] The memory 2003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.

[0108] Optionally, the memory 2003 is used to store application code for executing the solution of the present application, and the execution is controlled by the processor 2001. The processor 2001 is used to execute the application code stored in the memory 2003 to implement the dependency package recommendation method provided in any embodiment of the present application.

[0109] The electronic device provided in the embodiment of the present application is applicable to any embodiment of the above method and will not be described in detail here.

[0110] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the dependency package recommendation method shown in the above method embodiment is implemented.

[0111] The computer-readable storage medium provided in the embodiments of the present application is applicable to any embodiment of the above method and will not be described in detail here.

[0112] The dependency package recommendation scheme disclosed in the embodiment of the present application, through the dependency package recommendation scheme disclosed in the embodiment of the present application, obtains the build file information input by the user; matches the target dependency package that has a target dependency relationship with the input build file; wherein the target dependency package is stored in a pre-built build file dependency package knowledge base; and recommends the target dependency package to the user. Based on the dependency package recommendation method disclosed in the present application, it is possible to recommend completely or partially matching dependency packages for the user to choose according to the build file input by the user in real time, so as to improve the efficiency of software development, avoid missing, redundant or conflicting dependency packages, and thus improve the quality of software.

[0113] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0114] The above 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.

Claims

1. A method for recommending dependency packages. It is characterized in that The method comprises: Get the build file information entered by the user; Matching a target dependency package having a target dependency relationship with the input build file; wherein the target dependency package is stored in a pre-built build file dependency package knowledge base, and building the dependency package knowledge base includes: Extract dependency information datasets of sample build files in software repositories; Using an association rule mining algorithm to obtain frequent item sets of the dependency information data set; Constructing the dependency package knowledge base according to the association rules of the non-empty subsets of the frequent itemsets that meet the preset confidence level; The method of obtaining the frequent itemsets of the dependency information data set by using the association rule mining algorithm includes: The frequency of scanning the dependency information dataset to obtain target dependencies; The data set whose frequency meets the preset threshold is determined as a frequent 1-item set; Determine frequent 2-item sets based on the association rules of at least two frequent 1-item sets; An iterative algorithm is used to determine the frequent K-item sets; The step of constructing the dependency package knowledge base according to the association rule of the non-empty subset of the frequent item set satisfying the preset confidence level comprises: Select the target non-empty subset of frequent K itemsets; When the confidence of all non-empty subsets of the K-item set and the target non-empty subset meets the preset confidence, the dependency rules of the target non-empty subset and other non-empty subsets of the K-item set are output; Constructing a dependency package knowledge base according to the frequent K-item sets and the output dependency rules; The target dependency package is recommended to the user.

2. The method for recommending dependent packages according to claim 1, It is characterized in that Before matching the target dependency package having a target dependency relationship with the input build file, the method further includes: According to the acquired build file information input by the user, a target dependency package of a target dependency relationship is extracted from the dependency package knowledge base using a dependency package recommendation engine; A target dependency package option component is generated using the target dependency package.

3. The method for recommending dependent packages according to claim 2, It is characterized in that The method further comprises: Displaying the target dependency package option component on an interface to recommend it to a user; The target dependency package option component receives a user operation instruction and matches the target dependency package; wherein the user operation instruction is used to select a target dependency package.

4. The method for recommending dependent packages according to claim 1, It is characterized in that The method further comprises: The dependency package knowledge base can accept user-defined modifications; wherein the modifications include: adding, deleting, updating, and modifying the association rules and / or construction file samples.

5. A dependency package recommendation device, It is characterized in that The device comprises: a reading module, a matching module, a storage module and a recommendation module, wherein: The reading module is used to obtain the build file information input by the user; it is also used to extract the dependency information data set of the build file sample in the software warehouse; it is also used to obtain the frequent item sets of the dependency information data set using the association rule mining algorithm; it is also used to scan the dependency information data set to obtain the frequency of the target dependency relationship; The matching module is used to match a target dependency package having a target dependency relationship with the input build file; the target dependency package is stored in a pre-built build file dependency package knowledge base; The storage module is used to store the constructed build file dependency package knowledge base; The recommendation module is used to recommend the target dependency package to the user; The device also includes: A construction module, used to construct the dependency package knowledge base according to the association rules of the non-empty subsets of the frequent itemsets that meet the preset confidence level; A determination module is used to determine a data set whose frequency meets a preset threshold as a frequent 1-item set; it is also used to determine a frequent 2-item set according to an association rule of at least two frequent 1-item sets; it is also used to determine a frequent K-item set using an iterative algorithm; The construction module also includes a selection unit, an output unit and a construction unit, wherein: The selection unit is used to select a target non-empty subset of the frequent K-item set; The output unit is used to output the dependency rules between the target non-empty subset and other non-empty subsets of the K-item set when the confidence of all non-empty subsets of the K-item set and the target non-empty subset meets the preset confidence; The construction unit is used to construct a dependency package knowledge base according to the frequent K-item sets and the output dependency rules.

6. An electronic device, It is characterized in that including a processor and a memory; The memory is used to store operation instructions; The processor is used to execute the method according to any one of claims 1 to 4 by calling the operation instruction.

7. A computer-readable storage medium, It is characterized in that The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.