CN108681589B - Index system based structured query language instruction generation method and device - Google Patents

Index system based structured query language instruction generation method and device Download PDF

Info

Publication number
CN108681589B
CN108681589B CN201810462636.6A CN201810462636A CN108681589B CN 108681589 B CN108681589 B CN 108681589B CN 201810462636 A CN201810462636 A CN 201810462636A CN 108681589 B CN108681589 B CN 108681589B
Authority
CN
China
Prior art keywords
data
index
structured query
query language
language instruction
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.)
Active
Application number
CN201810462636.6A
Other languages
Chinese (zh)
Other versions
CN108681589A (en
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.)
Koubei Shanghai Information Technology Co Ltd
Original Assignee
Koubei Shanghai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Koubei Shanghai Information Technology Co Ltd filed Critical Koubei Shanghai Information Technology Co Ltd
Priority to CN201810462636.6A priority Critical patent/CN108681589B/en
Publication of CN108681589A publication Critical patent/CN108681589A/en
Application granted granted Critical
Publication of CN108681589B publication Critical patent/CN108681589B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method and a device for generating a structured query language instruction based on an index system, wherein the method for generating the structured query language instruction based on the index system comprises the following steps: constructing an index system comprising a plurality of index models and a data theme mart according to the data table; configuring the data topics in the data topic marts to obtain configuration data corresponding to the data topics; generating a structured query language instruction corresponding to the data subject according to the configuration data; and obtaining the access service by using the structured query language instruction. According to the technical scheme provided by the invention, the structured query language instruction suitable for various business requirements can be quickly, automatically and flexibly generated, the incidence mapping relation between the index system and the SQL service is established, various business requirements are effectively met, the uniqueness of data indexes is ensured, and the problem of inconsistent index calibers is effectively avoided.

Description

Index system based structured query language instruction generation method and device
Technical Field
The invention relates to the technical field of data processing, in particular to a structured query language instruction generation method and device based on an index system.
Background
With the rapid development of information technology, a big data era is met, and massive data needs to be processed. Generally, data are analyzed and processed to be converted into dimensions which are easy to understand by a user, data indexes needed by the user are obtained from possible dimensions, and a visual report is obtained, so that the user can quickly and intuitively know business development and determine a business development strategy. In the prior art, reports are generally obtained through the following two processing methods. The first processing mode is to obtain various data processing scripts by manually writing a structured query language instruction (SQL instruction), and perform associated binding on a data source and a report display, and this processing mode needs to consume a large amount of labor cost, has low processing efficiency, and is not beneficial to unified maintenance because the report association processing is complex. The second processing mode is that the SQL instruction is automatically generated based on a data table and multi-table association mode and then is bound with a visual interface of a report, the data tables are maintained in a large amount by the processing mode, overlapped indexes exist among the data tables, and when a certain data table is changed, other data tables are not sensed, so that a serious data quality problem is caused.
Disclosure of Invention
In view of the above, the present invention has been made to provide a method and apparatus for generating structured query language instructions based on an index system that overcomes or at least partially solves the above problems.
According to one aspect of the invention, a method for generating a structured query language instruction based on an index system is provided, and the method comprises the following steps:
constructing an index system comprising a plurality of index models and a data theme mart according to the data table;
configuring the data topics in the data topic marts to obtain configuration data corresponding to the data topics;
generating a structured query language instruction corresponding to the data subject according to the configuration data;
and obtaining the access service by using the structured query language instruction.
Further, according to the data table, constructing an index system including a plurality of index models and data topic marts further comprises:
processing the data table and establishing a plurality of index models;
and establishing a data theme market comprising a plurality of data themes according to the index models to obtain an index system.
Further, processing the data table, and establishing the plurality of index models further includes:
and taking the data wide table and/or the middle model table in the data table as a data model, analyzing and processing the metadata of the data model, and establishing a plurality of index models.
Further, the plurality of index models includes: the system comprises a basic dimension index model, a measurement index model, a virtual dimension index model, a derivative index model and a calculation index model.
Further, configuring the data topics in the data topic marts, and obtaining configuration data corresponding to the data topics further includes:
and configuring basic information, components and/or report page template identifications for the data topics to obtain configuration data corresponding to the data topics.
Further, the assembly comprises: a summary component, a detail component, a trend component, and a download component.
Further, after generating the structured query language instruction corresponding to the data topic according to the configuration data, the method further comprises:
generating a report display page instruction corresponding to the data subject according to the configuration data;
and obtaining report service by using the structured query language instruction and the report display page instruction.
Further, according to the configuration data, generating a report display page instruction corresponding to the data subject further comprises:
generating an extensible markup language instruction corresponding to the data theme according to the configuration data;
inquiring a report page template corresponding to the report page template identifier from a preset report page template mart based on the extended style sheet conversion language according to the report page template identifier in the configuration data;
and combining the extensible markup language instruction with a page template instruction corresponding to the inquired report page template to generate a report display page instruction.
Further, obtaining the access service using the structured query language instruction further comprises:
and executing a structured query language instruction corresponding to the data subject to obtain a data query result, and returning the data query result to the access service calling end.
According to another aspect of the present invention, there is provided a data query method based on an index system, the method including:
acquiring query constraint conditions set in a data query page by a user;
according to the query constraint condition, a structured query language instruction corresponding to the query constraint condition is requested from a server;
and obtaining a data query result by using a structured query language instruction.
Further, obtaining the data query result by using the structured query language instruction further comprises:
analyzing the structured query language instruction to obtain an executable structured query language instruction;
and executing the executable structured query language instruction to obtain a data query result.
According to another aspect of the present invention, there is provided an apparatus for generating structured query language instructions based on an index system, the apparatus comprising:
the index system building module is suitable for building an index system comprising a plurality of index models and a data theme mart according to the data table;
the configuration module is suitable for configuring the data topics in the data topic marts to obtain configuration data corresponding to the data topics;
the generating module is suitable for generating a structured query language instruction corresponding to the data subject according to the configuration data;
and the access service module is suitable for obtaining access service by utilizing the structured query language instruction.
Further, the index architecture building module is further adapted to:
processing the data table and establishing a plurality of index models;
and establishing a data theme market comprising a plurality of data themes according to the index models to obtain an index system.
Further, the index architecture building module is further adapted to:
and taking the data wide table and/or the middle model table in the data table as a data model, analyzing and processing the metadata of the data model, and establishing a plurality of index models.
Further, the plurality of index models includes: the system comprises a basic dimension index model, a measurement index model, a virtual dimension index model, a derivative index model and a calculation index model.
Further, the configuration module is further adapted to:
and configuring basic information, components and/or report page template identifications for the data topics to obtain configuration data corresponding to the data topics.
Further, the assembly comprises: a summary component, a detail component, a trend component, and a download component.
Further, the generation module is further adapted to: generating a report display page instruction corresponding to the data subject according to the configuration data;
the device also includes: and the report service module is suitable for obtaining report service by utilizing the structured query language instruction and the report display page instruction.
Further, the generation module is further adapted to:
generating an extensible markup language instruction corresponding to the data theme according to the configuration data;
inquiring a report page template corresponding to the report page template identifier from a preset report page template mart based on the extended style sheet conversion language according to the report page template identifier in the configuration data;
and combining the extensible markup language instruction with a page template instruction corresponding to the inquired report page template to generate a report display page instruction.
Further, the fetch service module is further adapted to:
and executing a structured query language instruction corresponding to the data subject to obtain a data query result, and returning the data query result to the access service calling end.
According to another aspect of the present invention, there is provided a data query apparatus based on an index system, the apparatus including:
the acquisition module is suitable for acquiring query constraint conditions set in a data query page by a user;
the request module is suitable for requesting a structured query language instruction corresponding to the query constraint condition from the server side according to the query constraint condition;
and the query module is suitable for obtaining a data query result by utilizing the structured query language instruction.
Further, the query module is further adapted to:
analyzing the structured query language instruction to obtain an executable structured query language instruction;
and executing the executable structured query language instruction to obtain a data query result.
According to another aspect of the present invention, there is provided a computing device comprising: the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the structured query language instruction generating method based on the index system.
According to another aspect of the present invention, a computer storage medium is provided, in which at least one executable instruction is stored, and the executable instruction causes a processor to execute operations corresponding to the index-based structured query language instruction generation method.
According to yet another aspect of the present invention, there is provided a computing device comprising: the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the data query method based on the index system.
According to still another aspect of the present invention, there is provided a computer storage medium having at least one executable instruction stored therein, where the executable instruction causes a processor to perform operations corresponding to the index system-based data query method as described above.
According to the technical scheme provided by the invention, a unified index model and a data theme market are constructed based on a data table, the establishment of an index system is completed, and a structured query language instruction suitable for various business requirements can be quickly, automatically and flexibly generated in a componentization mode, so that the instruction generation efficiency is improved, the labor cost required by writing the instruction is reduced, the incidence mapping relation between the index system and the SQL service is established, and various business requirements are effectively met; in addition, the technical scheme can ensure the uniqueness of the data index, effectively avoid the problem of inconsistent index calibers, optimize the generation mode of the structured query language instruction and conveniently perform unified maintenance and effective management on the data sheet.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1a is a flow diagram illustrating a method for index based structured query language instruction generation, in accordance with an embodiment of the present invention;
FIG. 1b shows a schematic diagram of the construction of the index system;
FIG. 2 is a flow chart diagram illustrating an index system-based data query method according to an embodiment of the invention;
FIG. 3 is a block diagram of an apparatus for generating structured query language instructions based on an index architecture according to an embodiment of the present invention;
FIG. 4 is a block diagram of an index based data query apparatus according to an embodiment of the present invention;
FIG. 5 illustrates a schematic structural diagram of a computing device according to an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
FIG. 1a is a flow chart of a method for generating a structured query language instruction based on an index system according to an embodiment of the present invention, and as shown in FIG. 1a, the method includes the following steps:
and S100, constructing an index system comprising a plurality of index models and data theme marts according to the data table.
The method may be performed by a server. In order to construct and obtain an index system based on a data table, the data table needs to be processed, a plurality of index models are established, and then a data theme market containing a plurality of data themes is established according to the established index models, so that the index system is obtained. Specifically, the data table may include a wide data table and a narrow data table, and may further include data tables corresponding to data models of respective layers, such as a high-layer model, a middle-layer model, and a bottom-layer model. The data wide table is a data table with more fields and more contained dimension levels, and generally associates indexes, dimensions and attributes related to a service theme together, so that access statistics are facilitated; the narrow data table is a data table with a few fields and a few dimensional layers. In the data modeling process, three levels of high-level model establishment, middle-level model establishment and bottom-level model establishment are generally divided, wherein the high-level model belongs to an entity relationship layer, the bottom-level model belongs to a physical layer, and after the high-level model is established, one middle-level model is established for each entity identified in the high-level model, which is equivalent to establishing a data item set.
In the process of establishing a plurality of index models, the data wide table and/or the middle model table in the data table can be used as the data model to analyze and process the metadata of the data model, so that the plurality of index models are established. The intermediate model table refers to a data table corresponding to the intermediate model. The plurality of metric models may include: the system comprises a basic dimension index model, a measurement index model, a virtual dimension index model, a derivative index model and a calculation index model. Specifically, the fields in the metadata of the data model may be analyzed and abstracted to obtain a basic dimension index, a measurement index, a virtual dimension index, a derivative index, and a calculation index, so as to obtain a basic dimension index model, a measurement index model, a virtual dimension index model, a derivative index model, and a calculation index model. The basic dimension index is used for describing query constraints, classification summarization and multi-table associated main keys and external keys, the measurement index is used for describing fact data of a business process, the fact data is generally integer or floating point decimal data, the virtual dimension index is used for describing custom query constraints, dimension indexes which are not originally in a data table and the problem of inconsistent names of the multi-table associated main keys and the external keys, the derived index is the measurement index after a modifier is limited, and the calculation index is an index obtained after mathematical operation.
After the index models are established, a plurality of corresponding data topics are determined, and a data topic mart containing the data topics is obtained. The index model and the data topic may have many-to-many correspondence, for example, one data topic corresponds to a plurality of index models. The data topic market has the characteristic of ensuring that the index model is uniform and not repeated. The data topics in the data topic marts can be set by those skilled in the art according to actual needs, and are not specifically limited herein. For example, data topics may include: the system comprises a marketing data theme, a transaction data theme, a commodity data theme, a traffic data theme, a coupon data theme or a service commodity ticket data theme, wherein the coupon can be a discount coupon or a full discount coupon suitable for a service place, and the service commodity ticket can be a voucher or a redemption ticket for redeeming actual business services. After obtaining a plurality of index models and data topic marts, the construction of the index system is completed, the construction schematic diagram of the index system can be as shown in fig. 1b, a plurality of index models are established according to a plurality of data tables 111, which are respectively a basic dimension index model 121, a measurement index model 122, a virtual dimension index model 123, a derivative index model 124 and a calculation index model 125, and then a data topic mart 130 including a plurality of data topics 131 is established according to the plurality of index models.
And step S101, configuring the data topics in the data topic marts to obtain configuration data corresponding to the data topics.
After the construction of the index system is completed, the configuration of each data topic in the data topic mart is also needed. Specifically, basic information, component and/or report page template identifiers and the like can be configured for the data topics, and configuration data corresponding to the data topics are obtained. Wherein, the basic information may include: name information and description information, etc.; the assembly may include: a summary component, a detail component, a trend component, a download component, and the like; the report page template identifier can be a report page template ID and the like. In specific application, the process of configuring the data topics can be mainly divided into 4 steps, wherein in the step 1, one data topic to be configured is selected from a plurality of data topics in a data topic mart, and basic information such as name information and description information is configured for the selected data topic; step 2, configuring query constraint conditions for the selected data topics; step 3, configuring different required components for the selected data theme; and 4, configuring an index calculation mode for the selected data topic. Wherein, the data theme can support free association of multiple themes; supporting various operational characters in the process of configuring the query constraint conditions, wherein parameters are optional and optional; in configuring components, the components that support configuration may include, but are not limited to: a summary component, a detail component, a trend component, a download component, and the like; the metric calculation method may include, but is not limited to: the basic summary method comprises the following steps: sum function, count function, etc., the self-defining method may include: and calculating output, composite output and the like, wherein the calculating output is to perform calculation processing on the summarized result obtained by the basic summarizing method, the composite output is to perform composite processing on the data object and/or the summarized result obtained by the basic summarizing method, for example, the calculating output can include performing division processing on the summarized result of the data object A and the summarized result of the data object B and the like, and the composite output can include processing the data object A and the data object B by a join () method and the like. In addition, a corresponding report page template identifier can be configured for the data topic, and the report page template adopted by the data topic is determined.
And step S102, generating a structured query language instruction corresponding to the data subject according to the configuration data.
In order to obtain the access service for the user, after obtaining the configuration data corresponding to the data topic, a structured query language instruction (i.e., SQL instruction) corresponding to the data topic needs to be generated according to the configuration data, and the generated SQL instruction corresponding to the data topic is stored in the server. SQL is a database query and programming language, supports statement nesting, has transparent service, and has the advantages of great flexibility, strong mobility, portability and the like.
In the process of generating the SQL instruction corresponding to the data theme, the SQL instruction corresponding to the data theme can be automatically generated according to the configuration data based on a preset SQL instruction generation rule. Those skilled in the art can set a preset SQL instruction generation rule according to actual needs, and the method is not limited specifically here. For example, the preset SQL instruction generation rule may specify an index that needs to be output, a table name of a data table used for query, a basic dimension index based on grouping, an association manner between different data topics, a used basic dimension index, a query constraint condition, a modifier, and the like, and may specify that indexes that do not participate in grouping cannot be output alone, an aggregation operator needs to be used for performing operation processing on the indexes, and a multi-table association condition is defined based on the same basic dimension index or the same virtual dimension index. The invention can quickly and flexibly generate the structured query language instruction suitable for various business requirements in a componentization mode, establishes the incidence mapping relation between the index system and the SQL service and effectively meets various business requirements.
Step S103, obtaining access service by using the structured query language instruction.
After the structured query language instructions corresponding to the data topics are generated, the access service can be obtained by using the structured query language instructions. Specifically, a structured query language instruction corresponding to the data theme is executed to obtain a data query result, and the data query result is returned to the access service calling end. The generated structured query language instruction corresponding to the data theme can be used as a part of the access service information, a data query result can be conveniently obtained by executing the structured query language instruction corresponding to the data theme, and then the data query result is returned to the access service calling end to be used by the access service calling end. Specifically, for some components (e.g., detailed components) that may correspond to different structured query language instructions, the structured query language instructions corresponding to the same component in the structured query language instructions corresponding to the data topic may be combined and then executed concurrently, and after the execution is completed, the execution results are gathered together as the data query result.
Optionally, after step S102, the method may further include: generating a report display page instruction corresponding to the data subject according to the configuration data; and obtaining report service by using the structured query language instruction and the report display page instruction. In addition, the generated report display page instruction corresponding to the data subject can be stored to the server. Specifically, an extensible markup language instruction (i.e., an XML instruction) corresponding to a data topic may be generated according to configuration data, then a report page template corresponding to the report page template identifier may be queried from a preset report page template market based on an extended style sheet translation language according to the report page template identifier in the configuration data, and then the extensible markup language instruction and a page template instruction corresponding to the queried report page template may be combined to generate a report presentation page instruction.
In the process of generating the XML instruction corresponding to the data theme, the XML instruction corresponding to the data theme may be automatically generated according to the configuration data based on the preset XML instruction generation rule. The preset XML instruction generation rule can be set by those skilled in the art according to actual needs, and is not limited specifically here. The generated XML instruction corresponding to the data subject can contain the componentized information of the report page, such as information related to a summary component, a detail component, a trend component, a download component and the like.
In order to conveniently generate the report display page instruction, a preset report page template market can be established in advance based on an extended stylesheet transformation language (XSLT), wherein the XSLT is a language for transforming the XML instruction and can transform the XML instruction into a description language of any text, so that the preset report page template market is established by using the XSLT, the XML instruction corresponding to the data theme can be conveniently combined with the page template instruction corresponding to the report page template, and the report display page instruction corresponding to the data theme is quickly generated and obtained.
The preset report page template market comprises a plurality of report page templates, each report page template comprises overall content configuration, component configuration, element configuration and the like, wherein the overall content configuration mainly comprises basic layout information of a report page, the component configuration comprises configuration information of summarizing area configuration, detail area configuration, trend area configuration, downloading area configuration and the like, and the element configuration comprises configuration information of specific elements, including but not limited to: text search boxes, drop-down search boxes, tofu piece summary elements, forms, and the like. The overall content configuration, the component configuration and the element configuration have an association relationship, specifically: component configurations are constructed based on the element configurations, and overall content configurations are constructed based on the component configurations.
In order to distinguish and use the report page templates, report page template identifications corresponding to each report page template can be set. Under the condition that the corresponding report page template identification is configured for the data theme, the report page template corresponding to the report page template identification can be quickly inquired from the preset report page template market according to the report page template identification in the configuration data, and then the XML instruction corresponding to the data theme is combined with the page template instruction corresponding to the report page template to generate the report display page instruction.
After the structured query language instruction and the report display page instruction corresponding to the data subject are generated, the report service can be obtained by utilizing the structured query language instruction and the report display page instruction. Specifically, a corresponding data query result is obtained by using a structured query language instruction, a report page style is obtained by using a report display page instruction, and then the data query result is rendered on a report page corresponding to the report page style.
The method for generating the structured query language instruction based on the index system provided by the embodiment constructs a unified index model and a data theme market based on a data table, completes the establishment of the index system, and can quickly, automatically and flexibly generate the structured query language instruction suitable for various business requirements in a componentization mode, thereby not only improving the instruction generation efficiency and reducing the labor cost required for writing the instruction, but also establishing the incidence mapping relationship between the index system and the SQL service, and effectively meeting various business requirements; in addition, the technical scheme can ensure the uniqueness of the data index, effectively avoid the problem of inconsistent index calibers, optimize the generation mode of the structured query language instruction and conveniently perform unified maintenance and effective management on the data sheet.
Fig. 2 is a flowchart illustrating a data query method based on an index system according to an embodiment of the present invention, and as shown in fig. 2, the method includes the following steps:
step S200, acquiring the query constraint conditions set in the data query page by the user.
When the user needs to perform data query, the query constraint condition may be set in the data query page of the data query client, and then in step S200, the query constraint condition set in the data query page by the user is obtained.
Step S201, according to the query constraint condition, a structured query language instruction corresponding to the query constraint condition is requested from the server.
The server side stores the structured query language instruction corresponding to the data subject, and then after the query constraint condition set by the user is obtained, the structured query language instruction corresponding to the query constraint condition can be requested from the server side according to the query constraint condition. The server side inquires the structured query language instruction corresponding to the query constraint condition in the stored structured query language instruction, and returns the inquired structured query language instruction to the data query client side.
Step S202, a data query result is obtained by using a structured query language instruction.
Because the obtained structured query language instruction has service logic and cannot be directly executed, the structured query language instruction needs to be analyzed to obtain an executable structured query language instruction, and then the executable structured query language instruction is executed to obtain a data query result.
According to the index system-based data query method provided by the embodiment, the request from the server side to the corresponding structured query language instruction can be conveniently made according to the query constraint condition set by the user, and then the data query result can be quickly obtained by using the structured query language instruction, so that the data query efficiency is improved, the user can conveniently obtain the data query result, and the convenience for the user to obtain the data query result is effectively improved.
FIG. 3 is a block diagram of an apparatus for generating structured query language instructions based on an index architecture according to an embodiment of the present invention, as shown in FIG. 3, the apparatus comprising: an index architecture building module 310, a configuration module 320, a generation module 330, and a fetch service module 340.
The index architecture building module 310 is adapted to: and constructing an index system comprising a plurality of index models and data topic marts according to the data table.
Wherein the index architecture building module 310 is further adapted to: processing the data table and establishing a plurality of index models; and establishing a data theme market comprising a plurality of data themes according to the index models to obtain an index system. Specifically, the index system building module 310 takes the data wide table and/or the intermediate model table in the data table as the data model, analyzes and processes the metadata of the data model, and builds a plurality of index models. Specifically, the plurality of index models include: the system comprises a basic dimension index model, a measurement index model, a virtual dimension index model, a derivative index model and a calculation index model.
The configuration module 320 is adapted to: and configuring the data topics in the data topic marts to obtain configuration data corresponding to the data topics.
Wherein the configuration module 320 is further adapted to: and configuring basic information, components and/or report page template identifications for the data topics to obtain configuration data corresponding to the data topics. Specifically, the assembly comprises: a summary component, a detail component, a trend component, and a download component.
The generation module 330 is adapted to: and generating a structured query language instruction corresponding to the data subject according to the configuration data.
The fetch service module 340 is adapted to: and obtaining the access service by using the structured query language instruction.
Wherein the fetch service module 340 is further adapted to: and executing a structured query language instruction corresponding to the data subject to obtain a data query result, and returning the data query result to the access service calling end.
Optionally, the generating module 330 is further adapted to: and generating a report display page instruction corresponding to the data subject according to the configuration data. Specifically, the generating module 330 generates an extensible markup language instruction corresponding to the data topic according to the configuration data; inquiring a report page template corresponding to the report page template identifier from a preset report page template mart based on the extended style sheet conversion language according to the report page template identifier in the configuration data; and combining the extensible markup language instruction with a page template instruction corresponding to the inquired report page template to generate a report display page instruction.
The device also includes: the report service module 350 is adapted to obtain a report service by using the structured query language instruction and the report display page instruction.
The structured query language instruction generation device based on the index system provided by the embodiment constructs a unified index model and a data theme market based on a data table, completes the establishment of the index system, and can quickly, automatically and flexibly generate the structured query language instruction suitable for various business requirements in a componentization mode, thereby not only improving the instruction generation efficiency and reducing the labor cost required for writing the instruction, but also establishing the incidence mapping relation between the index system and the SQL service, and effectively meeting various business requirements; in addition, the technical scheme can ensure the uniqueness of the data index, effectively avoid the problem of inconsistent index calibers, optimize the generation mode of the structured query language instruction and conveniently perform unified maintenance and effective management on the data sheet.
Fig. 4 is a block diagram illustrating a structure of an index system-based data query apparatus according to an embodiment of the present invention, as shown in fig. 4, the apparatus includes: an acquisition module 410, a request module 420, and a query module 430.
The acquisition module 410 is adapted to: and acquiring the query constraint conditions set in the data query page by the user.
The request module 420 is adapted to: and requesting a structured query language instruction corresponding to the query constraint condition from the server side according to the query constraint condition.
The query module 430 is adapted to: and obtaining a data query result by using a structured query language instruction.
The query module 430 analyzes the structured query language instruction to obtain an executable structured query language instruction, and executes the executable structured query language instruction to obtain a data query result.
The index system-based data query device provided by the embodiment can conveniently request the corresponding structured query language instruction from the server according to the query constraint condition set by the user, and then quickly obtain the data query result by using the structured query language instruction, so that the data query efficiency is improved, the user can conveniently obtain the data query result, and the convenience for the user to obtain the data query result is effectively improved.
The invention also provides a nonvolatile computer storage medium, wherein the computer storage medium stores at least one executable instruction, and the executable instruction can execute the index system-based structured query language instruction generation method in any method embodiment.
Fig. 5 is a schematic structural diagram of a computing device according to an embodiment of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the computing device.
As shown in fig. 5, the computing device may include: a processor (processor)502, a Communications Interface 504, a memory 506, and a communication bus 508.
Wherein:
the processor 502, communication interface 504, and memory 506 communicate with one another via a communication bus 508.
A communication interface 504 for communicating with network elements of other devices, such as clients or other servers.
The processor 502 is configured to execute the program 510, and may specifically perform relevant steps in the above embodiment of the method for generating a structured query language instruction based on an index system.
In particular, program 510 may include program code that includes computer operating instructions.
The processor 502 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement an embodiment of the invention. The computing device includes one or more processors, which may be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 506 for storing a program 510. The memory 506 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 510 may be specifically configured to cause the processor 502 to execute the index-based structured query language instruction generation method in any of the above-described method embodiments. For specific implementation of each step in the program 510, reference may be made to corresponding steps and corresponding descriptions in units in the above embodiment of generating a structured query language instruction based on an index system, which are not described herein again. It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described devices and modules may refer to the corresponding process descriptions in the foregoing method embodiments, and are not described herein again.
The invention also provides a nonvolatile computer storage medium, and the computer storage medium stores at least one executable instruction which can execute the data query method based on the index system in any method embodiment.
The present invention also provides a computing device comprising: the processor, the memory and the communication interface complete mutual communication through the communication bus; the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the data query method based on the index system. The schematic structure of the computing device is the same as the schematic structure of the computing device shown in fig. 5, and is not described here again.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components in accordance with embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.

Claims (22)

1. A method for generating structured query language instructions based on an index architecture, the method comprising:
constructing an index system comprising a plurality of index models and a data theme mart according to the data table;
configuring the data topics in the data topic marts to obtain configuration data corresponding to the data topics;
generating a structured query language instruction and a report display page instruction corresponding to the data subject according to the configuration data;
obtaining access service by using the structured query language instruction;
utilizing the structured query language instruction and the report display page instruction to obtain report service;
wherein, the instruction for generating the report display page further comprises: generating an extensible markup language instruction corresponding to the data theme according to the configuration data; inquiring a report page template corresponding to the report page template identifier from a preset report page template mart based on an extended style sheet conversion language according to the report page template identifier in the configuration data; and combining the extensible markup language instruction with a page template instruction corresponding to the inquired report page template to generate a report display page instruction.
2. The method for generating index-based structured query language instructions according to claim 1, wherein said building an index system comprising a plurality of index models and data topic marts according to a data table further comprises:
processing the data table and establishing a plurality of index models;
and establishing a data theme market comprising a plurality of data themes according to the index models to obtain the index system.
3. The method of claim 2, wherein the processing the data table to create a plurality of metric models further comprises:
and taking the data wide table and/or the middle model table in the data table as a data model, analyzing and processing the metadata of the data model, and establishing a plurality of index models.
4. The index architecture-based structured query language instruction generation method of claim 1, wherein said plurality of metric models comprises: the system comprises a basic dimension index model, a measurement index model, a virtual dimension index model, a derivative index model and a calculation index model.
5. The index-based structured query language instruction generation method of any one of claims 1 to 4, wherein the configuring the data topics in the data topic marts to obtain configuration data corresponding to the data topics further comprises:
and configuring basic information, components and/or report page template identifications for the data topics to obtain configuration data corresponding to the data topics.
6. The index architecture-based structured query language instruction generation method of claim 5, wherein said components comprise: a summary component, a detail component, a trend component, and a download component.
7. The index-based structured query language instruction generation method of any one of claims 1 to 4, wherein the obtaining access service using the structured query language instruction further comprises:
and executing a structured query language instruction corresponding to the data subject to obtain a data query result, and returning the data query result to the access service calling end.
8. A data query method based on an index system of the index system based structured query language instruction generation method of any one of claims 1 to 7, the method comprising:
acquiring query constraint conditions set in a data query page by a user;
according to the query constraint condition, a structured query language instruction corresponding to the query constraint condition is requested from a server;
and obtaining a data query result by utilizing the structured query language instruction.
9. The data query method of claim 8, wherein said obtaining data query results using said structured query language instructions further comprises:
analyzing the structured query language instruction to obtain an executable structured query language instruction;
and executing the executable structured query language instruction to obtain a data query result.
10. An apparatus for structured query language instruction generation based on an index architecture, the apparatus comprising:
the index system building module is suitable for building an index system comprising a plurality of index models and a data theme mart according to the data table;
the configuration module is suitable for configuring the data topics in the data topic marts to obtain configuration data corresponding to the data topics;
the generating module is suitable for generating a structured query language instruction and a report display page instruction corresponding to the data subject according to the configuration data;
the access service module is suitable for obtaining access service by utilizing the structured query language instruction;
the report service module is suitable for obtaining report service by utilizing the structured query language instruction and the report display page instruction;
wherein the generation module is further adapted to: generating an extensible markup language instruction corresponding to the data theme according to the configuration data; inquiring a report page template corresponding to the report page template identifier from a preset report page template mart based on an extended style sheet conversion language according to the report page template identifier in the configuration data; and combining the extensible markup language instruction with a page template instruction corresponding to the inquired report page template to generate a report display page instruction.
11. The index architecture-based structured query language instruction generating apparatus as claimed in claim 10, wherein said index architecture building module is further adapted to:
processing the data table and establishing a plurality of index models;
and establishing a data theme market comprising a plurality of data themes according to the index models to obtain the index system.
12. The index architecture-based structured query language instruction generating apparatus as claimed in claim 11, wherein said index architecture building module is further adapted to:
and taking the data wide table and/or the middle model table in the data table as a data model, analyzing and processing the metadata of the data model, and establishing a plurality of index models.
13. The index architecture-based structured query language instruction generation apparatus of claim 10, wherein said plurality of metric models comprises: the system comprises a basic dimension index model, a measurement index model, a virtual dimension index model, a derivative index model and a calculation index model.
14. The index architecture-based structured query language instruction generation apparatus according to any one of claims 10-13, wherein said configuration module is further adapted to:
and configuring basic information, components and/or report page template identifications for the data topics to obtain configuration data corresponding to the data topics.
15. The index architecture based structured query language instruction generation apparatus of claim 14, wherein said components comprise: a summary component, a detail component, a trend component, and a download component.
16. The index architecture-based structured query language instruction generation apparatus according to any one of claims 10-13, wherein said fetch service module is further adapted to:
and executing a structured query language instruction corresponding to the data subject to obtain a data query result, and returning the data query result to the access service calling end.
17. A data query device based on an index system of an index system based structured query language instruction generation device according to any one of claims 10 to 16, the device comprising:
the acquisition module is suitable for acquiring query constraint conditions set in a data query page by a user;
the request module is suitable for requesting a structured query language instruction corresponding to the query constraint condition from a server side according to the query constraint condition;
and the query module is suitable for obtaining a data query result by utilizing the structured query language instruction.
18. The data query device of claim 17, wherein the query module is further adapted to:
analyzing the structured query language instruction to obtain an executable structured query language instruction;
and executing the executable structured query language instruction to obtain a data query result.
19. A computing device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the index system-based structured query language instruction generation method according to any one of claims 1-7.
20. A computer storage medium having stored therein at least one executable instruction for causing a processor to perform operations corresponding to the index architecture based structured query language instruction generation method of any one of claims 1-7.
21. A computing device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the data query method as claimed in claim 8 or 9.
22. A computer storage medium having at least one executable instruction stored therein, the executable instruction causing a processor to perform operations corresponding to the data query method of claim 8 or 9.
CN201810462636.6A 2018-05-15 2018-05-15 Index system based structured query language instruction generation method and device Active CN108681589B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810462636.6A CN108681589B (en) 2018-05-15 2018-05-15 Index system based structured query language instruction generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810462636.6A CN108681589B (en) 2018-05-15 2018-05-15 Index system based structured query language instruction generation method and device

Publications (2)

Publication Number Publication Date
CN108681589A CN108681589A (en) 2018-10-19
CN108681589B true CN108681589B (en) 2020-09-04

Family

ID=63806212

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810462636.6A Active CN108681589B (en) 2018-05-15 2018-05-15 Index system based structured query language instruction generation method and device

Country Status (1)

Country Link
CN (1) CN108681589B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109840246A (en) * 2019-01-31 2019-06-04 北京三快在线科技有限公司 It is a kind of for calculating the method and device of the historical data of target signature
CN110647549A (en) * 2019-09-29 2020-01-03 北京卓信智恒数据科技股份有限公司 Data index analyzing and executing method and device based on business dynamic modeling
CN111125092A (en) * 2019-11-18 2020-05-08 贝壳技术有限公司 Service index query method and device
CN112286929B (en) * 2020-06-08 2022-04-05 上海柯林布瑞信息技术有限公司 Method and device for generating multi-dimensional data set and computer readable storage medium
CN112860696B (en) * 2021-02-07 2024-04-12 中国邮政储蓄银行股份有限公司 Data query method and device and data query model
CN113127490B (en) * 2021-04-23 2023-02-24 山东英信计算机技术有限公司 Key name generation method and device and computer readable storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103678413B (en) * 2012-09-25 2017-07-28 金蝶软件(中国)有限公司 The methods of exhibiting and device of dynamic column of report
CN104714949A (en) * 2013-12-11 2015-06-17 航天信息股份有限公司 Method for customizing report dynamically
CN104361140B (en) * 2014-12-10 2018-11-16 用友网络科技股份有限公司 Dynamic generation data model configuration device and method
US10204147B2 (en) * 2016-04-05 2019-02-12 Fractal Industries, Inc. System for capture, analysis and storage of time series data from sensors with heterogeneous report interval profiles
US10318528B2 (en) * 2016-02-25 2019-06-11 Microsoft Technology Licensing, Llc Query response using mapping to parameterized report
CN107169070A (en) * 2017-05-08 2017-09-15 山大地纬软件股份有限公司 The constructing system and its method in a kind of social security index warehouse based on big data
CN107577805B (en) * 2017-09-26 2020-08-18 华南理工大学 Business service system for log big data analysis

Also Published As

Publication number Publication date
CN108681589A (en) 2018-10-19

Similar Documents

Publication Publication Date Title
CN108664638B (en) report generation method and device based on index system
CN108681589B (en) Index system based structured query language instruction generation method and device
CN105550241B (en) Multi-dimensional database querying method and device
US8255410B2 (en) Translating queries to representational state transfer (REST)
US20090225082A1 (en) Generating distributed dataflow graphs
EP3740880A1 (en) Pick and applicator for use with a stringed instrument
CN101271475B (en) Commercial intelligent system
US20140114822A1 (en) Method and system for creating tax configuration templates
CN107844299A (en) A kind of implementation method of Web application development tools
WO2021184725A1 (en) User interface test method and apparatus, storage medium, and computer device
CN115617327A (en) Low code page building system, method and computer readable storage medium
US9967370B2 (en) OData enabled mobile software applications
CN108399086B (en) Widget management method, server and computer readable storage medium
CN108171528B (en) Attribution method and attribution system
KR20060106639A (en) Data-driven actions for network forms
CN114880346B (en) Data processing method, related assembly and acceleration processor
Lu et al. An empirical study of XML/EDI
US9043344B1 (en) Data mining and model generation using an in-database analytic flow generator
US10380132B2 (en) Information landscape modeling, analysis and validation
CN104881490A (en) WEB form data access method and system
CN114625732A (en) Query method and system based on Structured Query Language (SQL)
CN112860730A (en) SQL statement processing method and device, electronic equipment and readable storage medium
CN108595681B (en) Method, device and system for displaying form
CN112667598B (en) Data model rapid construction system based on business demand change
Ivanov et al. Performance evaluation of spark SQL using BigBench

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
GR01 Patent grant
GR01 Patent grant