Excel function conversion method and related device based on SQL database
Through the Excel function conversion method based on SQL database, scan and analyze and construct SQL processing functions, the problem of slow SQL database function modification caused by changes in logical table structure in low-code platforms is solved, efficient update of logical tables is achieved, and databases are improved efficiency.
Patent Information
- Application Number
- CN202210514000.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-11
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2042-05-11
AI Technical Summary
Traditional database query methods are inflexible, especially when the logical table structure changes frequently in low-code platforms, resulting in slow modification of SQL database functions, affecting database efficiency.
Provides an Excel function conversion method based on SQL database. By receiving Excel data, scanning and analyzing processing function expressions, constructing syntax parsing data and generating SQL processing functions, implementing efficient updates and modifications of logical tables, and avoiding direct modifications to physical tables.
It realizes efficient updates and modifications of logical tables during the system operation stage, solves the problem of slow modification of SQL database functions, and improves the overall efficiency of the database.
Smart Images

Figure CN114942766B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of SQL function conversion, and in particular to an Excel function conversion method based on SQL database and related devices. Background Art
[0002] When querying the database, the traditional query method can only query through the defined fields in the physical table of the database. Under the premise of preventing SQL injection, the SQL WHERE clause is generally assembled in the system. This query method is not flexible and can only query data through simple string comparison, date comparison, and value size comparison, which are pre-defined query methods in the interface. In the low-code development platform, in order to meet the flexibility of the table structure, the data is not stored in the physical table, but in the logical table. The physical table in the non-traditional database, the low-code platform simulates a layer of logical table on the physical table. Simply put, it is simulated based on the Json data type of the Postgres database. During the system operation stage, the table structure and field information of the logical table will change as the user changes its business structure, and the change cost is low and the change frequency is fast. Users of Excel in the low-code platform hope that they can flexibly combine fields and Excel functions for query operations in the database, and hope that this query method is as efficient as the query method of the physical table.
[0003] Traditional databases need to modify the physical table to modify the table structure, and table locks will occur during the DDL execution, affecting the overall database execution efficiency. Therefore, a technology is needed to solve the problem that the current AQL database function modification is slow due to the relationship between the logical table and the physical table. Summary of the invention
[0004] The main purpose of the present invention is to solve the technical problem that the current AQL database function modification has a slow modification speed due to the relationship between the logical table and the physical table.
[0005] The first aspect of the present invention provides an Excel function conversion method based on a SQL database, comprising the steps of:
[0006] Receive Excel data to be converted;
[0007] Scanning and analyzing the Excel data to locate the function expression of the Excel data;
[0008] Performing lexical scanning on the function expression to locate blank characters in the function expression;
[0009] Filter and delete the blank characters of the function expression to obtain function lexical data;
[0010] Analyze the logic tree data of the function lexical data, and construct grammar parsing data corresponding to the function lexical data based on the logic tree data;
[0011] Based on the grammatical parsing data, the data in the SQL database is executed to generate an SQL processing function.
[0012] Optionally, in a first implementation of the first aspect of the present invention, analyzing the logic tree data of the function lexical data and constructing the grammatical parsing data corresponding to the function lexical data based on the logic tree data includes:
[0013] Extracting a grammatical character segment of the function lexical data;
[0014] Performing operation processing on the grammatical character segment to extract the referenced character segment and the referenced character segment literal corresponding to the grammatical character segment;
[0015] Based on the referenced character segment and the referenced character segment literal, generate syntax parsing data corresponding to the function lexical data.
[0016] Optionally, in a second implementation of the first aspect of the present invention, executing the data in the SQL database based on the grammatical parsing data to generate an SQL processing function includes:
[0017] The grammatical parsing data is run and processed, and the reference character segment corresponding to the grammatical parsing data is mapped to a reference node of the Json data type in a preset Postgres database, and an SQL processing function is generated.
[0018] Optionally, in a third implementation of the first aspect of the present invention, after filtering and deleting blank characters of the function expression to obtain function lexical data, and before analyzing the logic tree data of the function lexical data and constructing grammatical parsing data corresponding to the function lexical data based on the logic tree data, it also includes:
[0019] Performing character correctness verification processing on the function lexical data to generate a verification result;
[0020] Determine whether there is no operation instruction data in the verification result;
[0021] If there is no operation instruction data, the conversion process is terminated;
[0022] If no no-operation instruction data exists, the function lexical data is determined to be legal data, so as to enter the step of analyzing the logic tree data of the function lexical data.
[0023] Optionally, in a fourth implementation of the first aspect of the present invention, after executing the data in the SQL database based on the grammatical parsing data to generate an SQL processing function, the method further includes:
[0024] Calculate the MD5 digest value corresponding to the function expression, and generate a mapping relationship between the MD5 digest value and the SQL processing function;
[0025] The MD5 digest value is written into a preset MD5 digest value history record, and the SQL processing function is stored in a function generation record.
[0026] Optionally, in a fifth implementation of the first aspect of the present invention, after scanning and analyzing the Excel data to locate the function expression of the Excel data, and before lexically scanning the function expression to locate the blank characters of the function expression, the method further includes:
[0027] Analyze the MD5 digest value corresponding to the function expression, and read the preset MD5 digest value history record;
[0028] Determine whether the MD5 digest value exists in the MD5 digest value history record;
[0029] If it exists, then based on the mapping relationship between the MD5 digest value historical record and the preset function generation record, the SQL processing function corresponding to the MD5 digest value is queried, and the conversion process is terminated.
[0030] A second aspect of the present invention provides an Excel function conversion device for an SQL database, the Excel function conversion device based on the SQL database comprising:
[0031] A receiving module, used for receiving Excel data to be converted;
[0032] A positioning module, used for scanning, analyzing and processing the Excel data to locate the function expression of the Excel data;
[0033] A scanning module, used for performing lexical scanning on the function expression to locate blank characters of the function expression;
[0034] A filtering and deleting module, used for filtering and deleting blank characters in the function expression to obtain function lexical data;
[0035] A construction module, used for analyzing the logic tree data of the function lexical data, and constructing the grammatical parsing data corresponding to the function lexical data based on the logic tree data;
[0036] The execution generation module is used to parse the data based on the grammar, execute the data in the SQL database, and generate an SQL processing function.
[0037] The third aspect of the present invention provides an Excel function conversion device based on SQL database, comprising: a memory and at least one processor, wherein instructions are stored in the memory, and the memory and the at least one processor are interconnected via a line; the at least one processor calls the instructions in the memory so that the Excel function conversion device based on SQL database executes the above-mentioned Excel function conversion method based on SQL database.
[0038] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the above-mentioned Excel function conversion method based on SQL database.
[0039] In the embodiment of the present invention, in the current implementation of the low-code platform, the tables that users see are all logical tables, which are simulated in the Postgres database through the Json data type. In the update and modification of the logical table, there is no need to change the physical table, so the update and modification of the logical table can be efficiently implemented during the system operation phase, solving the current technical problem of slow conversion of SQL database functions. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A schematic diagram of an embodiment of an Excel function conversion method based on a SQL database in an embodiment of the present invention;
[0041] Figure 2 It is a schematic diagram of an embodiment of an Excel function conversion device based on SQL database in an embodiment of the present invention;
[0042] Figure 3 It is another embodiment schematic diagram of the Excel function conversion device based on SQL database in the embodiment of the present invention;
[0043] Figure 4 The figure is a schematic diagram of an embodiment of an Excel function conversion device based on a SQL database in an embodiment of the present invention. DETAILED DESCRIPTION
[0044] The embodiment of the present invention provides an Excel function conversion method based on SQL database and related devices.
[0045] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0046] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 , an embodiment of an Excel function conversion method based on a SQL database in an embodiment of the present invention, the Excel function conversion method based on a SQL database comprises:
[0047] 101. Receive Excel data to be converted;
[0048] 102. Scan and analyze the Excel data to locate a function expression of the Excel data;
[0049] In steps 101-102, the Excel data to be converted is first received, and then the function name and function structure of the Excel data are scanned to obtain a function expression. The function expression may be specifically as follows:
[0050]
[0051] The above structure is the scanned function expression. The following steps require mapping and adjustment of the function expression.
[0052] Furthermore, after step 102 and before step 103, the following steps may be performed:
[0053] 1021. Analyze the MD5 digest value corresponding to the function expression, and read the preset MD5 digest value history record;
[0054] 1022. Determine whether the MD5 digest value exists in the MD5 digest value historical record;
[0055] 1023. If it exists, based on the mapping relationship between the MD5 digest value historical record and the preset function generation record, query the SQL processing function corresponding to the MD5 digest value, and terminate the conversion process.
[0056] In steps 1021-1023, after analyzing the function expression, continue to analyze the MD5 digest value of the function expression, and then read the historical record of the MD5 digest value to analyze whether the MD5 digest value appears in the historical record. If it does appear, there is no need to re-run the SQL database to generate a new SQL processing function. Directly call the SQL processing function corresponding to the MD5 digest value in the historical record, and directly output the result to complete the conversion process. However, if the MD5 digest value does not appear in the historical record, the following analysis steps 103-106 are required to convert the Excel function into an SQL processing function, because the historical record is also generated in the following analysis steps and cannot appear out of thin air.
[0057] 103. Perform lexical scanning on the function expression to locate blank characters in the function expression;
[0058] 104. Filter and delete the blank characters in the function expression to obtain function lexical data;
[0059] In the examples 103-104, the input function expression is analyzed, all lexical units are scanned and analyzed, redundant blank characters are filtered out, and a lexical unit sequence is output, which is output to the parser for grammar parsing. For example, the following function expression is converted:
[0060]
[0061] Converted to AND(SUM({column1},{column2})=10,OR({column3}={column4},{column5}>NOW())).
[0062] Furthermore, after 104 and before 105, the following steps are also included:
[0063] 1041. Perform character correctness verification processing on the function lexical data to generate a verification result;
[0064] 1042. Determine whether there is no operation instruction data in the verification result;
[0065] 1043. If there is no operation instruction data, the conversion process is terminated;
[0066] 1044. If no no-operation instruction data exists, the function lexical data is determined to be legal data, so as to enter the step of analyzing the logic tree data of the function lexical data.
[0067] In steps 1041-1044, the correctness of all lexical units and the correctness of function usage are verified to obtain the verification result. It is determined whether the verification result is data without operation instructions. The SQL database needs to perform some data processing processes such as adding, deleting, modifying, and checking. If there is no operation instruction, the function is meaningless and the conversion is terminated. If it is not meaningless instruction data, step 105 can be executed.
[0068] 105. Analyze the logic tree data of the function lexical data, and construct grammar parsing data corresponding to the function lexical data based on the logic tree data;
[0069] In this embodiment, the lexical unit sequence is parsed, and the correctness of all lexical units and the correctness of function usage are verified, the referenced fields and literals are extracted, and the corresponding syntax parse tree is constructed. Each node of the syntax parse tree contains a raw information structure of the function, literal or referenced field, and the syntax parse tree is then output to the field parser for field parsing.
[0070] The field parser will verify the legality of the referenced fields in the syntax tree and whether they exist in the logic table. If the above parsing and verification processes are passed, the syntax parsing tree will be output to the function executor for final execution.
[0071] Furthermore, at 105, the following steps may be performed:
[0072] 1051. Extract the grammatical character segment of the function lexical data;
[0073] 1052. Perform operation processing on the grammatical character segment to extract the referenced character segment and the referenced character segment literal corresponding to the grammatical character segment;
[0074] 1053. Generate syntax parsing data corresponding to the function lexical data based on the referenced character segment and the referenced character segment literal.
[0075] In steps 1051-1053, the grammatical character segments of AND, SUM, OR, and NOW are extracted, and AND, SUM, OR, and NOW are respectively run to obtain the reference character segments and reference character segment literals corresponding to these grammatical character segments. Then, based on the reference character segments and reference character segment literals, grammatical parsing data is generated.
[0076] 106. Based on the grammatical parsing data, execute the data in the SQL database to generate an SQL processing function.
[0077] In this embodiment, the function-SQL mapping module provides a mapping relationship between functions and SQL, which can be pre-configured or dynamically configured through a database. The function executor can use it to make a function output a result SQL.
[0078] The function executor will execute in the order of the entire syntax parse tree. Each function is constructed and outputs the set mapping SQL through the function-SQL mapping module. The referenced fields will be mapped into the Json data type reference node in the Postgres database, such as "cells->>'column1'". The function executor will assemble them completely according to the syntax parse tree. After completion, the MD5 digest value of the expression and the result SQL will be asynchronously sent to the cache module for caching, and the result SQL will be output.
[0079] Furthermore, at 106, the following steps may be performed:
[0080] 1061. Run processing on the syntax parsing data, map the reference character segment corresponding to the syntax parsing data to a reference node of the Json data type in a preset Postgres database, and generate an SQL processing function.
[0081] In step 1061, the syntax parse tree is executed in sequence. Each function is constructed and outputs the set mapping SQL through the function-SQL mapping module. The referenced fields will be mapped into the Json data type reference node in the Postgres database, such as "cells->>'column1'". The function executor will assemble them completely according to the syntax parse tree. After completion, the MD5 digest value of the expression and the result SQL will be asynchronously sent to the cache module for caching, and the result SQL will be output.
[0082] The final converted SQL processing function is as follows:
[0083]
[0084] Furthermore, after step 106, the following steps may be performed:
[0085] 1062. Calculate the MD5 digest value corresponding to the function expression, and generate a mapping relationship between the MD5 digest value and the SQL processing function;
[0086] 1063. Write the MD5 digest value into a preset MD5 digest value historical record, and store the SQL processing function into a function generation record.
[0087] In steps 1062-1063, the MD5 digest value of the function expression is bound to the result SQL. If the input function expression hits the cache, the subsequent parsing and execution processes can be omitted and the result SQL can be obtained directly.
[0088] In the embodiment of the present invention, in the current implementation of the low-code platform, the tables that users see are all logical tables, which are simulated in the Postgres database through the Json data type. In the update and modification of the logical table, there is no need to change the physical table, so the update and modification of the logical table can be efficiently implemented during the system operation phase, solving the current technical problem of slow conversion of SQL database functions.
[0089] The Excel function conversion method based on SQL database in the embodiment of the present invention is described above. The Excel function conversion device based on SQL database in the embodiment of the present invention is described below. Figure 2 In one embodiment of the present invention, an Excel function conversion device based on a SQL database is provided. The Excel function conversion device based on a SQL database comprises:
[0090] A receiving module 201 is used to receive Excel data to be converted;
[0091] A positioning module 202 is used to scan, analyze and process the Excel data to locate the function expression of the Excel data;
[0092] A scanning module 203 is used to perform lexical scanning on the function expression to locate blank characters in the function expression;
[0093] A filtering and deleting module 204 is used to filter and delete blank characters in the function expression to obtain function lexical data;
[0094] A construction module 205 is used to analyze the logic tree data of the function lexical data, and construct grammar parsing data corresponding to the function lexical data based on the logic tree data;
[0095] The execution generation module 206 is used to parse the data based on the syntax, execute the data in the SQL database, and generate an SQL processing function.
[0096] In the embodiment of the present invention, in the current implementation of the low-code platform, the tables that users see are all logical tables, which are simulated in the Postgres database through the Json data type. In the update and modification of the logical table, there is no need to change the physical table, so the update and modification of the logical table can be efficiently implemented during the system operation phase, solving the current technical problem of slow conversion of SQL database functions.
[0097] See also Figure 3 , another embodiment of the Excel function conversion device based on SQL database in the embodiment of the present invention, the Excel function conversion device based on SQL database comprises:
[0098] A receiving module 201 is used to receive Excel data to be converted;
[0099] A positioning module 202 is used to scan, analyze and process the Excel data to locate the function expression of the Excel data;
[0100] A scanning module 203 is used to perform lexical scanning on the function expression to locate blank characters in the function expression;
[0101] A filtering and deleting module 204 is used to filter and delete blank characters in the function expression to obtain function lexical data;
[0102] A construction module 205 is used to analyze the logic tree data of the function lexical data, and construct grammar parsing data corresponding to the function lexical data based on the logic tree data;
[0103] The execution generation module 206 is used to parse the data based on the syntax, execute the data in the SQL database, and generate an SQL processing function.
[0104] Wherein, the construction module 205 is specifically used for:
[0105] Extracting a grammatical character segment of the function lexical data;
[0106] Performing operation processing on the grammatical character segment to extract the referenced character segment and the referenced character segment literal corresponding to the grammatical character segment;
[0107] Based on the referenced character segment and the referenced character segment literal, generate syntax parsing data corresponding to the function lexical data.
[0108] The execution generation module 206 is specifically used for:
[0109] The grammatical parsing data is run and processed, and the reference character segment corresponding to the grammatical parsing data is mapped to a reference node of the Json data type in a preset Postgres database, and an SQL processing function is generated.
[0110] The Excel function conversion device based on SQL database further includes a verification module 207, and the verification module 207 is specifically used for:
[0111] Performing character correctness verification processing on the function lexical data to generate a verification result;
[0112] Determine whether there is no operation instruction data in the verification result;
[0113] If there is no operation instruction data, the conversion process is terminated;
[0114] If no no-operation instruction data exists, the function lexical data is determined to be legal data, so as to enter the step of analyzing the logic tree data of the function lexical data.
[0115] The Excel function conversion device based on SQL database further includes an MD5 judgment module 208 specifically used for:
[0116] Analyze the MD5 digest value corresponding to the function expression, and read the preset MD5 digest value history record;
[0117] Determine whether the MD5 digest value exists in the MD5 digest value history record;
[0118] If it exists, then based on the mapping relationship between the MD5 digest value historical record and the preset function generation record, the SQL processing function corresponding to the MD5 digest value is queried, and the conversion process is terminated.
[0119] The Excel function conversion device based on SQL database further includes an MD5 writing module 209 specifically used for:
[0120] Calculate the MD5 digest value corresponding to the function expression, and generate a mapping relationship between the MD5 digest value and the SQL processing function;
[0121] The MD5 digest value is written into a preset MD5 digest value history record, and the SQL processing function is stored in a function generation record.
[0122] In the embodiment of the present invention, in the current implementation of the low-code platform, the tables that users see are all logical tables, which are simulated in the Postgres database through the Json data type. In the update and modification of the logical table, there is no need to change the physical table, so the update and modification of the logical table can be efficiently implemented during the system operation phase, solving the current technical problem of slow conversion of SQL database functions.
[0123] above Figure 2 and Figure 3 The Excel function conversion device based on SQL database in the embodiment of the present invention is described in detail from the perspective of modular functional entities. The Excel function conversion device based on SQL database in the embodiment of the present invention is described in detail from the perspective of hardware processing.
[0124] Figure 4 1 is a schematic diagram of the structure of an Excel function conversion device based on a SQL database provided by an embodiment of the present invention. The Excel function conversion device 400 based on a SQL database may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 410 (for example, one or more processors) and a memory 420, and one or more storage media 430 (for example, one or more mass storage devices) storing application programs 433 or data 432. Among them, the memory 420 and the storage medium 430 may be temporary storage or permanent storage. The program stored in the storage medium 430 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the Excel function conversion device 400 based on a SQL database. Furthermore, the processor 410 may be configured to communicate with the storage medium 430 to execute a series of instruction operations in the storage medium 430 on the Excel function conversion device 400 based on a SQL database.
[0125] The Excel function conversion device 400 based on SQL database may also include one or more power supplies 440, one or more wired or wireless network interfaces 450, one or more input and output interfaces 460, and / or one or more operating systems 431, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, etc. It can be understood by those skilled in the art that Figure 4 The structure of the Excel function conversion device based on SQL database shown does not constitute a limitation of the Excel function conversion device based on SQL database, and may include more or less components than shown in the figure, or a combination of certain components, or a different arrangement of components.
[0126] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the Excel function conversion method based on an SQL database.
[0127] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system, device, or unit can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.
[0128] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0129] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An Excel function conversion method based on SQL database, characterized in that: Includes steps: Receive Excel data to be converted; Scanning and analyzing the Excel data to locate the function expression of the Excel data; Performing lexical scanning on the function expression to locate blank characters in the function expression; Filter and delete the blank characters of the function expression to obtain function lexical data; Analyze the logic tree data of the function lexical data, and construct grammar parsing data corresponding to the function lexical data based on the logic tree data; Based on the grammatical parsing data, execute the data in the SQL database to generate an SQL processing function; The step of analyzing the logic tree data of the function lexical data and constructing the grammatical parsing data corresponding to the function lexical data based on the logic tree data includes: Extracting a grammatical character segment of the function lexical data; Performing operation processing on the grammatical character segment to extract the referenced character segment and the referenced character segment literal corresponding to the grammatical character segment; Based on the referenced character segment and the referenced character segment literal, generate syntax parsing data corresponding to the function lexical data; The step of executing the data in the SQL database based on the grammatical parsing data to generate an SQL processing function comprises: The grammatical parsing data is run and processed, and the reference character segment corresponding to the grammatical parsing data is mapped to a reference node of the Json data type in a preset Postgres database, and an SQL processing function is generated.
2. The Excel function conversion method based on SQL database according to claim 1, characterized in that: After filtering and deleting the blank characters of the function expression to obtain the function lexical data, and before analyzing the logic tree data of the function lexical data and constructing the grammatical parsing data corresponding to the function lexical data based on the logic tree data, the method further includes: Performing character correctness verification processing on the function lexical data to generate a verification result; Determine whether there is no operation instruction data in the verification result; If there is no operation instruction data, the conversion process is terminated; If no no-operation instruction data exists, the function lexical data is determined to be legal data, so as to enter the step of analyzing the logic tree data of the function lexical data.
3. The Excel function conversion method based on SQL database according to claim 1, characterized in that: After the data in the SQL database is executed based on the grammar parsing data to generate the SQL processing function, the method further includes: Calculate the MD5 digest value corresponding to the function expression, and generate a mapping relationship between the MD5 digest value and the SQL processing function; The MD5 digest value is written into a preset MD5 digest value history record, and the SQL processing function is stored in a function generation record.
4. The Excel function conversion method based on SQL database according to claim 1, characterized in that: After scanning and analyzing the Excel data to locate the function expression of the Excel data, and before lexically scanning the function expression to locate the blank characters of the function expression, the method further includes: Analyze the MD5 digest value corresponding to the function expression, and read the preset MD5 digest value history record; Determine whether the MD5 digest value exists in the MD5 digest value history record; If it exists, then based on the mapping relationship between the MD5 digest value historical record and the preset function generation record, the SQL processing function corresponding to the MD5 digest value is queried, and the conversion process is terminated.
5. An Excel function conversion device based on SQL database, characterized in that: The Excel function conversion device based on SQL database comprises: A receiving module, used for receiving Excel data to be converted; A positioning module, used for scanning, analyzing and processing the Excel data to locate the function expression of the Excel data; A scanning module, used for performing lexical scanning on the function expression to locate blank characters of the function expression; A filtering and deleting module, used for filtering and deleting blank characters in the function expression to obtain function lexical data; A construction module is used to analyze the logic tree data of the function lexical data and construct grammatical parsing data corresponding to the function lexical data based on the logic tree data, specifically including: Extracting a grammatical character segment of the function lexical data; Performing operation processing on the grammatical character segment to extract the referenced character segment and the referenced character segment literal corresponding to the grammatical character segment; Based on the referenced character segment and the referenced character segment literal, generate syntax parsing data corresponding to the function lexical data; The execution generation module is used to parse the data based on the grammar, execute the data in the SQL database, and generate an SQL processing function, specifically including: The grammatical parsing data is run and processed, and the reference character segment corresponding to the grammatical parsing data is mapped to a reference node of the Json data type in a preset Postgres database, and an SQL processing function is generated.
6. An Excel function conversion device based on SQL database, characterized in that: The Excel function conversion device based on SQL database includes: a memory and at least one processor, the memory stores instructions, and the memory and the at least one processor are interconnected through a line; The at least one processor calls the instructions in the memory to enable the Excel function conversion device based on SQL database to execute the Excel function conversion method based on SQL database as claimed in any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the Excel function conversion method based on SQL database as described in any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Data Transformation Spreadsheet
AU2011100882A4
Data query method and system
CN103577590A
Excel configuration-based data acquisition method and apparatus, and computer device
CN109522303A
Data table structure conversion method, device and equipment and readable storage medium
CN109684389A
SQL interpreter of HBase and optimization method
CN111309757A
