Script correction method and device, equipment, medium and product

Through the generative language model, the processing of requirements description text and running scripts is automatically generated, which solves the inefficiency problem caused by manual intervention in the existing technology and realizes the automation and efficiency of script maintenance.

CN119621113APending Publication Date: 2025-03-14INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411876375.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

Existing script maintenance methods rely on manual intervention, resulting in low processing efficiency, high labor costs and low flexibility.

Method used

By responding to script update operations in the interactive interface, using a generative language model to process requirements description text and run scripts, generate target correction scripts, and realize automated requirements analysis, script analysis and script correction.

Benefits of technology

This greatly reduces manual intervention, improves problem-solving efficiency and script analysis and correction efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621113A_ABST
    Figure CN119621113A_ABST
Patent Text Reader

Abstract

The invention provides a script correction method and device, equipment, a medium and a product, and can be applied to the technical field of artificial intelligence. The method comprises the steps that in response to an updating request determined for script updating operation of an interactive interface, a demand description text and a running script are determined, the running script is used for supporting system running, and the demand description text is used for describing running defects existing in a system running based on the running script; performing word segmentation processing on the demand description text to obtain demand information and prompt words; the generated language model is used for processing the demand information, the cue word and the running script, a target correction script is obtained, the cue word is used for controlling the generated language model to execute the script correction task, and the target correction script is used for controlling normal running of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a script correction method, device, equipment, medium and product. Background Art

[0002] The existing script maintenance method is mainly handled by manual intervention of operation and maintenance personnel. The operation and maintenance personnel's handling of scripts is mainly divided into three stages: problem analysis, script content analysis, and script content correction. In the problem analysis stage, the root cause of the problem is found; in the script content analysis stage, the scripts involved and the execution statements involved in each script are analyzed; finally, in the script content correction stage, the location of the relevant statements needs to be determined, and the statements need to be adjusted, modified, optimized, etc.

[0003] In the process of implementing the present disclosure, the inventors found that each stage of analysis in the related technology would consume a lot of time of operation and maintenance personnel, with low processing efficiency, high labor costs and low flexibility. Summary of the invention

[0004] In view of the above problems, the present disclosure provides a script correction method, apparatus, device, medium and product.

[0005] According to a first aspect of the present disclosure, a script correction method is provided, comprising: in response to an update request determined for a script update operation of an interactive interface, determining a requirement description text and an operation script, wherein the operation script is used to support system operation, and the requirement description text is used to describe operation defects existing in a system running based on the operation script; performing word segmentation processing on the requirement description text to obtain requirement information and prompt words; and using a generative language model to process the requirement information, prompt words and the operation script to obtain a target correction script, wherein the prompt words are used to control the generative language model to execute a script correction task, and the target correction script is used to control the normal operation of the system.

[0006] According to an embodiment of the present disclosure, the prompt word includes at least one of a correction prompt word and an analysis prompt word, wherein the analysis prompt word is used to control the generative language model to perform a defect analysis task on the running script based on the requirement information; the correction prompt word is used to control the generative language model to correct the running script based on the requirement information.

[0007] According to an embodiment of the present disclosure, the requirement description text is generated based on the following operations: determining business change requirement information from an acquired business change requirement file; determining the business change requirement description text based on the business change requirement information, wherein the requirement description text includes the business change requirement description text.

[0008] According to an embodiment of the present disclosure, the requirement description text is generated based on the following operations: obtaining detected system fault alarm information; extracting key information from the system fault alarm information to obtain a problem requirement description text, wherein the requirement description text includes a problem requirement description text.

[0009] According to an embodiment of the present disclosure, a generative language model includes an encoder and a decoder; wherein, using the generative language model to process demand information, prompt words and running scripts to obtain a target correction script includes: position encoding the demand information to obtain a first sequence word vector; position encoding the prompt words to obtain a second sequence word vector; position encoding the running script to obtain a third sequence word vector; merging the first sequence word vector, the second sequence word vector and the third sequence word vector into an encoder to output an encoded vector; inputting the encoded vector into a decoder to output a target correction script.

[0010] According to an embodiment of the present disclosure, the encoder includes a multi-head attention layer, a normalization layer and a forward feedback layer; the first sequence word vector, the second sequence word vector and the third sequence word vector are fused and input into the encoder, and the output encoding vector includes: fusing the first sequence word vector, the second sequence word vector and the third sequence word vector to obtain a fused vector; inputting the fused vector into the multi-head attention layer and outputting the first attention vector; inputting the first attention vector into the normalization layer and outputting the initial normalized vector; merging the initial normalized vector and the fused vector to obtain a residual vector; inputting the residual vector into the forward feedback layer and outputting the first forward vector; inputting the first forward vector into the normalization layer and outputting the target normalized vector; merging the residual vector and the target normalized vector to obtain the encoding vector.

[0011] According to an embodiment of the present disclosure, the decoder includes a masked attention layer, a multi-head attention layer, a forward feedback layer, and a fully connected layer; wherein, the encoding vector is input into the decoder, and outputting the target correction script includes: inputting the encoding vector into the masked attention layer, and outputting the masked vector; fusion of the masked vector and the encoding vector is input into the multi-head attention layer, and outputting the second attention vector; inputting the second attention vector into the forward feedback layer, and outputting the second forward vector; inputting the second forward vector into the fully connected layer, and outputting the target correction script.

[0012] According to an embodiment of the present disclosure, the script correction method also includes: updating the generative language model based on the following reinforcement learning operation to obtain an updated generative language model, wherein the reinforcement learning operation includes: obtaining the operating status information generated by the system based on the target correction script operation; processing the target correction script and the operating status information based on the reward function to obtain reward information; and fine-tuning the generative language model based on the reward information to obtain an updated generative language model.

[0013] A second aspect of the present disclosure provides a script correction device, comprising:

[0014] A determination module, configured to determine a requirement description text and an operation script in response to an update request determined for a script update operation of an interactive interface, wherein the operation script is used to support system operation, and the requirement description text is used to describe operation defects existing in a system running based on the operation script;

[0015] The word segmentation module is used to perform word segmentation on the demand description text to obtain demand information and prompt words;

[0016] The correction module is used to use the generative language model to process the demand information, prompt words and running scripts to obtain the target correction script, wherein the prompt words are used to control the generative language model to execute the script correction task, and the target correction script is used to control the normal operation of the system.

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

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

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

[0020] According to the script correction method, device, equipment, medium and product provided by the present disclosure, by responding to the update request determined by the script update operation for the interactive interface, the demand description text and the running script are determined; the demand description text is segmented to obtain the demand information and prompt words; the demand information, prompt words and running script are processed by using a generative language model to obtain the target correction script. Since the demand description text and the running script are processed by the generative language model, the target correction script is directly generated, which realizes the automation of demand analysis, script analysis and script correction, greatly reduces the manual intervention work of analyzing the cause of the problem and locating the associated execution statements in the script and then correcting the script, and improves the efficiency of problem solving and script analysis and correction. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0022] Figure 1A diagram schematically shows an application scenario of the script correction method according to an embodiment of the present disclosure;

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

[0024] Figure 3 A schematic diagram schematically shows an interactive interface according to an embodiment of the present disclosure;

[0025] Figure 4 A schematic diagram schematically shows a system architecture according to an embodiment of the present disclosure;

[0026] Figure 5 A schematic diagram of a generative language model according to an embodiment of the present disclosure is schematically shown;

[0027] Figure 6 A schematic diagram showing a structural block diagram of a script correction device according to an embodiment of the present disclosure; and

[0028] Figure 7 A block diagram of an electronic device suitable for implementing a script correction method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

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

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

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

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

[0033] In the process of implementing the present disclosure, it was found that the existing script maintenance methods in the relevant technology are mainly handled by manual intervention of operation and maintenance personnel, and the operation and maintenance personnel's handling of scripts is mainly divided into three stages: problem analysis, script content analysis, and script content correction. In the problem analysis stage, find the root cause of the problem; in the script content analysis stage, analyze the scripts involved, the execution statements involved in each script, etc.; finally, in the script content correction stage, it is necessary to determine the location of the relevant statements, and adjust, modify, optimize, etc. the statements. Each stage of analysis will consume a lot of time for the operation and maintenance personnel, such as manually operating the script and modifying the content, which has low processing efficiency, high labor costs, and low flexibility.

[0034] In view of this, an embodiment of the present disclosure provides a script correction method, which determines a requirement description text and an operation script in response to an update request determined for a script update operation of an interactive interface, wherein the operation script is used to support system operation, and the requirement description text is used to describe operation defects existing in a system that runs based on the operation script; performs word segmentation processing on the requirement description text to obtain requirement information and prompt words; uses a generative language model to process the requirement information, prompt words and the operation script to obtain a target correction script, wherein the prompt words are used to control the generative language model to execute the script correction task, and the target correction script is used to control the normal operation of the system.

[0035] It should be noted that the script correction method and script correction device provided by the present disclosure can be used in the field of financial technology, such as financial institutions, and can also be used in any field other than the field of financial technology, such as e-commerce platforms such as shopping websites. Therefore, the application field of the script correction method and script correction device provided by the present disclosure is not limited.

[0036] In the technical solution of the present disclosure, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0037] In the scenario of using personal information for automated decision-making, the methods, devices, and systems provided by the embodiments of the present disclosure provide users with corresponding operation portals for 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. The expression "automated decision-making" here refers to the activity of automatically analyzing and evaluating a person's behavioral habits, interests and hobbies, or economic, health, credit status, etc. through computer programs, and making decisions. The expression "expert decision-making" here refers to the activity of making decisions by people who specialize in a certain field, have specialized experience, knowledge and skills, and have reached a certain level of professionalism.

[0038] Figure 1 The application scenario diagram of the script correction method according to the embodiment of the present disclosure is schematically shown.

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

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

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

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

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

[0044] It should be understood that Figure 1 The number of the first terminal device, the second terminal device, the third terminal device, the network and the server in the embodiment is only for illustration. According to the implementation requirements, there may be any number of the first terminal device, the second terminal device, the third terminal device, the network and the server.

[0045] The following will be based on Figure 1 The scene described by Figure 2~Figure 5 The script correction method of the embodiment of the present disclosure is described in detail.

[0046] Figure 2 The flowchart of the script correction method according to the embodiment of the present disclosure is schematically shown.

[0047] like Figure 2 As shown, the script correction method 200 of this embodiment includes operations S210 to S230.

[0048] In operation S210 , in response to an update request determined for a script update operation of an interactive interface, a requirement description text and an operating script are determined.

[0049] In operation S220, the demand description text is segmented to obtain demand information and prompt words.

[0050] In operation S230, the requirement information, the prompt words and the running script are processed using a generative language model to obtain a target correction script.

[0051] According to an embodiment of the present disclosure, the interactive interface is a human-computer interaction interface built on the development framework React based on the application (World Wide Web, Web), and human-computer interaction is achieved through an application programming interface (English: Application Programming Interface, API).

[0052] According to an embodiment of the present disclosure, the script update operation for the interactive interface may be an operation in which relevant operation and maintenance personnel input relevant information in the interactive interface based on the requirements to be updated, and an update request is determined according to the script update operation.

[0053] According to an embodiment of the present disclosure, in response to receiving an update request, the server extracts information from the update request, determines a requirement description text and an operation script.

[0054] According to an embodiment of the present disclosure, a running script is used to support system operation, for example, the running script is a shell script. A shell script is a programming method for managing an application program of an operating system. It is an interface between a user and an operating system, allowing a user to execute commands and operations on the operating system. A shell script is a plain text file, which is a program written by a user using shell syntax and instructions. The program can be run in the command line of the operating system. Shell scripts use special syntax and system calls to implement their functions, and can be used for many different tasks, such as file operations, network configuration, user management, process management, etc.

[0055] According to an embodiment of the present disclosure, the requirement description text is used to describe the operation defects of the system based on the operation script, such as server downtime defects, application function defects, and excessive memory usage defects.

[0056] According to an embodiment of the present disclosure, format errors, problematic and irrelevant statements in the demand description text are removed, and the data format is unified, such as removing special characters, punctuation marks, stop words, etc.; and statements such as spaces and comments in the running script that have no meaning to the program code are removed.

[0057] According to an embodiment of the present disclosure, the demand description text is segmented based on a segmentation algorithm to obtain demand information and prompt words. For example, the prompt words may be "please", "according to", "demand", "information", "modify", "shell", or "script".

[0058] According to an embodiment of the present disclosure, prompt words are used to control the generative language model to perform a script correction task.

[0059] According to an embodiment of the present disclosure, the demand information represents system-specific defect description information, such as defect occurrence time, location, frequency, etc. The demand information may be a plurality of demand words obtained based on the jieba word segmentation tool.

[0060] According to an embodiment of the present disclosure, a trained generative language model is used to analyze demand information and operation scripts based on prompt words, determine the cause of the operation defect and the location of the execution statement associated with the cause in the operation script, and then adjust, modify, optimize, etc. the execution statement to obtain a target correction script, which is used to control the normal operation of the system.

[0061] According to an embodiment of the present disclosure, a generative language model is trained using a Chinese corpus involving demand description texts and a script corpus of running scripts to improve the accuracy of the generative language model. A variety of Chinese corpora are selected to ensure the diversity and integrity of the corpus forms; the content of the script corpus is different from that of natural language, and the statements have their own specific syntax, just like C++ or Java programs, with variables, commands, loop statements, conditional statements, functions, system calls, etc. Therefore, the script corpus needs to be collected and obtained separately from the open source database.

[0062] According to the embodiments of the present disclosure, by utilizing a generative language model to process the requirement description text and run the script, a target correction script is directly generated, thereby realizing the automation of requirement analysis, script analysis, and script correction. This greatly reduces the manual intervention work of analyzing the cause of the problem and locating the associated execution statements in the script and then correcting the script, thereby improving the problem solving efficiency and the script analysis and correction efficiency.

[0063] According to an embodiment of the present disclosure, the prompt word includes at least one of a correction prompt word and an analysis prompt word, wherein the analysis prompt word is used to control the generative language model to perform a defect analysis task on the running script based on the requirement information; the correction prompt word is used to control the generative language model to correct the running script based on the requirement information.

[0064] According to an embodiment of the present disclosure, a requirement description text may include multiple requirement information, each of which has a corresponding number. The running script may include multiple sub-scripts, each of which has a corresponding number.

[0065] According to an embodiment of the present disclosure, the correction prompt word is used to control the generative language model to correct the sub-script corresponding to the target requirement information based on the target requirement information.

[0066] For example, the modified prompt words are "please", "according to", "requirement", "information", "1", "modify", "shell", "script", and "3".

[0067] According to an embodiment of the present disclosure, the analysis prompt word is used to prompt the generative language model to analyze the target requirement information and analyze the sub-script corresponding to the target requirement information. The analysis of the target requirement information is used to determine the cause of the operation defect, and the analysis of the sub-script is used to disassemble multiple execution statements in the sub-script and determine the location of the execution statement corresponding to the cause.

[0068] For example, the revised prompt words are "please", "analysis", "requirement", "information", "1", "and", "shell", "script", and "3".

[0069] Figure 3 A schematic diagram of an interactive interface according to an embodiment of the present disclosure is schematically shown.

[0070] like Figure 3 As shown, the script update operation is performed on the interactive interface. When the requirement description text is entered in the "Please enter the problem description" dialog box, the run script is entered in the "Please enter the script content" dialog box, and an update request is generated. The server receives the update request and sends it to the generative language model to obtain the target correction script. The target correction script that the user wants to use is displayed word for word in the "Generated Script Content" dialog box on the right.

[0071] Figure 4 The diagram schematically shows a system architecture according to an embodiment of the present disclosure.

[0072] like Figure 4 As shown, the interactive interface is a web front-end interface. The front-end interface, back-end framework, and generative language model are all deployed on the cloud server. The back-end uses the Node.js framework. The back-end framework supports the training and application of the generative language model. The generative language model is built based on the Transformer architecture. The script update operation for the interactive interface includes: entering the requirement description text and running the script in the dialog box. After receiving the update request, the cloud server extracts the requirement description text and the running script, and sends them to the generative language model for correction to obtain the target correction script. The cloud server obtains the target correction script and displays the target correction script in the interactive interface for more convenient use by users.

[0073] According to the embodiments of the present disclosure, the generative language model needs to use a large amount of text data to train and generate answers, and the distributed file system (Hadoop Distributed File System, HDFS) has the ability to store a large amount of text data and has a strong parallel processing capability, which can improve the training and deployment efficiency of the model. Therefore, the Hadoop distributed file system is selected as the storage system for the model data.

[0074] According to the embodiments of the present disclosure, a human-computer interaction interface is provided for the input and output of a generative language model in the form of a Web application, so that the solution to the problem is more intuitive, and operation and maintenance personnel can use the functions of the interaction interface more conveniently and quickly.

[0075] According to an embodiment of the present disclosure, the requirement description text is generated based on the following operations: determining business change requirement information from an acquired business change requirement file; determining the business change requirement description text based on the business change requirement information, wherein the requirement description text includes the business change requirement description text.

[0076] According to the embodiment of the present disclosure, when the business requirements of an enterprise change, the business requirement change information needs to be written into the business change requirement file. The business requirement change information may include a description of the business requirement change, the change content, the change effect, etc.

[0077] According to an embodiment of the present disclosure, the business change requirement information is screened to obtain a business change requirement description text, for example, the business change requirement description text may include the business requirement content before change, content after change, change time, application change location, etc. The target correction script obtained based on the business change requirement description text may support the normal use of related business application functions on the system.

[0078] According to an embodiment of the present disclosure, the requirement description text is generated based on the following operations:

[0079] Acquire detected system fault alarm information; extract key information from the system fault alarm information to obtain a problem requirement description text, wherein the requirement description text includes a problem requirement description text.

[0080] According to an embodiment of the present disclosure, system fault alarm information is obtained based on the fault alarm signal.

[0081] According to the embodiment of the present disclosure, the key error information is extracted from the system fault alarm information to obtain the problem requirement description text. For example, the key error information is "error: XXX"

[0082] For example, the problem requirement description text may be a server downtime problem description, a server downtime time description, etc.

[0083] According to the embodiments of the present disclosure, a problem requirement description text is obtained based on system fault alarm information and business change information, so that requirements can be flexibly determined in real time according to on-site faults and business change requirements, so as to correct the scripts associated with the requirement problems and solve the requirements.

[0084] According to an embodiment of the present disclosure, a generative language model includes an encoder and a decoder; wherein, using the generative language model to process demand information, prompt words and running scripts to obtain a target correction script includes: position encoding the demand information to obtain a first sequence word vector; position encoding the prompt words to obtain a second sequence word vector; position encoding the running script to obtain a third sequence word vector; merging the first sequence word vector, the second sequence word vector and the third sequence word vector into an encoder to output an encoded vector; inputting the encoded vector into a decoder to output a target correction script.

[0085] According to the embodiments of the present disclosure, the demand information is subjected to word embedding and then position encoding to obtain a first sequence word vector; the prompt words are subjected to word embedding and then position encoding to obtain a second sequence word vector; the running script is subjected to word embedding and then position encoding to obtain a third sequence word vector.

[0086] According to an embodiment of the present disclosure, word embedding uses a pre-trained word vector model, and the position encoding process is to add position information to the input word embedding vector sequence to achieve sequence order perception capability.

[0087] According to an embodiment of the present disclosure, a generative language model includes an encoder and a decoder. The generative language model is constructed based on the overall Transformer architecture. The first sequence word vector, the second sequence word vector and the third sequence word vector are fused and input to the encoder, and the encoded vector is output.

[0088] According to an embodiment of the present disclosure, a decoder is processed using a coding vector to obtain a target correction script.

[0089] According to an embodiment of the present disclosure, the encoder includes a multi-head attention layer, a normalization layer and a forward feedback layer; the first sequence word vector, the second sequence word vector and the third sequence word vector are fused and input into the encoder, and the output encoding vector includes: fusing the first sequence word vector, the second sequence word vector and the third sequence word vector to obtain a fused vector; inputting the fused vector into the multi-head attention layer and outputting the first attention vector; inputting the first attention vector into the normalization layer and outputting the initial normalized vector; merging the initial normalized vector and the fused vector to obtain a residual vector; inputting the residual vector into the forward feedback layer and outputting the first forward vector; inputting the first forward vector into the normalization layer and outputting the target normalized vector; merging the residual vector and the target normalized vector to obtain the encoding vector.

[0090] According to an embodiment of the present disclosure, the first sequence word vector, the second sequence word vector and the third sequence word vector are concatenated to obtain a fusion vector.

[0091] According to an embodiment of the present disclosure, the encoder module consists of two sub-layers, the first sub-layer includes a multi-head attention mechanism layer, a normalization layer, and a residual connection layer; the second sub-layer includes a forward feedback layer, a normalization layer, and a residual connection layer, and the forward feedback layer is a fully connected forward feedback layer.

[0092] According to an embodiment of the present disclosure, a query vector Q, a key vector K, and a numerical vector V are obtained based on the fusion vector. The multi-head attention mechanism projects the query vector Q, the key vector K, and the numerical vector V together through n different linear transformations, performs dot product attention calculations, and finally splices the different results together.

[0093] In one embodiment, the dot product attention is calculated as shown in formula (1):

[0094] (1);

[0095] Among them, T represents the transposition process, Represents the dimension of the key vector K, Q represents the query vector, V represents the numerical vector, and K represents the key vector.

[0096] In one embodiment, the first attention vector is calculated as shown in formula (2):

[0097] (2);

[0098] in, Characterize the splicing operation, Represents the dot product attention corresponding to the nth linear projection layer, The weight matrix representing the last linear projection layer.

[0099] According to an embodiment of the present disclosure, the first attention vector is processed by a normalization layer to obtain an initial normalized vector; the initial normalized vector and the fusion vector are merged to obtain a residual vector.

[0100] According to an embodiment of the present disclosure, a residual vector is processed using a front feedback layer to obtain a first front vector; the first front vector is processed using a normalization layer to obtain a target normalized vector; the residual vector and the target normalized vector are merged to obtain a coding vector.

[0101] According to an embodiment of the present disclosure, the decoder includes a masked attention layer, a multi-head attention layer, a forward feedback layer, and a fully connected layer; wherein, the encoding vector is input into the decoder, and outputting the target correction script includes: inputting the encoding vector into the masked attention layer, and outputting the masked vector; fusion of the masked vector and the encoding vector is input into the multi-head attention layer, and outputting the second attention vector; inputting the second attention vector into the forward feedback layer, and outputting the second forward vector; inputting the second forward vector into the fully connected layer, and outputting the target correction script.

[0102] According to an embodiment of the present disclosure, the decoder is composed of three sub-layers, the first sub-layer includes a masked attention layer, a normalization layer, and a residual connection layer, the masked attention layer is a multi-head attention layer with a mask function, the second sub-layer includes a multi-head attention layer, a normalization layer, and a residual connection layer, and the third sub-layer includes a pre-feedback layer, a normalization layer, and a residual connection layer. The multi-head attention layer is a multi-head attention layer that integrates the encoding vector output by the encoder and the output of the residual connection layer in the first sub-layer.

[0103] According to an embodiment of the present disclosure, after the encoding vector is processed by the masked attention layer, it is input into the normalization layer and the residual connection layer to output the masked vector.

[0104] According to an embodiment of the present disclosure, the masking vector and the encoding vector are integrated using a multi-head attention layer, and then input into a normalization layer and a residual connection layer to output a second attention vector.

[0105] According to an embodiment of the present disclosure, after the second attention vector is processed by the forward feedback layer, it is input into the normalization layer and the residual connection layer to output the second forward vector.

[0106] According to an embodiment of the present disclosure, the second pre-vector is first input into a normalization layer and then into a fully connected layer, and the matching probabilities of multiple classification words corresponding to each word in the running script are output, and the classification words with high matching probabilities are determined as correction words, thereby obtaining a target correction script.

[0107] Figure 5 A schematic diagram of a generative language model according to an embodiment of the present disclosure is schematically shown.

[0108] like Figure 5 As shown in the figure, the generative language model includes an encoder and a decoder. When the encoder inputs, the input information needs to be positionally encoded. The encoder module consists of two sublayers. The first sublayer includes a multi-head attention mechanism layer, a normalization layer, and a residual connection layer; the second sublayer includes a pre-feedback layer, a normalization layer, and a residual connection layer. The pre-feedback layer is a fully connected pre-feedback layer. The decoder consists of three sublayers. The first sublayer includes a masked attention layer, a normalization layer, and a residual connection layer. The masked attention layer is a multi-head attention layer with a masking function. The second sublayer includes a multi-head attention layer, a normalization layer, and a residual connection layer. The third sublayer includes a pre-feedback layer, a normalization layer, and a residual connection layer. The multi-head attention layer is a multi-head attention layer that integrates the encoding vector output by the encoder and the output of the residual connection layer in the first sublayer. The output in the decoder is embedded as an encoding vector. After position encoding, the encoding vector is input into the masked attention layer. Finally, it passes through the fully connected layer softmax to output the matching probability of multiple classified words corresponding to each word in the running script.

[0109] According to an embodiment of the present disclosure, the script correction method also includes: updating the generative language model based on the following reinforcement learning operation to obtain an updated generative language model, wherein the reinforcement learning operation includes: obtaining the operating status information generated by the system based on the target correction script operation; processing the target correction script and the operating status information based on the reward function to obtain reward information; and fine-tuning the generative language model based on the reward information to obtain an updated generative language model.

[0110] According to the embodiment of the present disclosure, supervised training of the generative language model is first performed based on the supervised fine-tuning (SFT) model. In this stage, high-quality target correction script data is selected and integrated into a sample question-answering data set to train the generative language model. The training consumes little computing resources and only requires 100 graphics processing units (GPUs) for a few days of training.

[0111] According to an embodiment of the present disclosure, the running status information may be a computing resource consumption status generated during the training of the generative language model.

[0112] According to the embodiments of the present disclosure, a reward model is obtained based on reward function training. In this stage, the sample question and answer data set collected in the supervised fine-tuning stage is converted into a comparable data set, and the reward function is used to let the generative language model learn to compare which answer is better for the same question input. The reward information is the feedback information generated for the target correction script and the running status information, which can be positive feedback information and negative feedback information.

[0113] According to the embodiments of the present disclosure, the supervised fine-tuning model and the reward model obtained through training are used to perform reinforcement learning operations. This stage allows the generative language model to learn which questions have good return results and which have bad return results. If the reward information is positive, the corresponding target correction script will be generated more in the future; if the reward information is negative, the corresponding target correction script will be generated as little as possible in the future.

[0114] According to the embodiments of the present disclosure, a sample corpus is obtained, and the cleaned sample corpus is divided into a training set, a validation set, and a test set according to a certain ratio. The validation set is used to verify the training results of the fine-tuned generative language model, and the indicators used for verification include accuracy, recall, etc. If the performance of the model does not meet the requirements, the performance of the model can be improved by changing the training set, optimizing the model architecture, or adjusting the hyperparameters.

[0115] According to an embodiment of the present disclosure, the generative language model is optimized based on the reinforcement learning operations in the supervised stage and the reward stage, so that the generative language model can learn which question inputs return more accurate results, thereby improving the accuracy of the model.

[0116] Based on the above script correction method, the present disclosure also provides a script correction device. Figure 6 The device is described in detail.

[0117] Figure 6 The structural block diagram of the script correction device according to the embodiment of the present disclosure is schematically shown.

[0118] like Figure 6 As shown, the script correction device 600 of this embodiment includes a determination module 610 , a word segmentation module 620 and a correction module 630 .

[0119] The determination module 610 is used to determine the requirement description text and the operation script in response to the update request determined for the script update operation of the interactive interface, wherein the operation script is used to support the operation of the system, and the requirement description text is used to describe the operation defects existing in the system based on the operation script. In one embodiment, the determination module 610 can be used to perform the operation S210 described above, which will not be repeated here.

[0120] The word segmentation module 620 is used to perform word segmentation processing on the demand description text to obtain demand information and prompt words. In one embodiment, the word segmentation module 620 can be used to perform the operation S220 described above, which will not be repeated here.

[0121] The correction module 630 is used to process the demand information, the prompt word and the running script by using the generative language model to obtain a target correction script, wherein the prompt word is used to control the generative language model to perform the script correction task, and the target correction script is used to control the normal operation of the system. In one embodiment, the correction module 630 can be used to perform the operation S230 described above, which will not be repeated here.

[0122] According to an embodiment of the present disclosure, the correction module 630 includes a first generation submodule, a second generation submodule, a third generation submodule, an encoding submodule and a decoding submodule.

[0123] The first generation submodule is used to perform position encoding on the demand information to obtain a first sequence word vector.

[0124] The second generation submodule is used to perform position encoding on the prompt word to obtain a second sequence word vector.

[0125] The third generation submodule is used to perform position encoding on the running script to obtain a third sequence word vector.

[0126] The encoding submodule is used to fuse the first sequence word vector, the second sequence word vector and the third sequence word vector into an encoder and output an encoded vector.

[0127] The decoding submodule is used to input the encoding vector into the decoder and output the target correction script.

[0128] According to an embodiment of the present disclosure, the encoding submodule includes a first encoding unit, a second encoding unit, a third encoding unit, a fourth encoding unit, a fifth encoding unit, a sixth encoding unit, and a seventh encoding unit.

[0129] The first encoding unit is used to fuse the first sequence word vector, the second sequence word vector and the third sequence word vector to obtain a fused vector.

[0130] The second encoding unit is used to input the fusion vector into the multi-head attention layer and output the first attention vector.

[0131] The third encoding unit is used to input the first attention vector into the normalization layer and output an initial normalized vector.

[0132] The fourth encoding unit is used to merge the initial normalized vector and the fusion vector to obtain a residual vector.

[0133] The fifth encoding unit is used to input the residual vector to the forward feedback layer and output the first forward vector.

[0134] The sixth encoding unit is used to input the first pre-vector to the normalization layer and output a target normalized vector.

[0135] The seventh encoding unit is used to merge the residual vector and the target normalized vector to obtain a coding vector.

[0136] According to an embodiment of the present disclosure, the decoding submodule includes a first decoding unit, a second decoding unit, a third decoding unit and a fourth decoding unit.

[0137] The first decoding unit is used to input the encoding vector into the masked attention layer and output the masked vector.

[0138] The second decoding unit is used to fuse the masking vector and the encoding vector into the multi-head attention layer and output a second attention vector.

[0139] The third decoding unit is used to input the second attention vector into the front feedback layer and output a second front vector.

[0140] The fourth decoding unit is used to input the second pre-vector into the fully connected layer and output a target correction script.

[0141] According to an embodiment of the present disclosure, the script correction device 600 also includes an acquisition module, a reward module and a fine-tuning module.

[0142] The acquisition module is used to obtain the running status information generated by the system based on the running of the target correction script.

[0143] The reward module is used to process the target correction script and the running status information based on the reward function to obtain the reward information.

[0144] The fine-tuning module is used to fine-tune the generative language model based on the reward information to obtain an updated generative language model.

[0145] According to an embodiment of the present disclosure, any multiple modules of the determination module 610, the word segmentation module 620 and the correction module 630 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the determination module 610, the word segmentation module 620 and the correction module 630 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in any appropriate combination of any of them. Alternatively, at least one of the determination module 610, the word segmentation module 620 and the correction module 630 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be performed.

[0146] Figure 7 A block diagram of an electronic device suitable for implementing a script correction method according to an embodiment of the present disclosure is schematically shown.

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

[0148] In RAM 703, various programs and data required for the operation of electronic device 700 are stored. Processor 701, ROM 702 and RAM 703 are connected to each other via bus 704. Processor 701 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 702 and / or RAM 703. It should be noted that the program can also be stored in one or more memories other than ROM 702 and RAM 703. Processor 701 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in one or more memories.

[0149] According to an embodiment of the present disclosure, the electronic device 700 may further include an input / output (I / O) interface 705, which is also connected to the bus 704. The electronic device 700 may further include one or more of the following components connected to the input / output (I / O) interface 705: an input portion 706 including a keyboard, a mouse, etc.; an output portion 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 708 including a hard disk, etc.; and a communication portion 709 including a network interface card such as a LAN card, a modem, etc. The communication portion 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the input / output (I / O) interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage portion 708 as needed.

[0150] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

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

[0152] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the script correction method provided by the embodiment of the present disclosure.

[0153] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 701. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0154] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 709, and / or installed from the removable medium 711. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0155] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the processor 701, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.

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

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

[0158] It will be appreciated by those skilled in the art that the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations or combinations are not explicitly described in the present disclosure. In particular, without departing from the spirit and teachings of the present disclosure, the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.

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

Claims

1. A script correction method, characterized in that: The method comprises: In response to an update request determined for a script update operation of an interactive interface, determining a requirement description text and an operation script, wherein the operation script is used to support system operation, and the requirement description text is used to describe operation defects existing in the system running based on the operation script; Performing word segmentation processing on the demand description text to obtain demand information and prompt words; The requirement information, the prompt word and the running script are processed by a generative language model to obtain a target correction script, wherein the prompt word is used to control the generative language model to perform a script correction task, and the target correction script is used to control the normal operation of the system.

2. The method according to claim 1, characterized in that The prompt words include at least one of correction prompt words and analysis prompt words, wherein the analysis prompt words are used to control the generative language model to perform a defect analysis task on the running script based on the requirement information; the correction prompt words are used to control the generative language model to correct the running script based on the requirement information.

3. The method according to claim 2, characterized in that The requirement description text is generated based on the following operations: Determine the business change requirement information from the obtained business change requirement document; Based on the business change requirement information, a business change requirement description text is determined, wherein the requirement description text includes the business change requirement description text.

4. The method according to claim 2, characterized in that: The requirement description text is generated based on the following operations: Obtain detected system fault alarm information; Key information is extracted from the system fault alarm information to obtain a problem requirement description text, wherein the requirement description text includes the problem requirement description text.

5. The method according to claim 1, characterized in that The generative language model includes an encoder and a decoder; Wherein, using the generative language model to process the requirement information, the prompt word and the running script to obtain the target correction script includes: Performing position encoding on the demand information to obtain a first sequence word vector; Performing position encoding on the prompt word to obtain a second sequence word vector; Performing position encoding on the running script to obtain a third sequence word vector; The first sequence word vector, the second sequence word vector and the third sequence word vector are fused and input into the encoder, and an encoding vector is output; The encoding vector is input to the decoder, and the target correction script is output.

6. The method according to claim 5, characterized in that The encoder includes a multi-head attention layer, a normalization layer and a pre-feedback layer; The first sequence word vector, the second sequence word vector and the third sequence word vector are fused and input into the encoder, and the output encoding vector includes: Fusing the first sequence word vector, the second sequence word vector and the third sequence word vector to obtain a fused vector; Input the fusion vector to the multi-head attention layer and output a first attention vector; Inputting the first attention vector to the normalization layer and outputting an initial normalized vector; Merging the initial normalized vector and the fused vector to obtain a residual vector; Inputting the residual vector to the forward feedback layer, and outputting a first forward vector; Inputting the first pre-vector into the normalization layer, and outputting a target normalized vector; The residual vector and the target normalized vector are combined to obtain the encoding vector.

7. The method according to claim 5, characterized in that The decoder includes a masked attention layer, a multi-head attention layer, a forward feedback layer, and a fully connected layer; Wherein, inputting the encoding vector into the decoder and outputting the target correction script comprises: Input the encoding vector to the masked attention layer and output a masked vector; The masking vector and the encoding vector are fused and input into the multi-head attention layer, and a second attention vector is output; Inputting the second attention vector to the forward feedback layer, and outputting a second forward vector; The second pre-vector is input into the fully connected layer, and the target correction script is output.

8. The method according to claim 1, characterized in that The method further comprises: The generative language model is updated based on the following reinforcement learning operation to obtain an updated generative language model, wherein the reinforcement learning operation includes: Acquire operation status information generated by the system based on the operation of the target correction script; Processing the target correction script and the running status information based on a reward function to obtain reward information; and The generative language model is fine-tuned based on the reward information to obtain the updated generative language model.

9. A script correction device, characterized in that: The device comprises: A determination module, configured to determine, in response to an update request determined for a script update operation of an interactive interface, a requirement description text and an operation script, wherein the operation script is used to support system operation, and the requirement description text is used to describe operation defects existing in the system operated based on the operation script; A word segmentation module is used to perform word segmentation processing on the demand description text to obtain demand information and prompt words; The correction module is used to use the generative language model to process the demand information, the prompt word and the running script to obtain a target correction script, wherein the prompt word is used to control the generative language model to perform a script correction task, and the target correction script is used to control the normal operation of the system.

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

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

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