CN114238375B - Index query method and device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN114238375B
CN114238375B CN202111546602.3A CN202111546602A CN114238375B CN 114238375 B CN114238375 B CN 114238375B CN 202111546602 A CN202111546602 A CN 202111546602A CN 114238375 B CN114238375 B CN 114238375B
Authority
CN
China
Prior art keywords
index
preset
data table
queried
query engine
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
CN202111546602.3A
Other languages
Chinese (zh)
Other versions
CN114238375A (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 Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China 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 Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202111546602.3A priority Critical patent/CN114238375B/en
Publication of CN114238375A publication Critical patent/CN114238375A/en
Application granted granted Critical
Publication of CN114238375B publication Critical patent/CN114238375B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/24Querying
    • G06F16/242Query formulation
    • 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
    • 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/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • G06F16/285Clustering or classification

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Probability & Statistics with Applications (AREA)
  • Fuzzy Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to a data analysis technology, and discloses an index query method, which comprises the following steps: configuring each preset index query engine according to the information data of each preset index, and generating a mapping relation table between each preset index and each preset index query engine; acquiring related information of an index to be queried, and determining an index query engine corresponding to the index to be queried as a target index query engine according to the related information and the mapping relation table; acquiring a data table set corresponding to the index to be queried according to the related information, preferentially screening the data table set to obtain a target data table set, and assembling an SQL statement corresponding to the index to be queried according to the related information and the target data table set; and executing the SQL sentence by using the target index query engine to obtain a query result of the index to be queried. The invention also provides an index query device, equipment and medium. The invention can improve index query efficiency.

Description

Index query method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data analysis technologies, and in particular, to an index query method, an index query device, an electronic device, and a computer readable storage medium.
Background
Index data plays an important role in various industries. Different industries define and count different index data, and through analysis of the index data, the current situation of service discovery is known, the service development problem is insight, the service development trend is prejudged, and the service development strategy is adjusted or deployed in time.
Generally, a piece of index data relates to various aspects of an index calculation algorithm, an index statistics dimension, an index filtering condition, an index data source and the like, and how to quickly and accurately query and acquire the index data is a great importance in index data management.
Currently, the query of index data is more common to predefine a target object table for querying the index data and a unified index query interface, and a given target object table is queried through the unified index query interface to obtain an index data result. The index query method can ensure the efficiency and the accuracy of index query aiming at index query scenes with small data volume and low complexity of index calculation algorithm, but can ignore different complexity of different index calculation algorithms and different table structures of different target object tables aiming at index data query with large data volume or index data query scenes with multiple data sources and high calculation complexity, so that the query efficiency is reduced.
Disclosure of Invention
The invention provides an index query method, an index query device and a computer readable storage medium, and mainly aims to improve index query efficiency.
In order to achieve the above object, the present invention provides an index query method, including:
configuring each preset index query engine according to the information data of each preset index, and generating a mapping relation table between each preset index and each preset index query engine;
acquiring related information of an index to be queried, and determining an index query engine corresponding to the index to be queried as a target index query engine according to the related information and the mapping relation table;
Acquiring a data table set corresponding to the index to be queried according to the related information, preferentially screening the data table set to obtain a target data table set, and assembling an SQL statement corresponding to the index to be queried according to the related information and the target data table set;
Executing the SQL sentence by using the target index query engine to obtain a query result of the index to be queried;
wherein, according to the information data of each preset index, configuring each preset index query engine, including: according to the information data of each preset index, performing type classification of a preset number on all the preset indexes to obtain index types of the preset number, wherein the preset number is consistent with the number of the preset index query engines; randomly distributing a preset index query engine to each index class; acquiring calculation parameters of each preset index in each index class; synchronizing the calculation parameters of each preset index in the index class to an allocated preset index query engine;
The preferentially screening the data table set to obtain a target data table set comprises the following steps: extracting table characteristics of each data table in the data table set; according to the table characteristics, each data table is evaluated by using a preset evaluation function, and an evaluation value of each data table is obtained; collecting a data table with the evaluation value meeting a preset condition as a target data table set corresponding to the index to be queried;
The step of evaluating each data table by using a preset evaluation function to obtain an evaluation value of each data table comprises the following steps: calculating an evaluation value of each data table by using the following evaluation function:
Representing the evaluation value of data Table A,/> Representing the number of table features included in data table A,/>Represents the/>, in data table AValues of the individual table features,/>Represents the/>, in data table AThreshold corresponding to the table feature,/>Represent the/>, in data Table AWeights corresponding to the individual table features, wherein/>、/>、/>The value range is (0, 1), and the sum of all weights is equal to 1.
Optionally, the performing, according to the information data of each preset index, a preset number of type classifications on all the preset indexes to obtain the preset number of index classes includes:
Extracting index features of each preset index according to information data of each preset index, and collecting all the index features as feature sets;
Randomly selecting an index feature from the feature set as an initial clustering center;
sequentially calculating the distance from each index feature remaining in the feature set to the clustering center, and dividing each index feature into categories corresponding to the clustering center with the minimum distance to obtain a plurality of category clusters;
Calculating the clustering center of each category cluster, replacing the initial clustering center by using the calculated clustering center, and returning to the step of sequentially calculating the distance from each index feature in the feature set to the clustering center until the number of the category clusters reaches the preset number, and determining each category cluster as an index class.
Optionally, the generating a mapping relation table between each preset index and each index query engine includes:
randomly generating an index ID of each preset index and an engine ID of each index query engine;
and creating a mapping relation table formed by the corresponding index ID and the corresponding engine ID according to the corresponding relation between each preset index and the configured index query engine.
Optionally, the determining, according to the related information and the mapping relation table, that the index query engine corresponding to the index to be queried is a target index query engine includes:
analyzing the related information to obtain an index ID corresponding to the index to be queried;
And querying an engine ID corresponding to the index ID in the mapping relation table, and taking an index query engine corresponding to the queried engine ID as a target index query engine.
In order to solve the above problems, the present invention further provides an index query device, configured to implement the index query method, where the device includes:
The index query engine generation module is used for configuring each preset index query engine according to the information data of each preset index and generating a mapping relation table between each preset index and each preset index query engine;
The target query engine acquisition module is used for acquiring related information of the index to be queried and determining an index query engine corresponding to the index to be queried as a target index query engine according to the related information and the mapping relation table;
The index query SQL construction module acquires a data table set corresponding to the index to be queried according to the related information, performs preferential screening on the data table set to obtain a target data table set, and assembles an SQL statement corresponding to the index to be queried according to the related information and the target data table set;
And the index query result acquisition module is used for executing the SQL sentence by using the target index query engine to obtain the query result of the index to be queried.
In order to solve the above-mentioned problems, the present invention also provides an electronic apparatus including:
a memory storing at least one computer program; and
And the processor executes the program stored in the memory to realize the index query method.
In order to solve the above-mentioned problems, the present invention also provides a computer-readable storage medium having stored therein at least one computer program that is executed by a processor in an electronic device to implement the index query method described above.
According to the embodiment of the invention, the data table set corresponding to the index to be queried is preferentially screened, so that the number of the data tables in the target data table set is reduced, the expenditure of traversing the data tables in the index query process is further reduced, different index query engines are matched for different indexes to be queried, and the concurrent processing efficiency and the query execution efficiency of index query are improved.
Drawings
FIG. 1 is a flowchart of an index query method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a detailed implementation of one of the steps in the index query method shown in FIG. 1;
FIG. 3 is a functional block diagram of an index query device according to an embodiment of the present invention;
Fig. 4 is a schematic structural diagram of an electronic device for implementing the index query method according to an embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The embodiment of the application provides an index query method. The execution subject of the index query method includes, but is not limited to, at least one of a server, a terminal, and the like, which can be configured to execute the method provided by the embodiment of the application. In other words, the index query method may be performed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The server may be an independent server, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (ContentDelivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
Referring to fig. 1, a flowchart of an index query method according to an embodiment of the invention is shown. In this embodiment, the index query method includes:
S1, configuring a preset index query engine according to information data of each preset index, and generating a mapping relation table between each preset index and each preset index query engine;
In the embodiment of the invention, the preset index is a group of indexes which are pre-carded and have standardability and uniqueness and are measurable aiming at a target system to be checked, and the target system can comprise an asset management system, a consultation system, an order management system and the like.
In the embodiment of the present invention, the information data of the preset index includes, but is not limited to, information data such as an index name, an index ID, an index calculation complexity, an index calculation type, an index data source, an independent index, an associated index, and the like, where the index calculation type may include a same ratio, a ring ratio, a duty ratio, and the like, the independent index is independent of other indexes and may perform independent calculation, and the associated index is opposite to the independent index and depends on other indexes, and the data of the associated index may be generated only after the calculation of the other indexes that are depended on.
In the embodiment of the present invention, the preset index query engines may be distributed based on a micro-service framework, where each preset index query engine corresponds to a micro-service server, and when the preset index engine executes related computing processing, the micro-service server allocates computing resources for the preset index query engine, for example, allocates computing resources such as threads or memories of a CPU.
In detail, referring to fig. 2, in S1, according to the information data of each preset index, configuring each preset index query engine includes:
S11, performing type classification of a preset number on all preset indexes according to information data of each preset index to obtain index types of the preset number, wherein the preset number is consistent with the number of preset index query engines;
S12, randomly distributing a preset index query engine for each index class;
s13, acquiring calculation parameters of each preset index in each index class;
S13, synchronizing the calculation parameters of each preset index in the index class to an allocated preset index query engine.
The step of performing a preset number of type classifications on all the preset indexes according to the information data of each preset index to obtain the preset number of index classes, including: extracting index features of each preset index according to information data of each preset index, and collecting all the index features as feature sets; randomly selecting a preset number of index features from the feature set to serve as an initial clustering center; sequentially calculating the distance from each index feature remaining in the feature set to the clustering center, and dividing each index feature into categories corresponding to the clustering center with the minimum distance to obtain the category clusters with the preset number; calculating the clustering center of each category cluster, replacing the initial clustering center by using the calculated clustering center, and returning to the step of sequentially calculating the distance from each index feature in the feature set to the clustering center until the number of the category clusters reaches the preset number, and determining each category cluster as an index class.
In the embodiment of the present invention, the distance may be euclidean distance, manhattan distance, chebyshev distance, or the like.
In an alternative embodiment of the present invention, the cluster center of each category cluster may be calculated by the following formula:
Wherein, For/>Clustering center,/>For/>Category clusters,/>Is an index feature in a category cluster.
In the embodiment of the present invention, the calculation parameters of each preset index include, but are not limited to, index name, index data source address, input parameters, output parameters, and the like.
Illustratively, the index name may be "profit margin". The data source address may be an IP address corresponding to the database, or may be a specific domain name or index url address, for example, "/api/v1/GAINSRATE". The inclusion may be data related to the "profit margin", e.g., revenue data, cost data, etc. The parameter may be a dimension condition that the corresponding index query engine can calculate to output, for example, data of "profit margin" of a certain time interval is output.
In detail, the generating a mapping relation table between each preset index and each preset index query engine includes: randomly generating an index ID of each preset index and an engine ID of each index query engine; and creating a mapping relation table formed by the corresponding index ID and the corresponding engine ID according to the corresponding relation between each preset index and the configured index query engine.
In the embodiment of the present invention, it is understood that the same engine ID may correspond to a plurality of index IDs, and the same index ID corresponds to a single engine ID.
S2, acquiring related information of the index to be queried, and determining an index query engine corresponding to the index to be queried as a target index query engine according to the related information and the mapping relation table;
In the embodiment of the invention, the related information of the index to be queried can be acquired from the designated index query field by using a preset interface or using a computer sentence (such as JAVA sentence, python sentence and the like) with a data grabbing function.
In the embodiment of the invention, the related information of the index to be queried includes, but is not limited to, an index name, an index ID, an index parameter, an index dimension and an index filtering condition.
In detail, the determining, according to the related information and the mapping relation table, that the index query engine corresponding to the index to be queried is a target index query engine includes: analyzing the related information to obtain an index ID corresponding to the index to be queried; and querying an engine ID corresponding to the index ID in the mapping relation table, and taking an index query engine corresponding to the queried engine ID as a target index query engine.
In the embodiment of the invention, different indexes to be queried adopt the customized index query engine, so that compared with the traditional method adopting a unified index query interface, the method can more reasonably utilize computing resources, and further improve the efficiency of index query.
S3, acquiring a data table set corresponding to the index to be queried according to the related information, preferentially screening the data table set to obtain a target data table set, and assembling an SQL statement corresponding to the index to be queried according to the related information and the target data table set;
In the embodiment of the invention, the index ID of the index to be queried can be obtained from the related information, and the data table set corresponding to the index ID is queried according to the index ID in a preset index and data table comparison relation table.
In the embodiment of the present invention, the preset index-data table comparison relation table is used to record in which data tables each index parameter related to is distributed. It may be understood that the index parameters corresponding to the index to be queried may be distributed in a plurality of different data tables, for example, the index parameter of a certain index is the sales amount of the product a, and the sales amount of the product a may be in a daily chemical product sales statistics table or a mall product sales statistics table.
In the embodiment of the invention, each data table has different table structures, data refreshing frequencies, data generating time and the like, if all the data tables corresponding to the index to be queried are traversed, the index query efficiency is reduced, if one data table is randomly selected from all the data tables corresponding to the index to be queried as a query object, the accuracy of index query is possibly affected, and therefore, a data table set corresponding to the index to be queried needs to be scientifically screened, so that the index query efficiency is improved.
In detail, the preferentially screening the data table set to obtain a target data table set includes: extracting table characteristics of each data table in the data table set; according to the table characteristics, each data table is evaluated by using a preset evaluation function, and an evaluation value of each data table is obtained; and collecting the data table with the evaluation value meeting the preset condition as a target data table set corresponding to the index to be queried.
In the embodiment of the invention, the table features include, but are not limited to, the number of fields of the data table, the data refresh frequency, the latest refresh time of the data, and the like.
The embodiment of the invention can calculate the evaluation value of each data table by using the following evaluation function:
Representing the evaluation value of data Table A,/> Representing the number of table features included in data table A,/>Represents the/>, in data table AValues of the individual table features,/>Represents the/>, in data table AThreshold corresponding to the table feature,/>Represent the/>, in data Table AWeights corresponding to the table features,/>Representing the/>, in the data tableWeights corresponding to individual table features, i.e. the last table feature, wherein/>、/>、/>The value range is (0, 1), and the sum of all weights is equal to 1.
It can be understood that the refresh frequency of the data table is higher, the timeliness of the corresponding data is higher, the corresponding table feature weight is higher, and conversely, the latest refresh time of the data is earlier, the timeliness of the corresponding data is lower, and the corresponding table feature weight is lower.
In the embodiment of the present invention, the preset condition may be an evaluation value threshold, and data tables corresponding to an evaluation value greater than the evaluation value threshold are collected as the target data table set, or may also be a maximum number of data tables, and according to the size of the evaluation value of each data table, each data table is sorted in a descending order, and from large to small, a data table satisfying the maximum number of data tables is selected to form the target data table set.
In the embodiment of the invention, the table features are utilized to perform preferential screening on each data table through the preset evaluation function, so that the expenditure of traversing the data table in the index query process is reduced, and the index query efficiency can be improved.
In the embodiment of the invention, the SQL statement corresponding to the index to be queried is assembled according to the index parameter, the index dimension, the index filtering condition and the like contained in the related information and the target data table set.
S4, executing the SQL sentence by using the target index query engine to obtain a query result of the index to be queried.
In the embodiment of the invention, the index query engines can be distributed based on a micro-service framework, each index query engine corresponds to one micro-service server, the target index query engine is utilized to analyze the instruction information corresponding to the SQL, and the instruction information is matched with index calculation parameters configured in the target index query engine to obtain corresponding index calculation parameters, such as an index name, an index data source address, an index data input address, an index output parameter and the like. And calling a corresponding micro-service server, acquiring data corresponding to the instruction information from a data source appointed by the index data source address, performing calculation operation on the data to obtain a calculation result, and screening the calculation result according to the dimension appointed by the parameter to obtain an index query result. For example, the corresponding query results are output in a time slot dimension, or the corresponding query results are output in a department dimension.
According to the embodiment of the invention, the data table set corresponding to the index to be queried is preferentially screened, so that the number of the data tables in the target data table set is reduced, the expenditure of traversing the data tables in the index query process is further reduced, different index query engines are matched for different indexes to be queried, and the concurrent processing efficiency and the query execution efficiency of index query are improved.
Fig. 3 is a functional block diagram of an index query device according to an embodiment of the present invention.
The index inquiry apparatus 100 of the present invention may be installed in an electronic device. Depending on the implementation, the index query device 100 may include an index query engine generating module 101, a target query engine obtaining module 102, an index query SQL construction module 103, and an index query result obtaining module 104. The module of the invention, which may also be referred to as a unit, refers to a series of computer program segments, which are stored in the memory of the electronic device, capable of being executed by the processor of the electronic device and of performing a fixed function.
In the present embodiment, the functions concerning the respective modules/units are as follows:
The index query engine generating module 101 is configured to configure each preset index query engine according to information data of each preset index, and generate a mapping relation table between each preset index and each preset index query engine;
The target query engine acquisition module 102 is configured to acquire related information of an index to be queried, and determine, according to the related information and the mapping relationship table, that an index query engine corresponding to the index to be queried is a target index query engine;
The index query SQL construction module 103 obtains a data table set corresponding to the index to be queried according to the related information, performs preferential screening on the data table set to obtain a target data table set, and assembles an SQL statement corresponding to the index to be queried according to the related information and the target data table set;
the index query result obtaining module 104 is configured to execute the SQL statement by using the target index query engine to obtain a query result of the index to be queried.
In detail, each module in the index query device 100 in the embodiment of the present invention adopts the same technical means as the index query method described in fig. 1 to 2 and can produce the same technical effects when in use, and will not be described herein.
Fig. 4 is a schematic structural diagram of an electronic device for implementing the index 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 an index lookup program, stored in the memory 11 and executable on the processor 10.
The memory 11 includes at least one type of readable storage medium, including flash memory, a mobile hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an 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 in other embodiments also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD) or 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 for storing application software installed in the electronic device 1 and various types of data, such as codes of index inquiry programs, but also for temporarily storing data that has been output or is to be output.
The processor 10 may be comprised of integrated circuits in some embodiments, for example, a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functions, including one or more central processing units (Central Processing unit, CPU), microprocessors, digital processing chips, graphics processors, combinations of various control chips, and the like. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects respective components of the entire electronic device using various interfaces and lines, and executes various functions of the electronic device 1 and processes data by running or executing programs or modules (e.g., index lookup programs, etc.) stored in the memory 11, and calling data stored in the memory 11.
The bus may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. The bus is arranged to enable a connection communication between the memory 11 and at least one processor 10 etc.
Fig. 4 shows only an electronic device with components, it being understood by a person skilled in the art that the structure shown in fig. 4 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or may combine certain components, or may be arranged in different components.
For example, although not shown, the electronic device 1 may further include a power source (such as a battery) for supplying power to each component, and preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management, and the like are implemented through the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The electronic device 1 may further include various sensors, bluetooth modules, wi-Fi modules, etc., which will not be described herein.
Further, the electronic device 1 may also comprise a network interface, optionally the network interface may comprise a wired interface and/or a wireless interface (e.g. WI-FI interface, bluetooth interface, etc.), typically used for establishing a communication connection between the electronic device 1 and other electronic devices.
The electronic device 1 may optionally further comprise a user interface, which may be a Display, an input unit, such as a Keyboard (Keyboard), or 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, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device 1 and for displaying a visual user interface.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
The index lookup program stored in the memory 11 of the electronic device 1 is a combination of a plurality of instructions, which when executed in the processor 10, may implement:
configuring each preset index query engine according to the information data of each preset index, and generating a mapping relation table between each preset index and each preset index query engine;
acquiring related information of an index to be queried, and determining an index query engine corresponding to the index to be queried as a target index query engine according to the related information and the mapping relation table;
Acquiring a data table set corresponding to the index to be queried according to the related information, preferentially screening the data table set to obtain a target data table set, and assembling an SQL statement corresponding to the index to be queried according to the related information and the target data table set;
and executing the SQL sentence by using the target index query engine to obtain a query result of the index to be queried.
Specifically, the specific implementation method of the above instructions by the processor 10 may refer to the description of the relevant steps in the corresponding embodiment of fig. 1, which is not repeated herein.
Further, the modules/units integrated in the electronic device 1 may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as separate products. The computer readable storage medium may be volatile or nonvolatile. For example, the computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM).
The present invention also provides a computer readable storage medium storing a computer program which, when executed by a processor of an electronic device, can implement:
configuring each preset index query engine according to the information data of each preset index, and generating a mapping relation table between each preset index and each preset index query engine;
acquiring related information of an index to be queried, and determining an index query engine corresponding to the index to be queried as a target index query engine according to the related information and the mapping relation table;
Acquiring a data table set corresponding to the index to be queried according to the related information, preferentially screening the data table set to obtain a target data table set, and assembling an SQL statement corresponding to the index to be queried according to the related information and the target data table set;
and executing the SQL sentence by using the target index query engine to obtain a query result of the index to be queried.
In the several embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
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 characteristics 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 blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The blockchain (Blockchain), essentially a de-centralized database, is a string of data blocks that are generated in association using cryptographic methods, each of which contains information from a batch of network transactions for verifying the validity (anti-counterfeit) of its information and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
The embodiment of the application can acquire and process the related data based on the artificial intelligence technology. Wherein artificial intelligence (ARTIFICIAL INTELLIGENCE, AI) is the theory, method, technique, and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend, and expand human intelligence, sense the environment, acquire knowledge, and use knowledge to obtain optimal results.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the system claims can also be implemented by means of software or hardware by means of one unit or means. The terms second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (7)

1. An index query method, the method comprising:
configuring each preset index query engine according to the information data of each preset index, and generating a mapping relation table between each preset index and each preset index query engine;
acquiring related information of an index to be queried, and determining an index query engine corresponding to the index to be queried as a target index query engine according to the related information and the mapping relation table;
Acquiring a data table set corresponding to the index to be queried according to the related information, preferentially screening the data table set to obtain a target data table set, and assembling an SQL statement corresponding to the index to be queried according to the related information and the target data table set;
Executing the SQL sentence by using the target index query engine to obtain a query result of the index to be queried;
wherein, according to the information data of each preset index, configuring each preset index query engine, including: according to the information data of each preset index, performing type classification of a preset number on all the preset indexes to obtain index types of the preset number, wherein the preset number is consistent with the number of the preset index query engines; randomly distributing a preset index query engine to each index class; acquiring calculation parameters of each preset index in each index class; synchronizing the calculation parameters of each preset index in the index class to an allocated preset index query engine;
The preferentially screening the data table set to obtain a target data table set comprises the following steps: extracting table characteristics of each data table in the data table set; according to the table characteristics, each data table is evaluated by using a preset evaluation function, and an evaluation value of each data table is obtained; collecting a data table with the evaluation value meeting a preset condition as a target data table set corresponding to the index to be queried;
The step of evaluating each data table by using a preset evaluation function to obtain an evaluation value of each data table comprises the following steps: calculating an evaluation value of each data table by using the following evaluation function:
Representing the evaluation value of data Table A,/> Representing the number of table features included in data table A,/>Represents the/>, in data table AValues of the individual table features,/>Represents the/>, in data table AThreshold corresponding to the table feature,/>Represent the/>, in data Table AWeights corresponding to the individual table features, wherein/>、/>、/>The value range is (0, 1), and the sum of all weights is equal to 1.
2. The index query method as claimed in claim 1, wherein said performing a predetermined number of type classifications on all of said predetermined indexes based on information data of each of said predetermined indexes to obtain said predetermined number of index classes comprises:
Extracting index features of each preset index according to information data of each preset index, and collecting all the index features as feature sets;
Randomly selecting an index feature from the feature set as an initial clustering center;
sequentially calculating the distance from each index feature remaining in the feature set to the clustering center, and dividing each index feature into categories corresponding to the clustering center with the minimum distance to obtain a plurality of category clusters;
Calculating the clustering center of each category cluster, replacing the initial clustering center by using the calculated clustering center, and returning to the step of sequentially calculating the distance from each index feature in the feature set to the clustering center until the number of the category clusters reaches the preset number, and determining each category cluster as an index class.
3. The method of claim 1, wherein generating a mapping table between each of the preset indexes and each of the preset index query engines comprises:
randomly generating an index ID of each preset index and an engine ID of each index query engine;
and creating a mapping relation table formed by the corresponding index ID and the corresponding engine ID according to the corresponding relation between each preset index and the configured index query engine.
4. The method for querying the index according to claim 3, wherein determining, according to the related information and the mapping relation table, the index query engine corresponding to the index to be queried as the target index query engine comprises:
analyzing the related information to obtain an index ID corresponding to the index to be queried;
And querying an engine ID corresponding to the index ID in the mapping relation table, and taking an index query engine corresponding to the queried engine ID as a target index query engine.
5. An index query device for implementing the index query method according to any one of claims 1 to 4, characterized in that the device comprises:
The index query engine generation module is used for configuring each preset index query engine according to the information data of each preset index and generating a mapping relation table between each preset index and each preset index query engine;
The target query engine acquisition module is used for acquiring related information of the index to be queried and determining an index query engine corresponding to the index to be queried as a target index query engine according to the related information and the mapping relation table;
The index query SQL construction module acquires a data table set corresponding to the index to be queried according to the related information, performs preferential screening on the data table set to obtain a target data table set, and assembles an SQL statement corresponding to the index to be queried according to the related information and the target data table set;
And the index query result acquisition module is used for executing the SQL sentence by using the target index query engine to obtain the query result of the index to be queried.
6. An electronic device, the electronic device comprising:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores a computer program executable by the at least one processor, the instructions being executable by the at least one processor to enable the at least one processor to perform the index query method of any one of claims 1 to 4.
7. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the index query method of any one of claims 1 to 4.
CN202111546602.3A 2021-12-16 2021-12-16 Index query method and device, electronic equipment and storage medium Active CN114238375B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111546602.3A CN114238375B (en) 2021-12-16 2021-12-16 Index query method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111546602.3A CN114238375B (en) 2021-12-16 2021-12-16 Index query method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114238375A CN114238375A (en) 2022-03-25
CN114238375B true CN114238375B (en) 2024-05-28

Family

ID=80757423

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111546602.3A Active CN114238375B (en) 2021-12-16 2021-12-16 Index query method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114238375B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115455103B (en) * 2022-10-20 2023-04-07 广州明动软件股份有限公司 Dynamic query system and method based on dynamic interface engine

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019060861A1 (en) * 2017-09-24 2019-03-28 Domo, Inc. Systems and methods for data analysis and visualization spanning multiple datasets
CN111694858A (en) * 2020-04-28 2020-09-22 平安科技(深圳)有限公司 Data blood margin analysis method, device, equipment and computer readable storage medium
CN112184011A (en) * 2020-09-27 2021-01-05 中国建设银行股份有限公司 Efficiency evaluation method and device, electronic equipment and readable storage medium
CN112699142A (en) * 2020-12-29 2021-04-23 平安普惠企业管理有限公司 Cold and hot data processing method and device, electronic equipment and storage medium
CN113377805A (en) * 2021-08-13 2021-09-10 腾讯科技(深圳)有限公司 Data query method and device, electronic equipment and computer readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11853107B2 (en) * 2018-07-24 2023-12-26 MachEye, Inc. Dynamic phase generation and resource load reduction for a query

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019060861A1 (en) * 2017-09-24 2019-03-28 Domo, Inc. Systems and methods for data analysis and visualization spanning multiple datasets
CN111694858A (en) * 2020-04-28 2020-09-22 平安科技(深圳)有限公司 Data blood margin analysis method, device, equipment and computer readable storage medium
CN112184011A (en) * 2020-09-27 2021-01-05 中国建设银行股份有限公司 Efficiency evaluation method and device, electronic equipment and readable storage medium
CN112699142A (en) * 2020-12-29 2021-04-23 平安普惠企业管理有限公司 Cold and hot data processing method and device, electronic equipment and storage medium
CN113377805A (en) * 2021-08-13 2021-09-10 腾讯科技(深圳)有限公司 Data query method and device, electronic equipment and computer readable storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
RDF查询语言到SQL语言的转换原理及其实现方法;雷云飞 等;计算机研究与发展;20040716;41(07);第1251-1252页 *
数据库查询优化研究;李澍;电脑知识与技术;20101028(第21期);第6103-6116也 *

Also Published As

Publication number Publication date
CN114238375A (en) 2022-03-25

Similar Documents

Publication Publication Date Title
CN114840531B (en) Data model reconstruction method, device, equipment and medium based on blood edge relation
CN114612194A (en) Product recommendation method and device, electronic equipment and storage medium
CN114398560B (en) Marketing interface setting method, device, equipment and medium based on WEB platform
CN113516417A (en) Service evaluation method and device based on intelligent modeling, electronic equipment and medium
CN112699142A (en) Cold and hot data processing method and device, electronic equipment and storage medium
CN113806434A (en) Big data processing method, device, equipment and medium
CN112949278A (en) Data checking method and device, electronic equipment and readable storage medium
CN114238375B (en) Index query method and device, electronic equipment and storage medium
CN114637811A (en) Data table entity relation graph generation method, device, equipment and storage medium
CN114862140A (en) Behavior analysis-based potential evaluation method, device, equipment and storage medium
CN112052310A (en) Information acquisition method, device, equipment and storage medium based on big data
CN114238777B (en) Negative feedback flow distribution method, device, equipment and medium based on behavior analysis
CN114817408B (en) Scheduling resource identification method and device, electronic equipment and storage medium
CN113849520B (en) Intelligent recognition method and device for abnormal SQL, electronic equipment and storage medium
CN114841165B (en) User data analysis and display method and device, electronic equipment and storage medium
CN114625975B (en) Knowledge graph-based customer behavior analysis system
CN113918305B (en) Node scheduling method, node scheduling device, electronic equipment and readable storage medium
CN115879947A (en) Management method and system based on electronic transaction
CN115022397A (en) Interface parameter simplifying method and device, electronic equipment and storage medium
CN113918995A (en) Data display method and device based on data authority distribution
CN114819590B (en) Policy intelligent recommendation method, device, equipment and storage medium
CN114185617B (en) Service call interface configuration method, device, equipment and storage medium
CN115759875B (en) Classified and hierarchical management method and system for suppliers of public resource transaction
CN113434365B (en) Data characteristic monitoring method and device, electronic equipment and storage medium
CN116303645A (en) Method, device, equipment and storage medium for quickly positioning interpersonal relationship path

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