Training program, inference program, training method, inference method, and information processing device

The learning program uses a machine learning model to analyze SQL command sequences and execution logs, generating vector dictionaries to detect missing commit commands, thereby preventing database issues by identifying incomplete transactions in SQL processing.

WO2024180689A1PCT designated stage expired Publication Date: 2024-09-06FUJITSU LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/JP2023/007423
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-02-28
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

Conventional SQL editors cannot detect missing commit commands in SQL sequences, leading to potential database issues due to incomplete transaction processing.

Method used

A learning program and information processing device that uses a machine learning model to analyze SQL command sequences and execution logs, detecting commit omissions by generating vector dictionaries through preprocessing and training on labeled data to identify abnormal sequences.

Benefits of technology

Effectively detects commit omissions in real-time SQL processing, preventing database errors by alerting users to incomplete transaction processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure JP2023007423_06092024_PF_FP
    Figure JP2023007423_06092024_PF_FP
Patent Text Reader

Abstract

This information processing device acquires training data in which input data and a label are associated with each other, the input data including sequentially executed multiple instructions and execution logs obtained by executing the multiple instructions, the label indicating whether or not the multiple instructions are appropriate. The information processing device executes machine learning of a machine learning model on the basis of the training data.
Need to check novelty before this filing date? Find Prior Art

Description

Learning program, inference program, learning method, inference method, and information processing device

[0001] The present invention relates to a learning program and the like.

[0002] DBMSs (Data Base Management Systems) are used to perform processes such as searching and updating data in databases. Users manipulate database data by inputting commands based on SQL (Structured Query Language) into the DBMS. In the following explanation, commands based on SQL will be referred to as "SQL commands."

[0003] When the DBMS receives an SQL command from a user, it executes SQL processing corresponding to the SQL command on the database and returns an execution log to the user.

[0004] For simple data manipulation, the user only needs to input one SQL command, but for complex data manipulation, the user inputs multiple SQL commands in sequence. After inputting multiple SQL commands in sequence, the user inputs a commit command to finalize the SQL processing by the DBMS up to that point.

[0005] A conventional technique for assisting in the creation of SQL commands is the use of an SQL editor. The SQL editor has a function for completing missing keywords and identifiers for a single SQL command. By using the SQL editor, users can create accurate SQL commands.

[0006] JP 2009-258913 A JP 2001-184241 A JP 2020-98405 A

[0007] For example, a user is required to input a plurality of SQL commands in order to perform a first operation into a DBMS, and then input a commit command. However, after inputting the plurality of SQL commands, the user may forget to input the commit command and continue inputting another SQL command for a second operation.

[0008] As mentioned above, forgetting to enter a commit command is referred to as a "missed commit." If a missed commit occurs, the next SQL operation is performed before the previous SQL operation has been finalized, which can cause problems in the database.

[0009] Although the conventional SQL editor can complete the keywords and identifiers of each SQL command, it cannot detect missed commits.

[0010] In one aspect, the present invention aims to provide a learning program, an inference program, a learning method, an inference method, and an information processing device that are capable of detecting an abnormal SQL sequence such as a missed commit.

[0011] In the first proposal, a computer is caused to perform the following process: The computer acquires training data in which input data having a plurality of instructions executed in sequence and an execution log obtained by executing the plurality of instructions is associated with labels indicating whether the plurality of instructions are appropriate. The computer then performs machine learning of a machine learning model based on the training data.

[0012] Abnormal SQL sequences such as missed commits can be detected.

[0013] FIG. 1 is a diagram illustrating an example of a system according to this embodiment. FIG. 2 is a diagram illustrating processing in the preprocessing phase. FIG. 3 is a diagram illustrating an example of an SQL command and an execution log. FIG. 4 is a diagram (1) illustrating the learning phase. FIG. 5 is a diagram (2) illustrating the learning phase. FIG. 6 is a diagram (1) illustrating the inference phase. FIG. 7 is a diagram (2) illustrating the inference phase. FIG. 8 is a functional block diagram illustrating the configuration of an information processing device according to this embodiment. FIG. 9 is a flowchart illustrating the processing procedure of the preprocessing phase. FIG. 10 is a flowchart illustrating the processing procedure of the learning phase. FIG. 11 is a flowchart illustrating the processing procedure of the inference phase. FIG. 12 is a diagram illustrating an example of the relationship between line shapes and PostScript programs. FIG. 13 is a diagram illustrating an example of the hardware configuration of a computer that realizes similar functions to those of the information processing device according to the embodiment.

[0014] Hereinafter, embodiments of the learning program, inference program, learning method, inference method, and information processing device disclosed in the present application will be described in detail with reference to the accompanying drawings. However, the present invention is not limited to these embodiments.

[0015] Fig. 1 is a diagram showing an example of a system according to this embodiment. As shown in Fig. 1, this system includes an information processing device 100, a DBMS 200, and a database 240. The information processing device 100 and the DBMS 200 are connected to each other via a network. The DBMS 200 is connected to the database 240.

[0016] A user operates the information processing device 100 to output an SQL command to the DBMS 200. When the DBMS 200 receives the SQL command, it executes an SQL process corresponding to the SQL command on the database 240. The SQL process includes reading, writing, overwriting, and deleting data. When the DBMS 200 executes the SQL process, it outputs an execution log to the information processing device 100.

[0017] Each time the information processing device 100 receives input of an SQL command from a user, it uses the trained machine learning model M1 to determine whether a missed commit has occurred, and if a missed commit is detected, it displays on the display unit that a missed commit has been detected.

[0018] For example, the information processing device 100 sequentially executes a pre-processing phase process, a learning phase process, and an inference phase process. The pre-processing phase process, the learning phase process, and the inference phase process will be described below in this order.

[0019] The processing of the pre-processing phase executed by the information processing device 100 will be described. FIG. 2 is a diagram for explaining the processing of the pre-processing phase. The information processing device 100 generates a first vector dictionary 142a and a second vector dictionary 142b by executing the processing of the pre-processing phase. The information processing device 100 has a corpus 141. For example, the corpus 141 stores a plurality of SQL commands created by the user in the past, and a plurality of execution logs returned from the DBMS 200 when an SQL command is input to the DBMS 200.

[0020] 3 is a diagram showing an example of an SQL command and an execution log. For example, when an SQL command 5 is input to the DBMS 200, an execution log 6 is output from the DBMS 200. For example, in the SQL command 5, a command statement is set in each line, and each command statement includes a command type, arguments, etc. In the execution log 6, a value of each attribute is set in each line. In the example shown in FIG. 3, the attributes include "url," "access_count," "access_users," and "access_view." Although not shown, each line may be associated with a time.

[0021] Returning to the description of FIG. 2 , the process by which the information processing device 100 generates the first vector dictionary 142a will be described. The information processing device 100 extracts a plurality of SQL commands from the corpus 141. In the description of FIG. 2 , a plurality of SQL commands will be collectively referred to as "SQL command 10." As described in FIG. 3 , a command statement is set in each line of one SQL command. The information processing device 100 performs morphological analysis on the command statement in each line of the SQL command 10, thereby breaking it down into a plurality of morphemes. The broken down morphemes will be referred to as "tokens." The tokens obtained by breaking down the command statement in each line of the SQL command include command types, arguments, etc.

[0022] The information processing device 100 decomposes the SQL command 10 into multiple tokens and then arranges the tokens in order. The information processing device 100 applies algorithms such as CBoW or skip-gram (Word2vec) to each of the arranged tokens, treating each token as a word and calculating a vector for each token. The information processing device 100 registers the relationship between the tokens of the SQL command 10 and the vectors in the first vector dictionary 142a.

[0023] The information processing apparatus 100 repeatedly executes the above process for other SQL commands, thereby registering the relationships between tokens included in the other SQL commands and vectors in the first vector dictionary 142a.

[0024] Next, a process by which the information processing device 100 generates the second vector dictionary 142b will be described. The information processing device 100 extracts a plurality of execution logs from the corpus 141. In the description of FIG. 2 , the plurality of execution logs will be collectively referred to as the "execution log 15." The information processing device 100 performs morphological analysis on the execution log 15 to decompose it into a plurality of morphemes. The decomposed morphemes will be referred to as "tokens." The tokens obtained by decomposing the execution log are words or numbers.

[0025] The information processing device 100 breaks down the execution log 15 into multiple tokens and then arranges the tokens in order. The information processing device 100 applies a CBoW or skip-gram algorithm to each of the arranged tokens, treats each token as a word, and calculates a vector for each token. The information processing device registers the relationship between the tokens in the execution log 15 and the vectors in the second vector dictionary 142b.

[0026] As described above, the information processing device 100 generates the first vector dictionary 142a and the second vector dictionary 142b by executing the processing of the preprocessing phase. Note that the information processing device 100 may define the relationship between tokens and vectors and obtain the first vector dictionary 142a and the second vector dictionary 142b in advance from an external device, etc. If the information processing device 100 obtains the first vector dictionary 142a and the second vector dictionary 142b in advance, it may skip the processing of the preprocessing phase.

[0027] Next, a description will be given of the learning phase process executed by the information processing device 100. Fig. 4 is a diagram (1) for explaining the learning phase. The information processing device 100 executes the learning phase process using a teacher data table 143 prepared in advance.

[0028] For example, the teacher data table 143 associates an item number, an SQL command sequence, an execution log group, and a label. The item number is a number that identifies a record (teacher data) in the teacher data table 143. The SQL command sequence includes multiple SQL commands that cause the DBMS 200 to execute a specified SQL process. The execution log group includes multiple execution logs obtained when each SQL command included in the SQL command sequence is input to the DBMS 200. The label indicates whether or not there is a missed commit in the corresponding SQL sequence. If there is no missed commit in the corresponding SQL sequence, the label is set to "OK". If there is a missed commit in the corresponding SQL sequence, the label is set to "NG".

[0029] For example, the SQL command sequence of item number (1) includes, in order from the beginning, SQL commands c1-1, c1-2, c1-3, and a commit command c1-4.

[0030] The execution log group of item number (1) includes, from the top, execution logs e1-1, e1-2, e1-3, and e1-4. For example, execution log e1-1 is an execution log obtained by inputting SQL command c1-1 into the DBMS 200. Execution log e1-2 is an execution log obtained by inputting SQL command c1-2 into the DBMS 200. Execution log e1-3 is an execution log obtained by inputting SQL command c1-3 into the DBMS 200. Execution log e1-2 is an execution log obtained by inputting commit command c1-4 into the DBMS 200.

[0031] For example, the label corresponding to item number (1) is the label (OK), which indicates that no commit omissions have occurred in the SQL command sequence of item number (1).

[0032] Although not shown, SQL command sequences corresponding to other item numbers include multiple SQL commands, and execution log groups corresponding to other item numbers include multiple execution logs. An SQL command sequence may or may not include a commit command.

[0033] The label corresponding to item number (2) is label (NG), which indicates that a commit has been omitted in the SQL command sequence of item number (2). Although not shown in the figure, for example, the SQL command sequence of item number (2) does not include a commit command.

[0034] The information processing device 100 uses the first vector dictionary 142a created in the preparation phase to identify the vectors of each SQL command included in the SQL command sequence in the teacher data table 143. In the following description, the vectors of the SQL commands will be referred to as "command vectors."

[0035] This will be explained using SQL command c1-1 in the SQL command sequence of item number (1). The information processing device 100 performs morphological analysis on the SQL command c1-1 to break it down into multiple tokens. The information processing device 100 identifies the vector of each token by comparing each token of the SQL command c1-1 with the first vector dictionary 142a. The information processing device 100 obtains the command vector vc1-1 of the SQL command c1-1 by integrating the vectors of each token of the SQL command c1-1.

[0036] The information processing apparatus 100 obtains a command vector vc1-2 for the SQL command c1-2 in the same way as for the SQL command c1-1. The information processing apparatus 100 obtains a command vector vc1-3 for the SQL command c1-3. The information processing apparatus 100 obtains a command vector vc1-4 for the commit command c1-4.

[0037] Next, the information processing device 100 uses the second vector dictionary 142b created in the preparation phase to identify the vector of each execution log included in the execution log group in the teacher data table 143. In the following description, the vector of the execution log is referred to as a "log vector."

[0038] An explanation will be given using the execution log e1-1 of the execution log group of item number (1). The information processing device 100 performs morphological analysis on the execution log e1-1 to break it down into multiple tokens. The information processing device 100 identifies the vector of each token by comparing each token of the execution log e1-1 with the second vector dictionary 142b. The information processing device 100 obtains the log vector ve1-1 of the execution log e1-1 by integrating each vector of each token of the execution log e1-1.

[0039] The information processing apparatus 100 obtains a log vector ve1-2 for the execution log e1-2 in the same manner as for the execution log e1-1. The information processing apparatus 100 obtains a log vector ve1-3 for the execution log e1-3. The information processing apparatus 100 obtains a log vector ve1-4 for the execution log e1-4.

[0040] 5 is a diagram (2) for explaining the learning phase. The information processing device 100 inputs each command vector of the SQL command sequence of each item number and each log vector of the execution log group into the machine learning model M1 in order, and trains the machine learning model M1 (updates its parameters) so that the value output from the machine learning model M1 approaches the corresponding label.

[0041] The machine learning model M1 is a neural network (NN) such as BERT (Pre-training of Deep Bidirectional Transformers for Language Understanding), Next Sentence Prediction, or Transformers.

[0042] A case will be described in which the information processing device 100 updates parameters using an SQL command sequence, execution log group, and label corresponding to item number (1) in the teacher data table 143.

[0043] 4, and obtains command vectors vc1-1 to vc1-4 of SQL commands c1-1 to c1-3 and commit command c1-4 included in the SQL command sequence of item number (1).The information processing device 100 also obtains log vectors ve1-1 to ve1-4 of execution logs e1-1 to e1-4 included in the execution log group of item number (1).

[0044] The information processing device 100 inputs pairs of command vectors of SQL commands and log vectors of execution logs in the order of the SQL command sequence. For example, the information processing device 100 first inputs the command vector vc1-1 and the log vector ve1-1 to the machine learning model M1. The information processing device 100 secondly inputs the command vector vc1-2 and the log vector ve1-2 to the machine learning model M1. The information processing device 100 thirdly inputs the command vector vc1-3 and the log vector ve1-3 to the machine learning model M1. The information processing device 100 fourthly (finally) inputs the command vector vc1-4 and the log vector ve1-4 to the machine learning model M1.

[0045] When the information processing device 100 inputs the pair of the command vector of the last SQL command and the log vector of the execution log into the machine learning model M1, it updates the parameters of the machine learning model M1 so that the difference between the output result output from the machine learning model M1 and the label of item number (1) becomes small.

[0046] The information processing device 100 updates the parameters of the machine learning model M1 by repeatedly performing the same process as above for the SQL command sequences, execution log groups, and labels from item number (2) onwards in the teacher data table 143.

[0047] Next, the processing of the inference phase executed by the information processing device will be described. Figures 6 and 7 are diagrams for explaining the inference phase. The information processing device acquires, in real time, SQL commands sequentially input to the DBMS 200 by the user and execution logs sequentially returned from the DBMS 200.

[0048] 6 shows an example in which a user inputs SQL commands c10-1, c10-2, c10-3, and c10-4 in that order. When SQL command c10-1 is input, the DBMS 200 returns an execution log e10-1. When SQL command c10-2 is input, the DBMS 200 returns an execution log e10-2. When SQL command c10-3 is input, the DBMS 200 returns an execution log e10-3. When SQL command c10-4 is input, the DBMS 200 returns an execution log e10-4.

[0049] The information processing device 100 calculates a command vector vc10-1 based on the first vector dictionary 142a when the SQL command c10-1 is input to the DBMS 200. The process of calculating a command vector from an SQL command is similar to the process of calculating the command vector vc1-1, etc. of the SQL command c1-1 described in FIG.

[0050] The information processing device 100 calculates a log vector ve10-1 based on the second vector dictionary 142b when an execution log e10-1 is output from the DBMS 200. The process of calculating a log vector from an execution log is similar to the process of calculating the log vector ve1-1, etc. of the execution log e1-1 described in FIG.

[0051] 7. The information processing device 100 inputs a pair of the command vector vc10-1 of the SQL command c10-1 and the log vector ve10-1 of the execution log e10-1 into the machine learning model M1, and obtains, for example, an output result of "OK." In this case, the information processing device 100 infers that no missed commit occurred at the stage when the SQL command c10-1 was input.

[0052] Returning to the explanation of Figure 6, when an SQL command c10-2 is input to the DBMS 200, the information processing device 100 calculates a command vector vc10-2 based on the first vector dictionary 142a. When an execution log e10-2 is output from the DBMS 200, the information processing device 100 calculates a log vector ve10-2 based on the second vector dictionary 142b.

[0053] 7 will be described. The information processing device 100 inputs the pair of command vector vc10-1 and log vector ve10-1, followed by the pair of command vector vc10-2 of SQL command c10-2 and log vector ve10-2 of execution log e10-2, to the machine learning model M1. For example, the information processing device 100 obtains an output result of "OK" from the machine learning model M1. In this case, the information processing device 100 infers that no missed commit occurred at the stage when the SQL command c10-2 was input.

[0054] Returning to the explanation of Figure 6, when an SQL command c10-3 is input to the DBMS 200, the information processing device 100 calculates a command vector vc10-3 based on the first vector dictionary 142a. When an execution log e10-3 is output from the DBMS 200, the information processing device 100 calculates a log vector ve10-3 based on the second vector dictionary 142b.

[0055] 7 will be described. The information processing device 100 inputs the pair of command vector vc10-2 and log vector ve10-2, followed by the pair of command vector vc10-3 of SQL command c10-3 and log vector ve10-3 of execution log e10-3, to the machine learning model M1. For example, the information processing device 100 obtains the output result "OK" from the machine learning model M1. In this case, the information processing device 100 infers that no missed commit occurred at the stage when the SQL command c10-3 was input.

[0056] Returning to the explanation of Figure 6, when an SQL command c10-4 is input to the DBMS 200, the information processing device 100 calculates a command vector vc10-4 based on the first vector dictionary 142a. When an execution log e10-4 is output from the DBMS 200, the information processing device 100 calculates a log vector ve10-4 based on the second vector dictionary 142b.

[0057] We now move on to the description of FIG. 7. Following the pair of command vector vc10-3 and log vector ve10-3, the information processing device 100 inputs the pair of command vector vc10-4 of SQL command c10-4 and log vector ve10-4 of execution log e10-4 to the machine learning model M1. For example, the information processing device 100 obtains an output result of "NG" from the machine learning model M1. In this case, the information processing device 100 detects that a missed commit has occurred when the SQL command c10-4 is input. When the information processing device 100 detects a missed commit, it causes the display unit to display a message indicating that a missed commit has occurred. The information processing device 100 may also cause the display unit to display a series of SQL commands from the start of input of the SQL commands until the detection of the missed commit.

[0058] As described above, in the learning phase, the information processing device 100 performs machine learning of the machine learning model M1 based on training data in which SQL command sequences and execution logs are associated with labels indicating the presence or absence of missed commits, thereby generating the machine learning model M1 that can detect missed commits.

[0059] In the inference phase, the information processing device 100 inputs the command vector of the SQL command and the log vector of the execution log to the trained machine learning model M1 in real time, and infers missed commits based on the output results of the machine learning model M1, thereby making it possible to detect missed commits.

[0060] Next, an example of the configuration of an information processing device 100 that executes the above-mentioned inference phase process, learning phase process, and inference phase process will be described. Fig. 8 is a functional block diagram showing the configuration of an information processing device according to this embodiment. As shown in Fig. 8, the information processing device 100 includes a communication unit 110, an input unit 120, a display unit 130, a storage unit 140, and a control unit 150.

[0061] The communication unit 110 is connected to the DBMS 200 or the like via a wired or wireless connection, and transmits and receives information to and from the DBMS 200 or the like. For example, the communication unit 110 is realized by a NIC (Network Interface Card) or the like. The communication unit 110 may be connected to a network (not shown). The communication unit 110 outputs SQL commands input by a user to the DBMS 200, and acquires an execution log from the DBMS 200.

[0062] The input unit 120 is an input device that inputs various types of information to the information processing device 100. The input unit 120 corresponds to a keyboard, a mouse, a touch panel, etc. For example, a user operates the input unit 120 to input an SQL command.

[0063] The display unit 130 is a display device that displays information output from the control unit 150. The display unit 130 corresponds to a liquid crystal display, an organic EL (Electro Luminescence) display, a touch panel, etc. For example, when the control unit 150 detects a missed commit, the display unit 130 displays information indicating that a missed commit has been detected.

[0064] The storage unit 140 includes a corpus 141, a first vector dictionary 142a, a second vector dictionary 142b, a teacher data table 143, and a machine learning model M1. The storage unit 140 is realized by, for example, a semiconductor memory element such as a random access memory (RAM) or a flash memory, or a storage device such as a hard disk or an optical disk.

[0065] The corpus 141 stores a plurality of SQL commands created by the user in the past, and a plurality of execution logs returned from the DBMS 200 when an SQL command is input to the DBMS 200 .

[0066] The first vector dictionary 142a is a dictionary that stores tokens included in SQL commands in association with vectors. Other descriptions of the first vector dictionary 142a are the same as those of the first vector dictionary 142a shown in FIG. 2 and the like.

[0067] The second vector dictionary 142b is a dictionary that stores tokens included in the execution log in association with vectors. Other descriptions of the second vector dictionary 142b are the same as those of the second vector dictionary 142b shown in FIG. 2 and the like.

[0068] The teacher data table 143 holds multiple teacher data. The teacher data associates SQL command sequences, execution log groups, and labels. Each teacher data is used when performing machine learning on the machine learning model M1. The explanation of the data structure of the teacher data table 143 is the same as the explanation of the data structure of the teacher data table 143 shown in FIG. 4.

[0069] The machine learning model M1 is a neural network such as BERT, Next Sentence Prediction, or Transformers, which are described in FIG. 5 .

[0070] The control unit 150 includes a preprocessing unit 151, a learning processing unit 152, and an inference processing unit 153. The control unit 150 is realized by, for example, a central processing unit (CPU) or a micro processing unit (MPU). The control unit 150 may also be implemented by an integrated circuit such as an application specific integrated circuit (ASIC) or a field programmable gate array (FPGA).

[0071] 2 and 3. The preprocessing unit 151 acquires an SQL command from the corpus 141 and performs morphological analysis on the SQL command to decompose it into multiple tokens. The preprocessing unit 151 applies an algorithm such as CBoW or skip-gram (Word2vec), assigns a vector to each token, and sets the relationship between the tokens and vectors of the SQL command in the first vector dictionary 142a.

[0072] The preprocessing unit 151 acquires an execution log from the corpus 141 and performs morphological analysis on the execution log to decompose it into multiple tokens. The preprocessing unit 151 applies an algorithm such as CBoW or skip-gram (Word2vec), assigns a vector to each token, and sets the relationship between the tokens of the execution log and the vectors in the second vector dictionary 142b.

[0073] The other processes of the preprocessing unit 151 are the same as those of the preprocessing phase described with reference to Figures 2 and 3. Note that the preprocessing unit 151 may skip the preprocessing phase if the first vector dictionary 142a and the second vector dictionary 142b have been acquired in advance.

[0074] The learning processing unit 152 executes the learning phase processing described with reference to FIGS. 4 and 5 . The learning processing unit 152 acquires training data from the training data table 143. The learning processing unit 152 calculates a command vector for each SQL command in the SQL command sequence based on the first vector dictionary 142a. The learning processing unit 152 calculates a log vector for each execution log in the execution log group. The learning processing unit 152 inputs the pair of the command vector and the log vector to the machine learning model M1, and updates the parameters of the machine learning model M1 based on the backpropagation algorithm or the like so as to reduce the difference between the output result of the machine learning model M1 and the label. The learning processing unit 152 repeatedly executes the above processing using each training data stored in the training data table 143.

[0075] The other processes executed by the learning processing unit 152 are the same as those in the learning phase described with reference to FIGS.

[0076] The inference processing unit 153 executes the processing of the inference phase described in Fig. 6 and Fig. 7. The inference processing unit 153 acquires, in real time, SQL commands input by a user operating the input unit 120 and execution logs obtained by inputting the SQL commands to the DBMS 200.

[0077] The inference processing unit 153 calculates a command vector of an SQL command based on the first vector dictionary 142a, and calculates a log vector of an execution log based on the second vector dictionary 142b. The inference processing unit 153 inputs a pair of the command vector and the log vector to a trained machine learning model M1, and determines whether a commit omission has occurred based on the output result of the machine learning model M1. The inference processing unit 153 repeatedly executes the above process each time it receives an input of an SQL command.

[0078] When the inference processing unit 153 detects that a missed commit has occurred, it outputs and displays information that a missed commit has occurred to the display unit 130. When displaying the information that a missed commit has occurred, the inference processing unit 153 may display on the display unit 130 a series of SQL commands from when the user starts inputting them until the missed commit occurs.

[0079] The other processes executed by the inference processing unit 153 are similar to the processes in the inference phase described with reference to FIGS.

[0080] Next, an example of a processing procedure of the information processing device 100 according to this embodiment will be described. Fig. 9 is a flowchart showing the processing procedure of the preprocessing phase. As shown in Fig. 9, the preprocessing unit 151 of the information processing device 100 acquires an SQL command from the corpus 141 (step S101). The preprocessing unit 151 performs morphological analysis on the SQL command and breaks it down into multiple tokens (step S102).

[0081] The preprocessing unit 151 assigns a vector to each token of the SQL command (step S103), and sets the vector corresponding to each token in the first vector dictionary 142a (step S104).

[0082] The preprocessing unit 151 acquires the execution log from the corpus 141 (step S105). The preprocessing unit 151 performs morphological analysis on the execution log to break it down into a plurality of tokens (step S106).

[0083] The preprocessing unit 151 assigns a vector to each token in the execution log (step S107), and sets a vector corresponding to each token in the second vector dictionary 142b (step S108).

[0084] 10 is a flowchart showing the processing procedure of the learning phase. As shown in FIG. 10, the learning processing unit 152 of the information processing device 100 acquires training data from the training data table 143 (step S201). The learning processing unit 152 calculates command vectors for SQL commands based on the first vector dictionary 142a (step S202).

[0085] The learning processing unit 152 calculates a log vector of the execution log based on the second vector dictionary 142b (step S203). The learning processing unit 152 inputs a plurality of pairs of command vectors and log vectors to the machine learning model M1 in order (step S204).

[0086] The learning processing unit 152 calculates the difference between the output result of the machine learning model M1 and the label (step S205). The learning processing unit 152 updates the parameters of the machine learning model M1 so as to reduce the difference (step S206).

[0087] If the learning processing unit 152 determines to continue the process (Yes at step S207), the process proceeds to step S201. If the learning processing unit 152 determines not to continue the process (No at step S207), the process ends.

[0088] 11 is a flowchart showing the processing procedure of the inference phase. As shown in FIG. 11, the inference processing unit 153 of the information processing device 100 acquires an SQL command from the input unit 120 (step S301). The inference processing unit 153 acquires an execution log from the DBMS 200 via the communication unit 110 (step S302).

[0089] The inference processing unit 153 calculates a command vector of the SQL command based on the first vector dictionary 142a (step S303), and calculates a log vector of the execution log based on the second vector dictionary 142b (step S304).

[0090] The inference processing unit 153 inputs the pair of the command vector and the log vector to the machine learning model M1 (step S305). Based on the output result of the machine learning model M1, it determines whether a commit omission has occurred (step S306).

[0091] If no missed commit has occurred (No at step S307), the inference processing unit 153 proceeds to step S301.

[0092] If a missed commit occurs (Yes at step S307), the inference processing unit 153 outputs to the display unit 130 a message indicating that a missed commit has occurred, and causes the display unit 130 to display the message (step S308).

[0093] Next, the effects of the information processing device 100 according to this embodiment will be described. In the learning phase, the information processing device 100 executes machine learning of the machine learning model M1 based on training data in which SQL command sequences and execution logs are associated with labels indicating the presence or absence of missed commits. This makes it possible to generate the machine learning model M1 that can detect missed commits.

[0094] The information processing device 100 calculates a vector of an SQL command based on the first vector dictionary 142a, and calculates a log vector of an execution log based on the second vector dictionary 142b. The information processing device 100 inputs a pair of the vector of the SQL command and the log vector of the execution log into the machine learning model M1, and trains the machine learning model so that the difference between the output result of the machine learning model M1 and the label is small. This makes it possible to generate a machine learning model M1 that can detect missed commits using the vectors.

[0095] In the preprocessing phase, the information processing device 100 decomposes an SQL command into multiple morphemes and assigns a vector to each morpheme to generate a first vector dictionary 142a in which the multiple morphemes of the SQL command correspond to the vectors. The information processing device 100 also decomposes an execution log into multiple morphemes and assigns a vector to each morpheme to generate a second vector dictionary 142b in which the multiple morphemes of the execution log correspond to the vectors. This makes it possible to generate dictionaries for converting SQL commands and execution logs into vectors.

[0096] In the inference phase, the information processing device 100 inputs the command vector of the SQL command and the log vector of the execution log to the trained machine learning model M1 in real time, and infers missed commits based on the output results of the machine learning model M1, thereby making it possible to detect missed commits.

[0097] The above-described processing by the information processing device 100 is merely an example, and other processing may be performed. For example, when the execution log includes time-series numerical values, the information processing device 100 may create a Postscript program that draws line shapes corresponding to the time-series numerical values, and use vectors from each Postscript program as vectors corresponding to the numerical values ​​in the execution log. Other processing by the information processing device 100 will be described below.

[0098] When the execution log contains chronological numerical values, the information processing device 100 generates a line shape that indicates the relationship between time and the numerical value. In the example described in FIG. 3 , the information processing device 100 generates a line shape based on the numerical value corresponding to the attribute "access_count," with the horizontal axis representing time and the vertical axis representing the magnitude of the numerical value. Similarly, the information processing device generates a line shape based on the numerical values ​​corresponding to the attributes "access_users" and "access_view." The information processing device generates a Postscript program that draws the generated line shape. It is assumed that time information is associated with lines in the execution log where numerical values ​​are set.

[0099] 12 is a diagram illustrating an example of the relationship between line shapes and Postscript programs. For example, the Postscript program for line information 160-1, which consists of straight lines and curves, becomes Postscript program 160-2. Note that A, B, C, and D in the line information indicate connection points, and α and β indicate control points. The same applies to other line information.

[0100] The Postscript program for line information 161-1 consisting of one straight line is Postscript program 161-2, and the Postscript program for line information 162-1 consisting of two straight lines is Postscript program 162-2.

[0101] The Postscript program for line information 163-1 corresponding to a Bezier curve is Postscript program 163-2, and the Postscript program for line information 164-1 consisting of two curves (Bezier curves) is Postscript program 164-2.

[0102] In the preprocessing phase, if the execution log contains time-series numerical values, the preprocessing unit 151 of the information processing device 100 generates a Postscript program by the above process. The preprocessing unit 151 performs morphological analysis on the Postscript program to decompose it into multiple morphemes (tokens). After decomposing the Postscript program into multiple tokens, the information processing device 100 arranges each token in order. The information processing device 100 applies a CBoW or skip-gram algorithm to each of the arranged tokens, treats each token as a word, and calculates a vector for each token. The preprocessing unit 151 registers the relationship between the tokens of the Postscript program and the vectors in the second vector dictionary 142b.

[0103] The pre-processing unit 151 assigns vectors to tokens in the execution log and registers them in the second vector dictionary by performing the processing described in Figure 2 for the information contained in the execution log other than the part containing time-series numerical values.

[0104] In the learning phase, if the execution log contains time-series numerical values, the learning processing unit 152 of the information processing device 100 generates a Postscript program in the same manner as the preprocessing unit 151. The preprocessing unit 151 performs morphological analysis on the Postscript program to break it down into tokens. The learning processing unit 152 identifies vectors for each token of the Postscript program based on the tokens of the Postscript program and the second vector dictionary 142b, and calculates the vectors of the Postscript program by integrating the vectors of each identified token.

[0105] The learning processing unit 152 accumulates the vectors of each token in the execution log by executing the process described in Fig. 4 for the information included in the execution log other than the portion including time-series numerical values. The learning processing unit 152 calculates the log vector of the execution log by adding the vector of the Postscript program to the accumulated vector.

[0106] When the execution log contains time-series numerical values, the information processing device 100 generates a Postscript program that draws the line shape indicated by the time-series numerical values, calculates the vector of the Postscript program, and uses it to calculate the log vector of the execution log. This makes it possible to generate an execution log vector that includes the line shape indicated by the time-series numerical values ​​of the execution log as a feature.

[0107] Next, an example of the hardware configuration of a computer that realizes the same functions as the information processing device 100 described in the above embodiment will be described. Fig. 13 is a diagram showing an example of the hardware configuration of a computer that realizes the same functions as the information processing device of the embodiment.

[0108] 13, computer 300 has a CPU 301 that executes various types of arithmetic processing, an input device 302 that accepts data input from a user, and a display 303. Computer 300 also has a communication device 304 that exchanges data with external devices via a wired or wireless network, and an interface device 305. Computer 300 also has a RAM 306 that temporarily stores various types of information, and a hard disk drive 307. Each of devices 301 to 307 is connected to a bus 308.

[0109] The hard disk drive 307 stores a pre-processing program 307 a, a learning processing program 307 b, and an inference processing program 307 c. The CPU 301 reads out each of the programs 307 a to 307 c and loads them into the RAM 306.

[0110] The pre-processing program 307a functions as the pre-processing process 306a, the learning processing program 307b functions as the learning processing process 306b, and the inference processing program 307c functions as the inference processing process 306c.

[0111] The pre-processing process 306a corresponds to the process by the pre-processing unit 151. The learning process 306b corresponds to the process by the learning processing unit 152. The inference process 306c corresponds to the process by the inference processing unit 153.

[0112] It should be noted that each of the programs 307a to 307c does not necessarily have to be stored in the hard disk drive 307 from the beginning. For example, each program may be stored in a "portable physical medium" such as a flexible disk (FD), CD-ROM, DVD, magneto-optical disk, or IC card that is inserted into the computer 300. Then, the computer 300 may read and execute each of the programs 307a to 307c.

[0113] REFERENCE SIGNS LIST 100 Information processing device 110 Communication unit 120 Input unit 130 Display unit 140 Storage unit 141 Corpus 142a First vector dictionary 142b Second vector dictionary 143 Teacher data table 150 Control unit 151 Preprocessing unit 152 Learning processing unit 153 Inference processing unit

Claims

1. A learning program that causes a computer to execute a process of acquiring training data in which input data having a plurality of instructions executed in sequence and an execution log obtained by executing the plurality of instructions is associated with a label indicating whether the plurality of instructions is appropriate, and executing machine learning of a machine learning model based on the training data.

2. The learning program described in claim 1, characterized in that the acquisition process acquires the teacher data in which input data having a plurality of SQL (Structured Query Language) commands executed in sequence and the execution log obtained by inputting the plurality of SQL commands into a database management system corresponds to the label indicating whether or not a commit command is included in an appropriate position in the plurality of SQL commands.

3. The learning program of claim 2, further comprising a process of causing a computer to execute a process of calculating vectors of the SQL command and the execution log contained in the input data, and the process of executing the machine learning comprises inputting the vectors of the SQL command and the execution log into the machine learning model, and executing machine learning of the machine learning model based on the output results output from the machine learning model and the labels.

4. The learning program of claim 3, further comprising a process of causing the computer to execute the steps of: decomposing the SQL command into a plurality of morphemes and assigning a vector to each morpheme to generate a first dictionary in which the plurality of morphemes of the SQL command correspond to vectors; and decomposing the execution log into a plurality of morphemes and assigning a vector to each morpheme to generate a second dictionary in which the plurality of morphemes of the execution log correspond to vectors; and the process of calculating the vectors comprises the steps of: calculating vectors for the SQL command and the execution log using the first dictionary and the second dictionary.

5. An inference program that causes a computer to execute a process of acquiring a certain command and an execution log obtained by executing the certain command, and inputting information about the certain command and information about the execution log obtained by executing the certain command into a machine learning model that has been subjected to machine learning based on training data in which input data having a plurality of commands executed in sequence and the execution logs obtained by executing the plurality of commands are associated with labels indicating whether the plurality of commands are appropriate, thereby inferring whether a specific command has been omitted from being input before the certain command.

6. The inference program described in claim 5, characterized in that the acquiring process acquires a SQL (Structured Query Language) command and the execution log obtained by inputting the SQL command into a database management system, and the inferring process inputs a vector of the SQL command and a vector of the execution log into the machine learning model, and infers whether or not a commit has been missed based on the output results output from the machine learning model.

7. A learning method characterized in that a computer executes a process of acquiring training data in which input data having a plurality of instructions executed in sequence and an execution log obtained by executing the plurality of instructions is associated with a label indicating whether the plurality of instructions is appropriate, and executing machine learning of a machine learning model based on the training data.

8. The learning method according to claim 7, characterized in that the acquiring process acquires the teacher data in which input data having a plurality of SQL (Structured Query Language) commands executed in sequence and the execution log obtained by inputting the plurality of SQL commands into a database management system is associated with the label indicating whether or not a commit command is included in an appropriate position in the plurality of SQL commands.

9. The learning method described in claim 8, further comprising a process in which the computer executes a process of calculating vectors of the SQL command and the execution log contained in the input data, and the process of executing the machine learning includes inputting the vectors of the SQL command and the execution log into the machine learning model, and executing machine learning of the machine learning model based on the output results output from the machine learning model and the labels.

10. The learning method described in claim 9, further comprising the steps of: decomposing the SQL command into a plurality of morphemes and assigning a vector to each morpheme to generate a first dictionary in which the plurality of morphemes of the SQL command correspond to vectors; and decomposing the execution log into a plurality of morphemes and assigning a vector to each morpheme to generate a second dictionary in which the plurality of morphemes of the execution log correspond to vectors; and the process of calculating the vectors includes calculating vectors for the SQL command and the execution log using the first dictionary and the second dictionary.

11. An inference method characterized by comprising the steps of: acquiring a certain command and an execution log obtained by executing the certain command; and inputting information about the certain command and information about the execution log obtained by executing the certain command into a machine learning model that has been subjected to machine learning based on training data in which input data has a plurality of commands executed in sequence and the execution logs obtained by executing the plurality of commands, and labels indicating whether the plurality of commands are appropriate or not, thereby inferring whether a specific command has been omitted from being input before the certain command.

12. The inference method described in claim 11, characterized in that the acquiring process acquires a SQL (Structured Query Language) command and the execution log obtained by inputting the SQL command into a database management system, and the inferring process inputs a vector of the SQL command and a vector of the execution log into the machine learning model, and infers whether or not a commit has occurred based on the output results output from the machine learning model.

13. An information processing device having a control unit that executes a process of acquiring training data in which input data having a plurality of instructions executed in sequence and an execution log obtained by executing the plurality of instructions is associated with a label indicating whether the plurality of instructions is appropriate, and executing machine learning of a machine learning model based on the training data.

14. The information processing device according to claim 13, characterized in that the acquiring process acquires the teacher data in which input data having a plurality of SQL (Structured Query Language) commands executed in sequence and the execution log obtained by inputting the plurality of SQL commands into a database management system is associated with the label indicating whether or not a commit command is included in an appropriate position in the plurality of SQL commands.

15. The information processing device described in claim 14, characterized in that the control unit further executes a process of calculating vectors of the SQL command and the execution log contained in the input data, and the process of executing the machine learning includes inputting the vectors of the SQL command and the execution log into the machine learning model, and executing machine learning of the machine learning model based on the output results output from the machine learning model and the labels.

16. The information processing device described in claim 15, characterized in that the control unit further executes a process of generating a first dictionary in which the multiple morphemes of the SQL command correspond to vectors by decomposing the SQL command into a plurality of morphemes and assigning a vector to each morpheme, and a process of generating a second dictionary in which the multiple morphemes of the execution log correspond to vectors by decomposing the execution log into a plurality of morphemes and assigning a vector to each morpheme, and the process of calculating the vectors calculates vectors of the SQL command and the execution log using the first dictionary and the second dictionary.

17. An information processing device having a control unit that executes a process of acquiring a certain command and an execution log obtained by executing the certain command, and inputting information about the certain command and information about the execution log obtained by executing the certain command into a machine learning model that has been subjected to machine learning based on training data in which input data has multiple commands executed in sequence and the execution logs obtained by executing the multiple commands, and labels indicating whether the multiple commands are appropriate or not are associated with each other, thereby inferring whether a specific command has been omitted before the certain command.

18. The information processing device according to claim 17, characterized in that the acquisition process acquires a certain SQL (Structured Query Language) command and the execution log obtained by inputting the certain SQL command into a database management system, and the inference process inputs a vector of the certain SQL command and a vector of the execution log into the machine learning model, and infers whether or not a missed commit has occurred based on the output results output from the machine learning model.

Citation Information

Patent Citations

  • Control processing device, control processing method, and control processing program

    JP2020204975A

  • Information processing program, information processing method, and information processing apparatus

    JP2021015421A

  • Threat Detection Using Machine Learning Query Analysis

    US20200410091A1