Code analysis method and device based on interactive model, and electronic equipment

Through the code analysis method based on interactive model, the problem of insufficient ability to identify operational hazards in code review and scheduling optimization in the existing technology is solved, and efficient hidden danger identification and prevention of distributed batch processing systems is achieved.

CN119829030APending Publication Date: 2025-04-15INDUSTRIAL AND COMMERCIAL BANK OF CHINA

Patent Information

Application Number
CN202411832222.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

The prior art is difficult to effectively identify and prevent operational hazards in distributed batch processing systems in code review and scheduling optimization, resulting in poor system stability and efficiency.

Method used

Using an interactive model-based code analysis method, the object code file and model prompt words are obtained, and they are input into the pre-trained interactive model for review, identify potential operational risks, and conduct in-depth analysis when necessary to determine the error type.

Benefits of technology

It realizes accurate identification and analysis of hidden dangers in code operation, improves the accuracy and efficiency of code review, prevents potential operation abnormalities in advance, and improves the stability and efficiency of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829030A_ABST
    Figure CN119829030A_ABST
Patent Text Reader

Abstract

The invention discloses a code analysis method and device based on an interactive model and electronic equipment, and relates to the technical field of artificial intelligence or other related fields, and the method comprises the following steps: obtaining a target code file and a first model cue word; the target code file and the first model cue word are input into a target model, an examination result is output, the target model is a pre-trained interactive model used for examining code operation hidden dangers, and the examination result is used for recording hidden danger code details; under the condition that the review result indicates that the target code has the operation hidden danger, obtaining a second model cue word; the hidden danger code details and the second model cue words are input into a target model, an analysis result is output, and the target model is further used for analyzing code error types based on the second model cue words and the hidden danger code details. Through the method and the device, the technical problem that code operation hidden dangers cannot be effectively prevented in advance due to insufficient code operation hidden danger recognition capability in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology or other related fields, and in particular to a code analysis method based on an interactive model, a device thereof, and an electronic device. Background Art

[0002] The transformation of application architecture in the financial sector and the transformation of information technology innovation (IT innovation) are driving the continuous expansion of the scale of distributed batch processing, aiming to improve processing efficiency and system stability to meet growing business needs. However, despite the increase in the scale and complexity of batch processing, the convergence of interruption and response problems has not been significantly improved. In the traditional design and development process, unreasonable interruption and response processing and improper batch concurrency control often become bottlenecks for the stable operation of the system. Current solutions usually rely on post-test drives and the actual operation of the production environment to discover the hidden dangers of batch interruption or response. This approach is not only time-consuming and inefficient, but also difficult to effectively prevent potential operational anomalies before the code is stored.

[0003] The code review stage has limited ability to identify specific risks, especially those complex risks that may cause system interruptions or response problems. It can only be checked based on preset rules, and lacks sufficient ability to identify new or specific risks. In addition, existing technologies are also unable to deal with the problem of excessive batch concurrency caused by unreasonable scheduling design. When multiple tasks are running at the same time, resource competition intensifies, and the risk of system interruption increases, which in turn affects the overall business process and user experience.

[0004] Therefore, existing code review and scheduling optimization technologies are inadequate when faced with the complexity and uncertainty of distributed batch processing. They cannot accurately locate hazardous codes before the code is entered into the database, and the stability and efficiency of batch processing are not ideal.

[0005] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0006] The main purpose of this application is to provide a code analysis method based on an interactive model, a device and an electronic device thereof, so as to at least solve the technical problem in the related technology of insufficient ability to identify code operation risks, resulting in the inability to effectively prevent code operation risks in advance.

[0007] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a code analysis method based on an interactive model is provided, the method comprising: obtaining a target code file and a first model prompt word; inputting the target code file and the first model prompt word into a target model, and outputting a review result, wherein the target model is a pre-trained interactive model, used to review whether the target code has any operational risks, and the review result is used to record the risk code details; when the review result indicates that the target code has any operational risks, obtaining a second model prompt word; inputting the risk code details and the second model prompt word into the target model, and outputting an analysis result, wherein the target model is also used to analyze the code error type based on the second model prompt word and the risk code details.

[0008] Furthermore, the step of obtaining a target code file and a first model prompt word includes: receiving a code file path input by a target user on an interactive interface; locating a file location based on the code file path, and obtaining the target code file based on the file location; obtaining operation information of the target user on the interactive interface, wherein N drop-down menus and M input text boxes are preset on the interactive interface, and the operation information refers to the target user's selection information on the N drop-down menus and input information on the M input text boxes, and N and M are both positive integers; matching keywords in a preset prompt word library based on the operation information, and generating a first model prompt word based on the matched keywords.

[0009] Furthermore, the preset drop-down menus on the interactive interface include at least: a first type of drop-down menu, wherein the first type of drop-down menu is used to provide analysis type selection, including the following menu items: batch interruption analysis, batch response analysis, and scheduling rationality analysis; a second type of drop-down menu, wherein the second type of drop-down menu is used to provide analysis scenario selection, including the following menu items: stock code analysis, incremental code analysis, and scheduling job analysis; a third type of drop-down menu, wherein the third type of drop-down menu is used to provide prompt word optimization selection, including the following menu items: prompt word line break structuring, prompt word sorting, and prompt word emphasis; a fourth type of drop-down menu, wherein the fourth type of drop-down menu is used to provide result processing selection, including the following menu items: result collection method, result display preference, and whether to store historical analysis results.

[0010] Further, when the operation information instructs the target user to select the batch interruption analysis or the batch response analysis in the first type of drop-down menu, the drop-down menu preset on the interactive interface also includes: a fifth type of drop-down menu, wherein the fifth type of drop-down menu is used to provide interruption error type selection, including the following menu items: R types of interruption error type options, wherein R is a positive integer; a sixth type of drop-down menu, wherein the sixth type of drop-down menu is used to provide response error type selection, including the following menu items: S types of response error type options, wherein S is a positive integer.

[0011] Further, when the operation information instructs the target user to select the scheduling rationality analysis in the first type of drop-down menu, the preset drop-down menu on the interactive interface also includes: a seventh type of drop-down menu, wherein the seventh type of drop-down menu is used to provide scheduling job analysis selections, including the following menu items: scheduling job file upload, job dependency analysis, expected job time analysis, and batch executor node status query.

[0012] Further, when the review result indicates that the target code does not have any operational risks, the interactive model-based code analysis method also includes: obtaining a batch job file, wherein the batch job file is T target job files packaged according to a preset schedule, and the target job file includes the target code file that has been determined to have no operational risks, and T is an integer greater than or equal to 2; obtaining a third model prompt word, wherein the third model prompt word is determined through the seventh category drop-down menu on the interactive interface; inputting the T target job files and the third model prompt word into the target model according to the preset schedule, and outputting a scheduling analysis result, wherein the target model is also used to analyze the batch schedule based on the third model prompt word, and the scheduling analysis result is used to record whether the batch job file has a scheduling conflict.

[0013] Furthermore, the step of analyzing batch scheduling by the target model includes: determining batch scheduling information, job pre-dependency information and job post-dependency information based on the received T target job files; generating a batch task scheduling graph based on the batch scheduling information, the job pre-dependency information and the job post-dependency information; determining the expected execution time of the batch job based on the batch task scheduling graph, and obtaining the node status of each execution node in the batch executor based on the expected execution time; and generating the scheduling analysis result based on the expected execution time and each of the node statuses.

[0014] In order to achieve the above-mentioned purpose, according to another aspect of the present application, there is also provided a code analysis device based on an interactive model, which includes: a first acquisition unit, used to acquire a target code file and a first model prompt word; a first input unit, used to input the target code file and the first model prompt word into a target model, and output a review result, wherein the target model is a pre-trained interactive model, used to review whether the target code has any operational risks, and the review result is used to record the risk code details; a second acquisition unit, used to acquire a second model prompt word when the review result indicates that the target code has any operational risks; a second input unit, used to input the risk code details and the second model prompt word into the target model, and output an analysis result, wherein the target model is also used to analyze the code error type based on the second model prompt word and the risk code details.

[0015] Furthermore, the first acquisition unit includes: a receiving module, which is used to receive a code file path input by a target user on an interactive interface; a positioning module, which is used to locate the file location based on the code file path, and to acquire the target code file based on the file location; a first acquisition module, which is used to acquire operation information of the target user on the interactive interface, wherein N drop-down menus and M input text boxes are preset on the interactive interface, and the operation information refers to the target user's selection information on the N drop-down menus and input information on the M input text boxes, and N and M are both positive integers; a generation module, which is used to match keywords in a preset prompt word library based on the operation information, and to generate a first model prompt word based on the matched keyword.

[0016] Furthermore, the preset drop-down menus on the interactive interface include at least: a first type of drop-down menu, wherein the first type of drop-down menu is used to provide analysis type selection, including the following menu items: batch interruption analysis, batch response analysis, and scheduling rationality analysis; a second type of drop-down menu, wherein the second type of drop-down menu is used to provide analysis scenario selection, including the following menu items: stock code analysis, incremental code analysis, and scheduling job analysis; a third type of drop-down menu, wherein the third type of drop-down menu is used to provide prompt word optimization selection, including the following menu items: prompt word line break structuring, prompt word sorting, and prompt word emphasis; a fourth type of drop-down menu, wherein the fourth type of drop-down menu is used to provide result processing selection, including the following menu items: result collection method, result display preference, and whether to store historical analysis results.

[0017] Further, when the operation information instructs the target user to select the batch interruption analysis or the batch response analysis in the first type of drop-down menu, the drop-down menu preset on the interactive interface also includes: a fifth type of drop-down menu, wherein the fifth type of drop-down menu is used to provide interruption error type selection, including the following menu items: R types of interruption error type options, wherein R is a positive integer; a sixth type of drop-down menu, wherein the sixth type of drop-down menu is used to provide response error type selection, including the following menu items: S types of response error type options, wherein S is a positive integer.

[0018] Further, when the operation information instructs the target user to select the scheduling rationality analysis in the first type of drop-down menu, the preset drop-down menu on the interactive interface also includes: a seventh type of drop-down menu, wherein the seventh type of drop-down menu is used to provide scheduling job analysis selections, including the following menu items: scheduling job file upload, job dependency analysis, expected job time analysis, and batch executor node status query.

[0019] Furthermore, the interactive model-based code analysis device also includes: a second acquisition module, used to acquire a batch job file when the review result indicates that the target code does not have any operational risks, wherein the batch job file is T target job files packaged according to a preset schedule, and the target job file includes the target code file that has been determined to have no operational risks, and T is an integer greater than or equal to 2; a third acquisition module, used to acquire a third model prompt word, wherein the third model prompt word is determined by the seventh category drop-down menu on the interactive interface; an input module, used to input the T target job files and the third model prompt word into the target model according to the preset schedule, and output a scheduling analysis result, wherein the target model is also used to analyze the batch schedule based on the third model prompt word, and the scheduling analysis result is used to record whether the batch job file has a scheduling conflict.

[0020] Furthermore, the input module includes: a first determination submodule, used to determine the batch scheduling information, job pre-dependency information and job post-dependency information based on the received T target job files; a first generation submodule, used to generate a batch task scheduling graph based on the batch scheduling information, the job pre-dependency information and the job post-dependency information; a second determination submodule, used to determine the expected execution time of the batch job based on the batch task scheduling graph, and obtain the node status of each execution node in the batch executor based on the expected execution time; a second generation submodule, used to generate the scheduling analysis result based on the expected execution time and each of the node states.

[0021] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a computer-readable storage medium is also provided, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned interactive model-based code analysis methods.

[0022] In order to achieve the above-mentioned purpose, according to another aspect of the present application, there is also provided an electronic device, comprising one or more processors and a memory, wherein the memory is used 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 implement any one of the above-mentioned interactive model-based code analysis methods.

[0023] The present invention proposes a code analysis method based on an interactive model, which first obtains a target code file and a first model prompt word, then inputs the target code file and the first model prompt word into a target model, and outputs a review result, wherein the target model is a pre-trained interactive model, which is used to review whether the target code has any operational risks, and the review result is used to record the details of the potential risk code, and then, when the review result indicates that the target code has any operational risks, obtains a second model prompt word, and finally inputs the potential risk code details and the second model prompt word into the target model, and outputs an analysis result, wherein the target model is also used to analyze the code error type based on the second model prompt word and the potential risk code details.

[0024] In the present invention, an interactive model deep analysis method is adopted, and different prompt words are input into the target model in stages to achieve the purpose of accurately locating and analyzing code operation risks, thereby achieving the technical effect of improving the accuracy and efficiency of code review. Specifically, the target code file is combined with the first model prompt word, and the code is reviewed by a pre-trained interactive model to screen out possible operation risks. The review result records the details of the risk code in detail, providing a basis for subsequent refined analysis. When the review result indicates that there is a code operation risk, the second model prompt word is further used to perform a deep analysis on the risk code to accurately determine the nature of the risk, that is, the code error type. This process makes full use of the intelligent analysis capability of the interactive model. Through the two-stage prompt word input, not only can the risk be effectively identified, but also the root cause of the risk can be accurately analyzed, which provides strong technical support for preventing and correcting code operation risks, thereby solving the technical problem of insufficient ability to identify code operation risks in related technologies, resulting in the inability to effectively prevent code operation risks in advance. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0026] Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing an interactive model-based code analysis method is shown;

[0027] Figure 2 is a flowchart of an optional interactive model-based code analysis method according to an embodiment of the present invention;

[0028] Figure 3 It is a flowchart of an optional method for obtaining code files and model prompt words based on an embodiment of the present invention;

[0029] Figure 4 is a schematic diagram of an optional training process of a target model according to an embodiment of the present invention;

[0030] Figure 5 is a flow chart of an optional interactive model-based batch scheduling analysis method according to an embodiment of the present invention;

[0031] Figure 6 is a schematic diagram of an optional interactive model-based code analysis device according to an embodiment of the present invention;

[0032] Figure 7 It is a structural block diagram of an electronic device for executing an interactive model-based code analysis method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0033] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0035] To facilitate those skilled in the art to understand the present invention, some terms or nouns involved in the embodiments of the present invention are explained below:

[0036] Interactive Model, an artificial intelligence model that can communicate with users or systems in a two-way manner. In the present invention, the interactive model is used to review and analyze the code, which can accept code files and prompt words as input and provide output about code risks and error types. Compared with traditional static models, the interactive model can dynamically adjust its analysis strategy to improve the accuracy and flexibility of the analysis.

[0037] It should be noted that the interactive model-based code analysis method and device thereof in the present application can be used in the field of artificial intelligence technology when performing intelligent review and error type analysis on code files, and can also be used in any field outside the field of artificial intelligence technology when performing intelligent review and error type analysis on code files. The present application does not limit the application field of the interactive model-based code analysis method and device thereof.

[0038] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, processing, transmission, provision, disclosure, use and processing of the relevant data comply with the laws, regulations and standards of the relevant regions, take necessary confidentiality measures, do not violate public order and good customs, and provide corresponding operation entrances for users to choose to authorize or refuse. For example, an interface is set up between this system and relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.

[0039] The information collection (for example, user voice, video, and text collection) and analysis operations involved in this application have provided users with corresponding operation entrances when they are executed, allowing users to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered.

[0040] The following embodiments of the present invention can be applied to various systems / applications / devices that require code review and error type analysis, and can realize intelligent positioning and accurate identification of code operation risks. The present invention uses an interactive model to perform code analysis, and then optimizes the model analysis results through multi-stage prompt word input, which can better improve code quality and system stability.

[0041] Specifically, the method and device of the present invention are applicable to distributed batch processing systems, financial institution back-end systems, and any equipment and applications that rely on stable code operation. By using the interactive model to review the target code file, the present invention can effectively identify possible operational risks in the code, such as interruption and response problems. After the initial review finds the risk, by introducing the second model prompt word, the interactive model can further analyze the error type of the risk code, provide developers with specific error analysis results, and facilitate targeted code correction.

[0042] The present invention is described in detail below in conjunction with various embodiments.

[0043] Embodiment 1

[0044] According to an embodiment of the present invention, an embodiment of a code analysis method based on an interactive model is 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 a 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.

[0045] The interactive model-based code analysis method embodiment provided in the first embodiment of the present invention can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing a code analysis method based on an interactive model. Figure 1As shown, the computer terminal 10 (or mobile device) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is 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 functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0046] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0047] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the interactive model-based code analysis method in the embodiment 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, realizing the above-mentioned interactive model-based code analysis method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via 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 combinations thereof.

[0048] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may 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 (RF) module, which is used to communicate with the Internet wirelessly.

[0049] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).

[0050] Under the above operating environment, the present invention provides Figure 2 The code analysis method based on the interactive model shown in the figure is implemented by a batch intelligent analysis system. It is combined with the Zhiyong big model technology for distributed batch processing scenarios of financial institutions, especially for code operation interruptions and response hidden dangers. Through the means of interactive model intelligent review and analysis, it can achieve accurate positioning and analysis of operation risks in the code, optimize code quality, and improve system stability. Through a series of intelligent processing, it can effectively avoid batch processing interruptions caused by code risks, and provide financial institutions (such as banks, fund companies) systems with more efficient and secure batch job management solutions.

[0051] The embodiment of the present invention is described in detail below in conjunction with various specific steps.

[0052] Figure 2 is a flowchart of an optional interactive model-based code analysis method according to an embodiment of the present invention, such as Figure 2 As shown, the method comprises the following steps:

[0053] Step S201, obtaining a target code file and a first model prompt word.

[0054] It should be noted that the target code file refers to the code file to be reviewed, which can be an incremental code, that is, a newly developed or modified code part, or an existing code, that is, a code that has been deployed in the system. The target code file contains the key business logic in the distributed batch processing system of the target financial institution, and may involve core functions such as batch task execution, data processing, file reading and writing, and transaction management. The embodiment of the present invention is intended to conduct an in-depth review of the target code file before the code is submitted to the version control system or prepared for deployment to the production environment to ensure that it can run stably and avoid interruptions and response problems in batch processing.

[0055] Another thing to note is that the model prompt words play a key role in guiding the direction and focus of the interactive model analysis in the embodiment of the present invention. The first model prompt words are mainly used to guide the preliminary code review, focusing on the interruption / response risks that may exist in the code, for example, including but not limited to: checking the exception handling mechanism, the rationality of large transaction monitoring, the verification of file permissions, the accuracy of database connection configuration, etc.

[0056] By combining the target code file with the first model prompt word and inputting it into the interactive model, the model can check the code in a targeted manner according to the prompt word guidance and identify the code sections that may have interruption or response problems. The setting of the first model prompt word is used to help the model quickly focus on potential operational risks, which is crucial for optimizing the model's review efficiency and recognition accuracy, and can effectively improve the initial effect of code review.

[0057] Figure 3 This is a flow chart of an optional method for obtaining code files and model prompt words based on an embodiment of the present invention. Figure 3 As shown, the method comprises the following steps:

[0058] Step S301, receiving a code file path input by a target user on an interactive interface;

[0059] Step S302, locating the file location based on the code file path, and obtaining the target code file based on the file location;

[0060] Step S303, obtaining the target user's operation information on the interactive interface, wherein the interactive interface is preset with N drop-down menus and M input text boxes, and the operation information refers to the target user's selection information on the N drop-down menus and input information on the M input text boxes, where N and M are both positive integers;

[0061] Step S304: matching keywords in a preset prompt word library based on the operation information, and generating a first model prompt word based on the matched keywords.

[0062] It should be noted that the target users are software developers, system engineers or quality assurance engineers who are responsible for writing, modifying and reviewing the code of the batch processing system of financial institutions. The interactive interface is designed to be user-friendly, allowing the target users to enter the path of the target code file through the graphical user interface, that is, the specific location of the code file in the file system. For example, the user can choose to upload a file, or directly enter the URL of the file in the version control system.

[0063] Once the target user provides the code file path, the location of the code file in the server or local storage can be located through path resolution, and then the file can be read and loaded, and input into the interactive model for analysis together with the first model prompt word. The above process involves interaction with the version control system (such as Git) to ensure that the latest version of the code file is obtained, or the file is read directly from the local file system.

[0064] Another thing that needs to be explained is that the operation information refers to the details of all interactive behaviors performed by the target user on the interactive interface, including the click information of the drop-down menu and the input information of the input text box. The drop-down menu is used to select the code type (such as incremental or stock), select the analysis mode (such as interrupt analysis or response analysis), etc., while the input text box is used to enter specific information, such as job name, Git submission link, etc. The above operation information together constitutes the basis for generating the prompt word of the first model.

[0065] Specifically, the operation information includes keywords related to a specific type of interruption / response risk selected or input by the user, and these keywords are matched with a preset prompt word library, which pre-stores keywords related to various code risks. For example, if the target user selects an option related to large transaction monitoring, the first model prompt word containing keywords such as "large transaction", "monitoring", and "transaction timeout" is found. The model prompt word containing keywords is used to guide the interactive model to pay special attention to the code paragraphs related to the selected risk type when analyzing the target code file, thereby improving the pertinence and efficiency of the review.

[0066] In addition, regarding the interactive interface, it can be designed as a graphical interface that users can operate intuitively, including various graphical controls, such as drop-down menus, input boxes, and various graphical buttons, etc., to facilitate users to select analysis types, input code file information, and customize prompt word parameters.

[0067] The drop-down menu is one of the common controls in the interactive interface, allowing the user to select one or more options from a preset list of options. The drop-down menu in the embodiment of the present invention at least includes selecting the type of code review (such as interrupt analysis or response analysis), selecting the scenario of the code (such as incremental or stock), and selecting the common type of interruption hidden dangers (such as SQL execution exception, null pointer exception, permission problem, etc.).

[0068] The input text box is another common control in the interactive interface, which allows users to enter specific information, such as the path of the code file, the job name, the GIT submission link, etc. Using the input text box helps the system to accurately locate the target code file and obtain the metadata required for analysis.

[0069] Through the combined use of an interactive interface and an interactive model, the embodiment of the present invention realizes an automated and intelligent code review process, which not only reduces the burden on developers and testers, but also improves the efficiency and accuracy of code review, and plays a significant role in preventing interruptions and response problems in batch processing.

[0070] In the embodiment of the present invention, various functional controls of the interactive interface are designed mainly for the code review problem and the scheduling analysis problem in the batch job execution process, wherein the code review problem involves at least the following application scenarios: interruption scenario and response scenario. Among them, the interruption scenario refers to the situation in which the batch job suddenly stops or fails due to hidden dangers or exceptions in the code during the execution process. The response scenario mainly involves the response or waiting time of the batch job. When the job depends on the arrival of external resources or data, but the actual reception time exceeds expectations, the response scenario will be entered.

[0071] Furthermore, the interruption risk in the interruption scenario refers to the problem of being unable to continue execution or abnormal termination due to code risks (such as incorrect logic, resource contention, abnormal events, etc.) during code execution. The root causes of the above code risks include but are not limited to: code errors, such as improper exception handling, null pointer references, improper resource closure, etc.; or improper system configuration, such as file permission problems, network configuration errors, etc. If the interruption risk is not discovered and handled, it will cause the program to stop suddenly during operation, which may cause data loss, system instability or service unavailability.

[0072] Response risks in response scenarios refer to the problem that the processing of requests or data cannot be completed and the response cannot be returned within the expected time. This usually occurs when the system is waiting for external resources (such as files, databases, or network responses). If the waiting time is too long or the resources are not available, the processing cannot be completed in time and the response cannot be given, resulting in a response timeout. Response risks may arise from code logic errors, such as incorrect waiting time settings, invalid resource access attempts, etc., or they may arise from unreasonable system configuration or resource allocation. If response risks are not resolved, it will affect the system's response speed and user experience, and in severe cases may cause system service interruptions.

[0073] In the batch processing of financial institutions, interruptions and response risks can easily affect the processing of a large number of transactions, leading to errors in key data such as account balances and transaction records, and even affecting business continuity and customer fund security. Therefore, it is particularly worthy of attention. Identifying and resolving these risks in the code development and scheduling design stages can improve the stability and efficiency of the financial system. The design of the interactive interface needs to take this into account.

[0074] Furthermore, in the embodiment of the present invention, various functional controls of the interactive interface are designed for scheduling issues during the execution of batch jobs. Scheduling analysis refers to the evaluation and optimization of the arrangement of batch tasks or batch jobs on the timeline. In the batch processing environment of financial institutions, scheduling analysis involves the management of dependencies, resource allocation, execution order and time windows between different jobs. Effective scheduling analysis can ensure the efficient, safe and conflict-free operation of batch jobs, which is crucial to the continuity of financial business and the accuracy of data, so the design of the interactive interface also needs to take this into consideration.

[0075] Optionally, the drop-down menu preset on the interactive interface includes at least: a first type of drop-down menu, wherein the first type of drop-down menu is used to provide analysis type selection, including the following menu items: batch interruption analysis, batch response analysis, and scheduling rationality analysis; a second type of drop-down menu, wherein the second type of drop-down menu is used to provide analysis scenario selection, including the following menu items: stock code analysis, incremental code analysis, and scheduling job analysis; a third type of drop-down menu, wherein the third type of drop-down menu is used to provide prompt word optimization selection, including the following menu items: prompt word line break structuring, prompt word sorting, and prompt word emphasis; a fourth type of drop-down menu, wherein the fourth type of drop-down menu is used to provide result processing selection, including the following menu items: result collection method, result display preference, and whether to store historical analysis results.

[0076] Specifically, in the first drop-down menu, when batch interruption analysis is selected, the first model prompt word generated will guide the model to focus on finding hidden dangers in the target code that may cause batch processing interruption, such as improper exception handling, resource contention, large transaction monitoring, etc. This analysis type is applicable to any scenario that may affect the continuity and stability of batch tasks.

[0077] When batch response analysis is selected, the first model prompt word generated will guide the model to analyze response risks in the code, focusing mainly on the processing logic of the code when waiting for external response or input, such as incorrect file receiving path, unreasonable response waiting time, etc.

[0078] When scheduling rationality analysis is selected, the first model prompt word generated will guide the model to focus on the rationality of the scheduled job, analyzing whether the scheduling settings may lead to resource conflicts, excessive job concurrency, or conflicts in the execution time of key tasks, so as to prevent interruptions caused by improper scheduling during the execution of batch jobs.

[0079] In the second drop-down menu, stock code analysis refers to the analysis of the code that has been deployed in the production environment to find possible hidden dangers in order to maintain system stability and optimize long-term performance; incremental code analysis is applicable to newly developed or modified code to ensure that the new code can pass intelligent review before entering the database to avoid introducing hidden dangers into the production environment; scheduled job analysis is used to analyze scheduled job files to evaluate the rationality of the scheduling design, ensure that new and old jobs can work together seamlessly, and avoid resource competition and execution conflicts.

[0080] It should be noted that the options in the first and second drop-down menus need to match the input information in the input text box. For example, when you choose to interrupt / respond to potential danger review of incremental / existing codes, the input information must be one or more code files. When you choose to schedule analysis of batch jobs, the input information must be multiple batch job files with preset schedules.

[0081] Furthermore, the prompt word optimization options in the third category of drop-down menus involve the accuracy optimization of the model output results. Among them, the prompt word line break structured option supports the target user to adjust the prompt word format, and makes it easier for the model to understand the hierarchical structure of the prompt word through line breaks and structuring, thereby improving the analysis accuracy; the prompt word sorting option supports the target user to specify the sorting of keywords in the prompt word, and puts the keywords with higher relevance at the beginning or end of the prompt word to guide the model to locate the problem more accurately; prompt word emphasis refers to enhancing the model's attention to the specified hidden danger type by emphasizing certain keywords or phrases. For example, in the file reading and table writing job scenario, emphasizing the null pointer check when the file is assigned to the table field helps the model to analyze this specified hidden danger more carefully.

[0082] The fourth type of drop-down menu focuses on the output method of the model output results. Among them, the option of result collection method supports the target user to select the collection method of model analysis results, for example, including but not limited to: real-time collection, scheduled collection or batch collection, to adapt to different workflows and review requirements; the option of result display preference allows the target user to customize the format of result display, including but not limited to detailed reports, summary information, chart display, etc., to meet the preferences and needs of different reviewers; the option of whether to store historical analysis results supports the target user to set whether to save the analysis results of large models. Storing historical analysis results helps to perform trend analysis and track changes in code quality and system performance, which is crucial for long-term code optimization and system stability management.

[0083] Optionally, when the operation information indicates that the target user selects batch interruption analysis or batch response analysis in the first drop-down menu, the drop-down menu preset on the interactive interface also includes: a fifth drop-down menu, wherein the fifth drop-down menu is used to provide interruption error type selection, including the following menu items: R interruption error type options, wherein R is a positive integer; a sixth drop-down menu, wherein the sixth drop-down menu is used to provide response error type selection, including the following menu items: S response error type options, wherein S is a positive integer.

[0084] It should be noted that when the target user chooses to perform batch interruption analysis or batch response analysis, the fifth and sixth drop-down menus on the interactive interface provide users with more detailed error type selections, so that specific interruption or response problems that may exist in the code can be analyzed and reviewed in a targeted manner.

[0085] Specifically, when the target user selects "Batch Interruption Analysis" in the first drop-down menu, the fifth drop-down menu will be activated, providing multiple interruption error type options for selection. Each interruption error type corresponds to a coding field in the interactive page, which can be represented by Arabic numerals or other coding forms, which is not specifically limited in the embodiments of the present invention.

[0086] The coding field-interruption error type in the embodiment of the present invention includes but is not limited to: 1-SQL execution exception, which is used to check the correctness of the database query statement in the code and the exception handling mechanism; 2-large transaction monitoring, which is used to analyze the transaction processing logic to avoid interruptions caused by large transactions or improper processing; 3-insufficient file permissions, which is used to review the configuration of file read and write permissions to avoid interruptions caused by permission problems; 4-null pointer exception, which is used to locate the code segment that may cause null pointer exceptions and reduce runtime errors; 5-password configuration errors, which is used to check the connection configuration of the database or file server to avoid interruptions caused by password errors; 6-cleaning and control table parameter missing, which is used to analyze the use of the control table in the code to ensure that all necessary parameters have been configured; 7-regular expression matching failure, which is used to review the file name parsing logic to ensure the correctness of the regular expression to avoid answering; 8-file length exception, which is used to check the file processing logic to prevent interruptions caused by file length exceptions. By selecting a specific interruption error type, the user can guide the target model (i.e., the Zhiyong large model) to focus more accurately on a certain type of interruption hidden dangers in the code, thereby improving the pertinence and efficiency of the analysis.

[0087] When the target user selects "Batch Response Analysis" in the first drop-down menu, the sixth drop-down menu will be activated, providing multiple response error type options. Each response error type also corresponds to a coding field in the interactive page. The coding method is not specifically limited in the embodiment of the present invention.

[0088] The coding field-response error type in the embodiment of the present invention includes but is not limited to: 1-file receiving path configuration error, used to check the configuration of the file receiving path in the code to ensure the correctness of the path; 2-file name processing logic error, used to review the file name processing logic in the code to avoid responses caused by file name configuration errors; 3-improper response waiting time setting, used to analyze the time setting for waiting for external data or response in the code, to avoid response problems caused by too short or too long waiting time; 4-insufficient folder permissions, used to check file operation permissions, to avoid responses caused by insufficient permissions; 5-non-FSS path configuration, used to review file path configuration, to ensure that all file operations occur on the expected FSS (FileSystem Service) path, to avoid responses caused by path errors. By selecting the response error type, users can further refine the analysis of the code by Zhiyong Big Model, focus on finding specific response risks, so that they can be corrected in time before the code is stored or deployed, avoiding job delays or failures caused by response problems in the production environment.

[0089] The menu options provided in the above interactive interface not only help Zhiyong Big Model to locate problems in the code more accurately, but also provide a mechanism that enables developers and testers to prioritize the review of code parts that are most likely to cause interruptions and response problems based on past experience and common errors in the production environment, thereby significantly improving the efficiency and effectiveness of batch intelligent analysis. The customized error type selection capability enhances the application flexibility of Zhiyong Big Model and the depth of intelligent review.

[0090] Next, the process of using the interactive model to perform code review and code analysis in an embodiment of the present invention is introduced, including three sections: target model training, reviewing code operation risks, and analyzing code error types.

[0091] It should be noted that the target model is an interactive model that is pre-trained to review code files for operational risks, such as interruptions or response problems. Figure 4 is a schematic diagram of an optional target model training process according to an embodiment of the present invention, such as Figure 4 As shown in the figure, the process includes: sample collection, data labeling, feature engineering, model training, hyperparameter adjustment, and validation testing.

[0092] Specifically, data collection refers to the pre-collection of code samples and their running conditions from fault records in historical production environments, code review results in test environments, and feedback from developers, including code with known interruption and response issues; labeling data refers to labeling the collected data to identify code segments related to interruption and response issues and the corresponding specific error types as the basis for supervised learning; feature engineering refers to preprocessing code data and converting it into a form that can be understood by the model, including techniques such as word embedding and syntax tree analysis, so that the model can capture the structure and semantics of the code.

[0093] Model training refers to training using the Zhiyongda model interface. The Zhiyongda model gradually masters the ability to identify code hazards by learning the relationship between input code and annotated hazards. During the training process, the model continuously adjusts its own parameters to minimize the difference between the predicted results and the actual annotations; hyperparameter adjustment refers to adjusting hyperparameters such as learning rate, batch size, etc. according to the model's training performance to optimize the model's training effect; verification and testing refers to using data sets that are not involved in training to verify the generalization ability of the model, ensuring that the model not only performs well on training data, but also can accurately predict hazards in new code files.

[0094] Furthermore, in order to avoid the target model's over-reliance on the model, model bias or false alarms that may lead to unreliable model output effects, model update mechanisms, manual review and other methods can be adopted for supervision and review.

[0095] Step S202, input the target code file and the first model prompt word into the target model, and output the review result, wherein the target model is a pre-trained interactive model used to review whether the target code has any operational risks, and the review result is used to record the details of the risk code.

[0096] It should be noted that the review results output by the target model are used to indicate whether there are operational risks in the code file. If so, the risk code details will be marked in the form of highlighting, underlining, etc., that is, the code segments that the model believes may cause interruptions or response problems. Among them, the risk code details are extracted from the target code file through the recognition ability of the target model.

[0097] Step S203, if the review result indicates that the target code has an operational risk, obtain the second model prompt word. If the review result indicates that there is an operational risk, the interactive interface will prompt the user to choose whether to further obtain the second model prompt word. The target user selects or enters a more specific prompt word (for example, a detailed description of a specific error type) on the interactive interface according to the risk type displayed in the review result, or the system automatically generates or suggests a second model prompt word based on the risk code details returned by the model for reference by the target user.

[0098] Step S204, input the hidden danger code details and the second model prompt words into the target model, and output the analysis results, wherein the target model is also used to analyze the code error type based on the second model prompt words and the hidden danger code details.

[0099] It should be noted that the steps of further analyzing the code error types involve at least: code context analysis and error pattern matching, wherein code context analysis refers to considering the context around the potential danger code to determine the specific type of the error, and the context includes: variable definitions, function calls, and code segments related to the potential danger; error pattern matching refers to matching the potential danger code with known error patterns to identify the most similar error type, wherein the known error patterns are marked in the training data.

[0100] Optionally, the target model can also generate an analysis report based on the analysis results, listing all identified error types and corresponding vulnerable code sections as well as possible solution suggestions, providing clear guidance for developers.

[0101] The above steps can effectively review the code, identify potential operational risks, and further accurately locate the error type, ultimately helping to improve the stability and efficiency of the bank's distributed batch processing system.

[0102] When the review results indicate that the target code does not have any operational risks, the embodiment of the present invention can also provide batch scheduling analysis based on the interactive model, and the menu options are correspondingly provided through a drop-down menu in the interactive interface.

[0103] Optionally, when the operation information indicates that the target user selects scheduling rationality analysis in the first drop-down menu, the preset drop-down menu on the interactive interface also includes: a seventh drop-down menu, wherein the seventh drop-down menu is used to provide scheduling job analysis selections, including the following menu items: scheduling job file upload, job dependency analysis, expected job time analysis, and batch executor node status query.

[0104] It should be noted that when the target user selects "Schedule Reasonableness Analysis" as the analysis type, the seventh category drop-down menu on the interactive interface will provide a series of options aimed at comprehensively evaluating and optimizing the scheduling design of batch jobs.

[0105] Among them, the scheduling job file upload supports the target user to manually upload the DBF scheduling job file containing detailed scheduling information of the batch job. The scheduling information includes: the start and end time of the job, dependency, etc.

[0106] Job dependency analysis is used to check the dependencies between jobs. Batch jobs are often executed in a certain order. The completion of a job may depend on the output of other jobs. By analyzing the dependencies, we can ensure that the execution order of jobs is reasonable and avoid affecting the efficiency and stability of the entire batch processing process due to the delay of a job in the dependency chain.

[0107] Expected job time analysis allows users to analyze the expected latest start time, expected end time, and the relationship between the expected time and the actual batch job execution time of a specific job. By comparing the expected job time with historical job operation data, the rationality of the job scheduling settings can be evaluated and potential resource conflicts or execution bottlenecks can be identified.

[0108] Batch executor node status query supports target users to query the real-time status of batch executor nodes, including key indicators such as CPU usage and memory usage. Node status data is crucial for estimating resource usage during job execution, and can help predict the execution status of jobs in a high-concurrency environment, thereby optimizing scheduling and avoiding resource contention or overload.

[0109] The embodiment of the present invention can comprehensively evaluate and optimize the scheduling design through the preset seventh category of drop-down menu options, avoid interruptions or resource waste caused by improper scheduling, and thus improve the overall efficiency and stability of the distributed batch processing system.

[0110] Figure 5 is a flowchart of an optional batch scheduling analysis method based on an interactive model according to an embodiment of the present invention, such as Figure 5 As shown, the method comprises the following steps:

[0111] Step S501, obtaining a batch job file, wherein the batch job file is T target job files packaged according to a preset schedule, the target job file includes a target code file that has been determined to have no operating risk, and T is an integer greater than or equal to 2;

[0112] It should be noted that the batch job file may involve integration with a version control system (such as Git) to automatically capture code files submitted daily, or allow target users to manually upload job files containing preset scheduling information.

[0113] Step S502, obtaining a third model prompt word, wherein the third model prompt word is determined through a seventh category drop-down menu on the interactive interface;

[0114] It should be noted that the third model prompt words may include keywords such as job dependency analysis, expected job time analysis, executor node status query, and descriptions of specific resource contention scenarios, such as "CPU usage", "memory usage" or "database connection status".

[0115] There are two ways to obtain the third model prompt words: one is that the target user manually selects according to the analysis objectives and expected results, and customizes the analysis requirements through the options listed in the drop-down menu; the other is that the system automatically recommends and intelligently generates prompt words based on historical data analysis and the characteristics of the current job file to guide the model to perform more effective analysis.

[0116] Step S503, input T target job files and the third model prompt words into the target model according to the preset schedule, and output the scheduling analysis results, wherein the target model is also used to analyze the batch schedule based on the third model prompt words, and the scheduling analysis results are used to record whether there are scheduling conflicts in the batch job files.

[0117] It should be noted that the scheduling analysis results are used to record whether there are scheduling conflicts in the batch job files, such as overlapping job start times, resource allocation conflicts, and other issues.

[0118] Optionally, the step of analyzing the batch scheduling by the target model includes: determining the batch scheduling information, job pre-dependency information and job post-dependency information based on the received T target job files; generating a batch task scheduling graph based on the batch scheduling information, job pre-dependency information and job post-dependency information; determining the expected execution time of the batch job based on the batch task scheduling graph, and obtaining the node status of each execution node in the batch executor based on the expected execution time; and generating a scheduling analysis result based on the expected execution time and each node status.

[0119] It should be noted that batch scheduling information includes but is not limited to: the set start time, set end time, execution frequency, etc. The batch task scheduling diagram is used to intuitively display the execution order and dependency relationship between jobs, including: job nodes, dependency edges and job weights, where the job weight may be determined by factors such as job complexity, resource requirements and historical execution time. The execution path and potential conflict points of batch jobs can be clearly observed through graphical representation.

[0120] The target model is used to predict the expected execution time of each job based on historical operation data and current system status, including the latest start time and the latest end time, and to query the real-time status of each node in the batch executor (such as database server or application server) in the real-time monitoring system within the window of expected execution time, including CPU utilization, memory usage and JVM performance indicators. It should be noted that the acquisition of node status ensures that the analysis results can take into account the resource status of the actual execution environment.

[0121] Finally, the target model integrates scheduling information, job dependencies, expected execution time, and execution node status to generate a detailed scheduling analysis report. The report identifies scheduling conflicts, resource bottlenecks, and potential execution risks, providing specific guidance for scheduling optimization.

[0122] Through the above steps S201 to S204, the target code file and the first model prompt words can be first obtained, and then the target code file and the first model prompt words are input into the target model, and the review results are output, wherein the target model is a pre-trained interactive model, which is used to review whether the target code has any operational risks, and the review results are used to record the hidden danger code details, and then when the review results indicate that the target code has any operational risks, the second model prompt words are obtained, and finally the hidden danger code details and the second model prompt words are input into the target model, and the analysis results are output, wherein the target model is also used to analyze the code error type based on the second model prompt words and the hidden danger code details.

[0123] In the embodiment of the present invention, an interactive model deep analysis method is adopted, and different prompt words are input into the target model in stages to achieve the purpose of accurately locating and analyzing code operation hazards, thereby achieving the technical effect of improving the accuracy and efficiency of code review. Specifically, the target code file is combined with the first model prompt word, and the code is reviewed by a pre-trained interactive model to screen out possible operation hazards. The review result records the details of the hidden danger code in detail, providing a basis for subsequent refined analysis. When the review result indicates that there is a code operation hazard, the second model prompt word is further used to perform a deep analysis on the hidden danger code to accurately determine the nature of the hazard, that is, the code error type. This process makes full use of the intelligent analysis capability of the interactive model. Through the two-stage prompt word input, not only can the hidden danger be effectively identified, but also the root cause of the hidden danger can be accurately analyzed, which provides strong technical support for preventing and correcting code operation hazards, thereby solving the technical problem of insufficient ability to identify code operation hazards in related technologies, resulting in the inability to effectively prevent code operation hazards in advance.

[0124] The present invention is described below in conjunction with another optional embodiment.

[0125] Embodiment 2

[0126] An embodiment of the present invention also provides a code analysis device based on an interactive model. It should be noted that the code analysis device based on an interactive model in the embodiment of the present invention includes multiple implementation units, which can be used to execute the interactive model-based code analysis method provided in the above-mentioned embodiment one, and each implementation unit corresponds to each implementation step in the above-mentioned embodiment one.

[0127] Figure 6is a schematic diagram of an optional interactive model-based code analysis device according to an embodiment of the present invention, such as Figure 6 As shown, the device may include: a first acquisition unit 61, a first input unit 62, a second acquisition unit 63, and a second input unit 64.

[0128] The first acquisition unit 61 is used to acquire the target code file and the first model prompt word.

[0129] The first input unit 62 is used to input the target code file and the first model prompt word into the target model and output the review result, wherein the target model is a pre-trained interactive model used to review whether there are any operational risks in the target code, and the review result is used to record the details of the risk code.

[0130] The second acquisition unit 63 is used to acquire a second model prompt word when the review result indicates that the target code has an operational risk.

[0131] The second input unit 64 is used to input the hidden danger code details and the second model prompt word into the target model and output the analysis result, wherein the target model is also used to analyze the code error type based on the second model prompt word and the hidden danger code details.

[0132] The above-mentioned code analysis device based on the interactive model can first obtain the target code file and the first model prompt word through the first acquisition unit 61, and then input the target code file and the first model prompt word into the target model through the first input unit 62, and output the review result, wherein the target model is a pre-trained interactive model, which is used to review whether the target code has any operational risks, and the review result is used to record the hidden danger code details, and then through the second acquisition unit 63, when the review result indicates that the target code has an operational risk, the second model prompt word is obtained, and finally the hidden danger code details and the second model prompt word are input into the target model through the second input unit 64, and the analysis result is output, wherein the target model is also used to analyze the code error type based on the second model prompt word and the hidden danger code details.

[0133] In an embodiment of the present invention, an interactive model deep analysis method is adopted, and different prompt words are input into the target model in stages to achieve the purpose of accurately locating and analyzing code operation risks, thereby achieving the technical effect of improving the accuracy and efficiency of code review. Specifically, the target code file is combined with the first model prompt word, and the code is reviewed by a pre-trained interactive model to screen out possible operation risks. The review result records the details of the risk code in detail, providing a basis for subsequent refined analysis. When the review result indicates that there is a code operation risk, the second model prompt word is further used to perform a deep analysis on the risk code to accurately determine the nature of the risk, that is, the code error type. This process makes full use of the intelligent analysis capability of the interactive model. Through the two-stage prompt word input, not only can the risk be effectively identified, but also the root cause of the risk can be accurately analyzed, which provides strong technical support for preventing and correcting code operation risks, thereby solving the technical problem of insufficient ability to identify code operation risks in related technologies, resulting in the inability to effectively prevent code operation risks in advance.

[0134] Optionally, the first acquisition unit includes: a receiving module, used to receive a code file path input by a target user on an interactive interface; a positioning module, used to locate the file location based on the code file path, and to acquire the target code file based on the file location; a first acquisition module, used to acquire the target user's operation information on the interactive interface, wherein N drop-down menus and M input text boxes are preset on the interactive interface, and the operation information refers to the target user's click information on the N drop-down menus and input information on the M input text boxes, and N and M are both positive integers; a generation module, used to match keywords in a preset prompt word library based on the operation information, and generate a first model prompt word based on the matched keywords.

[0135] Optionally, the drop-down menu preset on the interactive interface includes at least: a first type of drop-down menu, wherein the first type of drop-down menu is used to provide analysis type selection, including the following menu items: batch interruption analysis, batch response analysis, and scheduling rationality analysis; a second type of drop-down menu, wherein the second type of drop-down menu is used to provide analysis scenario selection, including the following menu items: stock code analysis, incremental code analysis, and scheduling job analysis; a third type of drop-down menu, wherein the third type of drop-down menu is used to provide prompt word optimization selection, including the following menu items: prompt word line break structuring, prompt word sorting, and prompt word emphasis; a fourth type of drop-down menu, wherein the fourth type of drop-down menu is used to provide result processing selection, including the following menu items: result collection method, result display preference, and whether to store historical analysis results.

[0136] Optionally, when the operation information indicates that the target user selects batch interruption analysis or batch response analysis in the first drop-down menu, the drop-down menu preset on the interactive interface also includes: a fifth drop-down menu, wherein the fifth drop-down menu is used to provide interruption error type selection, including the following menu items: R interruption error type options, wherein R is a positive integer; a sixth drop-down menu, wherein the sixth drop-down menu is used to provide response error type selection, including the following menu items: S response error type options, wherein S is a positive integer.

[0137] Optionally, when the operation information indicates that the target user selects scheduling rationality analysis in the first drop-down menu, the preset drop-down menu on the interactive interface also includes: a seventh drop-down menu, wherein the seventh drop-down menu is used to provide scheduling job analysis selections, including the following menu items: scheduling job file upload, job dependency analysis, expected job time analysis, and batch executor node status query.

[0138] Optionally, the code analysis device based on the interactive model also includes: a second acquisition module, used to acquire batch job files when the review results indicate that the target code does not have any operational risks, wherein the batch job files are T target job files packaged according to a preset schedule, and the target job files include target code files that have been determined to have no operational risks, and T is an integer greater than or equal to 2; a third acquisition module, used to acquire a third model prompt word, wherein the third model prompt word is determined through a seventh category drop-down menu on the interactive interface; an input module, used to input the T target job files and the third model prompt word into the target model according to the preset schedule, and output a scheduling analysis result, wherein the target model is also used to analyze the batch schedule based on the third model prompt word, and the scheduling analysis result is used to record whether there is a scheduling conflict in the batch job file.

[0139] Optionally, the input module includes: a first determination submodule, used to determine the batch scheduling information, job pre-dependency information and job post-dependency information based on the received T target job files; a first generation submodule, used to generate a batch task scheduling graph based on the batch scheduling information, job pre-dependency information and job post-dependency information; a second determination submodule, used to determine the expected execution time of the batch job based on the batch task scheduling graph, and obtain the node status of each execution node in the batch executor based on the expected execution time; a second generation submodule, used to generate a scheduling analysis result based on the expected execution time and each node status.

[0140] It should be noted that the first acquisition unit 61, the first input unit 62, the second acquisition unit 63, and the second input unit 64 correspond to steps S201 to S204 in the first embodiment, and the examples and application scenarios implemented by the above units and the corresponding steps are the same, but are not limited to the contents disclosed in the first embodiment. It should be noted that the above modules or units can be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n), and the above modules or units can also be part of the device and can be run in the computer terminal 10 provided in the first embodiment.

[0141] The present invention is described below in conjunction with another optional embodiment.

[0142] Embodiment 3

[0143] An embodiment of the present invention may also provide an electronic device, Figure 7 is a structural block diagram of an electronic device for executing a code analysis method based on an interactive model according to an embodiment of the present invention, such as Figure 7 As shown, the electronic device may include: one or more ( Figure 7 (only one is shown) processor 702, memory 704, storage controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.

[0144] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the interactive model-based code analysis method and device in the embodiment of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned interactive model-based code analysis method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories can be connected to the terminal via 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 combinations thereof.

[0145] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: obtain the target code file and the first model prompt word; input the target code file and the first model prompt word into the target model, and output the review result, wherein the target model is a pre-trained interactive model for reviewing whether the target code has any operational risks, and the review result is used to record the risk code details; when the review result indicates that the target code has any operational risks, obtain the second model prompt word; input the risk code details and the second model prompt word into the target model, and output the analysis result, wherein the target model is also used to analyze the code error type based on the second model prompt word and the risk code details.

[0146] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: receiving the code file path input by the target user on the interactive interface; locating the file position based on the code file path, and obtaining the target code file based on the file position; obtaining the target user's operation information on the interactive interface, wherein N drop-down menus and M input text boxes are preset on the interactive interface, and the operation information refers to the target user's click information on the N drop-down menus and the input information on the M input text boxes, and N and M are both positive integers; matching keywords in a preset prompt word library based on the operation information, and generating a first model prompt word based on the matched keywords.

[0147] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: obtain a batch job file, wherein the batch job file is T target job files packaged according to a preset schedule, the target job file includes a target code file that has been determined to have no operating risks, and T is an integer greater than or equal to 2; obtain a third model prompt word, wherein the third model prompt word is determined through the seventh category drop-down menu on the interactive interface; input the T target job files and the third model prompt word into the target model according to the preset schedule, and output a scheduling analysis result, wherein the target model is also used to analyze the batch schedule based on the third model prompt word, and the scheduling analysis result is used to record whether there is a scheduling conflict in the batch job file.

[0148] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: determine the batch scheduling information, job pre-dependency information and job post-dependency information based on the received T target job files; generate a batch task scheduling graph based on the batch scheduling information, job pre-dependency information and job post-dependency information; determine the expected execution time of the batch job based on the batch task scheduling graph, and obtain the node status of each execution node in the batch executor based on the expected execution time; generate a scheduling analysis result based on the expected execution time and each node status.

[0149] By adopting the embodiment of the present invention, a code analysis scheme based on an interactive model is provided. By adopting the interactive model deep analysis method, different prompt words are input into the target model in stages, so as to achieve the purpose of accurately locating and analyzing the hidden dangers of code operation, thereby achieving the technical effect of improving the accuracy and efficiency of code review. Specifically, the target code file is combined with the prompt words of the first model, and the code is reviewed by the pre-trained interactive model to screen out the possible operation hidden dangers. The review result records the details of the hidden danger code in detail, providing a basis for the subsequent refined analysis. When the review result indicates that there is a hidden danger of code operation, the second model prompt words are further used to perform a deep analysis on the hidden danger code to accurately determine the nature of the hidden danger, that is, the type of code error. This process makes full use of the intelligent analysis ability of the interactive model. Through the two-stage prompt word input, it can not only effectively identify the hidden dangers, but also accurately analyze the root causes of the hidden dangers, providing strong technical support for preventing and correcting the hidden dangers of code operation, thereby solving the technical problem that the ability to identify hidden dangers of code operation in the related technology is insufficient, resulting in the inability to effectively prevent hidden dangers of code operation in advance.

[0150] It can be understood by those skilled in the art that Figure 7 The structure shown is for illustration only, and the electronic device may also be a smart phone, a tablet computer, a PDA, a mobile Internet device (MID), a PAD or other terminal device. Figure 7 The structure of the electronic device is not limited. Figure 7 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 7 Different configurations are shown.

[0151] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0152] The present invention is described below in conjunction with another optional embodiment.

[0153] Embodiment 4

[0154] The embodiment of the present invention further provides a computer-readable storage medium. Optionally, in the embodiment of the present invention, the computer-readable storage medium can be used to store the program code executed by the interactive model-based code analysis method provided in the first embodiment.

[0155] Optionally, in an embodiment of the present invention, the above-mentioned storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.

[0156] An embodiment of the present invention also provides a computer program product, which, when executed on a data processing device, is suitable for executing the steps of a code analysis method based on an interactive model: obtaining a target code file and a first model prompt word; inputting the target code file and the first model prompt word into a target model, and outputting a review result, wherein the target model is a pre-trained interactive model, and is used to review whether the target code has any operational risks, and the review result is used to record the details of the risk code; when the review result indicates that the target code has any operational risks, obtaining a second model prompt word; inputting the risk code details and the second model prompt word into the target model, and outputting an analysis result, wherein the target model is also used to analyze the code error type based on the second model prompt word and the risk code details.

[0157] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0158] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0159] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0160] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0161] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0162] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0163] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A code analysis method based on an interactive model, characterized in that: include: Obtaining a target code file and a first model prompt word; Input the target code file and the first model prompt word into the target model, and output a review result, wherein the target model is a pre-trained interactive model used to review whether the target code has any operation risks, and the review result is used to record the details of the risk code; When the review result indicates that the target code has an operational risk, obtaining a second model prompt word; The hidden danger code details and the second model prompt words are input into the target model, and an analysis result is output, wherein the target model is also used to analyze the code error type based on the second model prompt words and the hidden danger code details.

2. The code analysis method according to claim 1, characterized in that: The step of obtaining the target code file and the first model prompt word includes: Receive the code file path input by the target user on the interactive interface; Locating a file location based on the code file path, and acquiring the target code file based on the file location; Acquire the target user's operation information on the interactive interface, wherein the interactive interface is preset with N drop-down menus and M input text boxes, and the operation information refers to the target user's selection information on the N drop-down menus and input information on the M input text boxes, where N and M are both positive integers; Based on the operation information, keywords are matched in a preset prompt word library, and a first model prompt word is generated based on the matched keywords.

3. The code analysis method according to claim 2, characterized in that: The preset drop-down menu on the interactive interface includes at least: A first type of drop-down menu, wherein the first type of drop-down menu is used to provide analysis type selection, including the following menu items: batch interruption analysis, batch response analysis, and scheduling rationality analysis; The second type of drop-down menu, wherein the second type of drop-down menu is used to provide analysis scenario selection, including the following menu items: stock code analysis, incremental code analysis, and scheduled job analysis; The third type of drop-down menu, wherein the third type of drop-down menu is used to provide prompt word optimization selection, including the following menu items: prompt word line break structure, prompt word sorting and prompt word emphasis; The fourth type of drop-down menu, wherein the fourth type of drop-down menu is used to provide result processing options, including the following menu items: result collection method, result display preference and whether to store historical analysis results.

4. The code analysis method according to claim 3, characterized in that: In the case where the operation information indicates that the target user selects the batch interruption analysis or the batch response analysis in the first type of drop-down menu, the drop-down menu preset on the interactive interface further includes: A fifth drop-down menu, wherein the fifth drop-down menu is used to provide interruption error type selection, including the following menu items: R interruption error type options, wherein R is a positive integer; The sixth type of drop-down menu, wherein the sixth type of drop-down menu is used to provide response error type selection, including the following menu items: S types of response error type options, wherein S is a positive integer.

5. The code analysis method according to claim 3, characterized in that: In the case where the operation information indicates that the target user selects the schedule rationality analysis in the first type of drop-down menu, the drop-down menu preset on the interactive interface further includes: The seventh drop-down menu is used to provide scheduling job analysis options, including the following menu items: scheduling job file upload, job dependency analysis, expected job time analysis and batch executor node status query.

6. The code analysis method according to claim 5, characterized in that: When the review result indicates that the target code does not have any operational risk, the interactive model-based code analysis method further includes: Acquire a batch job file, wherein the batch job file is T target job files packaged according to a preset schedule, the target job file includes the target code file that has been determined to have no operation risk, and T is an integer greater than or equal to 2; Obtaining a third model prompt word, wherein the third model prompt word is determined through the seventh category drop-down menu on the interactive interface; According to the preset schedule, T target job files and the third model prompt words are input into the target model, and a scheduling analysis result is output, wherein the target model is also used to analyze the batch schedule based on the third model prompt words, and the scheduling analysis result is used to record whether there is a scheduling conflict among the batch job files.

7. The code analysis method according to claim 6, characterized in that: The step of analyzing the batch scheduling by the target model includes: Determine batch scheduling information, job pre-dependency information, and job post-dependency information based on the received T target job files; Generate a batch task scheduling graph based on the batch scheduling information, the job pre-dependency information and the job post-dependency information; Determine the expected execution time of the batch job based on the batch task scheduling graph, and obtain the node status of each execution node in the batch executor based on the expected execution time; The scheduling analysis result is generated based on the expected execution time and the status of each of the nodes.

8. A code analysis device based on an interactive model, characterized in that: include: A first acquisition unit, used for acquiring a target code file and a first model prompt word; A first input unit, used for inputting the target code file and the first model prompt word into a target model, and outputting a review result, wherein the target model is a pre-trained interactive model, and is used for reviewing whether the target code has any operation risks, and the review result is used for recording the details of the risk code; A second acquisition unit is used to acquire a second model prompt word when the review result indicates that the target code has an operation risk; The second input unit is used to input the hidden danger code details and the second model prompt word into the target model, and output the analysis result, wherein the target model is also used to analyze the code error type based on the second model prompt word and the hidden danger code details.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the interactive model-based code analysis method according to any one of claims 1 to 7.

10. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used 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 implement the interactive model-based code analysis method described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Code review method and device, storage medium and computer equipment

    CN116088857A

  • Code analysis method, device and system

    CN116166556A

  • Code analysis method and device based on neural network, and electronic equipment

    CN116578980A

  • Experiment scheduling method and device, electronic equipment and storage medium

    CN117035309A

  • Code detection model training method and device

    CN117707947A

Cited By

  • Data analysis method and device, electronic equipment and computer readable medium

    CN121233730A