The application provides a
network security Text-to-KQL query generation method and
system based on pattern screening and semantic
verification and a storage medium, and the method comprises the following steps: S1,
data input and task definition; receiving a user
natural language query Q and a whole
database pattern S, wherein Q is a user
natural language retrieval / analysis intention, and S represents a set of all tables and fields in the
system; S2, pattern optimization based on a
hybrid attention model; S3, candidate KQL generation based on few-shot
adaptation; and S4, KQL
verification and selection based on execution signature and reasoning. The application has the beneficial effects that the application solves the problem of how to accurately and efficiently convert a
natural language into a KQL
query statement, reduces the technical threshold of a
security analyst in a
data query process, improves the efficiency of
data query and analysis, and enhances the ability and response speed of
network security protection.