Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements that are expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a training method for generating a large model by using a script link, which is provided in an embodiment of the present invention, where the method may be performed by a training device for generating a large model by using a script link, the training device for generating a large model by using a script link may be implemented in a form of hardware and/or software, and the training device for generating a large model by using a script link may be configured in an electronic device. As shown in fig. 1, the method includes:
S101, obtaining structure information of at least one action script, wherein the structure information of the action script comprises an execution action, a precondition and adjacent script relation information, and the adjacent script relation information is used for indicating the next action script executable after the execution of the action script.
In this embodiment, the action script may be understood as a script simulating an operation action of the user, for example, an action simulating an APP that the user clicks on an application program in the main interface. The execution action can be clicking, sliding, inputting and other operations, the pre-condition can be understood as a condition required to be met by the action execution, for example, the clicking operation can be executed on a main interface currently, the adjacent script relation information can be understood as information describing other action scripts adjacent to the action script, the adjacent script relation information is used for indicating the next action script executable after the action script is executed, the adjacent script relation information can comprise one or more action scripts, the number of the next action scripts executable after the action script is executed can be 0,1 or more, 0 indicates that the next action script which is not executable after the action script is executed, 1 indicates that the next action script executable after the action script is executed is only 1, and the number of the next action scripts executable after the action script is executed is a plurality, and can be selected from the action scripts to be executed.
The method provided by the embodiment of the application is applied to the vehicle-mounted system, so that different application programs can be installed on the vehicle-mounted system, and a user can operate the different application programs through the different actions, for example, clicking the interface of the application program, inputting information in different windows and the like. By analyzing different actions of a user, determining pre-conditions for executing the actions, information such as the next action after the actions are executed, generating structural information of an action script, and storing the structural information of the action script into a corresponding storage space, such as a database. The embodiment of the application can be triggered by user operation or set training conditions, automatically trigger model training when the training conditions are met, and the like.
Each action script has unique identification information to distinguish between different action scripts, e.g., each action script is numbered 1-N, distinguishing between different action scripts.
S102, generating at least one first prompt text according to the structure information of each action script.
In this embodiment, the first prompt text may be understood as text for prompting a large language model, for example, prompt. And writing the structural information of each action script into the prompt text, and generating at least one first prompt text according to the sample generated by the action script providing model.
S103, inputting each first prompt text into the large language model for training, and obtaining a script link generation large model which is used for generating the script link.
In this embodiment, the script link generation large model may be understood as a large model for generating a script link, where the script link includes different action scripts, and according to the script link, an action script to be executed and an execution sequence of the action scripts may be determined.
And sequentially inputting each first prompt text into the large language model to guide the large language model to train. In the training process, the large language model learns the meaning of the data contained in the action script, learns the execution sequence of each action script according to the adjacent script relation information, and obtains a script link to generate the large model. The trained script link generation large model can be used for generating a script link, for example, a prompt text is input into the script link generation large model, and the script link generation large model performs reasoning according to the knowledge learned in the training process to generate the script link. The generated script links can be composed of different action scripts, the action scripts are sequentially ordered according to the execution sequence, and the action scripts in the script links are sequentially executed to complete corresponding operations. For example, the script link includes identifiers of different action scripts, execution processes of the different action scripts are written into executable codes in advance and stored in an execution script library, and after the script link is generated, the action scripts are acquired from the execution script library according to the identifiers and executed. According to the method provided by the embodiment of the application, the script is disassembled into the independent action script, the execution steps of each function do not need to be exhausted, a large number of similar or repeated scripts do not appear, the development time can be effectively saved, the development efficiency is improved, the problems of lower system development intellectualization and low development efficiency are solved, and the whole development process is more intelligent.
The embodiment of the application can be applied to the visible and speaking function in the vehicle-mounted voice, and takes the process of automatically helping a vehicle owner to search a film in the application program A by using a vehicle-mounted voice assistant as an example, so as to explain the realization principle of the prior art. The vehicle-mounted voice assistant simulates user operation, and automatically opens an application program A to help a vehicle owner search for a movie to be watched. The software helps the user to complete a relatively long action link of searching and playing a specified movie from the mobile phone main page to the application program A, and the steps of simulating manual operation of the user are required to be written, namely, 1, entering the application program from the mobile phone main page, 2, clicking a search interface, 3, then inputting a power source name, and 4, finally clicking and playing. Each operation can be described by an action script which can be understood by a machine, and the scripts have a front-back fixed execution relationship, and the four actions and the serial relationship form a movie script sequence of the playing application program A. By way of example, FIG. 2 provides an exemplary diagram of a script sequence, which requires 4 jobs as shown to enter the script of application A for playing a movie from the home page.
Similarly, the process of continuing to play the last movie which is not seen in the history from the main page of the mobile phone to the Aiqi art is to write a machine execution script sequence, wherein the script sequence is that the first action is that the main page enters the Aiqi art, the second action is that the history entry is clicked, and the third action is that the last history power supply is clicked to play. If the voice assistant is to support the two functions, two script sequences corresponding to the two functions need to be saved. By way of example, FIG. 3 provides an exemplary diagram of another script sequence, where a script to enter an Aiqi play historian from a home page would need to include 3 actions as shown.
Comparing the script sequences of the two functions, it can be known that the first function and the second function need to enter the love art from the homepage in the first step, and the stored two action script sequences have one action script 'from the main page to the love art' with the same function, so that the script contents need to be repeatedly written in the development process. In the traditional scheme, a large amount of similar or repeated content exists in each script, and development manpower and storage resources are wasted greatly. According to the embodiment of the application, each action is disassembled into an independent script, and a script link generation large model is obtained through model training, so that the script link can be generated by the script link generation large model, and the script link comprises a plurality of action script permutation and combination sequence relations.
The embodiment of the application provides a training method for generating a large model by a script link, which effectively improves the degree of intellectualization of system development, splits a complete flow script for operation execution into independent action scripts, wherein the action scripts comprise execution actions, pre-conditions and adjacent script relation information, the adjacent script relation information is used for indicating the next action script which can be executed after the action scripts are executed, at least one first prompt text is generated according to each action script, the large language model learns the meaning of data contained in the action scripts by the first prompt text, and learns the execution sequence of each action script according to the adjacent script relation information, so that the large model is generated by the script link, the script link is used for generating the script link, the execution sequence of different scripts is determined by the script link, the complete writing of the complete flow script is not needed, the workload is small, the script link is generated by the script link, the degree of intellectualization of system development can be effectively improved, the scripts do not need to be developed one by one, the execution steps of each function do not need to be carried out, the script can not be completely decomposed into the independent action scripts, the similar to be completely developed, the human resources can be saved, the development time can be effectively saved, the like can be saved, and the development time can be saved, and the system can be more conveniently and the development time is more convenient.
Example two
Fig. 4 is a flowchart of a training method for generating a large model by using a script link according to a second embodiment of the present invention, where the present embodiment is refined based on the foregoing embodiment. As shown in fig. 4, the method includes:
s201, acquiring and analyzing historical user operation information, and determining all execution actions.
In this embodiment, the history user operation information may be understood as information formed by different operations performed by the user, for example, the user clicks an operation interface of an application program, the user inputs information in a search box, and the like, and execution time of the different operations, and the like. Taking a car machine system as an example, different types of application programs can be installed on the car machine system, a user can operate on the car machine system, for example, different application programs can be opened in a clicking mode and the like, and control of different functions of the application programs can be achieved through clicking, sliding, inputting and the like in the application programs. When the model is trained, historical user operation information is acquired and analyzed, actions executed by the user, pre-conditions met when the actions are executed, next executed actions adjacent to the executed actions and the like are determined, and all the actions executed by the user are determined through analysis of the historical user operation information. And (3) carrying out script writing on each execution action, or acquiring a pre-written script, and determining script information for executing the action. The execution actions in the embodiments of the present application include specific actions, and may also include script information for executing the actions.
S202, determining at least one pre-condition corresponding to each execution action, and generating corresponding initial action script information according to the execution action and each pre-condition corresponding to the execution action, wherein the initial action script information comprises the execution action and the pre-condition.
In this embodiment, the initial action script information may be understood as script structure information that is initially determined, where the initial action script information does not include all the structure information of the action script, and includes the execution action and the preconditions. For each execution action, a precondition for the execution action is determined, and the precondition for the execution action may be one or more, i.e., each execution action may be executed in a different situation. Generating initial action script information by the execution action and a corresponding precondition, wherein the initial action script information comprises the execution action and the precondition, and when the number of the preconditions is a plurality, the corresponding initial action script information is respectively generated according to the execution action and each precondition.
S203, determining the next execution action according to the execution action and the pre-condition included in the initial action script information for each initial action script information, and generating adjacent script relation information according to the next execution action, and writing the adjacent script relation information into the initial action script information to form the structure information of the action script.
For each initial action script information, determining the next execution action executed after the execution of the execution action is completed according to the execution action and the pre-condition included in the initial action script information, wherein the number of the next execution actions can be one or more, generating adjacent script relation information according to the next execution action, and writing the adjacent script relation information into the initial action script information to form the structure information of the action script.
According to the embodiment of the application, one or the pre-conditions corresponding to each execution action and the next execution action executed under the pre-conditions can be determined by analyzing different execution actions and analyzing different pre-conditions and the like corresponding to the same execution action, so that the structural information of the corresponding action script is generated. The next executable action script is described by the structural information of the action script, the execution action, the preconditions of the execution. The embodiment of the application can determine the structure information of different action scripts through the method.
After the structural information of the action script is generated, a manual review may be performed to check whether the structural information of the generated action script is correct.
The embodiment of the application can develop and write the original independent script unit for the system to be controlled, the independent script is enough to cover all user operable page controls or objects, all the user can manually operate the actions in all the interfaces of all the applications, and each independent action is written with an action script for description.
Optionally, the adjacent script relation information comprises an array, the length of the array is the total number of the action scripts, and each bit element in the array is used for indicating whether the action script corresponding to the element can be executed after the current action script is executed.
The adjacent script relation information comprises an array, whether each action script can be executed or not is represented by the array, wherein the length of the array is the total number of the action scripts, each bit element in the array corresponds to one action script, and the elements can be associated with different action scripts through positions. Each bit element in the array is used for indicating whether the action script corresponding to the element can be executed after the current action script is executed.
For example, all the action scripts are numbered from 1 to N, the length of the array is the number N of the action scripts, the ith bit element in the array is 0 to indicate that the ith script cannot be directly executed after the current action script is executed, and the ith bit element in the array is 1 to indicate that the ith script can be executed immediately after the current action script is executed. The adjacent script relationship information may be a pointer chained relationship indicating a next executable script pointer. FIG. 5 provides an exemplary diagram of structural information of an Action script, wherein an Action click (X, Y) may represent the execution as a click operation at the (X, Y) coordinate in the screen, and adjacent script relationship information is represented by an array, i.e., an adjacent script relationship array in the diagram, wherein a first bit of 0 in the array indicates that the first Action script is not executable after the execution of the Action script is completed. Fig. 6 provides an example diagram of an action script library, in which different action scripts are stored, each action script has a unique corresponding identification, for example, identifying different action scripts by the numbers of 1, 2. Each step that the user can manually operate can be represented by a script unit and stored in an action script library, as shown in fig. 6, each click, slide and input operation on each interface is represented by an action script, and the actual operation is combined to determine that each script and other scripts can execute the contact relationship successively.
S204, generating at least one first prompt text according to the structure information of each action script.
S205, inputting each first prompt text into the large language model for training, and obtaining a script link generation large model which is used for generating the script link.
Optionally, the first prompt text comprises structural information of each action script, script link generation samples and operation requirement information.
In this embodiment, the script link generation sample can be understood as a sample indicating how the script link is generated, for example, the script link generation sample includes a precondition, a target end point, and a script link formed by "script 1-script 16-script 8-script 4", through which an operation from a start point to an end point can be completed, the precondition is used to determine the start point of the script, and the target end point is used to determine the end point of the script. The operation demand information is information required for simulating the operation of the user, for example, a precondition that can determine the start point of the operation and end point information of the operation.
In the training process of the large language model, the meaning of the single action script data structure and the adjacent script relation information is learned and understood according to each action script, and the adjacent script relation is found according to all independent action scripts by utilizing the large model reasoning capability. And learning how to generate the correct script link through the script link generation sample, generating a corresponding script link according to the operation demand information, and continuously adjusting the large language model by judging whether the generated script link is correct or not to finally obtain a script link generation large model, wherein the script link generation large model obtained through training can accurately generate the script link.
Because the script link generation large model can not execute specific actions in the learning and reasoning process, and can only use the pre-conditions and the adjacent script relation information to learn and reason, the first prompt text can only comprise the pre-conditions and the adjacent script relation information in the structural information of the action scripts and does not comprise the execution actions, namely the action scripts comprise the pre-conditions and the adjacent script relation information in the structural information of each action script, the script link generation sample and the operation requirement information. In the embodiment of the application, in the process of training the script link to generate the large model, all information influencing the script link generation can be input into the large model to guide the large model to learn, and in the process of predicting the large model, all information influencing the script link generation can also be input into the large model to facilitate the large model to accurately infer the script link.
Optionally, the structure information of the action script further comprises at least one of user characteristic information and scene information.
In this embodiment, the user characteristic information may be understood as information describing unique characteristics of the user, such as preference, habit information, etc. of the user, and the scene judgment information may be understood as information under different application scenes, such as environmental information. The structure information of the action script further comprises at least one of user characteristic information and scene information, wherein the user characteristic information and the scene information are used for assisting the action script to execute corresponding actions.
After the updating condition is met, the structural information of the action script and/or the action script is updated, the structural information of the action script and/or the action script after updating can be directly stored or replaced by the structural information of the original action script and/or the action script, the script link generation model can directly generate a script link according to the action script after updating, or the script link generation model can be trained and updated again according to the action script after updating, and the like. Other action scripts do not need to be changed, and under the condition that the number of the scripts is large, the other action scripts are not influenced, so that the workload of developers is reduced. The update condition may be that a software function is changed, which may cause an action operated by a user to be changed, so that the action script needs to be updated.
For example, after the software functions are changed, the traditional script execution scheme of the voice assistant needs to input products to design each function before the function development, input manpower to write each function script sequence, and then transmit the script sequence to an application developer for development, the more the functions, the exponentially increase the workload, and the later change functions need to modify the script again to update the software version. The method provided by the embodiment of the application independently forms each execution action into the action script, can greatly reduce the labor investment of script design and script writing workload, can dynamically generate a large model by combining with the actual use process information of a user, does not need to manually modify and increase a script sequence, and does not need to update software again to realize function upgrading.
The embodiment of the application provides a training method for generating a large model by a script link, which can effectively improve the degree of intelligence of system development, save time, split a complete flow script for operation execution into independent action scripts, wherein the action scripts comprise execution actions, preconditions and adjacent script relation information, the adjacent script relation information is used for indicating the next action script which can be executed after the action scripts are executed, the large language model learns the meaning of data contained in the action scripts, learns the execution sequence of each action script according to the adjacent script relation information, obtains the large model by the script link, generates the script link by the script link, determines the execution sequence of different scripts by the script link, does not need to completely write the complete flow script, has small workload, generates the script link by the script, can effectively improve the degree of intelligence of system development, does not need to develop all scripts one by one, does not need to exhaust the execution steps of each function, does not generate a large number of similar or repeated scripts, can effectively save time, improves the efficiency, saves manpower and saves the development resources, and is more convenient to store and manages development resources. The labor investment for iterative updating of function development is reduced, and the updating period of the function updating flow is shortened. The constraint limit of the fixed script is broken, the newly-added or modified functions do not need to be rewritten manually to release version upgrades of the script each time, and only the background dynamic change of the large model is needed to be generated. The labor investment of script design and script writing workload is greatly reduced.
Example III
Fig. 7 is a flowchart of a method for generating a script link according to a third embodiment of the present invention, where the method may be applied to a case of quickly generating a script link, and the method may be performed by a script link generating device, where the script link generating device may be implemented in a form of hardware and/or software, and the script link generating device may be configured in an electronic device. As shown in fig. 7, the method includes:
S301, acquiring target operation demand information, and generating a second prompt text according to the target operation demand information.
In the present embodiment, the target operation demand information may be understood as demand information simulating the operation of the user, for example, a precondition for determining a start point, and information of an operation end point. The second prompt text may be understood as text for prompting a large language model, e.g., prompt.
The target operation requirement information can be determined according to the voice command, the action command, the brain-computer command, the current running state of the equipment and the like of the user. And writing the target operation requirement information into the prompt text to generate a second prompt text, wherein the target operation requirement is used for determining the pre-condition and the end point of the operation, or determining the pre-condition and the end point of the operation according to the target operation requirement, writing the pre-condition and the end point of the operation into the prompt text to generate the second prompt text. The second prompt text also comprises action scripts and can also comprise script link generation samples.
The user can output voice instructions through voice, or output action instructions through hand actions (such as wrist swing, finger assignment actions, elbow assignment actions and the like), leg actions (such as leg extension, foot extension and the like), face actions (such as blinking, mouth opening and the like) and the like, or output brain-computer instructions through wearing special equipment (such as an electroencephalogram cap), and the special equipment can acquire brain-computer instructions through acquiring brain wave signals of the user.
The method provided by the embodiment of the application can be deployed on intelligent devices such as a vehicle system, a smart phone, a tablet personal computer, a smart watch, eye movement devices, VR glasses and the like of a vehicle. Taking deployment on a car system as an example, the driver may have the requirements of navigation, music playing, phone call and the like in the driving process, but the driver directly operates the car system to be distracted and unable to ensure driving safety, so that the driver can control the car system to automatically play music through voice 'please help me play xx music', and the car system obtains the voice command of the driver and then analyzes the voice command to determine target operation requirement information. Taking deployment on a smart phone as an example, a user can output target operation requirement information through a voice instruction, or the user wears a sensor to acquire wrist information of the user, the user can acquire corresponding wrist information under any scene of work, movement, household and the like, the target operation requirement information is determined through the wrist information, for example, the user rotates the wrist inwards is detected, and an xx application program is opened to continuously play the video played last time. The method provided by the embodiment of the application can be deployed on the eye movement device, and for the user who is inconvenient to operate and can not send out voice, the user can wear the eye movement device, the eye movement command of the user is collected through the eye movement device, and further the target operation requirement information is determined through the eye movement command, for example, the user blinks the left eye, opens the music software to continuously play the music played last time, the user blinks the left eye for two times continuously, opens the music software to continuously play the music played last time and increases the volume. S302, inputting a second prompt text into a pre-trained script link generation large model, wherein the script link generation large model is obtained by training the script link generation large model by adopting the training method of any embodiment of the application.
And inputting the second prompt text into a pre-trained script link generation large model, and guiding the script link generation large model to carry out reasoning. The script link generation large model is obtained by training the script link generation large model by adopting the training method of any embodiment of the invention.
S303, determining a target script link according to the output of the script link generation large model.
In this embodiment, the target script link may be understood as a script link derived by model reasoning. The script link generation large model can directly output the script link, and the script link output by the script link generation large model is used as a target script link.
In the process of reasoning, firstly, determining an action script of a starting point and an action script of an ending point, then determining script links from the starting point to the ending point, and one or more script links from the starting point to the ending point can be arranged. The script link generation large model may directly output one of the script links as a target script link, or the script link generation large model may output all the script links, from which one is selected as a target script link.
The target script link comprises different action scripts and execution sequences of the action scripts, and the different action scripts and the execution sequences thereof can be determined through the target script link so as to call the action scripts to execute corresponding actions, thereby realizing different functions. When different functions are realized, a complete execution script is not required to be written, a script link is only required to be inferred through a large model, repeated writing is not required for the same actions of different functions, development resources are saved, and development efficiency is improved.
The embodiment of the application provides a script link generation method, which improves the degree of intellectualization of system development, generates a second prompt text according to target operation demand information, guides a trained script link to generate a large model through the second prompt text, guides the script link to generate the large model to perform reasoning according to learned instructions, generates a target script link, can determine the execution sequence of different scripts through the target script link, does not need to completely write a whole flow script, has small workload, generates the large model to generate the script link through the script link, can effectively improve the degree of intellectualization of system development, does not need to develop all the scripts one by one, disassembles the scripts into independent action scripts, does not need to exhaust execution steps of each function, does not generate a large number of similar or repeated scripts, can effectively save development time, improve development efficiency, save development manpower and storage resources, is convenient to manage the scripts, and is more flexible and changeable when realizing different functions.
Example IV
Fig. 8 is a flowchart of a script link generation method according to a fourth embodiment of the present invention, where the present embodiment is refined on the basis of the foregoing embodiment. As shown in fig. 8, the method includes:
s401, receiving user operation information.
In this embodiment, the user operation information may be voice instruction information of the user, for example, the user instructs "please help me play XX movie using application a" by voice. User operation information is collected by a microphone or other sensor.
S402, determining target interface state information according to user operation information, and determining target pre-conditions according to the state of the current interface.
In this embodiment, the target interface state information may be understood as information of an interface that is required to be reached at the end of performing the operation, for example, the target interface state information is a play-designated movie. The target precondition can be understood as the precondition which is satisfied by the actual interface in the reasoning process, and is used for matching with the precondition in the action script.
The method comprises the steps of analyzing user operation information, determining a target point which a user wants to reach, and taking the target point as target interface state information, wherein the user operation information is for example 'please help me play XX movies by using an application program A', and the target interface state information is for playing movies. And reading the state of the current interface to obtain a target precondition, for example, the state of the current interface is the main interface, and the target precondition is the main interface.
S403, generating target operation requirement information according to the target interface state information and the target pre-condition.
And taking the target interface state information and the target pre-condition as target operation requirement information, or writing the target interface state information and the target pre-condition into the information to form the target operation requirement information.
S404, generating a second prompt text according to the target operation demand information.
S405, inputting a second prompt text into a pre-trained script link generation large model, wherein the script link generation large model is obtained by training by adopting the training method of the script link generation large model in any embodiment of the invention.
S406, determining the target script link according to the output of the script link generation large model.
The target precondition is used for determining a starting point, and the target interface state information is used for determining an ending point;
the target script link is the shortest path link from the start point to the end point.
The starting point to the end point can be provided with a plurality of links, and the embodiment of the application selects the shortest path link as the target script link, ensures that the script execution time is shortest, and completes corresponding operation at the fastest speed, thereby improving the response speed.
Different actions can be performed under the same precondition, for example, any application program can be opened on the main interface, and operations such as searching, playing and the like can be performed on the interface of the application program. Thus, one or more starting points can be determined by inputting the target pre-conditions into the script link generation large model, a unique ending point can be determined by inputting the target interface state information into the script link generation large model, the reachable paths of the starting point and the ending point are analyzed, and finally the shortest path link is determined. The executing Action can comprise different parameters and can correspond to different objects, the objects can be single objects or can be classified according to categories to refer to one type of object, user operation information can be combined with the information to determine an executing end point, the Action comprises different slot positions, for example, X and Y in an Action click (X, Y) respectively represent different slot positions, the slot positions can be filled according to the user operation information, for example, a Zhenchuan first set is played, and the corresponding slot positions in the Action of the corresponding Action script are filled with the screened first set respectively. When the script link generation large model generates the target script link, corresponding parameters can be directly written into corresponding parameter positions in the action script according to user operation information, and the script link generation large model can be directly executed according to the written parameters when the action script is executed, for example, when the script corresponding to the playing operation is executed, the first set is played according to the parameters in the slot positions.
S407, determining action scripts to be called and the calling sequence of the action scripts to be called according to the target script link.
The target script link comprises different action scripts and calling sequences, the action scripts form a link according to the sequence, the sequence of the action scripts in the link is the calling sequence of the action scripts, namely, all the action scripts connected in series on the target script path can be understood as that a plurality of steps of operations need to be performed on the vehicle machine for completing the function, and each action script sequence from the beginning is the sequence of each step of operation. And taking the action scripts included in the target script link as action scripts to be called, and simultaneously determining the calling sequence of each action script to be called. Or the target script link comprises different identifiers of the action scripts and the calling sequence of the action scripts, and the action scripts can be obtained from the action script library according to the identifiers of the action scripts. The calling sequence of the action scripts is the link pointer relation between each execution script.
S408, calling each action script to be called in turn according to the calling sequence of each action script to be called to execute the corresponding action.
And sequentially calling the action scripts to be called according to the calling sequence of the action scripts to be called, and executing corresponding actions corresponding to the action scripts after each action script to be called is called.
By way of example, FIG. 9 provides a schematic diagram of a dynamic generation of script sequences based on a large model, where different action scripts and different chained relationships are shown, the action scripts may be stored in an action script library, and the chained relationships of each color are a script link, so as to implement different functions.
Under the interaction scene of the voice assistant, after the script link generates a large model to generate a script link, the script link can be dynamically issued to the voice assistant, the voice assistant sequentially reads the action scripts corresponding to each point in the action script library according to the generated script link, and executes each action script, and the whole process can be completed from opening the application program A to finally playing the film.
Optionally, the structural information of the action script includes at least one of user characteristic information and scene information.
Optionally, the action script to be invoked executes a corresponding action according to the user characteristic information and/or the scene information.
When the Action script to be called is called, corresponding actions can be executed according to at least one of the user characteristic information and the scene information, and the user characteristic information and the scene information can be used as information in the execution process of executing Action actions to assist the Action script to execute the corresponding actions. For example, the user characteristic information comprises at least one of historical use times, active action modifying times of a user and praise feedback of the user, the scene information is environment parameters, and the environment parameters comprise at least one of weather, vehicle body state and date.
By adding at least one of user characteristic information and scene information into the action script, requirements of combining user preference analysis, user-defined scenes, AI pushing and the like can be generated, and overall arbitrary multi-step action combination control of the terminal can be realized through dynamic script sequence relation generation.
After the software function is changed, the action script for executing the action is directly updated without modifying other action scripts, so that the labor investment of script design and script writing workload can be greatly reduced, a large model can be dynamically generated by combining with the actual use process information of a user, the script sequence is not required to be manually modified and increased, and the software is not required to be updated again to realize the function upgrading.
The structure information of the action script also comprises the execution action, the precondition and the adjacent script relation information.
The embodiment of the application provides a script link generation method, which effectively improves the intelligent degree of system development, saves time, determines target interface state information through user operation information, determines target preconditions according to the state of a current interface, generates target operation requirement information according to the target interface state information and the target preconditions, so that a script link generation large model determines a starting point according to the target preconditions, determines an ending point according to the target interface state information, generates a target script link with the shortest path based on the starting point and the ending point, determines the execution sequence of different scripts through the script link, does not need to completely write a full-flow script, has small workload, generates a large model generation script link through the script link, can effectively improve the intelligent degree of system development, does not need to develop all scripts one by one, does not need to exhaust the execution steps of each function, does not generate a large number of similar or repeated scripts, can effectively save development time, improves development manpower and storage resources, is convenient to manage the scripts, and is more flexible when different functions are realized. The labor investment for iterative updating of function development is reduced, and the updating period of the function updating flow is shortened. The constraint limit of the fixed script is broken, the newly-added or modified functions do not need to be rewritten manually to release version upgrades of the script each time, and only the background dynamic change of the large model is needed to be generated. The labor investment of script design and script writing workload is greatly reduced.
Example five
Fig. 10 is a schematic structural diagram of a training device for generating a large model by using a script link according to a fifth embodiment of the present invention. As shown in fig. 10, the apparatus includes an action script acquisition module 51, a first text generation module 52, and a model training module 53.
The action script obtaining module 51 is configured to obtain structural information of at least one action script, where the structural information of the action script includes an execution action, a precondition, and adjacent script relation information, and the adjacent script relation information is used to indicate a next action script executable after the execution of the action script;
a first text generation module 52, configured to generate at least one first prompt text according to the structural information of each action script;
the model training module 53 is configured to input each of the first prompt texts into a large language model for training, so as to obtain a script link generation large model, where the script link generation large model is used for generating a script link.
The embodiment of the application provides a training device for generating a large model by a script link, which effectively improves the degree of intelligence of system development, saves time, splits a complete flow script for operation execution into independent action scripts, wherein the action scripts comprise execution actions, pre-conditions and adjacent script relation information, the adjacent script relation information is used for indicating the next action script which can be executed after the action scripts are executed, generates at least one first prompt text according to each action script, trains the large language model by the first prompt text, learns the meaning of data contained in the action scripts by the large language model, learns the execution sequence of each action script according to the adjacent script relation information, obtains the large model generated by the script link, generates the large model for generating the script link, determines the execution sequence of different scripts by the script link, does not need to completely write the complete flow script, has small workload, generates the script link by the large model generated by the script link, can effectively improve the degree of intelligence of system development, does not need to develop all scripts one by one, does not need to decompose the independent action scripts, does not need to carry out large quantity of execution steps of each function, does not need to be repeatedly execute the execution steps of each function, can not have great quantity of the execution steps, can not be repeatedly realized, can save the development resources, can be more easily realized, saves the development resources, saves resources, is more convenient, can be more can be developed, can be more easily and has more convenient, can be used and can be more easily developed, and can be saved.
Optionally, the action script acquisition module 51 includes:
the historical information acquisition module is used for acquiring and analyzing historical user operation information and determining all execution actions;
The initial script generation module is used for determining at least one pre-condition corresponding to each execution action, and respectively generating corresponding initial action script information according to the execution actions and each pre-condition corresponding to the execution actions, wherein the initial action script information comprises the execution actions and the pre-condition;
The action script generation module is used for determining a next execution action according to the execution action and the pre-condition included in the initial action script information aiming at each piece of initial action script information, generating adjacent script relation information according to the next execution action, and writing the adjacent script relation information into the initial action script information to form the structure information of the action script.
Optionally, the adjacent script relation information comprises an array, wherein the length of the array is the total number of the action scripts, and each bit element in the array is used for indicating whether the action script corresponding to the element can be executed after the current action script is executed.
Optionally, the first prompt text comprises structure information of each action script, script link generation samples and operation requirement information.
Optionally, the structure information of the action script further comprises at least one of user characteristic information and scene information.
The training device for generating the large model by the script link provided by the embodiment of the invention can execute the training method for generating the large model by the script link provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example six
Fig. 11 is a schematic structural diagram of a training device for generating a large model by using a script link according to a sixth embodiment of the present invention. As shown in fig. 11, the apparatus includes a second text generation module 61, a model input module 62, and a script link generation module 63.
A second text generation module 61, configured to obtain target operation requirement information, and generate a second prompt text according to the target operation requirement information;
The model input module 62 is configured to input the second prompt text into a pre-trained script link generation large model, where the script link generation large model is obtained by training the script link generation large model according to the training method of any embodiment of the present invention;
And the script link generation module 63 is used for determining a target script link according to the output of the script link generation large model.
The embodiment of the application provides a script link generation device, which effectively improves the degree of intellectualization of system development, saves time, generates a second prompt text according to target operation demand information, guides a trained script link to generate a large model through the second prompt text, guides the script link to generate the large model to be inferred according to learned instructions, generates a target script link, can determine the execution sequence of different scripts through the target script link, does not need to completely write a full-flow script, has small workload, generates the large model to generate the script link through the script link, can effectively improve the degree of intellectualization of system development, does not need to develop all scripts one by one, disassembles the scripts into independent action scripts, does not need to carry out execution steps of each function, does not generate a large number of similar or repeated scripts, can effectively save development time, improve development efficiency, save development manpower and storage resources, is convenient to manage the scripts, and is more flexible and changeable when realizing different functions.
Optionally, the second text generation module 61 includes:
an operation information receiving unit for receiving user operation information;
the target information determining unit is used for determining target interface state information according to the user operation information and determining target pre-conditions according to the state of the current interface;
and the target demand generation unit is used for generating target operation demand information according to the target interface state information and the target pre-condition.
The target precondition is used for determining a starting point, and the target interface state information is used for determining an ending point;
The target script link is the shortest path link from the start point to the end point.
Optionally, the apparatus further comprises:
The to-be-called script determining unit is used for determining to-be-called action scripts and the calling sequence of each to-be-called action script according to the target script link;
And the script calling unit is used for calling each action script to be called in turn according to the calling sequence of each action script to be called to execute the corresponding action.
Optionally, the structural information of the action script comprises at least one of user characteristic information and scene information;
And the action script to be called executes corresponding actions according to the user characteristic information and/or the scene information.
The script link generation device provided by the embodiment of the invention can execute the script link generation method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example seven
Fig. 12 is a schematic structural diagram of an electronic device according to a seventh embodiment of the present invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices (e.g., helmets, eyeglasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 12, the electronic device 70 includes at least one processor 71, and a memory such as a Read Only Memory (ROM) 72, a Random Access Memory (RAM) 73, etc. communicatively connected to the at least one processor 71, wherein the memory stores a computer program executable by the at least one processor, and the processor 71 may perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 72 or the computer program loaded from the storage unit 78 into the Random Access Memory (RAM) 73. In the RAM 73, various programs and data required for the operation of the electronic device 70 may also be stored. The processor 71, the ROM 72 and the RAM 73 are connected to each other via a bus 74. An input/output (I/O) interface 75 is also connected to bus 74.
Various components in the electronic device 70 are connected to an I/O interface 75, including an input unit 76, such as a keyboard, mouse, etc., an output unit 77, such as various types of displays, speakers, etc., a storage unit 78, such as a magnetic disk, optical disk, etc., and a communication unit 79, such as a network card, modem, wireless communication transceiver, etc. The communication unit 79 allows the electronic device 70 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
Processor 71 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 71 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 71 performs the respective methods and processes described above, for example, a training method of script link generation large model or a script link generation method.
In some embodiments, the training method of script link generation large model or script link generation method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 78. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 70 via the ROM 72 and/or the communication unit 79. When the computer program is loaded into RAM 73 and executed by processor 71, one or more steps of the above-described training method of script link generation large model or script link generation method may be performed. Alternatively, in other embodiments, processor 71 may be configured to perform a training method or a script link generation method of script link generation large models in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include being implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be a special or general purpose programmable processor, operable to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
An embodiment of the present invention provides a computer program product, where the computer program product includes a computer program, where the computer program when executed by a processor implements a training method or a script link generation method for generating a large model by using a script link according to any embodiment of the present invention.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user, for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback), and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a Local Area Network (LAN), a Wide Area Network (WAN), a blockchain network, and the Internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.