A method and device for constructing a data query system

By building the underlying query subsystem and carrying out inheritance development, the problem of repeated code and maintenance costs of query subsystems in the financial market is solved, and a data query system with strong adaptability and high scalability is realized.

CN115422468BActive Publication Date: 2025-08-19CHINA CONSTRUCTION BANK +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211217828.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-30
Publication Date
2025-08-19
Estimated Expiration
2042-09-30

AI Technical Summary

Technical Problem

In the prior art, the query subsystems of various business departments of the financial market have developed a large number of similar codes due to differentiated demands, which are difficult to ensure consistency and have high maintenance costs.

Method used

Build the underlying query subsystem, and through inherited development and layer-by-layer expansion, each query subsystem is decoupled and developed, inheriting corresponding functions and information, and reducing duplicate code development.

Benefits of technology

It has achieved the ability to meet differentiated query needs, reduce maintenance costs, ensure consistency, and improve the adaptability and scalability of the data query system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115422468B_ABST
    Figure CN115422468B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of data processing technology, and in particular to a method and device for constructing a data query system. The method includes: obtaining the first element storage information of each query service, and the association relationship between the first element storage information of each query service and the element storage information of other query services; determining the underlying element storage information based on the first element storage information of each query service, and constructing the underlying query subsystem based on the underlying element storage information and the preset query function; constructing the corresponding N-th layer query subsystem based on the first element storage information of each query service and the corresponding association relationship; N is determined based on the corresponding association relationship of the query service, and N is a positive integer greater than 1; constructing a data query system based on the query subsystems corresponding to each query service. In this way, the various query subsystems can be decoupled and developed, making the data query system more adaptable and improving the scalability of the data query system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of data processing technology, and in particular to a method and device for constructing a data query system. Background Art

[0002] At present, with the continuous development of science and technology, more and more technologies are being applied in the financial field.

[0003] In the financial industry, different business departments in the financial market sector may have various levels of screening and display requirements for transaction elements in different interfaces or process processing in the front-end and back-end systems due to their respective business processing scope or responsibility identification scope.

[0004] However, the subsystems for querying transaction elements are often inconsistent (for example, they may be subsystems for ledger query, approval form query, or transaction confirmation task form query), and the screening conditions of each subsystem must not only meet its own screening conditions, but also match the screening conditions of the transaction elements. As a result, these subsystems themselves cannot be further split into fine-grained parts, resulting in these subsystems not being universal. As a result, in the implementation process of each subsystem, a large amount of similar underlying code development is often required to adapt to the needs of different business processes. Summary of the Invention

[0005] The embodiments of the present invention provide a method and apparatus for constructing a data query system, which is used to provide a method for constructing a data query system that meets differentiated query requirements without the need to develop a large amount of similar code and has low maintenance costs.

[0006] In a first aspect, an embodiment of the present invention provides a method for constructing a data query system, the method comprising:

[0007] Obtaining the first element storage information of each query service, and the association relationship between the first element storage information of each query service and the element storage information of other query services;

[0008] Determine the underlying element storage information based on the first element storage information of each query service, and construct the underlying query subsystem based on the underlying element storage information and the preset query function; the underlying element storage information is the element storage information included in each query service;

[0009] Constructing a corresponding N-th layer query subsystem based on the first element storage information and the corresponding association relationship of each query service; wherein the N-th layer query subsystem inherits the corresponding functions and information of the bottom layer query subsystem, the information corresponding to the query subsystem before the N-th layer inherited on the basis of the bottom layer query subsystem, and the corresponding first element storage information; N is determined based on the corresponding association relationship of the query service, and N is a positive integer greater than 1;

[0010] The data query system is constructed according to the query subsystems corresponding to the various query services.

[0011] In a possible implementation, the preset query function of the underlying query subsystem specifically includes at least two of: an input object, a business object, a query screening condition, a query output field, an output field mapping file, and an output object.

[0012] In a possible implementation, each preset query function in the query subsystem at the bottom layer is defined with a public sub-function that can be inherited by query subsystems at other layers.

[0013] In one possible implementation, the method further includes:

[0014] Receive the second element storage information of the new query service;

[0015] If it is determined that the second element storage information is the same as the first element storage information of any query service among the query services; determining the query subsystem corresponding to the any query service;

[0016] A new layer of query subsystem is constructed based on the second element storage information and the query subsystem corresponding to any query business; the new layer of query subsystem includes: the functions and information corresponding to the underlying query subsystem, the information corresponding to the query subsystem corresponding to any query business, and the second element storage information.

[0017] In one possible implementation, the method further includes:

[0018] If the element storage information corresponding to the query subsystem of the Nth layer is adjusted, determining the adjusted new element storage information;

[0019] A new N-th-layer query subsystem is constructed based on the new element storage information and the information corresponding to the query subsystem before the N-th layer; the new N-th-layer query subsystem includes: inheriting the functions and information corresponding to the underlying query subsystem, iteratively inheriting the information corresponding to the query subsystem before the N-th layer based on the underlying query subsystem, and the adjusted new element storage information.

[0020] In a second aspect, a device for constructing a data query system is provided, the device comprising:

[0021] An obtaining unit, configured to obtain the first element storage information of each query service, and the association relationship between the first element storage information of each query service and the element storage information of other query services;

[0022] a construction unit, configured to determine underlying element storage information based on the first element storage information of each query service, and to construct an underlying query subsystem based on the underlying element storage information and a preset query function; the underlying element storage information is element storage information included in each query service;

[0023] The construction unit is configured to construct a corresponding N-th layer query subsystem based on the first element storage information and the corresponding association relationship of each query service; wherein the N-th layer query subsystem inherits the corresponding functions and information of the bottom layer query subsystem, the information corresponding to the query subsystem before the N-th layer inherited on the basis of the bottom layer query subsystem, and the corresponding first element storage information; N is determined based on the corresponding association relationship of the query service, and N is a positive integer greater than 1;

[0024] The construction unit is further configured to construct the data query system according to the query subsystems corresponding to the respective query services.

[0025] In a possible implementation, the preset query function of the underlying query subsystem specifically includes at least two of: an input object, a business object, a query screening condition, a query output field, an output field mapping file, and an output object.

[0026] In a possible implementation, each preset query function in the query subsystem at the bottom layer is defined with a public sub-function that can be inherited by query subsystems at other layers.

[0027] In a possible embodiment, the construction unit is further used to:

[0028] Receive the second element storage information of the new query service;

[0029] If it is determined that the second element storage information is the same as the first element storage information of any query service among the query services; determining the query subsystem corresponding to the any query service;

[0030] A new layer of query subsystem is constructed based on the second element storage information and the query subsystem corresponding to any query business; the new layer of query subsystem includes: the functions and information corresponding to the underlying query subsystem, the information corresponding to the query subsystem corresponding to any query business, and the second element storage information.

[0031] In a possible embodiment, the construction unit is further used to:

[0032] If the element storage information corresponding to the query subsystem of the Nth layer is adjusted, determining the adjusted new element storage information;

[0033] A new N-th-layer query subsystem is constructed based on the new element storage information and the information corresponding to the query subsystem before the N-th layer; the new N-th-layer query subsystem includes: inheriting the functions and information corresponding to the underlying query subsystem, iteratively inheriting the information corresponding to the query subsystem before the N-th layer based on the underlying query subsystem, and the adjusted new element storage information.

[0034] According to a third aspect, an electronic device is provided, comprising: a processor, and a memory communicatively connected to the processor;

[0035] The memory stores computer-executable instructions;

[0036] The processor executes the computer-executable instructions stored in the memory to implement the method for constructing the data query system as described above.

[0037] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method for constructing the data query system as described above.

[0038] In a fifth aspect, a computer program product is provided, comprising a computer program, which implements the method for constructing the above-mentioned data query system when executed by a processor.

[0039] The beneficial effects of the present invention are as follows:

[0040] In an embodiment of the present invention, the electronic device can obtain the first element storage information of each query service, as well as the association relationship between the first element storage information of each query service and the element storage information of other query services; determine the underlying element storage information based on the first element storage information of each query service, and construct the underlying query subsystem based on the underlying element storage information and the preset query function; construct the corresponding N-th layer query subsystem based on the first element storage information of each query service and the corresponding association relationship; N is determined based on the corresponding association relationship of the query service, and N is a positive integer greater than 1; construct a data query system based on the query subsystems corresponding to each query service.

[0041] In this way, the data query system can meet the differentiated query requirements of various query services. Because each query subsystem is decoupled and developed, and each query subsystem inherits the functions and information of its corresponding query subsystem, the problem of developing a large amount of similar code is avoided, and the maintenance cost of the data query system is also reduced. Furthermore, because the data query system is built based on the subsystems corresponding to each query service, the consistency of the data query system can be guaranteed, and the data query system is more adaptable.

[0042] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present invention. The purposes and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0044] Figure 1 This is an optional schematic diagram of an application scenario in an embodiment of the present invention;

[0045] Figure 2 This is a flow chart of a method for constructing a data query system according to an embodiment of the present invention;

[0046] Figure 3 A schematic diagram of the relationship between element storage information in an embodiment of the present invention;

[0047] Figure 4 A schematic diagram of a query subsystem according to an embodiment of the present invention;

[0048] Figure 5 A schematic diagram of another query subsystem in an embodiment of the present invention;

[0049] Figure 6 A schematic diagram of building another query subsystem in an embodiment of the present invention;

[0050] Figure 7 Schematic diagram of inheritance implementation of query function in an embodiment of the present invention;

[0051] Figure 8 A schematic diagram of the structure of a data query system construction device according to an embodiment of the present invention;

[0052] Figure 9 The figure is a schematic diagram of the hardware structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. In the absence of conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other arbitrarily. In addition, although the logical order is shown in the flowchart, in some cases, the steps shown or described can be performed in an order different from that here.

[0054] The term "comprises" and any variations thereof in the description and claims of the present invention are intended to cover non-exclusive protection. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements, but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.

[0055] In the embodiment of the present invention, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0056] Furthermore, unless otherwise specified, ordinal numbers such as "first" and "second" in the embodiments of the present invention are used to distinguish between multiple objects and are not used to limit the size, content, sequence, timing, priority, or importance of the multiple objects. For example, the first element storage information and the second element storage information are only used to distinguish the element storage information and do not indicate a difference in content, size, priority, or importance between the two element storage information.

[0057] To facilitate understanding of the technical solutions provided by the embodiments of the present invention, some key terms used in the embodiments of the present invention are explained here:

[0058] Financial market business processing refers to the processing operations for standardized investment businesses, including exchange rate business, interest rate business, bond business, precious metals business, commodity business, money market business, etc. The main business processing links include front-end (investment strategy, transaction management, portfolio management, etc.), middle-end (risk control, position monitoring, exposure valuation, etc.), and back-end (post-trade operations management, transaction delivery confirmation, clearing and settlement, etc.) business processing. The aforementioned various businesses and the corresponding businesses in each business processing link can all be understood as query services in the embodiments of the present invention. Of course, project businesses in other fields, such as construction projects, can also serve as query services, and this is not limited in the embodiments of the present invention.

[0059] Financial Market Product Transaction Elements: refers to the transaction elements of various products in various financial markets, such as foreign exchange trading (spot, forward, swap), interbank lending, precious metal trading (spot, forward, swap), precious metal leasing, bond trading, bond repurchase, bond lending, and other products. These elements include the transaction date, value date, maturity date, transaction amount, transaction currency, transaction quantity, and related cash flows generated by the transaction. At least one of the aforementioned financial market product transaction elements can be understood as element storage information in the embodiments of the present invention. That is, the element storage information can be understood as including element storage information for bond trading, or including element storage information for bond trading and bond repurchase, and this is not limited in the embodiments of the present invention.

[0060] Query subsystem: This type of query service returns a list of qualified data, rather than querying the details of individual transactions. The query service can be based on product transaction elements themselves or process data within a financial market operation. However, due to business processing requirements, it also requires the simultaneous display of transaction-related elements. When the query service is based on product transaction elements themselves, the service can return a list of all transaction elements for all products that meet the requirements based on the input conditions of some transaction elements. When the query service is based on process data within a financial market operation, for example, querying a list of approval documents in a certain status, business processing requires information about both the approval documents themselves and the underlying transaction elements. Based on the approval document status and the input conditions of some transaction elements, the service can return a list of approval documents that meet the status and have matching transaction elements, with the corresponding transaction elements displayed simultaneously. For example, if the query is for a list of transaction confirmation tasks in backend business, the business processing requires attention to both the information about the transaction confirmation tasks and the transaction elements behind them. Based on the status of the confirmation tasks and the input conditions of some transaction elements, the service can return a list of transaction confirmation tasks that meet this status and match the transaction elements. The transaction elements corresponding to the transaction confirmation tasks must be displayed simultaneously.

[0061] Currently, there are two main approaches to querying transaction elements within the interfaces of each subsystem, divided by development group or module. The first approach involves integrating the query body with the transaction elements and directly writing input conditions and return statements in the corresponding tables of the transaction modules, resulting in a large amount of similar code implementation. The second approach involves storing a similar set of tables within the module itself, and providing input and return statements based on these tables, resulting in multiple sets of similar table structures and a large amount of similar code.

[0062] The first implementation has the following drawbacks: First, developers need to understand not only their own module's business information but also the transaction module's table structure and field meanings, placing high demands on developers. Second, the corresponding code or underlying SQL statements are similar. If the transaction module is modified, the corresponding SQL must also be modified simultaneously, which can easily lead to inconsistencies and cause query result errors. Furthermore, the second implementation has the following drawbacks: First, it also places high demands on developers. In addition to understanding their own module's business information, they also need to understand the transaction module's table structure and field meanings. Second, it increases table maintenance costs. Adding fields to the transaction module generally requires simultaneous adjustments to the original module.

[0063] It can be seen that the existing technology has differentiated query requirements of various business departments in the financial market in the business processing link, which has led to the development of a large number of similar codes, difficulty in ensuring consistency, and high maintenance costs.

[0064] In order to solve the aforementioned problems, the present invention provides a method for constructing a data query system. Through this method, there is no need to do a large amount of similar code development. It is only necessary to build a general underlying query subsystem, and then carry out inheritance development and layer-by-layer expansion on this basis. In this way, each development module or group can focus on the design and implementation of its own module as much as possible, so there is no need for a lot of repeated communication of element information related to the transaction module. As a result, the transaction module tables, transaction module methods and classes, and the underlying SQL implementation can be reused as much as possible at the lowest cost.

[0065] Furthermore, based on the underlying query subsystem, we can develop and expand it layer by layer, and then simultaneously add new query subsystems with their own query subject filtering conditions and return results. This way, when a transaction module needs to modify or add fields, it only needs to find the corresponding base layer code to modify. Developers of upper-level services do not need to worry about the implementation details of the lower-level code or the specific database table fields, thus ensuring a high degree of decoupling of the query services of other modules during implementation.

[0066] After introducing the design concepts of the embodiments of the present invention, the following briefly describes the application scenarios to which the technical solutions of the embodiments of the present invention can be applied. It should be noted that the application scenarios described below are only for the purpose of illustrating the embodiments of the present invention and are not intended to be limiting. During implementation, the technical solutions provided by the embodiments of the present invention can be flexibly applied according to actual needs.

[0067] The solution provided by the embodiment of the present invention can be applied to all kinds of business scenarios that require data query.

[0068] See Figure 1As shown, a scenario diagram provided by an embodiment of the present invention may include multiple terminal devices 101 and a server 102, wherein the terminal device 101-1, the terminal device 101-2, ..., the terminal device 101-n can be used by different objects, and each terminal device is provided with its own query platform.

[0069] Specifically, in an embodiment of the present invention, the subject can log in to the corresponding query platform on the terminal device 101, and after logging in, establish communication between the terminal device 101 and the server 102, so that the server 102 provides services for the query platform.

[0070] In the embodiment of the present invention, the terminal device 101 can be, for example, a mobile phone, a tablet computer (PAD), a personal computer (PC), a smart TV, a smart car device, a wearable device, etc., which is not limited in the embodiment of the present invention.

[0071] In an embodiment of the present invention, server 102 can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, or it can be a physical server, but is not limited to this.

[0072] The terminal device 101 and the server 102, as well as each terminal device 101, can be directly or indirectly connected to each other through one or more networks 103. The network 103 can be a wired network or a wireless network, for example, a mobile cellular network or a Wireless Fidelity (WIFI) network. Of course, other possible networks are also possible, and the embodiment of the present invention does not limit this.

[0073] In an embodiment of the present invention, the object can log in to the corresponding query platform on the terminal device 101 to trigger a query request, and then send the query request to the server 102 through the terminal device 101. The server 102 receives the query request and processes it based on the data query system to obtain the query result, and then feeds back the query result to the terminal device 101.

[0074] In the embodiment of the present invention, a data query system is running on the server 102, wherein the construction method of the data query system is described below. Figure 2 As shown in the corresponding embodiments, no further details are given here.

[0075] Of course, the method provided in the embodiment of the present invention is not limited to Figure 1 The application scenarios shown can also be used in other possible application scenarios, such as application scenarios where multiple terminal devices interact with multiple servers, which are not limited in the embodiments of the present invention. Figure 1 The functions that can be implemented by each device in the application scenario shown will be described in subsequent method embodiments and will not be described in detail here.

[0076] To further illustrate the technical solutions provided by the embodiments of the present invention, the following is a detailed description of the technical solutions in conjunction with the accompanying drawings and specific implementation methods. Although the embodiments of the present invention provide the method operation steps as shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on routine or no creative labor. In steps where there is no necessary causal relationship logically, the execution order of these steps is not limited to the execution order provided by the embodiments of the present invention. In the actual processing process or when the device is executed, the method may be executed in the order of the methods shown in the embodiments or drawings or in parallel.

[0077] See Figure 2 As shown in FIG, a flow chart of a method for constructing a data query system provided by an embodiment of the present invention is provided. The process of the method can be executed by an electronic device, which can be Figure 1 The specific implementation process of the method for the server 102 is as follows:

[0078] Step 201: Obtain the first element storage information of each query service, and the association relationship between the first element storage information of each query service and the element storage information of other query services.

[0079] In an embodiment of the present invention, the electronic device can obtain the first element storage information of each query service and further determine the association relationship between the first element storage information of each query service and the element storage information of other query services based on the first element storage information of each query service.

[0080] For example, see Figure 3 , is a schematic diagram of the relationship between element storage information in an embodiment of the present invention. Figure 3 For example, let's assume that all query services belong to the bond trading category. Specifically, bond trading services are generally categorized into bond trading, bond repurchase, and bond lending. For example, the relationships between these services can be expressed using a tree structure.

[0081] Specifically, the transaction elements of the bond trading business are respectively stored in the bond trading basic information table and the bond trading sub-table, that is, the first element storage information of the bond trading business includes the bond trading basic information table and the bond trading sub-table; the transaction elements of the bond repurchase business are respectively stored in the bond trading basic information table and the bond repurchase sub-table, and multiple mortgage information is stored in the mortgage bond information table, that is, the first element storage information of the bond repurchase business includes the bond trading basic information table, the bond repurchase sub-table and the mortgage bond information table; the transaction elements of the bond lending business are respectively stored in the bond trading basic information table and the bond lending sub-table, multiple mortgage bond information is stored in the mortgage bond information table, and the lending transaction also has corresponding fee information stored in the fee information table, that is, the first element storage information of the bond lending business includes the bond trading basic information table, the bond lending sub-table, the mortgage bond information table and the fee information table.

[0082] It can be seen that there is an association relationship between the first element storage information of the bond trading business, the bond repurchase business and the bond lending transaction business; wherein, the association relationship can be understood as the first element storage information corresponding to the two query businesses respectively contains the same information.

[0083] Step 202: Determine the underlying element storage information based on the first element storage information of each query service, and build the underlying query subsystem based on the underlying element storage information and the preset query function; the underlying element storage information is the element storage information included in each query service.

[0084] For example, see Figure 3 As can be seen, the first element storage information corresponding to bond trading, bond repurchase, and bond lending businesses contains the same information, namely the bond trading basic information table. In other words, the bond trading basic information table stores the underlying element information for the aforementioned bond trading, bond repurchase, and bond lending businesses.

[0085] It can be seen that in the embodiment of the present invention, the electronic device can determine the underlying element storage information based on the data storage characteristics of the transaction elements.

[0086] In an embodiment of the present invention, after the electronic device determines the underlying element storage information, it can construct an underlying query subsystem based on the underlying element storage information and a preset query function. The preset query function includes at least two of an input object, a business object, a query filter condition, a query output field, an output field mapping file, and an output object.

[0087] For example, the preset query function includes: an InVo class for implementing the sub-function of determining the input object, a Bo class for implementing the sub-function of determining the business object, an input condition sql fragment for implementing the sub-function of determining the query screening condition, an output condition sql fragment for implementing the sub-function of determining the query output field, an output resultmap for implementing the sub-function of determining the output field mapping file, and an OutVo class for implementing the sub-function of determining the output object. Optionally, the relationship between the aforementioned query functions is reflected in the fact that the flow of data is from the input class to the sql and then to the output class. Among them, the functions provided by these classes or sql fragments are mutually complementary and complete, and these classes or sql fragments can independently provide a complete query function after being combined, that is, the query subsystem in the implementation of the present invention.

[0088] In this embodiment of the present invention, each preset query function in the bottom-level query subsystem defines public subfunctions that can be inherited by query subsystems at other levels. Optionally, for each level of query subsystem implementation, the electronic device can define corresponding public and special subfunctions. For example, public and special attributes can be defined in a class, or public and special fragments can be defined in SQL. Special subfunctions can be dedicated to specialized processing logic to implement non-public functions.

[0089] Furthermore, in this embodiment of the present invention, when defining common and special sub-functions in classes and SQL snippets at each level, it is also necessary to ensure that the common sub-functions can be used independently and in conjunction with each other. For example, the common sub-functions in resulmap must correspond to the common sub-functions in outVo, thus providing a good implementation foundation for integrating the functions of the query subsystem at that level with other query subsystems.

[0090] Step 203: Construct the corresponding N-th layer query subsystem according to the first element storage information and the corresponding association relationship of each query business; wherein the N-th layer query subsystem inherits the corresponding functions and information of the underlying query subsystem, the corresponding information of the query subsystem before the Nth layer inherited on the basis of the underlying query subsystem, and the corresponding first element storage information; N is determined based on the corresponding association relationship of the query business, and N is a positive integer greater than 1.

[0091] For example, see Figure 4 Continuing with the bond trading business as an example, the electronic device can construct a corresponding N-th layer query subsystem based on the first element storage information and corresponding associations of the bond trading business. Specifically, the electronic device constructs a corresponding second-layer query subsystem based on the first element storage information and corresponding associations of the bond trading business. The bottom-layer query subsystem is constructed based on the bond trading basic information table.

[0092] Please continue to see Figure 4 For example, the bottom layer is called the Base1 layer, and its corresponding preset query functions are: Base1InVo class, Base1 Bo class, input condition SQL fragment (including the input condition of the Base1 layer bond trading basic information table), output condition SQL fragment (including the output of the Base1 layer bond trading basic information table), Base1 output resultmap, and Base1OutVo class.

[0093] Furthermore, the second layer is called the Base 2A layer, for example. The first element storage information corresponding to this layer includes the bond trading basic information table and the bond buying and selling sub-table, and its corresponding query functions include: Base2InVo A class, Base2 BoA class, input condition sql fragment (including the bond buying and selling sub-table input conditions and the referenced Base1 layer bond trading basic information table input conditions), output condition sql fragment (including the bond buying and selling sub-table output and the referenced Base1 layer bond trading basic information table output), Base2A output resultmap, and Base2 OutVo A class.

[0094] As can be seen, the query subsystem for bond trading can be divided into the base1 layer and the base2A layer. The base1 layer provides query functionality for the bond trading basic information table, while the base2A layer provides query functionality for the bond trading basic information table and the bond trading subtable. The primary elements of the bond trading business include the bond trading basic information table and the bond trading subtable. The base2A layer class inherits from the corresponding base1 layer class, and the base2A layer SQL snippets reference or include base1 layer SQL snippets.

[0095] For example, see Figure 5 Continuing with the example of the bond repurchase business in the bond trading business, the electronic device can build corresponding second-layer and third-layer query subsystems based on the first element storage information and corresponding association relationships of the bond repurchase business.

[0096] See Figure 5The second layer is called the Base 2B layer, for example. The first element storage information corresponding to this layer includes the bond trading basic information table and the bond repurchase subtable. Its corresponding query functions include: Base2InVo B class, Base2 BoB class, input condition SQL fragment (including the bond repurchase subtable input condition and the referenced Base1 layer bond trading basic information table input condition), output condition SQL fragment (including the bond repurchase subtable output and the referenced Base1 layer bond trading basic information table output), Base2B output resultmap, and Base2 OutVo B class.

[0097] Please continue to see Figure 5 The third layer is called the Base3B layer, for example. The first element storage information corresponding to this layer includes the bond trading basic information table, the bond repurchase subtable and the mortgage bond information table. Its corresponding query functions include: Base3InVoB class, Base3 BoB class, input condition SQL fragment (including the mortgage bond information table input condition, and the referenced bond repurchase subtable input condition and the bond trading basic information table input condition), output condition SQL fragment (including the mortgage bond information table output, and the referenced bond repurchase subtable output and the bond trading basic information table output), Base3B output resultmap, and Base3OutVo B class.

[0098] As can be seen, for bond repurchase transactions, electronic devices can split transaction element queries into the base1 layer, base2B layer, and base3B layer. The base1 layer provides a specific implementation of the bond transaction basic information table query function. This is consistent with the base1 layer implementation for bond trading transactions and can be directly reused. The base2B layer provides a specific implementation of the bond transaction basic information table and the bond repurchase subtable query function. The base3B layer provides a specific implementation of the bond transaction basic information table, the bond repurchase subtable, and the mortgage bond information table query function. The first element of the bond repurchase transaction stores information including the bond transaction basic information table, the bond repurchase subtable, and the mortgage bond information table. Clearly, the base2B layer inherits the functions of the base1 layer, and the base3B layer inherits the functions of the base1 and base2B layers.

[0099] For example, see Figure 6 , Figure 6 Continuing with the example of the bond lending business in the bond trading business, the schematic diagram of the construction of the query subsystem is shown, wherein the electronic device can construct the corresponding second-layer, third-layer and fourth-layer query subsystems based on the first element storage information and corresponding association relationships of the bond repurchase business.

[0100] Please continue to see Figure 6 As can be seen, for bond lending business, electronic devices can split transaction element queries into base1, base2C, base3C, and base4C layers. The base2C layer provides a specific implementation of query functionality for the bond transaction basic information table and the bond lending subtable. The base3C layer provides a specific implementation of query functionality for the bond transaction basic information table, the bond lending subtable, and the mortgage bond information table. The base4C layer provides a specific implementation of query functionality for the bond transaction basic information, the bond lending subtable, the mortgage bond information table, and the fee information table. The first element of the bond lending business stores information including query functionality for the bond transaction basic information, the bond lending subtable, the mortgage bond information table, and the fee information table.

[0101] In the embodiment of the present invention, the relationship between classes is inheritance. For example, see Figure 7 Taking the Bo class as an example, the figure shows that each level of the Bo class is an inheritance tree structure. For bond trading, Base2BoA inherits from Base1Bo; for bond repurchase, Base2BoB inherits from Base1Bo, and Base3BoB inherits from Base2BoB; for bond lending, Base2BoC inherits from Base1Bo, Base3BoC inherits from Base2BoC, and Base4BoC inherits from Base3BoC.

[0102] Step 204: Construct a data query system according to the query subsystems corresponding to the various query services.

[0103] In the embodiment of the present invention, the electronic device can construct a data query system according to the query subsystems corresponding to the respective query services.

[0104] In one possible implementation, an electronic device may receive second-element storage information of a new query service; if the second-element storage information is determined, the same element storage information exists as the first-element storage information of any query service in each query service; determine the query subsystem corresponding to any query service; construct a new layer of query subsystem based on the second-element storage information and the query subsystem corresponding to any query service; the new layer of query subsystem includes: functions and information corresponding to the underlying query subsystem, information corresponding to the query subsystem corresponding to any query service, and the second-element storage information.

[0105] For example, if the second element storage information includes the buying and selling sub-table information, the bond trading basic information table, and the A information table, then it is determined that the second element storage information and the first element storage information of the bond trading business have the same element storage information, and the query subsystem corresponding to the bond trading business can be determined. In this way, for the new query business, the query of transaction elements can be divided into the base1 layer, the base2D layer, and the base3D layer. The base2D layer is a specific implementation method for providing query functions for the bond trading basic information table and the buying and selling sub-table information. The base3D layer is a specific implementation method for providing query functions for the bond trading basic information table, the buying and selling sub-table information, and the A information table. In this way, the sub-query system corresponding to the new query business can be understood as a sub-query system including the base1 layer, the base2D layer, and the base3D layer.

[0106] For example, if a new query service involves transaction confirmation and also requires querying the basic information of the bonds underlying these tasks, the corresponding query subsystem can be implemented by extending only the base1 layer. Another example is if a new query service requires querying bond lending data for a specific business process but does not require consideration of the corresponding fees, it can be implemented by extending only the base3C layer.

[0107] It can be seen that in the embodiment of the present invention, the electronic device can select a base at any level for subsequent inheritance expansion.

[0108] In one possible implementation, if the element storage information corresponding to the query subsystem of the Nth layer is adjusted, the adjusted new element storage information is determined; based on the new element storage information and the information corresponding to the query subsystem before the Nth layer, a new query subsystem of the Nth layer is constructed; the new query subsystem of the Nth layer includes: inheriting the functions and information corresponding to the underlying query subsystem, iteratively inheriting the information corresponding to the query subsystem before the Nth layer based on the underlying query subsystem, and the adjusted new element storage information.

[0109] For example, assuming that the bond trading subtable is adjusted, that is, the element storage information corresponding to the query subsystem of the second layer is adjusted, it can be updated according to the underlying query subsystem to obtain the updated query subsystem of the second layer.

[0110] It can be seen that in the embodiment of the present invention, the corresponding query subsystem can be adjusted according to the adjustment of the element storage information.

[0111] In this embodiment of the present invention, based on the characteristics of financial market business processing, namely, multiple business processes with a strong dependence on transaction element queries, a multi-layered code structure is adopted, with corresponding layers extended by inheritance as needed. This reduces the development of large amounts of similar code or the repeated storage of similar table structures. When a transaction element is modified, only the code of the corresponding layer needs to be adjusted, without affecting the detailed adjustments of the code of the previous layer. This reduces the excessive focus of other modules on the element information of the transaction module. In this way, decoupled structural development can be effectively carried out, making the data query system more adaptable and highly scalable to meet the needs of various business departments.

[0112] For example, in the backend system application scenario for fund transactions, due to the functional division of business departments, Department One requires a mainline query page dedicated to querying bond trading elements, while Department Two requires an independent auxiliary line query page, also for querying bond trading elements. It also needs to query the settlement and matching status of transactions related to the auxiliary line. The query of transaction elements involved in the auxiliary line is basically similar to that of the main line, with slightly fewer query conditions and results. The main line implements common base layer code at all levels, and auxiliary lines are developed based on this inheritance and expanded to corresponding levels as needed. This effectively isolates the focus of developers at each level and reduces the labor of repetitive code.

[0113] Based on the same inventive concept, an embodiment of the present invention also provides a device for constructing a data query system. Figure 8 As shown, it is a structural diagram of a construction device 800 of a data query system, which may include:

[0114] The obtaining unit 801 is configured to obtain the first element storage information of each query service, and the association relationship between the first element storage information of each query service and the element storage information of other query services;

[0115] The construction unit 802 is configured to determine underlying element storage information based on the first element storage information of each query service, and to construct an underlying query subsystem based on the underlying element storage information and the preset query function; the underlying element storage information is element storage information included in each query service;

[0116] The construction unit 802 is configured to construct a corresponding N-th layer query subsystem based on the first element storage information and the corresponding association relationship of each query service; wherein the N-th layer query subsystem inherits the corresponding functions and information of the bottom layer query subsystem, the information corresponding to the query subsystem before the N-th layer inherited from the bottom layer query subsystem, and the corresponding first element storage information; N is determined based on the corresponding association relationship of the query service, and N is a positive integer greater than 1;

[0117] The construction unit 802 is further configured to construct the data query system according to the query subsystems corresponding to the respective query services.

[0118] In a possible implementation, the preset query function of the underlying query subsystem specifically includes at least two of: an input object, a business object, a query screening condition, a query output field, an output field mapping file, and an output object.

[0119] In a possible implementation, each preset query function in the query subsystem at the bottom layer is defined with a public sub-function that can be inherited by query subsystems at other layers.

[0120] In a possible implementation manner, the construction unit 802 is further configured to:

[0121] Receive the second element storage information of the new query service;

[0122] If it is determined that the second element storage information is the same as the first element storage information of any query service among the query services; determining the query subsystem corresponding to the any query service;

[0123] A new layer of query subsystem is constructed based on the second element storage information and the query subsystem corresponding to any query business; the new layer of query subsystem includes: the functions and information corresponding to the underlying query subsystem, the information corresponding to the query subsystem corresponding to any query business, and the second element storage information.

[0124] In a possible implementation manner, the construction unit 802 is further configured to:

[0125] If the element storage information corresponding to the query subsystem of the Nth layer is adjusted, determining the adjusted new element storage information;

[0126] A new N-th-layer query subsystem is constructed based on the new element storage information and the information corresponding to the query subsystem before the N-th layer; the new N-th-layer query subsystem includes: inheriting the functions and information corresponding to the underlying query subsystem, iteratively inheriting the information corresponding to the query subsystem before the N-th layer based on the underlying query subsystem, and the adjusted new element storage information.

[0127] For the convenience of description, the above parts are divided into modules (or units) according to their functions and described separately. Of course, when implementing the present invention, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.

[0128] After introducing the method and apparatus for constructing a data query system according to an exemplary embodiment of the present invention, an electronic device according to another exemplary embodiment of the present invention is introduced next.

[0129] Those skilled in the art will appreciate that various aspects of the present invention may be implemented as systems, methods, or program products. Therefore, various aspects of the present invention may be implemented in the following forms: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be collectively referred to herein as "circuits," "modules," or "systems."

[0130] Based on the same inventive concept as the above method embodiment, an electronic device is also provided in the embodiment of the present invention. In this embodiment, the structure of the electronic device can be as follows Figure 9 As shown, an embodiment of the present invention further provides an electronic device, such as Figure 9 As shown, the electronic device in the embodiment of the present invention includes at least one processor 901, and a memory 902 and a communication interface 903 connected to the at least one processor 901. The embodiment of the present invention does not limit the specific connection medium between the processor 901 and the memory 902. Figure 9 In the example, the processor 901 and the memory 902 are connected via a bus 900. Figure 9 The bus 900 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, Figure 9 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0131] In an embodiment of the present invention, the memory 902 stores instructions that can be executed by at least one processor 901. By executing the instructions stored in the memory 902, the at least one processor 901 can execute the steps included in the aforementioned method for constructing a data query system.

[0132] Among them, the processor 901 is the control center of the electronic device. It can use various interfaces and lines to connect various parts of the entire fault detection device. By running or executing instructions stored in the memory 902 and calling data stored in the memory 902, it can realize various functions of the electronic device. Optionally, the processor 901 may include one or more processing units. The processor 901 may integrate an application processor and a modem processor. The processor 901 mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 901. In some embodiments, the processor 901 and the memory 902 may be implemented on the same chip. In some embodiments, they may also be implemented separately on separate chips.

[0133] The processor 901 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in conjunction with the embodiments of the present invention can be directly implemented as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor.

[0134] The memory 902 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 902 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (RAM), a static random access memory (SRAM), a programmable read-only memory (PROM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 902 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 902 in the embodiment of the present invention can also be a circuit or any other device that can implement a storage function, for storing program instructions and / or data.

[0135] The communication interface 903 is a transmission interface that can be used for communication, and data can be received or sent through the communication interface 903 .

[0136] In addition, the electronic device also includes a basic input / output system (I / O system) 904 for helping to transmit information between various components within the electronic device, and a large-capacity storage device 908 for storing an operating system 905, application programs 906 and other program modules 907.

[0137] The basic input / output system 904 includes a display 909 for displaying information and an input device 510, such as a mouse and keyboard, for user input. Both the display 909 and the input device 510 are connected to the processor 901 via the basic input / output system 904, which is connected to the system bus 900. The basic input / output system 904 may also include an input / output controller for receiving and processing input from a variety of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, the input / output controller also provides output to a display screen, printer, or other types of output devices.

[0138] Specifically, the mass storage device 908 is connected to the processor 901 via a mass storage controller (not shown) connected to the system bus 900. The mass storage device 908 and its associated computer-readable media provide non-volatile storage for the server package. In other words, the mass storage device 908 may include a computer-readable medium (not shown) such as a hard disk or a CD-ROM drive.

[0139] According to various embodiments of the present invention, the electronic device can also be connected to a remote computer on a network via a network such as the Internet to operate. In other words, the electronic device can be connected to the network 511 via the communication interface 903 connected to the system bus 900, or in other words, the communication interface 903 can also be used to connect to other types of networks or remote computer systems (not shown).

[0140] An embodiment of the present invention further provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on a computer, the computer executes the technical solution of the method for constructing a data query system in the above embodiment.

[0141] An embodiment of the present invention also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, it can implement the technical solution of the method for constructing the data query system in the above embodiment.

[0142] Those skilled in the art will appreciate that all or part of the steps of the above-described method embodiments may be implemented by hardware associated with program instructions. The aforementioned program instructions are computer programs, which may be stored in a computer-readable storage medium. When the computer program is executed, it performs the steps of the above-described method embodiments. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0143] The program product of an embodiment of the present invention may be a portable compact disc read-only memory (CD-ROM) and include program code, and can be run on a computing device. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with a command execution system, device, or apparatus.

[0144] A readable signal medium may include a data signal transmitted in baseband or as part of a carrier wave, which carries readable program code. Such a transmitted data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with a command execution system, apparatus, or device.

[0145] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0146] The program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and the like, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0147] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0148] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.

Claims

1. A method for constructing a data query system, characterized in that: The method comprises: Obtaining the first element storage information of each query service, and the association relationship between the first element storage information of each query service and the element storage information of other query services; Determine the underlying element storage information based on the first element storage information of each query service, and construct the underlying query subsystem based on the underlying element storage information and the preset query function; the underlying element storage information is the element storage information included in each query service; Constructing a corresponding N-th layer query subsystem based on the first element storage information and the corresponding association relationship of each query service; wherein the N-th layer query subsystem inherits the corresponding functions and information of the bottom layer query subsystem, the information corresponding to the query subsystem before the N-th layer inherited on the basis of the bottom layer query subsystem, and the corresponding first element storage information; N is determined based on the corresponding association relationship of the query service, and N is a positive integer greater than 1; The data query system is constructed according to the query subsystems corresponding to the various query services.

2. The method according to claim 1, wherein The preset query function of the underlying query subsystem specifically includes at least two items of: input object, business object, query screening condition, query output field, output field mapping file and output object.

3. The method according to claim 2, wherein Each preset query function in the query subsystem of the bottom layer is defined with a public sub-function that can be inherited by the query subsystems of other layers.

4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Receive the second element storage information of the new query service; If it is determined that the second element storage information is the same as the first element storage information of any query service among the query services; determining the query subsystem corresponding to the any query service; A new layer of query subsystem is constructed based on the second element storage information and the query subsystem corresponding to any query business; the new layer of query subsystem includes: the functions and information corresponding to the underlying query subsystem, the information corresponding to the query subsystem corresponding to any query business, and the second element storage information.

5. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: If the element storage information corresponding to the query subsystem of the Nth layer is adjusted, determining the adjusted new element storage information; A new N-th-layer query subsystem is constructed based on the new element storage information and the information corresponding to the query subsystem before the N-th layer; the new N-th-layer query subsystem includes: inheriting the functions and information corresponding to the underlying query subsystem, iteratively inheriting the information corresponding to the query subsystem before the N-th layer based on the underlying query subsystem, and the adjusted new element storage information.

6. A device for constructing a data query system, characterized in that: The device comprises: An obtaining unit, configured to obtain the first element storage information of each query service, and the association relationship between the first element storage information of each query service and the element storage information of other query services; a construction unit, configured to determine underlying element storage information based on the first element storage information of each query service, and to construct an underlying query subsystem based on the underlying element storage information and a preset query function; the underlying element storage information is element storage information included in each query service; The construction unit is configured to construct a corresponding N-th layer query subsystem based on the first element storage information and the corresponding association relationship of each query service; wherein the N-th layer query subsystem inherits the corresponding functions and information of the bottom layer query subsystem, the information corresponding to the query subsystem before the N-th layer inherited on the basis of the bottom layer query subsystem, and the corresponding first element storage information; N is determined based on the corresponding association relationship of the query service, and N is a positive integer greater than 1; The construction unit is further configured to construct the data query system according to the query subsystems corresponding to the respective query services.

7. The device according to claim 6, characterized in that The preset query function of the underlying query subsystem specifically includes at least two items of: input object, business object, query screening condition, query output field, output field mapping file and output object.

8. An electronic device, characterized in that: include: a processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 5.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 5 when executed by a processor.

10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 5 when executed by a processor.

Citation Information

Patent Citations

  • Data query method and device, electronic equipment and storage medium

    CN112052242A

  • Data query method and device, equipment and storage medium

    CN115033575A