Software dependency processing method, apparatus, device, storage medium, and program product
By employing intelligent software dependency handling methods, open-source software versions are automatically analyzed and managed, solving the problems of inefficiency and security risks caused by manual handling by developers, and achieving efficient and secure software dependency management.
Patent Information
- Application Number
- CN202610464659.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-09
- Publication Date
- 2026-08-25
AI Technical Summary
In the fintech field, developers need to manually query and compare open-source software dependency versions, which leads to low efficiency, high compatibility risks, prominent security vulnerabilities, and high maintenance costs, and makes it impossible to dynamically optimize software dependency versions to meet enterprise compliance requirements.
By employing intelligent software dependency handling methods, intelligent agents are used to automatically analyze project engineering documents. Combined with the enterprise's internal software product management system and open-source software dependency libraries, automated software dependency version management is achieved, ensuring version security and compliance.
It improves software development efficiency, reduces the complexity of manual processing, ensures the security and compliance of software dependency versions, and reduces runtime errors and security risks.
Smart Images

Figure CN122633228A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of financial technology and software development technology, and in particular to a software dependency processing method, apparatus, device, storage medium and program product. Background Technology
[0002] In various fields such as fintech, application development projects heavily rely on third-party open-source software (OSS) to accelerate feature implementation and reduce development costs. These open-source software programs often have complex dependencies on each other. When introducing open-source software, developers must ensure that the selected version complies with security specifications and other requirements.
[0003] However, in this technology, developers need to manually query the versions of the open-source software dependencies introduced in the enterprise's internal software product management system one by one and compare them with the dependency requirements of the target project. This process is not only time-consuming and labor-intensive, but also prone to human negligence, resulting in improper version selection or omission of security reviews. Summary of the Invention
[0004] This application provides a software dependency processing method, apparatus, device, storage medium, and program product to automate software dependency processing and improve its efficiency.
[0005] In a first aspect, this application provides a software dependency processing method, comprising: determining a first software dependency list for a project file selected by a user, the first software dependency list including version information of all software dependencies in the project file; updating the first software dependency list according to user-inputted software dependency requirements to obtain a second software dependency list, the software dependency requirements indicating the generation of recommended versions of newly added software dependencies or the updating of version information of at least one software dependency in the full set of software dependencies, the second software dependency list including a version range of software dependencies; querying the software dependencies and their version ranges in the second software dependency list in an open-source software dependency library to obtain query results; the open-source software dependency library including multiple open-source software dependencies and at least one version of them, each version of the open-source software dependency being registered to the target system, having passed a preset test; and updating the second software dependency list according to the query results to obtain a third software dependency list.
[0006] In one possible embodiment, determining the first software dependency list of a project file based on a user-selected project file includes: reading dependency declaration information from the project file; and converting the dependency declaration information into a structured format containing organization identifiers, component identifiers, and version numbers to obtain the first software dependency list.
[0007] In one possible embodiment, updating the first software dependency list based on user-inputted software dependency requirements to obtain a second software dependency list includes: performing semantic analysis on the user-inputted software dependency requirements to obtain a software dependency field, a software dependency version field, a software dependency processing field, and / or a software dependency constraint field, wherein the software dependency processing field indicates at least one of replacing, deleting, or adding a software dependency or software dependency version, and the software dependency constraint field indicates the constraints that the software dependency requirements must satisfy; and updating the first software dependency list using the software dependency field, software dependency version field, software dependency processing field, and / or software dependency constraint field to obtain the second software dependency list.
[0008] In one possible embodiment, the method further includes: detecting organization identifiers and / or component identifiers using preset technology stack matching rules to obtain technology stack information; updating the first software dependency list using software dependency fields, software dependency version fields, software dependency processing fields, and / or software dependency constraint fields includes: detecting the compatibility between the technology stack information and the software dependency fields and software dependency version fields; and, if compatible, updating the first software dependency list using the software dependency fields, software dependency version fields, software dependency processing fields, and / or software dependency constraint fields.
[0009] In one possible embodiment, updating the second software dependency list based on the query results to obtain the third software dependency list includes: if the query results indicate that the first software dependency and its version range in the second software dependency list exist in the open-source software dependency library, selecting target version information from the version range of the first software dependency based on preset filtering indicators and their priorities; and updating the second software dependency list using the first software dependency and its target version information to obtain the third software dependency list.
[0010] In one possible embodiment, the preset detection includes vulnerability detection, and the preset screening indicators include at least one of the following: the detection results of vulnerability detection, and the performance feedback information of open source software based on historical runtime.
[0011] In one possible embodiment, the method is applied to an electronic device, which includes a display interface. After obtaining a third software dependency list, the method further includes: displaying the third software dependency list on the display interface; and modifying the software dependency declaration information of the project engineering file using the third software dependency list in response to triggering a first control on the display interface.
[0012] Secondly, this application provides a software dependency processing apparatus, comprising: a first intelligent agent, configured to determine a first software dependency list of a project file selected by a user, the first software dependency list including version information of all software dependencies in the project file; a second intelligent agent, configured to update the first software dependency list according to software dependency requirements input by the user to obtain a second software dependency list, the software dependency requirements indicating the generation of recommended versions of newly added software dependencies or the updating of version information of at least one software dependency in the full set of software dependencies, the second software dependency list including a version range of software dependencies; a third intelligent agent, configured to query the software dependencies and their version ranges in the second software dependency list in an open-source software dependency library to obtain query results; the open-source software dependency library includes multiple open-source software dependencies and at least one version of them, each version of the open-source software dependency being registered to the target system, having undergone preset testing, and having passed the testing; and a fourth intelligent agent, configured to update the second software dependency list according to the query results to obtain a third software dependency list.
[0013] In one possible embodiment, the first, second, third, and fourth intelligent agents are embedded in an integrated development environment (IDE) tool as plug-ins. The IDE tool is used to read project files, receive software dependency requirements, and / or modify software dependency declaration information in the project files using a third software dependency list.
[0014] Thirdly, this application provides an electronic device, including: a processor and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method as described in any of the first aspects.
[0015] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any of the first aspects.
[0016] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method of any one of the first aspects.
[0017] In this embodiment, the electronic device can automatically determine a first software dependency list for a project file selected by the user, eliminating the need for manual analysis of the project file's software dependencies. The first software dependency list includes version information for all software dependencies in the project file, making it a reliable reference for subsequent software dependency processing. User-inputted software dependency requirements serve as the basis for updating the first software dependency list, resulting in a second software dependency list that meets user needs. The open-source software dependencies in the open-source software dependency library are registered with the target system, have passed preset checks, and are therefore compliant and secure. By querying the second software dependency list and its version range in the open-source software dependency library, obtaining query results, and updating the second software dependency list based on these results, a third software dependency list is obtained that satisfies both project file requirements and user needs, as well as compliance and security requirements.
[0018] In summary, the software dependency processing method of this application can automatically handle software dependencies in project engineering files without relying on human experience or intervention, thereby improving software development efficiency. Furthermore, the software dependencies in the final determined third software dependency list have security and compliance guarantees, reducing the likelihood of errors during subsequent software development and runtime. Therefore, the software dependency processing method of this application has a higher degree of automation and efficiency. Attached Figure Description
[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0020] Figure 1 This is a schematic diagram of the system architecture for which the software dependency processing method of the embodiments of this application can be applied;
[0021] Figure 2 A schematic diagram of the system architecture of a software dependency processing method according to another embodiment of this application;
[0022] Figure 3 This is a flowchart of a software dependency processing method according to an embodiment of this application;
[0023] Figure 4 A flowchart of a software dependency processing method according to another embodiment of this application;
[0024] Figure 5 This is a schematic diagram of the structure of a software dependency processing device provided in an embodiment of this application;
[0025] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0026] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0027] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0028] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of the relevant data all comply with the relevant laws, regulations, and standards of the relevant countries and regions, have taken necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation access points for users to choose to authorize or refuse.
[0029] Furthermore, the technical solution involved in this application, which involves big data analysis of user information (including but not limited to personal biometrics, identity data, consumption data, asset data, electronic terminal operation data, etc.) and the use of artificial intelligence technology for automated decision-making, and makes decisions that have a significant impact on personal rights based on the results of automated decision-making, provides users with corresponding operation entry points for users to choose to agree to or reject the results of automated decision-making; if the user chooses to reject, the process will proceed to the expert decision-making process.
[0030] It should be noted that the prompt word generation method, apparatus, device, storage medium and program product provided in this application can be applied to the fields of financial technology and artificial intelligence technology, and can also be used in any field other than financial technology and artificial intelligence technology. This application does not limit the application field of the prompt word generation method, apparatus, device, storage medium and program product.
[0031] The following will explain the relevant technical terms involved in the embodiments of this application.
[0032] Software dependency: External software packages, components, libraries, frameworks, modules, or third-party programs that a project's engineering files must rely on, call, or depend on to provide capabilities when compiling, running, or implementing specified functions. Agent: A software entity possessing a certain degree of autonomy, goal orientation, and the ability to interact with its environment.
[0033] Model Context Protocol (MCP): A lightweight, language-agnostic, open protocol used to securely and structurally transmit contextual information, capability claims, and interaction requests between agents, tools, services, or user interfaces.
[0034] Software Product Management System: An open-source software information management system used to manage trusted open-source software that has undergone internal vulnerability scanning and analysis.
[0035] The relevant technologies primarily rely on developers manually handling open-source software dependencies. The specific process is as follows:
[0036] Developers first open the application project file using an Integrated Development Environment (IDE) and manually analyze the current dependency list (such as Maven's pom.xml or NPM's package.json) to identify software dependencies that need to be updated or added. Then, developers need to log into the company's internal software product management system to query the available versions of each open-source software dependency that needs to be updated or added, comparing version compatibility, vulnerability scan results, and security assessment reports.
[0037] If multiple candidate versions are found, developers need to comprehensively consider technology stack compatibility, performance requirements, and security specifications, and ultimately manually select and configure the version number. This process needs to be repeated multiple times, especially when the software dependency hierarchy is complex or batch updates are required, where developers need to spend a lot of time comparing versions and troubleshooting conflicts. Furthermore, there is a lack of automated tools to assist in analyzing dependencies, requiring developers to handle version conflicts themselves (such as different dependencies requiring different versions of the same component), and it is impossible to dynamically verify whether the recommended version meets enterprise compliance requirements. Ultimately, developers need to manually modify project configuration files and test and verify, making the entire process highly dependent on human experience, inefficient, and prone to errors.
[0038] In summary, the relevant technologies have at least one of the following problems:
[0039] Manual analysis is inefficient: Developers need to manually query, compare and test open source software dependency versions, which makes the dependency management process cumbersome and time-consuming, seriously slowing down the development progress.
[0040] Version compatibility risk: When manually selecting versions, it is difficult to fully assess the compatibility of dependencies, which can easily lead to runtime errors such as class loading conflicts and interface mismatches.
[0041] Significant security risks: Developers may mistakenly select open-source software dependency versions that have not passed vulnerability scanning or have not completed security assessments, exposing the system to potential attack risks.
[0042] Lack of dynamic optimization capabilities: It cannot dynamically recommend the optimal software dependency versions based on the project's technology stack, nor can it automatically filter versions that meet the company's compliance standards.
[0043] High maintenance costs: When software dependency layers are complex, developers need to troubleshoot conflicts layer by layer, and maintenance costs increase exponentially, especially in scenarios where multiple projects are developed in parallel.
[0044] Based on this, the software dependency processing method, apparatus, device, storage medium, and program product of this application, by combining an enterprise's internal software product management system with dynamic software dependency resolution technology, achieve intelligent recommendation and security review of open-source software dependencies. Specifically, through the collaborative division of labor among multiple intelligent agents, the manually processed software dependency processing flow can be transformed into an automated processing flow.
[0045] The embodiments of this application are applicable to project development scenarios in the financial technology field that rely on complex open-source software, such as bank transaction systems, risk control platforms, or data analysis platforms.
[0046] Figure 1 This is a schematic diagram of the system architecture for which the software dependency processing method of the embodiments of this application can be applied.
[0047] like Figure 1 As shown, the system architecture includes a terminal device 1 and an electronic device 2. Specifically, the user (i.e., the developer) initiates a software dependency processing request and inputs software dependency requirements through the terminal device 1. The request and software dependency requirements are transmitted to the electronic device 2, which then executes the software dependency processing method of this embodiment.
[0048] Terminal device 1 can be a mobile phone, computer, tablet, etc., and electronic device 2 can be a server.
[0049] Figure 2 This is a schematic diagram of the system architecture of a software dependency processing method according to another embodiment of this application.
[0050] like Figure 2 As shown, the system architecture includes: target system 3, model context protocol interface 4, software dependency analysis agent 5, and integrated development environment tool 6. Target system 3, model context protocol interface 4, software dependency analysis agent 5, and integrated development environment tool 6 can all be deployed on... Figure 1 On the electronic device 2, or, the model context protocol interface 4, the software dependency analysis agent 5, and the integrated development environment tools 6 are all deployed on Figure 1 The target system 3 is deployed on a different electronic device than electronic device 2, while electronic device 2 is on electronic device 2.
[0051] Among them, Target System 3 can be understood as a software product management system, which is used to store registered open source software dependencies that have passed the preset tests.
[0052] Model Context Protocol Interface 4 is used for cross-system data interaction, specifically for obtaining relevant data on open-source software dependencies in target system 3.
[0053] The software dependency analysis agent 5, also known as the software dependency processing device below, includes the first agent, the second agent, the third agent, and the fourth agent. The first agent, the second agent, the third agent, and the fourth agent are embedded in the integrated development environment tool 6 as plug-ins.
[0054] Integrated Development Environment (IDE) 6 is a tool for developers to write code, handle software dependencies, and input software dependency requirements. Project files are stored within the IDE. For example... Figure 2 As shown, the integrated development environment tool 6 can be, for example, the MAVEN build tool, the NPM build tool, or the Python build tool.
[0055] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0056] Figure 3 This is a flowchart illustrating a software dependency processing method according to an embodiment of this application. The software dependency processing in this embodiment can be performed by an electronic device and specifically includes steps S110 to S140.
[0057] S110. Based on the project engineering file selected by the user, determine the first software dependency list of the project engineering file.
[0058] The first software dependency list includes version information for all software dependencies in the project's engineering files. Each software dependency in the first software dependency list has a specific version.
[0059] Project files are configuration files used by developers to manage software dependencies in an application project. Examples of project files include Maven's pom.xml or NPM's package.json.
[0060] S120. Update the first software dependency list according to the software dependency requirements input by the user to obtain the second software dependency list.
[0061] Software dependency requirements indicate whether to generate recommended versions of newly added software dependencies or update the version information of at least one software dependency in the full software dependency list. After the user inputs the software dependency requirements, these requirements serve as fuzzy constraints for updating the first software dependency list, enabling the second software dependency list to include a range of software dependency versions. For example, in the second software dependency list, newly added or updated software dependencies have their own version ranges. That is, compared to the first software dependency list, some software dependencies in the second software dependency list expand from a fixed version to multiple versions.
[0062] For example, the software dependency requirement is "to add a JSON parsing class to the current Java Spring Boot project, preferably a version compatible with Spring Boot 2.7.x". Based on this software dependency requirement, the second software dependency list includes the new software dependency fastjson and its version range 2.0.40-2.0.45.
[0063] Alternatively, the software dependency requirement is "update the existing commons-lang3 software dependency in the current project from version 3.8.1 to the latest stable version compatible with JDK 11." Based on this software dependency requirement, the second software dependency list includes the updated software dependency commons-lang3 and its version range 3.12.0-3.14.0.
[0064] S130. Query the software dependencies and their version ranges in the second software dependency list in the open source software dependency library to obtain the query results.
[0065] The open-source software dependency library includes multiple open-source software dependencies and at least one version of them. Each version of the open-source software dependency has been registered with the target system, passed the preset test, and passed the test.
[0066] For example, the target system is an enterprise's software product management system. Pre-defined detection includes: vulnerability detection and security analysis detection. Vulnerability detection specifically checks whether open-source software dependencies contain common vulnerabilities, remote code execution vulnerabilities, unauthorized access vulnerabilities, data leaks, etc. Security analysis detection checks whether open-source software dependencies contain malicious code such as Trojans and backdoors, and whether they have been tampered with.
[0067] The open-source software dependencies in the open-source software dependency library are open-source software dependencies that are recognized, safe, and compliant by the target system.
[0068] Electronic devices can perform precise matching queries in the open-source software dependency library based on the software dependencies and their version ranges in the second software dependency list, and obtain the query results. The query results indicate whether there are open-source software dependencies in the open-source software dependency library that are the same as the software dependencies in the second software dependency list and whose versions are within the corresponding version range.
[0069] S140. Update the second software dependency list based on the query results to obtain the third software dependency list.
[0070] When the query results indicate that there is an open-source software dependency in the open-source software dependency library that is the same as each software dependency in the second software dependency list and whose version is within the corresponding version range, the second software dependency list is updated using the open-source software dependency to obtain the third software dependency list.
[0071] When the query results indicate that there is no open-source software dependency in the open-source software dependency library that is the same as or has a version that is not within the corresponding version range as the software dependency in the second software dependency list, the electronic device can generate and display a prompt message indicating that the software dependency processing has failed.
[0072] In this embodiment, the electronic device can automatically determine a first software dependency list for a project file selected by the user, eliminating the need for manual analysis of the project file's software dependencies. The first software dependency list includes version information for all software dependencies in the project file, making it a reliable reference for subsequent software dependency processing. User-inputted software dependency requirements serve as the basis for updating the first software dependency list, resulting in a second software dependency list that meets user needs. The open-source software dependencies in the open-source software dependency library are registered with the target system, have passed preset checks, and are therefore compliant and secure. By querying the second software dependency list and its version range in the open-source software dependency library, obtaining query results, and updating the second software dependency list based on these results, a third software dependency list is obtained that satisfies both project file requirements and user needs, as well as compliance and security requirements.
[0073] In summary, the software dependency processing method of this application embodiment can automatically handle software dependencies in project engineering files without relying on human experience or intervention, thereby improving software development efficiency. Furthermore, the software dependencies in the final determined third software dependency list have security and compliance guarantees, reducing the likelihood of errors during subsequent software development and runtime. Therefore, the software dependency processing method of this application embodiment has a higher degree of automation and efficiency.
[0074] Figure 4 This is a flowchart of a software dependency processing method according to another embodiment of this application.
[0075] like Figure 4 As shown, in one possible embodiment, step S110 includes steps S111 to S112.
[0076] S111: Read the dependency declaration information in the project engineering file.
[0077] Dependency declaration information refers to the identifying information of third-party dependencies defined in the project files, such as Maven's dependency declarations. <dependencies>Software dependency declarations in the tag.
[0078] For example, an electronic device can parse the text of a project's engineering files to read dependency declaration information.
[0079] S112. Convert the dependency declaration information into a structured format containing organization identifier, component identifier and version number to obtain the first software dependency list.
[0080] Structured format refers to software dependency information stored in a standardized data format, such as JSON or XML.
[0081] The organization identifier (GroupId, ArtifactId, Version, i.e., GAV) is used to identify the business domain to which the development organization, team, or project belongs; the component identifier is used to identify the specific software, project model, etc., under the organization identifier; and the version number is used to identify different iterations of a unified component. A single open-source software can be uniquely identified through GAV.
[0082] In this embodiment, by reading dependency declaration information from the project's engineering files and converting it into a structured format containing organization identifiers, component identifiers, and version numbers, software dependency information can be standardized, providing a unified data foundation for subsequent software dependency analysis and version recommendations. Furthermore, in this process, developers do not need to manually compare the GAV information of software dependencies; the electronic device can automatically extract and organize the first software dependency list, reducing the time spent on manual software dependency processing and avoiding parsing failures due to missing or incorrectly formatted software dependency information.
[0083] like Figure 4 As shown, in one possible embodiment, step S120 includes steps S121 to S122.
[0084] S121. Perform semantic analysis on the user-inputted software dependency requirements to obtain software dependency fields, software dependency version fields, software dependency processing fields, and / or software dependency constraint fields.
[0085] The software dependency field indicates the name of the software dependency, and the software dependency version field indicates the version number of the software dependency.
[0086] The Software Dependency Handling field indicates at least one of the following: replacement, deletion, or addition of a software dependency or software dependency version.
[0087] The software dependency constraint field indicates the constraints that software dependency requirements must meet.
[0088] Continuing with the example of a software dependency requirement: "Add a JSON parsing class dependency to the current Java SpringBoot project, preferably a usable version compatible with SpringBoot 2.7.x," the dependency constraint fields indicate: Project Name: Java SpringBoot, compatible with SpringBoot 2.7.x, and must be a JSON parsing class; the dependency handling field is "Add." Another example is a software dependency requirement: "Update the existing commons-lang3 dependency in the current project from version 3.8.1 to the latest stable version compatible with JDK 11." The dependency fields are: commons-lang3, version: 3.8.1, handling field: "Update," and dependency constraint fields indicate compatibility with JDK 11, stability, and latest version.
[0089] S122. Update the first software dependency list using the software dependency field, software dependency version field, software dependency processing field and / or software dependency constraint field to obtain the second software dependency list.
[0090] In this embodiment, by performing semantic analysis on the input software dependency requirements, the natural language software dependency requirements can be transformed into structured fields, specifically including software dependency fields, software dependency version fields, software dependency processing fields, and / or software dependency constraint fields. These fields allow for accurate updating of the first software dependency list, ensuring that the second software dependency list conforms to the software dependency requirements.
[0091] In one possible embodiment, the software dependency processing method further includes: detecting organization identifiers and / or component identifiers using preset technology stack matching rules to obtain technology stack information. This step can be performed after step S112.
[0092] Technology stack matching rules are rules used to associate the organizational and / or component identifiers that software depends on with the technology stack of the project documentation.
[0093] For example, the technology stack matching rule indicates that org.springframework.boot (organization identifier) and spring-boot-starter (component identifier) match the Java Spring Boot framework stack. Another example is that com.alibaba (organization identifier) and fastjson (component identifier) match Java ecosystem JSON parsing class dependencies.
[0094] Step S122 includes: detecting the compatibility between the technology stack information and the software dependency field and the software dependency version field; if compatible, updating the first software dependency list using the software dependency field, the software dependency version field, the software dependency processing field and / or the software dependency constraint field.
[0095] For example, if there is incompatibility between the technology stack information and the software dependency field and the software dependency version field, the electronic device will not use the software dependency field, the software dependency version field, the software dependency processing field and / or the software dependency constraint field to update the first software dependency list.
[0096] In this embodiment, by utilizing preset technology stack matching rules to detect organization identifiers and / or component identifiers, the technology stack of the project engineering files can be automatically and accurately identified. By detecting the compatibility between the technology stack information and the software dependency fields and software dependency version fields, and, where compatible, updating the first software dependency list using the software dependency fields, software dependency version fields, software dependency processing fields, and / or software dependency constraint fields, the resulting second software dependency list not only meets user needs but also adapts to the technology stack of the project engineering files. This allows for the early resolution of software dependency compatibility issues and reduces the risk of errors during project engineering file execution.
[0097] like Figure 4 As shown, in one possible embodiment, step S130 includes steps S131 to S132.
[0098] S131. If the query results indicate that the first software dependency and its version range exist in the second software dependency list in the open source software dependency library, select the target version information from the version range of the first software dependency based on the preset filtering indicators and their priorities.
[0099] The target version information refers to the optimal version determined after pre-defined screening criteria and priority ranking among multiple versions of open source software dependencies in the open source software dependency library that simultaneously meet the criteria of "having the same name as the first software dependency and having a version within the version range of the first software dependency in the second software dependency list".
[0100] For example, the version range of the first software dependency in the second software dependency list is 3.1.1 to 3.1.5. An open-source software dependency library contains an open-source software dependency with the same name as the first software dependency and versions 3.1.1 to 3.1.3. In this embodiment, the electronic device can select the optimal version from 3.1.1 to 3.1.3 based on preset filtering criteria and their priorities. Similarly, the version range of the first software dependency in the second software dependency list is 3.1.1 to 3.1.5. An open-source software dependency library contains an open-source software dependency with the same name as the first software dependency and a version such as 3.1.1. In this case, the electronic device can directly determine 3.1.1 as the target version.
[0101] S132. Using the first software dependency and its target version information, update the second software dependency list to obtain the third software dependency list.
[0102] In this embodiment, when the query result indicates that the first software dependency and its version range from the second software dependency list exist in the open-source software dependency library, this means that the open-source software dependency library stores the first software dependency with the corresponding version range from the second software dependency list. This also means that multiple versions corresponding to the version range of the first software dependency meet the requirements of the project engineering file, user requirements, and matching technology stack requirements, and are safe and compliant software dependencies that have undergone preset testing. At this time, this embodiment selects target version information from the version range of the first software dependency based on preset filtering indicators and their priorities, and can select the optimal target version information from the version range of the first software dependency. Therefore, by using the first software dependency and its target version information to update the second software dependency list, the resulting third software dependency list includes the optimal software dependency version, which is more efficient and performs better when used for subsequent project engineering file execution.
[0103] In one possible embodiment, the preset detection includes vulnerability detection, and the preset screening indicators include at least one of the following: the detection results of vulnerability detection, and the performance feedback information of open source software based on historical runtime.
[0104] For example, the priority of the preset screening criteria can be that the detection results of vulnerability detection have a higher priority than the performance feedback information of open source software based on historical runtime.
[0105] For example, for open-source software dependencies that have undergone vulnerability testing and passed the test, the detection results may include no pre-defined vulnerabilities or the existence of low-level pre-defined vulnerabilities.
[0106] For example, performance feedback information from the historical runtime of open-source software dependencies includes at least one of performance overhead, resource consumption, and activity level. Performance overhead refers to the degree of computational resource consumption by the open-source software dependency version during runtime, and can be represented by at least one of CPU utilization, execution time, and request processing throughput. Resource consumption refers to the consumption of resources such as memory and disk by the open-source software dependency version during runtime, and can be represented by at least one of peak memory usage and disk space usage. Activity level refers to the open-source community's enthusiasm for maintaining the open-source software dependency version, and can be represented by at least one of the latest update time, fix rate, and commit frequency of the software dependency version.
[0107] For example, electronic devices can perform weighted calculations based on preset weights of multi-dimensional evaluation metrics to obtain a multi-dimensional evaluation metric score for open-source software that relies on historical runtime performance feedback information. Taking performance overhead, resource consumption, and activity as examples, the specific values of performance overhead, resource consumption, and activity can be normalized to the same range and mapped to the base score. The product of the preset weights and the base score is the final multi-dimensional evaluation metric score. The preset weights corresponding to performance overhead, resource consumption, and activity are, for example, 0.4, 0.3, and 0.3. The specific preset weights corresponding to performance overhead, resource consumption, and activity can be set according to actual needs.
[0108] In this embodiment, when the preset screening criteria include at least one of the following: vulnerability detection results, performance feedback information from the historical runtime of open-source software dependencies, the target version information selected from the first software dependency version range based on the preset screening criteria and their priorities is a version with fewer vulnerabilities or a lower vulnerability risk level and better running performance. This can reduce the occurrence of subsequent rework to fix software dependency versions.
[0109] like Figure 3 As shown, in one possible embodiment, the software dependency processing method is applied to an electronic device, which includes a display interface. After obtaining a third software dependency list, the software dependency processing method further includes steps S150 to S160.
[0110] S150. Display the list of third-party software dependencies on the display interface.
[0111] S160. In response to the first control that triggers the display interface, modify the software dependency declaration information of the project file using the third software dependency list.
[0112] The first control is used to receive a user's confirmation instruction for the third software dependency list. In one possible embodiment, the display interface further includes a second control, which is used to receive a user's rejection instruction for the third software dependency list. The electronic device can respond to triggering the second control by not modifying the software dependency declaration information in the project engineering file using the third dependency list.
[0113] In this embodiment, by displaying a third software dependency list on the display interface and responding to a first control that triggers the display interface, the software dependency declaration information in the project engineering file can be modified using the third software dependency list, thus achieving an automated closed loop for software dependency version processing. For example, developers do not need to manually modify configuration files; the electronic device can automatically generate and apply the software dependency versions in the third software dependency version list, significantly reducing manual operation time while ensuring the accuracy and consistency of dependency declaration information.
[0114] In one possible embodiment, the software dependency processing method further includes: predicting the probability of software dependency conflicts in a third software dependency list using a first model and updating the third software dependency list based on the software dependency conflict probabilities.
[0115] For example, the first model can be a gradient boosting tree or a random forest model. The gradient boosting tree or random forest model can output important features related to software dependency conflicts, which can be used for subsequent auditing, making it suitable for financial scenarios with auditing requirements and possessing reasoning capability.
[0116] For example, the probability range of software dependency conflict probabilities can be mapped to a preset conflict handling strategy. For instance, when the software conflict probability is less than or equal to 1 and greater than 80%, the corresponding conflict handling strategy could be to replace the conflicting software dependency version. When the software conflict probability is greater than 30% and less than or equal to 80%, the corresponding conflict handling strategy could be to push a replacement software dependency version to the developers and replace it according to their instructions, or not replace it at all. When the software conflict probability is greater than or equal to 1 and less than or equal to 30%, the original software dependency version in the third software dependency list can be retained, and the software dependency conflict probability can be marked.
[0117] For example, an electronic device can pre-collect historical software dependency data, label it using feature engineering techniques, and generate training samples in the form of feature vectors from the historical software dependency data. Next, an initial first model is trained using these training samples to obtain an initial software dependency conflict probability. If the initial software dependency conflict probability converges based on a loss function evaluation, the model parameters of the initial first model are fixed to obtain the first model. If convergence is not achieved, iterative training continues.
[0118] Understandably, the large number and variety of training samples allow the first model to learn features representing software dependencies under various conditions. Based on the input third software dependency list, the probability of software dependency conflicts in the three software dependency lists is automatically predicted.
[0119] In this embodiment of the application, the probability of software dependency conflict in the third software dependency list is predicted by the first model and the third software dependency list is updated using the probability of software dependency conflict. This can reduce the risk of runtime anomalies caused by software dependency conflicts and improve the stability of subsequent software dependency versions.
[0120] In summary, the software dependency processing method according to the embodiments of this application has at least one of the following technical effects:
[0121] 1. Reduce the time developers spend searching, comparing, and testing open-source software, and automate the complex software dependency processing flow that relies on manual handling, thereby improving software development efficiency.
[0122] 2. The above embodiments handle software dependencies at the very beginning of the software dependency introduction process, which solves the runtime errors and security risks caused by software dependency version incompatibility and software dependency version conflicts from the source, ensuring the robustness and architectural security of the software system in complex application environments.
[0123] 3. The open-source software dependency versions in the final third software dependency list meet both the optimal performance requirements of the project's technology stack and the enterprise's internal security audit and compliance standards, thus taking into account both technical compatibility and enterprise compliance requirements.
[0124] Figure 5 This is a schematic diagram of a software dependency processing device provided in an embodiment of this application. Figure 5 As shown, the software dependency processing device provided in this application embodiment includes: a first intelligent agent 210, a second intelligent agent 220, a third intelligent agent 230, and a fourth intelligent agent 240.
[0125] The first intelligent agent 210 is used to determine a first software dependency list of the project project file based on the project project file selected by the user. The first software dependency list includes version information of all software dependencies in the project project file.
[0126] The second intelligent agent 220 is used to update the first software dependency list according to the software dependency requirements input by the user to obtain the second software dependency list. The software dependency requirements indicate whether to generate a recommended version of the newly added software dependency or to update the version information of at least one software dependency in the full set of software dependencies. The second software dependency list includes the version range of the software dependencies.
[0127] The third intelligent agent 230 is used to query the software dependencies and their version ranges in the second software dependency list in the open source software dependency library and obtain the query results; the open source software dependency library includes multiple open source software dependencies and at least one version information, and each version of the open source software dependency has been registered to the target system, has passed the preset test, and has passed the test.
[0128] The fourth intelligent agent 240 is used to update the second software dependency list based on the query results to obtain the third software dependency list.
[0129] For example, the first, second, third, and fourth agents can all be composite structures with interface call capabilities, combined with a rule engine and a large language model. For instance, these four agents can be used for semantic analysis, software dependency processing, and knowledge invocation, making the execution of steps S110 to S140 by the first to fourth agents more efficient and accurate.
[0130] For example, the fourth agent can call relevant interfaces through the Model Context Protocol (MCP) to query the software dependencies and their version ranges in the second software dependency list in the open-source software dependency library.
[0131] In one possible embodiment, the first, second, third, and fourth intelligent agents are embedded in an integrated development environment (IDE) tool as plug-ins. The IDE tool is used to read project files, receive software dependency requirements, and / or modify software dependency declaration information in the project files using a third software dependency list.
[0132] In this embodiment, developers can write code, handle software dependencies, and input software dependency requirements entirely within the integrated development environment tool, avoiding the tedious operation of switching back and forth between multiple tools.
[0133] In addition, the integrated development environment (IDE) tools support reading project files and can capture changes in project software dependencies in real time. When project software dependencies change, the software dependency processing method of this application embodiment can be triggered to synchronously update the software dependency list.
[0134] Furthermore, the first, second, third, and fourth intelligent agents are embedded into the integrated development environment tool as plug-ins. Subsequent updates and iterations of these intelligent agents only require version upgrades of the corresponding plug-ins, without the need to deploy the entire project, thus reducing the cost of iteration and updates.
[0135] In one possible embodiment, the first intelligent agent includes: a reading submodule for reading dependency declaration information from project engineering files; and a conversion submodule for converting the dependency declaration information into a structured format containing organization identifiers, component identifiers, and version numbers to obtain a first software dependency list.
[0136] In one possible embodiment, the second intelligent agent includes: a semantic analysis submodule, configured to perform semantic analysis on the software dependency requirements input by the user to obtain a software dependency field, a software dependency version field, a software dependency processing field, and / or a software dependency constraint field, wherein the software dependency processing field indicates at least one of replacing, deleting, or adding a software dependency or software dependency version, and the software dependency constraint field indicates the constraints that the software dependency requirements must satisfy; and a first update submodule, configured to update the first software dependency list using the software dependency field, the software dependency version field, the software dependency processing field, and / or the software dependency constraint field to obtain a second software dependency list.
[0137] In one possible embodiment, the device method further includes: a detection module, configured to detect organization identifiers and / or component identifiers using preset technology stack matching rules to obtain technology stack information; and a first update submodule specifically configured to: detect the compatibility between the technology stack information and the software dependency field and the software dependency version field; and, if compatible, update the first software dependency list using the software dependency field, the software dependency version field, the software dependency processing field, and / or the software dependency constraint field.
[0138] In one possible embodiment, the third intelligent agent includes: a selection submodule, configured to select target version information from the version range of the first software dependency based on preset filtering indicators and their priorities, when the query result indicates that the first software dependency and its version range exist in the second software dependency list in the open source software dependency library; and a second update submodule, configured to update the second software dependency list using the first software dependency and its target version information to obtain the third software dependency list.
[0139] In one possible embodiment, the preset detection includes vulnerability detection, and the preset screening indicators include at least one of the following: the detection results of vulnerability detection, and the performance feedback information of open source software based on historical runtime.
[0140] In one possible embodiment, the apparatus method is applied to an electronic device, the electronic device including a display interface, the apparatus further including: a display module for displaying a third software dependency list on the display interface; and a modification module for modifying software dependency declaration information of a project file using the third software dependency list in response to triggering a first control on the display interface.
[0141] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 6 As shown, this application embodiment provides an electronic device including a processor 301 and a memory 302. Optionally, the device further includes a communication component 303. The processor 301, memory 302, and communication component 303 are connected via a bus 304.
[0142] In the specific implementation process, the memory 302 stores code, and the processor 301 runs the code stored in the memory 302 to execute the method of the above method embodiment.
[0143] The specific implementation process of processor 301 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0144] In the above Figure 6 In the illustrated embodiments, it should be understood that the processor 301 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0145] The memory 302 may include high-speed RAM memory, and may also include non-volatile memory (NVM), such as at least one disk storage.
[0146] Bus 304 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Bus 304 can be divided into address bus, data bus, control bus, etc. For ease of illustration, the bus 304 in the accompanying drawings of this application is not limited to only one bus or one type of bus.
[0147] This application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the methods described in the above-described method embodiments.
[0148] The aforementioned computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0149] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0150] This application provides a computer program product, including a computer program that, when executed by a processor, implements the methods provided in any of the embodiments described above.
[0151] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.
[0152] It should be further noted that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0153] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.
[0154] Furthermore, unless otherwise specified, the functional units / modules in the various embodiments of this application can be integrated into one unit / module, or each unit / module can exist physically separately, or two or more units / modules can be integrated together. The integrated units / modules described above can be implemented in hardware or as software program modules.
[0155] When integrated units / modules are implemented in hardware, the hardware can be digital circuits, analog circuits, etc. The physical implementation of the hardware structure includes, but is not limited to, transistors, memristors, etc. Unless otherwise specified, the processor can be any suitable hardware processor, such as a CPU, GPU, FPGA, DSP, and ASIC, etc. Unless otherwise specified, the storage unit can be any suitable magnetic or magneto-optical storage medium, such as Resistive Random Access Memory (RRAM), Dynamic Random Access Memory (DRAM), Static Random Access Memory (SRAM), Enhanced Dynamic Random Access Memory (EDRAM), High-Bandwidth Memory (HBM), Hybrid Memory Cube (HMC), etc.
[0156] If the integrated unit / module is implemented as a software program module and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0157] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.
[0158] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0159] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.< / dependencies>
Claims
1. A software dependency handling method, characterized in that, include: Based on the project file selected by the user, a first software dependency list is determined for the project file, the first software dependency list including version information of all software dependencies in the project file; The first software dependency list is updated based on the software dependency requirements input by the user to obtain a second software dependency list. The software dependency requirements indicate whether to generate a recommended version of a new software dependency or to update the version information of at least one software dependency in the full set of software dependencies. The second software dependency list includes a range of software dependency versions. The software dependencies and their version ranges in the second software dependency list are queried in the open source software dependency library to obtain the query results; the open source software dependency library includes multiple open source software dependencies and at least one version information, and each version of the open source software dependency has been registered to the target system, passed the preset test; The second software dependency list is updated based on the query results to obtain the third software dependency list.
2. The method according to claim 1, characterized in that, The step of determining the first software dependency list of the project project file based on the project project file selected by the user includes: Read the dependency declaration information from the project's engineering file; The dependency declaration information is converted into a structured format containing organization identifier, component identifier, and version number to obtain the first software dependency list.
3. The method according to claim 2, characterized in that, The step of updating the first software dependency list based on user-inputted software dependency requirements to obtain the second software dependency list includes: Semantic analysis is performed on the software dependency requirements input by the user to obtain software dependency fields, software dependency version fields, software dependency processing fields and / or software dependency constraint fields. The software dependency processing field indicates at least one of replacing, deleting or adding software dependencies or software dependency versions. The software dependency constraint field indicates the constraints that the software dependency requirements must meet. The first software dependency list is updated using the software dependency field, the software dependency version field, the software dependency processing field, and / or the software dependency constraint field to obtain the second software dependency list.
4. The method according to claim 3, characterized in that, The method further includes: The organization identifier and / or component identifier are detected using preset technology stack matching rules to obtain technology stack information; The step of updating the first software dependency list using the software dependency field, the software dependency version field, the software dependency processing field, and / or the software dependency constraint field includes: Detect the compatibility between the technology stack information and the software dependency field and the software dependency version field; Where compatible, the first software dependency list is updated using the software dependency field, the software dependency version field, the software dependency processing field, and / or the software dependency constraint field.
5. The method according to any one of claims 2-4, characterized in that, The step of updating the second software dependency list based on the query results to obtain the third software dependency list includes: If the query result indicates that the first software dependency and its version range in the second software dependency list exist in the open source software dependency library, target version information is selected from the version range of the first software dependency based on preset filtering indicators and their priorities. Using the first software dependency and its target version information, update the second software dependency list to obtain the third software dependency list.
6. The method according to claim 5, characterized in that, The preset detection includes vulnerability detection, and the preset screening indicators include at least one of the following: the detection result of the vulnerability detection, and the performance feedback information of the open source software during historical runtime.
7. The method according to claim 5, characterized in that, The method is applied to an electronic device, which includes a display interface. After obtaining the third software dependency list, the method further includes: The third software dependency list is displayed on the display interface; In response to a first control that triggers the display interface, the software dependency declaration information of the project file is modified using the third software dependency list.
8. A software dependency processing apparatus, characterized in that, include: A first intelligent agent is used to determine a first software dependency list of the project project file based on the project project file selected by the user. The first software dependency list includes version information of all software dependencies in the project project file. The second intelligent agent is used to update the first software dependency list according to the software dependency requirements input by the user to obtain the second software dependency list. The software dependency requirements indicate whether to generate a recommended version of a new software dependency or to update the version information of at least one software dependency in the full set of software dependencies. The second software dependency list includes a range of software dependency versions. The third intelligent agent is used to query the software dependencies and their version ranges in the second software dependency list in the open source software dependency library to obtain the query results; the open source software dependency library includes multiple open source software dependencies and at least one version information, and each version of the open source software dependency has been registered to the target system, has passed the preset test; A fourth intelligent agent is used to update the second software dependency list based on the query results to obtain a third software dependency list.
9. The apparatus according to claim 8, characterized in that, The first intelligent agent, the second intelligent agent, the third intelligent agent, and the fourth intelligent agent are embedded in the integrated development environment tool in a plug-in manner. The integrated development environment tool is used to read the project engineering file, receive the software dependency requirements, and / or modify the software dependency declaration information of the project engineering file using the third software dependency list.
10. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 7.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 7.
12. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of any one of claims 1 to 7.
