CN115729983A - SQL statement paged display method and device, electronic equipment and storage medium - Google Patents

SQL statement paged display method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115729983A
CN115729983A CN202211257134.2A CN202211257134A CN115729983A CN 115729983 A CN115729983 A CN 115729983A CN 202211257134 A CN202211257134 A CN 202211257134A CN 115729983 A CN115729983 A CN 115729983A
Authority
CN
China
Prior art keywords
page
input
sql
statement
sql statement
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
CN202211257134.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.)
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
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 OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN202211257134.2A priority Critical patent/CN115729983A/en
Publication of CN115729983A publication Critical patent/CN115729983A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to a data processing technology, and discloses a method for displaying SQL statements in a page mode, which comprises the following steps: acquiring an SQL statement to be displayed, and identifying parameters to be input and the type of the parameters to be input in the SQL statement to be displayed; calling a preset placeholder according to the type of the parameter to be input to replace the corresponding parameter to be input, and performing semantic recognition on the replaced SQL statement to obtain a text expression statement; carrying out conversion operation of a page input component on the placeholder in the text expression statement, and taking the converted text expression statement as page input information; and acquiring a display page address corresponding to the SQL statement to be displayed, rendering the page input information, and publishing the rendered page input information to a display page corresponding to the display page address. The invention also provides a device, equipment and a medium for the paged display of the SQL sentences. The invention can improve the operation experience of the SQL data.

Description

SQL statement paged display method and device, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of data processing, in particular to a method and a device for page display of SQL sentences, electronic equipment and a computer-readable storage medium.
Background
In daily operation of enterprises, related business data needs to be acquired in time so as to meet the requirements of business data checking, business data analysis, business data circulation and the like.
In the above scenario, business personnel can directly write SQL statements to perform operations of adding, deleting, modifying and checking related business data, but in the actual application process, not all business personnel can master SQL knowledge skillfully, therefore, an enterprise releases a business foreground management system, and provides a related business data query function in the system, but this data query function shields SQL statements, and business personnel cannot accurately grasp the logic of background business data query operations, so that when business data query operations are performed through a foreground, it cannot be guaranteed whether input parameters are in correct positions, and user experience is not high.
Disclosure of Invention
The invention provides a method and a device for displaying a SQL statement page, electronic equipment and a computer-readable storage medium, and mainly aims to improve the operation experience of SQL data.
In order to achieve the above object, the invention provides a method for displaying a SQL statement page, which comprises the following steps:
acquiring an SQL statement to be displayed, and identifying a parameter to be input and the type of the parameter to be input in the SQL statement to be displayed;
calling a preset placeholder according to the type of the parameter to be input to replace the corresponding parameter to be input, and performing semantic recognition on the replaced SQL statement to obtain a text expression statement;
carrying out conversion operation of a page input component on the placeholder in the text expression sentence, and taking the converted text expression sentence as page input information;
and acquiring a display page address corresponding to the SQL sentence to be displayed, rendering the page input information, and issuing the rendered page input information to a display page corresponding to the display page address.
Optionally, the identifying the parameters to be input and the types of the parameters to be input in the SQL statements to be displayed includes:
stripping an operation condition part from the SQL statement to be displayed according to a preset SQL grammar;
identifying replaceable data and position information corresponding to the replaceable data in the operation condition part, and taking the replaceable data as the parameter to be input;
and querying a parameter type matched with the position information of each parameter to be input in a preset parameter position and parameter type mapping table, and taking the queried parameter type as the type of the corresponding parameter to be input.
Optionally, the semantic recognition of the replaced SQL statement to obtain a text expression statement includes:
performing word segmentation on the replaced SQL sentence;
analyzing the incidence relation between each word segmentation by using a preset SQL grammar;
and reordering each participle according to the result of the incidence relation analysis to obtain the text expression sentence.
Optionally, the performing, by the page input component, a conversion operation on the placeholder in the text expression sentence, and taking the converted text expression sentence as page input information includes:
inquiring a page input component label corresponding to each placeholder in a preset comparison relation table of the placeholder and the page component;
and adding the inquired page input component label to the corresponding placeholder, and taking a text expression statement containing the page input component label as the page input information.
Optionally, the obtaining of the display page address corresponding to the SQL statement to be displayed includes:
analyzing the SQL sentence to be displayed to obtain target data to be acquired;
acquiring the service attribute of the target data;
and inquiring the page address corresponding to the service attribute according to a preset page setting rule, and taking the inquired page address as a display page address corresponding to the SQL statement to be displayed.
Optionally, the rendering the page input information and publishing the rendered page input information to the display page corresponding to the display page address includes:
converting the page input information into an HTML file;
constructing a rendering tree according to the HTML file by using a preset engine;
and calculating the coordinates of the rendering tree in the display page, and mapping the rendering tree to the display page according to the coordinates.
In order to solve the above problem, the present invention further provides a device for displaying a paged SQL statement, wherein the device comprises:
an input parameter identification module: the method comprises the steps of acquiring an SQL statement to be displayed, and identifying a parameter to be input and the type of the parameter to be input in the SQL statement to be displayed;
a text conversion module: the system comprises a database, a query language (SQL) statement and a database, wherein the database is used for storing the SQL statement to be input and the database is used for storing the SQL statement to be input;
the page component conversion module: the placeholder in the text expression sentence is subjected to conversion operation of a page input component, and the converted text expression sentence is used as page input information;
a page rendering module: the system is used for acquiring a display page address corresponding to the SQL sentence to be displayed, rendering the page input information, and issuing the rendered page input information to a display page corresponding to the display page address.
Optionally, the text conversion module performs semantic recognition on the replaced SQL statement by the following method:
performing word segmentation on the replaced SQL sentence;
analyzing the incidence relation between each word segmentation by using a preset SQL grammar;
and reordering each participle according to the result of the incidence relation analysis to obtain the text expression sentence.
In order to solve the above problem, the present invention also provides an electronic device, including:
a memory storing at least one computer program; and
and the processor executes the program stored in the memory to realize the SQL statement paging display method.
In order to solve the above problem, the present invention further provides a computer-readable storage medium, where at least one computer program is stored in the computer-readable storage medium, and the at least one computer program is executed by a processor in an electronic device to implement the above-mentioned SQL statement paging display method.
According to the method and the device, the SQL sentence to be displayed is subjected to semantic recognition operation and conversion operation of the parameters to be input and the page input component, and the text expression sentence corresponding to the SQL sentence to be displayed is obtained and serves as the page input information, wherein the text expression sentence not only contains the semantic information of the SQL sentence to be displayed, embodies the logic of the SQL sentence to be displayed and correctly regulates user operation, but also contains the page component information corresponding to the parameters to be input in the SQL sentence to be displayed, so that the operation threshold is favorably reduced, and the user experience is improved.
Drawings
Fig. 1 is a schematic flow chart of a method for displaying a SQL statement page according to an embodiment of the present invention;
fig. 2 is a schematic diagram illustrating a detailed implementation flow of one step in the SQL statement paging display method according to an embodiment of the present invention;
fig. 3 is a schematic diagram illustrating a detailed implementation flow of another step in the SQL statement paged display method according to an embodiment of the present invention;
fig. 4 is a functional block diagram of an SQL statement paged display apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device for implementing the SQL statement paged display method according to an embodiment of the present invention.
The implementation, functional features and advantages of the present invention will be further described with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the invention.
The embodiment of the application provides a method for displaying SQL (structured query language) statements in a page mode. The execution body of the SQL statement paging display method includes but is not limited to a server, a terminal and other electronic devices which can be configured to execute the method provided by the embodiment of the application. In other words, the SQL statement paged display method may be executed by software or hardware installed in a terminal device or a server device, where the software may be a block chain platform. The server side can be an independent server, and can also be a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, cloud functions, cloud storage, network service, cloud communication, middleware service, domain name service, security service, content Delivery Network (CDN), big data and an artificial intelligence platform.
Fig. 1 is a schematic flow chart of a method for displaying a SQL statement page according to an embodiment of the present invention. In this embodiment, the method for displaying the SQL statement page includes:
s1, acquiring an SQL statement to be displayed, and identifying a parameter to be input and the type of the parameter to be input in the SQL statement to be displayed;
in the embodiment of the invention, the SQL statement to be displayed refers to one of the SQL statement sets which are universal and cover business requirements and are obtained by combing and inducing the operations of adding, deleting, modifying and checking related business data according to the actual business requirements.
It can be understood that, in general, the SQL statement includes three parts, namely an operation type, an operation object and an operation condition, where the operation type includes query, insert, modify, delete, etc., the operation object refers to target data that needs to be finally queried, modified or deleted, and the operation condition refers to a definition of the operation object, for example, a total amount of orders from 2019 month 1 to 2020 month 12 31 is queried, where the total amount of orders is the operation object, the operation type is a query, and the query condition is a time period from 2019 month 1 to 2020 month 12 31.
In the embodiment of the present invention, the parameters to be input include parameters that need to be input in the above operation conditions, and the types of the parameters to be input may be classified according to a data input manner that can be provided by an actual service foreground, for example, parameters that can be directly input through the foreground may be classified as text types, parameters that can be input through a foreground drop-down box may be classified as drop-down box types, and in addition, the parameters may also include a radio button type or a multi-choice menu type, and the like.
In detail, referring to fig. 2, the identifying the parameters to be input and the types of the parameters to be input in the SQL statement to be displayed includes:
s11, stripping an operation condition part from the SQL sentence to be displayed according to a preset SQL grammar;
s12, identifying replaceable data in the operation condition part and position information corresponding to the replaceable data, and taking the replaceable data as the parameter to be input;
and S13, inquiring the parameter type matched with the position information of each parameter to be input in a preset parameter position and parameter type mapping table, and taking the inquired parameter type as the type of the corresponding parameter to be input.
Illustratively, the SQL statement to be displayed is "select from table1 white field1like '% value1%", where "from table1 white field1 like'% value1%" is the operation condition section, and where "table1", "field1", "% value1%" is the parameter to be input.
In the embodiment of the invention, the preset parameter position and parameter type mapping table is used for defining the type of the parameter to be input according to the SQL syntax and the input position of the parameter to be input. For example, the parameters to be input, which are usually located behind from and in front of Where, are plain text, and the type of the corresponding parameters to be input may be a text type. If only the parameter to be input is behind the Where, the type of the corresponding parameter to be input is the type of the drop-down selection box.
In the embodiment of the invention, the parameters to be input and the types of the parameters to be input in the SQL sentences to be displayed are identified, so that the corresponding parameters to be input are displayed in a differentiated mode according to the types of the parameters to be input.
S2, calling a preset placeholder according to the type of the parameter to be input to replace the corresponding parameter to be input, and performing semantic recognition on the replaced SQL statement to obtain a text expression statement;
in the embodiment of the present invention, the preset placeholder is a character string corresponding to different types of parameters to be input one to one, that is, a unique character string is specified for each type of parameter to be input, and the character string itself has no meaning, but each character string corresponds to one type of parameter to be input.
For example, a parameter to be entered of a text type may be replaced with a placeholder "$ { text }", and a parameter to be entered of a drop-down box type may be replaced with a placeholder "$ { selector }".
In the embodiment of the invention, the corresponding relation between the type of the parameter to be input and the preset placeholder can be maintained through a comparison table, and the comparison table can be added, deleted and modified according to actual needs in actual service application.
In the embodiment of the invention, the SQL sentence to be displayed can be converted into the sentence consisting of text characters by replacing the parameters to be input in the SQL sentence to be displayed with the preset placeholders, so that the SQL sentence to be displayed can be subjected to semantic recognition operation in the following process.
In the embodiment of the present invention, the replaced SQL statement may be understood as a character set composed of characters, and the replaced SQL statement may be subjected to semantic analysis by using a preset SQL syntax.
In detail, referring to fig. 3, performing semantic recognition on the replaced SQL statement to obtain a text expression statement includes:
s21, performing word segmentation on the replaced SQL sentence;
s22, analyzing the incidence relation between each word segmentation by using a preset SQL grammar;
and S23, reordering each participle according to the result of the incidence relation analysis to obtain the text expression sentence.
Illustratively, the replaced SQL statement is "Select $ { col _ id } between $ { text1} and $ { text2}", and the text expression statement obtained through the semantic recognition is "query a value between $ { text1} and $ { text2 }".
In the embodiment of the invention, the text expression statement carries out natural language conversion on the corresponding SQL statement based on the grammar of the SQL statement to be displayed, and the converted text expression statement is more beneficial to understanding of business personnel and reduces the technical threshold of the business personnel.
S3, carrying out conversion operation of a page input assembly on the placeholder in the text expression sentence, and taking the converted text expression sentence as page input information;
it can be understood that, in the method for displaying the SQL statement in the paged manner provided by the embodiment of the present invention, the specialized SQL statement is finally converted into the easy-to-read and easy-to-operate input guidance information on the page, and therefore, before the SQL statement to be displayed is displayed in the page, the parameter information to be input in the SQL statement to be displayed needs to be converted into the related page input component.
In the embodiment of the present invention, the page input component may be a component corresponding to input information in a user interface based on a JavaScript frame, for example, a text box, a pull-down selection box, a radio box, a check box, and the like.
In detail, the performing a conversion operation of a page input component on the placeholder in the text expression sentence, and using the converted text expression sentence as page input information includes:
inquiring a page input component label corresponding to each placeholder in a preset comparison relation table of the placeholder and the page component;
and adding the inquired page input assembly label to the corresponding placeholder, and taking a text expression statement containing the page input assembly label as the page input information.
In the embodiment of the present invention, the preset table of the mapping relationship between the placeholder and the page component is a one-to-one table of preset placeholder and page component tags, for example, the $ { col _ id } placeholder corresponds to a text box component, and the page component tag may be assigned to $ { col _ id } as T.
In the embodiment of the invention, the page input information not only contains the semantic information of the SQL statement to be displayed, but also contains the page component information corresponding to the parameters to be input in the SQL statement to be displayed, thereby being beneficial to the subsequent page rendering operation aiming at the page input information.
S4, acquiring a display page address corresponding to the SQL sentence to be displayed, rendering the page input information, and issuing the rendered page input information to a display page corresponding to the display page address.
It can be understood that in practical business applications, different pages of the business management foreground generally correspond to different business management categories, such as an order management business page, an inventory management page, a supplier management page, and the like. And the business category and the realized business function related to each SQL statement to be displayed are different, so the addresses of foreground management pages corresponding to different SQL statements to be displayed are also different.
In detail, the obtaining of the display page address corresponding to the SQL statement to be displayed includes:
analyzing the SQL sentence to be displayed to obtain target data to be acquired;
acquiring the service attribute of the target data;
and inquiring the page address corresponding to the service attribute according to a preset page setting rule, and taking the inquired page address as a display page address corresponding to the SQL statement to be displayed.
In the embodiment of the present invention, the preset page setting rule refers to presetting different display pages allocated according to different service ranges according to actual service needs, where each service range corresponds to related service data. For example, the target data is the total order amount, the service attribute corresponding to the target data is order management, and correspondingly, in the preset page setting rule, the page address corresponding to the order management is specified as https:// xxx.
In the embodiment of the invention, before the page input information is released to the display page, semantic information and page component information carried in the page information need to be rendered so as to ensure that the page input information can be normally and reasonably presented on the display page.
In detail, the rendering the page input information and publishing the rendered page input information to the display page corresponding to the display page address includes:
converting the page input information into an HTML file;
constructing a rendering tree according to the HTML file by using a preset engine;
and calculating the coordinates of the rendering tree in the display page, and mapping the rendering tree to the display page according to the coordinates.
In the embodiment of the present invention, the preset engine may be a JavaScript engine, the JavaScript engine may be configured to lay out and modify contents of a page, and generally, the JavaScript engine includes an HTML interpreter and a CSS interpreter, where the HTML interpreter is configured to understand an HTML file and interpret an HTML text into a document object model, and the CSS interpreter is a style sheet interpreter, and is configured to add style information to each page input component in the document object model. And applying the document object model and the style information to the page layout through a JavaScript engine, thereby finishing the rendering of the page input information.
According to the method and the device, the SQL sentence to be displayed is subjected to semantic recognition operation and conversion operation of the parameters to be input and the page input component, and the text expression sentence corresponding to the SQL sentence to be displayed is obtained and serves as the page input information, wherein the text expression sentence not only contains the semantic information of the SQL sentence to be displayed, embodies the logic of the SQL sentence to be displayed and correctly regulates user operation, but also contains the page component information corresponding to the parameters to be input in the SQL sentence to be displayed, so that the operation threshold is favorably reduced, and the user experience is improved.
Fig. 4 is a functional block diagram of an apparatus for displaying a paged SQL statement according to an embodiment of the present invention.
The SQL statement paging display apparatus 100 of the present invention may be installed in an electronic device. According to the realized function, the SQL statement paging display device 100 comprises an input parameter identification module 101, a text conversion module 102, a page component conversion module 103 and a page rendering module 104. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the input parameter identification module 101: the method comprises the steps of acquiring an SQL statement to be displayed, and identifying a parameter to be input and the type of the parameter to be input in the SQL statement to be displayed;
the text conversion module 102: the system comprises a database, a query language (SQL) statement and a database, wherein the database is used for storing the SQL statement to be input and the database is used for storing the SQL statement to be input;
the page component conversion module 103: the placeholder in the text expression statement is subjected to conversion operation of a page input component, and the converted text expression statement is used as page input information;
the page rendering module 104: and the system is used for acquiring a display page address corresponding to the SQL statement to be displayed, rendering the page input information, and publishing the rendered page input information to a display page corresponding to the display page address.
In this embodiment, the SQL statement paging display apparatus 100 includes:
step one, acquiring an SQL statement to be displayed, and identifying parameters to be input and the type of the parameters to be input in the SQL statement to be displayed;
in the embodiment of the invention, the SQL statement to be displayed refers to one of the SQL statement sets which are universal and cover business requirements and are obtained by combing and inducing the operations of adding, deleting, modifying and checking related business data according to the actual business requirements.
It can be understood that, in general, the SQL statement includes three parts, i.e., an operation type, an operation object, and an operation condition, wherein the operation type includes query, insert, modify, delete, etc., the operation object refers to target data that needs to be queried, modified, or deleted finally, and the operation condition refers to a definition of the operation object, for example, a total amount of orders from 2019, 1 month, and 1 day to 2020, 12 month, and 31 days is queried, wherein the total amount of orders is the operation object, the operation type is a query, and the query condition is a time period from 2019, 1 month, and 1 day to 2020, 12 month, and 31 days.
In the embodiment of the present invention, the parameters to be input include parameters that need to be input in the above operation conditions, and the types of the parameters to be input may be classified according to a data input manner that can be provided by an actual service foreground, for example, parameters that can be directly input through the foreground may be classified as text types, parameters that can be input through a foreground drop-down box may be classified as drop-down box types, and in addition, the parameters may also include a radio button type or a multi-choice menu type, and the like.
In detail, the identifying the parameters to be input and the types of the parameters to be input in the SQL statements to be displayed includes:
according to a preset SQL syntax, stripping an operation condition part from the SQL sentence to be displayed;
identifying replaceable data and position information corresponding to the replaceable data in the operation condition part, and taking the replaceable data as the parameter to be input;
and querying a parameter type matched with the position information of each parameter to be input in a preset parameter position and parameter type mapping table, and taking the queried parameter type as the type of the corresponding parameter to be input.
Illustratively, the SQL statement to be presented is "select from table1 corner field1 like"% value1% ", where" from table1 corner field1like "% value1%" is the operation condition portion, and "table1", "field1", "value 1%" is the parameter to be input.
In the embodiment of the invention, the preset parameter position and parameter type mapping table is used for defining the type of the parameter to be input according to the SQL syntax and the input position of the parameter to be input. For example, the parameters to be input, which are usually located behind from and in front of Where, are plain text, and the type of the corresponding parameters to be input may be a text type. If only the parameter to be input is behind the Where, the type of the corresponding parameter to be input is usually the drop-down box type.
In the embodiment of the invention, the parameters to be input and the types of the parameters to be input in the SQL sentences to be displayed are identified, so that the corresponding parameters to be input are displayed in a differentiated mode according to the types of the parameters to be input.
Step two, calling a preset placeholder according to the type of the parameter to be input to replace the corresponding parameter to be input, and performing semantic recognition on the replaced SQL statement to obtain a text expression statement;
in the embodiment of the present invention, the preset placeholder is a character string corresponding to different types of parameters to be input one to one, that is, a unique character string is specified for each type of parameter to be input, and the character string itself has no meaning, but each character string corresponds to one type of parameter to be input.
For example, a parameter to be entered of a text type may be replaced with a placeholder "$ { text }", and a parameter to be entered of a drop-down box type may be replaced with a placeholder "$ { selector }".
In the embodiment of the invention, the corresponding relation between the type of the parameter to be input and the preset placeholder can be maintained through a comparison table, and the comparison table can be added, deleted and modified according to actual needs in actual service application.
In the embodiment of the invention, the parameters to be input in the SQL sentences to be displayed are replaced by the preset placeholders, so that the SQL sentences to be displayed can be converted into the sentences composed of text characters, and the SQL sentences to be displayed can be subjected to semantic recognition operation in the subsequent process.
In the embodiment of the invention, the replaced SQL statement can be understood as a character set consisting of characters, and the replaced SQL statement can be subjected to semantic analysis by using a preset SQL grammar.
In detail, the semantic recognition of the replaced SQL statement to obtain a text expression statement includes:
performing word segmentation on the replaced SQL sentence;
analyzing the incidence relation between each word segmentation by using a preset SQL grammar;
and reordering each participle according to the result of the incidence relation analysis to obtain the text expression sentence.
Illustratively, the replaced SQL statement is "Select $ { col _ id } between $ text1} and $ { text2}", and the text expression statement obtained after the semantic recognition is "query a value between $ { text1} and $ { text2 }".
In the embodiment of the invention, the text expression statement carries out natural language conversion on the corresponding SQL statement based on the grammar of the SQL statement to be displayed, and the converted text expression statement is more beneficial to understanding of business personnel and reduces the technical threshold of the business personnel.
Thirdly, converting the placeholders in the text expression sentences into page input components, and taking the converted text expression sentences as page input information;
it can be understood that, with the SQL statement paged display method provided in the embodiment of the present invention, the specialized SQL statement is finally converted into the easy-to-read and easy-to-operate input guidance information on the page, and therefore, before the SQL statement to be displayed is subjected to page display, the parameter information to be input in the SQL statement to be displayed needs to be converted into the relevant page input component.
In the embodiment of the present invention, the page input component may be a component corresponding to input information in a user interface based on a JavaScript frame, for example, a text box, a drop-down selection box, a radio box, a check box, and the like.
In detail, the performing, by the page input component, a conversion operation on the placeholder in the text expression statement, and taking the converted text expression statement as page input information includes:
inquiring a page input assembly label corresponding to each placeholder in a preset comparison relation table of the placeholder and a page assembly;
and adding the inquired page input component label to the corresponding placeholder, and taking a text expression statement containing the page input component label as the page input information.
In the embodiment of the present invention, the preset table of the comparison relationship between the placeholder and the page component is a one-to-one table of the placeholder and the page component tag, for example, the $ { col _ id } placeholder corresponds to a text box component, and the page component tag may be allocated to $ { col _ id } as T.
In the embodiment of the invention, the page input information not only contains the semantic information of the SQL statement to be displayed, but also contains the page component information corresponding to the parameters to be input in the SQL statement to be displayed, thereby being beneficial to the subsequent page rendering operation aiming at the page input information.
And step four, acquiring a display page address corresponding to the SQL statement to be displayed, rendering the page input information, and publishing the rendered page input information to a display page corresponding to the display page address.
It can be understood that in practical business applications, different pages of the business management foreground generally correspond to different business management categories, such as an order management business page, an inventory management page, a supplier management page, and the like. And the service category and the realized service function related to each SQL sentence to be displayed are different, so that the addresses of foreground management pages corresponding to different SQL sentences to be displayed are also different.
In detail, the obtaining of the display page address corresponding to the SQL statement to be displayed includes:
analyzing the SQL sentence to be displayed to obtain target data to be acquired;
acquiring the service attribute of the target data;
and inquiring the page address corresponding to the service attribute according to a preset page setting rule, and taking the inquired page address as a display page address corresponding to the SQL statement to be displayed.
In the embodiment of the present invention, the preset page setting rule refers to presetting different display pages allocated according to different service ranges according to actual service needs, where each service range corresponds to related service data. For example, the target data is the total order amount, the service attribute corresponding to the target data is order management, and correspondingly, in the preset page setting rule, the page address corresponding to the order management is specified as https:// xxx.
In the embodiment of the invention, before the page input information is published to the display page, semantic information and page component information carried in the page information need to be rendered so as to ensure that the page input information can be normally and reasonably presented on the display page.
In detail, the rendering the page input information and publishing the rendered page input information to the display page corresponding to the display page address includes:
converting the page input information into an HTML file;
constructing a rendering tree according to the HTML file by using a preset engine;
and calculating the coordinates of the rendering tree in the display page, and mapping the rendering tree to the display page according to the coordinates.
In the embodiment of the present invention, the preset engine may be a JavaScript engine, the JavaScript engine may be configured to lay out and modify contents of a page, and generally, the JavaScript engine includes an HTML interpreter and a CSS interpreter, where the HTML interpreter is configured to understand an HTML file and interpret an HTML text into a document object model, and the CSS interpreter is a style sheet interpreter, and is configured to add style information to each page input component in the document object model. And applying the document object model and the style information to the page layout through a JavaScript engine, thereby finishing the rendering of the page input information.
According to the method and the device, through carrying out semantic recognition operation and conversion operation of the parameters to be input and the page input components on the SQL sentences to be displayed, the text expression sentences corresponding to the SQL sentences to be displayed are obtained and serve as the page input information, wherein the text expression sentences not only contain the semantic information of the SQL sentences to be displayed, reflect the logic of the SQL sentences to be displayed and correctly standardize user operation, but also contain the page component information corresponding to the parameters to be input in the SQL sentences to be displayed, so that the operation threshold is reduced, and the user experience is improved.
Fig. 5 is a schematic structural diagram of an electronic device for implementing a paged SQL statement display method according to an embodiment of the present invention.
The electronic device 1 may include a processor 10, a memory 11 and a bus, and may further include a computer program, such as an SQL statement paging presentation program, stored in the memory 11 and executable on the processor 10.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, e.g. a removable hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used to store not only application software installed in the electronic device 1 and various types of data, such as codes of a SQL statement paging presentation program, but also temporarily store data that has been output or is to be output.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged 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. The processor 10 is a Control Unit of the electronic device, and is connected to each component of the whole electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device 1 by running or executing programs or modules (for example, SQL statement paged display programs, etc.) stored in the memory 11 and calling data stored in the memory 11.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
Fig. 5 only shows an electronic device with components, and it will be understood by a person skilled in the art that the structure shown in fig. 5 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or a combination of certain components, or a different arrangement of components.
For example, although not shown, the electronic device 1 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so as to implement functions of charge management, discharge management, power consumption management, and the like through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 1 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device 1 may further include a network interface, and 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 are generally used to establish a communication connection between the electronic device 1 and another electronic device.
Optionally, the electronic device 1 may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device 1 and for displaying a visualized user interface.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The SQL statement paging presentation program stored in the memory 11 of the electronic device 1 is a combination of a plurality of instructions, and when running in the processor 10, can implement:
acquiring an SQL statement to be displayed, and identifying parameters to be input and the type of the parameters to be input in the SQL statement to be displayed;
calling a preset placeholder according to the type of the parameter to be input to replace the corresponding parameter to be input, and performing semantic recognition on the replaced SQL statement to obtain a text expression statement;
carrying out conversion operation of a page input component on the placeholder in the text expression statement, and taking the converted text expression statement as page input information;
and acquiring a display page address corresponding to the SQL sentence to be displayed, rendering the page input information, and issuing the rendered page input information to a display page corresponding to the display page address.
And according to the information of the line number and the column number in the Excel form to be put in storage, associating the fact table with the dimension table to obtain a data conversion table, and executing storage operation on the data conversion table.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. The computer readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, read-Only Memory (ROM).
The present invention also provides a computer-readable storage medium, storing a computer program which, when executed by a processor of an electronic device, may implement:
acquiring an SQL statement to be displayed, and identifying a parameter to be input and the type of the parameter to be input in the SQL statement to be displayed;
calling a preset placeholder according to the type of the parameter to be input to replace the corresponding parameter to be input, and performing semantic recognition on the replaced SQL statement to obtain a text expression statement;
carrying out conversion operation of a page input component on the placeholder in the text expression statement, and taking the converted text expression statement as page input information;
and acquiring a display page address corresponding to the SQL sentence to be displayed, rendering the page input information, and issuing the rendered page input information to a display page corresponding to the display page address.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a string of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, which is used for verifying the validity (anti-counterfeiting) of the information and generating a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The embodiment of the application can acquire and process related data based on the holographic projection technology. Among them, artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not to denote any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A method for displaying SQL sentences in a page mode is characterized by comprising the following steps:
acquiring an SQL statement to be displayed, and identifying parameters to be input and the type of the parameters to be input in the SQL statement to be displayed;
calling a preset placeholder according to the type of the parameter to be input to replace the corresponding parameter to be input, and performing semantic recognition on the replaced SQL statement to obtain a text expression statement;
carrying out conversion operation of a page input component on the placeholder in the text expression sentence, and taking the converted text expression sentence as page input information;
and acquiring a display page address corresponding to the SQL sentence to be displayed, rendering the page input information, and issuing the rendered page input information to a display page corresponding to the display page address.
2. The SQL statement paged display method according to claim 1, wherein the identifying the parameters to be input and the types of the parameters to be input in the SQL statement to be displayed comprises:
stripping an operation condition part from the SQL statement to be displayed according to a preset SQL grammar;
identifying replaceable data and position information corresponding to the replaceable data in the operation condition part, and taking the replaceable data as the parameter to be input;
and querying a parameter type matched with the position information of each parameter to be input in a preset parameter position and parameter type mapping table, and taking the queried parameter type as the type of the corresponding parameter to be input.
3. The SQL statement paged display method according to claim 1, wherein the semantic recognition of the replaced SQL statement to obtain a text expression statement comprises:
performing word segmentation on the replaced SQL sentence;
analyzing the incidence relation between each word segmentation by using a preset SQL grammar;
and reordering each participle according to the result of the incidence relation analysis to obtain the text expression sentence.
4. The method for displaying the paged SQL statement of claim 1, wherein the converting operation of the placeholder in the text expression statement to the page input component and the taking of the converted text expression statement as the page input information comprises:
inquiring a page input component label corresponding to each placeholder in a preset comparison relation table of the placeholder and the page component;
and adding the inquired page input component label to the corresponding placeholder, and taking a text expression statement containing the page input component label as the page input information.
5. The SQL statement paged display method according to claim 1, wherein the acquiring a display page address corresponding to the SQL statement to be displayed comprises:
analyzing the SQL sentence to be displayed to obtain target data to be acquired;
acquiring the service attribute of the target data;
and inquiring the page address corresponding to the service attribute according to a preset page setting rule, and taking the inquired page address as a display page address corresponding to the SQL statement to be displayed.
6. The method for paged presentation of SQL statements according to claim 1, wherein the rendering the page input information and the publishing the rendered page input information to the presentation page corresponding to the presentation page address comprises:
converting the page input information into an HTML file;
constructing a rendering tree according to the HTML file by using a preset engine;
and calculating the coordinates of the rendering tree in the display page, and mapping the rendering tree to the display page according to the coordinates.
7. An apparatus for displaying a paged SQL statement, the apparatus comprising:
an input parameter identification module: the method comprises the steps of obtaining an SQL statement to be displayed, and identifying parameters to be input and the type of the parameters to be input in the SQL statement to be displayed;
a text conversion module: the system is used for calling a preset placeholder according to the type of the parameter to be input to replace the corresponding parameter to be input, and performing semantic recognition on the replaced SQL statement to obtain a text expression statement;
the page component conversion module: the placeholder in the text expression statement is subjected to conversion operation of a page input component, and the converted text expression statement is used as page input information;
a page rendering module: and the system is used for acquiring a display page address corresponding to the SQL statement to be displayed, rendering the page input information, and publishing the rendered page input information to a display page corresponding to the display page address.
8. The apparatus according to claim 7, wherein the text conversion module performs semantic recognition on the replaced SQL statement by:
performing word segmentation on the replaced SQL sentence;
analyzing the incidence relation between each word segmentation by using a preset SQL grammar;
and reordering each participle according to the result of the incidence relation analysis to obtain the text expression sentence.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the SQL statement paged presentation method according to any one of claims 1 to 6.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the SQL statement paged presentation method according to any one of claims 1 to 6.
CN202211257134.2A 2022-10-14 2022-10-14 SQL statement paged display method and device, electronic equipment and storage medium Pending CN115729983A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211257134.2A CN115729983A (en) 2022-10-14 2022-10-14 SQL statement paged display method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211257134.2A CN115729983A (en) 2022-10-14 2022-10-14 SQL statement paged display method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115729983A true CN115729983A (en) 2023-03-03

Family

ID=85293591

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211257134.2A Pending CN115729983A (en) 2022-10-14 2022-10-14 SQL statement paged display method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115729983A (en)

Similar Documents

Publication Publication Date Title
CN111813963A (en) Knowledge graph construction method and device, electronic equipment and storage medium
CN113961584A (en) Method and device for analyzing field blood relationship, electronic equipment and storage medium
CN114979120B (en) Data uploading method, device, equipment and storage medium
CN112115145A (en) Data acquisition method and device, electronic equipment and storage medium
CN115048111B (en) Code generation method, device, equipment and medium based on metadata
CN111897856A (en) Supervision message generation method and device, electronic equipment and readable storage medium
CN114398346A (en) Data migration method, device, equipment and storage medium
CN114491646A (en) Data desensitization method and device, electronic equipment and storage medium
CN114138243A (en) Function calling method, device, equipment and storage medium based on development platform
CN113722533A (en) Information pushing method and device, electronic equipment and readable storage medium
CN115729983A (en) SQL statement paged display method and device, electronic equipment and storage medium
CN115496166A (en) Multitasking method and device, electronic equipment and storage medium
CN115544566A (en) Log desensitization method, device, equipment and storage medium
CN114398433A (en) Chart information report generation method and device, electronic equipment and storage medium
CN115062023A (en) Wide table optimization method and device, electronic equipment and computer readable storage medium
CN114780688A (en) Text quality inspection method, device and equipment based on rule matching and storage medium
CN114004591A (en) Automatic user-defined form auditing method and device, electronic equipment and storage medium
CN114943306A (en) Intention classification method, device, equipment and storage medium
CN111859452A (en) Page information checking method, device and equipment and computer readable storage medium
CN116226563A (en) Rich text editing method, rich text editing device, electronic equipment and computer readable storage medium
CN114091106A (en) Report file security rule establishing method, device, equipment and storage medium
CN115905660A (en) Network security data acquisition method, device, equipment and storage medium
CN115098514A (en) Method and device for identifying scene based on annotation, electronic equipment and storage medium
CN114625755A (en) Script checking method and device, electronic equipment and storage medium
CN114581044A (en) Scheme configuration method and device, electronic equipment and readable storage 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