Component risk identification method and device, equipment, medium and program product

By extracting code project data and prompt words and using machine learning models to identify risky components, the problem of low efficiency in third-party component risk identification in existing technologies is solved, achieving more efficient and stable component risk management and improving project quality.

CN120669977APending Publication Date: 2025-09-19INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510892074.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-30
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

The risk identification efficiency of third-party components in existing technologies is low and their stability is not high, resulting in frequent development and operation and maintenance problems.

Method used

By obtaining code project data and prompt words, extracting structured data, and using a preset machine learning model combined with a hybrid expert system and a multi-layer attention mechanism, the system outputs risk components, including component dependency tree relationships and reference relationships, and combines prompt words for feature fusion and compression to identify risk components.

Benefits of technology

It improves the efficiency and stability of component risk identification, enhances the quality of automatic identification of component dependencies, reduces operation and maintenance costs and security risks, and optimizes application size and transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120669977A_ABST
    Figure CN120669977A_ABST
Patent Text Reader

Abstract

The invention provides a component risk identification method which can be applied to the technical field of artificial intelligence. The component risk identification method comprises the steps of obtaining code item data and cue words; based on the code item data, first structured data is extracted, the first structured data comprises N to-be-analyzed components and a data model relation of the N to-be-analyzed components, N is a positive integer, and the data model relation comprises a component dependency tree relation and / or a component reference relation; and based on the first structured data and the cue word as input of a preset machine learning model, outputting a risk component. The invention further provides a component risk identification device and equipment, a storage medium and a program product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a component risk identification method, apparatus, device, medium, and program product. Background Art

[0002] Large-scale software development projects often introduce thousands of third-party components. These components can help developers quickly build application functions and save development time, but they also bring many development and operation and maintenance problems. Due to the lack of standardization and stability of third-party components, certain production problems will arise. Therefore, for these third-party components, a large amount of resources are required for management and maintenance.

[0003] In the prior art, risk identification of third-party components is performed by combining analysis plug-ins related to third-party components with manual methods, and then management and maintenance are implemented. However, this method has low efficiency and low stability in component risk identification. Summary of the Invention

[0004] In view of the above problems, the present disclosure provides a component risk identification method, apparatus, device, medium, and program product that improve the stability and efficiency of component risk identification.

[0005] According to a first aspect of the present disclosure, a component risk identification method is provided, comprising: obtaining code project data and prompt words; extracting first structured data based on the code project data, wherein the first structured data comprises N components to be analyzed and data model relationships between the N components to be analyzed, where N is a positive integer, and the data model relationships comprise component dependency tree relationships and / or component reference relationships; and outputting risk components based on the first structured data and the prompt words as inputs to a preset machine learning model.

[0006] According to an embodiment of the present disclosure, the risk component is output based on the first structured data and the prompt word as input of a preset machine learning model, including: splicing the first structured data and the prompt word embedding vector into a first fusion feature; and outputting the risk component based on the first fusion feature as input of the preset machine learning model.

[0007] According to an embodiment of the present disclosure, the method of outputting a risk component based on the first structured data and the prompt word as input of a preset machine learning model also includes: performing compression on the first structured data to obtain second structured data; splicing the second structured data and the prompt word embedding vector into a second fusion feature; and outputting the risk component based on the second fusion feature as input of the preset machine learning model.

[0008] According to an embodiment of the present disclosure, the prompt word includes: output format and / or component range.

[0009] According to an embodiment of the present disclosure, the risk component includes a risk type. After the risk component is output based on the first structured data and the prompt word as the input of the preset machine learning model, it also includes: obtaining a corresponding preset optimization solution based on the risk type.

[0010] According to an embodiment of the present disclosure, the method for establishing the preset machine learning model includes: obtaining training data, the training data including a structured training data set and a risk label set, the structured training data set including L component training data and data model relationships of L components, the risk label set including L component labels, where L is a positive integer; and based on the component training data set and the risk label set, fine-tuning the initialized machine learning model until a preset cutoff condition is met to obtain the preset machine learning model.

[0011] A second aspect of the present disclosure provides a component risk identification device, which includes: an acquisition module for acquiring code project data and prompt words; an extraction module for extracting first structured data based on the code project data, wherein the first structured data includes N components to be analyzed and data model relationships of the N components to be analyzed, where N is a positive integer, and the data model relationships include: component dependency tree relationships and / or component reference relationships; and an identification module for outputting risk components based on the first structured data and the prompt words as inputs of a preset machine learning model.

[0012] According to an embodiment of the present disclosure, the recognition module is specifically used to splice the first structured data and the prompt word embedding vector into a first fusion feature; and output the risk component based on the first fusion feature as the input of the preset machine learning model.

[0013] According to an embodiment of the present disclosure, the identification module is further specifically used to perform compression on the first structured data to obtain second structured data; splice the second structured data and the prompt word embedding vector into a second fusion feature; and output the risk component based on the second fusion feature as the input of the preset machine learning model.

[0014] According to an embodiment of the present disclosure, the prompt word includes: output format and / or component range.

[0015] According to an embodiment of the present disclosure, the risk component includes a risk type, and the device further includes a risk output module for acquiring a corresponding preset optimization solution based on the risk type.

[0016] According to an embodiment of the present disclosure, the device also includes a training module for acquiring training data, wherein the training data includes a structured training data set and a risk label set, wherein the structured training data set includes L component training data and data model relationships of L components, and the risk label set includes L component labels, where L is a positive integer; and based on the component training data set and the risk label set, fine-tuning the initialized machine learning model until a preset cutoff condition is reached to obtain the preset machine learning model.

[0017] A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.

[0018] The fourth aspect of the present disclosure further provides a computer-readable storage medium having a computer program or instructions stored thereon, which implements the steps of the above method when the computer program or instructions are executed by a processor.

[0019] The fifth aspect of the present disclosure further provides a computer program product, comprising a computer program or instructions, which implement the steps of the above method when executed by a processor.

[0020] To address the low efficiency and stability of component risk identification in existing technologies, the disclosed embodiments first extract component elements from code project data and the data model relationships between them. Then, they fuse prompt words, components, and data model relationships as input to an artificial intelligence model, enabling the machine learning model to output risk components. Combining prompt words with an artificial intelligence model ensures streamlined risk component output, improves the quality of automatic identification of component dependencies, and enhances the efficiency of identifying component risk components, thereby enhancing the quality of component introduction into projects. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0022] Figure 1 Schematically illustrates an application scenario diagram of the component risk identification method, apparatus, device, medium, and program product according to an embodiment of the present disclosure;

[0023] Figure 2 A flowchart of a component risk identification method according to an embodiment of the present disclosure is schematically shown;

[0024] Figure 3 Schematically shows a structural block diagram of a component risk identification device according to an embodiment of the present disclosure; and

[0025] Figure 4 A block diagram of an electronic device suitable for implementing a component risk identification method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0026] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the detailed description below, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0027] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise," "include," etc. used herein indicate the presence of the features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0028] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0029] When expressions such as "at least one of A, B, and C, etc." are used, they should generally be interpreted in accordance with the meaning commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0030] After years of development, some compiled languages ​​have developed vast, ecologically rich component libraries. These libraries can be easily incorporated into code projects. Large-scale application projects often have hundreds or even thousands of built-in or third-party components. These components can help developers quickly build application functionality and save development time, but they also bring a number of development and maintenance issues, such as:

[0031] 1. Not all third-party components are well maintained. Especially for those developed and maintained by smaller organizations or individuals, maintenance and updates are often unstable and inadequate, leading to compatibility issues and security risks.

[0032] 2. Introducing a large number of third-party components will multiply security risks, requiring significant operational costs to monitor and patch security vulnerabilities.

[0033] 3. The same functionality is often implemented in multiple components, often using the same class and method names. However, the processing details may differ between mature and simple components. If developers do not fully understand the functional implementation of each component, they may introduce incorrect methods, resulting in business processing errors when receiving unprocessable input, causing production problems.

[0034] 4. Without explicit exclusion declarations, all directly and indirectly imported components will be packaged into the project, often including a large number of components with duplicated and redundant functions. This will cause the size of the packaged application to increase dramatically, occupying application transmission bandwidth and wasting disk space.

[0035] An embodiment of the present disclosure provides a component risk identification method, which includes: obtaining code project data and prompt words; extracting first structured data based on the code project data, wherein the first structured data includes N components to be analyzed and data model relationships between the N components to be analyzed, where N is a positive integer, and the data model relationships include: component dependency tree relationships and / or component reference relationships; and outputting risk components based on the first structured data and the prompt words as inputs to a preset machine learning model.

[0036] To address the low efficiency and stability of component risk identification in existing technologies, the disclosed embodiments first extract component elements from code project data and the data model relationships between them. Then, they fuse prompt words, components, and data model relationships as input to an artificial intelligence model, enabling the machine learning model to output risk components. Combining prompt words with an artificial intelligence model ensures streamlined risk component output, improves the quality of automatic identification of component dependencies, and enhances the efficiency of identifying component risk components, thereby enhancing the quality of component introduction into projects.

[0037] Figure 1 The following schematically illustrates an application scenario diagram of the component risk identification method according to an embodiment of the present disclosure.

[0038] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links or optical fiber cables.

[0039] A user may use a first terminal device 101, a second terminal device 102, or a third terminal device 103 to interact with a server 105 via a network 104 to receive or send messages, etc. Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, or the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (for example only).

[0040] The first terminal device 101 , the second terminal device 102 , and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0041] The server 105 may be a server that provides various services, such as a background management server (for example only) that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process received data such as user requests, and feed back processing results (e.g., web pages, information, or data obtained or generated based on user requests) to the terminal devices.

[0042] It should be noted that the component risk identification method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the component risk identification device provided in the embodiment of the present disclosure can generally be set in the server 105. The component risk identification method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the component risk identification device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.

[0043] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.

[0044] The following will be based on Figure 1 The scene described by Figure 2 The component risk identification method of the disclosed embodiment is described in detail.

[0045] Figure 2 The flowchart of the component risk identification method according to the embodiment of the present disclosure is schematically shown.

[0046] like Figure 2 As shown, the component risk identification method of this embodiment includes operations S210 to S230 , and the component risk identification method can be executed by the server 105 .

[0047] In operation S210 , code item data and prompt words are acquired.

[0048] The code project data is code project data related to the project. The code project data can reflect component information and information between components. The code project data may include, for example, source files, dependency configuration files, and environment configuration files.

[0049] Among them, the prompt words are user-defined and are used to guide the format and content of the artificial intelligence model output. According to the embodiments of the present disclosure, the prompt words include: output format and / or component range. It can be understood that the prompt words are used to optimize the output data and format, ensure that the output content matches subsequent operations, and also streamline the output content to avoid redundant output content. For example, the prompt words can adopt the following constraints: output formatting as a table, forcing the retention of specified core components, and the components being checked are components of a specific part.

[0050] In a typical scenario, user input is embedded in pre-made prompt words to generate the final model requirement prompt words, which are used to strengthen the model output. For example, the output must be tabulated, the output content items are clearly defined, the mandatory agreement on the project information that must be retained and the items that can be excluded is made, whether the code should be optimized, and the clear requirement to use internal components instead of third-party components, etc., to reduce visual hallucinations.

[0051] In operation S220, first structured data is extracted based on the code project data, where the first structured data includes N components to be analyzed and data model relationships between the N components to be analyzed, where N is a positive integer, and the data model relationships include component dependency tree relationships and / or component reference relationships.

[0052] Specifically, one or more code project data are extracted in the form of pre-set structured data to form first structured data, wherein, for example, component dependency tree relationships and / or component reference relationships can be extracted from source files, dependency configuration files, and environment configuration files, etc. through regular expressions, and component dependency tree relationships and / or component reference relationships can be extracted from source files, dependency configuration files, and environment configuration files, etc. through relevant dependency tree extraction tools or reference relationship extraction tools.

[0053] In a typical scenario, automated scripts are run to automatically extract predefined target data structures from a project. Application projects can be packaged into compressed files or directories (for multiple projects, subdirectories are defined as the root directories of each project) for data extraction. Classes within the project are automatically identified, and a reference data model for components and application classes is constructed based on manually specified regular expressions, using three dimensions: import keywords, class names, and class (method) reference networks. The project's reference dependency tree is retrieved from the project object model file to output structured data.

[0054] In operation S230 , a risk component is output based on the first structured data and the prompt word as input to a preset machine learning model.

[0055] Specifically, the first structured data and the prompt word are directly used as input to a preset machine learning model, which then outputs a risk component. The underlying architecture of this preset machine learning model can be based on a hybrid expert system combined with a multi-layer attention mechanism. By combining the sparse computational advantages of the hybrid expert system with the fine-grained feature capture capabilities of multi-layer attention, this model is suitable for computing high-dimensional and strongly correlated structured data such as those referenced by components in code projects.

[0056] According to an embodiment of the present disclosure, the risk component is output based on the first structured data and the prompt word as input of a preset machine learning model, including: splicing the first structured data and the prompt word embedding vector into a first fusion feature; and outputting the risk component based on the first fusion feature as input of the preset machine learning model.

[0057] Specifically, the first structured data and the prompt word are used as text information to be input, which are converted into token information. The first structured data and the prompt word are spliced ​​and fused through position embedding (such as fixed position or learned position embedding) to form a first fusion feature, and then the first fusion feature is used as the input of a preset machine learning model to obtain an output risk component.

[0058] In a typical scenario, the prompt words will be embedded in the predefined citation quality improvement prompt words. Finally, the two pieces of information, after word embedding preprocessing, constitute the input information of the model and are input into the preset machine learning model.

[0059] According to an embodiment of the present disclosure, the method of outputting a risk component based on the first structured data and the prompt word as input of a preset machine learning model also includes: performing compression on the first structured data to obtain second structured data; splicing the second structured data and the prompt word embedding vector into a second fusion feature; and outputting the risk component based on the second fusion feature as input of the preset machine learning model.

[0060] Specifically, because import information, fully qualified names, and reference networks in code projects contain a large amount of redundant information, such as prefixes in full class names, serialization often exceeds the maximum text size allowed by the machine learning model, affecting the model's prediction accuracy. Therefore, we can first perform feature compression on the reference data model, such as using a variational autoencoder to reduce feature dimensionality, compress the first structured data into a second structured data, and then concatenate and fuse the compressed second structured data with the prompt word to obtain the second fused feature.

[0061] According to an embodiment of the present disclosure, the risk component includes a risk type. After the risk component is output based on the first structured data and the prompt word as the input of the preset machine learning model, it also includes: obtaining a corresponding preset optimization solution based on the risk type.

[0062] Specifically, after the machine learning model outputs the risk component, the risk type corresponding to the risk component is obtained, where the risk types include components with redundant functions, less frequently used third-party components, and single-entry component introductions, etc. The corresponding preset optimization solutions include: replacing risk components / or deleting risk components, such as: reducing the introduction of components with redundant functions, replacing uncommon third-party components, using in-application code to replace single-entry component introductions, using self-built or commonly used components in the development environment to replace uncommon third-party components, etc. It is understandable that the subsequent execution of the optimization solution can improve the quality of component introduction, reduce operation and maintenance manpower investment, improve application robustness, reduce application security risks, reduce the size of application reference packaging, improve the transmission efficiency of applications during deployment, and optimize disk usage.

[0063] According to an embodiment of the present disclosure, the method for establishing the preset machine learning model includes: obtaining training data, the training data including a structured training data set and a risk label set, the structured training data set including L component training data and data model relationships of L components, the risk label set including L component labels, where L is a positive integer; and based on the component training data set and the risk label set, fine-tuning the initialized machine learning model until a preset cutoff condition is met to obtain the preset machine learning model.

[0064] Specifically, the embodiments of the present disclosure first obtain training data for input, including structured training data and a risk label set, wherein the structured training data includes: component training, component dependency tree relationships and / or component reference relationships, and the component labels include whether there is a risk and the corresponding risk type; then, through these training data, the initialized machine learning model is fine-tuned until a preset cutoff condition is met, wherein the preset medium condition can be a preset number of rounds, a preset time, and other preset constraints, etc., wherein the above-mentioned initialized machine learning model can be a pre-trained large language model.

[0065] To address the low efficiency and stability of component risk identification in existing technologies, the disclosed embodiments first extract component elements from code project data and the data model relationships between them. Then, they fuse prompt words, components, and data model relationships as input to an artificial intelligence model, enabling the machine learning model to output risk components. Combining prompt words with an artificial intelligence model ensures streamlined risk component output, improves the quality of automatic identification of component dependencies, and enhances the efficiency of identifying component risk components, thereby enhancing the quality of component introduction into projects.

[0066] Based on the above component risk identification method, the present disclosure also provides a component risk identification device. Figure 3 The device is described in detail.

[0067] Figure 3 The structural block diagram of the component risk identification device according to an embodiment of the present disclosure is schematically shown.

[0068] like Figure 3 As shown, the component risk identification device 300 of this embodiment includes an acquisition module 310 , an extraction module 320 and an identification module 330 .

[0069] The acquisition module 310 is used to acquire code project data and prompt words. In one embodiment, the acquisition module 310 can be used to perform the operation S210 described above, which will not be repeated here.

[0070] Extraction module 320 is configured to extract first structured data based on the code project data. The first structured data includes N components to be analyzed and data model relationships between the N components to be analyzed, where N is a positive integer. The data model relationships include component dependency tree relationships and / or component reference relationships. In one embodiment, extraction module 320 may be configured to perform operation S220 described above, which will not be further described here.

[0071] The identification module 330 is configured to output a risk component based on the first structured data and the prompt word as input to a preset machine learning model. In one embodiment, the identification module 330 may be configured to perform the operation S230 described above, which will not be described in detail here.

[0072] To address the low efficiency and stability of component risk identification in existing technologies, the disclosed embodiments first extract component elements from code project data and the data model relationships between them. Then, they fuse prompt words, components, and data model relationships as input to an artificial intelligence model, enabling the machine learning model to output risk components. Combining prompt words with an artificial intelligence model ensures streamlined risk component output, improves the quality of automatic identification of component dependencies, and enhances the efficiency of identifying component risk components, thereby enhancing the quality of component introduction into projects.

[0073] According to an embodiment of the present disclosure, the recognition module is specifically used to splice the first structured data and the prompt word embedding vector into a first fusion feature; and output the risk component based on the first fusion feature as the input of the preset machine learning model.

[0074] According to an embodiment of the present disclosure, the identification module is further specifically used to perform compression on the first structured data to obtain second structured data; splice the second structured data and the prompt word embedding vector into a second fusion feature; and output the risk component based on the second fusion feature as the input of the preset machine learning model.

[0075] According to an embodiment of the present disclosure, the prompt word includes: output format and / or component range.

[0076] According to an embodiment of the present disclosure, the risk component includes a risk type, and the device further includes a risk output module for acquiring a corresponding preset optimization solution based on the risk type.

[0077] According to an embodiment of the present disclosure, the device also includes a training module for acquiring training data, wherein the training data includes a structured training data set and a risk label set, wherein the structured training data set includes L component training data and data model relationships of L components, and the risk label set includes L component labels, where L is a positive integer; and based on the component training data set and the risk label set, fine-tuning the initialized machine learning model until a preset cutoff condition is reached to obtain the preset machine learning model.

[0078] According to embodiments of the present disclosure, any multiple modules among the acquisition module 310, extraction module 320, and identification module 330 may be combined into a single module, or any one of these modules may be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of other modules and implemented in a single module. According to embodiments of the present disclosure, at least one of the acquisition module 310, extraction module 320, and identification module 330 may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or may be implemented in hardware or firmware through any other reasonable means of circuit integration or packaging, or may be implemented in any one of the three implementation methods of software, hardware, and firmware, or any appropriate combination of these. Alternatively, at least one of the acquisition module 310, extraction module 320, and identification module 330 may be at least partially implemented as a computer program module that, when executed, performs the corresponding functionality.

[0079] Figure 4 A block diagram of an electronic device suitable for implementing a component risk identification method according to an embodiment of the present disclosure is schematically shown.

[0080] like Figure 4 As shown, the electronic device 900 according to an embodiment of the present disclosure includes a processor 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage unit 908 into a random access memory (RAM) 903. The processor 901 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 901 may also include onboard memory for caching purposes. The processor 901 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiment of the present disclosure.

[0081] Various programs and data required for the operation of the electronic device 900 are stored in the RAM 903. The processor 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. The processor 901 executes the various operations of the method flow according to the embodiment of the present disclosure by executing the programs in the ROM 902 and / or the RAM 903. It should be noted that the programs may also be stored in one or more memories other than the ROM 902 and the RAM 903. The processor 901 may also execute the various operations of the method flow according to the embodiment of the present disclosure by executing the programs stored in the one or more memories.

[0082] According to an embodiment of the present disclosure, electronic device 900 may further include an input / output (I / O) interface 905, which is also connected to bus 904. Electronic device 900 may also include one or more of the following components connected to I / O interface 905: an input section 906 including a keyboard, mouse, etc.; an output section 907 including devices such as a cathode ray tube (CRT), liquid crystal display (LCD), and speakers; a storage section 908 including a hard disk; and a communication section 909 including a network interface card such as a LAN card or modem. Communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to I / O interface 905 as needed. Removable media 911, such as a magnetic disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed in drive 910 as needed, so that computer programs read from the removable media can be installed into storage section 908 as needed.

[0083] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or may exist independently and not be incorporated into the device / apparatus / system. The computer-readable storage medium carries one or more programs, and when executed, implements the method according to the embodiments of the present disclosure.

[0084] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, and may include, for example, but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 902 and / or RAM 903 described above, and / or one or more memories other than ROM 902 and RAM 903.

[0085] The embodiments of the present disclosure also include a computer program product, which includes a computer program containing program code for executing the method shown in the flowchart. When the computer program product is executed in a computer system, the program code is used to cause the computer system to implement the method provided by the embodiments of the present disclosure.

[0086] The computer program executes the above functions defined in the system / device of the embodiment of the present disclosure when the processor 901 executes the computer program. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0087] In one embodiment, the computer program may be stored on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may be transmitted and distributed in the form of a signal on a network medium, downloaded and installed via the communication portion 909, and / or installed from a removable medium 911. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to wireless, wired, or any suitable combination thereof.

[0088] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 909, and / or installed from a removable medium 911. When the computer program is executed by the processor 901, the above-described functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the systems, devices, means, modules, units, etc. described above can be implemented by computer program modules.

[0089] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computer programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C" or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect via the Internet).

[0090] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0091] Those skilled in the art will appreciate that the features described in the various embodiments of the present disclosure may be combined and / or coupled in various ways, even if such combinations or couplings are not explicitly described in the present disclosure. In particular, the features described in the various embodiments of the present disclosure may be combined and / or coupled in various ways without departing from the spirit and teachings of the present disclosure. All such combinations and / or couplings fall within the scope of the present disclosure.

[0092] The above describes the embodiments of the present disclosure. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although each embodiment has been described separately above, this does not mean that the measures in each embodiment cannot be advantageously used in combination. Without departing from the scope of the present disclosure, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A component risk identification method, characterized in that: The method comprises: Get code project data and prompt words; Extracting first structured data based on the code project data, the first structured data including N components to be analyzed and data model relationships between the N components to be analyzed, where N is a positive integer, and the data model relationships include: component dependency tree relationships and / or component reference relationships; and Based on the first structured data and the prompt word as input to a preset machine learning model, a risk component is output.

2. The method according to claim 1, wherein the step of outputting a risk component based on the first structured data and the prompt word as input to a preset machine learning model comprises: splicing the first structured data and the prompt word embedding vector into a first fusion feature; as well as Based on the first fusion feature as the input of the preset machine learning model, the risk component is output.

3. The method according to claim 2, wherein the outputting of the risk component based on the first structured data and the prompt word as input to a preset machine learning model further comprises: Compressing the first structured data to obtain second structured data; splicing the second structured data and the prompt word embedding vector into a second fusion feature; as well as Based on the second fusion feature as the input of the preset machine learning model, the risk component is output.

4. The method according to claim 1, wherein the prompt word comprises: Output format and / or component scope.

5. The method according to any one of claims 1 to 4, wherein the risk component includes a risk type, and after outputting the risk component based on the first structured data and the prompt word as input to a preset machine learning model, further comprising: Obtain a corresponding preset optimization solution based on the risk type.

6. The method according to any one of claims 1 to 4, wherein the method for establishing the preset machine learning model comprises: Acquire training data, where the training data includes a structured training data set and a risk label set, where the structured training data set includes L component training data and data model relationships of L components, and the risk label set includes L component labels, where L is a positive integer; as well as Based on the component training data set and the risk label set, the initialized machine learning model is fine-tuned until a preset cutoff condition is reached to obtain the preset machine learning model.

7. A component risk identification device, characterized in that: The device comprises: Acquisition module, used to obtain code project data and prompt words; an extraction module, configured to extract first structured data based on the code project data, wherein the first structured data includes N components to be analyzed and data model relationships between the N components to be analyzed, where N is a positive integer, and the data model relationships include component dependency tree relationships and / or component reference relationships; and An identification module is configured to output a risk component based on the first structured data and the prompt word as input to a preset machine learning model.

8. An electronic device comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.