Universal sql statement execution method and device, equipment and storage medium

Through pre-built SQL universal driver services and entity extraction network models, combined with the permission query and engine selection of the SQLReview platform, it solves the problem that data analysts have difficulty in choosing the right search engine, and achieves efficient data search and permission control.

CN119669295APending Publication Date: 2025-03-21WEIKUN (SHANGHAI) TECH SERVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411823601.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

In the prior art, data analysts find it difficult to select suitable search engine tools when conducting data queries, resulting in low execution efficiency and unable to quickly obtain search results.

Method used

The network model is extracted through pre-built SQL general driver services and pre-trained entities, identify the SQL statements sent by the user, extract the object entity set and action entity set, and use the SQLReview platform to query permissions based on the permission database, and automatically select the appropriate computing engine to execute SQL statements.

Benefits of technology

It realizes automatic selection of the right search engine, improves data search efficiency, and ensures user permission control and query results accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119669295A_ABST
    Figure CN119669295A_ABST
Patent Text Reader

Abstract

The invention relates to a voice semantic technology, and discloses a universal sql statement execution method, which comprises the following steps of: obtaining a sql statement sent by a user according to a pre-constructed sql universal driving service, and inquiring a service entity of the sql statement by utilizing a pre-trained entity extraction network model to obtain an object entity set and an action entity set; querying whether the object entity set has a query permission conforming to the action entity set; generating error reporting information when the permission conforming to the query does not exist; and when the query permission is met, performing statement analysis on the sql statement by utilizing an sq1view platform to obtain a calculation engine suitable for the sql statement, and importing the sql statement into the calculation engine to obtain an execution result corresponding to the sql statement. The invention further provides a universal sql statement execution device and equipment and a storage medium. The invention aims to identify the sql statement sent by the user and automatically select a proper search engine to search, so that the data search efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of speech semantics technology, and in particular to a general SQL statement execution method, device, equipment and computer-readable storage medium. Background Art

[0002] With the development of computer networks, database languages ​​have gradually been mastered by many data analysts, greatly improving data query efficiency. In recent years, in order to meet the query needs in different scenarios, more and more data computing engines have gradually emerged. Nowadays, when data analysts perform data queries, they often do not know which search engine tool to choose, resulting in low execution efficiency of the selected search engine and inability to quickly obtain search results. Therefore, there is an urgent need for a universal SQL data query method that automatically selects the appropriate search engine to increase data search efficiency. Summary of the invention

[0003] The present invention provides a general SQL statement execution method, device, equipment and storage medium, the main purpose of which is to increase data search efficiency by increasing the use efficiency of the search engine.

[0004] To achieve the above object, the present invention provides a general SQL statement execution method, comprising:

[0005] According to the pre-built SQL universal driver service, the SQL statement sent by the user is obtained, and the service entity of the SQL statement is queried using the pre-trained entity extraction network model to obtain the object entity set and the action entity set;

[0006] Using the pre-built sqlreview platform, according to the pre-built permission database, query whether the object entity set has the query permission that matches the action entity set;

[0007] When the object entity set does not have the query authority that matches the action entity set, an error message is generated;

[0008] When the object entity set has query permissions that match the action entity set, the sql review platform is used to perform statement analysis on the sql statement to obtain a calculation engine suitable for the sql statement, and the sql statement is imported into the calculation engine to obtain the execution result corresponding to the sql statement.

[0009] Optionally, the use of a pre-trained entity extraction network model to query the service entity of the SQL statement to obtain an object entity set and an action entity set includes:

[0010] Using a pre-trained entity extraction network model to perform part-of-speech recognition and word segmentation operations on the SQL statement to obtain a part-of-speech tagged SQL word set;

[0011] Performing a position tag quantization operation on the part-of-speech tag sql word set to obtain a word vector set;

[0012] Using the long short-term memory neural network in the entity extraction network model to perform feature extraction on the word vector set to obtain output features;

[0013] The conditional random field in the entity extraction network model is used to perform entity extraction on the output features, and the entity extraction results are classified to obtain an object entity set and an action entity set.

[0014] Optionally, obtaining the SQL statement sent by the user according to the pre-built SQL general driver service includes:

[0015] Using the preset interface, obtain the user's user identity information;

[0016] The custom statement sent by the user is obtained, and the user identity information is embedded into the target area of ​​the custom statement by using the pre-built SQL universal driver service to obtain the SQL statement.

[0017] Optionally, the using a pre-built sqlreview platform to query whether the object entity set has query permissions that match the action entity set according to a pre-built permissions database includes:

[0018] Constructing an action execution path network with the object entity set and the action entity set;

[0019] It is queried whether each line in the action execution path network meets the permission standard in the pre-built permission database.

[0020] Optionally, the using the sqlreview platform to perform statement analysis on the sql statement to obtain a computing engine suitable for the sql statement includes:

[0021] Using the sqlreview platform, the query type of the sql statement is identified, and the query range corresponding to the queried entity in the object entity set is queried;

[0022] When the total amount of data in the query range is less than a preset critical value and the SQL statement is a query request, calling the Impala engine;

[0023] When the total amount of data in the query range is less than the critical value and the SQL statement is not a query request, calling the spark engine;

[0024] When the total amount of data in the query range is greater than or equal to the critical value, the hive engine is called.

[0025] Optionally, before using the pre-built sqlreview platform to query whether the object entity set has query permissions that match the action entity set according to a pre-built permissions database, the method further includes:

[0026] Obtaining a permission query script file, encapsulating the query script file, and obtaining a permission query function package;

[0027] The authority query function package is embedded in the sqlreview platform using a socket interface.

[0028] In order to solve the above problem, the present invention also provides a general SQL statement execution device, the device comprising:

[0029] The entity extraction module is used to obtain the SQL statement sent by the user according to the pre-built SQL universal driver service, and use the pre-trained entity extraction network model to query the service entity of the SQL statement to obtain the object entity set and the action entity set;

[0030] The authority authentication module is used to use the pre-built sqlreview platform to query whether the object entity set has the query authority that matches the action entity set according to the pre-built authority database, and to generate an error message when the object entity set does not have the query authority that matches the action entity set;

[0031] The allocation engine query module is used to use the sqlreview platform to perform statement analysis on the sql statement when the object entity set has query permissions that meet the action entity set, obtain a calculation engine suitable for the sql statement, and import the sql statement into the calculation engine to obtain the execution result corresponding to the sql statement.

[0032] Optionally, the use of a pre-trained entity extraction network model to query the service entity of the SQL statement to obtain an object entity set and an action entity set includes:

[0033] Using a pre-trained entity extraction network model to perform part-of-speech recognition and word segmentation operations on the SQL statement to obtain a part-of-speech tagged SQL word set;

[0034] Performing a position tag quantization operation on the part-of-speech tag sql word set to obtain a word vector set;

[0035] Using the long short-term memory neural network in the entity extraction network model to perform feature extraction on the word vector set to obtain output features;

[0036] The conditional random field in the entity extraction network model is used to perform entity extraction on the output features, and the entity extraction results are classified to obtain an object entity set and an action entity set.

[0037] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:

[0038] at least one processor; and,

[0039] a memory communicatively connected to the at least one processor; wherein,

[0040] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the above-mentioned general SQL statement execution method.

[0041] In order to solve the above problem, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned general SQL statement execution method.

[0042] Embodiments of the present invention Embodiments of the present invention can identify the sql statements sent by users through the entity extraction network model, and find the object entity set and the action entity set from the sql statements, wherein the object entities are divided into active objects and passive objects, thereby conveniently controlling the user's authority through the action execution path of active object entity-action entity-passive object entity; in addition, through the sqlreview platform, it is also possible to automatically select a suitable search engine to search for the sql statements according to the total amount of data of the passive object entity and the action type of the action entity, and obtain search results. Therefore, a general sql statement execution method, device, equipment and storage medium provided by the embodiments of the present invention can identify the sql statements sent by users, automatically select a suitable search engine to search, and increase data search efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 A flowchart of a general SQL statement execution method provided by an embodiment of the present invention;

[0044] Figure 2 A detailed flowchart of a step in a general SQL statement execution method provided in an embodiment of the present invention;

[0045] Figure 3 A detailed flowchart of a step in a general SQL statement execution method provided in an embodiment of the present invention;

[0046] Figure 4 A detailed flowchart of a step in a general SQL statement execution method provided in an embodiment of the present invention;

[0047] Figure 5 A detailed flowchart of a step in a general SQL statement execution method provided in an embodiment of the present invention;

[0048] Figure 6 A functional module diagram of a general SQL statement execution device provided by an embodiment of the present invention;

[0049] Figure 7 A schematic diagram of the structure of an electronic device for implementing the general SQL statement execution method provided by an embodiment of the present invention.

[0050] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0051] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0052] The embodiment of the present application provides a general SQL statement execution method. In the embodiment of the present application, the execution subject of the general SQL statement execution method includes but is not limited to at least one of the electronic devices such as the server, the terminal, etc. that can be configured to execute the method provided by the embodiment of the present application. In other words, the general SQL statement execution method can be executed by software or hardware installed on the terminal device or the server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.

[0053] Reference Figure 1 FIG. 1 is a flow chart of a general SQL statement execution method provided in an embodiment of the present invention. In this embodiment, the general SQL statement execution method includes steps S1-S4:

[0054] S1. Obtain the SQL statement sent by the user according to the pre-built SQL general driver service, and use the pre-trained entity extraction network model to query the service entities of the SQL statement to obtain an object entity set and an action entity set.

[0055] In the embodiment of the present invention, the SQL general driver service is an executable program interface, which is used to add a note of user identity information behind the SQL statement when obtaining the SQL statement sent by the user.

[0056] Furthermore, the entity extraction network model is a network model based on Long Short-Term Memory (LSTM) and Conditional Random Field (CRF), which is used to perform entity extraction on English to obtain active objects, passive objects, and action behaviors. In the embodiment of the present invention, the model parameters of the pre-built English entity extraction model are obtained through transfer learning, and then a training set is used to fine-tune and train an English entity extraction model to obtain an entity extraction network model that can extract object entities and action entities.

[0057] Specifically, referring to Figure 2 As shown, in the embodiment of the present invention, obtaining the SQL statement sent by the user according to the pre-built SQL general driver service includes steps S11 - S12:

[0058] S111. Use a preset interface to obtain the user identity information of the user;

[0059] S112. Obtain the custom statement sent by the user, and use the pre-built SQL general driver service to embed the user identity information into the target area of the custom statement to obtain an SQL statement.

[0060] In the embodiment of the present invention, the target area can be in front of or behind the custom statement. For example, if the custom statement input by the user is "select * from table1", then the SQL statement is "select * from table1 / * Xiaobai 369 * / ", where "Xiaobai 369" is the identity information corresponding to the user.

[0061] Specifically, referring to Figure 3 As shown, in the embodiment of the present invention, using the pre-trained entity extraction network model to query the service entities of the SQL statement to obtain an object entity set and an action entity set includes steps S121 - S124:

[0062] S121, using a pre-trained entity extraction network model to perform part-of-speech recognition and segmentation operations on the SQL statement to obtain a part-of-speech tagged SQL word set;

[0063] S122, performing a position tag quantization operation on the part-of-speech tag sql word set to obtain a word vector set;

[0064] S123, using the long short-term memory neural network in the entity extraction network model to perform feature extraction on the word vector set to obtain output features;

[0065] S124. Utilize the conditional random field in the entity extraction network model to perform entity extraction on the output features, and classify the entity extraction results to obtain an object entity set and an action entity set.

[0066] In the embodiment of the present invention, the customer can express the purpose of the SQL statement in English. Since English sentences are basically composed of symbols, spaces and words, the SQL statement is divided into array words according to spaces and symbols, and then the stop words therein are excluded, such as "an, a, the", etc. The embodiment of the present invention ignores all the stop words to avoid wasting index resources, and then extracts the stems of each word, such as the deformation of "-ing, -ed, -s" in English. The embodiment of the present invention converts each stem into its own meaning, such as "apples" into "apple", and performs part-of-speech tagging on each word to obtain a part-of-speech tagged SQL word set. Then, the part-of-speech tagged SQL word set is positionally marked by a quantization model, such as "select*[0]from[1]table1[3]", and quantized encoding is performed to obtain a word vector set "E0, E1, E2", wherein the E table vector. Finally, the word vector set is entity extracted by the long short-term memory neural network and conditional random field to obtain an object entity set and an action entity set. Wherein, the action entity set includes but is not limited to operations such as query, read, and write. In addition, the long short-term memory neural network is a convolutional neural network with a changed structure. The network operation process in the long short-term memory neural network and the conditional random field is relatively common and will not be elaborated here.

[0067] S2. Using the pre-built sqlreview platform, according to the pre-built permission database, query whether the object entity set has the query permission that matches the action entity set.

[0068] In the embodiment of the present invention, the sqlreview platform is a platform that performs workload analysis on database instances within a selected interval and performs in-depth analysis on SQL running in the database instances, and can be used for index optimization suggestions, sql rewriting suggestions, etc.

[0069] In detail, in an embodiment of the present invention, before using the pre-built sqlreview platform to query whether the object entity set has query permissions that comply with the action entity set based on the pre-built permission database, the method also includes: obtaining a permission query script file, encapsulating the query script file to obtain a permission query function package; and using a socket interface to embed the permission query function package into the sqlreview platform.

[0070] Among them, the permission query script is an executable program based on Java language for querying a fixed permission database. The embodiment of the present invention encapsulates the permission query script through a packaging tool, and then embeds the packaging result into the sqlreview platform through a socket interface, thereby adding a permission query function to the sqlreview platform.

[0071] For more details, please refer to Figure 4 As shown, in the embodiment of the present invention, step S2 includes steps S21-S22:

[0072] S21, constructing an action execution path network with the object entity set and the action entity set;

[0073] S22: Query whether each line in the action execution path network meets the authority standard in the pre-built authority database.

[0074] In the embodiment of the present invention, the object entity set and the action entity set are used to construct an action execution path network, such as Xiaobai 369-read-table1; Xiaobai 369-write-table1, a network composed of two action execution paths. Then, by querying the pre-built permission database, it is determined whether Xiaobai 369 can read table1 and whether Xiaobai 369 can write table1.

[0075] When the object entity set does not have the query authority that matches the action entity set, S3, generating error information.

[0076] Among them, the error message can be a "**error, insufficient authority" template, and the action of insufficient authority can be brought into the template to obtain the error message of "write error, insufficient authority".

[0077] When the object entity set has query permissions that match the action entity set, S4, use the sqlreview platform to perform statement analysis on the sql statement, obtain a calculation engine suitable for the sql statement, and import the sql statement into the calculation engine to obtain the execution result corresponding to the sql statement.

[0078] For more details, please refer to Figure 5 In the embodiment of the present invention, the use of the sqlreview platform to analyze the sql statement to obtain a computing engine suitable for the sql statement includes steps S41-S44:

[0079] S41, using the sqlreview platform, identifying the query type of the sql statement, and querying the query range corresponding to the queried entity in the object entity set;

[0080] When the total amount of data in the query range is less than a preset critical value and the SQL statement is a query request, S42, calling the Impala engine;

[0081] When the total amount of data in the query range is less than the critical value and the SQL statement is not a query request, S43, calling the spark engine;

[0082] When the total amount of data in the query range is greater than or equal to the critical value, S44, calling the hive engine.

[0083] In the embodiment of the present invention, the computing engine is limited by analyzing the total amount of data to be queried. When the total amount of data in the query range is greater than or equal to the critical value, there is a risk of insufficient memory. It should be required to ensure that the SQL executed by the user will not cause an error in the big data cluster and to ensure the query efficiency as much as possible. Therefore, the hive engine can be selected because the hive engine is designed with computing / expansion capabilities for ultra-large data sets; and the impala engine and the spark engine can be used for a small amount of data, because the impala engine is a batch processing engine with very fast processing efficiency. It provides the fastest way to access data stored in the Hadoop distributed file system, and the spark engine is more inclined to big data computing. Therefore, when the sql statement is a query category, the impala engine is selected, and the spark engine is selected for other categories.

[0084] Embodiments of the present invention Embodiments of the present invention can identify the sql statements sent by users through the entity extraction network model, and find the object entity set and the action entity set from the sql statements, wherein the object entities are divided into active objects and passive objects, thereby conveniently controlling the user's authority through the action execution path of active object entity-action entity-passive object entity; in addition, through the sqlreview platform, it is also possible to automatically select a suitable search engine to search for the sql statements according to the total amount of data of the passive object entity and the action type of the action entity, and obtain search results. Therefore, a general sql statement execution method provided by the embodiment of the present invention can identify the sql statements sent by users, automatically select a suitable search engine to search, and increase data search efficiency.

[0085] like Figure 6 , which is a functional module diagram of a general SQL statement execution device provided in one embodiment of the present invention.

[0086] The general SQL statement execution device 100 of the present invention can be installed in an electronic device. According to the functions to be implemented, the general SQL statement execution device 100 can include an entity extraction module 101, an authority authentication module 102 and an allocation engine query module 103. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.

[0087] In this embodiment, the functions of each module / unit are as follows:

[0088] The entity extraction module 101 is used to obtain the SQL statement sent by the user according to the pre-built SQL universal driver service, and use the pre-trained entity extraction network model to query the service entity of the SQL statement to obtain the object entity set and the action entity set;

[0089] The authority authentication module 102 is used to use the pre-built sqlreview platform to query whether the object entity set has the query authority that matches the action entity set according to the pre-built authority database, and to generate an error message when the object entity set does not have the query authority that matches the action entity set;

[0090] The allocation engine query module 103 is used to use the sqlreview platform to perform statement analysis on the sql statement when the object entity set has query permissions that meet the action entity set, obtain a calculation engine suitable for the sql statement, and import the sql statement into the calculation engine to obtain the execution result corresponding to the sql statement.

[0091] In detail, each module described in the general SQL statement execution device 100 described in the embodiment of the present application adopts the same method as described above when used. Figures 1 to 3 The general SQL statement execution method described in the text is the same as the technical means and can produce the same technical effects, so I will not go into details here.

[0092] like Figure 7 , which is a schematic diagram of the structure of an electronic device 1 for implementing a general SQL statement execution method provided by an embodiment of the present invention.

[0093] The electronic device 1 may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a general SQL statement execution program.

[0094] The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The processor 10 is the control core (ControlUnit) of the electronic device 1, and uses various interfaces and lines to connect various components of the entire electronic device, and executes various functions and processes data of the electronic device by running or executing programs or modules stored in the memory 11 (for example, executing a general SQL statement execution program, etc.), and calling data stored in the memory 11.

[0095] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 may also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 11 may also include both an internal storage unit of the electronic device and an external storage device. The memory 11 may not only be used to store application software and various types of data installed in the electronic device, such as the code of a general sql statement execution program, etc., but may also be used to temporarily store data that has been output or is to be output.

[0096] The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.

[0097] The communication interface 13 is used for communication between the above-mentioned electronic device 1 and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.

[0098] Figure 7 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 7 The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0099] For example, although not shown, the electronic device 1 may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, etc. The electronic device 1 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0100] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

[0101] The general SQL statement execution program stored in the memory 11 in the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can achieve:

[0102] According to the pre-built SQL universal driver service, the SQL statement sent by the user is obtained, and the service entity of the SQL statement is queried using the pre-trained entity extraction network model to obtain the object entity set and the action entity set;

[0103] Using the pre-built sqlreview platform, according to the pre-built permission database, query whether the object entity set has the query permission that matches the action entity set;

[0104] When the object entity set does not have the query authority that matches the action entity set, an error message is generated;

[0105] When the object entity set has query permissions that match the action entity set, the sql review platform is used to perform statement analysis on the sql statement to obtain a calculation engine suitable for the sql statement, and the sql statement is imported into the calculation engine to obtain the execution result corresponding to the sql statement.

[0106] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, which will not be repeated here.

[0107] Furthermore, if the module / unit integrated in the electronic device 1 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. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).

[0108] The present invention 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 of an electronic device, the computer program can implement:

[0109] According to the pre-built SQL universal driver service, the SQL statement sent by the user is obtained, and the service entity of the SQL statement is queried using the pre-trained entity extraction network model to obtain the object entity set and the action entity set;

[0110] Using the pre-built sqlreview platform, according to the pre-built permission database, query whether the object entity set has the query permission that matches the action entity set;

[0111] When the object entity set does not have the query authority that matches the action entity set, an error message is generated;

[0112] When the object entity set has query permissions that match the action entity set, the sql review platform is used to perform statement analysis on the sql statement to obtain a calculation engine suitable for the sql statement, and the sql statement is imported into the calculation engine to obtain the execution result corresponding to the sql statement.

[0113] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0114] The modules described as separate components may or may not be physically separated, and the components shown as modules 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 modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0115] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0116] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0117] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.

[0118] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0119] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0120] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.

[0121] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A general SQL statement execution method, characterized in that: The method comprises: According to the pre-built SQL universal driver service, the SQL statement sent by the user is obtained, and the service entity of the SQL statement is queried using the pre-trained entity extraction network model to obtain the object entity set and the action entity set; Using the pre-built sqlreview platform, according to the pre-built permission database, query whether the object entity set has the query permission that matches the action entity set; When the object entity set does not have the query authority that matches the action entity set, an error message is generated; When the object entity set has query permissions that match the action entity set, the sql review platform is used to perform statement analysis on the sql statement to obtain a calculation engine suitable for the sql statement, and the sql statement is imported into the calculation engine to obtain the execution result corresponding to the sql statement.

2. The general SQL statement execution method according to claim 1, characterized in that: The pre-trained entity extraction network model is used to query the service entity of the SQL statement to obtain an object entity set and an action entity set, including: Using a pre-trained entity extraction network model to perform part-of-speech recognition and word segmentation operations on the SQL statement to obtain a part-of-speech tagged SQL word set; Performing a position tag quantization operation on the part-of-speech tag sql word set to obtain a word vector set; Using the long short-term memory neural network in the entity extraction network model to perform feature extraction on the word vector set to obtain output features; The conditional random field in the entity extraction network model is used to perform entity extraction on the output features, and the entity extraction results are classified to obtain an object entity set and an action entity set.

3. The general SQL statement execution method according to claim 1, characterized in that: The method of obtaining the SQL statement sent by the user according to the pre-built SQL universal driver service includes: Using the preset interface, obtain the user's user identity information; The custom statement sent by the user is obtained, and the user identity information is embedded into the target area of ​​the custom statement by using the pre-built SQL universal driver service to obtain the SQL statement.

4. The general SQL statement execution method according to claim 1, characterized in that: The using of the pre-built sqlreview platform and the querying of whether the object entity set has the query authority that matches the action entity set according to the pre-built authority database includes: Constructing an action execution path network with the object entity set and the action entity set; It is queried whether each line in the action execution path network meets the permission standard in the pre-built permission database.

5. The general SQL statement execution method according to claim 1, characterized in that: The step of analyzing the SQL statement using the SQLReview platform to obtain a computing engine suitable for the SQL statement includes: Using the sqlreview platform, the query type of the sql statement is identified, and the query range corresponding to the queried entity in the object entity set is queried; When the total amount of data in the query range is less than a preset critical value and the SQL statement is a query request, calling the Impala engine; When the total amount of data in the query range is less than the critical value and the SQL statement is not a query request, calling the spark engine; When the total amount of data in the query range is greater than or equal to the critical value, the hive engine is called.

6. The general SQL statement execution method according to claim 1, characterized in that: Before querying whether the object entity set has query permissions that match the action entity set using the pre-built sqlreview platform and according to the pre-built permissions database, the method further includes: Obtaining a permission query script file, encapsulating the query script file, and obtaining a permission query function package; The authority query function package is embedded in the sqlreview platform using a socket interface.

7. A general SQL statement execution device, characterized in that: The device comprises: The entity extraction module is used to obtain the SQL statement sent by the user according to the pre-built SQL universal driver service, and use the pre-trained entity extraction network model to query the service entity of the SQL statement to obtain the object entity set and the action entity set; The authority authentication module is used to use the pre-built sqlreview platform to query whether the object entity set has the query authority that matches the action entity set according to the pre-built authority database, and to generate an error message when the object entity set does not have the query authority that matches the action entity set; The allocation engine query module is used to use the sqlreview platform to perform statement analysis on the sql statement when the object entity set has query permissions that meet the action entity set, obtain a calculation engine suitable for the sql statement, and import the sql statement into the calculation engine to obtain the execution result corresponding to the sql statement.

8. The general SQL statement execution device according to claim 7, characterized in that: The pre-trained entity extraction network model is used to query the service entity of the SQL statement to obtain an object entity set and an action entity set, including: Using a pre-trained entity extraction network model to perform part-of-speech recognition and word segmentation operations on the SQL statement to obtain a part-of-speech tagged SQL word set; Performing a position tag quantization operation on the part-of-speech tag sql word set to obtain a word vector set; Using the long short-term memory neural network in the entity extraction network model to perform feature extraction on the word vector set to obtain output features; The conditional random field in the entity extraction network model is used to perform entity extraction on the output features, and the entity extraction results are classified to obtain an object entity set and an action entity set.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the general SQL statement execution method as described in any one of claims 1 to 6.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the general SQL statement execution method as described in any one of claims 1 to 6 is implemented.