[go: up one dir, main page]

CN114780109A - Python project third-party library dependence automatic analysis and installation method - Google Patents

Python project third-party library dependence automatic analysis and installation method Download PDF

Info

Publication number
CN114780109A
CN114780109A CN202210554316.XA CN202210554316A CN114780109A CN 114780109 A CN114780109 A CN 114780109A CN 202210554316 A CN202210554316 A CN 202210554316A CN 114780109 A CN114780109 A CN 114780109A
Authority
CN
China
Prior art keywords
version
library
project
party
python
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210554316.XA
Other languages
Chinese (zh)
Other versions
CN114780109B (en
Inventor
吴荣鑫
王超
林立
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen University
Original Assignee
Xiamen University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen University filed Critical Xiamen University
Priority to CN202210554316.XA priority Critical patent/CN114780109B/en
Publication of CN114780109A publication Critical patent/CN114780109A/en
Application granted granted Critical
Publication of CN114780109B publication Critical patent/CN114780109B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

Python项目第三方库依赖自动化解析与安装方法,涉及软件可靠性检测技术领域。首先收集Python包管理仓库PyPI上所有第三库的数据,形成本地知识库;输入一个Python项目,解析其配置文件,获取该项目所有的直接依赖;根据本地知识库构建该项目包含所以直接依赖和间接依赖以及其所有符合约束范围版本的完全依赖树,再求解出所有满足约束范围的版本;根据本地环境中已安装的第三方库来输出最终的安装脚本。本方法解析推荐的库能够在满足项目约束的同时尽可能复用本地已安装的第三方库。实现Python项目第三方库的自动解析、安装和复用。节省用户安装项目所需的下载时间和安装时间以及减少硬盘空间使用。

Figure 202210554316

A third-party library dependency of a Python project is an automatic analysis and installation method, which relates to the technical field of software reliability detection. First, collect the data of all third libraries on the Python package management warehouse PyPI to form a local knowledge base; enter a Python project, parse its configuration file, and obtain all direct dependencies of the project; build the project according to the local knowledge base, including all direct dependencies and Indirect dependencies and the complete dependency tree of all versions that meet the constraint range, and then solve all versions that meet the constraint range; output the final installation script according to the third-party libraries installed in the local environment. This method parses and recommends libraries that can reuse locally installed third-party libraries as much as possible while meeting project constraints. Implement automatic parsing, installation and reuse of third-party libraries for Python projects. Save users download time and installation time required to install projects and reduce hard disk space usage.

Figure 202210554316

Description

Python项目第三方库依赖自动化解析与安装方法Python project third-party library dependency automatic analysis and installation method

技术领域technical field

本发明涉及软件可靠性检测技术领域,尤其是涉及一种Python项目第三方库依赖自动化解析与安装方法。The invention relates to the technical field of software reliability detection, in particular to a third-party library dependency automatic analysis and installation method of a Python project.

背景技术Background technique

在当代的软件开发过程中,第三方库的重用给开发人员带来了极大的便利,使得一些软件开发人员更加专注于自己业务功能的开发。PyPI是Python生态系统中一个成功的例子,它提供了一个中央仓库来存储大量的Python第三方库。到2022年3月,它已经索引了近300万个库的发布版本,每个库都有元数据描述(例如,库名、版本信息和对其他库的依赖)。为了导入PyPI中的库,开发者需要声明版本约束(即库的版本必须满足的约束),以限制配置文件中所导入的库是否兼容。然后,在遵守版本约束的情况下,Python库安装程序pip会以递归的方式自动安装导入的库和其他被这个导入的库所依赖的库。pip将开发者从管理库依赖关系的沉重负担中解脱出来。然而,由于复杂的库依赖关系,自动安装过程将伴随着依赖冲突问题的风险。若一个项目中出现了对同一个库的多个版本约束时,就有可能会产生依赖冲突。In the contemporary software development process, the reuse of third-party libraries brings great convenience to developers, making some software developers focus more on the development of their own business functions. PyPI is a successful example in the Python ecosystem, which provides a central repository to store a large number of third-party Python libraries. As of March 2022, it has indexed nearly 3 million releases of libraries, each of which is described by metadata (e.g., library name, version information, and dependencies on other libraries). In order to import a library in PyPI, developers need to declare version constraints (that is, the constraints that the version of the library must satisfy) to restrict whether the imported library in the configuration file is compatible. Then, subject to version constraints, the Python library installer pip will recursively install the imported library and other libraries that the imported library depends on. pip frees developers from the heavy burden of managing library dependencies. However, due to complex library dependencies, the automatic installation process will come with the risk of dependency conflict issues. If there are multiple version constraints on the same library in a project, dependency conflicts may occur.

Python项目中的依赖冲突问题主要分为两大类,第一种是Python生态社区中其他库的更新引起的项目出现冲突问题。这是因为pip的安装策略默认为下载安装第三库约束范围内最新的版本,但是,pip不能保证所下载的第三方库是完全兼容的。第二种是本地环境中多个Python项目相互之间出现不兼容的问题。当开发者在安装多个Python项目时,对于同一个第三方库的版本约束可能不一致,这就导致了Python项目在安装过程中与本地环境的不兼容冲突问题。所以,需要一种方法来自动化地解析Python项目所需的第三库的所有版本,在没有依赖冲突等兼容性问题的情况下安装所有的第三方库。Dependency conflicts in Python projects are mainly divided into two categories. The first is the project conflict caused by the update of other libraries in the Python ecological community. This is because pip's installation policy defaults to downloading and installing the latest version within the constraints of the third-party library. However, pip cannot guarantee that the downloaded third-party library is fully compatible. The second is the incompatibility between multiple Python projects in the local environment. When developers install multiple Python projects, the version constraints for the same third-party library may be inconsistent, which leads to incompatibility conflicts between Python projects and the local environment during the installation process. Therefore, there is a need for a way to automatically resolve all versions of third-party libraries required by a Python project, and install all third-party libraries without compatibility issues such as dependency conflicts.

发明内容SUMMARY OF THE INVENTION

本发明的目的在于针对现有技术存在的上述不足,本申请提供一种Python软件项目第三方库依赖自动化解析与安装方法。基于项目整个依赖树所有的第三库的所有可用版本进行解析,期望在最短的时间内寻找符合当前项目所需的最合适第三库的版本。首先收集Python包管理仓库PyPI上所有第三库的数据,形成本地知识库;接着输入一个Python项目,解析其配置文件,获取该项目所有的直接依赖;然后根据本地知识库构建该项目包含所以直接依赖和间接依赖以及其所有符合约束范围版本的完全依赖树,再求解出所有满足约束范围的版本;最后根据本地环境中已安装的第三方库来输出最终的安装脚本,使得本方法解析推荐的库能够在满足项目约束的同时尽可能复用本地已安装的第三方库。本方法实现Python项目第三方库的自动解析、安装和复用。The purpose of the present invention is to address the above deficiencies in the prior art, and the present application provides a method for automatic analysis and installation of third-party library dependencies of Python software projects. Based on all available versions of the third library in the entire dependency tree of the project, it is expected to find the most suitable version of the third library that meets the needs of the current project in the shortest time. First collect the data of all third libraries on PyPI, the Python package management warehouse, to form a local knowledge base; then enter a Python project, parse its configuration file, and obtain all the direct dependencies of the project; then build the project according to the local knowledge base. Dependencies and indirect dependencies, as well as all their complete dependency trees that meet the constraint range, and then solve all versions that meet the constraint range; finally, output the final installation script according to the third-party library installed in the local environment, so that this method can parse the recommended Libraries can reuse locally installed third-party libraries as much as possible while meeting project constraints. This method realizes automatic parsing, installation and reuse of third-party libraries of Python projects.

本发明包括如下步骤:The present invention comprises the following steps:

步骤1:获取Python生态社区中所有第三方库的详细信息,包括库名、版本和其所有所需的直接依赖,构建本地知识库;Step 1: Obtain the detailed information of all third-party libraries in the Python ecological community, including the library name, version and all its required direct dependencies, and build a local knowledge base;

步骤2:获取Python项目的依赖配置文件(setup.py或者reqiurements.txt);Step 2: Obtain the dependency configuration file (setup.py or requirements.txt) of the Python project;

步骤3:构建项目的完全依赖树,生成SMT表达式并求解约束范围;Step 3: Build the complete dependency tree of the project, generate the SMT expression and solve the constraint range;

步骤4:根据本地环境中已安装的第三方库来优化已经生成的SMT表达式;Step 4: Optimize the generated SMT expression according to the third-party library installed in the local environment;

步骤5:经过步骤4中的优化操作后,获取最终的SMT表达式,然后求解,获取Python项目所需的所有第三方库,其版本为满足版本约束范围内的最新版本,输出安装脚本;Step 5: After the optimization operation in Step 4, obtain the final SMT expression, and then solve it to obtain all the third-party libraries required by the Python project, whose version is the latest version within the range of the version constraints, and output the installation script;

步骤6:对于步骤5中的安装脚本,依次安装其中的所有第三方依赖到项目所在的本地环境中,如存在可复用的第三方库,则使用软连接的方式,链接到项目所在的环境中。Step 6: For the installation script in Step 5, install all the third-party dependencies in the local environment where the project is located in turn. If there is a reusable third-party library, use a soft link to link to the environment where the project is located. middle.

在步骤1中,所述构建本地知识库的步骤可为:In step 1, the step of building a local knowledge base may be:

步骤1.1:获取Python生态社区所有的第三方库;Step 1.1: Obtain all third-party libraries of the Python ecological community;

访问PyPI提供的API,获取Python生态社区中的每一个第三方库的名字和版本列表,然后,对于每一个版本,通过命令“pip install package_name–no-deps”下载到本地环境中;Access the API provided by PyPI to obtain the name and version list of each third-party library in the Python ecological community, and then, for each version, download it to the local environment through the command "pip install package_name–no-deps";

步骤1.2:解析每一个库版本的依赖信息;Step 1.2: Parse the dependency information of each library version;

通过步骤1.1中的命令下载一个第三方库以后,解析其setup.py文件,获取该库的完整名和版本号以及该库的所有直接依赖的其他第三方库的完整名和版本号信息,将以上4类信息分别存入数据库表package_req中,4列分别为package_name,package_version,package_req_name,package_req_version;After downloading a third-party library through the command in step 1.1, parse its setup.py file to obtain the full name and version number of the library and the full name and version number information of all other third-party libraries directly dependent on the library. The class information is stored in the database table package_req respectively, and the 4 columns are package_name, package_version, package_req_name, package_req_version;

步骤1.3:将数据重新编号形成本地知识库;Step 1.3: Renumber the data to form a local knowledge base;

由于SMT约束求解器只支持数字范围求解不支持版本号格式(例如0.0.1),因此需要将数据库中的数据项重新编号,每一个库的每一个版本对应一个唯一id,且id编号按照版本号从小到大依次排列;最后形成本地知识库文件,存储格式为Json文件。Since the SMT constraint solver only supports numerical range solving and does not support the version number format (such as 0.0.1), it is necessary to renumber the data items in the database. Each version of each library corresponds to a unique id, and the id number is based on the version. The numbers are arranged in order from small to large; finally, a local knowledge base file is formed, and the storage format is a Json file.

在步骤3中,所述构建项目的完全依赖树,生成SMT表达式并求解约束范围的具体步骤可为:In step 3, the specific steps of constructing the complete dependency tree of the project, generating the SMT expression and solving the constraint range may be:

步骤3.1:解析项目直接依赖库;Step 3.1: Parse the project's direct dependency library;

对步骤2中获取的依赖配置文件进行解析,获取到该配置文件后,通过步骤1.2的方法解析setup.py文件或直接读取requirements.txt来获取Python项目的所有所需的直接依赖库的信息;按照pip默认广度优先的解析策略依次解析项目的每一个直接依赖库,获取所需的版本约束范围;Parse the dependency configuration file obtained in step 2. After obtaining the configuration file, use the method in step 1.2 to parse the setup.py file or directly read the requirements.txt to obtain all the required information about the directly dependent libraries of the Python project. ;According to pip's default breadth-first parsing strategy, parse each directly dependent library of the project in turn to obtain the required version constraint range;

步骤3.2:在知识库中获取直接依赖库的可满足版本列表;Step 3.2: Obtain the satisfiable version list of the directly dependent library in the knowledge base;

在步骤3.1中获取项目的所有直接依赖库的版本约束范围后,转换成id列表在本地知识库中检索获取的当前库的符合版本约束范围的所有版本;After obtaining the version constraint range of all directly dependent libraries of the project in step 3.1, convert it into an id list and retrieve all versions of the current library that meet the version constraint range obtained in the local knowledge base;

步骤3.3:解析步骤3.2中的每一个版本,获取其子依赖库的信息,包括名和版本约束范围;Step 3.3: Analyze each version in Step 3.2 to obtain information about its sub-dependent libraries, including name and version constraint range;

步骤3.4:使用深度优先遍历算法重复上述步骤3.2~步骤3.3,直到Python项目的整个完全依赖树构建完成,该完全依赖树包含当前项目所有所需的所有依赖库及其可行所有的版本;Step 3.4: Use the depth-first traversal algorithm to repeat the above steps 3.2 to 3.3 until the entire complete dependency tree of the Python project is constructed, and the complete dependency tree contains all the required libraries and all feasible versions of the current project;

步骤3.5:根据步骤3.4中的完全依赖树生成SMT表达式;Step 3.5: Generate SMT expressions according to the complete dependency tree in step 3.4;

将步骤3.4完全依赖树中的每一个依赖库及其版本转换成本地知识库中对应的唯一id,同时也将对该库的版本约束范围转换成id的范围,形成SMT表达式。主要原因是SMT表达式是仅支持数值类型进行比较。其中每一个库的多个版本之间为OR的关系,多个库之间为AND关系,最终形成基于完全依赖树的SMT表达式。Convert each dependent library and its version in the complete dependency tree in step 3.4 into the corresponding unique id in the local knowledge base, and also convert the version constraint range of the library into the id range to form an SMT expression. The main reason is that SMT expressions are only supported for numeric types for comparison. There is an OR relationship between multiple versions of each library, and an AND relationship between multiple libraries, and finally an SMT expression based on a complete dependency tree is formed.

步骤3.6:使用约束求解工具Z3求解SMT表达式,得出每一个依赖库的可满足版本约束范围。Step 3.6: Use the constraint solving tool Z3 to solve the SMT expression, and obtain the satisfiable version constraint range of each dependent library.

定义:SMT为SAT(布尔表达式可满足性理论)的一种扩展,表示一类公式的可满足性判定问题,此处的SMT表达式用来判断依赖树中第三方库的版本约束范围是否可满足。Definition: SMT is an extension of SAT (Boolean Expression Satisfaction Theory), which represents the satisfiability determination problem of a class of formulas. The SMT expression here is used to determine whether the version constraint range of the third-party library in the dependency tree is not Satisfied.

在步骤4中,所述根据本地环境中已安装的第三方库来优化已经生成的SMT表达式,具体步骤如下:In step 4, the generated SMT expression is optimized according to the installed third-party library in the local environment, and the specific steps are as follows:

步骤4.1:获取本地环境中已安装的第三方库列表package_list;Step 4.1: Get the list of installed third-party libraries package_list in the local environment;

步骤4.2:对于package_list中的每一个第三方库的每一个版本,从高版本到低版本依次加入步骤3中的SMT表达式,使用约束求解器判断是否满足;Step 4.2: For each version of each third-party library in the package_list, add the SMT expression in step 3 in turn from the higher version to the lower version, and use the constraint solver to determine whether it is satisfied;

步骤4.3:若满足,则证明当前版本符合SMT约束范围,可以被复用,所以保留;Step 4.3: If it is satisfied, it proves that the current version complies with the SMT constraints and can be reused, so keep it;

步骤4.4:若不满足,则回滚SMT表达式的状态,然后继续加入下一个版本,直到SMT表达式中出现过的所有包都被遍历一遍则停止。Step 4.4: If it is not satisfied, roll back the state of the SMT expression, and then continue to add the next version, and stop until all the packages that appear in the SMT expression have been traversed once.

在步骤6中,具体步骤如下:In step 6, the specific steps are as follows:

对于步骤5中安装脚本的每一条记录,首先索引本地仓库是否存在该库的该版本,若存在则直接创建软连接,在Linux中使用ln-s,在Windows中使用mklink,最终将所有的包索引到当前项目所在的虚拟环境中。若该版本不存在与本地仓库中,则使用pip安装命令pip install package==version–no-deps安装该库的特定版本到本地仓库中,然后创建软连接到当前虚拟环境中。For each record of the installation script in step 5, first index whether the version of the library exists in the local warehouse, if so, create a soft link directly, use ln-s in Linux, use mklink in Windows, and finally all packages Index into the virtual environment where the current project is located. If the version does not exist in the local repository, use the pip installation command pip install package==version-no-deps to install a specific version of the library into the local repository, and then create a soft link to the current virtual environment.

本发明的有益效果主要包括两个部分:The beneficial effects of the present invention mainly include two parts:

1、本方法可以让用户在安装Python项目时,自动解析项目所需的所有依赖的第三方库及其版本。该方法还能有效地解决项目中存在的依赖冲突问题,弥补Python默认安装工具pip的解决依赖冲突问题时,搜索空间太大,搜索时间过长导致安装失败以及浪费带宽等问题。用户在使用过程中,无需了解Python依赖解析的具体过程,也无需处理项目中存在的潜在依赖冲突问题,可直接使用本方法。1. This method allows users to automatically resolve all dependent third-party libraries and their versions required by the project when installing a Python project. This method can also effectively solve the problem of dependency conflicts existing in the project, and make up for the problems of too large search space and too long search time to solve the dependency conflict problem of the default Python installation tool pip, which leads to installation failure and waste of bandwidth. In the process of using, users do not need to understand the specific process of Python dependency parsing, nor do they need to deal with potential dependency conflicts in the project, and can use this method directly.

2、使用本方法解析安装Python项目依赖的所有第三方库时,可以获取本地已安装的第三方库列表。在本方法向开发者推荐的待安装依赖库列表中,会优先选择本地已安装的依赖库,使得项目安装时,能够尽可能复用本地的数据。2. When using this method to parse and install all the third-party libraries that the Python project depends on, you can obtain a list of the locally installed third-party libraries. In the list of dependency libraries to be installed recommended to the developer by this method, the locally installed dependency libraries are preferentially selected, so that local data can be reused as much as possible when the project is installed.

附图说明Description of drawings

图1为本发明实施例中Python软件项目第三方库依赖自动化解析与安装方法的流程图;Fig. 1 is the flow chart of Python software project third-party library dependency automatic analysis and installation method in the embodiment of the present invention;

图2为本发明实施例中构建本地知识库的流程图;Fig. 2 is the flow chart of constructing local knowledge base in the embodiment of the present invention;

图3为本发明实施例中构建完全依赖树和解析项目依赖库版本范围的流程图;3 is a flowchart of constructing a complete dependency tree and analyzing the version range of a project dependency library in an embodiment of the present invention;

图4为本发明实施例中优化复用本地库的流程图。FIG. 4 is a flowchart of optimizing and multiplexing a native library in an embodiment of the present invention.

具体实施方式Detailed ways

本发明提供一种Python软件项目第三方库依赖自动化解析与安装方法,检测项目的配置文件并自动解析项目所需的所有第三方库以及最合适的版本范围,最后根据本地已安装的第三方库的情况来自动求解并给出当前项目所需的所有第三方库及其版本,并自动安装所有的版本,同时尽可能复用本地已安装的第三方库,最终达到节省用户安装项目所需的下载时间和安装时间以及减少硬盘空间使用。The invention provides an automatic analysis and installation method for third-party library dependencies of Python software projects, detects the configuration file of the project, automatically analyzes all third-party libraries required by the project and the most suitable version range, and finally according to the locally installed third-party libraries It can automatically solve and give all the third-party libraries and their versions required by the current project, and automatically install all versions, and reuse the locally installed third-party libraries as much as possible, so as to save the user's need for installing the project. Download time and installation time and reduce hard disk space usage.

下面结合附图和实施例,对本发明的具体实施方式详细描述。以下实施例用于说明本发明,但不用来限制本发明的范围。The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings and embodiments. The following examples are intended to illustrate the present invention, but not to limit the scope of the present invention.

本方法实施流程如图1中所示,过程如下:The implementation process of this method is shown in Figure 1, and the process is as follows:

步骤1:本地知识库构建的具体内容如图2中所示,包括:Step 1: The specific content of the local knowledge base construction is shown in Figure 2, including:

步骤1.1:获取Python生态社区所有的第三方库;Step 1.1: Obtain all third-party libraries of the Python ecological community;

访问PyPI提供的API,获取Python生态社区中的每一个第三方库的名字和版本列表。然后,对于每一个版本,通过命令“pip install package_name–no-deps”下载到本地环境中。Access the API provided by PyPI to get the name and version list of every third-party library in the Python ecosystem. Then, for each version, download it to the local environment with the command "pip install package_name --no-deps".

步骤1.2:解析每一个库版本的依赖信息;Step 1.2: Parse the dependency information of each library version;

通过步骤1.1中的命令下载一个第三方库以后,解析其setup.py文件,获取该库的完整名和版本号以及该库的所有直接依赖的其他第三方库的完整名和版本号信息。将以上4类信息分别存入数据库表package_req中,4列分别为package_name,package_version,package_req_name,package_req_version。After downloading a third-party library through the command in step 1.1, parse its setup.py file to obtain the full name and version number of the library and the full name and version number information of all other third-party libraries that the library directly depends on. The above four types of information are stored in the database table package_req respectively, and the four columns are package_name, package_version, package_req_name, package_req_version.

步骤1.3:将数据重新编号形成本地知识库;Step 1.3: Renumber the data to form a local knowledge base;

由于SMT约束求解器只支持数字范围求解不支持版本号格式(例如0.0.1),因此需要将数据库中的数据项重新编号,每一个库的每一个版本对应一个唯一id,且id编号按照版本号从小到大依次排列。最后形成本地知识库文件,存储格式为Json文件。Since the SMT constraint solver only supports numerical range solving and does not support the version number format (such as 0.0.1), it is necessary to renumber the data items in the database. Each version of each library corresponds to a unique id, and the id number is based on the version. Numbers are arranged in order from smallest to largest. Finally, a local knowledge base file is formed, and the storage format is Json file.

步骤2:获取Python项目的配置文件,并解析其直接依赖库信息;Step 2: Obtain the configuration file of the Python project and parse its direct dependent library information;

每一个Python项目都至少存在一个配置文件(例如setup.py或requirements.txt)。Every Python project has at least one configuration file (such as setup.py or requirements.txt).

步骤3:构建完全依赖树,生成SMT表达式并求解约束范围,具体内容如图3中所示,包括:Step 3: Build a complete dependency tree, generate SMT expressions and solve the constraint range, as shown in Figure 3, including:

步骤3.1:解析项目直接依赖库:获取到该配置文件后,通过步骤1.2的方法解析setup.py文件或者直接读取requirements.txt获取Python项目的所有直接依赖库的信息。按照pip默认广度优先的解析策略依次解析项目的每一个直接依赖库,获取所需的版本约束范围。Step 3.1: Parse the project's direct dependency library: After obtaining the configuration file, use the method in Step 1.2 to parse the setup.py file or directly read the requirements.txt to obtain the information of all the directly dependent libraries of the Python project. According to pip's default breadth-first resolution strategy, each directly dependent library of the project is parsed in turn to obtain the required version constraint range.

步骤3.2:在知识库中获取直接依赖库的可满足版本列表:在步骤3.1中获取项目的所有直接依赖库的版本约束范围后,转换成id列表在本地知识库中检索对应的版本。Step 3.2: Obtain the satisfiable version list of the directly dependent library in the knowledge base: After obtaining the version constraint range of all the directly dependent libraries of the project in step 3.1, convert it into an id list and retrieve the corresponding version in the local knowledge base.

步骤3.3:解析步骤3.2中的每一个版本,获取其子依赖库的信息,包括名和版本约束范围。Step 3.3: Analyze each version in Step 3.2 to obtain information about its sub-dependent libraries, including name and version constraint range.

步骤3.4:使用深度优先遍历算法重复上述步骤3.2到步骤3.3的内容,直到构建包含当前Python项目所需的所有依赖库以及其所有版本的完全依赖树。Step 3.4: Repeat steps 3.2 to 3.3 above using a depth-first traversal algorithm until a complete dependency tree is built that includes all the dependency libraries required by the current Python project and all their versions.

步骤3.5:根据步骤3.4中的完全依赖树生成SMT表达式:将步骤3.4完全依赖树中的每一个依赖库及其版本转换成本地知识库中对应的唯一id,同时也将对该库的版本约束范围转换成id的范围,形成SMT表达式。主要原因是SMT表达式是仅支持数值类型进行比较。其中每一个库的多个版本之间为OR的关系,多个库之间为AND关系,最终形成基于完全依赖树的SMT表达式。Step 3.5: Generate SMT expressions according to the complete dependency tree in step 3.4: Convert each dependency library and its version in the complete dependency tree in step 3.4 into the corresponding unique id in the local knowledge base, and also convert the version of the library Constraint ranges are converted to ranges of ids, forming SMT expressions. The main reason is that SMT expressions are only supported for numeric types for comparison. There is an OR relationship between multiple versions of each library, and an AND relationship between multiple libraries, and finally an SMT expression based on a complete dependency tree is formed.

步骤3.6:使用约束求解工具Z3求解SMT表达式,得出每一个依赖库的可满足版本约束范围。Step 3.6: Use the constraint solving tool Z3 to solve the SMT expression, and obtain the satisfiable version constraint range of each dependent library.

步骤4:根据本地环境中已安装的第三方库来优化已经生成的SMT表达式,具体内容如图4中所示,包括:Step 4: Optimize the generated SMT expression according to the installed third-party library in the local environment. The specific content is shown in Figure 4, including:

步骤4.1:获取本地环境中已安装的第三方库列表package_list;Step 4.1: Get the list of installed third-party libraries package_list in the local environment;

通过本方法,在首次安装Python项目时,会创建本地仓库,用于存储Python项目的所欲第三方库。当开发者再次使用本方法安装项目时,会首先获取此时本地仓库中已安装的所有第三方库package_list。With this method, when the Python project is installed for the first time, a local repository will be created to store the desired third-party libraries of the Python project. When the developer uses this method to install the project again, it will first obtain the package_list of all third-party libraries installed in the local warehouse at this time.

步骤4.2:对于package_list中的每一个第三方库的每一个版本,使用约束求解器判断是否满足;Step 4.2: For each version of each third-party library in the package_list, use the constraint solver to determine whether it is satisfied;

对于package_list中的每一个库,若该库存在于SMT表达式中,则获取其已下载的所有版本,从高版本号到低版本号依次遍历每一个版本,通过转换函数transform转换成本地知识库中的唯一id,然后以package_name==id的形式加入步骤3中的SMT表达式中,最后使用约束求解器判断此时表达式是否可满足。For each library in package_list, if the library exists in the SMT expression, get all its downloaded versions, traverse each version in turn from the high version number to the low version number, and convert it into the local knowledge base through the transformation function transform The unique id is added to the SMT expression in step 3 in the form of package_name==id, and finally the constraint solver is used to determine whether the expression can be satisfied at this time.

步骤4.3:若可满足,则证明当前库的版本符合SMT约束范围,可以被复用,所以保留;Step 4.3: If it can be satisfied, it proves that the version of the current library complies with the SMT constraints and can be reused, so it is reserved;

若将package_name==id加入SMT表达式后,求解结果为sat状态,则表示可满足,则保留当前约束,然后跳转到下一个库进行遍历搜索。If package_name==id is added to the SMT expression, and the solution result is in the sat state, it means that it can be satisfied, and the current constraint is retained, and then jumps to the next library for traversal search.

步骤4.4:若不满足,即SMT的求解结果为unsat,则回滚SMT表达式的状态,然后继续加入下一个版本,直到SMT表达式中出现过的所有包都被遍历一遍则停止;Step 4.4: If it is not satisfied, that is, the solution result of SMT is unsat, then roll back the state of the SMT expression, and then continue to add the next version, until all the packages that appear in the SMT expression have been traversed once, then stop;

步骤5:经过步骤4中的优化操作后,获取最终的SMT表达式,然后求解,获取Python项目所需的所有第三方库,其版本为满足版本约束范围内的最新版本,输出安装脚本;Step 5: After the optimization operation in Step 4, obtain the final SMT expression, and then solve it to obtain all the third-party libraries required by the Python project, whose version is the latest version within the range of the version constraints, and output the installation script;

使用Z3求解器求解最终的SMT表达式,获取一系列的库版本列表,其中每一条的形式为package_name==id。然后将id映射到本地知识库中,获取对应的版本号,转换成package_name==version的形式,输出到安装脚本中。Solve the final SMT expression using the Z3 solver to obtain a list of library versions, each of the form package_name==id. Then map the id to the local knowledge base, obtain the corresponding version number, convert it into the form of package_name==version, and output it to the installation script.

步骤6:对于步骤5中的安装脚本,依次安装其中的所有第三方依赖到项目所在的本地环境中,如存在步骤4中所述的可复用的第三方库,则使用软连接的方式,链接到项目所在的环境中。Step 6: For the installation script in Step 5, install all the third-party dependencies in the local environment where the project is located in turn. If there is a reusable third-party library described in Step 4, use the soft connection method, Link to the environment where the project is located.

对于步骤5中安装脚本的每一条记录,首先索引本地仓库是否存在该库的该版本,若存在则直接创建软连接,在Linux中使用ln-s,在Windows中使用mklink,最终将所有的包索引到当前项目所在的虚拟环境中。若该版本不存在与本地仓库中,则使用pip安装命令pip install package==version–no-deps安装该库的特定版本到本地仓库中,然后创建软连接到当前虚拟环境中。For each record of the installation script in step 5, first index whether the version of the library exists in the local warehouse, if so, create a soft link directly, use ln-s in Linux, use mklink in Windows, and finally all packages Index into the virtual environment where the current project is located. If the version does not exist in the local repository, use the pip installation command pip install package==version-no-deps to install a specific version of the library into the local repository, and then create a soft link to the current virtual environment.

步骤7:安装成功,输出安装结果。Step 7: The installation is successful, and the installation result is output.

本发明提供一种Python软件项目第三方库依赖自动化解析与安装方法,检测项目的配置文件并自动解析项目所需的所有第三方库以及最合适的版本范围,最后根据本地已安装的第三方库的情况来自动求解并给出当前项目所需的所有第三方库及其版本,并自动安装所有的版本,同时尽可能复用本地已安装的第三方库,最终达到节省用户安装项目所需的下载时间和安装时间以及减少硬盘空间使用。The invention provides an automatic analysis and installation method for third-party library dependencies of Python software projects, detects the configuration file of the project, automatically analyzes all third-party libraries required by the project and the most suitable version range, and finally according to the locally installed third-party libraries It can automatically solve and give all the third-party libraries and their versions required by the current project, and automatically install all versions, and reuse the locally installed third-party libraries as much as possible, so as to save the user's need for installing the project. Download time and installation time and reduce hard disk space usage.

Claims (5)

1.Python项目第三方库依赖自动化解析与安装方法,其特征在于包括如下步骤:1. The third-party library dependency automatic analysis and installation method of the Python project is characterized in that it comprises the following steps: 步骤1:获取Python生态社区中所有第三方库的详细信息,包括库名、版本和其所有所需的直接依赖,构建本地知识库;Step 1: Obtain the detailed information of all third-party libraries in the Python ecological community, including the library name, version and all its required direct dependencies, and build a local knowledge base; 步骤2:获取Python项目的依赖配置文件,setup.py或者reqiurements.txt;Step 2: Get the dependency configuration file of the Python project, setup.py or requirements.txt; 步骤3:构建项目的完全依赖树,生成SMT表达式并求解约束范围;Step 3: Build the complete dependency tree of the project, generate the SMT expression and solve the constraint range; 步骤4:根据本地环境中已安装的第三方库来优化已经生成的SMT表达式;Step 4: Optimize the generated SMT expression according to the third-party library installed in the local environment; 步骤5:经过步骤4中的优化操作后,获取最终的SMT表达式,然后求解,获取Python项目所需的所有第三方库,其版本为满足版本约束范围内的最新版本,输出安装脚本;Step 5: After the optimization operation in Step 4, obtain the final SMT expression, and then solve it to obtain all the third-party libraries required by the Python project, whose version is the latest version within the range of the version constraints, and output the installation script; 步骤6:对于步骤5中的安装脚本,依次安装其中的所有第三方依赖到项目所在的本地环境中,如存在可复用的第三方库,则使用软连接的方式,链接到项目所在的环境中。Step 6: For the installation script in Step 5, install all the third-party dependencies in the local environment where the project is located in turn. If there is a reusable third-party library, use a soft link to link to the environment where the project is located. middle. 2.如权利要求1所述Python项目第三方库依赖自动化解析与安装方法,其特征在于在步骤1中,所述构建本地知识库的步骤为:2. the third-party library of Python project as claimed in claim 1 relies on automatic analysis and installation method, it is characterized in that in step 1, the described step of building local knowledge base is: 步骤1.1:获取Python生态社区所有的第三方库;Step 1.1: Obtain all third-party libraries of the Python ecological community; 访问PyPI提供的API,获取Python生态社区中的每一个第三方库的名字和版本列表,然后,对于每一个版本,通过命令“pip install package_name–no-deps”下载到本地环境中;Access the API provided by PyPI to obtain the name and version list of each third-party library in the Python ecological community, and then, for each version, download it to the local environment through the command "pip install package_name-no-deps"; 步骤1.2:解析每一个库版本的依赖信息;Step 1.2: Parse the dependency information of each library version; 通过步骤1.1中的命令下载一个第三方库以后,解析其setup.py文件,获取该库的完整名和版本号以及该库的所有直接依赖的其他第三方库的完整名和版本号信息,将以上4类信息分别存入数据库表package_req中,4列分别为package_name,package_version,package_req_name,package_req_version;After downloading a third-party library through the command in step 1.1, parse its setup.py file to obtain the full name and version number of the library and the full name and version number information of all other third-party libraries directly dependent on the library. The class information is stored in the database table package_req respectively, and the 4 columns are package_name, package_version, package_req_name, package_req_version; 步骤1.3:将数据重新编号形成本地知识库;Step 1.3: Renumber the data to form a local knowledge base; 由于SMT约束求解器只支持数字范围求解不支持版本号格式(例如0.0.1),因此需要将数据库中的数据项重新编号,每一个库的每一个版本对应一个唯一id,且id编号按照版本号从小到大依次排列;最后形成本地知识库文件,存储格式为Json文件。Since the SMT constraint solver only supports numerical range solving and does not support the version number format (such as 0.0.1), it is necessary to renumber the data items in the database. Each version of each library corresponds to a unique id, and the id number is based on the version. The numbers are arranged in order from small to large; finally, a local knowledge base file is formed, and the storage format is a Json file. 3.如权利要求1所述Python项目第三方库依赖自动化解析与安装方法,其特征在于在步骤3中,所述构建项目的完全依赖树,生成SMT表达式并求解约束范围的具体步骤为:3. the third-party library of Python project as claimed in claim 1 relies on automatic analysis and installation method, it is characterized in that in step 3, the complete dependency tree of described construction project, the concrete steps that generate SMT expression and solve constraint scope are: 步骤3.1:解析项目直接依赖库;Step 3.1: Parse the project's direct dependency library; 对步骤2中获取的依赖配置文件进行解析,获取到该配置文件后,通过步骤1.2的方法解析setup.py文件或直接读取requirements.txt来获取Python项目的所有所需的直接依赖库的信息;按照pip默认广度优先的解析策略依次解析项目的每一个直接依赖库,获取所需的版本约束范围;Parse the dependency configuration file obtained in step 2. After obtaining the configuration file, use the method in step 1.2 to parse the setup.py file or directly read the requirements.txt to obtain all the required information about the directly dependent libraries of the Python project. ;According to pip's default breadth-first parsing strategy, parse each directly dependent library of the project in turn to obtain the required version constraint range; 步骤3.2:在知识库中获取直接依赖库的可满足版本列表;Step 3.2: Obtain the satisfiable version list of the directly dependent library in the knowledge base; 在步骤3.1中获取项目的所有直接依赖库的版本约束范围后,转换成id列表在本地知识库中检索获取的当前库的符合版本约束范围的所有版本;After obtaining the version constraint range of all directly dependent libraries of the project in step 3.1, convert it into an id list and retrieve all versions of the current library that conform to the version constraint range obtained in the local knowledge base; 步骤3.3:解析步骤3.2中的每一个版本,获取其子依赖库的信息,包括名和版本约束范围;Step 3.3: Analyze each version in Step 3.2 to obtain information about its sub-dependent libraries, including name and version constraint range; 步骤3.4:使用深度优先遍历算法重复上述步骤3.2~步骤3.3,直到Python项目的整个完全依赖树构建完成,该完全依赖树包含当前项目所有所需的所有依赖库及其可行所有的版本;Step 3.4: Use the depth-first traversal algorithm to repeat the above steps 3.2 to 3.3 until the entire complete dependency tree of the Python project is constructed, and the complete dependency tree contains all the required libraries and all feasible versions of the current project; 步骤3.5:根据步骤3.4中的完全依赖树生成SMT表达式;Step 3.5: Generate SMT expressions according to the complete dependency tree in step 3.4; 将步骤3.4完全依赖树中的每一个依赖库及其版本转换成本地知识库中对应的唯一id,同时也将对该库的版本约束范围转换成id的范围,形成SMT表达式;SMT表达式是仅支持数值类型进行比较;其中每一个库的多个版本之间为OR的关系,多个库之间为AND关系,最终形成基于完全依赖树的SMT表达式;Convert each dependency library and its version in the complete dependency tree in step 3.4 into the corresponding unique id in the local knowledge base, and also convert the version constraint range of the library into the id range to form an SMT expression; SMT expression It only supports numeric types for comparison; the OR relationship between multiple versions of each library, and the AND relationship between multiple libraries, finally forms an SMT expression based on a complete dependency tree; 步骤3.6:使用约束求解工具Z3求解SMT表达式,得出每一个依赖库的可满足版本约束范围。Step 3.6: Use the constraint solving tool Z3 to solve the SMT expression, and obtain the satisfiable version constraint range of each dependent library. 4.如权利要求1所述Python项目第三方库依赖自动化解析与安装方法,其特征在于在步骤4中,所述根据本地环境中已安装的第三方库来优化已经生成的SMT表达式,具体步骤如下:4. the third-party library of Python project as claimed in claim 1 relies on automatic analysis and installation method, it is characterized in that in step 4, described according to the third-party library installed in the local environment to optimize the generated SMT expression, concrete Proceed as follows: 步骤4.1:获取本地环境中已安装的第三方库列表package_list;Step 4.1: Get the list of installed third-party libraries package_list in the local environment; 步骤4.2:对于package_list中的每一个第三方库的每一个版本,从高版本到低版本依次加入步骤3中的SMT表达式,使用约束求解器判断是否满足;Step 4.2: For each version of each third-party library in the package_list, add the SMT expression in step 3 in turn from the higher version to the lower version, and use the constraint solver to determine whether it is satisfied; 步骤4.3:若满足,则证明当前版本符合SMT约束范围,可以被复用,所以保留;Step 4.3: If it is satisfied, it proves that the current version complies with the SMT constraints and can be reused, so keep it; 步骤4.4:若不满足,则回滚SMT表达式的状态,然后继续加入下一个版本,直到SMT表达式中出现过的所有包都被遍历一遍则停止。Step 4.4: If it is not satisfied, roll back the state of the SMT expression, and then continue to add the next version, and stop until all the packages that appear in the SMT expression have been traversed once. 5.如权利要求1所述Python项目第三方库依赖自动化解析与安装方法,其特征在于在步骤6中,具体步骤如下:5. the third-party library of Python project as claimed in claim 1 relies on automatic analysis and installation method, it is characterized in that in step 6, concrete steps are as follows: 对于步骤5中安装脚本的每一条记录,首先索引本地仓库是否存在该库的该版本,若存在则直接创建软连接,在Linux中使用ln-s,在Windows中使用mklink,最终将所有的包索引到当前项目所在的虚拟环境中;若该版本不存在与本地仓库中,则使用pip安装命令pipinstall package==version–no-deps安装该库的特定版本到本地仓库中,然后创建软连接到当前虚拟环境中。For each record of the installation script in step 5, first index whether the version of the library exists in the local warehouse, and if so, create a soft link directly, use ln-s in Linux, use mklink in Windows, and finally all packages Index into the virtual environment where the current project is located; if the version does not exist in the local warehouse, use the pip installation command pipinstall package==version-no-deps to install a specific version of the library into the local warehouse, and then create a soft link to in the current virtual environment.
CN202210554316.XA 2022-05-20 2022-05-20 Python project third-party library dependency automatic analysis and installation method Active CN114780109B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210554316.XA CN114780109B (en) 2022-05-20 2022-05-20 Python project third-party library dependency automatic analysis and installation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210554316.XA CN114780109B (en) 2022-05-20 2022-05-20 Python project third-party library dependency automatic analysis and installation method

Publications (2)

Publication Number Publication Date
CN114780109A true CN114780109A (en) 2022-07-22
CN114780109B CN114780109B (en) 2024-06-04

Family

ID=82408944

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210554316.XA Active CN114780109B (en) 2022-05-20 2022-05-20 Python project third-party library dependency automatic analysis and installation method

Country Status (1)

Country Link
CN (1) CN114780109B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115129360A (en) * 2022-07-27 2022-09-30 北京自如信息科技有限公司 Code file management method and device, electronic equipment and storage medium
CN115543294A (en) * 2022-12-06 2022-12-30 麒麟软件有限公司 A method for generating a visual dependency tree of a dynamic link library on a Linux system
CN115934106A (en) * 2023-03-14 2023-04-07 麒麟软件有限公司 Method for rapidly detecting apt warehouse source dependence integrity
CN118550546A (en) * 2024-07-26 2024-08-27 南京航空航天大学 A Python project dependency conflict detection and resolution method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017134665A1 (en) * 2016-02-03 2017-08-10 Cocycles System for organizing, functionality indexing and constructing of a source code search engine and method thereof
CN107704256A (en) * 2017-10-11 2018-02-16 成都知道创宇信息技术有限公司 The method that Python relies on system library automation installation is realized on a kind of Ubuntu
CN109446066A (en) * 2018-09-20 2019-03-08 北京大学 The static detection method and system of unreachable code in C/C++ program
EP3454213A1 (en) * 2017-09-08 2019-03-13 Accenture Global Solutions Limited Function library build architecture for serverless execution frameworks
CN111124454A (en) * 2019-12-25 2020-05-08 南京医康科技有限公司 Mirror image construction method and device, electronic equipment and storage medium
CN112631607A (en) * 2020-12-31 2021-04-09 东北大学 Method for detecting dependency conflict in python environment
WO2021113316A1 (en) * 2019-12-04 2021-06-10 Oracle International Corporation Inferring intra package and module dependencies

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017134665A1 (en) * 2016-02-03 2017-08-10 Cocycles System for organizing, functionality indexing and constructing of a source code search engine and method thereof
EP3454213A1 (en) * 2017-09-08 2019-03-13 Accenture Global Solutions Limited Function library build architecture for serverless execution frameworks
CN107704256A (en) * 2017-10-11 2018-02-16 成都知道创宇信息技术有限公司 The method that Python relies on system library automation installation is realized on a kind of Ubuntu
CN109446066A (en) * 2018-09-20 2019-03-08 北京大学 The static detection method and system of unreachable code in C/C++ program
WO2021113316A1 (en) * 2019-12-04 2021-06-10 Oracle International Corporation Inferring intra package and module dependencies
CN111124454A (en) * 2019-12-25 2020-05-08 南京医康科技有限公司 Mirror image construction method and device, electronic equipment and storage medium
CN112631607A (en) * 2020-12-31 2021-04-09 东北大学 Method for detecting dependency conflict in python environment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
何春燕;王超宇;: "基于python+pandas的数据分析处理应用", 数码世界, no. 07, 1 July 2018 (2018-07-01) *
徐立新;雷相波;: "应用Maven管理项目", 电脑知识与技术, no. 10, 5 April 2010 (2010-04-05) *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115129360A (en) * 2022-07-27 2022-09-30 北京自如信息科技有限公司 Code file management method and device, electronic equipment and storage medium
CN115543294A (en) * 2022-12-06 2022-12-30 麒麟软件有限公司 A method for generating a visual dependency tree of a dynamic link library on a Linux system
CN115543294B (en) * 2022-12-06 2023-03-17 麒麟软件有限公司 Method for generating visual dependency tree of dynamic link library on Linux system
CN115934106A (en) * 2023-03-14 2023-04-07 麒麟软件有限公司 Method for rapidly detecting apt warehouse source dependence integrity
CN115934106B (en) * 2023-03-14 2023-06-02 麒麟软件有限公司 Method for rapidly detecting source dependency integrity of apt warehouse
CN118550546A (en) * 2024-07-26 2024-08-27 南京航空航天大学 A Python project dependency conflict detection and resolution method and device

Also Published As

Publication number Publication date
CN114780109B (en) 2024-06-04

Similar Documents

Publication Publication Date Title
US20230014739A1 (en) Matching metastructure for data modeling
US20230244465A1 (en) Systems and methods for automated retrofitting of customized code objects
CN114780109B (en) Python project third-party library dependency automatic analysis and installation method
US9830341B2 (en) Resource name generation and derivation utilizing attribute space monikers and their associated context
US9465590B2 (en) Code generation framework for application program interface for model
US10067957B1 (en) Process for serializing and deserializing data described by a schema
CN113360156B (en) An IOS compilation method and related equipment
US10666744B2 (en) Managing discovery and selection of service interface specifications
CN118202330A (en) Checking source code validity at code update
US20210026756A1 (en) Deriving software application dependency trees for white-box testing
CN102279750A (en) Iterative code generation method based on domain knowledge sharing
CN113901083A (en) Heterogeneous data source operation resource analysis positioning method and equipment based on multiple analyzers
CN114356964A (en) Data lineage construction method, device, storage medium and electronic device
CN114138748A (en) Database mapping file generation method, device, equipment and storage medium
US20230113783A1 (en) Cross-platform code conversion method and device
WO2021022703A1 (en) Software project reconstruction method and device, and computer device and storage medium
CN112650526A (en) Version consistency detection method and device, electronic equipment and medium
US7490098B2 (en) Apparatus, system, and method for processing hierarchical data in disparate data repositories
US20200097260A1 (en) Software application developer tools platform
CN114816364A (en) Method, device and application for dynamically generating template file based on Swagger
CN112698819A (en) Method, device and storage medium for designing tree-oriented object programming program
CN111723104B (en) Method, device and system for analyzing grammar in data processing system
US12093686B2 (en) Code maintenance system
CN110321282A (en) The XML configuration file amending method and system of Mock test
CN115794858A (en) Query statement processing method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant