Script command generation method and device and storage medium

By using script command generation method based on neural network model in telecom network management, the problem of large error in script command generation in the existing technology is solved, the generation efficiency and accuracy are improved, the telecom network management failure is reduced, and the user experience is improved.

CN120045182APending Publication Date: 2025-05-27ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311524942.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-15
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

The existing technology has large errors in generating script commands in telecommunications network management, resulting in failures such as downtime in telecommunications network management, affecting user experience.

Method used

The target script command is generated by obtaining the script task to be generated and the neural network model trained based on the training sample set, including the command body, command parameters and parameter values.

Benefits of technology

Improve the efficiency and accuracy of script command generation, reduce the occurrence of telecommunications network management failures, and improve user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045182A_ABST
    Figure CN120045182A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a script command generation method and device and a storage medium, and belongs to the field of computers. The method comprises: obtaining a script task of a to-be-generated script command and a script command generation model, the script command generation model being obtained by training a preset neural network model based on a training sample set, and the training sample set being generated by augmenting a plurality of script command sample data; and generating a target script command based on the script task and the script command generation model, wherein the target script command comprises a command main body, a command parameter and a parameter value. According to the scheme, the script task is input into the pre-trained script command generation model to generate the target script command, so that the script command generation efficiency and accuracy are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of computer technology, and in particular, to a method, device, and storage medium for generating script commands. Background Art

[0002] In the field of telecommunications network management technology, script commands are used to execute each script task. Currently, there are basically two ways to call script commands in telecommunications network management. One is to manually select and call script commands by technicians, and the other is to call script commands through a script assistant. However, the script assistant is generated based on a small amount of sample data. Due to the small amount of sample data, the script commands called by the generated script assistant have large errors, which in turn leads to faults such as downtime in the telecommunications network management, seriously affecting the user experience.

[0003] Therefore, how to accurately and conveniently generate script commands is an urgent problem to be solved at present. Summary of the Invention

[0004] Embodiments of the present invention aim to provide a method, device, and storage medium for generating script commands, aiming to accurately and efficiently generate script commands.

[0005] In a first aspect, an embodiment of the present invention provides a method for generating a script command, including:

[0006] Obtain a script task for which a script command is to be generated and a script command generation model, where the script command generation model is obtained by training a preset neural network model based on a training sample set, and the training sample set is generated by augmenting a plurality of script command example data;

[0007] Generate a target script command based on the script task and the script command generation model, and obtain the target script command, where the target script command includes a command body, command parameters, and parameter values.

[0008] In a second aspect, an embodiment of the present invention further provides a terminal device, including a processor, a memory, a computer program stored on the memory and executable by the processor, and a data bus for realizing connection communication between the processor and the memory. When the computer program is executed by the processor, the steps of any script command generation method provided in the specification of the present invention are implemented.

[0009] In a third aspect, an embodiment of the present invention further provides a storage medium for computer-readable storage, characterized in that the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any script command generation method provided in the specification of the present invention.

[0010] An embodiment of the present invention provides a method, device, and storage medium for generating script commands. In the embodiment of the present invention, a script task for generating a script command and a script command generation model are obtained. The script command generation model is obtained by training a preset neural network model based on a training sample set, and the training sample set is generated by augmenting a plurality of script command sample data. A target script command is generated based on the script task and the script command generation model, and the target script command is obtained. The target script command includes a command body, command parameters, and parameter values. Through augmenting a plurality of script command sample data, this solution can obtain a sufficient number of training samples, and by training the neural network model with the training sample set, the script command generation model can be accurately obtained. By inputting the script task into the pre-trained script command generation model to generate the target script command, the efficiency and accuracy of script command generation are greatly improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 It is a schematic flowchart of a method for generating a script command provided by an embodiment of the present invention;

[0012] Figure 2 It is a schematic flowchart of another method for generating a script command provided by an embodiment of the present invention;

[0013] Figure 3 is Figure 2 a sub-step flowchart of step S202 in

[0014] Figure 4 is Figure 2 a sub-step flowchart of step S203 in

[0015] Figure 5 is Figure 2 a sub-step flowchart of step S204 in

[0016] Figure 6 It is a schematic block diagram of a device for generating a script command provided by an embodiment of the present application;

[0017] Figure 7 It is a schematic block diagram of another device for generating a script command provided by an embodiment of the present application;

[0018] Figure 8 It is a schematic block diagram of the structure of a terminal device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0019] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0020] The flowchart shown in the accompanying drawings is only an example, and does not necessarily include all contents and operations / steps, nor does it necessarily need to be executed in the described order. For example, some operations / steps can be decomposed, combined or partially merged, so the actual execution order may change according to the actual situation.

[0021] It should be understood that the terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include the plural forms.

[0022] The embodiments of the present invention provide a script command generation method, device and storage medium. Among them, the script command generation method can be applied to a terminal device, and the terminal device can be a device such as a mobile phone, a tablet computer, a notebook computer, and a desktop computer. For example, when the terminal device is a notebook computer, the notebook computer obtains a script task and a script command generation model for which a script command is to be generated, where the script command generation model is obtained by training a preset neural network model based on a training sample set, and the training sample set is generated by augmenting a plurality of script command sample data; a target script command is generated based on the script task and the script command generation model, and the target script command is obtained, and the target script command includes a command body, command parameters, and parameter values.

[0023] Next, some embodiments of the present invention will be described in detail in conjunction with the accompanying drawings. Without conflict, the following embodiments and the features in the embodiments can be combined with each other.

[0024] Please refer to Figure 1 , Figure 1 which is a schematic flowchart of a script command generation method provided by an embodiment of the present invention.

[0025] As Figure 1 shown, the script command generation method includes steps S101 to S102.

[0026] Step S101: Obtain a script task for which a script command is to be generated and a script command generation model. The script command generation model is obtained by training a preset neural network model based on a training sample set, and the training sample set is generated by augmenting a plurality of script command example data.

[0027] The script command generation model is obtained by training based on a training sample set. The type of the neural network model can be set according to actual situations, and the embodiments of the present invention do not make specific limitations thereto. For example, the neural network model can be a convolutional neural network model or a recurrent convolutional neural network model. In some embodiments, the neural network model can also be other types of machine models.

[0028] In one embodiment, Figure 2 is a schematic flowchart of another script command generation method provided by an embodiment of the present invention. As Figure 2 shown, steps S201 to S204 are further included before step S101.

[0029] Step S201: Obtain a plurality of script command example data. The script command example data includes a script task and a script command. The script command includes a command body, command parameters, and parameter values.

[0030] The script command example data is historical data of executed script commands. The script command example data includes a script task and a script command. The script command includes a command body, command parameters, and parameter values.

[0031] Exemplarily, the script task included in the script command example data 1 is "check the coupling status of the newly opened base station in Industrial Park C, District B, City A". The script command includes a command body, command parameters, and parameter values. The command body is "remquery-batch-mostatus", which is used to represent a batch query operation on network elements. The command parameters include moc, location, time, and action. It should be noted that each command parameter includes an attribute, and the attribute includes a required attribute and an optional attribute. The required attribute refers to an instruction that must be filled in the script command, and the optional instruction is a parameter that does not need to be filled in when the script command is executed again. The parameter values include moc-SCTP (indicating the coupling status), location - Industrial Park C, District B, City A, time - null (empty), and action - query coupling.

[0032] Exemplarily, the script task included in the script command sample data 1 is "query all current severe alarms of network element 2 in subnet 1 between 8 PM yesterday and 12 PM today in C Industrial Park, B District, A City". The script command includes a command body, command parameters, and parameter values. Among them, the command body is "fm query - history - alarm", and this command body is used to represent alarm query; the command parameters include alarm, location, time, and action; the parameter values include alarm - severity (indicating severe alarm), location - C Industrial Park, B District, A City, time - between 8 PM yesterday and 12 PM today, action - query alarm.

[0033] Step S202: Generate a set of parameter values corresponding to the script commands of each command body type according to the parameter parsing results of each script command.

[0034] Among them, this set of parameter values is a set of parameter values corresponding to each command parameter.

[0035] In one embodiment, Figure 3 is Figure 2 a schematic diagram of the sub - step process of step S202 in Figure 3 as shown. Step S202 includes sub - steps S2021 to S2022.

[0036] Sub - step S2021: Cluster the script commands of the same command body type according to the command body type in the parameter parsing results of each script command to obtain multiple script command sets.

[0037] Parse each script command sample data to generate the script task and script command of each script command sample data. The script command includes a command body, command parameters, and parameter values. Cluster the script commands of the same command body type according to the command body type in the parameter parsing results of each script command parameter to obtain multiple script command sets. Clustering the script commands by the command body type of the script command can improve the efficiency and accuracy of augmenting the script command sample data.

[0038] It should be noted that this command body type can be set according to the actual situation, and the embodiments of the present invention do not make specific limitations on this. For example, the command body type can be types such as alarm query, status query, and execution detection.

[0039] Exemplarily, the script command sample data includes script command sample data 1, script command sample data 2, script command sample data 3, script command sample data 4, and script command sample data 5. Among them, the command body type of script command sample data 1 is alarm query, the command body type of script command sample data 2 is execution detection, the command body type of script command sample data 3 is alarm detection, the command body type of script command sample data 4 is status query, and the command body type of script command sample data 5 is execution detection. Cluster script command sample data 1 and script command sample data 3 into the first script command set, cluster script command sample data 2 and script command sample data 5 into the second script command set, and cluster script command sample data 3 into the third script command set.

[0040] Sub-step S2022: Aggregate each parameter value corresponding to the command parameters of the script commands in each of the script command sets to generate a parameter value set corresponding to the script commands of each command body type.

[0041] Obtain all parameter values corresponding to the command parameters of the script commands of the target command body type, where the target command body type is any command body type; place all parameter values corresponding to the command parameters of the script commands of the target command body type in a clustering set to obtain a parameter value set corresponding to the script commands of the target command body type. By placing all parameter values corresponding to the command parameters in a clustering set, the parameter value sets corresponding to the command parameters of each script command can be accurately obtained, greatly improving the construction efficiency and accuracy of the training sample set.

[0042] Exemplarily, the script parameters in the first script command set for alarm query include a location parameter value set, a moc parameter value set, a time parameter value set, and an action parameter value set. Among them, the location parameter value set includes Zhangjiang Subway Station, A Industrial Park, B Furong Garden, and People's Square, etc.; the moc parameter value set includes single board, base station, network element, and cell, etc.; the time parameter value set includes from October 5, 2023 to October 6, 2023, etc.; and the action parameter value set includes query alarm, etc.

[0043] Step S203: Augment the multiple script command sample data according to the parameter value sets corresponding to the script commands of each command body type to obtain a training sample set, where the training samples in the training sample set include script tasks and script commands.

[0044] Among them, the training sample set includes enough training samples to converge a preset neural network model. By augmenting multiple script command example data, richer training samples are obtained, thereby improving the efficiency and accuracy of neural network model training.

[0045] In one embodiment, Figure 4 For Figure 2 the schematic diagram of the sub-step process of step S203 in Figure 4 is shown as

[0046] Sub-step S2031: Construct a prompt message for the target script command example data according to the parameter value set corresponding to the script command of each command body type, and generate the prompt message of the target script command example data. The target script command example data is any script command example data.

[0047] Among them, the prompt message is used to make the training samples generated by augmentation more accurate. The target script command example data is any script command example data.

[0048] In one embodiment, obtain the role type, script command description information, and script task limitation information of the script command of the target script command example data, and obtain multiple parameter values corresponding to each command parameter from the parameter value set; according to the parameter value set, role type, script command description information, and script task limitation information corresponding to the script command of each command body type, generate the prompt message of the target script command example data. Through the parameter values corresponding to each command parameter, role type, script command description information, and script task limitation information, the prompt message of the script command example data can be accurately generated, greatly improving the accuracy of the training samples.

[0049] It should be noted that the role type, script command description information, and script task limitation information can be set according to the actual situation, and the embodiments of the present invention do not make specific limitations on this. For example, the role type can be a natural language analysis expert, a script command expert in the field of telecommunications network management, a natural language processing expert in telecommunications network management, etc. The script command description information can be "According to the provided optional parameter values, supplement the context information to generate a complete and smooth sentence". The script task limitation information is to limit the output content, and the limitation content includes but is not limited to output format, output text length, output content constraints, etc.

[0050] In one embodiment, the method for generating the prompt information of the target script command example data based on the parameter value set, role type, script command description information, and script task limitation information corresponding to the script commands of each command subject type may be as follows: combining the prompt information according to the parameter value set corresponding to the script commands of each command subject type, and at least one of the role type, script command description information, and script task limitation information to generate the prompt information of the target script command example data. By combining the prompt information through the parameter values corresponding to multiple command parameters and at least one of the role type, script command description information, and script task limitation information, multiple pieces of prompt information of the target script command example data can be obtained, greatly enriching the diversity of training samples.

[0051] Exemplarily, the parameter values corresponding to the command parameters of the script command with the command subject type of querying alarms include alarm-severity, location-A Industrial Park, B District, City A, time-8 pm last night to 12 noon today, action-query alarms; the role type is an expert in script commands in the field of telecom network management, the script command description information is to supplement context information based on the provided parameter optional values to generate a complete and smooth sentence, and the script task limitation information is that the output text length is 100 words. Based on the parameter values corresponding to the command parameters including alarm-severity, location-A Industrial Park, B District, City A, time-8 pm last night to 12 noon today, action-query alarms; the role type is an expert in script commands in the field of telecom network management, the script command description information is to supplement context information based on the provided parameter optional values to generate a complete and smooth sentence, and the script task limitation information is that the output text length is 100 words, the prompt information of this script command is generated.

[0052] Sub-step S2032: Augment the sample data according to the prompt information of the target script command example data and the target script command example data to generate a training sample subset, where the training sample subset is a subset of the training sample set.

[0053] Among them, the training sample subset includes all the sample script command example data corresponding to the target script command example data. By augmenting the sample data of the target script command example data through the prompt information of the target script command example data, the training sample subset corresponding to the target script command example data can be accurately obtained.

[0054] In one embodiment, the preset sample construction model reconstructs the training sample data for the target script command example data according to the prompt information and the parameter value set to obtain multiple training samples; combines the multiple training samples corresponding to the target script command example data to generate a training sample subset. The preset sample construction model is a pre-trained machine model, and the machine model can be selected according to the actual situation, which is not specifically limited in the embodiments of the present invention. For example, the continuous model is a neural network model. By reconstructing the training sample data for the prompt information, the parameter value set, and the target script command example data through the preset sample construction model, multiple training samples can be accurately obtained, greatly improving the efficiency and accuracy of training sample construction.

[0055] In one embodiment, the method for reconstructing the training sample data for the target script command example data according to the prompt information and the parameter value set by the preset sample construction model to obtain multiple training samples may be: selecting a set of parameter values from the parameter value set as the target parameter values; inputting the target parameter values, the prompt information, and the script command in the target script command example data into the preset sample construction model to generate a target script task; replacing the parameter value of the script command in the target script command example data with the target parameter values to obtain a target script command, and using the data composed of the target script command and the target script task as a training sample. By reconstructing the data for the prompt information, the parameter value set, and the target script command example data through the preset sample construction model, multiple training samples can be accurately obtained, greatly improving the richness of the training samples.

[0056] It should be noted that the preset sample construction model is trained based on the prompt information, the parameter value set, and the script command example data. The training process of the script command example data can refer to the training process of the script command generation model in the text of the present invention, which will not be elaborated here.

[0057] Step S204: Train the preset neural network model according to the training sample set until the neural network model converges to obtain a script command generation model.

[0058] In one embodiment, Figure 5 For Figure 2 the sub-step process schematic diagram of step S204 in Figure 5 is shown as

[0059] Sub-step S2041: Select target sample data from the training sample set, and the target sample data is any sample data in the training sample set.

[0060] The target sample data includes a script task and a script command.

[0061] In one embodiment, a sample data is randomly selected from the training sample set as the target sample data, and selecting the target sample data can improve the efficiency and accuracy of the training script command generation model.

[0062] Sub-step S2042: Input the script task in the target sample data into a preset neural network model to generate a script command, and obtain a predicted script command.

[0063] Inputting the script task in the target sample data into a preset neural network model to generate a script command can accurately obtain the predicted script command, and this script command includes a command body, command parameters, and parameter values.

[0064] Sub-step S2043: Determine whether the preset neural network model converges according to the predicted script command and the script command in the target sample data.

[0065] In one embodiment, according to the predicted script command and the script command in the target sample data, the loss value of the model is determined. When the loss value is greater than or equal to the preset loss value, it is determined that the preset neural network model has not converged; when the loss value is less than the preset loss value, it is determined that the preset neural network model has converged. Among them, the preset loss value can be set according to the actual situation, and the embodiments of the present invention do not make specific limitations in this regard. For example, the preset loss value can be set to 0.02. By determining the loss value of the model, it can be accurately known whether the model converges, greatly improving the efficiency and accuracy of the training script command generation model.

[0066] In one embodiment, the method for determining the loss value of the model according to the predicted script command and the script command in the target sample data can be: calculating the cosine similarity between the predicted script command and the script command in the target sample data to obtain a similarity value, and subtracting the similarity value from the unit 1 to obtain a value determined as the loss value of the model. By calculating the cosine similarity between the predicted script command and the script command in the target sample data, it can be accurately known whether the model converges, greatly improving the efficiency and accuracy of the training script command generation model.

[0067] Sub-step S2044: When the preset neural network model has not converged, update the model parameters of the preset neural network model, and continue to execute the step of selecting the target sample data from the training sample set until the preset neural network model converges to obtain a script command generation model.

[0068] In the case where the preset neural network model does not converge, update the model parameters of the preset neural network model, and select target sample data from the training sample set; input the script task in the target sample data into the preset neural network model to generate a predicted script command; determine whether the preset neural network model converges according to the predicted script command and the script command in the target sample data; in the case where the loss value is less than the preset loss value, determine that the preset neural network model has converged; obtain a script command generation model. By cyclically updating the model parameters and performing model training, the script command generation model can be accurately obtained.

[0069] Step S102, generate a target script command based on the script task and the script command generation model to obtain the target script command, where the target script command includes a command body, command parameters, and parameter values.

[0070] After obtaining the script command generation model, input the script task into the script command generation model to generate a sample, and obtain a target script command, where the target script command includes a command body, command parameters, and parameter values. By using the script command generation model to generate a script command for the script task, the target script command can be accurately obtained, greatly improving the efficiency and accuracy of script command generation.

[0071] In the script command generation method in the above embodiment, obtain the script task and the script command generation model for generating the script command to be generated, where the script command generation model is obtained by training a preset neural network model based on a training sample set, and the training sample set is generated by augmenting multiple script command example data; generate a target script command based on the script task and the script command generation model to obtain the target script command, where the target script command includes a command body, command parameters, and parameter values. In this solution, by augmenting multiple script command example data, a sufficient number of training samples can be obtained, and by training the neural network model using the training sample set, the script command generation model can be accurately obtained. By inputting the script task into the pre-trained script command generation model to generate the target script command, the efficiency and accuracy of script command generation are greatly improved.

[0072] Please refer to Figure 6 , Figure 6 which is a schematic block diagram of a script command generation device provided by an embodiment of the present application.

[0073] As Figure 6 shown, the script command generation device 300 includes an acquisition module 310 and a generation module 320, where:

[0074] The obtaining module 310 is configured to obtain a script task for which a script command is to be generated and a script command generation model, where the script command generation model is obtained by training a preset neural network model based on a training sample set, and the training sample set is generated by augmenting a plurality of script command example data;

[0075] The generating module 320 is configured to generate a target script command based on the script task and the script command generation model, and obtain the target script command, where the target script command includes a command body, command parameters, and parameter values.

[0076] In one embodiment, as Figure 7 shown Figure 7 FIG. is a schematic block diagram of a script command generation device provided by an embodiment of the present application. The script command generation device 400 includes an obtaining module 410, a generating module 420, an augmenting module 430, and a training module 440, where:

[0077] The obtaining module 410 is configured to obtain a plurality of script command example data, where the script command example data includes a script task and a script command, and the script command includes a command body, command parameters, and parameter values;

[0078] The generating module 420 is configured to generate a set of parameter values corresponding to the script commands of each command body type according to the parameter parsing results of each script command;

[0079] The augmenting module 430 is configured to augment the plurality of script command example data according to the set of parameter values corresponding to the script commands of each command body type to obtain a training sample set, where the training samples in the training sample set include a script task and a script command;

[0080] The training module 440 is configured to train a preset neural network model according to the training sample set until the neural network model converges, and obtain a script command generation model.

[0081] In one embodiment, the generating module 420 is further configured to:

[0082] Cluster the script commands of the same command body type according to the command body type in the parameter parsing results of each script command to obtain a plurality of script command sets;

[0083] Aggregate the parameter values corresponding to the command parameters of the script commands in each script command set respectively to generate a set of parameter values corresponding to the script commands of each command body type.

[0084] In one embodiment, the generating module 420 is further configured to:

[0085] Obtain all parameter values corresponding to the command parameters of the script command of the target command body type, where the target command body type is any command body type;

[0086] Place all parameter values corresponding to the command parameters of the script command of the target command body type in a clustering set to obtain the parameter value set corresponding to the script command of the target command body type.

[0087] In one embodiment, the augmentation module 430 is further configured to:

[0088] Construct a prompt message for the target script command sample data according to the parameter value sets corresponding to the script commands of each command body type, and generate the prompt message of the target script command sample data, where the target script command sample data is any script command sample data;

[0089] Augment the sample data according to the prompt message of the target script command sample data and the target script command sample data to generate a training sample subset, where the training sample subset is a subset of the training sample set.

[0090] In one embodiment, the augmentation module 430 is further configured to:

[0091] Obtain the role type, script command description information, and script task limitation information of the script command of the target script command sample data, and obtain multiple parameter values corresponding to each command parameter from the parameter value set;

[0092] Generate the prompt message of the target script command sample data according to the parameter value sets, role type, script command description information, and script task limitation information corresponding to the script commands of each command body type.

[0093] In one embodiment, the augmentation module 430 is further configured to:

[0094] Reconstruct the training sample data of the target script command sample data according to the prompt message and the parameter value set through a preset sample construction model to obtain multiple training samples;

[0095] Combine the multiple training samples corresponding to the target script command sample data to generate a training sample subset.

[0096] In one embodiment, the training module 440 is further configured to:

[0097] Select target sample data from the training sample set, where the target sample data is any sample data in the training sample set;

[0098] Input the script task in the target sample data into a preset neural network model to generate a predicted script command.

[0099] Determine whether the preset neural network model converges according to the predicted script command and the script command in the target sample data.

[0100] In the case where the preset neural network model does not converge, update the model parameters of the preset neural network model, and continue to execute the step of selecting target sample data from the training sample set until the preset neural network model converges to obtain a script command generation model.

[0101] It should be noted that those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working process of the above script command generation device can refer to the corresponding process in the foregoing embodiment of the script command generation method, which will not be elaborated here.

[0102] Please refer to Figure 8 , Figure 8 which is a schematic block diagram of the structure of a terminal device provided by an embodiment of the present invention.

[0103] As Figure 8 shown, the terminal device 500 includes a processor 501 and a memory 502. The processor 501 and the memory 502 are connected through a bus 503, and this bus is, for example, an I2C (Inter - integrated Circuit) bus.

[0104] Specifically, the processor 501 is used to provide computing and control capabilities to support the operation of the entire terminal device. The processor 501 can be a central processing unit (CPU), and this processor 501 can also be other general - purpose processors, digital signal processors (DSPs), application - specific integrated circuits (ASICs), field - programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general - purpose processor can be a microprocessor or this processor can also be any conventional processor, etc.

[0105] Specifically, the memory 502 can be a Flash chip, read - only memory (ROM), magnetic disk, optical disc, USB flash drive, or mobile hard disk, etc.

[0106] Those skilled in the art can understand that Figure 8 The structure shown in Figure 8 is only a block diagram of some structures related to the solution of the present invention, and does not constitute a limitation on the terminal device to which the solution of the present invention is applied. The specific terminal device may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.

[0107] The processor is used to run a computer program stored in the memory, and when executing the computer program, implement any one of the script command generation methods provided by the embodiments of the present invention.

[0108] In an embodiment, the processor 501 is used to run a computer program stored in the memory, and when executing the computer program, implement the following steps:

[0109] Obtain a script task and a script command generation model for which a script command is to be generated, where the script command generation model is obtained by training a preset neural network model based on a training sample set, and the training sample set is generated by augmenting a plurality of script command example data;

[0110] Generate a target script command based on the script task and the script command generation model to obtain a target script command, where the target script command includes a command body, command parameters, and parameter values.

[0111] In an embodiment, before the processor 501 implements obtaining the script task and the script command generation model for which a script command is to be generated, it is further used to implement:

[0112] Obtain a plurality of script command example data, where the script command example data includes a script task and a script command, and the script command includes a command body, command parameters, and parameter values;

[0113] Generate a set of parameter values corresponding to the script commands of each command body type according to the parameter parsing results of each script command;

[0114] Augment the plurality of script command example data according to the set of parameter values corresponding to the script commands of each command body type to obtain a training sample set, where the training samples in the training sample set include a script task and a script command;

[0115] Train a preset neural network model according to the training sample set until the neural network model converges to obtain a script command generation model.

[0116] In an embodiment, when the processor 501 implements generating a set of parameter values corresponding to the script commands of each command body type according to the parameter parsing results of each script command, it is used to implement:

[0117] Cluster the script commands of the same command body type according to the command body type in the parameter parsing result of each said script command, to obtain a plurality of script command sets;

[0118] Aggregate the respective parameter values corresponding to the command parameters of the script commands in each said script command set respectively, to generate a parameter value set corresponding to the script commands of each command body type.

[0119] In one embodiment, when the processor 501 implements the aggregating the respective parameter values corresponding to the command parameters of the script commands in each said script command set respectively, to generate a parameter value set corresponding to the script commands of each command body type, it is used to implement:

[0120] Obtain all the parameter values corresponding to the command parameters of the script commands of the target command body type, wherein the target command body type is any command body type;

[0121] Place all the parameter values corresponding to the command parameters of the script commands of the target command body type in a clustering set, to obtain the parameter value set corresponding to the script commands of the target command body type.

[0122] In one embodiment, when the processor 501 implements augmenting a plurality of said script command sample data according to the parameter value sets corresponding to the script commands of each command body type, to obtain a training sample set, it is used to implement:

[0123] Construct a prompt message for the target script command sample data according to the parameter value sets corresponding to the script commands of each said command body type, to generate the prompt message of the target script command sample data, and the target script command sample data is any script command sample data;

[0124] Augment the sample data according to the prompt message of the target script command sample data and the target script command sample data, to generate a training sample subset, and the training sample subset is a subset of the training sample set.

[0125] In one embodiment, when the processor 501 implements constructing a prompt message for the target script command sample data according to the parameter value sets corresponding to the script commands of each said command body type, to generate the prompt message of the target script command sample data, it is used to implement:

[0126] Obtain the role type, the script command description information, and the script task limitation information of the script command of the target script command sample data, and obtain a plurality of parameter values corresponding to each command parameter from the parameter value set;

[0127] Generate the prompt information of the target script command sample data according to the parameter value set, role type, script command description information, and script task limitation information corresponding to the script commands of each of the command subject types.

[0128] In one embodiment, when the processor 501 implements augmenting the sample data according to the prompt information of the target script command sample data and the target script command sample data to generate a training sample subset, where the training sample subset is a subset of the training sample set, it is used to implement:

[0129] Reconstruct the training sample data for the target script command sample data according to the prompt information and the parameter value set through a preset sample construction model to obtain multiple training samples;

[0130] Combine the multiple training samples corresponding to the target script command sample data to generate a training sample subset.

[0131] In one embodiment, when the processor 501 implements training a preset neural network model according to the training sample set until the neural network model converges to obtain a script command generation model, it is used to implement:

[0132] Select target sample data from the training sample set, where the target sample data is any sample data in the training sample set;

[0133] Input the script task in the target sample data into the preset neural network model to generate a predicted script command;

[0134] Determine whether the preset neural network model converges according to the predicted script command and the script command in the target sample data;

[0135] In the case where the preset neural network model does not converge, update the model parameters of the preset neural network model, and continue to execute the step of selecting target sample data from the training sample set until the preset neural network model converges to obtain a script command generation model.

[0136] It should be noted that those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working process of the above-described terminal device can refer to the corresponding process in the embodiment of the foregoing script command generation method, and will not be elaborated herein.

[0137] The embodiment of the present invention also provides a storage medium for computer-readable storage. The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any script command generation method provided in the specification of the present invention.

[0138] Among them, the storage medium may be an internal storage unit of the terminal device described in the foregoing embodiments, such as the hard disk or memory of the terminal device. The storage medium may also be an external storage device of the terminal device, such as a plug-in hard disk equipped on the terminal device, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc.

[0139] Those of ordinary skill in the art can understand that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, and their appropriate combinations. In the hardware implementation, the division between the functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be executed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or transitory medium). As is well known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassette, tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, as is well known to those of ordinary skill in the art, a communication medium typically includes computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery medium.

[0140] It should be understood that the term "and / or" used in the specification of the present invention refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations. It should be noted that in this article, the terms "comprising", "including" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such a process, method, article or system. Without further limitation, an element defined by the statement "comprising an..." does not exclude the existence of another identical element in the process, method, article or system comprising that element.

[0141] The serial numbers of the above embodiments of the present invention are only for description and do not represent the superiority or inferiority of the embodiments. The above is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should all be covered within the protection scope of the present invention.

Claims

1. A method for generating script commands, characterized in that, it includes: obtaining a script task for which a script command is to be generated and a script command generation model, wherein the script command generation model is obtained by training a preset neural network model based on a training sample set, and the training sample set is generated by augmenting a plurality of script command example data; generating a target script command based on the script task and the script command generation model, where the target script command includes a command body, command parameters, and parameter values.

2. The script command generation method according to claim 1, characterized in that, before obtaining the script task for which a script command is to be generated and the script command generation model, it further includes: obtaining a plurality of script command example data, where the script command example data includes a script task and a script command, and the script command includes a command body, command parameters, and parameter values; generating a set of parameter values corresponding to the script commands of each command body type according to the parameter parsing results of each script command; augmenting the plurality of script command example data according to the set of parameter values corresponding to the script commands of each command body type to obtain a training sample set, where the training samples in the training sample set include a script task and a script command; training a preset neural network model according to the training sample set until the neural network model converges to obtain a script command generation model.

3. The script command generation method according to claim 2, characterized in that, the generating a set of parameter values corresponding to the script commands of each command body type according to the parameter parsing results of each script command includes: clustering the script commands of the same command body type according to the command body type in the parameter parsing results of each script command to obtain a plurality of script command sets; respectively aggregating the parameter values corresponding to the command parameters of the script commands in each script command set to generate a set of parameter values corresponding to the script commands of each command body type.

4. The script command generation method according to claim 3, characterized in that, the respectively aggregating the parameter values corresponding to the command parameters of the script commands in each script command set to generate a set of parameter values corresponding to the script commands of each command body type includes: obtaining all the parameter values corresponding to the command parameters of the script commands of the target command body type, where the target command body type is any command body type; placing all the parameter values corresponding to the command parameters of the script commands of the target command body type in a clustering set to obtain a set of parameter values corresponding to the script commands of the target command body type.

5. The script command generation method according to claim 2, characterized in that, the augmenting the plurality of script command example data according to the set of parameter values corresponding to the script commands of each command body type to obtain a training sample set includes: Construct prompt information for the target script command example data according to the parameter value sets corresponding to the script commands of each command subject type, and generate the prompt information for the target script command example data, where the target script command example data is any script command example data; Augment the sample data according to the prompt information of the target script command example data and the target script command example data to generate a training sample subset, where the training sample subset is a subset of the training sample set.

6. The script command generation method according to claim 5, characterized in that, The constructing of the prompt information for the target script command example data according to the parameter value sets corresponding to the script commands of each command subject type and generating the prompt information for the target script command example data includes: Obtain the role type, script command description information, and script task limitation information of the script command of the target script command example data, and obtain the parameter values corresponding to multiple command parameters from the parameter value sets; Generate the prompt information for the target script command example data according to the parameter value sets, role type, script command description information, and script task limitation information corresponding to the script commands of each command subject type.

7. The script command generation method according to claim 5, characterized in that, The augmenting of the sample data according to the prompt information of the target script command example data and the target script command example data to generate a training sample subset, where the training sample subset is a subset of the training sample set, includes: Reconstruct the training sample data for the target script command example data according to the prompt information and the parameter value sets through a preset sample construction model to obtain multiple training samples; Combine the multiple training samples corresponding to the target script command example data to generate a training sample subset.

8. The script command generation method according to claim 2, characterized in that, The training of the preset neural network model according to the training sample set until the neural network model converges to obtain a script command generation model includes: Select target sample data from the training sample set, where the target sample data is any sample data in the training sample set; Input the script task in the target sample data into the preset neural network model to generate a predicted script command; Determine whether the preset neural network model converges according to the predicted script command and the script command in the target sample data; In the case that the preset neural network model does not converge, update the model parameters of the preset neural network model and continue to execute the step of selecting target sample data from the training sample set until the preset neural network model converges to obtain a script command generation model.

9. A terminal device, characterized in that, The terminal device includes a processor, a memory, a computer program stored on the memory and executable by the processor, and a data bus for implementing connection communication between the processor and the memory. When the computer program is executed by the processor, the steps of the script command generation method according to any one of claims 1 to 8 are implemented.

10. A storage medium for computer-readable storage, characterized in that the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the script command generation method according to any one of claims 1 to 8.