CN116226498A - Data query method, device and equipment - Google Patents
Data query method, device and equipment Download PDFInfo
- Publication number
- CN116226498A CN116226498A CN202310220151.7A CN202310220151A CN116226498A CN 116226498 A CN116226498 A CN 116226498A CN 202310220151 A CN202310220151 A CN 202310220151A CN 116226498 A CN116226498 A CN 116226498A
- Authority
- CN
- China
- Prior art keywords
- query
- business
- information
- order number
- query request
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9532—Query formulation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/242—Query formulation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/10—Office automation; Time management
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Business, Economics & Management (AREA)
- General Engineering & Computer Science (AREA)
- Strategic Management (AREA)
- Mathematical Physics (AREA)
- Entrepreneurship & Innovation (AREA)
- Human Resources & Organizations (AREA)
- Computational Linguistics (AREA)
- Software Systems (AREA)
- Economics (AREA)
- Marketing (AREA)
- Operations Research (AREA)
- Quality & Reliability (AREA)
- Tourism & Hospitality (AREA)
- General Business, Economics & Management (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
技术领域technical field
本申请实施例涉及计算机技术领域,尤其涉及一种数据查询方法、装置及设备。The embodiments of the present application relate to the field of computer technology, and in particular, to a data query method, device, and equipment.
背景技术Background technique
工作人员可以通过企业的核心业务系统进行数据查询,以得到对应的业务信息。Staff can conduct data query through the enterprise's core business system to obtain corresponding business information.
在相关技术中,可以通过如下方式进行数据查询:用户可以在终端设备提供的查询页面输入要素信息并发送至服务器。服务器根据用户输入的要素信息,在服务器中存储的业务系统数据库中确定要素信息对应的业务信息并发送至终端设备。在上述过程中,当多个用户同时在业务系统中查询同一个业务的业务信息时,若每个用户输入的要素信息不同,服务器会同时根据每个用户输入的要素信息,确定对应的业务信息并发送给用户。同一时段同时多次查询可能使得服务器卡顿或者出现故障,导致数据查询的效率较低。In related technologies, data query can be performed in the following manner: a user can input element information on a query page provided by a terminal device and send it to a server. According to the element information input by the user, the server determines the business information corresponding to the element information in the business system database stored in the server and sends it to the terminal device. In the above process, when multiple users query the business information of the same business in the business system at the same time, if the element information input by each user is different, the server will simultaneously determine the corresponding business information based on the element information input by each user and sent to the user. Multiple queries at the same time at the same time may cause the server to freeze or fail, resulting in low data query efficiency.
发明内容Contents of the invention
本申请实施例提供一种数据查询方法、装置及设备,用以解决数据查询的效率较低的问题。Embodiments of the present application provide a data query method, device, and equipment to solve the problem of low data query efficiency.
第一方面,本申请实施例提供一种数据查询方法,包括:In the first aspect, the embodiment of the present application provides a data query method, including:
获取查询请求,所述查询请求包括至少一个第一业务单号、至少一个第一查询表的标识和每个第一查询表对应的至少一个第一要素;Obtaining a query request, the query request including at least one first business order number, at least one first query table identifier, and at least one first element corresponding to each first query table;
获取查询表与列式表之间的对应关系,所述列式表包括至少一个要素、以及每个要素对应的至少一条业务信息;Obtain the correspondence between the query table and the columnar table, where the columnar table includes at least one element and at least one piece of business information corresponding to each element;
根据所述查询请求和所述对应关系,确定所述查询请求对应的查询结果,所述查询结果包括所述至少一个第一业务单号和每个第一业务单号对应的业务数据。According to the query request and the corresponding relationship, determine a query result corresponding to the query request, where the query result includes the at least one first business order number and business data corresponding to each first business order number.
在一种可能的实施方式中,根据所述查询请求和所述对应关系,确定所述查询请求对应的查询结果,包括:In a possible implementation manner, determining a query result corresponding to the query request according to the query request and the correspondence relationship includes:
根据所述至少一个第一查询表的标识和所述对应关系,确定每个第一查询表对应的目标列式表;Determine a target columnar table corresponding to each first lookup table according to the identifier of the at least one first lookup table and the corresponding relationship;
根据所述至少一个第一业务单号和所述每个第一查询表对应的至少一个第一要素,在多个目标列式表中确定所述查询请求对应的业务数据;According to the at least one first business order number and at least one first element corresponding to each of the first query tables, determine the business data corresponding to the query request in a plurality of target column tables;
根据所述至少一个第一业务单号和所述每个第一业务单号对应的业务数据,生成所述查询结果。The query result is generated according to the at least one first service order number and the service data corresponding to each first service order number.
在一种可能的实施方式中,针对任意一个目标列式表,根据所述至少一个第一业务单号和所述至少一个第一要素,在所述目标列式表中确定所述查询请求对应的业务数据,包括:In a possible implementation manner, for any target columnar table, according to the at least one first business order number and the at least one first element, determine in the target columnar table that the query request corresponds to business data, including:
在目标列式表中,确定至少一个第一要素对应的业务信息集合;In the target columnar table, determine the business information set corresponding to at least one first element;
在每个业务信息集合中确定所述至少一个第一业务单号对应的业务信息;determining the business information corresponding to the at least one first business order number in each business information set;
将所述业务信息确定为所述查询请求对应的业务数据。The business information is determined as business data corresponding to the query request.
在一种可能的实施方式中,针对任意一个业务信息集合,在业务信息集合中确定所述至少一个第一业务单号对应的业务信息,包括:In a possible implementation manner, for any set of business information, determining the business information corresponding to the at least one first business order number in the set of business information includes:
确定所述第一查询表对应的主键信息;determining primary key information corresponding to the first query table;
根据所述至少一个第一业务单号和所述主键信息,在所述业务信息集合中确定所述业务信息。The service information is determined in the service information set according to the at least one first service order number and the primary key information.
在一种可能的实施方式中,根据所述至少一个第一业务单号和所述主键信息,在所述业务信息集合中确定所述业务信息,包括:In a possible implementation manner, according to the at least one first service order number and the primary key information, determining the service information in the service information set includes:
判断所述主键信息的数量是否为1;Judging whether the quantity of the primary key information is 1;
若是,在所述业务信息集合中,将每个第一业务单号对应的一条业务信息确定为所述查询请求对应的业务数据;If so, in the set of business information, determine a piece of business information corresponding to each first business order number as the business data corresponding to the query request;
若否,在所述业务信息集合中,将所述每个第一业务单号对应的多条业务信息确定为所述查询请求对应的业务数据。If not, in the service information set, determine multiple pieces of service information corresponding to each first service order number as service data corresponding to the query request.
在一种可能的实施方式中,所述方法还包括:In a possible implementation manner, the method also includes:
在业务数据库中获取业务信息的变更日志,所述变更日志包括更新后的第一业务信息;Acquiring a change log of the service information in the service database, the change log including the updated first service information;
在多个列式表中,确定所述第一业务信息对应的原始业务信息;In multiple columnar tables, determine original service information corresponding to the first service information;
根据所述变更日志,将所述列式表中的所述原始业务信息更新为所述第一业务信息。The original service information in the columnar table is updated to the first service information according to the change log.
在一种可能的实施方式中,获取查询请求,包括:In a possible implementation manner, obtaining a query request includes:
接收终端设备发送的所述查询请求。The query request sent by the terminal device is received.
在一种可能的实施方式中,根据所述查询请求和所述对应关系,确定所述查询请求对应的查询结果之后,还包括:In a possible implementation manner, after determining the query result corresponding to the query request according to the query request and the corresponding relationship, the method further includes:
向终端设备发送所述查询结果。Send the query result to the terminal device.
第二方面,本申请实施例提供一种数据查询装置,所述装置包括:In the second aspect, the embodiment of the present application provides a data query device, the device includes:
第一获取模块,用于获取查询请求,所述查询请求包括至少一个第一业务单号、至少一个第一查询表的标识和每个第一查询表对应的至少一个第一要素;A first obtaining module, configured to obtain a query request, the query request including at least one first business order number, at least one first query table identifier, and at least one first element corresponding to each first query table;
第二获取模块,用于获取查询表与列式表之间的对应关系,所述列式表包括至少一个要素、以及每个要素对应的至少一条业务信息;The second obtaining module is used to obtain the corresponding relationship between the query table and the columnar table, the columnar table includes at least one element and at least one piece of business information corresponding to each element;
确定模块,用于根据所述查询请求和所述对应关系,确定所述查询请求对应的查询结果,所述查询结果包括所述至少一个第一业务单号和每个第一业务单号对应的业务数据。A determining module, configured to determine a query result corresponding to the query request according to the query request and the corresponding relationship, the query result including the at least one first business order number and the corresponding information of each first business order number business data.
在一种可能的实施方式中,所述确定模块具体用于:In a possible implementation manner, the determining module is specifically configured to:
根据所述至少一个第一查询表的标识和所述对应关系,确定每个第一查询表对应的目标列式表;Determine a target columnar table corresponding to each first lookup table according to the identifier of the at least one first lookup table and the corresponding relationship;
根据所述至少一个第一业务单号和所述每个第一查询表对应的至少一个第一要素,在多个目标列式表中确定所述查询请求对应的业务数据;According to the at least one first business order number and at least one first element corresponding to each of the first query tables, determine the business data corresponding to the query request in a plurality of target column tables;
根据所述至少一个第一业务单号和所述每个第一业务单号对应的业务数据,生成所述查询结果。The query result is generated according to the at least one first service order number and the service data corresponding to each first service order number.
在一种可能的实施方式中,所述确定模块具体用于:In a possible implementation manner, the determining module is specifically configured to:
在目标列式表中,确定至少一个第一要素对应的业务信息集合;In the target columnar table, determine the business information set corresponding to at least one first element;
在每个业务信息集合中确定所述至少一个第一业务单号对应的业务信息;determining the business information corresponding to the at least one first business order number in each business information set;
将所述业务信息确定为所述查询请求对应的业务数据。The business information is determined as business data corresponding to the query request.
在一种可能的实施方式中,所述确定模块具体用于:In a possible implementation manner, the determining module is specifically configured to:
确定所述第一查询表对应的主键信息;determining primary key information corresponding to the first query table;
根据所述至少一个第一业务单号和所述主键信息,在所述业务信息集合中确定所述业务信息。The service information is determined in the service information set according to the at least one first service order number and the primary key information.
在一种可能的实施方式中,所述确定模块具体用于:In a possible implementation manner, the determining module is specifically configured to:
判断所述主键信息的数量是否为1;Judging whether the quantity of the primary key information is 1;
若是,在所述业务信息集合中,将每个第一业务单号对应的一条业务信息确定为所述查询请求对应的业务数据;If so, in the set of business information, determine a piece of business information corresponding to each first business order number as the business data corresponding to the query request;
若否,在所述业务信息集合中,将所述每个第一业务单号对应的多条业务信息确定为所述查询请求对应的业务数据。If not, in the service information set, determine multiple pieces of service information corresponding to each first service order number as service data corresponding to the query request.
在一种可能的实施方式中,所述装置还包括更新模块、接收模块以及发送模块。In a possible implementation manner, the device further includes an updating module, a receiving module, and a sending module.
其中,更新模块用于:Among them, the update module is used for:
在业务数据库中获取业务信息的变更日志,所述变更日志包括更新后的第一业务信息;Acquiring a change log of the service information in the service database, the change log including the updated first service information;
在多个列式表中,确定所述第一业务信息对应的原始业务信息;In multiple columnar tables, determine original service information corresponding to the first service information;
根据所述变更日志,将所述列式表中的所述原始业务信息更新为所述第一业务信息。The original service information in the columnar table is updated to the first service information according to the change log.
接收模块用于:The receiving module is used for:
接收终端设备发送的所述查询请求。The query request sent by the terminal device is received.
发送模块用于:The sending module is used for:
向终端设备发送所述查询结果。Send the query result to the terminal device.
第三方面,本申请实施例提供一种数据查询设备,包括:In a third aspect, the embodiment of the present application provides a data query device, including:
至少一个处理器;以及at least one processor; and
与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行第一方面任一项所述的方法。The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the method according to any one of the first aspect.
第四方面,本申请实施例提供一种存储有计算机指令的非瞬时计算机可读存储介质,其中,所述计算机指令用于使所述计算机执行第一方面中任一项所述的方法。In a fourth aspect, an embodiment of the present application provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method described in any one of the first aspects.
第五方面,本申请实施例提供一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现第一方面中任一项所述的方法。In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, and when the computer program is executed by a processor, implements the method described in any one of the first aspect.
本申请实施例提供的数据查询方法、装置及设备,设置了数据查询设备,数据查询设备中存储有多个列式表。在进行数据查询时,数据查询设备获取查询请求,查询请求包括第一业务单号、第一查询表的标识和至少一个第一要素。获取查询表和列式表之间的对应关系。根据查询请求和对应关系,确定查询请求对应的查询结果。查询结果包括第一业务单号和至少一个第一要素对应的业务数据。在上述过程中,由于可以根据业务数据库的查询表与列式表之间的对应关系,以及查询请求在数据查询设备中获取第一要素对应的业务数据,而不是在业务数据库中直接获取第一要素对应的业务信息,使得数据查询与核心系统的业务数据库解耦。且可以同时获取不同第一要素对应的业务信息,提高了数据查询的效率。The data query method, device, and device provided in the embodiments of the present application are provided with a data query device, and a plurality of columnar tables are stored in the data query device. When performing data query, the data query device obtains a query request, and the query request includes the first service order number, the identifier of the first query table and at least one first element. Get the correspondence between the query table and the columnar table. According to the query request and the corresponding relationship, the query result corresponding to the query request is determined. The query result includes the first business order number and business data corresponding to at least one first element. In the above process, since the business data corresponding to the first element can be obtained in the data query device according to the corresponding relationship between the query table of the business database and the columnar table, and the query request, instead of directly obtaining the first element in the business database The business information corresponding to the elements decouples the data query from the business database of the core system. In addition, business information corresponding to different first elements can be obtained simultaneously, thereby improving the efficiency of data query.
附图说明Description of drawings
图1为本申请实施例提供的应用场景的示意图;FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the present application;
图2为本申请实施例提供的一种数据查询方法的流程示意图;FIG. 2 is a schematic flow diagram of a data query method provided in an embodiment of the present application;
图3为本申请实施例提供的另一种数据查询方法的流程示意图;FIG. 3 is a schematic flow diagram of another data query method provided in the embodiment of the present application;
图4为本申请实施例提供的数据库的关系示意图;FIG. 4 is a schematic diagram of the relationship between the database provided by the embodiment of the present application;
图5为本申请实施例提供的数据查询的过程示意图;FIG. 5 is a schematic diagram of the data query process provided by the embodiment of the present application;
图6为本申请实施例提供的一种数据查询装置的结构示意图;FIG. 6 is a schematic structural diagram of a data query device provided in an embodiment of the present application;
图7为本申请实施例提供的另一种数据查询装置的结构示意图;FIG. 7 is a schematic structural diagram of another data query device provided in the embodiment of the present application;
图8为本申请实施例提供的数据查询设备的结构示意图。FIG. 8 is a schematic structural diagram of a data query device provided by an embodiment of the present application.
具体实施方式Detailed ways
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with aspects of the present application as recited in the appended claims.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, in this document, the term "comprising", "comprising" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus comprising that element.
为了便于理解,下面,结合图1,对本申请实施例所适用的应用场景进行说明。For ease of understanding, the application scenario applicable to the embodiment of the present application will be described below with reference to FIG. 1 .
图1为本申请实施例提供的应用场景的示意图。请参见图1,包括终端设备101以及服务器102。终端设备101可以为平板电脑、计算机等。终端设备101中设置有查询页面。服务器102中设置有业务数据库。业务数据库中存储有多条业务信息(业务信息1、业务信息2、……、业务信息N)。用户可以在终端设备101提供的显示页面输入要素信息,并发送至服务器102。服务器102根据要素信息,在服务器102的业务数据库中确定要素信息对应的业务信息。服务器102将要素信息对应的业务信息发送至终端设备101,以使用户得到数据查询结果。FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the present application. Please refer to FIG. 1 , which includes a terminal device 101 and a server 102 . The terminal device 101 may be a tablet computer, a computer, and the like. A query page is set in the terminal device 101 . A business database is set in the server 102 . Multiple pieces of business information (business information 1, business information 2, . . . , business information N) are stored in the business database. The user can input element information on the display page provided by the terminal device 101 and send it to the server 102 . According to the element information, the server 102 determines the service information corresponding to the element information in the service database of the server 102 . The server 102 sends the service information corresponding to the element information to the terminal device 101, so that the user can obtain the data query result.
在相关技术中,可以通过如下方式进行数据查询:当多个用户同时在业务系统中查询同一个业务的业务信息时,服务器会同时根据每个用户输入的要素信息,确定对应的业务信息并发送给用户。同一时段同时多次查询可能使得核心业务系统对应的服务器卡顿或者出现故障,导致数据查询的效率较低。In related technologies, data query can be performed in the following manner: when multiple users query the business information of the same business in the business system at the same time, the server will simultaneously determine the corresponding business information according to the element information input by each user and send the to the user. Multiple queries at the same time at the same time may cause the server corresponding to the core business system to freeze or fail, resulting in low data query efficiency.
本申请实施例中,设置了数据查询设备,数据查询设备中存储有多个列式表。在进行数据查询时,数据查询设备获取查询请求,查询请求包括第一业务单号、第一查询表的标识和至少一个第一要素。获取查询表和列式表之间的对应关系。根据查询请求和对应关系,确定查询请求对应的查询结果。查询结果包括第一业务单号和至少一个第一要素对应的业务数据。在上述过程中,由于可以根据业务数据库的查询表与列式表之间的对应关系,以及查询请求在数据查询设备中获取第一要素对应的业务数据,而不是在业务数据库中直接获取第一要素对应的业务信息,使得数据查询与核心系统的业务数据库解耦。且可以实时获取不同第一要素对应的业务信息,提高了数据查询的效率。In the embodiment of the present application, a data query device is provided, and multiple columnar tables are stored in the data query device. When performing data query, the data query device obtains a query request, and the query request includes the first service order number, the identifier of the first query table and at least one first element. Get the correspondence between the query table and the columnar table. According to the query request and the corresponding relationship, the query result corresponding to the query request is determined. The query result includes the first business order number and business data corresponding to at least one first element. In the above process, since the business data corresponding to the first element can be obtained in the data query device according to the corresponding relationship between the query table of the business database and the columnar table, and the query request, instead of directly obtaining the first element in the business database The business information corresponding to the elements decouples the data query from the business database of the core system. In addition, business information corresponding to different first elements can be obtained in real time, thereby improving the efficiency of data query.
下面,通过具体实施例对本申请所示的方法进行说明。需要说明的是,下面几个实施例可以单独存在,也可以互相结合,对于相同或相似的内容,在不同的实施例中不再重复说明。In the following, the method shown in this application will be described through specific examples. It should be noted that the following embodiments may exist independently or be combined with each other, and the same or similar content will not be repeatedly described in different embodiments.
图2为本申请实施例提供的一种数据查询方法的流程示意图。请参见图2,该方法可以包括:FIG. 2 is a schematic flowchart of a data query method provided by an embodiment of the present application. See Figure 2, the method can include:
S201、获取查询请求。S201. Obtain a query request.
本申请实施例的执行主体可以为数据查询设备,也可以为设置在数据查询设备中的数据查询装置。数据查询装置可以通过软件实现,也可以通过软件和硬件的结合实现。数据查询设备可以为服务器。The executor of this embodiment of the present application may be a data query device, or may be a data query device installed in the data query device. The data query device can be implemented by software, or by a combination of software and hardware. The data query device may be a server.
查询请求包括查询请求包括至少一个第一业务单号、至少一个第一查询表的标识和每个第一查询表对应的至少一个第一要素。The query request includes that the query request includes at least one first service order number, at least one identifier of the first query table, and at least one first element corresponding to each first query table.
获取查询请求可以包括两种情况。The acquisition query request may include two situations.
情况1、用户可以在终端设备提供的查询页面,输入查询请求并向数据查询设备发送至查询请求。用户可以输入同一业务单号对应的多个第一要素,也可以输入多个业务单号对应的相同第一要素。Case 1. The user can input a query request on the query page provided by the terminal device and send the query request to the data query device. The user may input multiple first elements corresponding to the same business order number, or may input the same first element corresponding to multiple business order numbers.
情况2、其他业务系统通过接口调用的方式,通过输入业务单号和至少一个第一要素,向数据查询设备发送数据查询请求。Case 2. Other business systems send a data query request to the data query device by inputting a business order number and at least one first element through an interface call.
查询表为在业务数据库中存储的查询表,查询表中包括多条业务信息。业务数据库设置在核心系统对应的服务器中,业务数据库中存储有多张查询表。The query table is a query table stored in the business database, and the query table includes multiple pieces of business information. The business database is set in the server corresponding to the core system, and multiple query tables are stored in the business database.
例如,假设用户查询保险A的保险开始时刻和保险终止时刻。用户可以在终端设备提供的查询页面输入的查询请求具体可以如表1所示:For example, assume that the user queries the insurance start time and insurance end time of insurance A. The query request that the user can input on the query page provided by the terminal device can be specifically shown in Table 1:
表1Table 1
S202、获取查询表与列式表之间的对应关系。S202. Obtain the corresponding relationship between the query table and the columnar table.
列式表包括至少一个要素、以及每个要素对应的至少一条业务信息。The columnar table includes at least one element and at least one piece of business information corresponding to each element.
列式表的每个列的命名可以为查询表-查询表要素名的形式。列式表中的主键信息可以为业务单号。将一个要素没有对应的业务信息列式表确定为空列式表。若列式表为空列式表,则通过数据查询得到查询请求对应的业务数据为空。The name of each column of the columnar table can be in the form of query table-query table element name. The primary key information in the columnar table can be a business order number. A column-style table of business information corresponding to an element is determined as an empty column-style table. If the columnar table is an empty columnar table, the business data corresponding to the query request obtained through data query is empty.
列式数据库中每个业务信息的结构关系与业务系统数据库中每个业务信息的结构关系不同。可以提前将查询表与列式表之间的对应关系,以及多个列式表存储在列式数据库中,列式数据库设置在数据查询设备中。列式数据库可以为HBase、Vertica等数据库。The structural relationship of each business information in the columnar database is different from the structural relationship of each business information in the business system database. The corresponding relationship between the query table and the columnar table, and multiple columnar tables can be stored in the columnar database in advance, and the columnar database is set in the data query device. The columnar database can be HBase, Vertica and other databases.
例如,保险公司A的保单基本信息对应的列式表具体可以如表2所示:For example, the columnar table corresponding to the basic policy information of insurance company A can be shown in Table 2:
表2Table 2
可以根据查询表对应的主键信息,确定查询表对应列式表中业务信息的数量。The quantity of business information in the columnar table corresponding to the query table can be determined according to the primary key information corresponding to the query table.
例如,查询表与列式表之间的对应关系具体可以如表3所示:For example, the corresponding relationship between the query table and the columnar table can be specifically shown in Table 3:
表3table 3
根据表3可以确定查询表PRPCM对应的主键信息为业务单号,则确定查询表PRPCM与列式表hbaseTable-A0201之间的对应关系为一对一,即查询表PRPCM对应列式表hbaseTable-A0110中1条业务信息。查询表与列式表之间的对应关系可以表示为PRPCM:1:hbaseTable-A0201。根据表3可以确定查询表PRPCIN对应的主键信息为业务单号以及序列号,则确定查询表PRPCIN与列式表hbaseTable-A0110之间的对应关系为一对M,M为大于等于1的整数。即查询表PRPCIN对应列式表hbaseTable-A0110中M条业务信息。查询表与列式表之间的对应关系可以表示为PRPCM:M:hbaseTable-A0201。According to Table 3, it can be determined that the primary key information corresponding to the query table PRPCM is the business order number, and then the corresponding relationship between the query table PRPCM and the columnar table hbaseTable-A0201 is determined to be one-to-one, that is, the query table PRPCM corresponds to the columnar table hbaseTable-A0110 1 piece of business information. The correspondence between the query table and the columnar table can be expressed as PRPCM:1:hbaseTable-A0201. According to Table 3, it can be determined that the primary key information corresponding to the query table PRPCIN is the business order number and serial number, and then it is determined that the corresponding relationship between the query table PRPCIN and the columnar table hbaseTable-A0110 is a pair of M, and M is an integer greater than or equal to 1. That is, the query table PRPCIN corresponds to M pieces of business information in the columnar table hbaseTable-A0110. The correspondence between the query table and the columnar table can be expressed as PRPCM:M:hbaseTable-A0201.
S203、根据查询请求和对应关系,确定查询请求对应的查询结果。S203. Determine a query result corresponding to the query request according to the query request and the corresponding relationship.
查询结果包括至少一个第一业务单号和每个第一业务单号对应的业务数据。The query result includes at least one first business order number and business data corresponding to each first business order number.
可以通过如下方式,确定查询请求对应的查询结果:根据至少一个第一查询表的标识和对应关系,确定每个第一查询表对应的目标列式表;根据第一业务单号和每个第一查询表对应的至少一个第一要素,在多个目标列式表中确定查询请求对应的业务数据;根据第一业务单号和业务数据,生成查询结果。The query result corresponding to the query request can be determined in the following manner: according to the identification and corresponding relationship of at least one first query table, determine the target columnar table corresponding to each first query table; The at least one first element corresponding to a query table determines the service data corresponding to the query request in multiple target columnar tables; generates a query result according to the first service order number and the business data.
例如,根据上述表1所示的查询请求,确定第一查询表为PRPCM。根据上述表3所示的查询表与列式表之间的对应关系,确定第一查询表PRPCM对应的列式表为hbaseTable-A0201。列式表hbaseTable-A0201具体可以如表4所示:For example, according to the query request shown in Table 1 above, it is determined that the first query table is PRPCM. According to the correspondence between the lookup table and the columnar table shown in Table 3 above, it is determined that the columnar table corresponding to the first lookup table PRPCM is hbaseTable-A0201. The column table hbaseTable-A0201 can be specifically shown in Table 4:
表4Table 4
根据上述表3可以确定,查询请求对应列式表hbaseTable-A0110中1条业务信息。根据上述表1所示的第一业务单号和表4所示的列式表,可以确定查询请求对应的业务数据为保险开始时刻2023.01.01,保险终止时刻2025.01.01。因此,查询结果包括第一业务单号PADC2023A14023751F,以及保险开始时刻2023.01.01,保险终止时刻2025.01.01。According to the above Table 3, it can be determined that the query request corresponds to one piece of business information in the columnar table hbaseTable-A0110. According to the first business order number shown in Table 1 and the columnar table shown in Table 4, it can be determined that the business data corresponding to the query request is the insurance start time 2023.01.01 and the insurance end time 2025.01.01. Therefore, the query result includes the first business order number PADC2023A14023751F, the insurance start time 2023.01.01, and the insurance termination time 2025.01.01.
本申请实施例提供的数据查询方法,获取查询请求。获取查询表与列式表之间的对应关系。根据查询请求和对应关系,确定查询请求对应的查询结果。在上述过程中,由于可以根据业务数据库的查询表与列式表之间的对应关系,以及查询请求在数据查询设备中获取第一要素对应的业务数据,而不是在业务数据库中直接获取第一要素对应的业务信息,使得数据查询保证时效性的同时与可以核心系统的业务数据库解耦。同时通过要素信息参数化的方式将接口的功能最大化,提高了数据查询的效率。The data query method provided in the embodiment of this application obtains a query request. Obtain the correspondence between the query table and the columnar table. According to the query request and the corresponding relationship, the query result corresponding to the query request is determined. In the above process, since the business data corresponding to the first element can be obtained in the data query device according to the corresponding relationship between the query table of the business database and the columnar table, and the query request, instead of directly obtaining the first element in the business database The business information corresponding to the elements enables data query to be decoupled from the business database of the core system while ensuring timeliness. At the same time, the function of the interface is maximized through the parameterization of element information, which improves the efficiency of data query.
在上述任意一个实施例基础上,下面,结合图3,对数据查询的详细过程进行说明。On the basis of any one of the above embodiments, the detailed process of data query will be described below with reference to FIG. 3 .
图3为本申请实施例提供的另一种数据查询方法的流程示意图。请参见图3,该方法包括:FIG. 3 is a schematic flowchart of another data query method provided by the embodiment of the present application. See Figure 3, the method includes:
S301、获取查询请求。S301. Obtain a query request.
在获取查询请求时,若查询条件中存在多个查询表,可以以查询表名称+第一要素的方式确定第一查询表的标识,以快速确定查询请求的每个第一要素对应的第一查询表。When obtaining a query request, if there are multiple query tables in the query condition, the identifier of the first query table can be determined in the form of the query table name + the first element, so as to quickly determine the first query table corresponding to each first element of the query request. lookup table.
例如,查询请求的第一要素包括保险开始时刻、保险终止时刻以及被保险人。可以确定保险开始时刻、保险终止时刻属于查询表PRPCM,被保险人属于查询表PRPCIN。可以以查询表名称+第一要素的方式确定第一查询表的标识。即查询请求对应的第一查询表标识可以包括PRPCM(保险开始时刻、保险终止时刻)以及PRPCIN(被保险人)。For example, the first element of the query request includes the insurance start time, the insurance end time, and the insured. It can be determined that the insurance start time and insurance termination time belong to the lookup table PRPCM, and the insured belongs to the lookup table PRPCIN. The identifier of the first lookup table can be determined in the form of lookup table name+first element. That is, the first lookup table identifier corresponding to the query request may include PRPCM (insurance start time, insurance end time) and PRPCIN (insured).
通过查询表名称+第一要素的方式确定第一查询表的标识,可以避免服务器在数据查询时遍历查询表确定第一要素的过程,提高了数据查询的效率。The identification of the first query table is determined by the method of the query table name + the first element, which can avoid the process of the server traversing the query table to determine the first element during data query, and improve the efficiency of data query.
S302、获取查询表与列式表之间的对应关系。S302. Obtain the corresponding relationship between the query table and the columnar table.
可以提前设置查询表与列式表之间的对应关系并存储在数据查询设备的预设存储空间中。The corresponding relationship between the query table and the columnar table can be set in advance and stored in the preset storage space of the data query device.
S303、根据至少一个第一查询表的标识和对应关系,确定每个第一查询表对应的目标列式表。S303. Determine a target columnar table corresponding to each first lookup table according to the identifier and the corresponding relationship of at least one first lookup table.
可以根据第一查询表的标识,在对应关系中确定第一查询表对应的目标列式表的标识。根据目标列式表的标识,在列式数据库中确定对应的目标列式表。The identifier of the target columnar table corresponding to the first lookup table may be determined in the corresponding relationship according to the identifier of the first lookup table. According to the identifier of the target columnar table, the corresponding target columnar table is determined in the columnar database.
例如,查询表与列式表之间的对应关系具体可以如表5所示:For example, the corresponding relationship between the query table and the columnar table can be specifically shown in Table 5:
表5table 5
假设根据查询请求确定第一查询表的标识为PRPCIN。根据表5所示的对应关系,确定第一查询表的标识PRPCIN对应的列式表的标识为hbaseTable-A0110。因此,在列式数据库中将hbaseTable-A0110对应的列式表确定为目标列式表。Assume that the identifier of the first lookup table is determined to be PRPCIN according to the lookup request. According to the corresponding relationship shown in Table 5, it is determined that the identifier of the column-type table corresponding to the identifier PRPCIN of the first lookup table is hbaseTable-A0110. Therefore, determine the columnar table corresponding to hbaseTable-A0110 as the target columnar table in the columnar database.
S304、针对任意一个目标列式表,在目标列式表中确定至少一个第一要素对应的业务信息集合。S304. For any target columnar table, determine a business information set corresponding to at least one first element in the target columnar table.
例如,根据上述举例确定的hbaseTable-A0110对应的目标列式表具体可以如表6所示:For example, the target columnar table corresponding to hbaseTable-A0110 determined according to the above example can be shown in Table 6:
表6Table 6
假设第一要素为被保险人以及证件号码。则可以确定第一要素对应的业务信息集合为表6中被保险人对应的列,以及表6中证件号码对应的列。Assume that the first element is the insured and the ID number. Then it can be determined that the business information set corresponding to the first element is the column corresponding to the insured in Table 6, and the column corresponding to the certificate number in Table 6.
S305、针对任意一个业务信息集合,确定第一查询表对应的主键信息。S305. For any set of business information, determine primary key information corresponding to the first lookup table.
查询表对应的主键信息可以存储在数据查询设备的预设存储空间中。The primary key information corresponding to the query table may be stored in a preset storage space of the data query device.
主键信息为将所有业务信息进行关联生成查询表的信息。The primary key information is the information that associates all business information to generate a query table.
例如,对于保险公司A,可以根据保险单号将多个保单基本信息表进行关联生成保单信息查询表。保单信息查询表对应的主键信息为保险单号。For example, for insurance company A, multiple policy basic information tables can be associated according to the insurance policy number to generate a policy information query table. The primary key information corresponding to the policy information query table is the policy number.
主键信息可以包括序列号。序列号用于指示列式数据库中的动态列。Primary key information can include serial numbers. Sequence numbers are used to indicate dynamic columns in columnar databases.
例如,一个业务单号对应的两个被保险人的序列号分别为1和2,则对应的在列式表HbaseTableA中对应的位置列为$1和$2。For example, if the serial numbers of two insureds corresponding to a business order number are 1 and 2, the corresponding positions in the columnar table HbaseTableA are listed as $1 and $2.
动态列是为了兼容业务单号一对多的业务信息,拥有动态列的要素在一个业务单号下会存在多条业务信息。例如,一个业务单号下会存在多个被保险人身份证号和被保险人姓名等要素对应的业务信息。The dynamic column is to be compatible with the one-to-many business information of the business order number. An element with a dynamic column will have multiple pieces of business information under one business order number. For example, under one business order number, there will be multiple business information corresponding to elements such as the ID number of the insured and the name of the insured.
S306、判断主键信息的数量是否为1。S306. Determine whether the quantity of primary key information is 1.
若是,执行S307。If yes, execute S307.
若否,执行S308。If not, execute S308.
S307、将每个第一业务单号对应的一条业务信息确定为查询请求对应的业务数据。S307. Determine a piece of business information corresponding to each first business order number as business data corresponding to the query request.
例如,假设根据查询请求确定第一查询表的标识为PRPCM,确定查询表PRPCM对应的主键信息为业务单号。根据第一查询表的标识PRPCM和上述表5所示的对应关系,确定第一查询表PRPCM对应的目标列式表为hbaseTable-A0201。则在目标列式表hbaseTable-A0201中,确定第一要素对应的业务信息集合为投保人对应的列。在业务信息集合中,将第一业务单号PADC2023A14023751F对应的一条业务信息用户A,确定为查询请求对应的业务数据。For example, assuming that the identifier of the first lookup table is determined to be PRPCM according to the query request, and the primary key information corresponding to the lookup table PRPCM is determined to be the service order number. According to the identification PRPCM of the first lookup table and the corresponding relationship shown in Table 5 above, it is determined that the target columnar table corresponding to the first lookup table PRPCM is hbaseTable-A0201. Then in the target columnar table hbaseTable-A0201, determine the business information set corresponding to the first element as the column corresponding to the policyholder. In the service information set, a piece of service information user A corresponding to the first service order number PADC2023A14023751F is determined as the service data corresponding to the query request.
在S307之后,执行S309。After S307, execute S309.
S308、在业务信息集合中,将每个第一业务单号对应的多条业务信息确定为查询请求对应的业务数据。S308. In the business information set, determine multiple pieces of business information corresponding to each first business order number as business data corresponding to the query request.
例如,假设第一要素为被保险人和证件号码,根据上述表6所示的目标列式表hbaseTable-A0110,则可以确定第一要素对应的业务信息集合为表6中被保险人对应的列,以及表6中证件号码对应的列。在业务信息集合中,将第一业务单号PADC2022A0124501T对应的2条业务信息确定为查询请求对应的业务数据。业务数据具体可以如表7所示:For example, assuming that the first element is the insured and the certificate number, according to the target column table hbaseTable-A0110 shown in Table 6 above, it can be determined that the business information set corresponding to the first element is the column corresponding to the insured in Table 6 , and the column corresponding to the document number in Table 6. In the business information set, two pieces of business information corresponding to the first business order number PADC2022A0124501T are determined as the business data corresponding to the query request. The specific business data can be shown in Table 7:
表7Table 7
S309、根据至少一个第一业务单号和每个第一业务单号对应的业务数据,生成查询结果。S309. Generate a query result according to at least one first business order number and business data corresponding to each first business order number.
例如,根据第一业务单号PADC2022A0124501T以及上述表7所示的业务数据,生成的查询结果具体可以如表8所示:For example, according to the first business order number PADC2022A0124501T and the business data shown in Table 7 above, the generated query results can be specifically shown in Table 8:
表8Table 8
S310、向终端设备发送查询结果。S310. Send the query result to the terminal device.
可以按照业务单号-查询表-业务信息的形式,将查询结果发送至终端设备。终端设备可以将业务单号-查询表-业务信息形式的查询结果按照预设方式进行解析处理,以得到查询请求对应的业务信息。其中,若存在查询表为查询表中的子表,则查询结果可以为业务单号-查询表-子表-业务信息。The query result can be sent to the terminal device in the form of business order number-query table-business information. The terminal device can analyze and process the query result in the form of service order number-query table-service information according to a preset method, so as to obtain the service information corresponding to the query request. Wherein, if the query table is a sub-table in the query table, the query result may be business order number-query table-sub-table-business information.
若业务信息的数量为1,则查询结果的业务信息为一个数据;若业务信息的数量不为1,则查询结果的业务信息为一组数据。If the number of business information is 1, the business information of the query result is a piece of data; if the number of business information is not 1, the business information of the query result is a set of data.
可以通过如下方式,对查询结果进行解析处理:获取第一要素对应的结构信息;根据第一要素和结构信息,对查询结果进行解析处理,得到第一要素对应的至少一条业务信息。The query result can be analyzed and processed in the following manner: obtain the structural information corresponding to the first element; analyze and process the query result according to the first element and the structural information to obtain at least one piece of business information corresponding to the first element.
结构信息用于指示要素与查询表之间的关系。可以将要素以及要素对应的结构信息,存储在终端设备的预设存储空间中。Structural information is used to indicate the relationship between features and lookup tables. The elements and the structure information corresponding to the elements may be stored in a preset storage space of the terminal device.
查询请求对应的要素可以通过预设方式进行入参并生成结构信息。在数据查询过程中,结构信息、结构信息的解析方式以及查询结果对应的反参方式都是根据核心业务系统中的查询表结构确定的。因此,可以实现一次开发配置,多次共用。The elements corresponding to the query request can be input in a preset way and generate structural information. During the data query process, the structural information, the analysis method of the structural information, and the counter-parameter method corresponding to the query results are all determined according to the query table structure in the core business system. Therefore, it is possible to realize one-time development configuration and multiple sharing.
例如,终端设备接收到上述表8所示的查询结果之后,获取被保险人和证件号码的结构信息。结构信息具体可以如表9所示:For example, after receiving the query result shown in Table 8 above, the terminal device acquires the structural information of the insured and the certificate number. The structural information can be specifically shown in Table 9:
表9Table 9
根据第一要素和表9所示的结构信息,对查询结果进行解析处理,得到第一要素对应的至少一条业务信息。业务信息具体可以如表10所示:According to the first element and the structural information shown in Table 9, the query result is analyzed and processed to obtain at least one piece of business information corresponding to the first element. The specific business information can be shown in Table 10:
表10Table 10
终端设备根据第一要素和结构信息,对查询结果进行解析处理。使得根据查询请求进行数据查询可以准确返回查询结果。The terminal device analyzes and processes the query result according to the first element and the structural information. So that the data query according to the query request can accurately return the query result.
本申请实施例提供的数据查询方法,获取查询请求。获取查询表与列式表之间的对应关系。根据第一查询表的标识和对应关系,确定第一查询表对应的目标列式表。在目标列式表中,确定至少一个第一要素对应的业务信息集合。确定第一查询表对应的主键信息。根据第一业务单号和主键信息,在业务信息集合中确定业务信息。根据第一业务单号和业务数据,生成查询结果并向终端设备发送查询结果。在上述过程中,由于可以根据业务数据库的查询表与列式表之间的对应关系,以及查询请求在数据查询设备中获取第一要素对应的业务数据,而不是在业务数据库中直接获取第一要素对应的业务信息,使得数据查询保证时效性的同时与可以核心系统的业务数据库解耦。同时通过要素信息参数化的方式将接口的功能最大化,提高了数据查询的效率。The data query method provided in the embodiment of this application obtains a query request. Obtain the correspondence between the query table and the columnar table. According to the identifier and the corresponding relationship of the first lookup table, the target columnar table corresponding to the first lookup table is determined. In the target columnar table, the business information set corresponding to at least one first element is determined. Determine primary key information corresponding to the first query table. The business information is determined in the business information set according to the first business order number and the primary key information. According to the first service order number and the service data, a query result is generated and sent to the terminal device. In the above process, since the business data corresponding to the first element can be obtained in the data query device according to the corresponding relationship between the query table of the business database and the columnar table, and the query request, instead of directly obtaining the first element in the business database The business information corresponding to the elements enables data query to be decoupled from the business database of the core system while ensuring timeliness. At the same time, the function of the interface is maximized through the parameterization of element information, which improves the efficiency of data query.
在上述任意一个实施例基础上,下面,结合图4,对列式数据库与业务数据库的关系进行说明。On the basis of any one of the above embodiments, the relationship between the columnar database and the service database will be described below with reference to FIG. 4 .
图4为本申请实施例提供的数据库的关系示意图。请参见图4,包括业务数据库401,消息中间件402以及列式数据库403。业务数据库401设置在核心业务系统中,消息中间件402以及列式数据库403设置在数据查询设备中。业务数据库401中存储有多个查询表(查询表1、查询表2、……、查询表M),每个查询表是根据主键信息关联起来的多条业务信息。消息中间件402中存储有多个主题对应的数据。每个主题对应业务数据库401中一个查询表。列式数据库403中存储有多个列式表(列式表1、列式表2、……、列式表K),每个列式表与业务数据库401中的至少一个查询表有对应关系。FIG. 4 is a schematic diagram of the relationship between the databases provided by the embodiment of the present application. Please refer to FIG. 4 , which includes a business database 401 , a message middleware 402 and a columnar database 403 . The business database 401 is set in the core business system, and the message middleware 402 and the columnar database 403 are set in the data query device. Multiple query tables (query table 1, query table 2, . . . , query table M) are stored in the business database 401, and each query table is multiple pieces of business information associated according to primary key information. Data corresponding to multiple topics are stored in the message middleware 402 . Each topic corresponds to a query table in the service database 401 . A plurality of columnar tables (columnary table 1, columnary table 2, ..., columnary table K) are stored in the columnar database 403, and each columnar table has a corresponding relationship with at least one query table in the business database 401 .
可以根据监听日志的方式,通过消息中间件402实时同步列式数据库403和业务数据库401中的业务信息。当业务数据库401中的业务信息更新时,可以通过如下方式,更新列式数据库403中对应的业务信息:在业务数据库401中获取业务信息的变更日志,变更日志包括更新后的第一业务信息。通过消息中间件402,在列式数据库403的多个列式表中,确定第一业务信息对应的原始业务信息。列式数据库403根据变更日志,将列式表中的原始业务信息更新为第一业务信息。The business information in the columnar database 403 and the business database 401 can be synchronized in real time through the message middleware 402 according to the way of monitoring logs. When the business information in the business database 401 is updated, the corresponding business information in the columnar database 403 can be updated in the following way: Obtain a change log of the business information in the business database 401, and the change log includes the updated first business information. The original service information corresponding to the first service information is determined in multiple columnar tables of the columnar database 403 through the message middleware 402 . The columnar database 403 updates the original service information in the columnar table to the first service information according to the change log.
本申请实施例提供的业务信息更新过程,在业务数据库中获取业务信息的变更日志,变更日志包括更新后的第一业务信息;在多个列式表中,确定第一业务信息对应的原始业务信息;根据变更日志,将列式表中的原始业务信息更新为第一业务信息。在上述过程中,可以通过消息中间件将数据查询设备和核心业务系统进行解耦,使得数据查询过程和核心业务系统的其他业务过程可以独立进行,提高了数据查询的效率。In the business information update process provided by the embodiment of the present application, the change log of the business information is obtained in the business database, and the change log includes the updated first business information; in multiple columnar tables, the original business corresponding to the first business information is determined information; according to the change log, the original service information in the columnar table is updated to the first service information. In the above process, the data query device and the core business system can be decoupled through the message middleware, so that the data query process and other business processes of the core business system can be carried out independently, improving the efficiency of data query.
在上述任意一个实施例基础上,下面,结合图5,对数据查询的过程进行举例说明。On the basis of any one of the above-mentioned embodiments, the process of data query will be illustrated below with reference to FIG. 5 .
图5为本申请实施例提供的数据查询的过程示意图。请参见图5,包括终端设备501,数据查询设备502和服务器503。终端设备501可以为平板电脑、计算机等,终端设备501中设置有查询页面。数据查询设备502可以为服务器,数据查询设备502中设置有列式数据库和消息中间件。列式数据库中存储有多个列式表(列式表1、列式表2、……、列式表K)。数据查询设备502中存储有查询表与列式表之间的对应关系。服务器503中设置有业务数据库,业务数据库中存储有多个查询表(查询表1、查询表2、……、查询表M)。数据查询设备502可以通过消息中间件,同步服务器503中的业务信息。FIG. 5 is a schematic diagram of the data query process provided by the embodiment of the present application. Please refer to FIG. 5 , which includes a terminal device 501 , a data query device 502 and a server 503 . The terminal device 501 may be a tablet computer, a computer, etc., and a query page is set in the terminal device 501 . The data query device 502 may be a server, and the data query device 502 is provided with a columnar database and message middleware. A plurality of columnar tables (columnary table 1, columnary table 2, . . . , columnar table K) are stored in the columnar database. The corresponding relationship between the query table and the columnar table is stored in the data query device 502 . The server 503 is provided with a service database, and multiple lookup tables (lookup table 1, lookup table 2, . . . , lookup table M) are stored in the service database. The data query device 502 can synchronize the business information in the server 503 through the message middleware.
用户通过终端设备501提供的查询页面输入查询请求并向数据查询设备502发送查询请求。查询请求具体可以如表11所示:The user inputs a query request through the query page provided by the terminal device 501 and sends the query request to the data query device 502 . The specific query request can be shown in Table 11:
表11Table 11
数据查询设备502接收终端设备501发送的查询请求,并根据第一查询表的标识和对应关系,确定第一查询表PRPCM(保险开始时刻、保险终止时刻)对应的目标列式表为hbaseTable-A0201,确定第一查询表PRPCIN(被保险人)对应的目标列式表为hbaseTable-A0110。目标列式表hbaseTable-A0201具体可以如表12所示:The data query device 502 receives the query request sent by the terminal device 501, and determines the target columnar table corresponding to the first query table PRPCM (insurance start time, insurance end time) as hbaseTable-A0201 according to the identification and corresponding relationship of the first query table , determine the target columnar table corresponding to the first query table PRPCIN (insured person) as hbaseTable-A0110. The target column table hbaseTable-A0201 can be specifically shown in Table 12:
表12Table 12
目标列式表hbaseTable-A0110具体可以如表13所示:The target column table hbaseTable-A0110 can be specifically shown in Table 13:
表13Table 13
数据查询设备502在表12所示的目标列式表hbaseTable-A0201中,确定第一要素对应的业务信息集合1为表12中保险开始时刻对应的列,以及保险终止时刻对应的列。数据查询设备502在表13所示的目标列式表hbaseTable-A0110中,确定第一要素对应的业务信息集合2为表13中被保险人对应的列。In the target column-type table hbaseTable-A0201 shown in Table 12, the data query device 502 determines that the business information set 1 corresponding to the first element is the column corresponding to the insurance start time and the column corresponding to the insurance termination time in Table 12. In the target column-type table hbaseTable-A0110 shown in Table 13, the data query device 502 determines that the business information set 2 corresponding to the first element is the column corresponding to the insured in Table 13.
数据查询设备502确定第一查询表PRPCM对应的主键信息为业务单号,确定第一查询表PRPCIN对应的主键信息为业务单号以及序列号。第一查询表PRPCM对应的主键信息数量为1,数据查询设备502在业务信息集合1中,将第一业务单号PADC2023D54012751C对应的一条业务信息确定为查询请求对应的业务数据。业务信息集合1中确定的业务数据具体可以如表14所示:The data query device 502 determines that the primary key information corresponding to the first lookup table PRPCM is the service order number, and determines that the primary key information corresponding to the first lookup table PRPCIN is the service order number and the serial number. The number of primary key information corresponding to the first query table PRPCM is 1, and the data query device 502 determines a piece of business information corresponding to the first business order number PADC2023D54012751C in the business information set 1 as the business data corresponding to the query request. The business data determined in the business information set 1 can be specifically shown in Table 14:
表14Table 14
第一查询表PRPCIN对应的主键信息数量为2,数据查询设备502在业务信息集合2中,将第一业务单号PADC2023D54012751C对应的多条业务信息确定为查询请求对应的业务数据。业务信息集合2中确定的业务数据具体可以如表15所示:The number of primary key information corresponding to the first query table PRPCIN is 2, and the data query device 502 determines multiple pieces of business information corresponding to the first business order number PADC2023D54012751C in the business information set 2 as the business data corresponding to the query request. The business data determined in the business information set 2 can be specifically shown in Table 15:
表15Table 15
根据第一业务单号PADC2023D54012751C和表14和表15所示业务数据,生成查询结果。查询结果具体可以如表16所示:Generate query results based on the first business order number PADC2023D54012751C and the business data shown in Table 14 and Table 15. The query results can be specifically shown in Table 16:
表16Table 16
数据查询设备502向终端设备501发送表16所示的查询结果。终端设备501可以对查询结果进行解析处理,以得到查询请求对应的业务信息。The data query device 502 sends the query results shown in Table 16 to the terminal device 501 . The terminal device 501 may analyze and process the query result to obtain the service information corresponding to the query request.
本申请实施例提供的数据查询方法,获取查询请求。获取查询表与列式表之间的对应关系。根据第一查询表的标识和对应关系,确定第一查询表对应的目标列式表。在目标列式表中,确定至少一个第一要素对应的业务信息集合。确定第一查询表对应的主键信息。根据第一业务单号和主键信息,在业务信息集合中确定业务信息。根据第一业务单号和业务数据,生成查询结果并向终端设备发送查询结果。在上述过程中,由于可以根据业务数据库的查询表与列式表之间的对应关系,以及查询请求在数据查询设备中获取第一要素对应的业务数据,而不是在业务数据库中直接获取第一要素对应的业务信息,使得数据查询保证时效性的同时与可以核心系统的业务数据库解耦。同时通过要素信息参数化的方式将接口的功能最大化,提高了数据查询的效率。The data query method provided in the embodiment of this application obtains a query request. Obtain the correspondence between the query table and the columnar table. According to the identifier and the corresponding relationship of the first lookup table, the target columnar table corresponding to the first lookup table is determined. In the target columnar table, the business information set corresponding to at least one first element is determined. Determine primary key information corresponding to the first query table. The business information is determined in the business information set according to the first business order number and the primary key information. According to the first service order number and the service data, a query result is generated and sent to the terminal device. In the above process, since the business data corresponding to the first element can be obtained in the data query device according to the corresponding relationship between the query table of the business database and the columnar table, and the query request, instead of directly obtaining the first element in the business database The business information corresponding to the elements enables data query to be decoupled from the business database of the core system while ensuring timeliness. At the same time, the function of the interface is maximized through the parameterization of element information, which improves the efficiency of data query.
图6为本申请实施例提供的一种数据查询装置的结构示意图。请参见图6,该数据查询装置10可以包括:FIG. 6 is a schematic structural diagram of a data query device provided by an embodiment of the present application. Referring to Fig. 6, the data query device 10 may include:
第一获取模块11,用于获取查询请求,所述查询请求包括至少一个第一业务单号、至少一个第一查询表的标识和每个第一查询表对应的至少一个第一要素;The first acquiring
第二获取模块12,用于获取查询表与列式表之间的对应关系,所述列式表包括至少一个要素、以及每个要素对应的至少一条业务信息;The second obtaining
确定模块13,用于根据所述查询请求和所述对应关系,确定所述查询请求对应的查询结果,所述查询结果包括所述至少一个第一业务单号和每个第一业务单号对应的业务数据。A determining
本申请实施例提供的数据查询装置可以执行上述方法实施例所示的技术方案,其实现原理以及有益效果类似,此处不再进行赘述。The data query device provided in the embodiment of the present application can implement the technical solutions shown in the above method embodiments, and its implementation principles and beneficial effects are similar, and will not be repeated here.
在一种可能的实施方式中,所述确定模块13具体用于:In a possible implementation manner, the determining
根据所述至少一个第一查询表的标识和所述对应关系,确定每个第一查询表对应的目标列式表;Determine a target columnar table corresponding to each first lookup table according to the identifier of the at least one first lookup table and the corresponding relationship;
根据所述至少一个第一业务单号和所述每个第一查询表对应的至少一个第一要素,在多个目标列式表中确定所述查询请求对应的业务数据;According to the at least one first business order number and at least one first element corresponding to each of the first query tables, determine the business data corresponding to the query request in a plurality of target list tables;
根据所述至少一个第一业务单号和所述每个第一业务单号对应的业务数据,生成所述查询结果。The query result is generated according to the at least one first service order number and the service data corresponding to each first service order number.
在一种可能的实施方式中,所述确定模块13具体用于:In a possible implementation manner, the determining
在目标列式表中,确定至少一个第一要素对应的业务信息集合;In the target columnar table, determine the business information set corresponding to at least one first element;
在每个业务信息集合中确定所述至少一个第一业务单号对应的业务信息;determining the business information corresponding to the at least one first business order number in each business information set;
将所述业务信息确定为所述查询请求对应的业务数据。The business information is determined as business data corresponding to the query request.
在一种可能的实施方式中,所述确定模块13具体用于:In a possible implementation manner, the determining
确定所述第一查询表对应的主键信息;determining primary key information corresponding to the first query table;
根据所述至少一个第一业务单号和所述主键信息,在所述业务信息集合中确定所述业务信息。The service information is determined in the service information set according to the at least one first service order number and the primary key information.
在一种可能的实施方式中,所述确定模块13具体用于:In a possible implementation manner, the determining
判断所述主键信息的数量是否为1;Judging whether the quantity of the primary key information is 1;
若是,在所述业务信息集合中,将每个第一业务单号对应的一条业务信息确定为所述查询请求对应的业务数据;If so, in the set of business information, determine a piece of business information corresponding to each first business order number as the business data corresponding to the query request;
若否,在所述业务信息集合中,将所述每个第一业务单号对应的多条业务信息确定为所述查询请求对应的业务数据。If not, in the service information set, determine multiple pieces of service information corresponding to each first service order number as service data corresponding to the query request.
本申请实施例提供的数据查询装置可以执行上述方法实施例所示的技术方案,其实现原理以及有益效果类似,此处不再进行赘述。The data query device provided in the embodiment of the present application can implement the technical solutions shown in the above method embodiments, and its implementation principles and beneficial effects are similar, and will not be repeated here.
图7为本申请实施例提供的另一种数据查询装置的结构示意图。在图6所示实施例的基础上,请参见图7,数据查询装置10还包括更新模块14、接收模块15以及发送模块16。FIG. 7 is a schematic structural diagram of another data query device provided by an embodiment of the present application. On the basis of the embodiment shown in FIG. 6 , referring to FIG. 7 , the data query device 10 further includes an updating
其中,更新模块14用于:Among them, the
在业务数据库中获取业务信息的变更日志,所述变更日志包括更新后的第一业务信息;Acquiring a change log of the service information in the service database, the change log including the updated first service information;
在多个列式表中,确定所述第一业务信息对应的原始业务信息;In multiple columnar tables, determine original service information corresponding to the first service information;
根据所述变更日志,将所述列式表中的所述原始业务信息更新为所述第一业务信息。The original service information in the columnar table is updated to the first service information according to the change log.
接收模块15用于:The receiving
接收终端设备发送的所述查询请求。The query request sent by the terminal device is received.
发送模块16用于:Sending
向终端设备发送所述查询结果。Send the query result to the terminal device.
本申请实施例提供的数据查询装置可以执行上述方法实施例所示的技术方案,其实现原理以及有益效果类似,此处不再进行赘述。The data query device provided in the embodiment of the present application can implement the technical solutions shown in the above method embodiments, and its implementation principles and beneficial effects are similar, and will not be repeated here.
图8为本申请实施例提供的数据查询设备的结构示意图。请参见图8,该数据查询设备20可以包括:存储器21、处理器22。示例性地,存储器21、处理器22,各部分之间通过总线23相互连接。FIG. 8 is a schematic structural diagram of a data query device provided by an embodiment of the present application. Referring to FIG. 8 , the data query device 20 may include: a
存储器21用于存储程序指令;The
处理器22用于执行该存储器所存储的程序指令,用以使得数据查询设备20执行上述方法实施例所示的方法。The
本申请实施例提供的数据查询设备可以执行上述方法实施例所示的技术方案,其实现原理以及有益效果类似,此处不再进行赘述。The data query device provided by the embodiment of the present application can implement the technical solutions shown in the above method embodiments, and its implementation principles and beneficial effects are similar, and will not be repeated here.
本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当所述计算机执行指令被处理器执行时用于实现上述方法。An embodiment of the present application provides a computer-readable storage medium, where computer-executable instructions are stored in the computer-readable storage medium, and the computer-executable instructions are used to implement the foregoing method when executed by a processor.
本申请实施例还可提供一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时,可实现上述方法。The embodiment of the present application may further provide a computer program product, including a computer program, and when the computer program is executed by a processor, the foregoing method may be implemented.
实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一可读取存储器中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储器(存储介质)包括:只读存储器(英文:read-only memory,缩写:ROM)、随机存取存储器(英文:Random Access Memory,缩写:RAM)、快闪存储器、硬盘、固态硬盘、磁带(英文:magnetic tape)、软盘(英文:floppy disk)、光盘(英文:optical disc)及其任意组合。All or part of the steps for implementing the above method embodiments can be completed by program instructions and related hardware. The aforementioned program can be stored in a readable memory. When the program is executed, it executes the steps comprising the above-mentioned method embodiments; and the aforementioned memory (storage medium) includes: read-only memory (English: read-only memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviation: RAM), flash memory, hard disk, solid state disk, magnetic tape (English: magnetic tape), floppy disk (English: floppy disk), optical disc (English: optical disc) and any combination thereof.
本申请实施例是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理单元以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理单元执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。Embodiments of the present application are described with reference to flowcharts and/or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processing unit of other programmable data processing equipment to produce a machine such that the instructions executed by the processing unit of the computer or other programmable data processing equipment produce a An apparatus for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions The device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow chart or blocks of the flowchart and/or the block or blocks of the block diagrams.
显然,本领域的技术人员可以对本申请实施例进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请实施例的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Apparently, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the present application. In this way, if the modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.
在本申请中,术语“包括”及其变形可以指非限制性的包括;术语“或”及其变形可以指“和/或”。本申请中术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。本申请中,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。In this application, the term "include" and its variants may mean non-limiting inclusion; the term "or" and its variants may mean "and/or". The terms "first", "second", etc. in this application are used to distinguish similar objects, and not necessarily used to describe a specific order or sequence. In the present application, "plurality" means two or more. "And/or" describes the association relationship of associated objects, indicating that there may be three types of relationships, for example, A and/or B may indicate: A exists alone, A and B exist simultaneously, and B exists independently. The character "/" generally indicates that the contextual objects are an "or" relationship.
Claims (12)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310220151.7A CN116226498A (en) | 2023-03-07 | 2023-03-07 | Data query method, device and equipment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310220151.7A CN116226498A (en) | 2023-03-07 | 2023-03-07 | Data query method, device and equipment |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN116226498A true CN116226498A (en) | 2023-06-06 |
Family
ID=86569276
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202310220151.7A Pending CN116226498A (en) | 2023-03-07 | 2023-03-07 | Data query method, device and equipment |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN116226498A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116991896A (en) * | 2023-08-02 | 2023-11-03 | 中国银行股份有限公司 | Data query methods, devices and equipment |
| CN118170784A (en) * | 2023-12-15 | 2024-06-11 | 易保网络技术(上海)有限公司 | Data query method, electronic device and storage medium |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115203258A (en) * | 2022-07-18 | 2022-10-18 | 京东科技信息技术有限公司 | Data query method and device, electronic equipment and computer readable medium |
| CN115577012A (en) * | 2022-10-25 | 2023-01-06 | 浪潮通用软件有限公司 | A method, device, equipment and medium for dynamically expanding query of column information |
| CN115687340A (en) * | 2021-07-28 | 2023-02-03 | 北京字节跳动网络技术有限公司 | Service query method, device, equipment and storage medium |
-
2023
- 2023-03-07 CN CN202310220151.7A patent/CN116226498A/en active Pending
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115687340A (en) * | 2021-07-28 | 2023-02-03 | 北京字节跳动网络技术有限公司 | Service query method, device, equipment and storage medium |
| CN115203258A (en) * | 2022-07-18 | 2022-10-18 | 京东科技信息技术有限公司 | Data query method and device, electronic equipment and computer readable medium |
| CN115577012A (en) * | 2022-10-25 | 2023-01-06 | 浪潮通用软件有限公司 | A method, device, equipment and medium for dynamically expanding query of column information |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116991896A (en) * | 2023-08-02 | 2023-11-03 | 中国银行股份有限公司 | Data query methods, devices and equipment |
| CN118170784A (en) * | 2023-12-15 | 2024-06-11 | 易保网络技术(上海)有限公司 | Data query method, electronic device and storage medium |
| WO2025123522A1 (en) * | 2023-12-15 | 2025-06-19 | 易保网络技术(上海)有限公司 | Data query method, electronic device and storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10380103B2 (en) | Object data updating method and apparatus in an object storage system | |
| US20210232558A1 (en) | Data isolation in a blockchain network | |
| US9910895B2 (en) | Push subscriptions | |
| US10762109B2 (en) | Asynchronous deletion in non-relational databases | |
| CN103729471A (en) | Method and device for database query | |
| EP3188051B1 (en) | Systems and methods for search template generation | |
| WO2018201887A1 (en) | Data response method, apparatus, terminal device, and medium | |
| CN111723161B (en) | A data processing method, device and equipment | |
| CN112835885B (en) | A processing method, device and system for distributed table storage | |
| CN116226498A (en) | Data query method, device and equipment | |
| CN111752939A (en) | Data processing method, apparatus, computer system, medium for multiple systems | |
| CN109947759A (en) | A data index establishment method, index retrieval method and device | |
| CN111125240B (en) | Method, device, electronic device and storage medium for realizing distributed transaction | |
| CN113704222B (en) | A method and device for processing a service request | |
| CN109948358A (en) | Blacklist sharing method and device, storage medium, and computer equipment | |
| CN111061740A (en) | A data synchronization method, device and storage medium | |
| CN115757406A (en) | Data storage method and device, electronic equipment and storage medium | |
| US20220261412A1 (en) | System and method for partitioning data based on authorization rules | |
| US11048486B2 (en) | Developer tools for a communication platform | |
| CN105653566B (en) | A kind of method and device for realizing database write access | |
| CN115757517A (en) | Data query method, device, computer equipment and storage medium | |
| CN115080537A (en) | Multi-tenant data partitioning method, program product and electronic device | |
| CN114003818A (en) | Page recommendation method, device, server and storage medium | |
| CN111045720B (en) | Code management method, code management system, server and medium | |
| CN115408403A (en) | Isolation method, server and system for multi-tenant data |
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 |