CN117076479A - SQL sentence generation method, device, computer equipment and readable storage medium - Google Patents

SQL sentence generation method, device, computer equipment and readable storage medium Download PDF

Info

Publication number
CN117076479A
CN117076479A CN202311038079.2A CN202311038079A CN117076479A CN 117076479 A CN117076479 A CN 117076479A CN 202311038079 A CN202311038079 A CN 202311038079A CN 117076479 A CN117076479 A CN 117076479A
Authority
CN
China
Prior art keywords
configuration
logic
optimized
sql
calculation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311038079.2A
Other languages
Chinese (zh)
Inventor
吉庆
赵乐品
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202311038079.2A priority Critical patent/CN117076479A/en
Publication of CN117076479A publication Critical patent/CN117076479A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a SQL sentence generation method, a device, computer equipment and a readable storage medium. The method comprises the following steps: abstracting a plurality of computing scenes according to the service scenes, and configuring computing logic according to each computing scene to obtain logic configuration; modifying the logic configuration to obtain a modified configuration, and checking the modified configuration to obtain an optimized configuration; converting the optimized configuration through a preset rule to generate a plurality of SQL sentences, and modifying script contents of the SQL sentences through a preset api interface to obtain a plurality of optimized SQL sentences; and issuing each optimized SQL statement to a big data platform, and executing batch calculation on each optimized SQL statement through optimal configuration. According to the application, the abstracted large data platform batch calculation logic is made into a configurable scene, so that the learning cost of SQL sentences of a user is reduced, the user experience is improved, the calculation logic is more intuitively displayed to the user side, and the fuzzy business logic is avoided.

Description

SQL sentence generation method, device, computer equipment and readable storage medium
Technical Field
The present application relates to the field of financial big data technologies, and in particular, to a method and apparatus for generating an SQL statement, a computer device, and a readable storage medium.
Background
In the field of financial science and technology, intelligent computing has become an important application direction of trade markets, such as monitoring and confirming of events to be processed, batch processing operation of trade events of financial products, batch accounting processing of net value of financial products, and the like. Various intelligent computing requirements related to the financial and technological field can be used as a data processing requirement. Currently, large amounts of data need to be batched due to the large number of transaction events, financial calculations. Batch calculation is an indispensable scene in the field of large data, and a large amount of data can be classified, integrated, marked and calculated through batch calculation.
In the prior art, the batch calculation realizes specific calculation logic by writing a fixed script, the efficiency of modifying the calculation logic is low, the flexible scene of the service cannot be dealt with, and meanwhile, a plurality of calculation logics cannot be visualized in the background, and the service logic is ambiguous.
Disclosure of Invention
In view of the above, the present application aims to overcome the shortcomings in the prior art, and provides a method, a device, a computer device and a readable storage medium for generating SQL sentences, which can be applied in the field of finance technology or other technical fields.
The application provides the following technical scheme:
in a first aspect, an embodiment of the present disclosure provides an SQL statement generation method, where the method includes:
abstracting a plurality of computing scenes according to the service scenes, and configuring computing logic according to each computing scene to obtain logic configuration;
modifying the logic configuration to obtain a modified configuration, and checking the modified configuration to obtain an optimized configuration;
converting the optimized configuration through a preset rule to generate a plurality of SQL sentences, and modifying script content of each SQL sentence through a preset api interface to obtain a plurality of optimized SQL sentences;
and issuing each optimized SQL statement to a big data platform, and executing batch calculation on each optimized SQL statement through the optimized configuration in the big data platform.
Further, the configuring the computing logic according to each computing scene to obtain a logic configuration includes:
carding the calculation logic and displaying the calculation logic on a configuration interface in a configuration mode;
and modifying the configured calculation logic to generate logic configuration identical to the script of the calculation logic.
Further, the carding the computing logic and displaying the computing logic on a configuration interface in a configuration form comprises the following steps:
displaying the configuration interface, wherein the configuration interface comprises calculation logic and configurable parameter options for configuration;
receiving configuration parameters and target configuration locations corresponding to the computational logic;
and adding the configuration parameters corresponding to the selected configurable parameter options to the target configuration position of the computing logic in the form of annotation information, and displaying the configuration parameters on the configuration interface.
Further, the verifying the correction configuration to obtain an optimized configuration includes:
checking the correctness of the input grammar and the correctness of the data parameters and the correctness of the logic of the correction configuration;
if the verification is legal, generating the optimized configuration;
and if the verification is illegal, revising the revised configuration to the verification is legal.
Further, the modifying the script content of each SQL statement through the preset api interface to obtain a plurality of optimized SQL statements includes:
binding the optimized configuration with script content of each SQL statement;
modifying script content of each SQL statement by calling a preset api interface, and judging whether modification is successful or not;
if the modification fails, prompting error information and revising to be correct;
and if the modification is successful, generating a plurality of optimized SQL sentences.
Further, the performing batch computation on each optimized SQL statement through the optimized configuration includes:
determining sequential logic of each SQL statement according to the optimized configuration;
and executing batch calculation on each optimized SQL statement according to the sequential logic.
Further, before determining the sequential logic of each SQL statement according to the optimized configuration, the method further includes:
creating an SQL abstract syntax tree according to the optimized configuration;
traversing the SQL abstract syntax tree to generate a sequential logic table, wherein the sequential logic table is used for recording sequential logic of the SQL sentence.
In a second aspect, in an embodiment of the present disclosure, there is provided an SQL statement generation apparatus, including:
the configuration module is used for abstracting a plurality of calculation scenes according to the service scenes, and configuring calculation logic according to each calculation scene to obtain logic configuration;
the verification module is used for modifying the logic configuration to obtain a modified configuration, and verifying the modified configuration to obtain an optimized configuration;
the modification module is used for converting the optimized configuration through a preset rule to generate a plurality of SQL sentences, and modifying script contents of the SQL sentences through a preset api interface to obtain a plurality of optimized SQL sentences;
and the calculation module is used for issuing each optimized SQL statement to a big data platform, and executing batch calculation on each optimized SQL statement through the optimized configuration in the big data platform.
In a third aspect, in an embodiment of the present disclosure, there is provided a computer device, including a memory and a processor, where the memory stores a computer program, and the processor implements the steps of the SQL statement generation method in the first aspect when the computer program is executed.
In a fourth aspect, in an embodiment of the present disclosure, there is provided a computer device, including a memory and a processor, where the memory stores a computer program, and the processor implements the steps of the SQL statement generation method in the first aspect when the processor executes the computer program.
Embodiments of the present application have the following advantages:
according to the SQL sentence generation method provided by the embodiment of the application, a plurality of calculation scenes are abstracted according to the service scenes, and the calculation logic is configured according to each calculation scene, so that logic configuration is obtained; modifying the logic configuration to obtain a modified configuration, and checking the modified configuration to obtain an optimized configuration; converting the optimized configuration through a preset rule to generate a plurality of SQL sentences, and modifying script content of each SQL sentence through a preset api interface to obtain a plurality of optimized SQL sentences; and issuing each optimized SQL statement to a big data platform, and executing batch calculation on each optimized SQL statement through the optimized configuration in the big data platform. According to the application, the abstracted large data platform batch calculation logic is made into a configurable scene, the simple configuration can reduce the learning cost of SQL sentences of a user, meanwhile, the user can change more conveniently, the process of providing demands for science and technology and converting the demands into codes is saved, and most importantly, the calculation logic can be displayed more intuitively in front of the user, and the fuzzy business logic is avoided.
In order to make the above objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 shows a flow chart of a method for generating SQL statements provided by an embodiment of the application;
FIG. 2 is a flow chart illustrating another method for generating SQL statements according to an embodiment of the application;
FIG. 3 is a flowchart of still another SQL statement generation method according to an embodiment of the application;
fig. 4 shows a schematic structural diagram of an SQL statement generation device according to an embodiment of the present application;
fig. 5 shows a schematic diagram of a hardware architecture of a computer device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the application.
It will be understood that when an element is referred to as being "fixed to" another element, it can be directly on the other element or intervening elements may also be present. When an element is referred to as being "connected" to another element, it can be directly connected to the other element or intervening elements may also be present. In contrast, when an element is referred to as being "directly on" another element, there are no intervening elements present. The terms "vertical," "horizontal," "left," "right," and the like are used herein for illustrative purposes only.
In the present application, unless explicitly specified and limited otherwise, the terms "mounted," "connected," "secured," and the like are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally formed; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communicated with the inside of two elements or the interaction relationship of the two elements. The specific meaning of the above terms in the present application can be understood by those of ordinary skill in the art according to the specific circumstances.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the present application, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description of the templates herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The term "and/or" as used herein includes any and all combinations of one or more of the associated listed items.
Example 1
Referring to fig. 1, a flowchart of an SQL statement generation method according to an embodiment of the present application includes the following steps:
step S110, abstracting a plurality of calculation scenes according to the service scenes, and configuring calculation logic according to each calculation scene to obtain logic configuration.
In this embodiment, batch computing scenes which need to be changed frequently or need to be flexibly configured are abstracted according to the service scenes to perform configuration implementation, so as to obtain logic configuration.
In an alternative embodiment, as shown in fig. 2, step S110 includes:
step S111, carding the calculation logic and displaying the calculation logic on a configuration interface in a configuration mode;
and step S112, modifying the configured calculation logic to generate logic configuration identical to the script of the calculation logic.
Specifically, a configuration interface is presented to facilitate user understanding and modification, the configuration interface including computing logic for which configuration is intended and configurable parameter options including identification of configurable parameters, parameter value input interfaces, and the like. The user may select the parameter identification to be configured, input the parameter value, specify the target configuration location in the calculation logic, etc. from the configurable parameter options if the user needs to configure the parameters.
And then, after receiving the configuration parameters configured by the user side and the target configuration positions corresponding to the calculation logic, adding the configuration parameters corresponding to the selected configurable parameter options to the target configuration positions of the calculation logic in the form of annotation information, and displaying the configuration parameters on a configuration interface.
And finally, modifying the configured calculation logic according to the requirements of the user end to generate logic configuration identical to the script of the calculation logic.
And step S120, modifying the logic configuration to obtain a modified configuration, and checking the modified configuration to obtain an optimized configuration.
Further, the service personnel edits the logic configuration in the current computing scene in a configuration modification mode according to the requirements of the user side to obtain the modification configuration, and the application program provides a verification function after modification is completed to verify the correctness of the input grammar, the correctness of the data parameters and the correctness of the logic of the modification configuration. If equal to (=) contains in (), and if the filled data is legal, whether executable SQL sentences can be generated normally, some customized check logic needs to be added to the correction logic aiming at a specific computing scene, for example, when an atomic product is deduced, multiple sections of SQL sentences exist in different source systems of the data, and at the moment, whether tag values under the same section of SQL sentences are consistent or not needs to be checked.
If the verification is legal, generating an optimal configuration; and if the verification is illegal, revising the revised configuration to the verification is legal.
And step S130, converting the optimized configuration through a preset rule to generate a plurality of SQL sentences, and modifying script contents of the SQL sentences through a preset api interface to obtain a plurality of optimized SQL sentences.
The application program converts the edited optimal configuration through preset rules to generate batch SQL sentences which can be executed, the optimal configuration is mapped and bound with script contents of the SQL sentences, and script contents of the SQL sentences are modified through a modification release scheduling job api interface provided by a big data scheduling platform.
Judging whether the modification is successful, if so, generating a plurality of optimized SQL sentences by calling the api interface, and if the modification is failed, returning to re-modification and prompting error information.
And step S140, each optimized SQL statement is issued to a big data platform, and batch calculation is executed on each optimized SQL statement through the optimized configuration in the big data platform.
In an alternative embodiment, as shown in fig. 3, step S140 includes:
step S141, determining the sequential logic of each SQL statement according to the optimized configuration;
step S142, executing batch computation on each optimized SQL statement according to the sequential logic.
Finally, each optimized SQL statement is issued to a big data platform, an SQL abstract syntax tree is created in the big data platform according to the optimized configuration, then the SQL abstract syntax tree is traversed, and a sequential logic table is generated, wherein the sequential logic table is used for recording sequential logic of the SQL statement.
Determining sequential logic of each SQL statement according to the optimized configuration, and executing batch calculation on each optimized SQL statement according to the sequential logic so as to process data.
The method realizes the online verification of business scenes such as atomic product standard deduction, index engine, management accounting, manpower label deduction and the like by configuring and generating batch SQL sentences, and the convenient and flexible user experience is approved by businesses.
According to the SQL sentence generation method provided by the embodiment of the application, a plurality of calculation scenes are abstracted according to the service scenes, and the calculation logic is configured according to each calculation scene, so that logic configuration is obtained; modifying the logic configuration to obtain a modified configuration, and checking the modified configuration to obtain an optimized configuration; converting the optimized configuration through a preset rule to generate a plurality of SQL sentences, and modifying script content of each SQL sentence through a preset api interface to obtain a plurality of optimized SQL sentences; and issuing each optimized SQL statement to a big data platform, and executing batch calculation on each optimized SQL statement through the optimized configuration in the big data platform. According to the application, the abstracted large data platform batch calculation logic is made into a configurable scene, the simple configuration can reduce the learning cost of SQL sentences of a user, meanwhile, the user can change more conveniently, the process of providing demands for science and technology and converting the demands into codes is saved, and most importantly, the calculation logic can be displayed more intuitively in front of the user, and the fuzzy business logic is avoided.
Example 2
Referring to fig. 4, a schematic structural diagram of an SQL statement generation device 400 according to an embodiment of the application includes:
the configuration module 410 is configured to abstract a plurality of computation scenes according to the service scene, and configure computation logic according to each computation scene to obtain logic configuration;
the verification module 420 is configured to modify the logic configuration to obtain a corrected configuration, and verify the corrected configuration to obtain an optimized configuration;
the modification module 430 is configured to convert the optimized configuration through a preset rule to generate a plurality of SQL statements, and modify script content of each SQL statement through a preset api interface to obtain a plurality of optimized SQL statements;
the calculation module 440 is configured to issue each optimized SQL statement to a large data platform, and execute batch calculation on each optimized SQL statement in the large data platform through the optimized configuration.
Optionally, the above SQL statement generation device may further include:
the carding module is used for carding the calculation logic and displaying the calculation logic on a configuration interface in a configuration mode;
and the first modification submodule is used for modifying the configured calculation logic and generating logic configuration identical to the script of the calculation logic.
Optionally, the above SQL statement generation device may further include:
the display module is used for displaying the configuration interface, and the configuration interface comprises calculation logic and configurable parameter options for configuration;
a receiving module for receiving configuration parameters and target configuration positions corresponding to the computing logic;
and the adding module is used for adding the configuration parameters corresponding to the selected configurable parameter options to the target configuration position of the computing logic in the form of annotation information and displaying the configuration parameters on the configuration interface.
Optionally, the above SQL statement generation device may further include:
the verification sub-module is used for verifying the correctness of the input grammar, the correctness of the data parameters and the correctness of the logic of the correction configuration;
the first generation module is used for generating the optimized configuration if the verification is legal;
and the first reset module is used for carrying out modification again on the correction configuration until the verification is legal if the verification is illegal.
Optionally, the above SQL statement generation device may further include:
the binding module is used for binding the optimized configuration with script contents of each SQL statement;
the second modification submodule is used for modifying script contents of the SQL sentences by calling a preset api interface and judging whether the modification is successful or not;
the second resetting module is used for prompting error information and carrying out the modification again until the error information is correct if the modification fails;
and the second generation module is used for generating a plurality of optimized SQL sentences if the modification is successful.
Optionally, the above SQL statement generation device may further include:
the determining module is used for determining sequential logic of each SQL statement according to the optimized configuration;
and the computing sub-module is used for executing batch computation on each optimized SQL statement according to the sequential logic.
Optionally, the above SQL statement generation device may further include:
the creating module is used for creating an SQL abstract syntax tree according to the optimized configuration;
the traversal module is used for traversing the SQL abstract syntax tree to generate a sequential logic table, wherein the sequential logic table is used for recording sequential logic of the SQL sentence.
The SQL sentence generating device provided by the embodiment of the application comprises the following components: the configuration module is used for abstracting a plurality of calculation scenes according to the service scenes, and configuring calculation logic according to each calculation scene to obtain logic configuration; the verification module is used for modifying the logic configuration to obtain a modified configuration, and verifying the modified configuration to obtain an optimized configuration; the modification module is used for converting the optimized configuration through a preset rule to generate a plurality of SQL sentences, and modifying script contents of the SQL sentences through a preset api interface to obtain a plurality of optimized SQL sentences; and the calculation module is used for issuing each optimized SQL statement to a big data platform, and executing batch calculation on each optimized SQL statement through the optimized configuration in the big data platform. The abstract large data platform batch calculation logic is made into a configurable scene, simple configuration can reduce the learning cost of SQL sentences of a user, simultaneously, the user can change more conveniently, the process of providing demands for science and technology and converting the demands into codes is saved, and most importantly, the calculation logic can be displayed more intuitively to the user, and the fuzzy business logic is avoided.
Example 3
Fig. 5 shows a schematic diagram of a hardware architecture of a computer device provided by the present application, where the computer device includes a memory and a processor, and the memory stores a computer program, and the processor implements the steps of the SQL statement generation method described in embodiment 1 when executing the computer program, where the method includes:
abstracting a plurality of computing scenes according to the service scenes, and configuring computing logic according to each computing scene to obtain logic configuration;
modifying the logic configuration to obtain a modified configuration, and checking the modified configuration to obtain an optimized configuration;
converting the optimized configuration through a preset rule to generate a plurality of SQL sentences, and modifying script content of each SQL sentence through a preset api interface to obtain a plurality of optimized SQL sentences;
and issuing each optimized SQL statement to a big data platform, and executing batch calculation on each optimized SQL statement through the optimized configuration in the big data platform.
In this embodiment, the computer device 500 is a device capable of automatically performing numerical calculation and/or information processing in accordance with instructions set or stored in advance. For example, it may be a rack server, a blade server, a tower server, or a rack server (including an independent server or a server cluster composed of a plurality of servers), etc. As shown in fig. 5, computer device 500 includes at least, but is not limited to: the memory 510, processor 520, and network interface 530 may be communicatively linked to each other by a system bus. Wherein:
the memory 510 includes at least one type of computer-readable storage medium including flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 510 may be an internal storage module of the computer device 500, such as a hard disk or memory of the computer device 500. In other embodiments, the memory 510 may also be an external storage device of the computer device 500, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the computer device 500. Of course, the memory 510 may also include both internal memory modules of the computer device 500 and external memory devices. In this embodiment, the memory 510 is typically used for storing an operating system and various types of application software installed on the computer device 500, such as program codes of a video playing method, and the like. In addition, the memory 510 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 520 may be a central processing unit (Central Processing Unit, simply CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 520 is generally used to control overall operation of the computer device 500, such as performing control and processing related to data interaction or communication with the computer device 500, and the like. In this embodiment, the processor 520 is configured to execute program codes or process data stored in the memory 510.
The network interface 530 may include a wireless network interface or a wired network interface, the network interface 530 typically being used to establish a communication link between the computer device 500 and other computer devices. For example, the network interface 530 is used to connect the computer device 500 to an external terminal through a network, establish a data transmission channel and a communication link between the computer device 500 and the external terminal, and the like. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a global system for mobile communications (GlobalSystem of Mobile communication, abbreviated as GSM), wideband code division multiple access (Wideband Code DivisionMultiple Access, abbreviated as WCDMA), a 4G network, a 5G network, bluetooth (Bluetooth), wi-Fi, etc.
It should be noted that fig. 5 only shows a computer device having components 510-530, but it should be understood that not all of the illustrated components are required to be implemented, and that more or fewer components may be implemented instead.
In this embodiment, the method for generating the SQL statement stored in the memory 510 may be further divided into one or more program modules and executed by one or more processors (the processor 520 in this embodiment) to complete the present application.
Example 4
The present embodiment also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the SQL statement generation method of the embodiment, the method comprising:
abstracting a plurality of computing scenes according to the service scenes, and configuring computing logic according to each computing scene to obtain logic configuration;
modifying the logic configuration to obtain a modified configuration, and checking the modified configuration to obtain an optimized configuration;
converting the optimized configuration through a preset rule to generate a plurality of SQL sentences, and modifying script content of each SQL sentence through a preset api interface to obtain a plurality of optimized SQL sentences;
and issuing each optimized SQL statement to a big data platform, and executing batch calculation on each optimized SQL statement through the optimized configuration in the big data platform.
In this embodiment, the computer-readable storage medium includes a flash memory, a hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the computer readable storage medium may be an internal storage unit of a computer device, such as a hard disk or a memory of the computer device. In other embodiments, the computer readable storage medium may also be an external storage device of a computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card), etc. that are provided on the computer device. Of course, the computer-readable storage medium may also include both internal storage units of a computer device and external storage devices. In this embodiment, the computer-readable storage medium is typically used to store an operating system and various types of application software installed on a computer device. Furthermore, the computer-readable storage medium may also be used to temporarily store various types of data that have been output or are to be output.
Any particular values in all examples shown and described herein are to be construed as merely illustrative and not a limitation, and thus other examples of exemplary embodiments may have different values.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the present application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application.

Claims (10)

1. A method for generating an SQL statement, the method comprising:
abstracting a plurality of computing scenes according to the service scenes, and configuring computing logic according to each computing scene to obtain logic configuration;
modifying the logic configuration to obtain a modified configuration, and checking the modified configuration to obtain an optimized configuration;
converting the optimized configuration through a preset rule to generate a plurality of SQL sentences, and modifying script content of each SQL sentence through a preset api interface to obtain a plurality of optimized SQL sentences;
and issuing each optimized SQL statement to a big data platform, and executing batch calculation on each optimized SQL statement through the optimized configuration in the big data platform.
2. The method for generating SQL statements according to claim 1, wherein said configuring the computation logic according to each computation scenario to obtain the logic configuration comprises:
carding the calculation logic and displaying the calculation logic on a configuration interface in a configuration mode;
and modifying the configured calculation logic to generate logic configuration identical to the script of the calculation logic.
3. The SQL statement generation method of claim 2, wherein the carding the computing logic and presenting it in a configurable form on a configuration interface comprises:
displaying the configuration interface, wherein the configuration interface comprises calculation logic and configurable parameter options for configuration;
receiving configuration parameters and target configuration locations corresponding to the computational logic;
and adding the configuration parameters corresponding to the selected configurable parameter options to the target configuration position of the computing logic in the form of annotation information, and displaying the configuration parameters on the configuration interface.
4. The method for generating an SQL statement according to claim 1, wherein verifying the revised configuration to obtain an optimized configuration comprises:
checking the correctness of the input grammar and the correctness of the data parameters and the correctness of the logic of the correction configuration;
if the verification is legal, generating the optimized configuration;
and if the verification is illegal, revising the revised configuration to the verification is legal.
5. The method for generating SQL statements according to claim 1, wherein said modifying script content of each of said SQL statements through a preset api interface to obtain a plurality of optimized SQL statements comprises:
binding the optimized configuration with script content of each SQL statement;
modifying script content of each SQL statement by calling a preset api interface, and judging whether modification is successful or not;
if the modification fails, prompting error information and revising to be correct;
and if the modification is successful, generating a plurality of optimized SQL sentences.
6. The SQL statement generation method according to claim 1, wherein the performing batch computation on each of the optimized SQL statements by the optimized configuration comprises:
determining sequential logic of each SQL statement according to the optimized configuration;
and executing batch calculation on each optimized SQL statement according to the sequential logic.
7. The method of claim 6, further comprising, before determining sequential logic of each SQL statement according to the optimal configuration:
creating an SQL abstract syntax tree according to the optimized configuration;
traversing the SQL abstract syntax tree to generate a sequential logic table, wherein the sequential logic table is used for recording sequential logic of the SQL sentence.
8. An SQL statement generation apparatus, the apparatus comprising:
the configuration module is used for abstracting a plurality of calculation scenes according to the service scenes, and configuring calculation logic according to each calculation scene to obtain logic configuration;
the verification module is used for modifying the logic configuration to obtain a modified configuration, and verifying the modified configuration to obtain an optimized configuration;
the modification module is used for converting the optimized configuration through a preset rule to generate a plurality of SQL sentences, and modifying script contents of the SQL sentences through a preset api interface to obtain a plurality of optimized SQL sentences;
and the calculation module is used for issuing each optimized SQL statement to a big data platform, and executing batch calculation on each optimized SQL statement through the optimized configuration in the big data platform.
9. A computer device comprising a memory storing a computer program and a processor implementing the steps of the SQL statement generation method of any one of claims 1-7 when the computer program is executed.
10. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed by a processor, implements the steps of the SQL statement generation method of any one of claims 1 to 7.
CN202311038079.2A 2023-08-16 2023-08-16 SQL sentence generation method, device, computer equipment and readable storage medium Pending CN117076479A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311038079.2A CN117076479A (en) 2023-08-16 2023-08-16 SQL sentence generation method, device, computer equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311038079.2A CN117076479A (en) 2023-08-16 2023-08-16 SQL sentence generation method, device, computer equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN117076479A true CN117076479A (en) 2023-11-17

Family

ID=88709135

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311038079.2A Pending CN117076479A (en) 2023-08-16 2023-08-16 SQL sentence generation method, device, computer equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN117076479A (en)

Similar Documents

Publication Publication Date Title
CN108241529B (en) Salary calculation method, application server and computer readable storage medium
CN108491304B (en) electronic device, business system risk control method and storage medium
CN109189669A (en) Test method, electronic device and the readable storage medium storing program for executing of business scenario
CN110599354A (en) Online reconciliation method, system, computer device and computer-readable storage medium
CN108595276A (en) Processing method, system, computer equipment and the storage medium of service logic
CN107133233B (en) Processing method and device for configuration data query
CN110990403A (en) Business data storage method, system, computer equipment and storage medium
CN110503564A (en) Save case processing method, system, equipment and storage medium from damage based on big data
CN111435367A (en) Knowledge graph construction method, system, equipment and storage medium
CN111241803A (en) Method and device for generating text file, computer equipment and readable storage medium
CN112416957A (en) Data increment updating method and device based on data model layer and computer equipment
CN111984674A (en) Method and system for generating structured query language
CN112001707A (en) Business workflow generation method and system based on business data
CN110019485A (en) A kind of product data storage method, terminal device and storage medium
CN117076479A (en) SQL sentence generation method, device, computer equipment and readable storage medium
CN112631719B (en) Data prediction model calling method, device, equipment and storage medium
CN114511314A (en) Payment account management method and device, computer equipment and storage medium
CN113722321A (en) Data export method and device and electronic equipment
CN113885760A (en) Model training configuration data generation method, system, terminal and storage medium
CN108415922B (en) Database modification method and application server
CN112817953A (en) Data verification method and device, computer equipment and computer-readable storage medium
CN113296785A (en) Document generation method, system, device and readable storage medium
CN111324434B (en) Configuration method, device and execution system of computing task
CN112132694B (en) Method, device, equipment and storage medium for confirming and checking policy and security case
CN115543485B (en) Data conversion configuration generation method, device, computer equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination