Batch job code generation method and device, electronic equipment and program product
By constructing a knowledge graph and utilizing a target classification model, the problem of inaccurate code caused by differences in descriptions from different business personnel was solved, enabling efficient and automatic generation of batch operation code and improving the accuracy and efficiency of code generation.
Patent Information
- Application Number
- CN202511638937.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-10
- Publication Date
- 2026-02-13
AI Technical Summary
The inaccuracy of code generated based on a large model is caused by different business personnel describing batch operations differently.
By constructing a knowledge graph based on metadata, code, and job types of historical jobs, the job type is determined using a target classification model. The most similar jobs with the highest similarity are retrieved from the knowledge graph, and the target code is generated by combining the large model, including extracting functional description information, code data source description, and keyword terms.
It improves the accuracy and efficiency of code generation, realizes the automatic generation of batch job code, and significantly improves processing efficiency and the work efficiency of financial institutions.
Smart Images

Figure CN121523653A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of artificial intelligence, and is applied to the field of financial technology, in particular, relates to a batch job code generation method and device, electronic equipment and program product. BACKGROUND
[0002] Under the background of digital transformation of the banking industry, batch job as a key link in processing large-scale data in the banking system, its automation level directly affects the operation efficiency and service quality of the bank. With the rapid development of artificial intelligence technology, especially the application of natural language processing large model, automatic code generation has become an important research direction to improve the development efficiency of batch job. Traditional code generation technology, whether based on model fine-tuning or simple retrieval enhancement, has shortcomings. The model fine-tuning method can optimize the generation effect through the data of a specific field, but it faces the problems of non-standardized demand description, lack of background knowledge and insufficient understanding of code dependence; while the retrieval enhancement based on code calling relationship enhances the context of code generation, but it is limited by the input length, and it is difficult to fully consider the complexity of the job.
[0003] In view of the problem that in the related technology, when generating batch job code based on a large model, due to different descriptions of batch job by different business personnel, the generated code is inaccurate, no effective solution has been proposed so far. SUMMARY
[0004] The main purpose of the present application is to provide a batch job code generation method, device, electronic equipment and program product, to solve the problem that in the related technology, when generating batch job code based on a large model, due to different descriptions of batch job by different business personnel, the generated code is inaccurate.
[0005] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a batch job code generation method is provided, which comprises: generating a knowledge graph based on the metadata, code and job type of historical jobs, wherein the historical jobs refer to batch jobs with generated codes; determining the job description information of the target job according to the business demand, and inputting the job description information into the target classification model to obtain the job type of the target job, wherein the target job refers to the batch job to be generated code; retrieving the most similar job to the target job in the knowledge graph according to the job type of the target job; inputting the job description information of the target job, the knowledge graph, the code of the similar job and the large model to generate the target code corresponding to the target job.
[0006] Further, the job description information of the target job, the knowledge graph, the code of the similar job and the input large model are input to generate the target code corresponding to the target job, including: extracting the function description information and the code data source description of the target job from the job description information and the knowledge graph through the large model; obtaining the dependent job of the target job from the knowledge graph, and determining the data structure of the code data source of the dependent job; identifying the keyword terms from the job description information based on keyword matching; inputting the function description information, the code data source description, the data structure, the job code of the similar job, the prompt word and the keyword terms into the large model to generate the target code corresponding to the target job.
[0007] Further, the function description information, the code data source description, the data structure, the job code of the similar job, the prompt word and the keyword term are input into the large model to generate the target code corresponding to the target job, including: when the target job belongs to modifying data, obtaining a similar modifying job based on the job with the highest similarity in the knowledge graph matching the code description document of the target job; determining the code change information of the similar modifying job according to the output result of the similar modifying job; inputting the function description information, the code data source description, the data structure, the job code of the similar job, the prompt word, the code change information and the keyword term into the large model to generate the target code corresponding to the target job.
[0008] Further, the knowledge graph is generated based on the metadata, the code and the job type of the historical job, including: constructing a job node according to the metadata of the historical job, wherein the metadata at least includes: job identification, job name, application information, maintenance information, dependent job; obtaining function description information by recursively describing the function of the code of the historical job; determining code submission information and code data source based on the code of the historical job, and constructing code submission node and data source node; constructing edges between the job node and the code submission node, the data source node and the data structure node, wherein the data structure node is a field in the data source node; clustering the historical jobs according to the code, the function description information and the code data source of the historical jobs, determining the job type of the historical jobs according to the clustering result, and adding the job type to the job node; generating the job knowledge graph according to the job node, the code submission node, the data source node and the edge.
[0009] Further, the code submission information and the code data source are determined based on the historical job code, and a code submission node and a data source node are constructed, including: determining the code submission information based on the code version library of the historical job, and constructing the code submission node, wherein the code submission node at least includes the following fields: submission identifier, submitter information, reviewer information, and submission description information; and parsing the code data source according to the historical job code, and constructing the data source node, wherein the code data source at least includes: input data source and output data source, and the data source node at least includes the following fields: data source name, application information, data source description, data source type, data structure node, and the data structure node at least includes the following fields: field name, field type, field description, data dictionary, field constraint, and whether it belongs to a required data source.
[0010] Further, the function description information is obtained by recursively describing the function of the historical job code, including: parsing the historical job code, and generating a call relationship tree based on the methods contained in the code; inputting the code information of the method corresponding to the leaf node in the call relationship tree into a text processing model, and outputting the function description information of the leaf node, wherein the function description information of the leaf node at least includes: method code, method function description, method input description, method output description, and description of the class to which the method belongs; traversing the parent node of the leaf node, and inputting the annotation information, code, prompt word, external explanation and connected leaf node of the parent node into the text processing model to generate the function description information of the parent node, wherein the external explanation is a code explanation obtained by searching in an external knowledge base; traversing from the parent node upwards until the root node of the call relationship tree, inputting the function description information of the node connected to the root node into the text processing model, and obtaining the function description information of the historical job.
[0011] Further, the historical jobs are clustered according to the historical job code, the function description information and the code data source, and the job type of the historical job is determined according to the clustering result, including: converting the historical job code into a code feature vector through a target pre-training model, wherein the target pre-training model is a model trained for code text; converting the function description information into a function feature vector through a word embedding model; converting the field information of the data source node corresponding to the code data source into a data feature vector, and the code data source at least includes: code input source and code output source; splicing the code feature vector, the function feature vector and the data feature vector to obtain the job feature vector of the historical job; clustering the job feature vector of the historical job based on a density-based clustering algorithm to obtain the clustering result, and merging and labeling the clustering result to obtain the job type of the historical job.
[0012] Further, the target job is based on the job type in the knowledge graph to retrieve the similar job with the greatest similarity between the target job, comprising: based on the job type of the target job in the knowledge graph for screening, obtaining the first job; when the target job belongs to the new data, using the term frequency-inverse document frequency algorithm to calculate the similarity based on the first vector corresponding to the job description document of the target job and the second vector corresponding to the job description document of the first job; when the target job belongs to the modified data, using the term frequency-inverse document frequency algorithm to calculate the similarity based on the third vector corresponding to the function description information of the target job and the fourth vector corresponding to the function description information of the first job; determine the candidate job in the first job according to the similarity, and determine the similar job based on the semantic similarity, organizational structure similarity, associated asset similarity and code similarity between the candidate job and the target job.
[0013] Further, the target job is based on the job type in the knowledge graph to retrieve the similar job with the greatest similarity between the target job, comprising: based on the job type of the target job in the knowledge graph for screening, obtaining the first job; when the target job belongs to the new data, using the term frequency-inverse document frequency algorithm to calculate the similarity based on the first vector corresponding to the job description document of the target job and the second vector corresponding to the job description document of the first job; when the target job belongs to the modified data, using the term frequency-inverse document frequency algorithm to calculate the similarity based on the third vector corresponding to the function description information of the target job and the fourth vector corresponding to the function description information of the first job; determine the candidate job in the first job according to the similarity, and determine the similar job based on the semantic similarity, organizational structure similarity, associated asset similarity and code similarity between the candidate job and the target job.
[0014] Further, after the clustering results are merged and labeled to obtain the job type of the historical job, the method further comprises: constructing a training data set according to the job type of the historical job and the code, function description information and code data source of the historical job; training the deep learning model using the training data set to obtain the target classification model, wherein the deep learning model comprises an attention mechanism.
[0015] Further, the field information of the data source node corresponding to the code data source is converted into a data feature vector, including: adopting a word embedding model to process the data source name and the data source description respectively to generate a name vector and a description vector; encoding the data source type to obtain a type vector; inputting the application identifier in the application information into a target coding model to generate an identifier vector, wherein the target coding model is obtained by training a self-encoder model using a one-hot code algorithm; merging the feature vectors corresponding to each field in the data structure through a pooling algorithm to obtain a data structure vector; and weighting and fusing the name vector, the description vector, the type vector, the identifier vector and the data structure vector to obtain the data feature vector.
[0016] To achieve the above object, according to another aspect of the present application, a batch job code generation device is provided, which comprises: a first generation unit configured to generate a knowledge graph based on metadata, code and job type of historical jobs, wherein the historical jobs refer to batch jobs for which the code has been generated; a classification unit configured to determine job description information of a target job according to business requirements, and input the job description information into a target classification model to obtain a job type of the target job, wherein the target job refers to a batch job for which the code is currently to be generated; a retrieval unit configured to retrieve a similar job with the greatest similarity to the target job in the knowledge graph according to the job type of the target job; and a second generation unit configured to input the job description information of the target job, the knowledge graph, the code of the similar job and an input large model to generate a target code corresponding to the target job.
[0017] To achieve the above object, according to an aspect of the present application, a computer program product is provided, which comprises a computer program, and the computer program is executed by a processor to implement any one of the batch job code generation methods described above, and the computer program is executed by the processor to implement the steps of the batch job code generation method in each embodiment of the present application.
[0018] To achieve the above object, according to an aspect of the present application, a computer readable storage medium is provided, which comprises stored computer instructions, wherein the computer instructions are executed by a processor to implement any one of the batch job code generation methods described above.
[0019] To achieve the above object, according to an aspect of the present application, an electronic device is provided, which comprises one or more processors and a memory, and the memory is configured to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement any one of the batch job code generation methods described above.
[0020] In the embodiment of the present application, a knowledge graph is generated based on the metadata, code and job type of historical jobs, wherein the historical jobs refer to batch jobs for which code has been generated; job description information of a target job is determined according to business requirements, and the job description information of the target job is input into a target classification model to obtain the job type of the target job, wherein the target job refers to a batch job for which code is currently to be generated; a similar job with the greatest similarity to the target job is searched in the knowledge graph according to the job type of the target job; and the job description information of the target job, the knowledge graph, the code of the similar job and an input large model are input into the large model to generate target code corresponding to the target job, thereby solving the technical problem that the generated code is inaccurate due to different descriptions of batch jobs by different business personnel when generating batch job code based on a large model.
[0021] By constructing a detailed knowledge graph containing historical job metadata, code and job type, comprehensive information of past batch jobs can be systematically organized and stored, achieving the technical effect of enhancing the understanding ability of batch jobs. At the same time, by classifying the description information of the target job through a deep learning model, the job type of the target job can be accurately identified, achieving directional guidance for code generation, and further achieving the technical effect of improving the relevance and efficiency of code generation. By searching the most similar historical job based on the target job type in the knowledge graph, inputting the target job description, knowledge graph information and similar job code into the large model for code generation, highly matched target code can be automatically output according to specific requirements and historical practices, achieving the automatic generation of batch job code, achieving the technical effect of significantly improving the accuracy and development speed of code generation, and further achieving the technical effect of improving the processing efficiency of batch jobs and the work efficiency of financial institutions. BRIEF DESCRIPTION OF DRAWINGS
[0022] The accompanying drawings, which form a part of this application, are included to provide a further understanding of the application and are incorporated in and constitute a part of this application. The embodiments of this application and their
[0023] Figure 1 is a hardware structure block diagram of a computer terminal (or mobile device) for implementing the batch job code generation method according to the embodiment 1 of the present application;
[0024] Figure 2 is a flowchart of an optional batch job code generation method according to the embodiment 1 of the present application;
[0025] Figure 3 is a flowchart of an optional batch job code generation method according to the embodiment 1 of the present application;
[0026] Figure 4is a schematic diagram of an optional knowledge graph based on historical batch job metadata generation provided by Embodiment 1 of the present application;
[0027] Figure 5 is a schematic diagram of an optional function description information generation process in a recursive manner provided by Embodiment 1 of the present application;
[0028] Figure 6 is a schematic diagram of an optional process for generating a data feature vector corresponding to a data source node provided by Embodiment 1 of the present application;
[0029] Figure 7 is a schematic diagram of a batch job code generation device provided by Embodiment 2 of the present application;
[0030] Figure 8 is a schematic diagram of a batch job code generation electronic device provided by Embodiment 3 of the present application. DETAILED DESCRIPTION
[0031] It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments.
[0032] It should be noted that the processing method, device, storage medium and electronic device of the present application file, and the method and device thereof can be used in the process of generating batch job code based on large models in the field of financial technology, which improves the accuracy of code generation, and can also be used in any field other than the field of financial technology. The application field of the processing method, device, storage medium and electronic device of the present application file is not limited.
[0033] It should be noted that the information collected (including but not limited to user device information, user personal information, collected data, used data, generated data, processed data, etc.) and data (including but not limited to data for analysis, stored data, displayed data, collected information, used information, generated information, processed information, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of related data comply with relevant laws, regulations and standards of relevant countries and regions, necessary security measures are taken, and public order and good customs are not violated, and appropriate operation entrances are provided for users to choose authorization or refusal. For example, the system and the related users or institutions are provided with an interface to provide the user with an appropriate operation entrance for the user to choose to agree or refuse the automatic decision result; if the user chooses to refuse, the expert decision process is entered.
[0034] Embodiment 1
[0035] According to the embodiments of the present application, a method for generating batch job code is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0036] The method embodiments provided by the embodiments of the present application can be executed in a mobile terminal, a computer terminal or similar computing device. Figure 1 is a hardware structure block diagram of a computer terminal (or mobile device) for implementing the method for generating batch job code according to the embodiments of the present application. As shown in Figure 1 , the computer terminal 10 (or mobile device) can include one or more (in the figure, 102a, 102b, …, 102n are used to show) processors 102 (the processor 102 can include but not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication function. In addition, it can also include a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which can be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. Those skilled in the art can understand that Figure 1 The structure shown is only schematic, which does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 10 can also include more or less components than those shown in Figure 1 , or have a different configuration from that shown in Figure 1 .
[0037] It should be noted that the one or more processors 102 and / or other data processing circuits described above can be referred to as "data processing circuits" herein. The data processing circuit can be embodied in whole or in part as software, hardware, firmware or any other combination. In addition, the data processing circuit can be a single independent processing module, or any one of the other elements combined into the computer terminal 10 (or mobile device) in whole or in part. As referred to in the embodiments of the present application, the data processing circuit as a kind of processor control (for example, the selection of the variable resistance terminal path connected with the interface).
[0038] The memory 104 can be used to store software programs of application software and modules, such as program instructions / data storage devices corresponding to the generation method of batch job code in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implements the generation method of batch job code described above. The memory 104 can include a high-speed random access memory, and can also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory 104 can further include a memory remotely arranged with respect to the processor 102, which can be connected to the computer terminal 10 through a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0039] The transmission device 106 is used to receive or send data via a network. The specific examples of the above-mentioned network can include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet in a wireless manner.
[0040] The display can be, for example, a touch screen type liquid crystal display (LCD), which can enable a user to interact with the user interface of the computer terminal 10 (or mobile device).
[0041] Under the above operating environment, the present application provides a generation method of batch job code as shown in Figure 2 Figure 2 is a flowchart of an optional generation method of batch job code according to Embodiment 1 of the present application.
[0042] In step S201, a knowledge graph is generated based on the metadata, code and job type of historical jobs, wherein the historical jobs refer to batch jobs for which the code has been generated.
[0043] In this embodiment 1, the process of constructing the knowledge graph involves the integration of metadata, code and job type data of historical jobs. Historical jobs refer to batch jobs that have code implementation. First, by traversing the batch job management platform, job ID, name, application ownership, maintenance department and dependency relationship metadata are collected. Then, the source code of historical jobs is extracted from the version control system, and code features are generated for each job. The job type is classified by a deep learning model based on code and function description. Based on the above information, nodes and edges are defined to construct the knowledge graph, where nodes represent jobs, code, function description and type, and edges represent the relationship between jobs and the association between jobs and other elements. This graph is used for subsequent batch job retrieval and code generation tasks, providing rich context and historical data support.
[0044] Step S202, according to the business requirement, the job description information of the target job is determined, and the job description information is input into the target classification model to obtain the job type of the target job, wherein the target job refers to the batch job whose code is currently to be generated.
[0045] In this embodiment 1, according to the business requirement, first, the job description information of the target job, i.e. the batch job whose code is currently to be generated, is determined. This information includes the functional requirements, input and output specifications and other key elements of the job. Then, the job description information is input into the pre-trained target classification model. The model uses deep learning technology to predict the job type based on the feature vector of the job description. The construction of the feature vector covers the vectorization representation of the job code, function description text and input and output assets. Through model operation, the job type classification result of the target job is finally obtained, providing type guidance for subsequent code generation. This process ensures the accurate determination of the job type, thereby improving the relevance and efficiency of code generation.
[0046] Step S203, according to the job type of the target job, the most similar job to the target job is retrieved in the knowledge graph.
[0047] In this embodiment 1, after determining the job type of the target job, the type is retrieved in the constructed knowledge graph to identify the job instance with the maximum similarity to the target job, i.e. the similar job. Then, the job with the highest similarity value is selected as the reference sample of the target job, providing guidance for the specific implementation of subsequent code generation. This retrieval step is a deep analysis based on type matching, aiming to improve the accuracy and efficiency of code generation.
[0048] Step S204, input the job description information of the target job, the knowledge graph, the code of the similar job and the input large model to generate the target code corresponding to the target job.
[0049] In this embodiment 1, the job description information of the target job is input into the trained large model together with the code of the similar jobs retrieved in the knowledge graph. The job description information includes the functional requirements, input and output specifications and their types of the target job. The knowledge graph provides information about the metadata, code features and associated assets related to the job. After receiving this information, the large model uses its pre-training ability for code generation tasks to generate the target code required by the target job in combination with the context from the knowledge graph and the specific implementation of the similar jobs. This process makes full use of the coding practices and project knowledge of historical jobs to improve the accuracy and efficiency of code generation.
[0050] Optionally, in the batch job code generation method provided in embodiment 1 of the present application, the target job description information, the knowledge graph, the code of the similar jobs and the input large model are used to generate the target code corresponding to the target job, including: extracting the functional description information and the code data source description of the target job from the job description information and the knowledge graph by the large model; obtaining the dependent jobs of the target job from the knowledge graph and determining the data structure of the code data source of the dependent jobs; identifying the keyword terms from the job description information based on keyword matching; inputting the functional description information, the code data source description, the data structure, the job code of the similar jobs, the prompt words and the keyword terms into the large model to generate the target code corresponding to the target job.
[0051] In this embodiment 1, in order to generate batch job code that matches business requirements to a high degree, first, a large pre-training model is used to analyze the job description information of the target job and the knowledge graph, accurately extracting the functional description of the job and the data source description related to the code, ensuring that the starting point of code generation matches the actual requirements. Then, according to the dependency relationship of the target job, the code data source associated with the dependent jobs is accurately obtained from the constructed knowledge graph, and the detailed data structure of these data sources is clearly defined, providing necessary context information for subsequent code generation and avoiding information loss during code generation. Among them, the dependent jobs can be obtained from the corresponding nodes in the knowledge graph based on job identification information. Secondly, keyword matching technology is used to deeply analyze the description information of the target job, and identify the key terms in the description. The identification of these terms helps to enhance the model's understanding of job requirements and improve the relevance of code generation. Finally, the previously extracted functional description information, code data source description, data structure information, most similar job code instances, and prompt words for code generation and keyword terms identified from the description are input into the large pre-training model. The model outputs target code that matches business requirements based on the above information.
[0052] Through the above steps, the technical effect of automatic batch job code generation is achieved, not only ensuring that the generated code is highly consistent with the job requirements, but also improving the efficiency and accuracy of code generation, providing strong technical support for the development of batch jobs of the bank system.
[0053] Optionally, in the batch job code generation method provided in Embodiment 1 of the present application, the function description information, the code data source description, the data structure, the job code of the similar job, the prompt word and the keyword term are input into the large model to generate the target code corresponding to the target job, including: when the target job belongs to modifying data, matching the job with the highest similarity based on the code description document of the target job in the knowledge graph to obtain a similar modification job; determining the code change information of the similar modification job according to the output result of the similar modification job; inputting the function description information, the code data source description, the data structure, the job code of the similar job, the prompt word, the code change information and the keyword term into the large model to generate the target code corresponding to the target job.
[0054] In Embodiment 1, in order to generate batch job code that accurately reflects the modification requirements, first, in the knowledge graph, based on the code description document of the target job, a pre-set similarity calculation algorithm is used to match the most similar historical job, which is defined as a similar modification job to obtain its existing code implementation and modification background. Then, the output result of the similar modification job is analyzed in detail to determine the specific information of the code change, including the position, nature and scope of the modification, to provide direct reference and modification basis for the generation of new job code. Secondly, the keyword matching technology is used to identify the key terms from the description information of the target job, to enhance the understanding of the modification intention of the model and ensure the accuracy of the code generation. Finally, the function description information, the code data source description, the data structure, the code of the similar job, the prompt word, the code change information and the keyword term of the target job are integrated and input into the large pre-training model as input to prompt the model to generate the target code that meets the modification requirements according to the input information.
[0055] By implementing the above steps, the technical effect of using historical job data and knowledge graph to guide automatic code generation in the batch job code modification scenario is achieved, not only reducing the workload of manual code modification, but also ensuring the correctness and consistency of code modification, greatly improving the efficiency and quality of batch job code modification.
[0056] Optionally, in the batch job code generation method provided in Embodiment 1 of the present application, the knowledge graph is generated based on the metadata, code and job type of the historical job, comprising: constructing a job node according to the metadata of the historical job, wherein the metadata at least includes: job identification, job name, application information, maintenance information, and dependent job; obtaining function description information by recursively describing the function of the code of the historical job; determining code submission information and code data source based on the code of the historical job, and constructing a code submission node and a data source node; constructing edges between the job node and the code submission node, the data source node and the data structure node, wherein the data structure node is a field in the data source node; clustering the historical job according to the code, the function description information and the code data source of the historical job, determining the job type of the historical job according to the clustering result, and adding the job type to the job node; and generating a job knowledge graph according to the job node, the code submission node, the data source node and the edge.
[0057] In Embodiment 1, in order to systematically organize and fully utilize the information of historical batch jobs in the bank system, first, the metadata of historical jobs is obtained by traversing the batch job management platform, including job identification, job name, application information, maintenance information, and dependent jobs, a detailed job node is constructed, and the basic attributes of historical jobs are recorded completely. Then, all batch jobs are identified based on the version management system, and the batch job code is extracted. By recursively analyzing the historical job code, text information describing the function of the code is accurately generated, i.e. the above-mentioned function description information, which aims to clearly define the specific execution logic of each job and provide a basis for subsequent job type division. Secondly, based on the code version library, the code submission records of historical jobs are analyzed, key submission information is extracted, and the data sources involved in the job code are identified, further constructing the code submission node and the data source node to fully reflect the development history and data interaction process of the job. The association between the job node and the code submission node, the data source node and the internal field of the data structure node is constructed, the purpose is to construct a dynamic and information-rich job network for subsequent retrieval and analysis. Finally, according to the historical job code, the function description information and the code data source, the jobs are classified by using a deep learning clustering algorithm, and the job type is labeled to the job node. This step aims to clearly divide jobs of different properties and provide category basis for job retrieval.
[0058] Through the above series of steps, a job knowledge graph integrating historical job metadata, code features, code submission details, data sources and job types is constructed, achieving the technical effect of effectively integrating and structuring the historical information of bank batch jobs. The construction of the knowledge graph provides rich context information and reference data for the intelligent generation of subsequent jobs, thereby significantly improving the accuracy and efficiency of code generation.
[0059] Optionally, in the batch job code generation method provided in Embodiment 1 of the present application, the code submission information and the code data source are determined based on the code of the historical job, and the code submission node and the data source node are constructed, including: determining the code submission information based on the code version library of the historical job, and constructing the code submission node, wherein the code submission node at least includes the following fields: submission identifier, submitter information, reviewer information, and submission description information; parsing the code data source according to the code of the historical job, and constructing the data source node, wherein the code data source at least includes: input data source and output data source, and the data source node at least includes the following fields: data source name, application information, data source description, data source type, and data structure node, and the data structure node at least includes the following fields: field name, field type, field description, data dictionary, field constraint, and whether it belongs to a required data source.
[0060] In Embodiment 1, in order to record the development process and data flow process of the bank batch job in detail, first, the detailed information of each code submission is accurately extracted from the code version library of the historical job, including the submission identifier, the identity information of the submitter, the related information of the reviewer, and the specific description of the submission, a detailed code submission node is constructed to ensure that the development changes of each job can be traced. Then, by deeply analyzing the historical job code, the attribute details of the input and output data sources are recognized, the data source node is constructed, covering the name of the data source, the application to which it belongs, the purpose description of the data source, the type, and the data structure node associated with it, so that the overall situation of the data source can be clearly displayed. Secondly, the construction of the data structure node is refined to ensure that each field in the data source contains the field name, field type, field purpose description, data dictionary, field constraint condition, and a flag indicating whether it is necessary for job execution, so as to improve the understanding of data characteristics and provide specific data basis for subsequent job type judgment and code generation. Finally, all the constructed nodes are integrated to form a job knowledge graph covering job metadata, code submission details, and data source characteristics, ensuring that the dependency relationship and data flow clues between jobs are clearly displayed.
[0061] Through the above steps, the development process and data flow characteristics of the bank batch job are structured and visualized, making the query and analysis of job information more convenient and accurate, paving the way for code generation based on similar job historical experience, and providing a solid data support for job type identification and job dependency relationship analysis, thereby improving the intelligent level and efficiency of batch job code generation.
[0062] Optionally, in the batch job code generation method provided in Embodiment 1 of the present application, the function of the code of the historical job is described in a recursive manner to obtain function description information, including: parsing the code of the historical job, generating a call relationship tree based on the methods contained in the code; inputting the code information of the method corresponding to the leaf node in the call relationship tree into the text processing model, and outputting the function description information of the leaf node, wherein the function description information of the leaf node at least includes: method code, method function description, method input description, method output description, and description of the class to which the method belongs; traversing the parent node of the leaf node, inputting the parent node's annotation information, code, prompt word, external explanation and connected leaf node into the text processing model to generate the function description information of the parent node, wherein the external explanation is a code explanation obtained by searching in an external knowledge base; traversing from the parent node upwards until the root node of the call relationship tree, inputting the function description information of the nodes connected to the root node into the text processing model to obtain the function description information of the historical job.
[0063] In Embodiment 1, there are three core objectives in the process of generating function description based on batch code: (1) accuracy of function description, i.e., the function description accurately reflects the function of the code and minimizes errors; (2) comprehensiveness of function description, i.e., the function description comprehensively describes the functions of the batch job; and (3) standardization, i.e., the function descriptions of similar jobs are as standardized and consistent as possible.
[0064] To meet the requirements of accuracy, comprehensiveness and standardization of function description, the code of the historical job is first analyzed in detail to construct a call relationship tree reflecting the internal method call logic of the code, ensuring a comprehensive understanding of the code structure. Then, function description is generated for the leaf nodes of the call relationship. Specifically, the code, code annotation, external explanation and model prompt word of the method corresponding to the leaf node are determined and input into the text processing model, and the function description information of the leaf node is output, including: leaf node method code, method function description, method input description, method return description, and description of the class to which the method belongs. Among them, the text processing model can be a code-to-function description special-purpose large model, the external explanation is obtained by indexing the external knowledge base through vector or regular matching of code annotations to obtain key information or term explanations, which strengthens the model's understanding of the code content, and the description of the class to which the method belongs is obtained by inputting the code of the class to which the method belongs and the description of all methods in the class into the text processing model to generate an overview of the entire class function.
[0065] Secondly, when generating the requirement description of the parent node, the method code, comment information, external explanation, model prompt of the parent node and the method function description, class description, input parameter description, return description of the leaf node referenced by the parent node are taken as the input of the large model, and the input description, output description, function description, class description of the parent node method are obtained through the text processing model (such as the code-to-function description special large model mentioned above). Finally, continuously traverse upwards until the root node of the call relationship tree, and input all the collected node function description information into the text processing model again to finally extract the comprehensive function description information of the entire historical job, ensuring the completeness and accuracy of the description.
[0066] In an optional embodiment, in addition to the above recursive method of generating function description, the specification of the generated description is also constrained, so that similar job function descriptions are also similar, which facilitates better similarity index effect when subsequent similar batch jobs are searched. The specification of the function description is mainly realized by the prompt engineering and the special code-to-function description special large model, and the prompt engineering mainly includes role, code, context, standardized expression, skill, output requirement and output format. The standardized expression declares the standardized expression mode of different batch jobs. The output format declares the overall structure requirement of the method.
[0067] Exemplarily, the prompt word structure at least includes: role, code, context information, normalized expression, skill, output requirement and output format. For the role, the prompt word includes: you are a code function explanation expert, you can generate the specification description information of the code function according to the code content combined with the context and in the specified format. For the code, the prompt word can include: collect node code. For the context information, the prompt word can include: based on the code annotation in the node and the index knowledge base, obtain the explanation of the key information or term. For the normalized expression, the prompt word can include: for the file splitting scene, express as "file splitting according to {specific file splitting rule}". For the skill, the prompt word can include: skill 1, you can summarize the main function of the method, method input and method return based on the code content, context and normalized expression; skill 2, when refining the code function description, different functions can be described by referring to the sentences in the normalized expression. For the output requirement, the prompt word can include: 1. when outputting, output "method main function", "method input parameter" and "method return" three parts respectively according to the output format; 2. in the description of "method main function", first summarize the main function of the method in one sentence, then list the core functions, and the number of points is not more than five, and each small point is one sentence. For the output format, the prompt word can include: please output according to the following format: "``` method main function: {one sentence to summarize the main function}: its core functions are as follows: 1. {core function 1}; 2. {core function 2}; 3. omitted; method input parameter: {parameter 1 type}: {parameter 1 function description}; {parameter 2 type}: {parameter 2 function description}; omitted; method return: {return object type}; {return object function description}```".
[0068] Through the above steps, the technical effect of accurately expressing the function of the historical job code in the form of a specification text is achieved, which not only facilitates the understanding of the execution logic of the job, but also lays a solid foundation for subsequent code generation based on similar jobs. This method effectively integrates the structure information of the code, the function description and the external knowledge, significantly improves the depth of code understanding, and thus improves the accuracy and efficiency of code generation.
[0069] Optionally, in the batch job code generation method provided in Embodiment 1 of the present application, the historical jobs are clustered according to the code, function description information, and code data source of the historical jobs, and the job types of the historical jobs are determined according to the clustering results, including: converting the code of the historical jobs into a code feature vector through a target pre-training model, wherein the target pre-training model is a model trained for code text; converting the function description information into a function feature vector through a word embedding model; converting the field information of the data source node corresponding to the code data source into a data feature vector, the code data source at least including a code input source and a code output source; splicing the code feature vector, the function feature vector, and the data feature vector to obtain a job feature vector of the historical jobs; clustering the job feature vector of the historical jobs based on a density-based clustering algorithm to obtain a clustering result, and merging and labeling the clustering result to obtain the job types of the historical jobs.
[0070] In Embodiment 1, in order to systematically analyze and classify bank batch jobs, first, a target pre-training model (i.e., CodeBERT model, which can capture the context dependency of code and text at the same time through the way of Bidirectional Encoder Representations from Transformers (BERT), and thus performs well on various code-related downstream tasks) trained for code text is used to convert the code of the historical jobs into a high-dimensional code feature vector, which realizes the abstract expression of code structure and logic, facilitating subsequent numerical analysis. Then, a word embedding model is used to process the function description information of the jobs to convert it into a function feature vector, which aims to capture the semantic characteristics in the description and provide key basis for job type identification. Secondly, for the code data source of the historical jobs, including the input and output sources, the field information in the data source node is converted into a data feature vector through a specific algorithm, which focuses on the characteristics of data interaction and further enriches the dimensions of job features. Finally, the code feature vector, the function feature vector, and the data feature vector obtained in the previous steps are spliced to form a job feature vector that comprehensively reflects the characteristics of the jobs. Then, a density-based clustering algorithm (Density-Based Spatial Clustering of Applications with Noise, referred to as DBSCAN) is used to cluster and analyze the job feature vectors, and the preliminary clustering results are output. The clustering results are manually reviewed, and if necessary, they are merged and labeled to determine the accurate job types of the historical jobs.
[0071] Through the above steps, the technical effect of automatically classifying bank batch jobs according to their inherent characteristics is achieved. The division of job types is based on the comprehensive consideration of codes, function descriptions, and data source interactions, rather than simple label matching, ensuring the scientificity and practicality of classification and providing important information support for subsequent code generation and optimization based on job types.
[0072] Optionally, in the batch job code generation method provided in Embodiment 1 of the present application, the similar job with the greatest similarity between the target job and the similar job is searched in the knowledge graph according to the job type of the target job, comprising: screening in the knowledge graph based on the job type of the target job to obtain a first job; when the target job belongs to new data, using the term frequency-inverse document frequency algorithm to calculate the similarity based on a first vector corresponding to the job description document of the target job and a second vector corresponding to the job description document of the first job; when the target job belongs to modified data, using the term frequency-inverse document frequency algorithm to calculate the similarity based on a third vector corresponding to the function description information of the target job and a fourth vector corresponding to the function description information of the first job; determining a candidate job in the first job according to the similarity, and determining the similar job based on the semantic similarity, organizational structure similarity, associated asset similarity, and code similarity between the candidate job and the target job.
[0073] In Embodiment 1, in order to accurately identify historical jobs similar in nature to the target job, first, according to the job type of the target job (for example, file splitting task, file conversion task, business processing task, etc.), a first job set of the same type is screened out in the constructed knowledge graph, aiming to narrow the search range and improve the matching efficiency. Then, if the target job is in the new data scenario, the term frequency-inverse document frequency (TF-IDF) algorithm is used to calculate the similarity between the first vector generated based on the job description document of the target job and the second vector generated based on the job description document of each job in the first job set. This calculation process aims to quantify the degree of semantic similarity between job description texts. Secondly, in the case of modified data, the TF-IDF algorithm is also used, but this time the similarity is calculated based on the third vector generated based on the function description information of the target job and the fourth vector generated based on the function description information of each job in the first job set. The purpose is to accurately locate the functionally similar historical jobs. Finally, following the calculated similarity, the top m jobs in the first job set are selected as candidate jobs based on the multiple similarity indexes between the candidate jobs and the target job, including semantic similarity, organizational structure similarity, associated asset similarity, and code similarity, to comprehensively determine the final similar job, ensuring that the selected job is most matched with the target job in multiple dimensions.
[0074] Through the above steps, the technical effect of efficiently and accurately retrieving the job with the highest similarity from the historical batch job is achieved, which not only promotes the intelligentization of the code generation process, but also improves the quality and applicability of the generated code, thereby significantly enhancing the accuracy and efficiency of generating new code based on historical jobs in the bank batch job scenario.
[0075] Optionally, in the batch job code generation method provided in Embodiment 1 of the present application, the similar jobs are determined based on the semantic similarity, organizational structure similarity, associated asset similarity and code similarity between the candidate jobs and the target job, comprising: calculating the code similarity based on the code feature vectors of the target job and the candidate jobs; when the target job belongs to new data, calculating the semantic similarity based on the first vector and the second vector, and when the target job belongs to modified data, calculating the semantic similarity based on the third vector and the fourth vector; calculating the organizational structure similarity based on the organizational structure level of the developer of the target job, the organizational structure level of the developer of the candidate job, and the common organizational level of the developer of the target job and the developer of the candidate job; calculating the associated asset similarity based on the code data source of the target job and the code data source of the candidate job; weighting and fusing the semantic similarity, the organizational structure similarity, the associated asset similarity and the code similarity, and determining the similar jobs in the candidate jobs according to the fused similarity.
[0076] In Embodiment 1, in order to quantitatively evaluate the correlation between the target job and the candidate job, the main task is to accurately sort the candidate jobs and select the top n batch jobs with the highest similarity to obtain the similar jobs as described above. Among them, the calculation of similarity includes: semantic similarity , organizational structure similarity , associated asset similarity and code similarity .
[0077] First, the CodeBert model is used to generate the hidden space vector, and then the cosine similarity is used to calculate the vector distance to obtain the code similarity, which reveals the degree of similarity of the underlying code logic of the job. Then, according to the different states of the target job, the job description document vector or the function description information vector is used to calculate the similarity between the corresponding vectors of the candidate jobs, i.e. semantic similarity, which aims to measure the degree of fit of the job at the text content level. Specifically, for jobs of new data type, the text similarity of the job description documents of the two jobs is calculated. For job modification tasks, the similarity between the function description information of the two jobs is calculated. It should be noted that the function description similarity of the two jobs mentioned here is based on the recursive function description generation method described above, i.e. the text describing the function of the code obtained by layer-by-layer summarization of the source code by the code-to-function description special model.
[0078] Secondly, considering the organizational structure level information of the job developers, the organizational structure similarity is obtained by comparing the level positions and common superior levels of the target job and the candidate job developers, aiming to reflect the consistency of the organizational environment between jobs. Specifically, the Wu-Palmer algorithm is used to calculate the organizational structure similarity, and the calculation process can be shown in Formula One.
[0079] (I)
[0080] wherein, represents the nearest common ancestor node of the batch jobs A and B, represents the depth of the nearest common ancestor node of the organizational affiliation of the batch jobs A and B, and the deeper the depth, the closer the positions of A and B in the organizational structure, that is, they are more likely to belong to the same department or similar business fields, respectively represent the depths of the batch jobs A and B in the organizational structure.
[0081] For example, the organizational structure of the entire enterprise is 5 layers, which are company, branch, department, group, and individual, i.e. the maximum distance is 4. If the developers of job A and job B are in different departments of the same branch. Then the distance to the common ancestor is 2, and based on the above formula (2x2) / (4+4), the similarity is 0.5.
[0082] Furthermore, based on the code data sources of the target job and the candidate job, the correlation asset similarity is evaluated by calculating the data source overlap degree, and this index emphasizes the similarity of the job data interaction mode. Specifically, the Jaccard algorithm is used to calculate the similarity of the batch job correlation asset similarity, and the calculation process can be shown in Formula Two.
[0083] (II)
[0084] wherein, |A∩B| represents the intersection size of set A and set B, i.e. the number of assets commonly associated with batch jobs A and B. |A∪B| represents the union size of set A and set B, i.e. the sum of the number of assets associated with batch jobs A and B. For example, the assets associated with batch job A are [a, b, e, f, g], and the assets associated with batch job B are [a, c, f], then the intersection is [a, f], and the union is [a, b, c, e, f, g], and the similarity is 0.33.
[0085] Finally, the semantic similarity, organizational structure similarity, correlation asset similarity and code similarity calculated are weighted and fused, and according to the similarity value after fusion, the most similar job instance to the target job is selected from the candidate jobs, ensuring the high relevance of the search results.
[0086] Specifically, for the job modification task, the calculation formula can be as follows, wherein, represents the weight of each data item. For the job addition task, since there is no code, the calculation formula can be as follows, wherein, represents the weight of each data item.
[0087] Through the above steps, the technical effect of objectively and accurately determining the similarity of the target job and the historical batch job by using the multi-dimensional similarity index is achieved. This method surpasses the limitations of a single index, provides a more comprehensive job matching perspective, and greatly improves the accuracy and applicability of code generation or modification based on similar jobs.
[0088] Optionally, in the batch job code generation method provided in Embodiment 1 of the present application, after the clustering results are merged and labeled to obtain the job type of the historical job, the above method further comprises: constructing a training data set according to the job type of the historical job and the code, function description information and code data source of the historical job; training a deep learning model using the training data set to obtain a target classification model, wherein the deep learning model includes an attention mechanism.
[0089] In Embodiment 1, in order to construct an efficient batch job type identification system, first, according to the existing historical jobs, the job type, code, function description information and code data source are carefully sorted to form a structured training data set. This preparatory work ensures the data quality and richness of subsequent model training. Then, a deep learning model containing an attention mechanism is selected. This model can focus on the key parts of the input data, improving the classification accuracy. The constructed training data set is input into the model, and through repeated iterative training, the model parameters are adjusted so that the model can automatically learn and distinguish different job types based on the multi-element characteristics of the job. Secondly, close attention is paid to the risk of overfitting during model training, and regularization techniques or other preventive measures are timely adopted to ensure the generalization ability of the model. Finally, after training, the model is strictly tested and verified to ensure that it can accurately predict the job type on unknown data and meet the expected classification performance standards.
[0090] Through the above steps, the technical effect of automatically identifying the bank batch job type by using the deep learning model is achieved. This method not only can quickly and accurately classify a large number of jobs, but also can gradually optimize the model performance as new data is continuously added, providing strong technical support for subsequent intelligent code generation and optimization strategy formulation based on job type.
[0091] Optionally, in the batch job code generation method provided in Embodiment 1 of the present application, the field information of the data source node corresponding to the code data source is converted into a data feature vector, including: using a word embedding model to process the data source name and the data source description respectively to generate a name vector and a description vector; encoding the data source type to obtain a type vector; inputting the application identifier in the application information into a target coding model to generate an identifier vector, wherein the target coding model is obtained by training a self-encoder model using a one-hot code algorithm; merging the feature vectors corresponding to each field in the data structure through a pooling algorithm to obtain a data structure vector; and weighting and fusing the name vector, the description vector, the type vector, the identifier vector and the data structure vector to obtain the data feature vector.
[0092] In Embodiment 1, for a single data source asset involved in a batch job, there are usually five fields including a data source name, an application ID, a data source description, a data source type and a data structure. Therefore, the feature vector of a single data source asset can be generated by weighting and aggregating the feature vectors of the five fields (corresponding to the name vector, the identifier vector, the description vector, the type vector and the data structure vector described above).
[0093] First, the data source name and description are processed using a word embedding model to be converted into a numerical name vector and a description vector respectively. Then, based on the data source type, an encoding method is used to generate a type vector. Next, since the application identifier in a financial institution often has a naming rule and a clear length limit, a character-level one-hot code algorithm can be used for encoding and training a variational auto-encoder (VAE self-encoder model, i.e., the target coding model described above) to generate a feature vector, and an identifier vector is output. Then, a pooling algorithm is used to merge the feature vectors of each field in the data structure to form a data structure vector. This step is crucial in integrating field information and extracting the overall features of the data structure.
[0094] Specifically, for the generation of the feature vector of each field, each field has field name, field type, data dictionary, field description, and whether it is necessary, etc. attributes. Among them, the field name, field description, and data dictionary can use word embedding to generate a feature vector, the field type uses one-hot encoding, and whether it is necessary uses 0-1 encoding. The vectors corresponding to each attribute of the field are spliced, and the vector representation of the field, i.e., the field vector, is obtained, i.e., field vector = [field name vector, field description vector, field type vector, data dictionary vector, whether necessary vector].
[0095] Finally, the pre-generated name vector, description vector, type vector, identification vector, and data structure vector are fused according to certain weights to form a comprehensive data feature vector. The fusion process aims to build a multi-dimensional vector representation that comprehensively reflects the characteristics of the data source.
[0096] It should be noted that the input and output of a batch job can be represented by two vectors, namely the input asset vector and the output asset vector. Since the input or output can involve multiple assets. For example, the input is [file1, file2, file3]. Since step 1 has generated a feature vector for a single asset, a pooling method can be used to merge the feature vectors of multiple input files into one feature vector.
[0097] Through the above steps, the technical effect of converting the data source involved in the bank batch job into a numerical feature vector is achieved. The construction of the data feature vector not only provides a quantitative basis for the automation of the batch job, but also promotes the in-depth understanding and accurate matching of the association between the batch job and the data source, and creates favorable conditions for intelligently generating batch job code.
[0098] Optionally, in the present embodiment 1, Figure 3 is an optional flowchart of generating batch job code according to the present embodiment 1. As shown in Figure 3 , the flow mainly includes three steps: generating a batch job knowledge graph based on batch job associated metadata and derived fields generated based on large model technology; retrieving the most similar batch job from the batch job knowledge graph based on the given job addition task or job modification task; the large model generates batch job addition or modification code by taking the most similar batch job as a reference. Among them, generating a batch job knowledge graph mainly includes three steps: generating a batch job basic knowledge graph based on batch job associated metadata; generating a standardized batch job function description through recursive method based on batch job code; generating a batch job type based on batch job code, function description, and input and output.
[0099] Optionally, in the present embodiment 1, Figure 4 is an optional knowledge graph generated based on the metadata of the historical batch job according to the present embodiment 1. As shown in Figure 4 , the nodes include: job nodes, code submission nodes (such as Figure 4 submission records), data source nodes, data structure nodes. The edges include: edges between submission records in the job node and code submission nodes, edges between input data sources (such as Figure 4 job inputs) in the job node and data source nodes, and edges between output data sources (such as Figure 4edges between the job nodes and the data source nodes, edges between the data source nodes and the data structure nodes, and edges between the data structure nodes.
[0100] The job node includes the following information: job identification (such as the current job ID in Figure 4 ), job name, application information (such as the application name in Figure 4 ), maintenance information (such as the maintenance department in Figure 4 ), dependent jobs (such as the previous job ID in Figure 4 , or the previous dependent job ID), submission node, job code, function description information (such as the function description generated based on the code in Figure 4 ), job description information (such as the detailed design document in Figure 4 ), batch job type, data source node (such as the job input and job output in Figure 4 ). The code submission node includes the following information: submission identification (such as the job submission ID in Figure 4 ), submitter information, auditor information, changed code, original submission information, submission description information (such as the normalized submission description information in Figure 4 ). The data source node includes the following information: data source name, data source description (such as the data source explanation in Figure 4 ), application information (such as the application to which the data source belongs in Figure 4 ), data source type, data structure node. The data structure node includes the following information: field name, field type, field description (such as the field Chinese description in Figure 5 ), data dictionary, field constraint, and whether it belongs to a required data source (such as whether it is required in Figure 5 ).
[0101] Optionally, in this embodiment 1, Figure 6 is a flowchart of generating function description information based on a recursive manner according to the embodiment 1 of the present application. As shown in Figure 6As shown, first, the batch job is parsed by syntax, and the call relationship graph of the batch job is drawn. In the call relationship graph, each node except the node corresponding to the class of the batch job is a method. Starting from the leaf node of the call relationship, the function description of the leaf node is generated. A leaf node includes five parts, i.e., the leaf node method code, the method function description, the method input description, the method return description, and the class description to which the method belongs. Specifically, the method body content, the comment, the external knowledge, and the prompt word of the leaf node are input into the large model, the code-to-function description special large model is used to obtain the input description, the output description, and the function description of the method of the leaf node. The retrieval method of the external knowledge is to index the external knowledge base by vector or regular matching of the code comment to obtain the explanation of the key information or terms, and to strengthen the understanding of the code content by the model. The class description to which the method belongs is to input the class code and the description of all methods in the class as input, and generate an overview of the entire class function. When generating the requirement description of the parent node, the method body content, the comment, the external knowledge, and the prompt word of the parent node and the method function description, the class description, the input description, and the return description of the leaf node called by the parent node are input into the large model, the code-to-function description special large model is used to obtain the input description, the output description, the function description, and the class description of the method of the parent node. Finally, the root node is a class representing the entire batch job. The code and the function description of all methods of the class are input into the code-to-function description special model, and finally the description of the entire job is obtained.
[0102] Optionally, in Embodiment 1, Figure 7 is a flowchart for generating a data feature vector corresponding to a data source node according to Embodiment 1 of the present application. The input and output of a batch file can involve multiple files. For example, a job reads the contents of multiple tables and writes them into a file, or a job reads multiple files and writes them into a table. In order to enable the generated feature vector to express the characteristics of the batch to the greatest extent, the following method is used to construct the input and output feature vector. As shown in Figure 7 For a single asset involved in a batch job, it usually includes five fields, i.e., data source name, application ID, data source description, data source type, and data structure. Therefore, the feature vector of the entire asset can be generated by weighted aggregation of the feature vectors of the five fields.
[0103] For the data source name vector and the data source description vector generation, since the fields are of text type, a word embedding method can be used for generation. For the application ID vector generation, since the application IDs in the bank system are often named regularly and have a clear length limit. A character-level One-Hot can be used for encoding and a VAE autoencoder model can be trained for generating the feature vector. For the data structure vector generation, since it is composed of multiple fields, a feature vector can be generated for each field, and multiple field vectors can be combined into a feature vector of the entire data structure through methods such as average pooling or maximum and minimum pooling. For the feature vector generation of each field, the field has field name, field type, data dictionary, field description, and whether it is required, etc. attributes. Among them, the field name, field description, and data dictionary can use word embedding to generate a feature vector, the field type uses One-Hot encoding, and the whether it is required uses 0-1 encoding. The vectors corresponding to each attribute of the field are spliced, and the vector representation of the field, i.e., the field vector, is obtained, i.e., field vector = [field name vector, field description vector, field type vector, data dictionary vector, whether it is required vector].
[0104] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown.
[0105] In summary, the batch job code generation method provided by the embodiments of the present application generates a knowledge graph based on the metadata, code and job type of the historical job, wherein the historical job refers to the batch job for which the code has been generated; determines the job description information of the target job according to the business requirements, and inputs the job description information into the target classification model to obtain the job type of the target job, wherein the target job refers to the batch job for which the code is currently to be generated; retrieves the most similar job to the target job in the knowledge graph according to the job type of the target job; inputs the job description information of the target job, the knowledge graph, and the code of the similar job into the large model to generate the target code corresponding to the target job, thereby solving the problem that in related technologies, when generating batch job code based on a large model, due to different descriptions of batch jobs by different business personnel, the generated code is inaccurate.
[0106] By constructing a detailed knowledge graph containing historical job metadata, code and job type, the comprehensive information of past batch jobs can be systematically sorted and stored, achieving the technical effect of enhancing the understanding ability of batch jobs. At the same time, by classifying the description information of the target job through a deep learning model, the job type of the target job can be accurately identified, realizing the directional guidance of code generation, and further achieving the technical effect of improving the relevance and efficiency of code generation. By retrieving the most similar historical job based on the target job type in the knowledge graph, inputting the target job description, knowledge graph information and similar job code into the large model for code generation, highly matched target code can be automatically output according to specific needs and historical practices, realizing the automatic generation of batch job code, achieving the technical effect of significantly improving the accuracy and development speed of code generation, and further achieving the technical effect of improving the processing efficiency of batch jobs and the work efficiency of financial institutions.
[0107] Embodiment 2
[0108] The embodiment of the present application also provides a batch job code generation device. It should be noted that the batch job code generation device of the embodiment of the present application can be used to execute the batch job code generation method provided by the embodiment of the present application. The batch job code generation device provided by the embodiment of the present application is introduced as follows.
[0109] According to the embodiment of the present application, a device for implementing the batch job code generation method is also provided, Figure 8 is a schematic diagram of the batch job code generation device provided by Embodiment 2 of the present application. As Figure 8 shown, the device includes:
[0110] Specifically, the first generation unit 701 is configured to generate a knowledge graph based on the metadata, code and job type of historical jobs, wherein the historical jobs refer to batch jobs that have generated code.
[0111] The classification unit 702 is configured to determine the job description information of the target job according to the business requirements, and input the job description information into the target classification model to obtain the job type of the target job, wherein the target job refers to the batch job to be generated code.
[0112] The retrieval unit 703 is configured to retrieve the most similar job to the target job in the knowledge graph according to the job type of the target job.
[0113] The second generation unit 704 is configured to input the job description information of the target job, the knowledge graph, the code of the similar job into the large model, and generate the target code corresponding to the target job.
[0114] The batch job code generation device provided by the embodiment of the application generates a knowledge graph based on the metadata, code and job type of the historical job through the first generation unit 701, wherein the historical job refers to a batch job for which the code has been generated; the classification unit 702 determines the job description information of the target job according to the business requirement, and inputs the job description information into the target classification model to obtain the job type of the target job, wherein the target job refers to a batch job for which the code is currently to be generated; the retrieval unit 703 retrieves the most similar job to the target job in the knowledge graph according to the job type of the target job; and the second generation unit 704 inputs the job description information of the target job, the knowledge graph, the code of the similar job and the input big model to generate the target code corresponding to the target job, thereby solving the problem that in the related art, when the batch job code is generated based on the big model, the generated code is inaccurate due to different descriptions of the batch job by different business personnel.
[0115] By constructing the detailed knowledge graph containing the historical job metadata, code and job type, the comprehensive information of the past batch job can be systematically sorted and stored, and the technical effect of enhancing the understanding ability of the batch job is achieved. Meanwhile, the description information of the target job is classified by the deep learning model, so that the job type of the target job can be accurately identified, the directional guidance of the code generation is achieved, and the technical effect of improving the relevance and efficiency of the code generation is further achieved. By retrieving the most similar historical job based on the target job type in the knowledge graph, the target job description, the knowledge graph information and the similar job code are input into the big model for code generation, the highly matched target code can be automatically output according to the specific requirement and historical practice, the automatic generation of the batch job code is achieved, the technical effect of significantly improving the accuracy and development speed of the code generation is achieved, and the technical effect of improving the processing efficiency of the batch job and the work efficiency of the financial institution is further achieved.
[0116] Optionally, in the batch job code generation device provided by the second embodiment of the application, the second generation unit 704 includes: an extraction subunit configured to extract the function description information and the code data source description of the target job from the job description information and the knowledge graph by the big model; an acquisition subunit configured to acquire the dependent job of the target job from the knowledge graph, and determine the data structure of the code data source of the dependent job; an identification subunit configured to identify the keyword term from the job description information based on keyword matching; and a first generation subunit configured to input the function description information, the code data source description, the data structure, the job code of the similar job, the prompt word and the keyword term into the big model to generate the target code corresponding to the target job.
[0117] Optionally, in the batch job code generation apparatus provided in Embodiment Two of the present application, the first generation subunit further includes: a matching module, configured to, when the target job belongs to modified data, match a job with the highest similarity to the target job based on a code description document of the target job, to obtain a similar modified job; a first determination module, configured to determine code change information of the similar modified job according to an output result of the similar modified job; and a first generation module, configured to input the function description information, the code data source description, the data structure, the job code of the similar job, the prompt word, the code change information and the keyword term into a large model to generate the target code corresponding to the target job.
[0118] Optionally, in the batch job code generation apparatus provided in Embodiment Two of the present application, the first generation unit 701 includes: a first construction subunit, configured to construct a job node according to metadata of the historical job, wherein the metadata at least includes: a job identifier, a job name, application information, maintenance information, and a dependent job; an expression subunit, configured to express the function of the code of the historical job in a recursive manner to obtain function description information; a second construction subunit, configured to determine code submission information and a code data source based on the code of the historical job, and construct a code submission node and a data source node; a third construction subunit, configured to construct edges between the job node and the code submission node, the data source node and a data structure node, wherein the data structure node is a field in the data source node; a clustering subunit, configured to cluster the historical jobs according to the code of the historical jobs, the function description information and the code data source, determine a job type of the historical jobs according to a clustering result, and add the job type to the job node; and a second generation subunit, configured to generate a job knowledge graph according to the job node, the code submission node, the data source node and the edges.
[0119] Optionally, in the batch job code generation apparatus provided in Embodiment Two of the present application, the second construction subunit includes: a first construction module, configured to determine the code submission information based on a code version library of the historical job, and construct the code submission node, wherein the code submission node at least includes the following fields: a submission identifier, submitter information, reviewer information, and submission description information; and a second construction module, configured to parse the code data source according to the code of the historical job, and construct the data source node, wherein the code data source at least includes: an input data source and an output data source, and the data source node at least includes the following fields: a data source name, application information, data source description, data source type, and a data structure node, and the data structure node at least includes the following fields: a field name, a field type, a field description, a data dictionary, a field constraint, and whether it belongs to a required data source.
[0120] Optionally, in the batch job code generation apparatus provided in Embodiment Two of the present application, the expression subunit comprises: a second generation module configured to parse the code of the historical job, and generate a call relationship tree based on the method contained in the code; a third construction module configured to input the code information of the method corresponding to the leaf node in the call relationship tree into a text processing model, and output the function description information of the leaf node, wherein the function description information of the leaf node at least comprises: the method code, the method function description, the method input description, the method output description, and the description of the class to which the method belongs; a third generation module configured to traverse the parent node of the leaf node, and input the annotation information, the code, the prompt word, the external explanation and the connected leaf node of the parent node into the text processing model to generate the function description information of the parent node, wherein the external explanation is a code explanation obtained by searching in an external knowledge base; and a processing module configured to traverse upwards from the parent node until the root node of the call relationship tree, and input the function description information of the node connected to the root node into the text processing model to obtain the function description information of the historical job.
[0121] Optionally, in the batch job code generation apparatus provided in Embodiment Two of the present application, the clustering subunit comprises: a first conversion module configured to convert the code of the historical job into a code feature vector through a target pre-training model, wherein the target pre-training model is a model trained for code text; a second conversion module configured to convert the function description information into a function feature vector through a word embedding model; a third conversion module configured to convert the field information of the data source node corresponding to the code data source into a data feature vector, wherein the code data source at least comprises: a code input source and a code output source; a splicing module configured to splice the code feature vector, the function feature vector and the data feature vector to obtain a job feature vector of the historical job; and a clustering module configured to cluster the job feature vector of the historical job based on a density-based clustering algorithm to obtain a clustering result, and merge and label the clustering result to obtain the job type of the historical job.
[0122] Optionally, in the batch job code generation apparatus provided in Embodiment Two of the present application, the retrieval unit 703 comprises: a screening subunit configured to screen in the knowledge graph based on the job type of the target job to obtain a first job; a first calculation subunit configured to, when the target job belongs to newly added data, calculate a similarity degree based on a first vector corresponding to a job description document of the target job and a second vector corresponding to a job description document of the first job using a term frequency-inverse document frequency algorithm; a second calculation subunit configured to, when the target job belongs to modified data, calculate a similarity degree based on a third vector corresponding to function description information of the target job and a fourth vector corresponding to function description information of the first job using the term frequency-inverse document frequency algorithm; and a determination subunit configured to determine a candidate job in the first job according to the similarity degree, and determine a similar job based on a semantic similarity degree, an organizational structure similarity degree, an associated asset similarity degree and a code similarity degree between the candidate job and the target job.
[0123] Optionally, in the batch job code generation apparatus provided in Embodiment Two of the present application, the determination subunit comprises: a first calculation module configured to calculate a code similarity degree based on a code feature vector of the target job and a code feature vector of the candidate job; a second calculation module configured to, when the target job belongs to newly added data, calculate a semantic similarity degree based on the first vector and the second vector, and when the target job belongs to modified data, calculate a semantic similarity degree based on the third vector and the fourth vector; a third calculation module configured to calculate an organizational structure similarity degree based on an organizational structure level of a developer of the target job, an organizational structure level of a developer of the candidate job, and a common organizational level of the developer of the target job and the developer of the candidate job; a fourth calculation module configured to calculate an associated asset similarity degree based on a code data source of the target job and a code data source of the candidate job; and a determination module configured to weight and fuse the semantic similarity degree, the organizational structure similarity degree, the associated asset similarity degree and the code similarity degree, and determine a similar job in the candidate job according to a fused similarity degree.
[0124] Optionally, in the batch job code generation apparatus provided in Embodiment Two of the present application, the clustering subunit further comprises: a fourth construction module configured to, after merging and labeling the clustering results to obtain a job type of a historical job, construct a training data set according to the job type of the historical job and the code, function description information and code data source of the historical job; and a training module configured to train a deep learning model using the training data set to obtain a target classification model, wherein the deep learning model comprises an attention mechanism.
[0125] Optionally, in the batch job code generation apparatus provided in Embodiment Two of the present application, the third conversion module comprises: a processing submodule, configured to process the data source name and the data source description respectively by using a word embedding model to generate a name vector and a description vector; an encoding submodule, configured to encode the data source type to obtain a type vector; a generation submodule, configured to input the application identifier in the application information into a target encoding model to generate an identifier vector, wherein the target encoding model is obtained by training a self-encoder model by using a one-hot code algorithm; a merging submodule, configured to merge the feature vectors corresponding to each field in the data structure by using a pooling algorithm to obtain a data structure vector; and a fusion submodule, configured to perform weighted fusion on the name vector, the description vector, the type vector, the identifier vector and the data structure vector to obtain a data feature vector.
[0126] It should be noted that the first generation unit 701, the classification unit 702, the retrieval unit 703 and the second generation unit 704 correspond to steps S201 to S204 in Embodiment 1, and the two modules have the same instances and application scenarios as the corresponding steps, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules or units can be hardware components or software components stored in a memory (for example, the memory 104) and processed by one or more processors (for example, the processors 102a, 102b, …, 102n), and the above modules can also be run in the computer terminal 10 provided in Embodiment 1 as part of the apparatus.
[0127] Embodiment 3
[0128] Embodiments of the present application can provide an electronic device, Figure 8 is a schematic diagram of the batch job code generation electronic device provided in Embodiment 3 of the present application. As shown in the figure, the electronic device can include one or more (only one is shown in the figure) processors 802, a memory 804, a storage controller, and a peripheral interface, wherein the peripheral interface is connected with a radio frequency module, an audio module and a display. Figure 8 Figure 8
[0129] The memory can be used to store software programs and modules, such as program instructions / modules corresponding to the method and device in the embodiments of the present application. The processor executes various functions and data processing by running the software programs and modules stored in the memory, that is, implements the above method. The memory can include a high-speed random access memory, and can further include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory can further include a memory remotely arranged with respect to the processor, which can be connected to the terminal through a network. Examples of the above network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0130] The processor can call the information and application programs stored in the memory through the transmission device to execute the method for generating the batch job code provided in Embodiment 1.
[0131] Those skilled in the art can understand that, Figure 8 The structure shown is only schematic, and the electronic device can also be a terminal device such as a smart phone, a tablet computer, a palm computer, a mobile Internet device (MID), a PAD, and the like. Figure 8 This does not limit the structure of the above electronic device. For example, the electronic device can further include more or fewer components (such as a network interface, a display device, and the like) than those shown in the figure, or have a different configuration from that shown in the figure.
[0132] Those skilled in the art can understand that all or part of the steps in the above embodiments can be completed by programs instructing the hardware related to the terminal device, and the programs can be stored in a computer readable storage medium, which can include a flash disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like.
[0133] Embodiment 4
[0134] The embodiments of the present application also provide a storage medium. Optionally, in the embodiments, the above storage medium can be used to save the program code executed by the method for generating the batch job code provided in Embodiment 1.
[0135] Optionally, in the embodiments, the above storage medium can be located in any one of the computer terminals in a computer terminal group in a computer network, or in any one of the mobile terminals in a mobile terminal group.
[0136] The application also provides a computer program product, which is suitable for executing the program of the method steps of the generation of the batch job code when executed on a data processing device.
[0137] The above-mentioned sequence numbers of the embodiments of the application are only for description, and do not represent advantages or disadvantages of the embodiments.
[0138] In the above-mentioned embodiments of the application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0139] In the several embodiments provided by the present application, it should be understood that the disclosed technology can be implemented in other ways. Of course, the embodiments described above are only schematic. For example, the division of units is only a logical function division, and there can be another division manner in actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, and can be electrical or other forms.
[0140] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. According to actual needs, part or all of the units can be selected to achieve the purpose of the embodiment scheme.
[0141] In addition, each functional unit in each embodiment of the application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0142] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or say the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.
[0143] The above is only the preferred embodiment of the present application, and it should be pointed out that for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, which should be considered as the protection scope of the present application.
Claims
1. A method of generating batch job code, the method comprising: The method comprises the steps of: generating a knowledge graph based on metadata, code and job types of historical jobs, wherein the historical jobs refer to batch jobs for which code has been generated; determining job description information of a target job according to business requirements, and inputting the job description information into a target classification model to obtain a job type of the target job, wherein the target job refers to a batch job for which code is currently to be generated; retrieving a similar job with the greatest similarity to the target job in the knowledge graph according to the job type of the target job; inputting the job description information of the target job, the knowledge graph, and the code of the similar job into a large model to generate target code corresponding to the target job.
2. The method of claim 1, wherein, The method comprises the steps of: extracting functional description information and code data source description of the target job from the job description information and the knowledge graph through the large model; obtaining dependent jobs of the target job from the knowledge graph, and determining data structures of code data sources of the dependent jobs; identifying keyword terms from the job description information based on keyword matching; inputting the functional description information, the code data source description, the data structures, the job code of the similar job, prompt words, and the keyword terms into the large model to generate target code corresponding to the target job.
3. The method of claim 2, wherein, The method comprises the steps of: when the target job belongs to modifying data, matching a job with the highest similarity in the knowledge graph based on a code description document of the target job, to obtain a similar modifying job; determining code change information of the similar modifying job according to an output result of the similar modifying job; inputting the functional description information, the code data source description, the data structures, the job code of the similar job, prompt words, the code change information, and the keyword terms into the large model to generate target code corresponding to the target job.
4. The method of claim 1, wherein, Generating a knowledge graph based on metadata, code and job types of historical jobs comprises the steps of: constructing a job node according to the metadata of the historical jobs, wherein the metadata at least includes job identification, job name, application information, maintenance information, and dependent jobs; representing the functions of the code of the historical jobs in a recursive manner to obtain functional description information; determining code submission information and code data sources based on the code of the historical jobs, and constructing code submission nodes and data source nodes; constructing edges between the job nodes and the code submission nodes, the data source nodes, and data structure nodes, wherein the data structure nodes are fields in the data source nodes. According to the code, the function description information, and the code data source of the historical job, the historical job is clustered, the job type of the historical job is determined according to the clustering result, and the job type is added to the job node; According to the job node, the code submission node, the data source node and the edge, a job knowledge graph is generated.
5. The method of claim 4, wherein, Based on the code of the historical job, code submission information and code data source are determined, and a code submission node and a data source node are constructed, including: Based on the code version library of the historical job, the code submission information is determined, and the code submission node is constructed, wherein the code submission node at least includes the following fields: submission identifier, submitter information, reviewer information, and submission description information; According to the code of the historical job, the code data source is parsed, and the data source node is constructed, wherein the code data source at least includes: input data source and output data source, and the data source node at least includes the following fields: data source name, application information, data source description, data source type, and the data structure node, and the data structure node at least includes the following fields: field name, field type, field description, data dictionary, field constraint, and whether it belongs to a required data source.
6. The method of claim 4, wherein, The function of the code of the historical job is expressed in a recursive manner to obtain function description information, including: The code of the historical job is parsed, and a call relationship tree is generated based on the methods contained in the code; The code information of the method corresponding to the leaf node in the call relationship tree is input into a text processing model, and the function description information of the leaf node is output, wherein the function description information of the leaf node at least includes: method code, method function description, method input description, method output description, and description of the class to which the method belongs; The parent node of the leaf node is traversed, and the function description information of the parent node is generated by inputting the annotation information, code, prompt word, external explanation and connected leaf node of the parent node into a text processing model, wherein the external explanation is a code explanation obtained by searching in an external knowledge base; From the parent node upwards, until the root node of the call relationship tree, the function description information of the nodes connected to the root node is input into the text processing model to obtain the function description information of the historical job.
7. The method of claim 5, wherein, According to the code, the function description information, and the code data source of the historical job, the historical job is clustered, the job type of the historical job is determined according to the clustering result, including: The code of the historical job is converted into a code feature vector through a target pre-training model, wherein the target pre-training model is a model trained for code text; The function description information is converted into a function feature vector through a word embedding model; The field information of the data source node corresponding to the code data source is converted into a data feature vector, and the code data source at least includes: code input source and code output source; The code feature vector, the function feature vector, and the data feature vector are spliced to obtain the job feature vector of the historical job; The density-based clustering algorithm clusters the job feature vectors of the historical jobs to obtain the clustering results, and merges and labels the clustering results to obtain the job types of the historical jobs.
8. The method of claim 7, wherein, The method comprises the following steps: According to the job type of the target job, a similar job with the greatest similarity to the target job is searched in a knowledge graph, which comprises the following steps: Filtering in the knowledge graph based on the job type of the target job to obtain a first job; When the target job belongs to new data, the TF-IDF algorithm is used to calculate the similarity between the first vector corresponding to the job description document of the target job and the second vector corresponding to the job description document of the first job; When the target job belongs to modified data, the TF-IDF algorithm is used to calculate the similarity between the third vector corresponding to the function description information of the target job and the fourth vector corresponding to the function description information of the first job; 9. The method of claim 8, wherein, According to the similarity, a candidate job is determined in the first job, and the similar job is determined based on the semantic similarity, organizational structure similarity, associated asset similarity and code similarity between the candidate job and the target job. The method for determining the similar job based on the semantic similarity, organizational structure similarity, associated asset similarity and code similarity between the candidate job and the target job comprises the following steps: Calculate the code similarity based on the code feature vector of the target job and the code feature vector of the candidate job; When the target job belongs to new data, calculate the semantic similarity based on the first vector and the second vector, and when the target job belongs to modified data, calculate the semantic similarity based on the third vector and the fourth vector; Calculate the organizational structure similarity based on the organizational structure level of the developer of the target job, the organizational structure level of the developer of the candidate job, and the common organizational level of the developer of the target job and the developer of the candidate job; Calculate the associated asset similarity based on the code data source of the target job and the code data source of the candidate job; 10. The method of claim 7, wherein, Weighted fusion of the semantic similarity, organizational structure similarity, associated asset similarity and code similarity, and determination of the similar job in the candidate job according to the fusion similarity. After the clustering results are merged and labeled to obtain the job types of the historical jobs, the method further comprises the following steps: According to the job type of the historical job and the code, function description information and code data source of the historical job, a training data set is constructed; 11. The method of claim 7, wherein, A deep learning model is trained using the training data set to obtain the target classification model, wherein the deep learning model comprises an attention mechanism. The field information of the data source node corresponding to the code data source is converted into a data feature vector, which comprises the following steps: The data source name and the data source description are processed respectively using a word embedding model to generate a name vector and a description vector; The data source type is encoded to obtain a type vector; Input the application identifier in the application information into a target coding model to generate an identifier vector, wherein the target coding model is obtained by training a self-coding model using a one-hot code algorithm; Merge the feature vectors corresponding to each field in the data structure through a pooling algorithm to obtain a data structure vector; Weight and fuse the name vector, the description vector, the type vector, the identifier vector, and the data structure vector to obtain the data feature vector.
12. A batch job code generation device, characterized in that, Comprise: The first generation unit is used for generating a knowledge graph based on the metadata, code and job type of historical jobs, wherein the historical jobs refer to batch jobs with generated code; The classification unit is used for determining the job description information of a target job according to business requirements, and inputting the job description information into a target classification model to obtain the job type of the target job, wherein the target job refers to a batch job with code to be generated at present; The retrieval unit is used for retrieving a similar job with the greatest similarity to the target job in the knowledge graph according to the job type of the target job; The second generation unit is used for inputting the job description information of the target job, the knowledge graph, the code of the similar job and a large model to generate the target code corresponding to the target job.
13. An electronic device, comprising: Comprise: A memory storing an executable program; A processor for running the program, wherein the program executes the batch job code generation method of any one of claims 1 to 11 when running.
14. A computer program product comprising computer instructions, characterized in that, The computer instructions are executed by the processor to implement the steps of the batch job code generation method of any one of claims 1 to 11. The computer instructions are executed by the processor to implement the steps of the batch job code generation method of any one of claims 1 to 11.