Call relationship determination method, device and storage medium for generating code

By parsing and compressing the call relationship graph of the initial code file, and using a neural network model to analyze the call relationship of the generated code, the problem of not being able to accurately determine the call relationship in large-scale projects is solved, thus improving code quality and maintainability.

CN119917075BActive Publication Date: 2026-06-02CHINA TELECOM ARTIFICIAL INTELLIGENCE TECHNOLOGY (BEIJING) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA TELECOM ARTIFICIAL INTELLIGENCE TECHNOLOGY (BEIJING) CO LTD
Filing Date
2024-12-31
Publication Date
2026-06-02

Smart Images

  • Figure CN119917075B_ABST
    Figure CN119917075B_ABST
Patent Text Reader

Abstract

The application discloses a method and device for determining the calling relationship of generated code and a storage medium. The method comprises the following steps: obtaining an initial code file of a target project and demand information of a target account; performing analysis processing on the initial code file to obtain a calling relationship graph of a target function file in the initial code file; performing compression processing on the initial code file based on the calling relationship graph to obtain a target code file of the target project, wherein the storage space of the target code file is smaller than that of the initial code file; and inputting the target code file and the demand information of the target account into a target calling relationship model of the target project for analysis to obtain the calling relationship of the generated code, wherein the demand information is used to represent the demand of the target account for the generated code, and the target calling relationship model is obtained by means of a neural network model. The application solves the technical problem that the calling relationship of the generated code cannot be accurately determined.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and more specifically, to a method, apparatus, and storage medium for determining call relationships in code generation. Background Technology

[0002] When using large models to generate project code, the clarity and completeness of call relationships are crucial for improving the quality and maintainability of the generated code. However, in large-scale projects containing tens of thousands of callable functions, the call relationships in the project code become extremely complex, leading to technical problems that make it impossible to accurately determine the call relationships in the generated code.

[0003] There is currently no effective solution to the technical problem of being unable to accurately determine the calling relationships of the generated code. Summary of the Invention

[0004] This application provides a method, apparatus, and storage medium for determining the call relationship of generated code, so as to at least solve the technical problem of being unable to accurately determine the call relationship of generated code.

[0005] According to one aspect of the embodiments of this application, a method for determining the call relationship of generated code is provided. The method may include: obtaining an initial code file of a target project and requirement information of a target account, wherein the initial code file is used to represent the execution logic of the target project; parsing the initial code file to obtain a call relationship graph of target function files in the initial code file, wherein the call relationship graph is used to represent the call relationship between the target function files and other function files in the initial code file besides the target function files; compressing the initial code file based on the call relationship graph to obtain a target code file of the target project, wherein the storage space of the target code file is smaller than the storage space of the initial code file; inputting the target code file and the requirement information of the target account into a target call relationship model of the target project for analysis to obtain the call relationship of generated code, wherein the requirement information is used to represent the requirement of the target account to generate code, and the target call relationship model is constructed using a neural network model.

[0006] Optionally, based on the call relationship graph, the initial code file is compressed to obtain the target code file of the target project, including: determining multiple first function files and multiple second function files of the target function file based on the call relationship graph, wherein the first function files are function files that have called the target function file, and the second function files are function files that have been called by the target function file; compressing the first function files to obtain compressed first function files, and compressing the second function files to obtain compressed second function files; and generating the target code file based on the compressed first function files and the compressed second function files.

[0007] Optionally, the target code file and target account requirement information are input into the target call relationship model of the target project for analysis to obtain the call relationship of the generated code. This includes: inputting the target code file and target account requirement information into the target call relationship model for analysis to obtain the target requirement function file, multiple initial requirement function files, and the correlation results corresponding to the multiple initial requirement function files respectively. The correlation results are used to characterize the degree of association between the initial requirement function files and the target requirement function file. Based on the multiple initial requirement function files and multiple correlation results, the call relationship of the generated code is determined.

[0008] Optionally, based on multiple initial requirement function files and multiple correlation results, the calling relationship of the generated code is determined, including: sorting the multiple initial requirement function files according to the multiple correlation results to obtain multiple sorted initial requirement function files; selecting a target number of initial requirement function files from the multiple sorted initial requirement function files; and determining the calling relationship of the generated code based on the target number of initial requirement function files.

[0009] Optionally, based on the target number of initial requirement function files, the calling relationships of the generated code are determined, including: updating the calling relationship graph based on the target number of initial requirement function files to obtain an updated calling relationship graph; and determining the calling relationships of the generated code based on the target number of initial requirement function files and the updated calling relationship graph.

[0010] Optionally, the method further includes: obtaining an initial call relationship model of the target project, wherein the initial call relationship model is used to construct the model through a neural network model; and training the initial call relationship model using the initial code file and target constraints to obtain a target call relationship model, wherein the target constraints are used to constrain the call relationships of function files in the initial code file.

[0011] According to another aspect of the embodiments of this application, a device for determining the call relationship of generated code is also provided, comprising: a first acquisition unit, configured to acquire an initial code file of a target project and requirement information of a target account, wherein the initial code file is used to characterize the execution logic of the target project; a parsing unit, configured to parse the initial code file to obtain a call relationship graph of target function files in the initial code file, wherein the call relationship graph is used to characterize the call relationship between the target function files and function files other than the target function files in the initial code file; a compression unit, configured to compress the initial code file based on the call relationship graph to obtain a target code file of the target project, wherein the storage space of the target code file is smaller than the storage space of the initial code file; and an analysis unit, configured to input the target code file and the requirement information of the target account into a target call relationship model of the target project for analysis to obtain the call relationship of generated code, wherein the requirement information is used to characterize the requirement of the target account to generate code, and the target call relationship model is constructed by a neural network model.

[0012] According to another aspect of the embodiments of this application, a non-volatile storage medium is also provided, comprising: the storage medium including a stored program, wherein, during program execution, the device where the storage medium is located is controlled to execute any method for determining the call relationship of generated code.

[0013] According to another aspect of the embodiments of this application, an electronic device is also provided, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute instructions to implement any method for determining the call relationship of generated code.

[0014] In this embodiment, the initial code file of the target project and the requirement information of the target account are obtained. The initial code file is used to represent the execution logic of the target project. The initial code file is parsed to obtain a call relationship graph of the target function files in the initial code file. The call relationship graph is used to represent the call relationship between the target function files and other function files in the initial code file. Based on the call relationship graph, the initial code file is compressed to obtain the target code file of the target project. The storage space of the target code file is smaller than that of the initial code file. The target code file and the requirement information of the target account are input into the target call relationship model of the target project for analysis to obtain the call relationship of the generated code. The requirement information is used to represent the requirement of the target account to generate code. The target call relationship model is constructed by a neural network model. In other words, the initial code file of the target project and the requirement information of the target account can be obtained first. Then, the initial code file can be parsed to obtain a call relationship diagram of the target function files within it. Based on this call relationship diagram, the initial code file can be compressed to obtain the target code file of the target project. Finally, the target code file and the requirement information are input into the target call relationship model of the target project for analysis, achieving the goal of obtaining the call relationship of the generated code. Considering that after obtaining the call relationship diagram of the target function files in the initial code file, the initial code file is compressed based on the call relationship diagram to obtain a target code file with smaller storage space, and then the target code file and the requirement information of the target account are input into the target call relationship model for analysis, the call relationship of the generated code can be obtained. This solves the technical problem of not being able to accurately determine the call relationship of the generated code, achieving the technical effect of accurately determining the call relationship of the generated code. Attached Figure Description

[0015] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0016] Figure 1 This is a flowchart of a method for determining the call relationship of generated code according to an embodiment of this application;

[0017] Figure 2 This is a flowchart of a method for obtaining a compressed code file according to an embodiment of this application;

[0018] Figure 3 This is a flowchart of a file compression method according to an embodiment of this application;

[0019] Figure 4 This is a schematic diagram of a device for determining the call relationship of generated code according to an embodiment of this application;

[0020] Figure 5 This is a schematic diagram of an example electronic device used to implement embodiments of this application, according to an embodiment of this application. Detailed Implementation

[0021] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0022] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0023] According to an embodiment of this application, an embodiment of a method for determining the calling relationship of generated code is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0024] Figure 1 This is a flowchart of a method for determining the call relationship of generated code according to an embodiment of this application, such as... Figure 1 As shown, the method includes the following steps:

[0025] Step S102: Obtain the initial code file of the target project and the required information of the target account.

[0026] In the technical solution provided in step S102 of this application, the initial code file of the target project and the requirement information of the target account can be obtained. The initial code file, which represents the execution logic of the target project, can be simply referred to as a file and includes multiple initial function files.

[0027] Optionally, the target account is a preset account, such as a mobile phone number or email address. One target account corresponds to one user. It should be noted that this is only an example of the target account type and does not specifically limit the target account type.

[0028] Step S104: Parse the initial code file to obtain the call relationship diagram of the target function file in the initial code file.

[0029] In the technical solution provided in step S104 of this application, after obtaining the initial code file, the initial code file is imported into the project system and parsed to obtain the call relationship diagram of the target function file in the initial code file.

[0030] Optionally, the call graph is used to represent the call relationships between the target function file and other function files in the initial code file, excluding the target function file. It can also be called a dependency directed graph.

[0031] Alternatively, a directed graph can be a graph structure in which the edges are directed and consist of a set of vertices (or nodes) and a set of directed edges (from one vertex to another). In a directed graph, the direction of the edges is used to represent the relationship between the nodes, typically representing some kind of dependency or flow.

[0032] Optionally, after the initial code file is imported into the project system, the system calls the DependencyAnalyzer to analyze the dependencies in the initial code file in order to generate a call graph.

[0033] For example, after a project is imported, the system will call DependencyAnalyzer to analyze the dependencies of functions in the project and create a directed dependency graph, which will then be stored in the database.

[0034] It should be noted that this is only a preferred implementation method for obtaining the call relationship graph of the target function file in the initial code file. No example is given for obtaining the call relationship graph of the target function file in the initial code file. Any process and method of parsing the initial code file to obtain the call relationship graph of the target function file in the initial code file is within the protection scope of this application and will not be listed here.

[0035] Step S106: Based on the call relationship graph, compress the initial code file to obtain the target code file of the target project.

[0036] In the technical solution provided in step S106 of this application, the initial code file is compressed according to the call relationship diagram to obtain the target code file of the target project. The storage space of the target code file is smaller than that of the initial code file, and the target code file includes multiple target function files. The target function files can be called comment files. The comment files include package name, class name and function name.

[0037] It is understood that this is only a preferred implementation method for obtaining the target code file of the target project, and the process and method of obtaining the target code file of the target project are not specifically limited. As long as the process and method of obtaining the target code file of the target project are based on the call relationship diagram and the initial code file is compressed, they are all within the protection scope of this application and will not be listed here.

[0038] Step S108: Input the target code file and the target account's requirement information into the target project's target call relationship model for analysis to obtain the call relationship of the generated code.

[0039] In the technical solution provided in step S108 of this application, after obtaining the target code file and the target account requirement information, the target code file and the target account requirement information can be input into the target call relationship model of the target project for analysis, so as to obtain the call relationship of the generated code.

[0040] Optionally, the requirement information is used to characterize the code generation requirements of the target account. The target call relationship model is constructed using a neural network model, which, after performing a learning and training process, can automatically extract and characterize data features, such as large models.

[0041] Optionally, call relationships refer to the relationships between different functions, methods, or modules in a program. Call relationships show which functions call other functions, as well as the call hierarchy and order. This relationship helps developers understand the program's structure, flow, and potential dependencies. Understanding call relationships is crucial in code analysis and optimization because it helps developers identify performance bottlenecks, reduce code duplication, and improve code maintainability.

[0042] It should be noted that this is only a preferred implementation method for obtaining the call relationship of the generated code. The process and method of obtaining the call relationship of the generated code are not specifically limited. As long as the target code file and the target account's requirement information are input into the target call relationship model of the target project for analysis, the process and method of obtaining the call relationship of the generated code are within the protection scope of this application, and will not be elaborated here.

[0043] In this embodiment, the initial code file of the target project and the requirement information of the target account can be obtained first. Then, the obtained initial code file is parsed to obtain a call relationship diagram of the target function files within the initial code file. Based on this call relationship diagram, the initial code file can be compressed to obtain the target code file of the target project. Finally, the target code file and the requirement information are input into the target call relationship model of the target project for analysis, achieving the goal of obtaining the call relationship of the generated code. Considering that after obtaining the call relationship diagram of the target function files in the initial code file, the initial code file is compressed based on the call relationship diagram to obtain a target code file with smaller storage space, and then the target code file and the requirement information of the target account are input into the target call relationship model for analysis, the call relationship of the generated code can be obtained. This solves the technical problem of not being able to accurately determine the call relationship of the generated code, achieving the technical effect of accurately determining the call relationship of the generated code.

[0044] In some embodiments of this application, the initial code file is compressed based on a call relationship graph to obtain the target code file of the target project. This includes: determining multiple first function files and multiple second function files of the target function file based on the call relationship graph, wherein the first function files are function files that have called the target function file, and the second function files are function files that have been called by the target function file; compressing the first function files to obtain compressed first function files, and compressing the second function files to obtain compressed second function files; and generating the target code file based on the compressed first function files and the compressed second function files.

[0045] In this embodiment, after obtaining the call relationship graph, multiple first function files that have called the target function file and multiple second function files that have been called by the target function file can be identified. Then, the first function files can be compressed to obtain compressed first function files, and the second function files can be compressed to obtain compressed second function files. Based on the compressed first function files and compressed second function files obtained above, the purpose of generating the target code file is achieved.

[0046] Optionally, based on the compressed first function file, the compressed second function file, and the call relationship diagram, a target code file can be generated using the target call relationship model. The target call relationship model can be simply referred to as the model. A first code file can be composed of multiple first function files. A second code file can be composed of multiple second function files.

[0047] For example, by using a call relationship graph, the code files that have called the target function file, and the code files that the target function file has called, are found. This call relationship graph, the code files that have called the target function file, and the code files that the target function file has called are then provided to the model. The model generates the target code file, which includes class and method comments. This method makes the code comments more accurate. After parsing the commented file using a syntax tree, only the package name, class comments, class signature, function signature, and function comments are retained. After compressing files with call relationships, the compressed files can be processed in parallel to accelerate the process without affecting each other.

[0048] In some optional embodiments of this application, the target code file and the target account's requirement information are input into the target project's target call relationship model for analysis to obtain the call relationship of the generated code. This includes: inputting the target code file and the target account's requirement information into the target call relationship model for analysis to obtain the target requirement function file, multiple initial requirement function files, and the correlation results corresponding to the multiple initial requirement function files, wherein the correlation results are used to characterize the degree of association between the initial requirement function files and the target requirement function file; and determining the call relationship of the generated code based on the multiple initial requirement function files and the multiple correlation results.

[0049] In this embodiment, the target code file and the target account's requirement information can be input into the target call relationship model for analysis. This allows for the acquisition of the target requirement function file, multiple initial requirement function files, and the correlation results corresponding to each of the initial requirement function files. Based on the obtained initial requirement function files and correlation results, the call relationship of the generated code is determined. The correlation results can be represented by correlation scores.

[0050] Optionally, the target account's requirements information can be the user's code generation requirements. The relevance score can be represented numerically, such as 7, 8, etc. A higher relevance score indicates a greater correlation between the initial and target requirement function files; conversely, a lower relevance score indicates a weaker correlation. It should be noted that this is merely an example of how to represent the relevance score and does not specifically limit its representation.

[0051] For example, obtain the user's code generation requirements, and based on these requirements, use the model to concatenate 30-50 code files. Ask the model which code files will be used in the user's requirements, and the model will select the files that may be used from these code files and perform parallel acceleration processing on these files.

[0052] In some optional embodiments of this application, determining the calling relationship of the generated code based on multiple initial requirement function files and multiple correlation results includes: sorting multiple initial requirement function files according to multiple correlation results to obtain multiple sorted initial requirement function files; selecting a target number of initial requirement function files from the sorted multiple initial requirement function files; and determining the calling relationship of the generated code based on the target number of initial requirement function files.

[0053] In this embodiment, multiple initial requirement function files can be sorted according to multiple relevance scores to obtain sorted initial requirement function files. Then, a target number of initial requirement function files can be selected from these sorted files, and the calling relationship of the generated code can be determined based on these target number of initial requirement function files. The target number can be a preset value, such as 30.

[0054] Optionally, the initial requirement function files can be sorted according to their relevance scores from largest to smallest to obtain the sorted initial requirement function files. Then, the first 30 initial requirement function files can be selected to determine the calling relationship of the generated code.

[0055] For example, after the model selects the files that may be used from these code files and performs parallel acceleration on the above files, it re-sorts all the files that may be used and selects the top 30 files that may be called for the next step of processing.

[0056] In some embodiments of this application, determining the call relationship of the generated code based on a target number of initial requirement function files includes: updating the call relationship graph based on the target number of initial requirement function files to obtain an updated call relationship graph; and determining the call relationship of the generated code based on the target number of initial requirement function files and the updated call relationship graph.

[0057] In this embodiment, the call relationship graph can be updated based on the target number of initial requirement function files to obtain an updated call relationship graph. Then, based on the target number of initial requirement function files and the updated call relationship graph, the call relationship of the generated code can be determined.

[0058] For example, a call graph can be used to expand the narrowed call relationships, restore the possible calling files to the call graph, and find a secondary call, that is, find the nodes that can associate the calling files, and select the top 10 nodes with the most interconnections as supplements, thereby updating the call graph to determine the call relationships of the generated code.

[0059] In some optional embodiments of this application, the method further includes: obtaining an initial call relationship model of the target project, wherein the initial call relationship model is used to construct the model through a neural network model; and training the initial call relationship model using the initial code file and target constraints to obtain a target call relationship model, wherein the target constraints are used to characterize the call relationship of function files in the initial code file.

[0060] In this embodiment, the initial call relationship model of the target project can be obtained, and the initial call relationship model can be trained according to the initial code file and the target constraints to obtain the target call relationship model.

[0061] Optionally, the target constraint can be established using a first loss function and a second loss function, which can be called the target loss function. The first loss function characterizes the difference between the accuracy of the predicted call relationship and the accuracy of the actual call relationship, and can be called the merged loss. The second loss function characterizes the difference between the legality of the predicted call relationship and the legality of the actual call relationship, and can be called the logic detection loss. Both the first and second loss functions can be expressed by the same formula, namely:

[0062]

[0063] Where J can be used to characterize either the first loss function or the second loss function, p(x i ) is used to characterize the prediction results of the model, q(x) i) is used to characterize the actual result, μ is used to represent the penalty coefficient, and 0.15 is used as the penalty rate in this case, and φ is used to represent the number of files that did not select the required call relationship.

[0064] Furthermore, the cross-entropy loss function is used to calculate the difference between the predicted call relationships and the actual call relationships. The merge loss and the logic detection loss can be weighted and merged to simultaneously optimize the accuracy of the merged results and the correctness of the logic during training.

[0065] For example, a neural network model (Mistral7B model) is chosen as the base model, and then secondary training is performed to narrow down the call relationships, thereby improving the model's ability to select call relationships. At the same time, in order to improve the identification of call chains when generating multiple files, the model is used for code compression.

[0066] Furthermore, the training process of the above model is as follows: Selecting training samples: Choose 20 projects, all of which have complete labeled data and can be used as pre-training data, fine-tuning data, etc., and obtain 5000 projects from known websites; Calling the dependency graph: Use DependencyAnalyzer to analyze the function dependencies in the projects and create a directed dependency graph; Class file compression: Compress all code files in a project, retaining only the package name (the package name to which the class belongs), class signature, and function signature. Simultaneously, use the model to generate class and function comments, replacing the code with comments for further code compression; Using the call relationship graph, obtain the called code and provide the call relationship graph and the called code to the model to achieve call file compression; Model fine-tuning: Utilize the target loss function obtained above and the labeled data to allow the model to learn better call relationships; Model testing: Use the remaining data to test the model.

[0067] In this embodiment, the initial code file of the target project and the requirement information of the target account can be obtained first. Then, the obtained initial code file is parsed to obtain a call relationship diagram of the target function files within the initial code file. Based on this call relationship diagram, the initial code file can be compressed to obtain the target code file of the target project. Finally, the target code file and the requirement information are input into the target call relationship model of the target project for analysis, achieving the goal of obtaining the call relationship of the generated code. Considering that after obtaining the call relationship diagram of the target function files in the initial code file, the initial code file is compressed based on the call relationship diagram to obtain a target code file with smaller storage space, and then the target code file and the requirement information of the target account are input into the target call relationship model for analysis, the call relationship of the generated code can be obtained. This solves the technical problem of not being able to accurately determine the call relationship of the generated code, achieving the technical effect of accurately determining the call relationship of the generated code.

[0068] The technical solutions of the embodiments of this application will be illustrated below with reference to preferred embodiments.

[0069] When using large models to generate project code, the explicitness and completeness of call relationships are crucial for improving the quality and maintainability of the generated code. Call relationships help the large model understand the dependencies between different modules and functions, thereby generating code that better conforms to the project structure. By understanding which functions call which other functions, the model can maintain consistency in the generated code and ensure that the types of call parameters and return values ​​match. Understanding call relationships helps avoid common programming errors, such as incorrect function calls or unhandled boundary conditions, and also ensures that the generated code is logically coherent, reducing runtime errors. By analyzing call relationships, the model can identify which functionalities can be reused, thereby generating more concise and modular code. This reuse improves code maintainability and reduces the generation of duplicate code.

[0070] In one implementation, models are constrained by context, and providing them with excessively long content reduces their focus. When processing large amounts of information, models may struggle to focus on the core elements of the current task, leading to inaccurate generated code or results that do not match expectations. Excessive contextual information can increase noise, affecting the model's decision-making ability and generating unnecessary or redundant code. When call relationships are too complex or deeply hierarchical, models may struggle to correctly understand the context, impacting code readability and maintainability. Furthermore, handling too many call relationships increases the computational burden of the generation process, prolonging response time and impacting development efficiency. Simultaneously, model accuracy decreases, leading to technical problems such as the inability to accurately determine the call relationships in the generated code.

[0071] To address the aforementioned issues, this application proposes a method for determining the call relationships of generated code. This method first obtains the initial code file of the target project and the requirement information of the target account. Then, it parses the obtained initial code file to obtain a call relationship diagram of the target function files within the initial code file. Based on this call relationship diagram, the initial code file is compressed to obtain the target code file of the target project. Finally, the target code file and the requirement information are input into the target call relationship model of the target project for analysis, thereby achieving the goal of obtaining the call relationships of the generated code. Considering that after obtaining the call relationship diagram of the target function files in the initial code file, the initial code file is compressed based on the call relationship diagram to obtain a target code file with smaller storage space, and then the target code file and the requirement information of the target account are input into the target call relationship model for analysis, the call relationships of the generated code can be obtained. This solves the technical problem of being unable to accurately determine the call relationships of the generated code, achieving the technical effect of accurately determining the call relationships of the generated code.

[0072] To facilitate a better understanding of the technical solutions of this application by those skilled in the art, a specific embodiment will now be described.

[0073] In this embodiment, the Mistral7B model is selected as the base model, and then secondary training is performed to narrow down the call relationships, thereby improving the model's ability to select call relationships. Simultaneously, to improve the identification of call chains when generating multiple files, the model is used for code compression.

[0074] In this embodiment, the Mistral7B model needs to be trained. The training process is as follows: Select training samples: Choose 20 projects, all of which have complete labeled data and can be used as pre-training data, fine-tuning data, etc., and obtain 5000 projects from known websites; Invoke the dependency graph: Use DependencyAnalyzer to analyze the function dependencies in the projects and create a directed dependency graph; Class file compression: Compress all code files in a project, retaining only the package name (the package name to which the class belongs), class signature, and function signature. Simultaneously, use the model to generate class and function comments, replacing the code with comments for further code compression. Through the dependency graph, obtain the called and invoked code, and provide the dependency graph and the called and invoked code to the model to achieve file compression.

[0075] Furthermore, after compressing the called file, the loss function can be determined and expressed by the following formula:

[0076]

[0077] Where J is used to characterize the first loss function or the second loss function, p(x) i ) is used to characterize the prediction results of the model, q(x) i The ) represents the actual result, and μ represents the penalty coefficient, with 0.15 used as the penalty rate in this case. This represents the number of files for which the desired call relationship was not selected. It's important to note that the cross-entropy loss function is used to calculate the difference between the predicted call relationship and the actual call relationship. The merging loss and the logistic detection loss can be weighted and merged to simultaneously optimize the accuracy of the merged result and the correctness of the logic during training; model fine-tuning utilizes the target loss function obtained above, using labeled data to allow the model to learn better call relationships; model testing uses the remaining data to test the model.

[0078] In addition, the above model training configuration includes: the base model is the Mistral7B model with a total of 7 billion parameters. Number of graphics cards: 10 graphics cards are used for training. Training method: 7 billion parameters require sufficient video memory (86GB). The video memory is compressed and can be placed onto a single graphics card. Each graphics card is trained independently, and the data is mixed and trained in multiple batches. Then, the parallel-trained models are weighted to obtain the final weights.

[0079] Figure 2 This is a flowchart of a method for obtaining a compressed code file according to an embodiment of this application, such as... Figure 2 As shown, the method may include the following steps:

[0080] Step S201: Import the project.

[0081] In this embodiment, the file is imported into the system.

[0082] Step S202: Resolve dependencies.

[0083] Step S203: Generate a call relationship diagram.

[0084] In this embodiment, after the project is imported, the system calls DependencyAnalyzer to analyze the dependencies of functions in the project, and creates a directed dependency graph, which is then stored in the database.

[0085] Optionally, using DependencyAnalyzer to parse the dependency graph can make the direct call relationships between functions clearer. It effectively utilizes dependency graph information when generating comments and uses natural language processing techniques to improve accuracy. Leveraging the contextual information provided by the dependency graph, more accurate and relevant comments can be generated, aiding in understanding the functionality and logic of the code. By removing implementation code and import statements, call relationships are simplified, making dependencies clearer and easier to analyze.

[0086] Step S204: Save the call relationship diagram.

[0087] Step S205: Obtain the commented-out code file.

[0088] Step S206: Use the call relationship diagram to obtain the relevant code files and parse the relevant code files.

[0089] Step S207: Compress the code file.

[0090] In this embodiment, after the relationship graph is generated, the system calls the model to generate comments for each code file.

[0091] Optionally, the code files that have called the target function file and the code files that the target function file has called are found through the call relationship graph. The call relationship graph, the code files that have called the target function file, and the code files that the target function file has called are then provided to the model, allowing the model to generate the target code file. This target code file includes class and method comments, and this method makes the code comments more accurate. After parsing the commented file using a syntax tree, only the package name, class comments, class signature, function signature, and function comments are retained. After compressing the files with call relationships, the compressed files can be processed in parallel to accelerate the process without affecting each other.

[0092] Step S208: Save the compressed code file.

[0093] Step S209: Has the entire file been parsed?

[0094] In this embodiment, it is necessary to determine whether the file has been completely parsed. If so, the process ends directly; otherwise, step S205 is executed. It should be noted that the execution of steps S205 to S209 can be accelerated in parallel.

[0095] Figure 3 This is a flowchart of a file compression method according to an embodiment of this application, such as... Figure 3 As shown, the method includes the following steps:

[0096] Step S301: Obtain the user's requirements for generating code.

[0097] Step S302: Obtain the concatenation code file.

[0098] Step S303: Obtain a small number of code files.

[0099] Step S304: Obtain the relevance score of the code file.

[0100] Step S305: Determine whether all code files have obtained relevance scores.

[0101] In this embodiment, it is necessary to determine whether all code files have obtained relevance scores. If so, step S306 is executed; otherwise, step S303 is executed. The execution content of steps S303 to S305 can be processed in parallel to accelerate the process.

[0102] Step S306: Obtain the target value and the code file with high relevance.

[0103] In this embodiment, code files with high relevance to the target value can be obtained. For example, the user's code generation requirements can be obtained. Based on the above requirements, 30-50 code files are concatenated using a model. The model is then asked which code files will be used in the user's requirements. The model selects the files that may be used from these code files, performs parallel acceleration processing on the above files, re-sorts all the files that may be used, and selects the top 30 files that may be called for the next step of processing.

[0104] Step S307: Expand the code file using a relationship diagram.

[0105] In this embodiment, a relationship graph can be used to expand the code file. For example, a call relationship graph can be used to expand the narrowed call relationship, restore the possible call files to the call relationship graph, and find a secondary call, that is, find the nodes that can associate the call files, and select the top 10 nodes with the most interconnections as supplements, thereby achieving the purpose of expanding the code file.

[0106] Step S308: Select the highly relevant code file.

[0107] Step S309: Obtain the calling relationship of the generated code.

[0108] In this embodiment, the call relationship of the generated code is obtained, and the call relationship used in the end is recorded.

[0109] Optionally, all data during the merging process can be collected, including developer feedback, conflict resolution, test results, etc.; the collected data can be used periodically to retrain and fine-tune the model to improve its merging and conflict resolution capabilities.

[0110] Optionally, querying the model with a small number of calls each time not only returns results quickly but also prevents the model from exceeding the context length. Selecting the top 50 files with the highest probability for use when generating the project ensures that large models do not exceed the token limit when generating code, and supports more rounds of dialogue, resulting in better code generation.

[0111] Optionally, selecting the top 50 files with the highest call probability can, to some extent, focus on the most relevant dependencies and improve the accuracy of the generated code. Batch request processing: Design an efficient request mechanism to ensure that requests to large models do not exceed their token limits, while retaining as much context information as possible. Effective batch processing: By querying large models in batches, efficiency can be improved, reducing the overhead of each request, making it suitable for processing a large number of code files.

[0112] Optionally, training data: Using 20 high-quality labeled items can improve training quality. Find some items on known websites as base data. Large model training: Utilize a loss function, use multiple GPUs to achieve parallel data processing, and mix different groups of data for multi-batch training to achieve weighted processing. A specially trained model can better handle the filtering of comments and call relationships in code files.

[0113] In this embodiment, the initial code file of the target project and the requirement information of the target account can be obtained first. Then, the obtained initial code file is parsed to obtain a call relationship diagram of the target function files within the initial code file. Based on this call relationship diagram, the initial code file can be compressed to obtain the target code file of the target project. Finally, the target code file and the requirement information are input into the target call relationship model of the target project for analysis, achieving the goal of obtaining the call relationship of the generated code. Considering that after obtaining the call relationship diagram of the target function files in the initial code file, the initial code file is compressed based on the call relationship diagram to obtain a target code file with smaller storage space, and then the target code file and the requirement information of the target account are input into the target call relationship model for analysis, the call relationship of the generated code can be obtained. This solves the technical problem of not being able to accurately determine the call relationship of the generated code, achieving the technical effect of accurately determining the call relationship of the generated code.

[0114] Figure 4This is a schematic diagram of a code generation and call relationship determination device according to an embodiment of this application, such as... Figure 4 As shown, the call relationship determination device 400 for the generated code includes: a first acquisition unit 401, a parsing unit 402, a compression unit 403, and an analysis unit 404.

[0115] The first acquisition unit 401 is used to acquire the initial code file of the target project and the requirement information of the target account, wherein the initial code file is used to represent the execution logic of the target project.

[0116] The parsing unit 402 is used to parse the initial code file to obtain the call relationship graph of the target function file in the initial code file. The call relationship graph is used to represent the call relationship between the target function file and other function files in the initial code file.

[0117] Compression unit 403 is used to compress the initial code file based on the call relationship graph to obtain the target code file of the target project, wherein the storage space of the target code file is smaller than the storage space of the initial code file.

[0118] Analysis unit 404 is used to input the target code file and the target account's requirement information into the target project's target call relationship model for analysis, and obtain the call relationship of the generated code. The requirement information is used to characterize the target account's requirement for generating code, and the target call relationship model is used to construct it through a neural network model.

[0119] Optionally, the compression unit 403 may include: a first determining module, configured to determine multiple first function files and multiple second function files of the target function file based on a call relationship graph, wherein the first function files are function files that have called the target function file, and the second function files are function files that have been called by the target function file; an obtaining module, configured to compress the first function files to obtain compressed first function files, and to compress the second function files to obtain compressed second function files; and a generating module, configured to generate a target code file based on the compressed first function files and the compressed second function files.

[0120] Optionally, the analysis unit 404 may include: an analysis module, used to input the target code file and the target account's requirement information into the target call relationship model for analysis, to obtain the target requirement function file, multiple initial requirement function files, and the correlation results corresponding to the multiple initial requirement function files respectively, wherein the correlation results are used to characterize the degree of association between the initial requirement function files and the target requirement function file; and a second determination module, used to determine the call relationship of the generated code based on the multiple initial requirement function files and the multiple correlation results.

[0121] Optionally, the second determining module may include: a sorting submodule, used to sort multiple initial requirement function files according to multiple correlation results to obtain multiple sorted initial requirement function files; a selection submodule, used to select a target number of initial requirement function files from the multiple sorted initial requirement function files; and a determining submodule, used to determine the calling relationship of the generated code based on the target number of initial requirement function files.

[0122] Optionally, the determination submodule is also used to update the call relationship graph based on the target number of initial requirement function files to obtain an updated call relationship graph; and to determine the call relationship of the generated code based on the target number of initial requirement function files and the updated call relationship graph.

[0123] Optionally, the device further includes: a second acquisition unit for acquiring an initial call relationship model of the target project, wherein the initial call relationship model is constructed using a neural network model; and a training unit for training the initial call relationship model using an initial code file and target constraints to obtain a target call relationship model, wherein the target constraints are used to constrain the call relationships of function files in the initial code file.

[0124] In this device, the initial code file of the target project and the requirement information of the target account are acquired by the first acquisition unit 401. The initial code file is used to represent the execution logic of the target project. The parsing unit 402 parses the initial code file to obtain the call relationship diagram of the target function files in the initial code file. The call relationship diagram is used to represent the call relationship between the target function files and other function files in the initial code file. The compression unit 403 compresses the initial code file based on the call relationship diagram to obtain the target code file of the target project. The storage space of the target code file is smaller than that of the initial code file. The analysis unit 404 inputs the target code file and the requirement information of the target account into the target call relationship model of the target project for analysis to obtain the call relationship of the generated code. The requirement information is used to represent the requirement of the target account to generate code. The target call relationship model is constructed by a neural network model to solve the technical problem of not being able to accurately determine the call relationship of the generated code and to achieve the technical effect of accurately determining the call relationship of the generated code.

[0125] According to another aspect of the embodiments of this application, a non-volatile storage medium is also provided, the non-volatile storage medium including a stored program, wherein, when the program is running, it controls the device where the non-volatile storage medium is located to execute any method for determining the call relationship of generated code.

[0126] Specifically, the aforementioned storage medium is used to store program instructions for the following functions, thereby implementing the following functions:

[0127] The process involves: obtaining the initial code file of the target project and the requirement information of the target account; parsing the initial code file to obtain a call relationship graph of the target function files within it, representing the call relationships between the target function files and other function files within the initial code file; compressing the initial code file based on the call relationship graph to obtain the target code file of the target project, where the storage space of the target code file is smaller than that of the initial code file; and inputting the target code file and the requirement information of the target account into the target call relationship model of the target project for analysis to obtain the call relationship of the generated code, where the requirement information represents the code generation requirements of the target account, and the target call relationship model is constructed using a neural network model.

[0128] Optionally, in this embodiment, the storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. More specific examples of the storage medium include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0129] In an exemplary embodiment of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the method for determining the call relationship of any of the above-described code generation methods.

[0130] Optionally, when executed by a processor, the computer program may perform the following steps:

[0131] The process involves: obtaining the initial code file of the target project and the requirement information of the target account; parsing the initial code file to obtain a call relationship graph of the target function files within it, representing the call relationships between the target function files and other function files within the initial code file; compressing the initial code file based on the call relationship graph to obtain the target code file of the target project, where the storage space of the target code file is smaller than that of the initial code file; and inputting the target code file and the requirement information of the target account into the target call relationship model of the target project for analysis to obtain the call relationship of the generated code, where the requirement information represents the code generation requirements of the target account, and the target call relationship model is constructed using a neural network model.

[0132] An electronic device is provided according to an embodiment of this application, the electronic device including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to execute any of the above-described methods for determining the call relationship of the generated code.

[0133] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0134] Figure 5 This is a schematic diagram of an example electronic device for implementing embodiments of this application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the application described and / or claimed herein.

[0135] like Figure 5As shown, device 500 includes a computing unit 501, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 502 or a computer program loaded from storage unit 508 into random access memory (RAM) 503. RAM 503 may also store various programs and data required for the operation of device 500. The computing unit 501, ROM 502, and RAM 503 are interconnected via bus 504. Input / output (I / O) interface 505 is also connected to bus 504.

[0136] Multiple components in device 500 are connected to I / O interface 505, including: input unit 506, such as keyboard, mouse, etc.; output unit 507, such as various types of monitors, speakers, etc.; storage unit 508, such as disk, optical disk, etc.; and communication unit 509, such as network card, modem, wireless transceiver, etc. Communication unit 509 allows device 500 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0137] The computing unit 501 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as the method for processing chained data. For example, in some embodiments, the method for processing chained data may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by the computing unit 501, one or more steps of the method for processing chained data described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform a method for processing call chain data by any other suitable means (e.g., by means of firmware).

[0138] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0139] The program code used to implement the methods of this application may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0140] In the context of this application, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0141] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0142] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0143] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0144] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0145] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0146] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0147] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0148] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0149] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0150] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for determining the call relationship of generated code, characterized in that, include: Obtain the initial code file of the target project and the requirement information of the target account, wherein the initial code file is used to characterize the execution logic of the target project; The initial code file is parsed to obtain a call relationship graph of the target function file in the initial code file, wherein the call relationship graph is used to represent the call relationship between the target function file and other function files in the initial code file besides the target function file; Based on the call relationship graph, the initial code file is compressed to obtain the target code file of the target project, wherein the storage space of the target code file is smaller than the storage space of the initial code file; The target code file and the target account's requirement information are input into the target project's target call relationship model for analysis to obtain the call relationship of the generated code. The requirement information is used to characterize the target account's requirement for generating code, and the target call relationship model is constructed using a neural network model. The process involves inputting the target code file and target account requirement information into the target project's target call relationship model for analysis to obtain the call relationship of the generated code. This includes: inputting the target code file and target account requirement information into the target call relationship model for analysis to obtain a target requirement function file, multiple initial requirement function files, and correlation results corresponding to the multiple initial requirement function files, wherein the correlation results are used to characterize the degree of association between the initial requirement function files and the target requirement function file; and determining the call relationship of the generated code based on the multiple initial requirement function files and the multiple correlation results.

2. The method according to claim 1, characterized in that, Based on the call relationship graph, the initial code file is compressed to obtain the target code file of the target project, including: Based on the call relationship graph, multiple first function files and multiple second function files of the target function file are determined, wherein the first function files are function files that have called the target function file, and the second function files are function files that have been called by the target function file; The first function file is compressed to obtain a compressed first function file, and the second function file is compressed to obtain a compressed second function file; The target code file is generated based on the compressed first function file and the compressed second function file.

3. The method according to claim 1, characterized in that, Based on multiple initial requirement function files and multiple correlation results, the calling relationships of the generated code are determined, including: Based on the multiple correlation results, the multiple initial requirement function files are sorted to obtain the sorted multiple initial requirement function files; Select a target number of the initial requirement function files from the sorted plurality of initial requirement function files; Based on the target number of initial requirement function files, the calling relationships of the generated code are determined.

4. The method according to claim 3, characterized in that, Based on the target number of initial requirement function files, the calling relationships of the generated code are determined, including: Based on the target number of initial requirement function files, the call relationship graph is updated to obtain the updated call relationship graph; Based on the target number of initial requirement function files and the updated call relationship graph, the call relationship of the generated code is determined.

5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: Obtain the initial call relationship model of the target project, wherein the initial call relationship model is constructed through the neural network model; Using the initial code file and target constraints, the initial call relationship model is trained to obtain the target call relationship model, wherein the target constraints are used to constrain the call relationship of function files in the initial code file.

6. A device for determining the call relationship of generated code, characterized in that, include: The first acquisition unit is used to acquire the initial code file of the target project and the requirement information of the target account, wherein the initial code file is used to characterize the execution logic of the target project; The parsing unit is used to parse the initial code file to obtain a call relationship graph of the target function file in the initial code file, wherein the call relationship graph is used to represent the call relationship between the target function file and other function files in the initial code file besides the target function file; A compression unit is used to compress the initial code file based on the call relationship graph to obtain the target code file of the target project, wherein the storage space of the target code file is smaller than the storage space of the initial code file; The analysis unit is used to input the target code file and the target account's requirement information into the target project's target call relationship model for analysis, and obtain the call relationship of the generated code. The requirement information is used to characterize the target account's requirement for generating code, and the target call relationship model is used to construct it through a neural network model. The analysis unit is further configured to input the target code file and the target account's requirement information into the target call relationship model for analysis, to obtain the target requirement function file, multiple initial requirement function files, and the correlation results corresponding to the multiple initial requirement function files respectively, wherein the correlation results are used to characterize the degree of association between the initial requirement function file and the target requirement function file; and to determine the call relationship of the generated code based on the multiple initial requirement function files and the multiple correlation results.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, wherein, when the executable program is executed, it controls the device on which the storage medium is located to perform the method according to any one of claims 1 to 5.

8. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the method as described in any one of claims 1 to 5.

9. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the method described in any one of claims 1 to 5.