Data generation method, system, terminal device and computer readable storage medium

By converting SQL query language and natural language into data structure expressions, the database simulation data is generated, and the problem of simulation research cannot be carried out when real data is lacking in the database is solved, and efficient data generation and processing is achieved.

CN119759934APending Publication Date: 2025-04-04SHENZHEN CLOUD INTEGRAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411589362.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

When real data is lacking in the database, users' needs for database query, testing, analysis and training cannot be met, resulting in the inability to conduct simulation research.

Method used

By converting SQL query language and natural language into expressions of preset data structures, third data features are generated and simulated data of the database are generated based on these features.

Benefits of technology

In the absence of real data, the simulation data required by users can be generated automatically, which solves the problem of the lack of data that cannot be simulated research, lowers the threshold for data creation, and improves the efficiency of data processing and the ability to drive data decisions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759934A_ABST
    Figure CN119759934A_ABST
Patent Text Reader

Abstract

The present application is applicable to the field of data development technology, and provides a data generation method, system, terminal device and computer-readable storage medium, including: performing data query on a database according to a query language containing a first data feature; if the query result is empty, obtaining a natural language containing a second data feature of the required query data; wherein the query language does not belong to a natural language; generating a third data feature according to the first data feature contained in the query language and the second data feature contained in the natural language; generating simulation data of the database according to the third data feature. The above method can solve the problem that simulation research cannot be carried out due to lack of data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of data development technology, and in particular, relates to a data generation method, system, terminal device and computer-readable storage medium. Background Art

[0002] In today's data-driven era, data in the database is an important information support for business operations and management. Whether it is customer information, sales records or financial data, this information is the basis for business decision-making. However, for some fields, there may be no actual data or the actual data is insufficient to support training or research. As a result, when there is no real data in the database, it is impossible to meet the user's needs for database query, testing, analysis and training for simulation research. Summary of the invention

[0003] The embodiments of the present application provide a data generation method, system and computer-readable storage medium, which can solve the problem that simulation research cannot be performed due to lack of data.

[0004] In a first aspect, an embodiment of the present application provides a data generation method, comprising:

[0005] Performing a data query on a database according to a query language containing a first data feature;

[0006] If the query result is empty, obtaining a natural language containing a second data feature of the query data; wherein the query language is not a natural language;

[0007] generating a third data feature according to the first data feature contained in the query language and the second data feature contained in the natural language;

[0008] The simulation data of the database is generated according to the third data feature.

[0009] In the embodiment of the present application, when using SQL language to query the database, if no data is returned, natural language can be introduced to analyze the SQL language and natural language respectively, and the data characteristics of the two languages ​​are combined to generate the data that the user needs to query. In other words, when the database does not have the query required by the user, the simulation data required by the user is automatically generated according to the user's query language and natural language. The above method can solve the problem that simulation research cannot be carried out due to lack of data.

[0010] In a possible implementation manner of the first aspect, generating the third data feature according to the first data feature included in the query language and the second data feature included in the natural language includes:

[0011] Converting the query language into a first expression of a preset data structure; the first expression is used to characterize the first data feature;

[0012] Converting the natural language into a second expression with a preset data structure; the second expression is used to characterize the second data feature;

[0013] The third data feature is generated according to the first expression and the second expression.

[0014] In the embodiment of the present application, by converting query language and natural language into data structured expressions, data can be automatically processed and understood.

[0015] In a possible implementation manner of the first aspect, converting the query language into a first expression of a preset data structure includes:

[0016] extracting a first keyword in the query language;

[0017] Extracting information corresponding to the first keyword from the query language to obtain the first data feature;

[0018] A first expression of the preset data structure is generated according to the first keyword and the first data feature.

[0019] In an embodiment of the present application, by extracting keywords and information directly related thereto, unnecessary data processing can be reduced, and the accuracy and speed of queries can be improved. The generated first expression provides a basis for automated data processing, making subsequent data analysis and operations more direct and efficient.

[0020] In a possible implementation manner of the first aspect, converting the natural language into a second expression of a preset data structure includes:

[0021] Performing semantic analysis on the natural speech to obtain a second keyword contained in the natural language;

[0022] extracting information corresponding to the second keyword from the natural language to obtain the second data feature;

[0023] A second expression of the preset data structure is generated according to the second keyword and the second data feature.

[0024] In the embodiments of the present application, by performing semantic analysis on natural speech, the user's intentions and needs can be understood more accurately, thereby improving the service quality.

[0025] In a possible implementation manner of the first aspect, generating the third data feature according to the first expression and the second expression includes:

[0026] The data corresponding to the same field in the first expression and the second expression are associated to obtain the fourth data feature of each of the fields; wherein the third data feature includes the fourth data feature of each of the fields.

[0027] In the embodiments of the present application, by associating and extracting features from data in different expressions, the integration and availability of data can be improved, providing strong support for further processing and analysis of data. This not only improves the efficiency of data processing, but also enhances the ability of data-driven decision-making.

[0028] In a possible implementation manner of the first aspect, generating simulation data of the database according to the third data feature includes:

[0029] For each of the fields, simulation data conforming to the fourth data feature of the field is generated.

[0030] In a possible implementation manner of the first aspect, the first expression includes sorting information of the field;

[0031] The method further comprises:

[0032] Generate a data sequence according to the fourth feature data of each of the fields included in the third data feature;

[0033] The data sequence is sorted according to the sorting information in the first expression to obtain a data table of the simulation data.

[0034] In the embodiment of the present application, by sorting the simulation data and obtaining a sorted data table, the simulation results are made more accurate and reliable.

[0035] In a second aspect, an embodiment of the present application provides a data generation system, including a data query module, a data acquisition module and a data generation module;

[0036] The data query module is used to perform data query on the database according to the query language containing the first data feature;

[0037] The data acquisition module is used to acquire a natural language containing a second data feature of the query data; wherein the query language is not a natural language;

[0038] The data generation module is used to generate a third data feature according to the first data feature included in the query language and the second data feature included in the natural language;

[0039] The data generation module is also used to generate simulation data of the database according to the third data feature.

[0040] In a third aspect, an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the data generation method as described in any one of the first aspects above is implemented.

[0041] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the data generation method as described in any one of the above-mentioned first aspects is implemented.

[0042] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute the data generation method described in any one of the above-mentioned first aspects.

[0043] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0045] Figure 1 It is a flowchart of a data generation method provided in an embodiment of the present application;

[0046] Figure 2 is a schematic diagram of a process for obtaining a first data feature provided in an embodiment of the present application;

[0047] Figure 3 This is a schematic diagram of a generated data table provided in an embodiment of the present application;

[0048] Figure 4 is a schematic block diagram of generated data provided by an embodiment of the present application;

[0049] Figure 5 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0051] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0052] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0053] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0054] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0055] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways.

[0056] In today's data-driven era, data in the database is an important information support for business operations and management. Whether it is customer information, sales records or financial data, this information is the basis for business decision-making. However, for some fields, there may be no actual data or the actual data is insufficient to support training or research. As a result, when there is no real data in the database, it is impossible to meet the user's needs for database query, testing, analysis and training for simulation research.

[0057] In order to solve the above problems, the embodiment of the present application provides a data generation method. In the present application, the large model language technology is adopted to design two functional agents, including SQL parsing agent and description interpretation agent. The two functions respectively complete the information extraction of structured query language (SQL) statements and the extraction of data feature description information, and finally complete the simulation data generation through the data generation plug-in. The above method aims to return the required data through SQL statements without a database, which can solve the problem that simulation research cannot be carried out due to lack of data, and can generate data distribution that meets the assumption according to the language description, reduce the threshold for data creation, and is of great significance for quickly opening up application research.

[0058] Among them, the large model language technology mentioned above refers to the technology that uses large pre-trained language models to process natural language text. These language models usually have billions to hundreds of billions of parameters and can capture complex patterns and associations in natural language. Large model language technology has achieved remarkable results in many application scenarios, such as text generation, machine translation, question-answering systems, text classification, etc. Large models can learn richer language knowledge from large amounts of data, so they have better performance in understanding the meaning and context of natural language; text generation technology based on large models can generate more natural and fluent texts, reducing the artificial traces of generated texts; large models learn a lot of general language knowledge during training, which makes them have better generalization capabilities when dealing with unseen tasks and data; large model language technology can be applied to various natural language processing tasks, including dialogue systems, search engines, recommendation systems, etc.

[0059] The SQL statement mentioned above is a standard programming language for managing relational database management systems. It is used to interact with the database, including creating, querying, updating, and deleting data. SQL statements can perform various operations such as data retrieval, data insertion, data update, data deletion, database object creation (such as tables, views, indexes, etc.) and database permission management. SQL statements usually include:

[0060] Keywords: Keywords in SQL statements are used to indicate the operations to be performed, such as SELECT, INSERT, UPDATE, DELETE, etc.

[0061] Table Name: Specify the name of the database table to be operated.

[0062] Column Name: Specify the column name in the database table to be operated;

[0063] Conditions: Conditions used to filter data, such as conditional expressions in the WHERE clause;

[0064] Operators: Operators used to compare values, such as equal to (=), greater than (>), less than (<), etc.

[0065] Functions: Functions used to operate and calculate data, such as SUM, AVG, COUNT, etc.

[0066] Group By: A keyword used to perform group calculations on data;

[0067] Order By: Keywords used to sort query results;

[0068] Aggregate: A function used to perform aggregate calculations on data, such as SUM, AVG, COUNT, etc.

[0069] Join: A keyword used to associate data from multiple tables.

[0070] See also Figure 1 , is a flow chart of a data generation method provided in an embodiment of the present application. As an example but not a limitation, the method may include the following steps:

[0071] S101, performing data query on a database according to a query language containing a first data feature.

[0072] In the embodiment of the present application, the query language is a programming language used to retrieve data from a database. In relational databases, SQL (Structured Query Language) is the most commonly used query language. The first data feature is a specific attribute or field of the data that the user wants to query. For example, if the user wants to query the sales quantity of a product in a sales database, then "sales quantity" is the first data feature.

[0073] The user uses the SQL language to write a query statement that retrieves data from the database based on specific data characteristics (such as sales volume). The query statement defines the data to be retrieved and the retrieval conditions, and then the database management system executes the query and returns the data records that meet the conditions.

[0074] S102: If the query result is empty, obtain a natural language containing a second data feature of the query data; wherein the query language is not a natural language.

[0075] In the embodiment of the present application, if the SQL query executed by the user does not return any data records, this may be because the data that the user wants to query does not exist in the database. At this time, if the database does not have real data but can provide data support for the user, the system will try to obtain another data feature related to the original query condition and obtain a natural language description of this feature.

[0076] In one implementation, if a user executes an SQL query statement and no data records are returned, the user can enter the natural language of the data to be queried into the system, such as "find the total sales quantity of all products sold after January 1, 2023", where the second data feature includes the date "January 1, 2023", "sales products", etc.

[0077] In another implementation, the system can obtain a natural language description of other data features related to the original query conditions. For example, if the original query is to find the total sales quantity of all products sold after January 1, 2023, and no records matching the conditions are found, the system may try to obtain some other information about these products, such as the average price of the product or the most sold product category.

[0078] It should be pointed out that the database query language used for querying (such as SQL) is a programming language, which does not belong to natural language. Natural language is the language used by humans for daily communication, while SQL is a computer-specific syntax used for interaction between humans and databases.

[0079] In the above method, the natural language description of the second data feature can provide the user with contextual information of the entities and attributes involved in the query. When the query conditions do not match any data, other possible query paths can be explored by obtaining the user's natural language containing the second data feature to obtain the required data.

[0080] S103: Generate a third data feature according to the first data feature included in the query language and the second data feature included in the natural language.

[0081] In an embodiment of the present application, after the query result is empty and the user's natural language containing the second data is obtained, the system will analyze the first data feature specified by the user in the query (the original query condition) and the second data feature mentioned by the user in the natural language description (the user's query intention), and then generate a new data feature based on this information, which is called the third data feature.

[0082] In one embodiment, see Figure 2 , is a schematic diagram of a process for obtaining a first data feature provided in an embodiment of the present application, such as Figure 2 As shown, step S103 includes:

[0083] S201, converting the query language into a first expression of a preset data structure; the first expression is used to characterize the first data feature.

[0084] In the embodiment of the present application, the preset structure may be a JSON structure, which is a lightweight data exchange format. Converting the SQL statement to the JSON statement may convert the query result from the relational data format to the JSON structure, so that data can be exchanged between applications more conveniently. The first expression may conform to the expression of the JSON structure and include the first data feature in the user query statement (such as querying the sales quantity, product name, etc.).

[0085] In one embodiment, step S201 includes:

[0086] S301, extracting the first keyword in the query language.

[0087] In an embodiment of the present application, the query language input by the user is semantically parsed to obtain the first keyword in the query language, the first keyword includes keywords such as SELECT, FROM, WHERE, GROUP BY, HAVING and ORDER BY, and the usage corresponding to the keyword is obtained.

[0088] The keywords in SQL statements are used to indicate the operations to be performed. For example, SELECT indicates which data to retrieve from the database. It can be used alone or in combination with clauses such as DISTINCT and TOP. FROM is used to specify the source of the query data, that is, which table or tables to query. WHERE is used to filter the rows in the query result set and only include rows that meet specific conditions. GROUP BY is used to group the rows in the query result set according to the values ​​of one or more columns, and is usually used in combination with aggregate functions such as COUNT(), SUM(), AVG(), MAX(), and MIN().

[0089] S302: extract information corresponding to the first keyword from the query language to obtain the first data feature.

[0090] In the implementation of this application, the corresponding higher-level information (first data feature) is extracted according to the usage of the first keyword. The higher-level information can be table names, column names, aggregation, sorting and filtering information of column dimensions, etc. Among them, the table name specifies the name of the database to be operated; the column name specifies the column name in the database table to be operated; the aggregation of the column dimension represents aggregation operations such as COUNT(), SUM(), AVG(), etc., which are used to perform statistical analysis on the data in the column and summarize or calculate the data.

[0091] S303: Generate a first expression of the preset data structure according to the first keyword and the first data feature.

[0092] In an embodiment of the present application, keywords (first keywords) and the column names corresponding to the keywords, table name aggregation operations, sorting and filtering conditions (first data features), etc. are converted into JSON structure expressions to provide accurate structural data for subsequent simulation data generation.

[0093] For example, the SQL statement entered by the user is:

[0094] SELECT name,age,gender

[0095] FROM employees

[0096] WHERE department = 'IT'

[0097] GROUP BY gender

[0098] ORDER BY age DESC

[0099] Among them, the first keyword is "SELECT" and the first data feature is ""

[0100] The first expression converted according to the first keyword and the first data feature is as follows:

[0101] Table name: "employees",

[0102] "Column field":["name","age","gender"],

[0103] "Sorting information": [{"field":"age","sort":"descending"}],

[0104] "Filter Condition":[{"Field":"department","Condition":{"Filter Value":"IT","Logic":"Equal to"}}],

[0105] "Aggregate information": ["gender"]

[0106] }

[0107] In the above method, the query statement input by the user is parsed and the corresponding JSON structure expression is generated, so that the user can use these expressions to perform complex data query and analysis.

[0108] S202, converting the natural language into a second expression of a preset data structure; the second expression is used to represent the second data feature.

[0109] In an embodiment of the present application, the natural language input by the user is parsed to identify the data feature (second data feature) that the user wants to query. The second data feature can be a data dimension such as time dimension, product dimension, and sales dimension. Once the system understands the user's natural language description, it constructs a query expression, which is usually in a format that conforms to a preset data structure (such as JSON). This expression will clearly indicate how to retrieve the required data from the database. Finally, the system converts this query expression into a preset data structure, such as JSON. This conversion process ensures that the query results can be used by different systems and applications.

[0110] In one embodiment, step S202 includes:

[0111] Performing semantic analysis on the natural speech to obtain a second keyword contained in the natural language;

[0112] extracting information corresponding to the second keyword from the natural language to obtain the second data feature;

[0113] A second expression of the preset data structure is generated according to the second keyword and the second data feature.

[0114] In an embodiment of the present application, the system analyzes the natural language text input by the user to understand its intention and the concepts expressed. Through semantic analysis, the system can identify important words (second keywords), which are called keywords such as "sales range", representing the core concepts of the user's query. Once the keywords are identified, the system extracts specific information related to these keywords from the original text. This process may involve deeper semantic analysis to ensure that the context is correctly understood. The extracted information will be converted into data features, which are specific data points that can be used in data processing and query. These data features are "second data features", such as the second data feature extracted based on the second keyword "sales range". The specific interval of the sales range is "1000-2000" and its upward trend is "first increase and then decrease".

[0115] Finally, based on these data features, the system will generate an expression in a preset data structure (such as JSON). This expression not only contains data features, but may also include query conditions, filters, aggregation functions, etc., which are direct reflections of user queries.

[0116] For example, according to the SQL statement input by the user, the natural language input by the user is obtained as "query the information of employees in the IT department with an age range of 20-50", and the second keywords that can be obtained by parsing the natural language are "IT department", "age range", etc. The data features of the second keywords are age range "20-50", "employee information", etc. The expression (second expression) of the preset structure (such as JSON) generated according to the second keyword and the second data feature is as follows:

[0117] "field1" {

[0118] "name":{"data type":"text",

[0119] "Data Range":{"Text":["Xiao Wang","Xiao Ming","Xiao Hei"]},

[0120] "Data Trend":"None"},"age":

[0121] }

[0122] "field2" {

[0123] {"Data Type":"Number",

[0124] "Data Range":{"Maximum Value":50,"Minimum Value":20},

[0125] "Data Trend": "None"}

[0126] }

[0127] In the above method, the above method enables the system to better understand the user's intention through semantic analysis and information extraction, and generate a suitable data structure expression based on it, which is crucial for subsequent data processing and analysis.

[0128] S203: Generate the third data feature according to the first expression and the second expression.

[0129] In the embodiment of the present application, the process of generating the third data feature is to combine the first expression and the second expression to obtain the user's query intent, that is, the query content, query conditions, etc. Based on this information, a total data feature (third data feature) is generated. This process may involve operations such as JSON path query, data aggregation, filtering, and conversion.

[0130] In one embodiment, step S203 includes:

[0131] The data corresponding to the same field in the first expression and the second expression are associated to obtain the fourth data feature of each of the fields; wherein the third data feature includes the fourth data feature of each of the fields.

[0132] In an embodiment of the present application, the first expression and the second expression are parsed to understand which fields they each contain. The fields of the two expressions are compared to find out the fields they have in common. For each common field, the data of the field in the first expression and the second expression are associated. This may involve merging the values ​​of the same fields in two JSON objects together. Through the above-mentioned association operation, a fourth data feature is generated for each common field. These fourth data features represent the merged or associated data of the field in the results of the two expressions. Finally, all fourth data features are included in the third data feature. In this way, the third data feature contains the association information of the data corresponding to the same fields in the first expression and the second expression.

[0133] For example, the first expression in the above example is:

[0134] Table name: "employees",

[0135] "Column field":["name","age","gender"],

[0136] "Sorting information": [{"field":"age","sort":"descending"}],

[0137] "Filter Condition":[{"Field":"department","Condition":{"Filter Value":"IT","Logic":"Equal to"}}],

[0138] "Aggregate information": ["gender"]

[0139] }

[0140] The second expression is:

[0141] "field1" {

[0142] "name":{"data type":"text",

[0143] "Data Range":{"Text":["Xiao Wang","Xiao Ming","Xiao Hei"]},

[0144] "Data Trend": "None"},

[0145] "field2" {

[0146] "age":{"data type":"number",

[0147] "Data Range":{"Maximum Value":50,"Minimum Value":20},

[0148] "Data Trend": "None"}

[0149] }

[0150] By comparison, we can see that the first expression and the second expression both contain the field "age". Then the data of the two identical fields are associated to obtain the fourth data feature corresponding to each field, as follows:

[0151] "field2" {

[0152] "age":{"data type":"number",

[0153] "Data Range":{"Maximum Value":50,"Minimum Value":20},

[0154] "Data Trend":"Sort":"Descending"}

[0155] }

[0156] The above is the fourth data feature obtained by combining the first expression and the second expression. The fourth data feature is to obtain and arrange the data in the range of 20-50 in the age field. By traversing each field in the first expression and associating it with the field information corresponding to the second expression, the fourth data feature corresponding to each field is obtained. The fourth data features corresponding to all fields are combined to generate the third data feature.

[0157] S104: Generate simulation data of the database according to the third data feature.

[0158] In the embodiment of the present application, step S104 is implemented as follows:

[0159] For each of the fields, simulation data conforming to the fourth data feature of the field is generated.

[0160] In an embodiment of the present application, the amount of data input by the user is obtained, and a conditional data sequence is generated based on the amount of data the user wants to obtain and based on the field information of each field in the third data feature, such as by using random number generation or other data generation techniques.

[0161] In one embodiment, the first expression includes sorting information of the fields; and the method further includes:

[0162] A data sequence is generated according to the fourth characteristic data of each of the fields contained in the third data characteristic; and the data sequence is sorted according to the sorting information in the first expression to obtain a data table of the simulation data.

[0163] In the embodiment of the present application, corresponding data is generated according to the fourth characteristic data corresponding to each field, such as the fields included in the above fields are:

[0164] Table field: employees; Data type: Number; Minimum value: 20, Maximum value: 50; Number of data: 3

[0165] Column field: name; Data type: text; Number of data: 3;

[0166] Column field: age; Data type: number; Minimum value 20, maximum value 50, Number of data: 3

[0167] The data generated based on the above field information is:

[0168] "name" is "Xiao Wang", "Xiao Ming", "Xiao Hei" respectively; age is "30", "25", "40" respectively;

[0169] According to the first expression, the data feature contains "arrangement information" and the "arrangement information" is "descending", so the age data obtained above is processed in descending order to [40,30,25]. According to the filtering condition in the first expression, the employees in the "IT" department have the aggregation information "gender", which is equivalent to grouping the results by gender and sorting each group of results from oldest to youngest according to age. To generate a data table of simulation data, see Figure 3 , is a schematic diagram of the generated data table provided in the embodiment of the present application.

[0170] In one embodiment, the present application provides a data generation system, the data generation system comprising a data query module, a data acquisition module and a data generation module;

[0171] The data query module is used to perform data query on the database according to the query language containing the first data feature;

[0172] The data acquisition module is used to acquire a natural language containing a second data feature of the query data; wherein the query language is not a natural language;

[0173] The data generation module is used to generate a third data feature according to the first data feature included in the query language and the second data feature included in the natural language;

[0174] The data generation module is also used to generate simulation data of the database according to the third data feature.

[0175] See also Figure 4 , is a schematic diagram of the generated data provided by the embodiment of the present application, such as Figure 4 As shown, the present application designs two types of parsing agent functions based on the big data model, namely SQL parsing agent and data description agent, which respectively complete the analysis of SQL statements and the parsing of natural language, and finally regenerate the simulation data according to the data features obtained after each parsing. The steps are as follows:

[0176] 1. The user enters an SQL statement to query the database. If no data is returned, the user enters a natural language, which contains the data features that the user wants to query;

[0177] 2. The SQL parsing agent parses the SQL statement input by the user, and generates a first expression, a first expression symbol, and an expression of a JSON structure according to the features of the parsed data;

[0178] 3. The data description agent performs data analysis on the natural language input by the user, and generates a second expression, a second expression symbol and an expression of a JSON structure according to the features of the analyzed data;

[0179] 4. Automatically generate simulation data according to the first expression and the second expression and the number of data that the user wants to obtain, and return the table data generated from the simulation data to the user.

[0180] In the above method, the required data can be returned through SQL statements even without a database, which can solve the problem of being unable to conduct simulation research due to lack of data. It can also generate data distribution that meets the assumptions based on natural language descriptions, lowering the threshold for data creation, which is of great significance for quickly opening up applied research.

[0181] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0182] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0183] Figure 5 Schematic diagram of the structure of the terminal device provided in the embodiment of the present application. Figure 5 As shown, the terminal device 5 of this embodiment includes: at least one processor 50 ( Figure 5 Only one is shown in the figure) a processor, a memory 51, and a computer program 52 stored in the memory 51 and executable on the at least one processor 50, and when the processor 50 executes the computer program 52, the steps in any of the above-mentioned method embodiments are implemented.

[0184] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art will understand that Figure 5 It is only an example of the terminal device 5 and does not constitute a limitation on the terminal device 5. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.

[0185] The processor 50 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0186] In some embodiments, the memory 51 may be an internal storage unit of the terminal device 5, such as a hard disk or memory of the terminal device 5. In other embodiments, the memory 51 may also be an external storage device of the terminal device 5, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 5. Further, the memory 51 may also include both an internal storage unit and an external storage device of the terminal device 5. The memory 51 is used to store an operating system, an application program, a boot loader, data, and other programs, such as the program code of the computer program. The memory 51 may also be used to temporarily store data that has been output or is to be output.

[0187] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0188] An embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0189] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the device / terminal device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0190] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0191] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0192] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0193] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0194] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A data generation method, characterized in that: The method comprises: Performing a data query on a database according to a query language containing a first data feature; If the query result is empty, obtaining a natural language containing a second data feature of the query data; wherein the query language is not a natural language; generating a third data feature according to the first data feature contained in the query language and the second data feature contained in the natural language; The simulation data of the database is generated according to the third data feature.

2. The data generation method according to claim 1, characterized in that: The generating the third data feature according to the first data feature included in the query language and the second data feature included in the natural language includes: Converting the query language into a first expression of a preset data structure; the first expression is used to characterize the first data feature; Converting the natural language into a second expression with a preset data structure; the second expression is used to characterize the second data feature; The third data feature is generated according to the first expression and the second expression.

3. The data generation method according to claim 2, characterized in that: The step of converting the query language into a first expression of a preset data structure includes: extracting a first keyword in the query language; Extracting information corresponding to the first keyword from the query language to obtain the first data feature; A first expression of the preset data structure is generated according to the first keyword and the first data feature.

4. The data generation method according to claim 2, characterized in that: The step of converting the natural language into a second expression of a preset data structure includes: Performing semantic analysis on the natural language to obtain a second keyword contained in the natural language; extracting information corresponding to the second keyword from the natural language to obtain the second data feature; A second expression of the preset data structure is generated according to the second keyword and the second data feature.

5. The data generation method according to claim 2, characterized in that: Generating the third data feature according to the first expression and the second expression includes: The data corresponding to the same field in the first expression and the second expression are associated to obtain the fourth data feature of each of the fields; wherein the third data feature includes the fourth data feature of each of the fields.

6. The data generation method according to claim 5, characterized in that: The method further comprises: For each field, simulated data conforming to the fourth data feature of the field is generated.

7. The data generation method according to claim 5, characterized in that: The first expression includes sorting information of the fields; The method further comprises: Generate a data sequence according to the fourth feature data of each of the fields included in the third data feature; The data sequence is sorted according to the sorting information in the first expression to obtain a data table of the simulation data.

8. A data generation system, characterized in that: The data generation system includes a data query module, a data acquisition module and a data generation module; The data query module is used to perform data query on the database according to the query language containing the first data feature; The data acquisition module is used to acquire a natural language containing a second data feature of the query data; wherein the query language is not a natural language; The data generation module is used to generate a third data feature according to the first data feature included in the query language and the second data feature included in the natural language; The data generation module is also used to generate simulation data of the database according to the third data feature.

9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.