Disclosure of Invention
The invention provides an action library generation method and device based on big data, which are used for solving the technical problem that the existing construction mode of an action library is low in efficiency.
A big data-based action library generation method comprises the following steps:
acquiring an action library generating instruction;
acquiring a plurality of pieces of action flow information from a target database according to the action library generation instruction;
taking each action flow information as an action speech segment, and performing semantic mapping processing on each action flow information by combining a preset neural network to obtain an action instruction keyword corresponding to each action flow information;
acquiring action types corresponding to the action instruction keywords;
acquiring a general logic statement corresponding to the action type corresponding to each action instruction keyword according to the action type corresponding to each action instruction keyword;
and constructing an action library, wherein the action library comprises each action instruction keyword, an action language segment corresponding to each action instruction keyword and a general logic statement corresponding to the action type corresponding to each action instruction keyword, and the general logic statement is used for executing the corresponding action language segment.
Specifically, before the obtaining of the plurality of pieces of action flow information from the target database according to the action library generation instruction, the action library generation method further includes:
verifying the validity of the action library generation instruction;
and if the action library generation instruction is an effective 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 verifying the validity of the action library generation instruction specifically includes:
comparing the target identity information with a preset identity database, and if the target identity information belongs to one identity information in the identity database, judging that the target identity information is valid identity information;
comparing the target instruction character string with a preset instruction character string database, and if the target instruction character string belongs to one instruction character string in the instruction character string database, judging that the target instruction character string is an effective instruction character string;
and if the target identity information is valid identity information and the target instruction character string is a valid instruction character string, judging that the action library generation instruction is a valid instruction.
Specifically, the neural network comprises an encoder and a decoder, wherein the encoder is used for converting each action flow information into a corresponding intermediate semantic representation, and the decoder is used for converting the intermediate semantic representation into an action instruction keyword corresponding to each action flow information.
A big data-based action library generation device comprises a memory, a processor and a computer program stored on the memory and running on the processor, wherein the processor executes the computer program to realize the big data-based action library generation method.
The action library generating method based on big data provided by the invention has the technical effects that: after an action library generation instruction is obtained, obtaining a plurality of action flow information from a target database, taking each action flow information as an action language segment, combining a preset neural network, mapping each action flow information to obtain an action instruction keyword corresponding to each action flow information, obtaining an action instruction keyword and a corresponding action language segment, obtaining an action type corresponding to each action instruction keyword according to an action type corresponding to each action instruction keyword, and finally constructing an action library, wherein the action library comprises each action instruction keyword and the action language segment corresponding to each action instruction keyword except for the action instruction keyword, and the general logic statement corresponding to the action type corresponding to each action instruction keyword is also included. Compared with a manual construction method, the action library generation method based on the big data provided by the invention can reduce the construction difficulty and improve the construction efficiency, has higher reliability, and can obtain the corresponding action language section and the general logic statement according to the keyword corresponding to the action instruction when a certain action instruction is obtained subsequently, and implement the reliable execution of the action by executing the corresponding action language section through the general logic statement.
Detailed Description
The embodiment provides a big data-based action library generation method, and a hardware execution main body of the big data-based action library generation method can be computer equipment, server equipment, an intelligent mobile terminal and the like. In addition, the application scenario of the hardware execution main body of the action library generation method based on big data is not limited, and is set according to actual needs.
As shown in fig. 1, the method for generating an action library based on big data includes the following steps:
step 1: acquiring an action library generating instruction:
and acquiring an action library generation instruction, wherein the action library generation instruction is used for starting an action library generation process.
In order to improve the safety of the action library generation, after step 1, i.e. before step 2, the big data based action library generation method further comprises:
and verifying the validity of the action library generation instruction, wherein the subsequent steps can be carried out 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 character string may form a data packet, or the target identity information of the operator is connected to the target instruction character string to form a data string. The target identity information may be an identity card number, an employee number, and the like, and the target instruction character string is a specific character string.
Correspondingly, the verification of the validity of the action library generation instruction specifically comprises the following steps:
the method comprises the steps that an identity database and an instruction character string database are preset, wherein the identity database comprises at least one piece of 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 if the target identity information belongs to one identity information in the identity database, judging that the target identity information is valid identity information; and comparing the target instruction character string with a preset instruction character string database, and if the target instruction character string belongs to one of the instruction character strings in the instruction character string database, judging that the target instruction character string is an effective instruction character string.
Correspondingly, if the target identity information is valid identity information and the target instruction character string is a valid instruction character string, the action library generation instruction is determined to be a valid instruction.
Step 2: according to the action library generation instruction, acquiring a plurality of action flow information 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) pieces of action flow information are acquired from the target database according to the action library generation instruction. The number of pieces of action flow information acquired from the target database is set according to actual needs.
The target database stores a plurality of pieces of operation flow information, and the number of pieces of operation flow information is determined by the size of the required operation library. The action flow information may be an action language segment, i.e. an action program code segment corresponding to a specific action process.
And step 3: taking each action flow information as an action speech segment, and combining a preset neural network to perform semantic mapping processing on each action flow information to obtain an action instruction keyword corresponding to each action flow information:
and taking each action flow information as an action speech segment, and performing semantic mapping processing on each action flow information by combining a preset neural network to obtain an action instruction keyword corresponding to each action flow information. The relationship between the action instruction keyword and the action language segment is as follows: action instruction key → action language segment, then, when the action instruction key is known, the corresponding action language segment can be obtained according to the action instruction key.
In this embodiment, the neural network may be a convolutional neural network, and includes an encoder and a decoder, where for any piece of motion flow information, the encoder is configured to convert the motion flow information into a corresponding intermediate semantic representation, and the decoder is configured to convert the intermediate semantic representation into a motion instruction keyword corresponding to the motion flow information. Therefore, the operation flow information is input to the encoder and encoded, the encoder outputs the intermediate semantic representation, and the decoder decodes the intermediate semantic representation and outputs the operation command keyword corresponding to the operation flow information.
And 4, step 4: acquiring 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 the action instruction keyword for any action instruction, namely for 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 an action type corresponding to each action instruction keyword, and then, for any one 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.
And 5: acquiring a general logic statement corresponding to the action type corresponding to each action instruction keyword according to the action type corresponding to each action instruction keyword:
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 acquired. As a specific embodiment, a general logic statement database is preset, and the general logic statement database includes a plurality of action types (for example, all the action types involved), and general logic statements corresponding to the action types. Then, according to the action type corresponding to each action instruction keyword, a general logic statement corresponding to the action type corresponding to each action instruction keyword is obtained. 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:
and after obtaining each action instruction keyword, an action language segment corresponding to each action instruction keyword and a general logic statement corresponding to the action type corresponding to each action instruction keyword, constructing an action library, wherein the action library comprises each action instruction keyword, an action language segment corresponding to each action instruction keyword and a general logic statement corresponding to the action type corresponding to each action instruction keyword.
Then, when the relevant action is needed, the action instruction is received, the action instruction keyword is obtained, the corresponding action language segment and the general logic statement are obtained according to the action instruction keyword and the action library, and then the corresponding action language segment is executed according to the general logic statement.
The embodiment further provides a motion library generation device based on big data, which includes a memory, a processor, and a computer program stored in the memory and running on the processor, where the processor implements the motion library generation method based on big data when executing the computer program, and since the method has been described in detail above, it is not described again.