Disclosure of Invention
The invention provides a method and a device for generating an action library based on big data, which are used for solving the technical problem that the efficiency of the existing construction mode of the action library is low.
A big data-based action library generation method comprises the following steps:
acquiring an action library generation instruction;
according to the action library generating instruction, acquiring a plurality of action stream information from a target database;
using each action flow information as an action speech segment, and carrying out semantic mapping processing on each action flow information by combining a preset neural network to obtain action instruction keywords corresponding to each action flow information;
obtaining action types corresponding to the action instruction keywords;
acquiring general logic sentences corresponding to the action types corresponding to the action command keywords according to the action types corresponding to the action command keywords;
the method comprises the steps of constructing an action library, wherein the action library comprises action instruction keywords, action language segments corresponding to the action instruction keywords and general logic sentences corresponding to action types corresponding to the action instruction keywords, and the general logic sentences are used for executing the corresponding action language segments.
Specifically, before the generating instruction of the action library obtains the plurality of action flow information from the target database, the action library generating method further includes:
checking the validity of the action library generation instruction;
and if the action library generation instruction is a valid instruction, executing the action library generation instruction, and acquiring a plurality of action flow information from a target database.
Specifically, the action library generation instruction comprises target identity information of an operator and a target instruction character string;
correspondingly, the verification of the validity of the action library generation instruction specifically comprises the following steps:
comparing the target identity information with a preset identity database, and judging the target identity information to be effective identity information if the target identity information belongs to one of the identity information in the identity database;
comparing the target instruction character string with a preset instruction character string database, and judging the target instruction character string to be a valid instruction character string if the target instruction character string belongs to one of the instruction character strings in the instruction character string database;
and if the target identity information is effective identity information and the target instruction character string is effective instruction character string, judging that the action library generation instruction is effective instruction.
Specifically, the neural network includes an encoder for converting the respective action stream information into a corresponding intermediate semantic representation, and a decoder for converting the intermediate semantic representation into action instruction keywords corresponding to the respective action stream information.
The big data-based action library generating device comprises a memory, a processor and a computer program stored in the memory and running on the processor, wherein the processor realizes the big data-based action library generating method when executing the computer program.
The method for generating the action library based on the big data has the technical effects that: after an action library generation instruction is acquired, a plurality of action stream information is acquired from a target database, then each action stream information is used as an action language segment, a preset neural network is combined to map each action stream information, action instruction keywords corresponding to each action stream information are obtained, after the action instruction keywords and the corresponding action language segments are obtained, the action types corresponding to each action instruction keyword are acquired firstly because the action types corresponding to each action language segment are different in general logic sentences when the action language segments are executed, then the general logic sentences corresponding to the action types corresponding to each action instruction keyword are acquired according to the action types corresponding to each action instruction keyword, finally the action library is constructed, and the action library comprises the action instruction keywords and the action language segments corresponding to each action instruction keyword and also comprises the general logic sentences corresponding to the action types corresponding to each action instruction keyword. Compared with a manual construction method, the big data-based action library generation method provided by the invention has the advantages that the construction difficulty can be reduced, the construction efficiency is improved, the reliability is higher, when a certain action instruction is obtained later, the corresponding action language segments and the general logic sentences are obtained according to the keywords corresponding to the action instruction, and the corresponding action language segments are executed through the general logic sentences, so that the reliable execution of the actions is realized.
Detailed Description
The embodiment provides a big data based action library generating method, and a hardware execution subject of the big data based action library generating method may be a computer device, a server device, an intelligent mobile terminal, and the like. In addition, the application scene of the hardware execution main body of the big data-based action library generation method is not limited, and is set according to actual requirements.
As shown in fig. 1, the method for generating the action library based on big data comprises the following steps:
step 1: obtaining an action library generation instruction:
and acquiring an action library generating instruction, wherein the action library generating instruction is used for starting an action library generating process.
In order to improve the security of the action library generation, after the step 1, that is, before the step 2, the action library generation method based on big data further comprises:
and checking the validity of the action library generation instruction, wherein the subsequent steps can be performed only if the action library generation instruction is a valid instruction.
In this embodiment, the action library generation instruction includes target identity information of the operator and a target instruction character string. The target identity information of the operator and the target instruction string may form a data packet, or the target identity information of the operator may be connected to the target instruction string to form a data string. The target identity information may be an identity card number, an employee number, etc., and the target instruction character string is a specific character string.
Correspondingly, the verification of the validity of the action library generation instruction is specifically as follows:
the method comprises the steps of presetting an identity database and an instruction character string database, wherein the identity database comprises at least one identity information, and the identity information in the identity database is effective identity information. The instruction character string database comprises at least one instruction character string, and the instruction character strings in the instruction character string database are all valid instruction character strings.
Then comparing the target identity information with a preset identity database, and judging the target identity information to be effective identity information if the target identity information belongs to one of the identity information in the identity database; comparing the target instruction character string with a preset instruction character string database, and judging the target instruction character string to be a valid instruction character string if the target instruction character string belongs to one of the instruction character strings in the instruction character string database.
Correspondingly, if the target identity information is effective identity information and the target instruction character string is effective instruction character string, determining that the action library generation instruction is effective instruction.
Step 2: according to the action library generation instruction, a plurality of action flow information are acquired from a target database:
in this embodiment, if the action library generation instruction is a valid instruction, a plurality of (i.e., at least two) action flow information is acquired from the target database according to the action library generation instruction. The number of the action flow information acquired from the target database is set according to actual needs.
The target database stores a plurality of pieces of action flow information, and the number of pieces of action flow information is determined by the size of the required action library. The action flow information may be action segments, i.e. action program code segments corresponding to a specific course of action.
Step 3: using each action flow information as an action language segment, and combining a preset neural network to perform semantic mapping processing on each action flow information to obtain action instruction keywords corresponding to each action flow information:
and using the motion stream information as motion language segments, and combining a preset neural network to perform semantic mapping processing on the motion stream information to obtain motion instruction keywords corresponding to the motion stream information. The relation between the action instruction keywords and the action language segments is as follows: action instruction keyword→action segment, then when the action instruction keyword is known, the corresponding action segment can be obtained according to the action instruction keyword.
In this embodiment, the neural network may be a convolutional neural network, including an encoder and a decoder, where for any one action stream information, the encoder is configured to convert the action stream information into a corresponding intermediate semantic representation, and the decoder is configured to convert the intermediate semantic representation into an action instruction keyword corresponding to the action stream information. Therefore, the motion stream information is input to the encoder to be encoded, the encoder outputs the intermediate semantic representation, and then the decoder decodes the intermediate semantic representation to output the motion instruction key corresponding to the motion stream information.
Step 4: obtaining action types corresponding to the action instruction keywords:
and if the action corresponding to each action instruction has a corresponding action type, acquiring the action type corresponding to any action instruction, namely any action instruction keyword. As a specific embodiment, an action type database may be provided, where the action type database includes a plurality of action instruction keywords and action types corresponding to the action instruction keywords, and then, for any action instruction keyword, the action instruction keyword is input into the action type database to obtain a corresponding action type. And finally obtaining the action type corresponding to each action instruction keyword.
Step 5: according to the action types corresponding to the action instruction keywords, acquiring general logic sentences corresponding to the action types corresponding to the action instruction keywords:
for a certain action type, the action process corresponding to the action type has a certain similarity, and correspondingly, the execution process of each action language segment corresponding to the action type also has a great similarity. Therefore, according to the action type, the general logic statement corresponding to the action type can be obtained. As a specific embodiment, a general logic sentence database is preset, and the general logic sentence database includes a plurality of action types (including all the action types involved, for example), and general logic sentences corresponding to the action types. And then, according to the action types corresponding to the action instruction keywords, acquiring the general logic sentences corresponding to the action types corresponding to the action instruction keywords. The general logic statement is used for executing the corresponding action language segment.
Step 6: constructing an action library, wherein the action library comprises action instruction keywords, action language segments corresponding to the action instruction keywords and general logic sentences corresponding to action types corresponding to the action instruction keywords, and the general logic sentences are used for executing the corresponding action language segments:
after obtaining each action instruction keyword, an action language segment corresponding to each action instruction keyword and a general logic statement corresponding to an action type corresponding to each action instruction keyword, an action library is constructed, wherein the action library comprises each action instruction keyword, the action language segment corresponding to each action instruction keyword and the general logic statement corresponding to the action type corresponding to each action instruction keyword.
When the related actions are needed, an action instruction is received, an action instruction keyword is obtained, corresponding action language segments and general logic sentences are obtained according to the action instruction keyword and an action library, and then the corresponding action language segments are executed according to the general logic sentences.
The embodiment also provides a big data based action library generating device, which comprises a memory, a processor and a computer program stored on the memory and running on the processor, wherein the processor realizes the big data based action library generating method when executing the computer program, and the method is not repeated because the detailed description is given above.