Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Method and device for generating SQL (Structured Query Language) statement, computer equipment and storage medium

A computer program and statement technology, applied in the database field, can solve problems such as low efficiency, and achieve the effect of improving efficiency and reducing workload

Pending Publication Date: 2022-01-07
PING AN MEDICAL & HEALTHCARE MANAGEMENT CO LTD
View PDF0 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] Aiming at the problem that the SQL statements of the existing business rules need to be handwritten and the efficiency is low, a method, device, computer equipment and storage medium for generating SQL statements aimed at improving the speed of obtaining the SQL statements of the business rules are provided

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for generating SQL (Structured Query Language) statement, computer equipment and storage medium
  • Method and device for generating SQL (Structured Query Language) statement, computer equipment and storage medium
  • Method and device for generating SQL (Structured Query Language) statement, computer equipment and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0048] see figure 1 , a method for generating an SQL statement in this embodiment, comprising the following steps:

[0049] S1. Extract rule information in the database according to preset rules, the rule information includes table name and rule data, parse the rule information, and obtain the table name and the rule data.

[0050]In one embodiment, the database includes at least one piece of rule information, the rule information is text information representing business rules configured according to business requirements, the table name refers to the name of the table involved in the above business rules, and the rule data is Text information representing the specific content of the above business rules. Take the employee payment schedule stored in the medical insurance database as an example: the rule information is "the personnel category of the employee payment schedule can only be active, retired, retired, and old Red Army". Among them, the table name is "employee paym...

Embodiment 2

[0104] see image 3 , an apparatus 1 for generating SQL statements in this embodiment includes: an analysis unit 11 , a processing unit 12 , a determination unit 13 and a generation unit 14 .

[0105] The parsing unit 11 is configured to extract rule information in the database according to preset rules, the rule information includes table names and rule data, parse the rule information, and obtain the table names and the rule data.

[0106] Wherein, the database includes at least one piece of rule information. The preset rule is a kind of extraction rule, and the rule can extract the rule information in the database one by one according to the order of the first letters in the rule information, or other preset or random order. The rule data includes field data, or field data and dictionary data.

[0107] The above rule information can also be stored in a server, which can be an independent server, or provide cloud services, cloud databases, cloud computing, cloud functions,...

Embodiment 3

[0145] In order to achieve the above object, the present invention also provides a kind of computer equipment 2, and this computer equipment 2 comprises a plurality of computer equipment 2, and the component part of the device 1 that generates SQL statement of embodiment 2 can be dispersed in different computer equipment 2, and computer equipment The device 2 can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server or a cabinet server (including an independent server, or a server cluster composed of multiple servers) for executing programs. )Wait. The computer device 2 of this embodiment at least includes but is not limited to: a memory 21, a processor 23, a network interface 22, and a device 1 for generating SQL statements that can be connected to each other through a system bus (refer to Figure 4 ). It should be pointed out that, Figure 4 Only the computer device 2 is shown with components - but it sh...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method and device for generating SQL statements, computer equipment and a storage medium, and belongs to the technical field of databases. According to the method for generating the SQL statement, reusability of a rule template is utilized, obtained rule information is analyzed to obtain a table name and rule data, all template identifiers associated with parameters are obtained according to the parameters, mapped in a parameter mapping table, of the table name and the rule data, and the corresponding rule template is determined according to the obtained template identifiers, so that the SQL statement is generated. Therefore, the obtained parameters, the table name and the rule data are input into the rule template automatic SQL statement, manual handwriting of the SQL statement is not needed, the workload of personnel is reduced, and the efficiency of generating the SQL statement is improved.

Description

technical field [0001] The invention relates to the technical field of databases, in particular to a method, a device, a computer device and a storage medium for generating SQL statements. Background technique [0002] In the quality control link of the data center, two rules, basic rules and business rules, are generally used to detect data quality. Basic rules (such as field non-empty judgment, uniqueness verification, dictionary value verification, etc.) are relatively simple to verify, and the logic of verification is relatively easy to abstract to form basic rules. Most of the data quality tools in the data center on the market now abstract these basic verification rules into methods for users to use. Business rule verification mainly focuses on verifying the business attributes of data. Usually, such business rule verification requirements come from the business system to help the business system verify whether the data meets the business system requirements in depth....

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F16/242G06F16/2455
CPCG06F16/2433G06F16/24564
Inventor 周伟刘莹浓范子龙陈杰刘亮亮
Owner PING AN MEDICAL & HEALTHCARE MANAGEMENT CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products