Operational statement detection method and device, equipment, medium and product
By using detection models and large language models in the database to analyze and summarize the operation statements and identify abnormal behaviors, the problem of database operation statement detection in the existing technology is solved and database security is improved.
Patent Information
- Application Number
- CN202410844006.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-11-26
AI Technical Summary
The prior art is difficult to effectively detect abnormal behavior of database operation statements, which makes it difficult to ensure database security.
By obtaining the operation statement text of the database, using a preset detection model for point exception detection and context exception detection, and combining a large language model to analyze and summarize the operation statements to detect whether the target summary text is included, thereby identifying the abnormal behavior of the database.
It improves the accuracy and efficiency of abnormal behavior detection of database operation statements and enhances the ability to protect database data.
Smart Images

Figure CN119026115A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and in particular, relates to an operation statement detection method, device, equipment, medium and product. Background Art
[0002] At present, database technology is developing rapidly. Databases are widely used in many fields because of their high efficiency in processing and managing various types of data. Therefore, the security issues of databases are becoming increasingly prominent. As more important data is stored in databases, attacks on databases are becoming more and more intense. Therefore, in order to protect databases from attacks, database abnormal behavior detection has become an important research topic.
[0003] The existing database anomaly detection methods mainly include detection based on database traffic, detection based on the syntax of structured query statements, and detection based on the statistical laws of data changes. However, the above different detection methods all focus on detecting the data stored in the database. At present, database anomalies are emerging in an endless stream, and detecting abnormal behavior of the database is still a difficult problem to be solved. Summary of the invention
[0004] The embodiments of the present application provide an operation statement detection method, apparatus, device, medium and product, which can detect abnormal behavior of operation statements of a database.
[0005] In a first aspect, an embodiment of the present application provides an operation statement detection method, comprising:
[0006] In case of receiving a detection task of an operation statement input by a user, obtaining an operation statement text from a database, where the operation statement text includes a plurality of operation statements;
[0007] In response to the user's target operation, a preset detection model is used to detect whether the operation statement text includes a target summary text to obtain a detection result, where the target operation is an operation set by the user to perform at least one of point anomaly detection and context anomaly detection on the operation statement text, and the target summary text is a text determined based on a sample operation statement text, and the target summary text includes at least one sample parsed sentence obtained based on the sample operation statement parsing.
[0008] In a second aspect, an embodiment of the present application provides an operation statement detection device, including:
[0009] An acquisition module, used for acquiring an operation statement text from a database when receiving a detection task of an operation statement input by a user, wherein the operation statement text includes a plurality of operation statements;
[0010] The detection module is used to respond to the user's target operation, use a preset detection model to detect whether the operation statement text includes a target summary text, and obtain a detection result. The target operation is an operation set by the user to perform at least one of point anomaly detection and context anomaly detection on the operation statement text. The target summary text is a text determined based on a sample operation statement text, and the target summary text includes at least one sample parsed sentence obtained based on the sample operation statement parsing.
[0011] In a third aspect, an embodiment of the present application provides an electronic device, the device comprising:
[0012] a processor and a memory storing computer program instructions;
[0013] When the processor executes computer program instructions, it is used to execute the operation statement detection method of the first aspect mentioned above.
[0014] In a fourth aspect, an embodiment of the present application provides a computer storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the operation statement detection method of the first aspect described above is implemented.
[0015] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when processed by a processor, implements the operation statement detection method of the first aspect above.
[0016] The operation statement detection method, device, equipment, medium and product provided in the embodiments of the present application obtain the operation statement text of the database when receiving the detection task of the operation statement input by the user, respond to the user's target operation, and use a preset detection model to detect whether the summary text includes the target summary text to obtain the detection result. It can detect point anomalies or context anomalies of the summary text, and realize detection of abnormal behavior of the database based on the operation statements of the database. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0018] Figure 1 A flowchart of an operation statement detection method provided for some embodiments of the present application.
[0019] Figure 2 A flowchart of another operation statement detection method provided for some embodiments of the present application.
[0020] Figure 3A flowchart of another operation statement detection method provided for some embodiments of the present application.
[0021] Figure 4 A flowchart of an operation statement detection system provided for some embodiments of the present application.
[0022] Figure 5 A schematic diagram of an operation statement detection device provided in some embodiments of the present application.
[0023] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0025] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0026] Before describing the technical solutions provided by the embodiments of the present application, in order to facilitate the understanding of the embodiments of the present application, the present application first specifically describes the problems existing in the related art:
[0027] Currently, database technology is developing rapidly and has been widely used in many fields. With its rapid development, database security issues are becoming increasingly prominent, and attacks around databases are becoming more and more intense. Therefore, in order to protect databases from attacks, database abnormal behavior detection has become an important research topic.
[0028] Based on this, the embodiments of the present application provide an operation statement detection method, device, equipment, medium and product, which detect abnormal behavior of a database based on operation statements of the database, thereby protecting the data in the database.
[0029] like Figure 1 As shown, the embodiment of the present application provides an operation statement detection method, including:
[0030] S110: When receiving a detection task of an operation statement input by a user, obtaining an operation statement text from a database, where the operation statement text includes a plurality of operation statements.
[0031] When an operation statement detection task input by the user is received, the operation statement text of the database can be obtained. The operation statement text is a text obtained based on the operation log of the database. The operation statement text may include multiple operation statements. The operation statement is a statement for performing a target operation on the data in the database. For example, the operation statement may be a structured query language (SQL). The target operation may include performing operations such as storage, insertion, and deletion on the data in the database based on SQL statements.
[0032] S120: In response to the user's target operation, a preset detection model is used to detect whether the operation statement text includes a target summary text, and a detection result is obtained, where the target operation is an operation set by the user to perform at least one of point anomaly detection and context anomaly detection on the operation statement text, and the target summary text is a text determined based on a sample operation statement text, and the target summary text includes at least one sample parsed sentence obtained based on the sample operation statement parsing.
[0033] In response to the user's target operation, a preset detection model can be used to detect whether the operation statement includes the target summary text to obtain a detection result. Here, the target summary text is a text determined based on the sample operation statement text. The detection model can be used to detect whether the operation statement text includes the target summary text to obtain a detection result. The target operation is an operation set by the user to perform at least one of point anomaly detection and context anomaly detection on the operation statement text.
[0034] Point anomaly detection can detect individual statements that are different from other operation statements. For example, a delete statement may be considered a point anomaly.
[0035] Contextual anomaly detection can detect abnormal operation statements in a specific environment. For example, multiple query statements in parallel may be regarded as contextual anomalies.
[0036] In some examples, the detection model outputs a first result when it detects that the operation statement text includes the target summary text; the detection model outputs a second result when it detects that the operation statement text does not include the target summary text. Here, the first result may represent a detection result in which no abnormality occurs in the operation statement, and the second result may represent a detection result in which an abnormality occurs in the operation statement.
[0037] In some examples, after obtaining the detection results, the detection results can be sent to the user device so that the user can determine the type of abnormality that may occur in the database based on the detection results. Here, the abnormality type of the database can be determined based on querying the database abnormal behavior table. The database abnormal behavior table is shown in Table 1 below.
[0038]
[0039] Table 1
[0040] The embodiment of the present application, when receiving a detection task of an operation statement input by a user, obtains the operation statement text of the database, responds to the user's target operation, and uses a preset detection model to detect whether the summary text includes the target summary text to obtain a detection result, thereby realizing the detection of the operation statement of the database to detect whether there is a point anomaly or a context anomaly in the database, and at the same time, based on the detection model, it can improve the accuracy and efficiency of detecting abnormal behavior of the database.
[0041] In some embodiments, in order to further improve the accuracy of detecting abnormal behavior of the database, Figure 2 As shown, in response to the user's target operation, a preset detection model is used to detect whether the operation statement text includes the target summary text. Before obtaining the detection result, the method also includes:
[0042] S210: Parse multiple operation statements based on the parsing algorithm included in the preset parsing model to determine the parsing text, where the parsing text includes multiple parsing statements. The parsing statement is the parsing result obtained by the parsing algorithm parsing the operation statement, and one parsing statement corresponds to one operation statement.
[0043] Each operation statement can be parsed based on the parsing algorithm included in the preset parsing model to obtain the parsing statement corresponding to each operation statement, and the parsing text can be determined based on multiple parsing statements. Here, the parsing algorithm can be an algorithm that converts each operation statement into a preset format.
[0044] In response to the user's target operation, a preset detection model is used to detect whether the operation statement text includes the target summary text, and the detection results are obtained, including:
[0045] S220: Input the parsed text into a preset extraction model to determine a summary text, where the summary text includes at least one parsed sentence.
[0046] The parsed text may be input into a preset extraction model to determine the summary text. The extraction model may extract at least one parsed sentence from the parsed text. The parsed sentence is input into a preset summary text template to obtain the summary text.
[0047] In some examples, the parsed statements included in the summary text may be statements that characterize the operation statements as operations performed on data in the database.
[0048] S230: In response to the user's target operation, a preset detection model is used to detect whether the summary text includes the target summary text, and a detection result is obtained.
[0049] It can respond to the user's target operation, such as the execution point anomaly detection or context anomaly detection operation input by the user, and use the preset detection model to detect whether the summary text includes the target summary text to obtain the detection result.
[0050] The embodiment of the present application parses the operation statement through the parsing algorithm included in the parsing model to obtain a parsed text including multiple parsed statements, determines the summary text based on the parsed text, and detects whether the summary text includes the target summary text, thereby improving the accuracy of detecting abnormal behavior of operation statements in the database.
[0051] In some embodiments, the above-mentioned parsing model, extraction model and detection model may be models constructed based on a large language model (LLM). It is conceivable that the method of detecting abnormal behavior of operation statements in a database based on a large language model can further improve the accuracy of abnormal behavior detection.
[0052] The prior art relies on parsing of operation statements for database anomaly detection, but the prior art method of parsing operation statements based on a parser has the problem of low parsing accuracy. Based on this, an embodiment of the present application provides a method for parsing operation statements to improve the accuracy of parsing operation statements, thereby improving the accuracy of detecting abnormal behavior of operation statements in the database.
[0053] In some embodiments, the operation statement includes a first character and a second character, the first character is a character for performing an operation on the data in the database, and the second character is a character for representing the data in the database;
[0054] Parsing multiple operation statements based on the parsing algorithm included in the preset parsing model to determine the parsed text, including:
[0055] The second character in each operation statement is replaced with a preset placeholder to obtain a parsed statement corresponding to each operation statement, and a parsed text is determined based on the parsed statement.
[0056] Here, the operation statement includes a first character and a second character. The first character is a character for performing an operation on the data in the database, and the second character is a character for representing the data in the database. For example, when the operation statement is "SELECT P1FROM TABLE WHERE cat=1AND stock>30", "1" and "30" are the second characters, and the remaining characters are the first characters. The second character can be replaced by a placeholder to obtain a parsing statement corresponding to each operation statement. For example, the placeholder "$" is used to replace "1" and "30", and the obtained parsing statement is "SELECT P1 FROM TABLE WHERE cat=$AND stock>$". Based on the above multiple parsing statements, a parsing text can be constructed.
[0057] The embodiment of the present application replaces the second character included in the operation statement with a placeholder to obtain the parsed statement corresponding to each operation statement, determines the method of parsing the text based on the parsing model, and realizes the standardized processing of each operation statement in a preset format, thereby overcoming the problem of parsing the operation statement in the prior art.
[0058] In some embodiments, the parsed text is input into a preset extraction model to determine the summary text, including:
[0059] Each parsed sentence in the parsed text is compared with a preset template sentence to determine a plurality of target parsed sentences including the template sentence, and a target parsed text is determined based on the plurality of target parsed sentences; the target parsed text is input into a preset extraction model to determine a summary text.
[0060] Each parsed statement in the parsed text can be compared with a preset template statement. Here, the template statement is a parsed statement corresponding to a template operation statement, and the template operation statement is a statement characterized as an operation behavior performed on the data in the database. Multiple template parsed statements including the template statement can be determined, and a target parsed text can be determined based on multiple target parsed statements. The target parsed text is input into an extraction model to determine a summary text.
[0061] The embodiment of the present application screens the parsed sentences in the parsed text to determine the target parsed text including multiple target parsed sentences, and can screen out the sentences that perform operations on the data in the database. By inputting the target parsed text into the extraction model to obtain the summary text, it is beneficial to improve the accuracy of detecting abnormal behavior of database operation statements based on the summary text.
[0062] Since the parsed text includes a large number of parsed sentences, the process of extracting the summary of the parsed text using a one-time data extraction model may take a long time. The parsed text can be split and input into the extraction model separately to determine the summary text.
[0063] In some embodiments, Figure 3 As shown, the target parsed text is input into the preset extraction model to determine the summary text, including:
[0064] The target parsed text is split to obtain a first sub-parsed text and a second sub-parsed text; the second sub-parsed text includes at least one parsed text; the first sub-parsed text is input into an extraction model to determine a first sub-summary text; the first sub-summary text and the second sub-parsed text are input into an extraction model to determine a summary text.
[0065] The target parsed text can be split to obtain a first sub-parsed text and a second sub-parsed text, wherein the second sub-parsed text includes at least one parsed text. The first sub-parsed text can be input into an extraction module to determine a first sub-summary text, the first sub-summary text and sub-text 1 in the second sub-parsed text can be input into an extraction model to determine sub-summary text 1, sub-summary text 1 and sub-text 2 in the second sub-parsed text can be input into an extraction model to determine sub-summary text 2... and so on to obtain a summary text.
[0066] The embodiment of the present application splits the parsed text to obtain a first sub-parsed text and a second sub-parsed text, and obtains a summary text by inputting a first sub-summary text obtained from the first sub-parsed text and the second sub-parsed text into an extraction model. This method can improve the efficiency of determining the summary text, while enabling the summary text obtained based on the above-mentioned iterative method to be combined with context memory to output a continuous text including the parsed statements corresponding to the operation statements. Detecting the operation statements based on the above-mentioned summary text can improve the accuracy of detecting abnormal behavior of database operation statements.
[0067] In some embodiments, before inputting the parsed text into a preset extraction model and determining the summary text, the operation statement detection method further includes:
[0068] A sample parsed text is obtained, the sample parsed text includes a plurality of second parsed sentences, the second parsed sentences are sentences obtained by parsing the sample operation sentences based on the parsing model; the sample parsed text includes a third sub-parsed text and a plurality of fourth sub-parsed texts; the third sub-parsed text is input into the extraction model to determine the second sub-summary text; the second sub-summary text and the plurality of fourth sub-parsed texts are input into the extraction model to determine the target summary text.
[0069] A sample parsed text can be obtained, the sample parsed text is a text including a plurality of second parsed sentences obtained by parsing based on the sample operation sentence, and similarly, based on the same iterative method as the above-mentioned determination of the summary text, the third sub-parsed text can be input into the extraction model to determine the second sub-summary text; the second sub-summary text and a plurality of fourth sub-parsed texts can be input into the extraction model to determine the target summary text, so that the detection result determined based on the summary text and the target summary text has a higher credibility.
[0070] In some embodiments, to improve the accuracy of the parsing model, multiple operation statements are parsed based on a parsing algorithm included in a preset parsing model. Before determining the parsed text, the operation statement detection method further includes:
[0071] A first training sample is obtained, the first training sample includes multiple first operation statements and first parsing statements, and one first operation statement corresponds to one first parsing statement; the first operation statement is input into a sample parsing model to obtain a reference parsing statement; based on the deviation between the first parsing statement and the reference parsing statement, the sample parsing model is trained until a preset training condition is met to obtain a parsing model.
[0072] A first training sample can be obtained, and a first operation statement included in the first training sample can be input into a sample parsing model. The sample parsing model can be trained based on the deviation between a first parsing statement corresponding to the first operation statement and a reference parsing statement until the loss function is less than a preset threshold, thereby obtaining a parsing model.
[0073] The embodiment of the present application obtains a first training sample and trains a sample parsing model based on a first operation statement and a first parsing statement corresponding to the first operation statement, thereby improving the accuracy of determining the parsing statement based on the parsing model.
[0074] In some embodiments, before obtaining the operation statement text from the database, the operation statement detection method further includes:
[0075] In the case of a detection task of receiving an operation statement input by a user, an operation behavior log of a database is obtained, the operation behavior log includes multiple initial operation statements; the multiple initial operation statements are converted into a preset text format to obtain multiple operation statements, and the operation statement text is determined based on the multiple operation statements.
[0076] In the case of a detection task of receiving an operation statement input by a user, an operation behavior log of the database is obtained. The operation behavior log includes multiple initial operation statements. The initial operation statement can be converted into a preset text format, such as a Json text format, to obtain an operation statement, and the operation statement text is determined based on multiple operation statements.
[0077] The embodiment of the present application obtains the operation behavior log of the database when receiving the detection task of the operation statement input by the user, and obtains the operation statement text by converting the initial statement included in the log into a preset text format, which facilitates the subsequent detection of the operation statement in the operation statement text.
[0078] In some embodiments, Figure 4 As shown, the embodiment of the present application provides an operation statement detection system, including an interface layer 401, a business logic layer 402 and a data support layer 403;
[0079] The interface layer 401 includes a plurality of application program interfaces (APIs), the business logic layer includes a detection model, and the data support layer includes a database;
[0080] The interface layer 401 is used to obtain the operation behavior log of the database through the API interface when receiving the detection task of the operation statement input by the user, and send the operation behavior log to the LLM model included in the business logic layer; the operation behavior log includes multiple initial operation statements;
[0081] The business logic layer 402 is used to detect the operation behavior log through the LLM model when receiving the operation behavior log; the operation behavior log includes multiple initial operation statements to obtain the detection result;
[0082] The data support layer 403 is used to store data and operation behavior logs through a database.
[0083] In some embodiments, the LLM model may include a parsing model, an extraction model, and a detection model;
[0084] The parsing model is used to decompose the detection task input by the user into multiple subtasks, and solve each subtask separately, including pre-processing and parsing the initial operation statement included in the operation behavior log, converting it into a parsing statement in a preset format, and generating a parsing file based on the parsing statement;
[0085] An extraction model is used to determine a summary text based on the parsed file, specifically to generate the summary text based on an iterative method;
[0086] The detection model is used to detect the parsed sentence corresponding to the operation sentence based on the summary text and the target summary text to obtain the detection result.
[0087] The embodiment of the present application sets up an operation statement detection system and obtains operation behavior logs based on an API interface, thereby improving the efficiency of obtaining operation behavior logs, detecting operation statements through an LLM model to obtain detection results, and utilizing the powerful reasoning ability of the LLM model to improve the accuracy of the detection results.
[0088] Based on the same inventive concept, an embodiment of the present application also provides a compensation device for a display panel.
[0089] In some embodiments, Figure 5 As shown, an embodiment of the present application provides a detection device for an operation statement, including:
[0090] An acquisition module 501 is used to acquire an operation statement text from a database when receiving a detection task of an operation statement input by a user, wherein the operation statement text includes a plurality of operation statements;
[0091] The detection module 502 is used to respond to the user's target operation, use a preset detection model to detect whether the operation statement text includes a target summary text, and obtain a detection result. The target operation is an operation set by the user to perform at least one of point anomaly detection and context anomaly detection on the operation statement text. The target summary text is a text determined based on a sample operation statement text, and the target summary text includes at least one sample parsed sentence obtained based on the sample operation statement parsing.
[0092] In some embodiments, the detection module may be specifically used to:
[0093] Based on the parsing algorithm included in the preset parsing model, multiple operation statements are parsed to determine the parsed text, the parsed text includes multiple parsed statements, the parsed statement is the parsing result obtained by the parsing algorithm parsing the operation statement, and one parsed statement corresponds to one operation statement;
[0094] Inputting the parsed text into a preset extraction model to determine a summary text, wherein the summary text includes at least one parsed sentence;
[0095] In response to the user's target operation, a preset detection model is used to detect whether the summary text includes the target summary text to obtain a detection result.
[0096] In some embodiments, the operation statement includes a first character and a second character, the first character is a character for performing an operation on the data in the database, and the second character is a character for representing the data in the database;
[0097] The detection module can be used for:
[0098] The second character in each operation statement is replaced with a preset placeholder to obtain a parsed statement corresponding to each operation statement, and a parsed text is determined based on the parsed statement.
[0099] In some embodiments, the detection module may be specifically used to:
[0100] Compare each parsed sentence in the parsed text with a preset template sentence, determine a plurality of target parsed sentences including the template sentence, and determine a target parsed text based on the plurality of target parsed sentences;
[0101] Input the target parsed text into the preset extraction model to determine the summary text.
[0102] In some embodiments, the detection module may be specifically used to:
[0103] Splitting the target parsed text to obtain a first sub-parsed text and a second sub-parsed text; the second sub-parsed text includes at least one parsed text;
[0104] Inputting the first sub-parsed text into the extraction model to determine the first sub-summary text;
[0105] The first sub-summary text and the second sub-parsed text are input into the extraction model to determine the summary text.
[0106] In some embodiments, the acquisition module may also be used to:
[0107] Acquire a first training sample, the first training sample comprising a plurality of first operation statements and first parsing statements, one first operation statement corresponds to one first parsing statement;
[0108] Inputting the first operation statement into the sample parsing model to obtain a reference parsing statement;
[0109] Based on the deviation between the first parsing statement and the reference parsing statement, the sample parsing model is trained until a preset training condition is met to obtain a parsing model.
[0110] In some embodiments, the acquisition module may also be used to:
[0111] Acquire a sample parsed text, the sample parsed text includes a plurality of second parsed sentences, the second parsed sentences are sentences obtained by parsing the sample operation sentences based on the parsing model; the sample parsed text includes a third sub-parsed text and a plurality of fourth sub-parsed texts;
[0112] Inputting the third sub-parsed text into the extraction model to determine the second sub-summary text;
[0113] The second sub-summary text and the plurality of fourth sub-parsed texts are input into the extraction model to determine the target summary text.
[0114] In some embodiments, the acquisition module may also be used to:
[0115] In case of receiving a detection task of an operation statement input by a user, obtaining an operation behavior log of a database, the operation behavior log including a plurality of initial operation statements;
[0116] The multiple initial operation statements are converted into a preset text format to obtain multiple operation statements, and the operation statement text is determined based on the multiple operation statements.
[0117] The device of the above embodiment is used to implement the corresponding operation statement detection method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0118] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an application embodiment.
[0119] The electronic device 600 may include a processor 601 and a memory 602 storing computer program instructions.
[0120] Specifically, the processor 601 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0121] The memory 602 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 602 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 602 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 602 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 602 is a non-volatile solid-state memory.
[0122] In certain embodiments, memory 602 includes a read-only memory (ROM). The ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of the above, where appropriate.
[0123] The memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to the first aspect of the present application.
[0124] The processor 601 implements any one of the operation statement detection methods in the above embodiments by reading and executing computer program instructions stored in the memory 602 .
[0125] In one example, the electronic device may further include a communication interface 603 and a bus 604. Figure 6 The processor 601, the memory 602, and the communication interface 603 are connected via a bus 604 and communicate with each other.
[0126] The communication interface 603 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0127] Bus 604 includes hardware, software or both, and the parts of online data flow billing equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-end bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 604 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.
[0128] The electronic device of the above embodiment is used to implement the corresponding operation statement detection method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0129] In addition, in combination with the operation statement detection method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the operation statement detection methods in the above embodiment is implemented.
[0130] In addition, in combination with the operation statement detection method in the above embodiment, the embodiment of the present application can provide a computer program product to implement. When the computer program product instructions are executed by a processor of an electronic device, any one of the operation statement detection methods in the above embodiment is implemented.
[0131] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.
[0132] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0133] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or devices based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0134] The above reference is according to the method of the embodiment of the present application, the flow chart of the device (device) and the computer program product and / or the block diagram described various aspects of the present application.It should be understood that each square box in the flow chart and / or the block diagram and the combination of each square box in the flow chart and / or the block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the realization of the function / action specified in one or more square boxes of the flow chart and / or the block diagram.Such a processor can be but is not limited to a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit.It can also be understood that each square box in the block diagram and / or the flow chart and the combination of the square boxes in the block diagram and / or the flow chart can also be realized by the dedicated hardware that performs the specified function or action, or can be realized by the combination of dedicated hardware and computer instructions.
[0135] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the above-described devices, modules and units can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application.
Claims
1. A method for detecting an operation statement, characterized in that: include: In case of receiving a detection task of an operation statement input by a user, obtaining an operation statement text from a database, wherein the operation statement text includes a plurality of operation statements; In response to the user's target operation, a preset detection model is used to detect whether the operation statement text includes a target summary text to obtain a detection result, wherein the target operation is an operation set by the user to perform at least one of point anomaly detection and context anomaly detection on the operation statement text, and the target summary text is a text determined based on a sample operation statement text, and the target summary text includes at least one sample parsed sentence obtained based on the parsing of the sample operation statement.
2. The operation statement detection method according to claim 1, characterized in that: In response to the user's target operation, the method further includes: using a preset detection model to detect whether the operation statement text includes the target summary text, and obtaining the detection result before obtaining the detection result. Parsing the multiple operation statements based on the parsing algorithm included in the preset parsing model to determine a parsed text, wherein the parsed text includes multiple parsed statements, and the parsed statements are parsed results obtained by the parsing algorithm parsing the operation statements, and one parsed statement corresponds to one operation statement; The responding user's target operation uses a preset detection model to detect whether the operation statement text includes the target summary text, and obtains a detection result, including: Inputting the parsed text into a preset extraction model to determine a summary text, wherein the summary text includes at least one parsed sentence; In response to the user's target operation, a preset detection model is used to detect whether the summary text includes the target summary text to obtain a detection result.
3. The operation statement detection method according to claim 2, characterized in that: The operation statement includes a first character and a second character, the first character is a character for performing an operation on the data in the database, and the second character is a character for representing the data in the database; The parsing algorithm included in the preset parsing model parses the multiple operation statements to determine the parsed text, including: The second character in each operation statement is replaced with a preset placeholder to obtain the parsed statement corresponding to each operation statement, and the parsed text is determined based on the parsed statement.
4. The operation statement detection method according to claim 1, characterized in that: The step of inputting the parsed text into a preset extraction model to determine a summary text includes: Comparing each parsed sentence in the parsed text with a preset template sentence, determining a plurality of target parsed sentences including the template sentence, and determining a target parsed text based on the plurality of target parsed sentences; The target parsed text is input into a preset extraction model to determine the summary text.
5. The operation statement detection method according to claim 3, characterized in that: The step of inputting the target parsed text into a preset extraction model to determine the summary text includes: Splitting the target parsed text to obtain a first sub-parsed text and a second sub-parsed text; the second sub-parsed text includes at least one parsed text; Inputting the first sub-parsed text into the extraction model to determine a first sub-summary text; The first sub-summary text and the second sub-parsed text are input into the extraction model to determine the summary text.
6. The operation statement detection method according to claim 2, characterized in that: The parsing algorithm included in the preset parsing model parses the multiple operation statements, and before determining the parsed text, the operation statement detection method further includes: Acquire a first training sample, where the first training sample includes a plurality of first operation statements and first parsing statements, and one first operation statement corresponds to one first parsing statement; Inputting the first operation statement into a sample parsing model to obtain a reference parsing statement; Based on the deviation between the first parsing statement and the reference parsing statement, the sample parsing model is trained until a preset training condition is met to obtain the parsing model.
7. The operation statement detection method according to claim 2, characterized in that: Before inputting the parsed text into a preset extraction model to determine the summary text, the operation statement detection method further includes: Acquire a sample parsed text, the sample parsed text comprising a plurality of second parsed sentences, the second parsed sentences being sentences obtained by parsing the sample operation sentences based on the parsing model; the sample parsed text comprising a third sub-parsed text and a plurality of fourth sub-parsed texts; Inputting the third sub-parsed text into the extraction model to determine a second sub-summary text; The second sub-summary text and the plurality of fourth sub-parsed texts are input into the extraction model to determine the target summary text.
8. The operation statement detection method according to claim 1, characterized in that: Before obtaining the operation statement text from the database, the operation statement detection method further includes: In case of receiving a detection task of an operation statement input by a user, obtaining an operation behavior log of a database, wherein the operation behavior log includes a plurality of initial operation statements; The multiple initial operation statements are converted into a preset text format to obtain the multiple operation statements, and the operation statement texts are determined based on the multiple operation statements.
9. An operation statement detection device, characterized in that: include: An acquisition module, configured to acquire an operation statement text from a database when receiving a detection task of an operation statement input by a user, wherein the operation statement text includes a plurality of operation statements; The detection module is used to respond to the user's target operation, use a preset detection model to detect whether the operation statement text includes a target summary text, and obtain a detection result. The target operation is an operation set by the user to perform at least one of point anomaly detection and context anomaly detection on the operation statement text. The target summary text is a text determined based on a sample operation statement text, and the target summary text includes at least one sample parsed sentence obtained based on the sample operation statement parsing.
10. An electronic device, characterized in that: The device comprises: a processor, and a memory storing computer program instructions; The processor reads and executes the computer program instructions to implement the operation statement detection method according to any one of claims 1 to 8.
11. A readable storage medium, characterized in that: The readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the operation statement detection method according to any one of claims 1 to 8 is implemented.
12. A computer program product, comprising a computer program, characterized in that When the computer program is processed by a processor, the operation statement detection method according to any one of claims 1 to 8 is implemented.
