Method, apparatus, device, and medium for generating knowledge graph of project
Patent Information
- Authority / Receiving Office
- EP · EP
- Patent Type
- Applications
- Current Assignee / Owner
- SIEMENS AG
- Filing Date
- 2023-09-26
- Publication Date
- 2026-07-01
Smart Images

Figure CN2023121695_03042025_PF_FP_ABST
Abstract
Description
Method, apparatus, device, and medium for generating knowledge graph of projectFIELD
[0001] The present invention relates to the technical field of knowledge graph, in particular to a method, apparatus, device, and medium for generating knowledge graph of project.BACKGROUND
[0002] BitBake is an automated tool program for software building, which, like other building tools, can build systems and address build dependencies. Unlike single function engineering management tools such as make, BitBake collects and manages description files without dependencies, and then automatically builds them in the correct order.
[0003] Currently, in building Linux distributions, main building tools (such as Yocto, ISAR, etc. ) are all based on BitBake. BitBake is a task execution engine for open-source software. However, in BitBake-based built projects, the relationships between various metadata objects such as layers, recipes, and build parameters are complex and difficult to manage.SUMMARY
[0004] Embodiments of the present invention propose a method, apparatus, device, and medium for generating knowledge graph of project.
[0005] In a first aspect, a method for generating knowledge graph of project is provided. The method comprising:
[0006] acquiring a first project based on BitBake built by a build system;
[0007] extracting metadata objects of the first project and relationships between the metadata objects of the first project from a first configuration file of the first project;
[0008] generating a knowledge graph of the first project based on the metadata objects of the first project and the relationships between the metadata objects of the first project.
[0009] In a second aspect, an apparatus for generating knowledge graph of project is provided. The apparatus comprising:
[0010] an acquiring module, configured to acquire a first project based on BitBake built by a build system;
[0011] an extracting module, configured to extract metadata objects of the first project and relationships between the metadata objects of the first project from a first configuration file of the first project;
[0012] a generating module, configured to generate a knowledge graph of the first project based on the metadata objects of the first project and the relationships between the metadata objects of the first project.
[0013] In a third aspect, an electronic device is provided. The electronic device comprising a processor and a memory, wherein an application program executable by the processor is stored in the memory for causing the processor to execute a method for generating knowledge graph of project as described in any of the above.
[0014] In a fourth aspect, a computer-readable medium comprising computer-readable instructions stored thereon is provided, wherein the computer-readable instructions, when executed by a processor, implement a method for generating knowledge graph of project as described in any of the above.
[0015] In a fifth aspect, a computer program product comprising a computer program, when the computer program is executed by a processor for executing a method for generating knowledge graph of project as described in any of the above.
[0016] According to the above technical solutions, embodiments of the present invention propose a method for generating knowledge graph containing metadata objects of a project based on BitBake and relationships between these metadata objects, which facilitates users to intuitively discover relationships between metadata objects and improves analysis efficiency. In addition, not only configuration files in the project are utilized, but also the metadata objects and relationships in other configuration files obtained during target image generation process of the project are used to generate the knowledge graph, ensuring the integrity of metadata objects and relationships between them in the knowledge graph, which is beneficial for users to comprehensively understand and query project information based on knowledge graphs, improving analysis efficiency.BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to make technical solutions of examples of the present disclosure clearer, accompanying drawings to be used in description of the examples will be simply introduced hereinafter. Obviously, the accompanying drawings to be described hereinafter are only some examples of the present disclosure. Those skilled in the art may obtain other drawings according to these accompanying drawings without creative labor.
[0018] Fig. 1 is an exemplary flowchart of a method for generating knowledge graph of a project according to an embodiment of the present invention.
[0019] Fig. 2 is a schematic diagram of an exemplary process for generating knowledge graph of a project according to an embodiment of the present invention.
[0020] Fig. 3 is an exemplary system architecture diagram for generating knowledge graph of a project according to an embodiment of the present invention.
[0021] Fig. 4 is an exemplary schematic diagram of an extractor processing process according to an embodiment of the present invention.
[0022] Fig. 5 is a first schematic diagram of project knowledge graph according to an embodiment of the present invention.
[0023] Fig. 6 is a second schematic diagram of project knowledge graph according to an embodiment of the present invention.
[0024] Fig. 7 is an exemplary structural diagram of apparatus for generating knowledge graph of project according to an embodiment of the present invention.
[0025] Fig. 8 is a structural diagram of an electronic device according to an embodiment of the present invention.
[0026] List of reference numbers: DETAILED DESCRIPTION
[0027] In order to make the purpose, technical scheme, and advantages of the invention clearer, the following examples are given to further explain the invention in detail.
[0028] In order to be concise and intuitive in description, the scheme of the invention is described below by describing several representative embodiments. Many details in the embodiments are only used to help understand the scheme of the invention. However, it is obvious that the technical scheme of the invention can be realized without being limited to these details. In order to avoid unnecessarily blurring the scheme of the invention, some embodiments are not described in detail, but only the framework is given. Hereinafter, "including" refers to "including but not limited to" , "according to... " refers to "at least according to..., but not limited to... " . When the number of an element is not specifically indicated below, it means that the element can be one or more, or can be understood as at least one.
[0029] After research, it was found that the relationships between various metadata objects in projects built on BitBake are complex and difficult to manage. This complexity may lead to the following issues:
[0030] (1) It is difficult for maintenance personnel to track where dependent recipes come from when the dependency relationship is cross layered.
[0031] For example, the following is a code fragment that describes dependency relationship from one recipe to another in the. bb file, where “Recipe Name” represents the recipe name.
[0032] DEPENDS="Recipe Name" ;
[0033] However, based on this code fragment, it is not possible to determine which layer the dependent recipe belongs to, making it difficult to understand and maintain the dependent recipe.
[0034] (2) BitBake heavily uses instructions such as include, require, inherit, and inherit configurations to share metadata, making it difficult for maintenance personnel to understand what objects are present in the recipe and where they originate.
[0035] The above exemplary description provides specific examples of complex relationships between metadata objects in current BitBake-based projects. Those skilled in the art may realize that this description is only exemplary and is not intended to limit the scope of protection of the embodiments of the present invention.
[0036] Embodiments of the present invention provide method for generating knowledge graph of project based on BitBake and also analysis method for the knowledge graph. Based on the knowledge graph, metadata objects and their relationships in project can be intuitively discovered, thus improving analysis efficiency.
[0037] The above disclosure provides a detailed explanation of the technical defects existing in the existing technology, the reasons for the technical defects, and the process of thinking and analyzing how to overcome them. In fact, the recognition of the aforementioned technical defects is not a general knowledge in this field, but rather a novel discovery made by the applicant in the research. In addition, the tracing of the causes of the technical defects and the process of thinking and analyzing how to overcome them are also the gradual analysis results of the applicant in the actual research process, and are not universal knowledge in this field.
[0038] Fig. 1 is an exemplary flowchart of a method for generating knowledge graph of a project according to an embodiment of the present invention. As shown in Figure 1, the method comprises:
[0039] Step 101: acquiring a first project based on BitBake built by a build system.
[0040] BitBake has similar functionality to GNU Make and is designed and developed for embedded Linux cross compiler environments. It is a production tool used by Open Embedded when building systems. BitBake is a universal task execution engine that allows Shell and Python tasks to run efficiently and in parallel when working within complex inter task dependency constraints.
[0041] The build system is based on BitBake. For example, build systems can be implemented as Yocto, WindRiver Linux, ISAR, and so on. Yocto is an open-source collaborative project based on BitBake that helps developers create custom Linux based systems without considering their hardware architecture.
[0042] Here, the first project built in the build system comprises a collection of code level files during the BitBake project development process. For example, the first project typically includes:
[0043] (1) Recipe file, which is the most basic metadata file, corresponds to a recipe file for each task unit with a suffix of. bb. The recipe file provides BitBake with basic information about the software package (author, version, license, etc. ) , dependencies, source code location and acquisition methods, patches, configuration and compilation methods, and how to package and install.
[0044] (2) Configuration file with the suffix. conf. Multiple variables are defined in the configuration file, including hardware architecture options, compiler options, general configuration options, and user configuration options. The main configuration file in the project is bitbake. conf.
[0045] Taking Yocto as an example: The main configuration file is located at / Poky / meta / conf / bitbake. conf, other configuration files are usually located in the conf directory of the source tree.
[0046] (3) Class (file) : The suffix of a class file is. bbclass, which contains shared information between metadata files. The BitBake source code tree is sourced from the base. bbclass file, located in Yocto / Poky / meta / classes / base. bbclass will be automatically included in the recipe and class files. It contains the basic definitions of standard tasks, such as obtaining, decompressing, configuring, compiling, installing, and packaging. Some definitions are just frameworks and the content is empty. The files with the bbclass suffix are actually the parts organized by Python scripts to manipulate data.
[0047] (4) Layers: Layers are used to classify different task units. Some task units have common characteristics and can be placed under a layer, facilitating modular organization of metadata and future modifications.
[0048] Step 102: extracting metadata objects of the first project and relationships between the metadata objects of the first project from a first configuration file of the first project.
[0049] Here, metadata objects can include: layers, recipes (such as. bb files, inc files) , classes (. bbclass files) , and so on.
[0050] In one embodiment, the first configuration file comprises a layer configuration file and respective configuration files for respective layers; the extracting metadata objects of the first project and relationships between the metadata objects of the first project from a first configuration file of the first project comprises: enabling an extractor to extract relationships between layers from the layer configuration file; enabling the extractor to extract relationships between respective recipes of each layer from respective configuration files for respective layers. Preferably, the method comprising: enabling the extractor to extract a recipe from the first project; enabling the extractor to search for keywords representing predetermined relationships in the recipe to extract at least one of the following relationships:
[0051] (1) relationship between the recipe and another recipe;
[0052] (2) relationship between the recipe and an installation package in the recipe;
[0053] (3) relationship between classes in the recipe;
[0054] (4) relationship between the recipe and classes in the recipe.
[0055] An extractor is a program or script that automatically retrieves information according to certain rules. Therefore, extracting metadata objects and relationships from the first configuration file through an extractor has the advantage of high extraction efficiency.
[0056] Step 103: generating a knowledge graph of the first project based on the metadata objects of the first project and the relationships between the metadata objects of the first project.
[0057] Here, after determining metadata objects and relationships, a triple of entity 1 (acertain metadata object) , relationship between entity 1 and entity 2, and entity 2 (another metadata object) can be formed. Based on a large number of such triples, a knowledge graph of the first project can be generated. For example, knowledge graphs can be generated based on the Resource Description Framework (RDF) or Labeled Property Graph (LPG) .
[0058] Taking RDF as an example, a modeler can organize metadata objects and their relationships into RDF format files, and store RDF files in RDF storage. RDF files can be retrieved through SPARQL (RDF's query language) search engine.
[0059] In one embodiment, the method comprises: running a command in the build system to generate a target image of the first project; acquiring a second configuration file generated during the process of generating the target image, which comprises metadata objects of a second project based on BitBake required by the first project and relationships between the metadata objects of the second project; extracting the metadata objects of the second project and the relationships between the metadata objects of the second project from the second configuration file; wherein generating a knowledge graph of the first project based on the metadata objects of the first project and the relationships between the metadata objects of the first project comprises: generating a knowledge graph of the first project based on the metadata objects of the first project, the relationships between the metadata objects of the first project, the metadata objects of the second project, and the relationships between the metadata objects of the second project.
[0060] During the process of building target image of the first project, a second configuration file will be generated. The second configuration file contains metadata objects required by the first project that do not belong to the first project which are located in a second project based on BitBake, as well as the relationships between these metadata objects located in the second project. Similarly, using an extractor to crawl the second configuration file can obtain metadata objects and their relationships in the second project, and further include these metadata objects and relationships in the process of generating knowledge graph of the first project. Therefore, not only utilizes configuration files in the first project, but also utilizes metadata objects and relationships in configuration files obtained during target image generation process of the first project to generate knowledge graph of the first project, thereby ensuring the integrity of metadata objects and relationships in the knowledge graph. It is beneficial for users to comprehensively understand and query project information based on the knowledge graph, improving analysis efficiency.
[0061] In one embodiment, the second configuration file comprises a layer configuration file and respective configuration files for respective layers; the extracting metadata objects of the second project and relationships between the metadata objects of the second project from a second configuration file of the second project comprises: enabling an extractor to extract relationships between layers from the layer configuration file comprised in the second configuration file; enabling the extractor to extract relationships between respective recipes of each layer from respective configuration files for respective layers comprised in the second configuration file. Preferably, the method comprising: enabling the extractor to extract a recipe from the first project; enabling the extractor to search for keywords representing predetermined relationships in the recipe to extract at least one of the following relationships: relationship between the recipe and another recipe; relationship between the recipe and an installation package in the recipe; relationship between classes in the recipe; relationship between the recipe and the classes in the recipe.
[0062] In one embodiment, the method comprises: displaying the knowledge graph of the first project in a visual interface. Therefore, by visualizing the knowledge graph, it is easy for users to understand the first project and achieve data queries based on the knowledge graph.
[0063] In one embodiment, the method comprises: generating a search condition library containing search conditions corresponding to respective scenarios; selecting search condition from the search criteria library based on a selection instruction received through the visual interface; querying the knowledge graph of the first project based on the selected search condition; displaying query results in the visual interface.
[0064] For example, a search condition can be: query dependency relationships of installation packages required for recipe A, where A is information that needs to be entered by a user, usually a string. After selecting the search condition and entering A, the user can quickly query the knowledge graph to determine dependencies of installation packages required for recipe A. Therefore, querying knowledge graphs based on pre-established search conditions has the advantage of high query efficiency.
[0065] Fig. 2 is a schematic diagram of an exemplary process for generating knowledge graph of a project according to an embodiment of the present invention.
[0066] In Figure 2, build host 12 includes a BitBake-based project 13 and a knowledge graph generation tool 14. The knowledge graph generation tool 14 obtains first configuration files (including layer configuration file and configuration files for each layer) in BitBake-based project 13. Moreover, knowledge graph generation tool 14 instructs build system of project 13 to generate target image of project 13 and obtain second configuration file during the target image generation process. The knowledge graph generation tool 14 extracts metadata objects contained in the first and second configuration files and relationships between these metadata objects, respectively, and establishes a knowledge graph for project 13 based on the extracted metadata objects and relationships between these metadata objects. User 10 can browse the knowledge graph of project 13 in visual interface 11. User 10 can also perform retrieval on the knowledge graph of project 13 through the visual interface 11.
[0067] Fig. 3 is an exemplary system architecture diagram for generating knowledge graph of a project according to an embodiment of the present invention.
[0068] In Figure 3, project 13 includes multiple folders 131-139, where folder 131 is a class folder, folder 132 is a configuration file folder, folder 133 is an APP folder, folder 134 is a bsp folder, folder 135 is a ci folder, folder 136 is a mirror folder, folder 137 is an initramfs folder, folder 138 is a kernel folder, and folder 139 is a secure boot folder. The knowledge graph generation tool 14 includes extractor 143. The extractor 143 searches multiple folders 131-139 to obtain relationships between metadata objects and metadata objects.
[0069] Extractor 143: This component is the core one that will traverse the whole project structure which need to be built, to find the metadata objects and the relationships between the metadata objects. The metadata objects include layers, recipes (. bb files, . inc files) , classes (. bbclass files) , etc. Modeler 144: It will organize the metadata objects and the relationships fetched by the extractor 143 from the built project to RDF format files. Storage 146: The created RDF files will be stored in the storage 146. These data will be retrieved by search engine 145 later. Search engine 145: The search commands come from the web server will be translated to SPAQRL sentence, which will be used to retrieve data stored in RDF storage. The RDF formatted data retrieved by search engine 145 will be visualized as graph, which can help end user to have an intuitive understanding the complex relationships between BitBake objects.
[0070] The extractor 143 obtains layer configuration file 20 and respective configuration files for respective layers 21 from folder 132. In the process 30 of extracting relationships between layers, the extractor extracts layers and relationships between layers from the layer configuration file 20. In the process 31 of extracting relationships between recipes of a layer, the extractor extracts recipes and relationships between recipes in respective layers from configuration files 21 of corresponding layers. The extractor 143 also traverses folders 131-139 to obtain all recipes 22, and performs recipe analysis processing 32 on each obtained recipe to extract relationships between the recipe and other recipes, relationships between the recipe and installation packages in the recipe, relationship between classes in the recipe, and relationship between the recipe and the classes in the recipe, and so on.
[0071] Modeler 144 organizes metadata objects and their relationships into RDF format files based on the crawling results of extractor 143. Saving the RDF format file in storage 146 to generate a knowledge graph. In the knowledge graph visualization processing 141, a visual interface for the knowledge graph is provided. Search engine 145 provides SPARQL search for the knowledge graph. In search condition library 142, respective search conditions corresponding to respective scenarios are stored to achieve rapid retrieval of the knowledge graph. The end user can select a search condition from search condition library 142 and fulfill it with inputting string. The search condition finally will be sent as a command to the search engine 145.
[0072] Fig. 4 is an exemplary schematic diagram of an extractor processing process according to an embodiment of the present invention.
[0073] In the process 30 of extracting relationships between recipes of a layer, extractor 143 gets the layers objects through searching the whole project with build folder to find bblayer. conf file, in which contains the info about what layers shall be included into the build process (defined by BBLAYERS variable) . In the process 31 of extracting relationships between recipes of a layer according to the layers info got from above step, extractor 143 goes through each layer folder structure to find layer. conf files, in which contains the info about where can find the . bb, bbapend files (defined by BBFILES variable) , to get the recipes bjects. In the process of recipe analysis processing 32, extractor 143 also goes through each bb file to search the keywords which indicate the relationships (like inherit, require, DEPENDS, etc. )
[0074] Fig. 5 is a first schematic diagram of project knowledge graph according to an embodiment of the present invention. In Figure 5, project node 40 has layer nodes 41, 42, and 43. Layer node 42 has recipe node 44 in bb format, recipe node 45 in bb format, and recipe node 46 in bb format. Among them: recipe node 46 in bb format relies on recipe node 45 in bb format. Based on the knowledge graph, not only can the dependency relationship of recipe be determined, but also the layer to which the dependent recipe belongs can be determined, making it easier for users to understand and maintain the dependent recipe.
[0075] Fig. 6 is a second schematic diagram of project knowledge graph according to an embodiment of the present invention. In Figure 6, project node 50 has layer nodes 51, 52, and 53. Layer node 53 has recipe node 54 in bb format and recipe node 56 in bb format. Layer node 53 also has recipe class 60. Recipe node 54 in bb format has a recipe node 55 in inc format. Recipe node 54 in bb format inherits the recipe class 60. Recipe node 54 in bb format includes recipe node 58 in inc format. Recipe node 54 in bb format requires recipe node 57 in inc format. Recipe node 58 in inc format requires recipe node 59 in bb format. It can be seen that even with many complex relationships such as include, require, inherit, etc., based on knowledge graphs, it is still possible to clearly determine what objects are present in the recipe and where they originate.
[0076] Fig. 7 is an exemplary structural diagram of apparatus for generating knowledge graph of project according to an embodiment of the present invention. As shown in Figure 7, apparatus 700 for generating knowledge graph of project comprising: an acquiring module 701, configured to acquire a first project based on BitBake built by a build system; an extracting module 702, configured to extract metadata objects of the first project and relationships between the metadata objects of the first project from a first configuration file of the first project; and a generating module 703, configured to generate a knowledge graph of the first project based on the metadata objects of the first project and the relationships between the metadata objects of the first project.
[0077] In one embodiment, the extracting module 702 configured to run a command in the build system to generate a target image of the first project; acquire a second configuration file generated during the process of generating the target image, which comprises metadata objects of a second project based on BitBake required by the first project and relationships between the metadata objects of the second project; extract the metadata objects of the second project and relationships between the metadata objects of the second project from the second configuration file; the generating module 703, configured to generate a knowledge graph of the first project based on the metadata objects of the first project, the relationships between the metadata objects of the first project, the metadata objects of the second project, and the relationships between the metadata objects of the second project.
[0078] Embodiments of the present invention also propose an electronic device with a processor memory architecture. Fig. 8 is a structural diagram of an electronic device according to an embodiment of the present invention. As shown in Figure 9, electronic device 800 includes a processor 801, a memory 802, and a computer program stored on memory 802 that can run on processor 801. When the computer program is executed by processor 801, the method for generating knowledge graph of project as described in either of the above is implemented. Among them, memory 802 can be implemented as various storage media such as electrically erasable programmable read-only memory (EEPROM) , flash memory, programmable program read-only memory (PROM) , etc. Processor 801 can be implemented to include one or more central processors or one or more field programmable gate arrays, wherein the field programmable gate array integrates one or more central processor cores. Specifically, the central processing unit or core can be implemented as a CPU, MCU, DSP, and so on.
[0079] It should be noted that not all steps and modules in the above processes and structural diagrams are necessary, and some steps or modules can be ignored according to actual needs. The execution sequence of each step is not fixed and can be adjusted as needed. The division of each module is only for the convenience of describing the functional division used. In actual implementation, a module can be divided into multiple modules, and the functions of multiple modules can also be implemented by the same module. These modules can be in the same device or different devices.
[0080] The hardware modules in each implementation can be implemented mechanically or electronically. For example, a hardware module can include specially designed permanent circuits or logic devices (such as dedicated processors, such as FPGA or ASIC) to complete specific operations. Hardware modules can also include programmable logic devices or circuits temporarily configured by software (such as general-purpose processors or other programmable processors) for performing specific operations. As for the specific use of mechanical methods, either dedicated permanent circuits or temporarily configured circuits (such as software configuration) to implement hardware modules, it can be determined based on cost and time considerations.
[0081] The above is only a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this invention shall be included within the scope of protection of this invention.
Claims
1.A method for generating knowledge graph of project, comprising:acquiring (101) a first project based on BitBake built by a build system;extracting (102) metadata objects of the first project and relationships between the metadata objects of the first project from a first configuration file of the first project; andgenerating (103) a knowledge graph of the first project based on the metadata objects of the first project and the relationships between the metadata objects of the first project.2.The method of claim 1, comprising:running a command in the build system to generate a target image of the first project;acquiring a second configuration file generated during the process of generating the target image, which comprises metadata objects of a second project based on BitBake required by the first project and relationships between the metadata objects of the second project;extracting the metadata objects of the second project and the relationships between the metadata objects of the second project from the second configuration file;wherein generating (103) a knowledge graph of the first project based on the metadata objects of the first project and the relationships between the metadata objects of the first project comprises:generating a knowledge graph of the first project based on the metadata objects of the first project, the relationships between the metadata objects of the first project, the metadata objects of the second project, and the relationships between the metadata objects of the second project.3.The method of claim1, wherein the first configuration file comprises a layer configuration file and respective configuration files for respective layers;the extracting (102) metadata objects of the first project and relationships between the metadata objects of the first project from a first configuration file of the first project comprises:enabling an extractor to extract relationships between layers from the layer configuration file;enabling the extractor to extract relationships between respective recipes of each layer from respective configuration files for respective layers.4.The method of claim3, comprising:enabling the extractor to extract a recipe from the first project;enabling the extractor to search for keywords representing predetermined relationships in the recipe to extract at least one of the following relationships:relationship between the recipe and another recipe; relationship between the recipe and an installation package in the recipe; relationship between classes in the recipe; relationship between the recipe and the classes in the recipe.5.The method of claim2, wherein the second configuration file comprises a layer configuration file and respective configuration files for respective layers;the extracting metadata objects of the second project and relationships between the metadata objects of the second project from a second configuration file of the second project comprises:enabling an extractor to extract relationships between layers from the layer configuration file;enabling the extractor to extract relationships between respective recipes of each layer from respective configuration files for respective layers.6.The method of claim5, comprising:enabling the extractor to extract a recipe from the second project;enabling the extractor to search for keywords representing predetermined relationships in the recipe to extract at least one of the following relationships:relationship between the recipe and another recipe; relationship between the recipe and an installation package in the recipe; relationship between classes in the recipe; relationship between the recipe and the classes in the recipe.7.The method of any one of claims 1-6, comprising:displaying the knowledge graph of the first project in a visual interface.8.The method of claim7, comprising:generating a search condition library containing search conditions corresponding to respective scenarios;selecting a search condition from the search criteria library based on a selection instruction received through the visual interface;querying the knowledge graph of the first project based on the selected search condition;displaying query results in the visual interface.9.An apparatus for generating knowledge graph of project, comprising:an acquiring module (701) , configured to acquire a first project based on BitBake built by a build system;an extracting module (702) , configured to extract metadata objects of the first project and relationships between the metadata objects of the first project from a first configuration file of the first project; anda generating module (703) , configured to generate a knowledge graph of the first project based on the metadata objects of the first project and the relationships between the metadata objects of the first project.10.The apparatus of claim 9, wherein the extracting module (702) configured to run a command in the build system to generate a target image of the first project; acquire a second configuration file generated during the process of generating the target image, which comprises metadata objects of a second project based on BitBake required by the first project and relationships between the metadata objects of the second project; extract the metadata objects of the second project and relationships between the metadata objects of the second project from the second configuration file;the generating module (703) , configured to generate a knowledge graph of the first project based on the metadata objects of the first project, the relationships between the metadata objects of the first project, the metadata objects of the second project, and the relationships between the metadata objects of the second project.11.An electronic device, comprising a processor (801) and a memory (802) , wherein an application program executable by the processor (801) is stored in the memory (802) for causing the processor (801) to execute a method for generating knowledge graph of project according to any one of claims 1-8.12.A computer-readable medium comprising computer-readable instructions stored thereon, wherein the computer-readable instructions for executing a method for generating knowledge graph of project according to any one of claims 1-8.13.A computer program product comprising a computer program, upon the computer program is executed by a processor for executing a method for generating knowledge graph of project according to any one of claims 1-8.