CN112052242A - Data query method and device, electronic equipment and storage medium - Google Patents

Data query method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112052242A
CN112052242A CN202010912977.6A CN202010912977A CN112052242A CN 112052242 A CN112052242 A CN 112052242A CN 202010912977 A CN202010912977 A CN 202010912977A CN 112052242 A CN112052242 A CN 112052242A
Authority
CN
China
Prior art keywords
data
query
service
association
determining
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.)
Granted
Application number
CN202010912977.6A
Other languages
Chinese (zh)
Other versions
CN112052242B (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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202010912977.6A priority Critical patent/CN112052242B/en
Priority to PCT/CN2020/122112 priority patent/WO2021189829A1/en
Publication of CN112052242A publication Critical patent/CN112052242A/en
Application granted granted Critical
Publication of CN112052242B publication Critical patent/CN112052242B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2452Query translation
    • G06F16/24522Translation of natural language queries to structured queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to a data processing technology, and discloses a data query method, which comprises the following steps: determining a corresponding service scene according to the task data set and the model table set, and determining a query information segment to be reported according to the service scene; mapping the model table set and the query information segment by using a query statement, and splicing to obtain a query field comprising a query command; determining a data main table and a data service table in the service scene according to the query field; associating the data main table and the data service table according to the query command to obtain an association condition; and splicing the query field and the associated condition to obtain complete query information and obtain reported data. In addition, the invention also relates to a block chain technology, and the complete query information can be stored to the nodes of the block chain. The invention also provides a data inquiry device, an electronic device and a computer readable storage medium. The invention can solve the problems of large storage occupation and low flexibility.

Description

Data query method and device, electronic equipment and storage medium
Technical Field
The present invention relates to data processing technologies, and in particular, to a data query method and apparatus, an electronic device, and a computer-readable storage medium.
Background
Generally, financial and other industries need to report information such as business data and financial data according to regulatory requirements. The general processing flows of different reporting main bodies are consistent, but the data sources, the reporting products, the reporting field formats, the reporting scenes, the corresponding information fields and the message formats are all different in the information query process, and the reporting field formats, the reporting scenes and the corresponding information can be updated and adjusted by a supervision department according to the gradual enrichment of the reporting main bodies and the reporting products, so that the current data query process in the reporting information has the following defects: 1. for each adjustment, business personnel need to perform new version adjustment in data query to develop new codes, and the efficiency is low. 2. When the whole version is adjusted and the codes are updated, a large number of codes are generated in data query, so that the phenomena of occupation of a large number of storage and calculation resources are caused, and the flexibility is not high.
Disclosure of Invention
The invention provides a data query method, a data query device and a computer readable storage medium, and mainly aims to solve the problem that a large amount of storage and calculation resources are occupied when the whole version is adjusted and codes are updated.
In order to achieve the above object, the present invention provides a data query method, including:
acquiring a task data set and a model table set, determining a corresponding service scene according to the task data set and the model table set, and determining a query information segment to be reported according to the service scene;
acquiring a model table corresponding to the service scene in the model table set, mapping the model table and the query information segment by using a query statement, and splicing to obtain a query field, wherein the query field comprises a query command;
determining a data main table and a data service table in the service scene according to the query field;
associating the data main table and the data service table according to the query command to obtain an association condition, and configuring the association condition into a database;
and splicing the query field and the associated condition to obtain complete query information, and querying the reported data from the information source of the service scene by using the complete query information.
Optionally, the acquiring a task data set and a model table set, determining a corresponding service scenario according to the task data set and the model table set, and determining a query information segment to be reported according to the service scenario includes:
extracting keywords in the task data set by using a preset statement processing algorithm;
matching a service scene table in the model table set according to the keywords to determine the service scene;
and matching a scene reporting node mapping table in the model table set according to the service scene to acquire the query information segment.
Optionally, the extracting the keywords in the task data set by using a preset statement processing algorithm includes:
performing word segmentation on the text contained in the task data set, and removing stop words to obtain word segmentation results;
one or more keywords are picked out from the word segmentation result.
Optionally, the determining a data master table and a data service table in the service scenario according to the query field includes:
searching all data tables needing to be reported under the service scene by using the query fields, and judging whether all the query fields are contained in the data tables;
and if the data table contains all query fields, determining the data table as the data main table, and if the data table contains partial query fields, determining the data table as the data service table.
Optionally, the associating the data main table and the data service table according to the query command to obtain an association condition includes:
extracting the aliases of the data main table and the data service table according to the query command;
and associating the data main table and the data service table according to the alias to obtain an association condition.
Optionally, the associating the data main table and the data service table according to the alias to obtain an association condition includes:
acquiring an association mode mapping table in the model table set, and matching alias association relations in the association mode mapping table according to the aliases;
and acquiring a corresponding association function by utilizing the alias association relationship, and associating the data main table and the data service table through the association function to obtain the association condition.
Optionally, after querying the report data from the information source of the service scenario by using the complete query information, the method further includes:
converting the reported data into a format object by using a preset database;
and converting the format object into the final uploading data in the uniform format by using the format conversion function by calling the format conversion function in the database.
In order to solve the above problem, the present invention also provides a data query apparatus, including:
the service determining module is used for acquiring a task data set and a model table set, determining a corresponding service scene according to the task data set and the model table set, and determining a query information segment to be reported according to the service scene;
the data mapping module is used for acquiring a model table corresponding to the service scene in the model table set, mapping the model table and the query information segment by using a query statement, and splicing to obtain a query field, wherein the query field comprises a query command;
a main table determining module, configured to determine a data main table and a data service table in the service scenario according to the query field;
the table association module is used for associating the data main table with the data service table according to the query command to obtain an association condition, and configuring the association condition into a database;
and the information splicing module is used for splicing the query field and the associated conditions to obtain complete query information, and querying the reported data from the information source of the service scene by using the complete query information.
In order to solve the above problem, the present invention also provides an electronic device, including:
a memory storing at least one instruction; and
and the processor executes the instructions stored in the memory to realize the data query method.
In order to solve the above problem, the present invention further provides a computer-readable storage medium, which stores at least one instruction, where the at least one instruction is executed by a processor in an electronic device to implement the data query method described above.
According to the embodiment of the invention, the query statement is spliced, any required query command can be generated according to the requirement of the model table, so that the required data can be flexibly obtained without being limited to data sources, data ranges and data formats, the message format and the content can be quickly adjusted by adjusting the configuration of the query statement, the maintainability is improved, and the association is carried out in an alias mode, so that the configuration and the actual database table can be decoupled, the occupation of computer resources is reduced, the query flexibility is greatly enhanced, and the data query difficulty is reduced. Therefore, the data query method, the data query device and the computer readable storage medium provided by the invention can solve the problems of large storage and low computing resource occupation and flexibility.
Drawings
Fig. 1 is a schematic flow chart of a data query method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart showing a detailed implementation of one of the steps in FIG. 1;
FIG. 3 is a schematic flow chart showing another step of FIG. 1;
FIG. 4 is a diagram illustrating query field mapping according to an embodiment of the present invention;
FIG. 5 is a schematic flow chart showing another step in FIG. 1;
FIG. 6 is a diagram of a data main table and a data service representation intention in an embodiment of the present invention;
FIG. 7 is a schematic flow chart showing another step of FIG. 1;
fig. 8 is a schematic diagram illustrating a relationship between the data main table and the data service table in the database according to an embodiment of the present invention;
FIG. 9 is a diagram illustrating the complete query information of a personal information segment in an embodiment of the present invention;
FIG. 10 is a schematic view of another step in FIG. 1
FIG. 11 is a functional block diagram of a data query device according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of an electronic device for implementing the data query method according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The execution subject of the data query method provided by the embodiment of the present application includes, but is not limited to, at least one of electronic devices that can be configured to execute the method provided by the embodiment of the present application, such as a server and a terminal. In other words, the data query method may be performed by software or hardware installed in the terminal device or the server device, and the software may be a block chain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
Fig. 1 is a schematic flow chart of a data query method according to an embodiment of the present invention. In this embodiment, the data query method includes:
s1, acquiring a task data set and a model table set, determining a corresponding service scene according to the task data set and the model table set, and determining a query information segment to be reported according to the service scene.
In the embodiment of the invention, the task data set refers to reported products uploaded by users, such as financial products like Tianjin guarantee, Hunan Xiaocredit and the like. The service scene refers to a service scene corresponding to the reported product, such as a loan scene and a loan scene. The model table set is a template table set provided by a supervision department and used for determining the reported products and the service scenes. The set of model tables includes: reporting a master table (rrs _ report _ main _ body): used for confirming the reporting main body; reporting a product configuration table (rrs _ body _ product _ config): the system is used for determining the product configuration relation of main reporting; message template table (rrs _ paper _ template): used for confirming the format of the report message; message node table (rrs _ paper _ node): used for confirming the configuration of the report message node; configuration field table (rrs _ choice _ field): used for determining the source of the value field; child node field configuration table (rrs _ node _ field _ set): used for confirming the setting of the field of the reporting node; service scenario table (rrs _ business _ scene): the method is used for setting a service scene, mainly configuring the where condition of the scene data for inquiring sql of a main table, and determining the range of the data; scene data segment query script association mapping table (rrs _ scene _ nondequery _ set): the method is used for confirming the association relationship of other business tables associated through the main table under each scene (each information segment determines the table needed to be used according to the source of the query field, and the table is dynamically spliced into the complete query sql); scene reporting node mapping table (rrs _ scene _ node _ mapping): which is used to confirm which query information segments need to be reported for each scene.
Preferably, referring to fig. 2, the S1 specifically includes:
s10, extracting keywords in the task data set by using a preset statement processing algorithm;
s11, matching a service scene table in the model table set according to the keywords to obtain the service scene;
s12, according to the scene report node mapping table in the service scene matching model table set, obtaining the query information segment.
In detail, the extracting the keywords in the task data set by using a preset sentence processing algorithm includes:
performing word segmentation on the text contained in the task data set, and removing stop words to obtain word segmentation results;
one or more keywords are picked out from the word segmentation result.
Further, the preset statement processing algorithm in the embodiment of the present invention may be a TextRank that is already disclosed at present, a keyword extraction algorithm based on semantics, and the like. For example, if the user uploads the Tianjin guarantee and extracts the keyword 'guarantee', the service scene corresponding to the matching service scene table is a loan scene, and the query information segment to be uploaded in the loan scene is determined to include a personal information segment, a service information segment and a state information segment from the scene reporting node mapping table.
S2, obtaining a model table corresponding to the service scene in the model table set, mapping the model table and the query information segment by using a query statement, and splicing to obtain a query field, wherein the query field comprises a query command.
Preferably, the query statement can use an SQL statement, which allows a user to concisely and briefly declare required business logic, and the SQL belongs to a set language, and only needs to clearly express the requirement without knowing about the specific practice; SQL can be optimized, various query optimizers are built in, and the various query optimizers can translate an optimal execution plan for SQL.
In detail, referring to fig. 3, the S2 specifically includes:
s20, acquiring the model table from a preset configuration page;
s21, extracting the field name in the query information field;
s22, mapping the field name and the field description in the model table by using SQL statements, and splicing the field name and the field description into a query field with an SQL command.
Preferably, the configuration page is a page for performing field configuration in the overall supervision and reporting process.
In detail, referring to fig. 4, when the first payment successful scenario of tianjin guarantee is provided, the process of mapping and splicing the personal information segments in the payment scenario to obtain the query fields of the personal information segments is performed. Arrows in the figure represent the mapping relationship between the personal information segment and the fields in the model table.
Further, the query field includes a query command, such as an SQL command. The SQL command can dynamically support the configured scene, once the monitoring department updates and adjusts the format of the reported field, the reported scene and the corresponding information due to the gradual increase of the reported main body and the reported products, the messages with different scenes and different information segments can be generated at will only by adjusting the SQL sentences, and the SQL command has high flexibility.
S3, determining a data main table and a data service table in the service scene according to the query field.
Preferably, referring to fig. 5, the S3 specifically includes:
s30, searching all data tables needing to be reported under the service scene by using the query fields, and judging whether all the query fields are contained in the data tables;
and S31, if the data table contains all the query fields, determining the data table as the data main table, and if the data table contains partial query fields, determining the data table as the data service table.
Preferably, the data master table refers to the most critical data table corresponding to different service scenarios. The data service table refers to a service sub-table related to the data main table in different service scenes according to regulations of a supervision department. In the embodiment of the invention, the borrowing contract, the user information, the credit information of the user, the guarantee information and the like correspond to the same borrowing data, so that each scene only has a unique data master table.
In detail, as shown in fig. 6, taking a first-time successful loan scenario of tianjin guarantee as an example, the service scenario is a loan scenario, the query field includes query fields corresponding to a personal information segment, a service information segment, and a status information segment, a data main table obtained according to the query fields is a borrowing contract table (rrs _ local _ contract, whose alias is Icot), and the data service table includes a guarantee contract table (rrs _ security _ contract, whose alias is guar), and the like.
And S4, associating the data main table and the data service table according to the query command to obtain an association condition, and configuring the association condition into a database.
Preferably, referring to fig. 7, the associating the data master table and the data service table according to the query command to obtain an association condition specifically includes:
s40, extracting the data main table and the alias of the data service table according to the query command;
and S41, associating the data main table and the data service table according to the alias to obtain an association condition.
Specifically, the associating the data main table and the data service table according to the alias to obtain an association condition specifically includes:
acquiring an association mode mapping table in the model table set, and matching alias association relations in the association mode mapping table according to the aliases;
and acquiring a corresponding association function by utilizing the alias association relationship, and associating the data main table and the data service table through the association function to obtain the association condition.
In detail, referring to fig. 8, taking a scene of successful first-time reimbursement guaranteed by tianjin as an example, fig. 8 is a relationship between the data main table and the data service table in the database. As shown in fig. 8, in this scenario, the alias of the data main table is lcot, if a guar is used, left connection is performed through a left connection association function lcot.g _ connect _ no ═ guar.connect _ no, and if a cust is used, intra-connection is performed through an intra-connection association function lcot.cust _ id ═ cust.cust _ id.
In the embodiment of the invention, the alias way is adopted for association, so that the configuration and the actual database table can be decoupled, the flexibility of the model is greatly enhanced, the difficulty of data acquisition and modification is reduced, and the maintainability is improved.
S5, splicing the query field and the associated condition to obtain complete query information, and querying the reported data from the information source of the service scene by using the complete query information.
Preferably, referring to FIG. 9, an example of complete query information is shown after completion of the concatenation. The figure 9 includes the query field of the personal information segment, the associated data main table and the data service table of the personal information segment. Through the complete query information, complete reported data can be queried.
Preferably, referring to fig. 10, after S5, the method further includes:
s50, converting the reported data into a format object by using a preset database;
and S51, converting the format object into the final upload data in the unified format by using the format conversion function by calling the format conversion function in the database.
In the embodiment of the invention, the database can be jQuery, and the jQuery is a compact and quick JavaScript library which can be used for simplifying event processing and aims to make a developer use JavaScript on a website more easily. The final uploaded data refers to data finally uploaded to a supervision department, the format of the final uploaded data can be a JSON (Java Object Notation) format, the JSON (JavaScript Object Notation) is a lightweight data exchange format, the format is simple, reading and writing are easy, the formats are all compressed, the occupied bandwidth is small, and data transmission is easy. By converting the JSON format into the JSON format, the occupation of computer storage and computing resources can be reduced.
According to the embodiment of the invention, the query statement is spliced, any required query command can be generated according to the requirement of the model table, so that the required data can be flexibly obtained without being limited to data sources, data ranges and data formats, the message format and the content can be quickly adjusted by adjusting the configuration of the query statement, the maintainability is improved, and the association is carried out in an alias mode, so that the configuration and the actual database table can be decoupled, the occupation of computer resources is reduced, the query flexibility is greatly enhanced, and the data query difficulty is reduced. Therefore, the data query method, the data query device and the computer readable storage medium provided by the invention can solve the problems of large storage and low computing resource occupation and flexibility.
Fig. 11 is a functional block diagram of a data query apparatus according to an embodiment of the present invention.
The data query apparatus 100 according to the present invention may be installed in an electronic device. According to the implemented functions, the data query apparatus 100 may include a service determination module 101, a data mapping module 102, a main table determination module 103, a table association module 104, and an information splicing module 105. A module according to the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the service determination module 101 is configured to obtain a task data set and a model table set, determine a corresponding service scenario, and determine an inquiry information segment to be reported according to the service scenario.
In the embodiment of the invention, the task data set refers to reported products uploaded by users, such as Tianjin guarantee and Hunan Xiao-Gong. The service scene refers to a service scene corresponding to the reported product, such as a loan scene and a loan scene. The model table set is a template table set provided by a supervision department and used for determining the reported products and the service scenes. The set of model tables includes: reporting a master table (rrs _ report _ main _ body): used for confirming the reporting main body; reporting a product configuration table (rrs _ body _ product _ config): the system is used for determining the product configuration relation of main reporting; message template table (rrs _ paper _ template): used for confirming the format of the report message; message node table (rrs _ paper _ node): used for confirming the configuration of the report message node; configuration field table (rrs _ choice _ field): used for determining the source of the value field; child node field configuration table (rrs _ node _ field _ set): used for confirming the setting of the field of the reporting node; service scenario table (rrs _ business _ scene): the method is used for setting a service scene, mainly configuring the where condition of the scene data for inquiring sql of a main table, and determining the range of the data; scene data segment query script association mapping table (rrs _ scene _ nondequery _ set): the method is used for confirming the association relationship of other business tables associated through the main table under each scene (each information segment determines the table needed to be used according to the source of the query field, and the table is dynamically spliced into the complete query sql); scene reporting node mapping table (rrs _ scene _ node _ mapping): which is used to confirm which query information segments need to be reported for each scene.
Preferably, the service determination module 101 obtains a task data set and a model table set by the following operations, determines a corresponding service scenario according to the task data set and the model table set, and determines a query information segment to be reported according to the service scenario:
extracting keywords in the task data set by using a preset statement processing algorithm;
matching a service scene table in the model table set according to the keywords to obtain the service scene;
and matching a scene reporting node mapping table in the model table set according to the service scene to acquire the query information segment.
Further, the service determination module 101 obtains the keyword by:
performing word segmentation on the text contained in the task data set, and removing stop words to obtain word segmentation results;
one or more keywords are picked out from the word segmentation result.
Further, in the embodiment of the present invention, one or more keywords may be selected by using a currently disclosed TextRank, a keyword extraction algorithm based on semantics, and the like. For example, if the user uploads the Tianjin guarantee and extracts the keyword 'guarantee', the service scene corresponding to the matching service scene table is a loan scene, and the query information segment to be uploaded in the loan scene is determined to include a personal information segment, a service information segment and a state information segment from the scene reporting node mapping table.
The data mapping module 102 is configured to obtain a model table corresponding to the service scenario in the model table set, map the model table and the query information segment by using a query statement, and splice to obtain a query field, where the query field includes a query command.
Preferably, the query statement can use an SQL statement, which allows a user to concisely and briefly declare required business logic, and the SQL belongs to a set language, and only needs to clearly express the requirement without knowing about the specific practice; SQL can be optimized, various query optimizers are built in, and the various query optimizers can translate an optimal execution plan for SQL.
In detail, the data mapping module 102 obtains a task data set and a model table set by the following operations, determines a corresponding service scenario according to the task data set and the model table set, and determines a query information segment to be reported according to the service scenario:
acquiring the model table from a preset configuration page;
extracting the field name in the query information field;
and mapping the field names and the field descriptions in the model table by using SQL sentences, and splicing the field names and the field descriptions into query fields with SQL commands.
Preferably, the configuration page is a page for performing field configuration in the overall supervision and reporting process.
Further, the query field includes a query command, such as an SQL command. The SQL command can dynamically support the configured scene, once the monitoring department updates and adjusts the format of the reported field, the reported scene and the corresponding information due to the gradual increase of the reported main body and the reported products, the messages with different scenes and different information segments can be generated at will only by adjusting the SQL sentences, and the SQL command has high flexibility.
The master table determining module 103 is configured to determine a data master table and a data service table in the service scenario according to the query field.
Preferably, the master table determining module 103 determines the data master table and the data service table by:
searching all data tables needing to be reported under the service scene by using the query fields, and judging whether all the query fields are contained in the data tables;
and if the data table contains all query fields, determining the data table as the data main table, and if the data table contains partial query fields, determining the data table as the data service table.
Preferably, the data master table refers to the most critical data table corresponding to different service scenarios. The data service table refers to a service sub-table related to the data main table in different service scenes according to regulations of a supervision department. In the embodiment of the invention, the borrowing contract, the user information, the credit information of the user, the guarantee information and the like correspond to the same borrowing data, so that each scene only has a unique data master table.
The table association module 104 is configured to associate the data main table and the data service table according to the query command to obtain an association condition, and configure the association condition in a database.
Preferably, the table association module 104 obtains the association condition by:
extracting the aliases of the data main table and the data service table according to the query command;
associating the data main table and the data service table according to the alias to obtain an association condition;
specifically, the table association module 104 associates the data main table and the data service table according to the alias through the following operations to obtain an association condition:
acquiring an association mode mapping table in the model table set, and matching alias association relations in the association mode mapping table according to the aliases;
and acquiring a corresponding association function by utilizing the alias association relationship, and associating the data main table and the data service table through the association function to obtain the association condition.
In detail, in the embodiment of the present invention, if a guar is used, left connection is performed through a left connection association function lcot.g _ connect _ no ═ guar.connect _ no, and if a cust is used, intra connection is performed through an intra connection association function lcot.cust _ id ═ cust.cust _ id.
Furthermore, in the embodiment of the invention, the alias way is adopted for association, so that the configuration and the actual database table can be decoupled, the flexibility of the model is greatly enhanced, the difficulty of data acquisition and modification is reduced, and the maintainability is improved.
The information splicing module 105 is configured to splice the query field and the associated condition to obtain complete query information, and query the report data from the information source of the service scenario by using the complete query information.
Preferably, the information splicing module 105 further performs a formatting operation on the complete query information to obtain a data intermediate table with a uniform format by:
converting the reported data into a format object by using a preset database;
and converting the format object into the final uploading data in the uniform format by using the format conversion function by calling the format conversion function in the database.
In the embodiment of the invention, the database can be jQuery, and the jQuery is a compact and quick JavaScript library which can be used for simplifying event processing and aims to make a developer use JavaScript on a website more easily. The final uploaded data refers to data finally uploaded to a supervision department, the format of the final uploaded data can be a JSON (Java Object Notation) format, the JSON (JavaScript Object Notation) is a lightweight data exchange format, the format is simple, reading and writing are easy, the formats are all compressed, the occupied bandwidth is small, and data transmission is easy. By converting the JSON format into the JSON format, the occupation of computer storage and computing resources can be reduced.
Fig. 12 is a schematic structural diagram of an electronic device for implementing a data query method according to an embodiment of the present invention.
The electronic device 1 may comprise a processor 10, a memory 11 and a bus, and may further comprise a computer program, such as a data query program 12, stored in the memory 11 and operable on the processor 10.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used not only to store application software installed in the electronic device 1 and various types of data, such as codes of the data inquiry program 12, but also to temporarily store data that has been output or is to be output.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device 1 by running or executing programs or modules (e.g., data query programs, etc.) stored in the memory 11 and calling data stored in the memory 11.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
Fig. 12 shows only an electronic device with components, and it will be understood by those skilled in the art that the structure shown in fig. 12 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device 1 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so as to implement functions of charge management, discharge management, power consumption management, and the like through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 1 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device 1 may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used for establishing a communication connection between the electronic device 1 and other electronic devices.
Optionally, the electronic device 1 may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the electronic device 1 and for displaying a visualized user interface, among other things.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The data query program 12 stored in the memory 11 of the electronic device 1 is a combination of instructions, which when executed in the processor 10, can implement:
acquiring a task data set and a model table set, determining a corresponding service scene according to the task data set and the model table set, and determining a query information segment to be reported according to the service scene;
acquiring a model table corresponding to the service scene in the model table set, mapping the model table and the query information segment by using a query statement, and splicing to obtain a query field, wherein the query field comprises a query command;
determining a data main table and a data service table in the service scene according to the query field;
associating the data main table and the data service table according to the query command to obtain an association condition, and configuring the association condition into a database;
and splicing the query field and the associated condition to obtain complete query information, and querying the reported data from the information source of the service scene by using the complete query information.
Specifically, the specific implementation method of the processor 10 for the instruction may refer to the description of the relevant steps in the embodiments corresponding to fig. 1 to fig. 10, which is not repeated herein.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a non-volatile computer-readable storage medium. The computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A method for data query, the method comprising:
acquiring a task data set and a model table set, determining a corresponding service scene according to the task data set and the model table set, and determining a query information segment to be reported according to the service scene;
acquiring a model table corresponding to the service scene in the model table set, mapping the model table and the query information segment by using a query statement, and splicing to obtain a query field, wherein the query field comprises a query command;
determining a data main table and a data service table in the service scene according to the query field;
associating the data main table and the data service table according to the query command to obtain an association condition, and configuring the association condition into a database;
and splicing the query field and the associated condition to obtain complete query information, and querying the reported data from the information source of the service scene by using the complete query information.
2. The data query method of claim 1, wherein the obtaining of the task data set and the model table set, determining a corresponding service scenario according to the task data set and the model table set, and determining a query information segment to be reported according to the service scenario, comprises:
extracting keywords in the task data set by using a preset statement processing algorithm;
matching a service scene table in the model table set according to the keywords to determine the service scene;
and matching a scene reporting node mapping table in the model table set according to the service scene to acquire the query information segment.
3. The data query method of claim 2, wherein the extracting the keywords in the task data set by using a preset sentence processing algorithm comprises:
performing word segmentation on the text contained in the task data set, and removing stop words to obtain word segmentation results;
one or more keywords are picked out from the word segmentation result.
4. The data query method of claim 1, wherein the determining the data master table and the data service table in the service scenario according to the query field comprises:
searching all data tables needing to be reported under the service scene by using the query fields, and judging whether all the query fields are contained in the data tables;
and if the data table contains all query fields, determining the data table as the data main table, and if the data table contains partial query fields, determining the data table as the data service table.
5. The data query method of claim 1, wherein the associating the data master table and the data service table according to the query command to obtain an association condition comprises:
extracting the aliases of the data main table and the data service table according to the query command;
and associating the data main table and the data service table according to the alias to obtain an association condition.
6. The data query method of claim 5, wherein the associating the data main table and the data service table according to the alias to obtain an association condition comprises:
acquiring an association mode mapping table in the model table set, and matching alias association relations in the association mode mapping table according to the aliases;
and acquiring a corresponding association function by utilizing the alias association relationship, and associating the data main table and the data service table through the association function to obtain the association condition.
7. The data query method according to any one of claims 1 to 6, wherein after querying the report data from the information source of the service scenario by using the complete query information, the method further includes:
converting the reported data into a format object by using a preset database;
and converting the format object into the final uploading data in the uniform format by using the format conversion function by calling the format conversion function in the database.
8. A data query apparatus, characterized in that the apparatus comprises:
the service determining module is used for acquiring a task data set and a model table set, determining a corresponding service scene according to the task data set and the model table set, and determining a query information segment to be reported according to the service scene;
the data mapping module is used for acquiring a model table corresponding to the service scene in the model table set, mapping the model table and the query information segment by using a query statement, and splicing to obtain a query field, wherein the query field comprises a query command;
a main table determining module, configured to determine a data main table and a data service table in the service scenario according to the query field;
the table association module is used for associating the data main table with the data service table according to the query command to obtain an association condition, and configuring the association condition into a database;
and the information splicing module is used for splicing the query field and the associated conditions to obtain complete query information, and querying the reported data from the information source of the service scene by using the complete query information.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a data query method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out a data query method according to any one of claims 1 to 7.
CN202010912977.6A 2020-09-02 2020-09-02 Data query method, device, electronic equipment and storage medium Active CN112052242B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010912977.6A CN112052242B (en) 2020-09-02 2020-09-02 Data query method, device, electronic equipment and storage medium
PCT/CN2020/122112 WO2021189829A1 (en) 2020-09-02 2020-10-20 Data query method and apparatus, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010912977.6A CN112052242B (en) 2020-09-02 2020-09-02 Data query method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112052242A true CN112052242A (en) 2020-12-08
CN112052242B CN112052242B (en) 2024-06-04

Family

ID=73608040

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010912977.6A Active CN112052242B (en) 2020-09-02 2020-09-02 Data query method, device, electronic equipment and storage medium

Country Status (2)

Country Link
CN (1) CN112052242B (en)
WO (1) WO2021189829A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113271307A (en) * 2021-05-18 2021-08-17 中国工商银行股份有限公司 Data assembling method, device, computer system and storage medium
CN113362177A (en) * 2021-06-30 2021-09-07 中国农业银行股份有限公司 Transaction data backtracking method and device
CN114741393A (en) * 2022-04-19 2022-07-12 四川大学 Material genetic engineering data conversion and retrieval method
CN115544096A (en) * 2022-11-22 2022-12-30 深圳市东信时代信息技术有限公司 Data query method and device, computer equipment and storage medium
CN117454862A (en) * 2023-12-25 2024-01-26 青岛民航凯亚***集成有限公司 Report generation method based on engine mode and self-service BI system

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114064655B (en) * 2021-11-23 2024-03-29 上证所信息网络有限公司 Automatic discovery method capable of configuring data query and data relationship
CN114387021A (en) * 2022-01-11 2022-04-22 平安普惠企业管理有限公司 Service state generation method, device, equipment and storage medium
CN114971435B (en) * 2022-08-01 2022-11-18 武汉易维科技股份有限公司 Intelligent water affair cloud service method, device, equipment and medium
CN115357604B (en) * 2022-10-18 2023-03-07 天聚地合(苏州)科技股份有限公司 Data query method and device
CN115392206B (en) * 2022-10-26 2023-01-13 深圳迅策科技有限公司 Method, device and equipment for quickly querying data based on WPS/EXCEL and storage medium
CN115994172B (en) * 2022-12-09 2024-05-14 华青融天(北京)软件股份有限公司 Method, device, equipment and medium for determining service access relation
CN115617819B (en) * 2022-12-19 2023-03-14 思创数码科技股份有限公司 Data storage method, system, computer device and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050278285A1 (en) * 2004-06-10 2005-12-15 International Business Machines Corporation Methods and apparatus for specifying and processing descriptive queries for data sources
CN102521412A (en) * 2011-12-28 2012-06-27 用友软件股份有限公司 Data association device and data association method
CN108710708A (en) * 2018-05-31 2018-10-26 泰康保险集团股份有限公司 Report processing method, device, medium and electronic equipment
CN109254966A (en) * 2018-08-23 2019-01-22 平安科技(深圳)有限公司 Tables of data querying method, device, computer equipment and storage medium
CN109814856A (en) * 2019-01-17 2019-05-28 平安科技(深圳)有限公司 Data entry method, device, terminal and computer readable storage medium
CN110263105A (en) * 2019-05-21 2019-09-20 北京百度网讯科技有限公司 Inquiry processing method, query processing system, server and computer-readable medium
CN110597842A (en) * 2019-07-22 2019-12-20 石化盈科信息技术有限责任公司 Service data query method and system
CN111367945A (en) * 2020-02-28 2020-07-03 平安医疗健康管理股份有限公司 Report query method, device, equipment and computer readable storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10216826B2 (en) * 2014-09-02 2019-02-26 Salesforce.Com, Inc. Database query system
CN110069532A (en) * 2019-03-14 2019-07-30 东软集团股份有限公司 Data query method, apparatus, computer readable storage medium and electronic equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050278285A1 (en) * 2004-06-10 2005-12-15 International Business Machines Corporation Methods and apparatus for specifying and processing descriptive queries for data sources
CN102521412A (en) * 2011-12-28 2012-06-27 用友软件股份有限公司 Data association device and data association method
CN108710708A (en) * 2018-05-31 2018-10-26 泰康保险集团股份有限公司 Report processing method, device, medium and electronic equipment
CN109254966A (en) * 2018-08-23 2019-01-22 平安科技(深圳)有限公司 Tables of data querying method, device, computer equipment and storage medium
CN109814856A (en) * 2019-01-17 2019-05-28 平安科技(深圳)有限公司 Data entry method, device, terminal and computer readable storage medium
CN110263105A (en) * 2019-05-21 2019-09-20 北京百度网讯科技有限公司 Inquiry processing method, query processing system, server and computer-readable medium
CN110597842A (en) * 2019-07-22 2019-12-20 石化盈科信息技术有限责任公司 Service data query method and system
CN111367945A (en) * 2020-02-28 2020-07-03 平安医疗健康管理股份有限公司 Report query method, device, equipment and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李润洲 等: "基于异构集成的元数据及其多表动态查询算法", 计算机工程, vol. 33, no. 17, 30 September 2007 (2007-09-30) *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113271307A (en) * 2021-05-18 2021-08-17 中国工商银行股份有限公司 Data assembling method, device, computer system and storage medium
CN113362177A (en) * 2021-06-30 2021-09-07 中国农业银行股份有限公司 Transaction data backtracking method and device
CN113362177B (en) * 2021-06-30 2024-03-19 中国农业银行股份有限公司 Transaction data backtracking method and device
CN114741393A (en) * 2022-04-19 2022-07-12 四川大学 Material genetic engineering data conversion and retrieval method
CN114741393B (en) * 2022-04-19 2023-04-28 四川大学 Material genetic engineering data conversion and retrieval method
CN115544096A (en) * 2022-11-22 2022-12-30 深圳市东信时代信息技术有限公司 Data query method and device, computer equipment and storage medium
CN117454862A (en) * 2023-12-25 2024-01-26 青岛民航凯亚***集成有限公司 Report generation method based on engine mode and self-service BI system

Also Published As

Publication number Publication date
CN112052242B (en) 2024-06-04
WO2021189829A1 (en) 2021-09-30

Similar Documents

Publication Publication Date Title
CN112052242A (en) Data query method and device, electronic equipment and storage medium
WO2021189826A1 (en) Message generation method and apparatus, electronic device, and computer-readable storage medium
CN111813963B (en) Knowledge graph construction method and device, electronic equipment and storage medium
CN111428451B (en) Text online editing method and device, electronic equipment and storage medium
CN112231417A (en) Data classification method and device, electronic equipment and storage medium
CN113672781A (en) Data query method and device, electronic equipment and storage medium
CN111897831A (en) Service message generation method and device, electronic equipment and storage medium
CN112115145A (en) Data acquisition method and device, electronic equipment and storage medium
CN112685117A (en) System language internationalization maintenance method, device and computer readable storage medium
CN112949278A (en) Data checking method and device, electronic equipment and readable storage medium
CN114979120A (en) Data uploading method, device, equipment and storage medium
CN112882995A (en) Script automatic generation method and device, electronic equipment and storage medium
CN113468175A (en) Data compression method and device, electronic equipment and storage medium
CN113722533A (en) Information pushing method and device, electronic equipment and readable storage medium
CN113434542A (en) Data relation identification method and device, electronic equipment and storage medium
CN112597171A (en) Table relation visualization method and device, electronic equipment and storage medium
CN112948380A (en) Data storage method and device based on big data, electronic equipment and storage medium
CN112464619A (en) Big data processing method, device and equipment and computer readable storage medium
CN111985194A (en) Data storage method and device, electronic equipment and storage medium
CN114003661A (en) Offline data entry method and device, electronic equipment and storage medium
CN114185522A (en) Page theme customizing method and device, electronic equipment and storage medium
CN112686759A (en) Account checking monitoring method, device, equipment and medium
CN112380820A (en) Automatic data backfilling method and device, electronic equipment and computer storage medium
CN112631675A (en) Workflow configuration method, device, equipment and computer readable storage medium
CN112506931B (en) Data query method, device, electronic equipment and storage medium

Legal Events

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