CN111538495B - Method, system and equipment for identifying Python open source component quoted in project - Google Patents

Method, system and equipment for identifying Python open source component quoted in project Download PDF

Info

Publication number
CN111538495B
CN111538495B CN202010667719.6A CN202010667719A CN111538495B CN 111538495 B CN111538495 B CN 111538495B CN 202010667719 A CN202010667719 A CN 202010667719A CN 111538495 B CN111538495 B CN 111538495B
Authority
CN
China
Prior art keywords
suspected
result set
dependent component
python
component result
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.)
Active
Application number
CN202010667719.6A
Other languages
Chinese (zh)
Other versions
CN111538495A (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.)
Shenzhen Kaiyuan Internet Security Technology Co Ltd
Original Assignee
Shenzhen Kaiyuan Internet Security Technology Co Ltd
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 Shenzhen Kaiyuan Internet Security Technology Co Ltd filed Critical Shenzhen Kaiyuan Internet Security Technology Co Ltd
Priority to CN202010667719.6A priority Critical patent/CN111538495B/en
Publication of CN111538495A publication Critical patent/CN111538495A/en
Application granted granted Critical
Publication of CN111538495B publication Critical patent/CN111538495B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Tests Of Electronic Circuits (AREA)

Abstract

The invention provides a method, a system, equipment and a storage medium for identifying a Python open source component quoted in a project, wherein the method comprises the following steps: analyzing the items to obtain a first suspected dependent component result set, and comparing the first suspected dependent component result set with a Python standard library to obtain a second suspected dependent component result set; comparing the second suspected dependent component result set with a Python mapping library to obtain a third suspected dependent component result set; scanning configuration files of items and component information of a virtual environment; and if the result sets are not scanned, comparing the third suspected dependent component result set with a Python version library to obtain a first dependent component result set, and if the result sets are scanned to obtain a fourth suspected dependent component result set of the configuration file and the virtual environment, comparing the third suspected dependent component result set with the fourth suspected dependent component result set to obtain the first dependent component result set. In the method, component detection is only carried out on the current project, and all directly and indirectly dependent components can be found.

Description

Method, system and equipment for identifying Python open source component quoted in project
Technical Field
The invention belongs to the technical field of computers, and particularly relates to a method, a system, equipment and a storage medium for identifying Python open source components quoted in projects.
Background
Due to the properties of the Python project, now the pip-owned freeze command mainly used by the Python component in the general analysis project generates requirements. The documents of requisition.txt have two defects, the first is that the component information in the documents only aims at the components in the current Python environment, but not at the project, so that the component information in the project is easy to appear, and the component information recorded in the second requisition.txt is only the components directly dependent on the first layer, and does not show the components indirectly dependent on the first layer, so that a plurality of components are easy to miss.
At present, there is no mature static scanning tool or method, and it is common practice to establish a separate Python virtual environment for the current project, then install the components needed by the project in this virtual environment, and then execute a command such as freeze to obtain a file like documents. The method does not count the components by mistake, but may miss some indirectly dependent components, and if a plurality of items exist, the maintenance and management of the environment are complex, the purity of each environment is ensured, and if other components which are not the same item are quoted in the current environment, the detection result may be the components which are not the same item.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: in view of the problems of the prior art, the present invention provides a method for identifying a Python open source component referenced in an item.
In a first aspect, an embodiment of the present application provides a method for identifying a Python open source component referenced in an item, where the method includes:
analyzing items to obtain a first suspected dependent component result set, and comparing the first suspected dependent component result set with a Python standard library to obtain a second suspected dependent component result set;
comparing the second suspected dependent component result set with a Python mapping library to obtain a third suspected dependent component result set;
scanning the configuration file of the project and the component information of the virtual environment;
and if the third suspected dependent component result set and the Python version library are not scanned, comparing the third suspected dependent component result set with the Python version library to obtain a first dependent component result set, and if the third suspected dependent component result set and a fourth suspected dependent component result set of the virtual environment are scanned, comparing the third suspected dependent component result set with the fourth suspected dependent component result set to obtain the first dependent component result set.
In a second aspect, an embodiment of the present application further provides a system for identifying a Python open source component referenced in an item, where the system includes:
a first comparison module: analyzing items to obtain a first suspected dependent component result set, and comparing the first suspected dependent component result set with a Python standard library to obtain a second suspected dependent component result set;
a second comparison module: comparing the second suspected dependent component result set with a Python mapping library to obtain a third suspected dependent component result set;
a scanning module: scanning the configuration file of the project and the component information of the virtual environment;
a generation module: and if the third suspected dependent component result set and the Python version library are not scanned, comparing the third suspected dependent component result set with the Python version library to obtain a first dependent component result set, and if the third suspected dependent component result set and a fourth suspected dependent component result set of the virtual environment are scanned, comparing the third suspected dependent component result set with the fourth suspected dependent component result set to obtain the first dependent component result set.
In a third aspect, an embodiment of the present application further provides an apparatus for identifying a Python open source component referenced in an item, where the apparatus includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the apparatus implements each step in the method for identifying a Python open source component referenced in an item according to the first aspect.
In a fourth aspect, the present application further provides a storage medium having a computer program stored thereon, where the computer program, when executed by a processor, implements the steps in the method for identifying a Python open source component referenced in an item according to the first aspect.
The method for identifying the Python open source component quoted in the project provided by the embodiment of the application comprises the following steps: analyzing items to obtain a first suspected dependent component result set, and comparing the first suspected dependent component result set with a Python standard library to obtain a second suspected dependent component result set; comparing the second suspected dependent component result set with a Python mapping library to obtain a third suspected dependent component result set; scanning the configuration file of the project and the component information of the virtual environment; and if the third suspected dependent component result set and the Python version library are not scanned, comparing the third suspected dependent component result set with the Python version library to obtain a first dependent component result set, and if the third suspected dependent component result set and a fourth suspected dependent component result set of the virtual environment are scanned, comparing the third suspected dependent component result set with the fourth suspected dependent component result set to obtain the first dependent component result set. In the method, component detection is only carried out on the current project, the local Python environment is not depended on, and all directly and indirectly dependent components can be found.
Drawings
The detailed structure of the invention is described in detail below with reference to the accompanying drawings
FIG. 1 is a flow chart illustrating a method of identifying Python open source components referenced in an item according to the present invention;
FIG. 2 is a sub-flow diagram of the method of the present invention for identifying a Python open source component referenced in an item;
FIG. 3 is another sub-flow diagram illustrating a method of the present invention for identifying a Python open source component referenced in an item;
FIG. 4 is another sub-flow diagram illustrating a method of the present invention for identifying a Python open source component referenced in an item;
FIG. 5 is another sub-flow diagram illustrating a method of the present invention for identifying a Python open source component referenced in an item;
FIG. 6 is a program module diagram of the method of the present invention for identifying a Python open source component referenced in an item.
Detailed Description
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, and not all the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart illustrating a method for identifying a Python open source component cited in an item in the present embodiment, where in the present embodiment, the method for identifying a Python open source component cited in an item includes:
step 101, analyzing the items to obtain a first suspected dependent component result set, and comparing the first suspected dependent component result set with a Python standard library to obtain a second suspected dependent component result set.
Firstly, analyzing codes in a project and adapting to the environment of the codes, wherein the analysis structure is a code from … import … and import …, the first case, such as from a import b, a behind from is regarded as a component, and of course, the structure can be a structure from a.b import c, and the processing is carried out to remove the following b, and special processing is carried out for similar cases; similarly, a is considered a component in the second case, for example, import a, and there are some special cases, for example, import a, b, and c, which are considered components. For the above two cases (from … import … and import …), the environment is adapted to the analysis, and the result set of the first suspected dependent component is obtained after the whole project is analyzed. And comparing the first suspected dependent component result set with a Python standard library to obtain a second suspected dependent component result set.
And 102, comparing the second suspected dependent component result set with a Python mapping library to obtain a third suspected dependent component result set.
And after the first suspected dependent component result set is compared with the Python standard library to obtain a second suspected dependent component result set, the second suspected dependent component result set is compared with the Python mapping library to obtain a third suspected dependent component result set.
Step 103, scanning the configuration file of the project and the component information of the virtual environment.
Some Python items have a tool or a command to generate configuration files such as requisitions.txt or the pipfile.lock, and when the items are scanned, the files are also scanned incidentally, and the component names and the version information of the components in the files are collected, because the configuration files may not have complete component information but can be put in the items, the configuration files are basically the real component information of the items, certain reference value is provided, and the determination of which components in a Python standard library exist is facilitated; scanning the virtual environment, a scanner is required to be constructed, and the scanner is used for traversing the specified directory, searching the name of the directory, and analyzing the corresponding component name and version information. If there is a separate virtual environment and the environment is clean, the scanner can be considered to be used to put the collected component name and version into the result set to be compared.
And 104, if neither of the two is scanned, comparing the third suspected dependent component result set with the Python version library to obtain a first dependent component result set, and if the scanning is performed to obtain a fourth suspected dependent component result set of a configuration file and a virtual environment, comparing the third suspected dependent component result set with the fourth suspected dependent component result set to obtain a first dependent component result set.
If no configuration file is scanned and no virtual environment exists, directly comparing the third suspected dependent component result set obtained in the step 102 with a Python version library to find out version information of components in the third suspected dependent component result set, and obtaining all indirect dependent components corresponding to the version information to obtain final data, namely a first dependent component result set; if the configuration file and the virtual environment are scanned, a scanned fourth suspected dependent component result set is obtained, the third suspected dependent component result set is compared with the fourth suspected dependent component result set, the same components in the third suspected dependent component result set and the fourth suspected dependent component result set are found, version information of the components in the fourth suspected dependent component result set is taken, all indirect dependent components are obtained, and final data, namely the first dependent component result set, is obtained.
The method for identifying the Python open source component quoted in the project provided by the embodiment of the application comprises the following steps: analyzing items to obtain a first suspected dependent component result set, and comparing the first suspected dependent component result set with a Python standard library to obtain a second suspected dependent component result set; comparing the second suspected dependent component result set with a Python mapping library to obtain a third suspected dependent component result set; scanning the configuration file of the project and the component information of the virtual environment; and if the third suspected dependent component result set and the Python version library are not scanned, comparing the third suspected dependent component result set with the Python version library to obtain a first dependent component result set, and if the third suspected dependent component result set and a fourth suspected dependent component result set of the virtual environment are scanned, comparing the third suspected dependent component result set with the fourth suspected dependent component result set to obtain the first dependent component result set. In the method, component detection is only carried out on the current project, the local Python environment is not depended on, and all directly and indirectly dependent components can be found.
Further, based on the above embodiment, in the preparation stage of the method, some basic data needs to be prepared for matching with the subsequent analysis and detection stage, the Python standard library is an internal library of Python itself, and the detection of the component generally does not include the internal library, in other words, the identification of the Python third-party component in the general project is an open-source component, rather than the Python itself, and the data of the Python standard library can be collected on the internet, and can also be maintained later. The Python mapping library is used for solving the problem that names referenced in the code are inconsistent with names of real components thereof, for example, there is a section of import all in the code, the meaning of the section of code is to reference the component of all, but the component name of the component of all is not all but all-level or level-all-adapter, and at this time, such a mapping library is needed, and data of the Python mapping library can be collected on the network, but real-time maintenance in the later period is also needed. The Python version library contains version information of Python components, such as names, versions, permissions and the like, and also contains dependency relationship data of the Python components, and the data of the version library is used for better identifying the Python components in the project and analyzing the dependency relationship among the Python components to help find all direct dependency components and indirect dependency components.
Further, based on the above embodiment, it is necessary to construct a file parser before adapting to the code environment and parsing the project, where the file parser functions to detect a file at the end of py in the project, so that after scanning the whole project's py file, a suspected Python component result set, that is, the first suspected dependent component result set, is obtained.
Further, based on the foregoing embodiment, referring to fig. 2, fig. 2 is a sub-flowchart of a method for identifying a Python open source component cited in an item in the embodiment of the present application, in this embodiment, the step 102 of comparing the first dependent component result set with the Python standard library includes:
step 201, comparing the first suspected dependent component result set with the Python standard library;
step 202, a component in the first suspected dependent component result set with the same directory name as that in the Python standard library is called a second suspected dependent component result set, and a component in the first suspected dependent component result set with a different directory name from that in the Python standard library is called a fifth suspected dependent component result set.
Specifically, after the first suspected dependent component result set is obtained, the result set is compared with a Python standard library, all directories of the current item are traversed to obtain all directory names, and if the directory names exist in the result set, the components are possibly self-defined components of the referenced current item, but not components of a third party open source. And calling the component with the same component name in the first suspected dependent component result set and the component with the same component name in the Python standard library as a second suspected dependent component result set, and calling the component with the component name in the first suspected dependent component result set and the component with the same component name in the Python standard library as a fifth suspected dependent component result set.
Further, based on the embodiment, fig. 3 is another sub-flow diagram of a method for identifying a Python open source component cited in an item in the embodiment of the present application, including:
step 301, comparing the component name in the second suspected dependent component result set with the Python mapping library;
step 302, converting the data in the second suspected dependency component result set existing in the Python mapping library into a component in a second suspected dependency component, so as to obtain a third suspected dependency component result set.
Specifically, the first suspected dependent component result set is compared with a Python standard library to obtain a second suspected dependent component result set, and the second suspected dependent component result set is compared with a Python mapping library, where the Python mapping library is used to solve the problem that the name referred in the code is not consistent with the name of the real component, and convert data possibly existing in the Python mapping library in the second suspected dependent component to obtain a third suspected dependent component result set. Where the data transformation in the Python mapping library, for example, the component name in the code is xmlenc, but is actually pysall 2, such as xmpp: xmppy, such a mapping library is needed at this time.
Further, based on the embodiment, fig. 4 is another sub-flow diagram of a method for identifying a Python open source component cited in an item in the embodiment of the present application, including:
step 401, calling the latest version of the component in the third suspected dependent component result set from the Python version library;
step 402, finding out dependent component information corresponding to the components in the third suspected dependent component result set to obtain the first dependent component result set.
And if the configuration file and the virtual environment are not scanned, comparing a third suspected dependent component result set with the Python version library to obtain a first dependent component result set, finding out the latest version information of the components in the third suspected dependent component result set in the Python version library, finding out the dependency relationship of the latest version of the components in the third suspected dependent component result set, and obtaining the first dependent component result set. Because there is no configuration file, if we analyze from the source code alone, we can't obtain the version information of the assembly, and because the concept of Python to the version is not strong, so will adopt the latest version number of the assembly. This is the same as the construction of the Python project, and when installing a Python component, if no version is specified, the latest version will be installed by default.
Further, according to an embodiment, fig. 5 is another sub-flow diagram of a method for identifying an open source component cited in an item in an embodiment of the present application, including:
step 501, finding out components with the same name in the third suspected component result set and the fourth suspected dependent component result set, and taking version information of the components in the fourth suspected dependent component result set;
step 502, finding out dependent component information corresponding to the component in the fourth suspected dependent component result set to obtain the first dependent component result set.
Scanning the configuration file and the virtual environment, if the configuration file and the virtual environment are scanned to obtain a fourth suspected dependent component result set of the configuration file and the virtual environment, comparing the third suspected dependent component result set with the fourth suspected dependent component result set to obtain a first dependent component result set, wherein when the third suspected dependent component result set is compared with the fourth suspected dependent component result set, finding out components with the same names in the third suspected dependent component result set and the fourth suspected dependent component result set, and taking the version of the fourth suspected dependent component result set as the version of the components in the third suspected dependent component result set, wherein the version information of the components in the third suspected dependent component result set and the version information of the fourth suspected dependent component are not embodied in the configuration file and are default use latest versions.
Further, obtaining a third dependent component result set includes constructing a management display maintenance system, further converting the suspected dependent component result set into a confirmed dependent component result set, where there may still be a batch of data in the third suspected dependent component result set that does not find data in the Python version library (possibly the Python version library data is not up-to-date or for other reasons), and putting the remaining data into a sixth suspected component result set, where the first dependent component result set is a confirmed component, and the fifth suspected component result set and the sixth suspected component result set are suspected possible components, and in the management maintenance system, the suspected component result and the confirmed component are divided into two sides for placement, and the component to be confirmed can be set into a confirmed component list through setting.
Further, an embodiment of the present application further provides a device 600 that references a Python open source component in an identification item, referring to fig. 4, where fig. 4 is a schematic diagram of a device module that references a Python open source component in an identification item in an embodiment of the present application, and in this embodiment, the device 600 that references a Python open source component in an identification item includes:
the first comparison module 601: analyzing items to obtain a first suspected dependent component result set, and comparing the first suspected dependent component result set with a Python standard library to obtain a second suspected dependent component result set;
the second comparison module 602: comparing the second suspected dependent component result set with a Python mapping library to obtain a third suspected dependent component result set;
the scanning module 603: scanning the configuration file of the project and the component information of the virtual environment;
the generation module 604: and if the third suspected dependent component result set and the Python version library are not scanned, comparing the third suspected dependent component result set with the Python version library to obtain a first dependent component result set, and if the third suspected dependent component result set and a fourth suspected dependent component result set of the virtual environment are scanned, comparing the third suspected dependent component result set with the fourth suspected dependent component result set to obtain the first dependent component result set.
The device 600 for identifying the Python open source component cited in the project provided by the embodiment of the application can realize that: analyzing items to obtain a first suspected dependent component result set, and comparing the first suspected dependent component result set with a Python standard library to obtain a second suspected dependent component result set; comparing the second suspected dependent component result set with a Python mapping library to obtain a third suspected dependent component result set; scanning the configuration file of the project and the component information of the virtual environment, wherein the component information at least comprises a component name and a version; and if the third suspected dependent component result set and the Python version library are not scanned, comparing the third suspected dependent component result set with the Python version library to obtain a first dependent component result set, and if the third suspected dependent component result set and a fourth suspected dependent component result set of the virtual environment are scanned, comparing the third suspected dependent component result set with the fourth suspected dependent component result set to obtain the first dependent component result set. In the method, component detection is only carried out on the current project, the local Python environment is not depended on, and all directly and indirectly dependent components can be found.
Further, the present application also provides an apparatus for identifying a Python open source component referenced in an item, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps in the above method for identifying a Python open source component referenced in an item when executing the computer program.
Further, the present application also provides a storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of identifying a Python open source component as referred to in the above item.
Each functional module in the embodiments of the present invention may be integrated into one processing module, or each module may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a separate product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It should be noted that, for the sake of simplicity, the above-mentioned method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present invention is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no acts or modules are necessarily required of the invention.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the above description of the method, system, device and storage medium for identifying Python open source components as cited in the item of identification provided by the present invention, those skilled in the art may change the specific implementation and application scope according to the idea of the embodiment of the present application, and in summary, the content of the present specification should not be construed as limiting the present invention.

Claims (10)

1. A method of identifying a Python open source component referenced in an item, the method comprising:
analyzing items to obtain a first suspected dependent component result set, and comparing the first suspected dependent component result set with a Python standard library to obtain a second suspected dependent component result set;
comparing the second suspected dependent component result set with a Python mapping library to obtain a third suspected dependent component result set;
scanning the configuration file of the project and the component information of the virtual environment, wherein the component information at least comprises a component name and a version;
and if the third suspected dependent component result set and the Python version library are not scanned, comparing the third suspected dependent component result set with the Python version library to obtain a first dependent component result set, and if the third suspected dependent component result set and a fourth suspected dependent component result set of the virtual environment are scanned, comparing the third suspected dependent component result set with the fourth suspected dependent component result set to obtain the first dependent component result set.
2. The method of claim 1, wherein parsing the item comprises:
and constructing a file parser, and parsing codes in the project line by line.
3. The method of claim 2 wherein comparing the first set of suspected dependent component results to the Python standard library to obtain a second set of suspected dependent component results comprises:
comparing the first suspected dependent component result set with the Python standard library;
and calling the components with the same names in the first suspected dependent component result set and the Python standard library as a second suspected dependent component result set, and calling the components with different names in the first suspected dependent component result set and the Python standard library as a fifth suspected dependent component result set.
4. The method of claim 3 wherein comparing the second set of suspected dependent component results to a Python mapping library to obtain a third set of suspected dependent component results comprises:
comparing the component name in the second suspected dependent component result set with the Python mapping library;
and converting the data in the second suspected dependency component result set, which exists in the Python mapping library, into components in a second suspected dependency component to obtain a third suspected dependency component result set, wherein a real component name corresponding to a code reference name in the second suspected dependency component result set exists in the Python mapping library.
5. The method of claim 4, wherein comparing the third suspected dependent component result set to the Python version library if neither is scanned comprises:
calling a latest version of the component in the third suspected dependent component result set from the Python version library;
and finding out the dependent component information corresponding to the components in the third suspected dependent component result set to obtain the first dependent component result set.
6. The method of claim 5, wherein if the scanning results in a fourth set of suspected dependent component results for the configuration file and the virtual environment, comparing the third set of suspected dependent component results with the fourth set of suspected dependent component results to obtain a first set of dependent component results comprises:
finding out the components with the same names in the third suspected component result set and the fourth suspected dependent component result set, and taking the version information of the components with the same names in the fourth suspected dependent component result set;
and finding out the dependent component information corresponding to the same component in the fourth suspected dependent component result set to obtain the first dependent component result set.
7. The method of claim 6, wherein said obtaining a first dependent component result set further comprises:
and constructing a management display maintenance system, and further converting the suspected dependent component result set into a confirmed dependent component result set.
8. A system for identifying a Python open source component referenced in an item, the system comprising:
a first comparison module: analyzing items to obtain a first suspected dependent component result set, and comparing the first suspected dependent component result set with a Python standard library to obtain a second suspected dependent component result set;
a second comparison module: comparing the second suspected dependent component result set with a Python mapping library to obtain a third suspected dependent component result set;
a scanning module: scanning the configuration file of the project and the component information of the virtual environment;
a generation module: and if the third suspected dependent component result set and the Python version library are not scanned, comparing the third suspected dependent component result set with the Python version library to obtain a first dependent component result set, and if the third suspected dependent component result set and a fourth suspected dependent component result set of the virtual environment are scanned, comparing the third suspected dependent component result set with the fourth suspected dependent component result set to obtain the first dependent component result set.
9. An apparatus for identifying a Python open source component referenced in an item, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, performs the steps of the method for identifying a Python open source component referenced in an item as claimed in any one of claims 1 to 7.
10. A storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the method of identifying a Python open source component for a reference in an item according to any one of claims 1 to 7.
CN202010667719.6A 2020-07-13 2020-07-13 Method, system and equipment for identifying Python open source component quoted in project Active CN111538495B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010667719.6A CN111538495B (en) 2020-07-13 2020-07-13 Method, system and equipment for identifying Python open source component quoted in project

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010667719.6A CN111538495B (en) 2020-07-13 2020-07-13 Method, system and equipment for identifying Python open source component quoted in project

Publications (2)

Publication Number Publication Date
CN111538495A CN111538495A (en) 2020-08-14
CN111538495B true CN111538495B (en) 2020-10-23

Family

ID=71978358

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010667719.6A Active CN111538495B (en) 2020-07-13 2020-07-13 Method, system and equipment for identifying Python open source component quoted in project

Country Status (1)

Country Link
CN (1) CN111538495B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112711438B (en) * 2021-01-13 2024-04-16 苏州棱镜七彩信息科技有限公司 Method, apparatus and computer readable storage medium for extracting dependency component information
CN117668327A (en) * 2024-02-02 2024-03-08 深圳开源互联网安全技术有限公司 Component identification method, device, terminal equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107168876A (en) * 2017-05-15 2017-09-15 杭州时趣信息技术有限公司 A kind of method and device of static code detection
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
CN107885501A (en) * 2017-11-03 2018-04-06 武汉斗鱼网络科技有限公司 Obtain the method and device of the mutual adduction relationship of component in Android
CN109491661A (en) * 2018-10-24 2019-03-19 武汉思普崚技术有限公司 Universal cross Compilation Method and equipment
CN110764776A (en) * 2019-09-24 2020-02-07 中信百信银行股份有限公司 Dependent component management and control method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9207920B2 (en) * 2013-05-30 2015-12-08 Veracode, Inc. Systems and methods for remote analysis of software applications
US10255064B2 (en) * 2016-06-24 2019-04-09 Vmware, Inc. Upgrade analysis of a computer system
CN106295343B (en) * 2016-08-24 2019-03-12 北京奇虎测腾安全技术有限公司 A kind of source code distributed detection system and method based on serializing intermediate representation
CN110647324B (en) * 2019-09-18 2023-05-16 编缘(杭州)教育科技有限公司 Python and Scratch interactive programming method and electronic device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107168876A (en) * 2017-05-15 2017-09-15 杭州时趣信息技术有限公司 A kind of method and device of static code detection
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
CN107885501A (en) * 2017-11-03 2018-04-06 武汉斗鱼网络科技有限公司 Obtain the method and device of the mutual adduction relationship of component in Android
CN109491661A (en) * 2018-10-24 2019-03-19 武汉思普崚技术有限公司 Universal cross Compilation Method and equipment
CN110764776A (en) * 2019-09-24 2020-02-07 中信百信银行股份有限公司 Dependent component management and control method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"查找python项目依赖并生成requirements.txt";weixin_34068198;《CSDN https://blog.csdn.net/weixin_34068198/article/details/88882101》;20180207;第1-2页 *

Also Published As

Publication number Publication date
CN111538495A (en) 2020-08-14

Similar Documents

Publication Publication Date Title
US9015214B2 (en) Process of generating a list of files added, changed, or deleted of a file server
US20070011142A1 (en) Method and apparatus for non-redundant search results
US9026901B2 (en) Viewing annotations across multiple applications
US11734427B2 (en) Systems, methods and devices for memory analysis and visualization
US20120078859A1 (en) Systems and methods to update a content store associated with a search index
CN111538495B (en) Method, system and equipment for identifying Python open source component quoted in project
US20080091708A1 (en) Enhanced Detection of Search Engine Spam
US20180341695A1 (en) Method to estimate the deletability of data objects
CN111258614B (en) Method, system, equipment and storage medium for detecting upgrade exception of project third-party library
US10503603B2 (en) Incremental data conversion using a synchronization information record
CN113448935A (en) Method, electronic device and computer program product for providing log information
Bellini et al. Metadata quality assessment tool for open access cultural heritage institutional repositories
CN109460363B (en) Automatic testing method and device, electronic equipment and computer readable medium
US20200334208A1 (en) Rule-based collections of subset(s) of metadata in response to a trigger event occurring
CN110347573B (en) Application program analysis method, device, electronic equipment and computer readable medium
Raghavan A framework for identifying associations in digital evidence using metadata
US9734195B1 (en) Automated data flow tracking
US20230229652A1 (en) Merging and unmerging entity representations via resolver trees
US10394761B1 (en) Systems and methods for analyzing and storing network relationships
CN115344755A (en) Data constraint condition recommendation method and system in data standard
US11500886B2 (en) Finding locations of tabular data across systems
SalahEldeen et al. Reading the correct history? Modeling temporal intention in resource sharing
Kwon et al. A vulnerability assessment tool based on oval in linux system
Booker Data Carving Against Known File Obfuscation Techniques: A Proposed Data Carving Algorithm
CN117931675A (en) Open source license detection method, electronic device, medium and computer program product

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