Financial database index construction method, device, equipment and storage medium

By identifying inefficient data search tools in financial databases, calculating information gain and gain rate to filter data attributes, and dynamically updating indexes, the problem of inefficient index construction in financial databases is solved and access efficiency is improved.

CN116662348BActive Publication Date: 2025-09-30INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310788356.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-29
Publication Date
2025-09-30
Estimated Expiration
2043-06-29

AI Technical Summary

Technical Problem

Existing financial database indexes are inefficient to construct when faced with changes in business data volume, resulting in inefficient access and inefficient manual construction of new indexes.

Method used

When the data search tool is identified as an inefficient tool, the target data volume and attributes are obtained, the information gain and gain rate are calculated, the target data attributes are screened out as the initial index, and the database index is dynamically updated.

Benefits of technology

It achieves efficient construction of financial database indexes, improves data search efficiency, and dynamically adapts to business changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116662348B_ABST
    Figure CN116662348B_ABST
Patent Text Reader

Abstract

The present application relates to a method for constructing a financial database index, which can be applied to financial technology and related fields. The method includes: obtaining the data volume of target data within the search range of the data search tool in the financial database, obtaining the data attributes contained in the target data, and obtaining the number of attribute values ​​in each data attribute by identifying that a data search tool for the financial database is a target data search tool; obtaining the information gain corresponding to each data attribute based on the data volume and the number, and filtering out the target data attribute from the data attributes based on the information gain; obtaining the information gain rate of each target data attribute based on the information gain of each target data attribute, and using the target data attribute with the largest information gain rate as the initial index data attribute; using the initial index data attribute as the database index for the data search tool to search the financial database. This method can efficiently construct a financial database index.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of financial databases, and in particular to a method, apparatus, computer equipment, storage medium, and computer program product for constructing a financial database index. Background Art

[0002] With the development of the field of financial database technology, financial database data search technology has emerged. This technology uses the data search tools corresponding to the financial database and the database index pre-built by the staff to search for target data from the financial database.

[0003] In the above technical solution, as financial business changes, the way the amount of business data increases changes, and the original index may no longer be applicable, resulting in low access efficiency. At this time, a new index needs to be rebuilt. Manually building a new database index will lead to low efficiency in building the database index. Summary of the Invention

[0004] Based on this, it is necessary to provide a financial database index construction method, device, computer equipment, computer-readable storage medium and computer program product that can efficiently construct a financial database index to address the above technical problems.

[0005] In a first aspect, the present application provides a method for constructing a financial database index. The method comprises:

[0006] When a data search tool for a financial database is identified as a target data search tool, obtaining the amount of target data within a search range of the data search tool in the financial database, obtaining data attributes included in the target data, and obtaining the number of attribute values ​​in each of the data attributes; the target data search tool is a data search tool with an efficiency lower than a preset value;

[0007] Based on the data volume and the quantity, obtaining information gains corresponding to the data attributes, and filtering out target data attributes from the data attributes based on the information gains;

[0008] According to the information gain of each target data attribute, an information gain rate of each target data attribute is obtained, and the target data attribute with the largest information gain rate is used as the initial index data attribute;

[0009] The initial index data attribute is used as the database index of the financial database by the data search tool.

[0010] In one embodiment, after using the initial index data attribute as the database index of the financial database by the data search tool, the method further includes: when the data search tool is again identified as a target data search tool, obtaining a target index data attribute from the current data attribute corresponding to the data attribute; the current data attribute is other data attributes in the data attributes except the initial index data attribute; using the initial index data attribute and the target index data attribute as new initial index data attributes, and returning to execute the step of using the initial index data attribute as the database index of the financial database by the data search tool until the data search tool is not identified as a target data search tool.

[0011] In one embodiment, obtaining the target index data attribute from the current data attribute corresponding to the data attribute includes: obtaining the data volume of the current data corresponding to the current data attribute in the target data, and obtaining the number of each attribute value in the current data attribute; obtaining the information gain corresponding to each current data attribute based on the data volume of the current data and the number of each attribute value in the current data attribute; and obtaining the target index data attribute from the current data attribute based on the information gain corresponding to the current data attribute.

[0012] In one embodiment, the information gain corresponding to each of the data attributes is obtained based on the data volume and the quantity, including: obtaining the information entropy and weight corresponding to each attribute value in the data attribute based on the data volume and the quantity; obtaining the information gain corresponding to the data attribute according to the information entropy and weight corresponding to each attribute value in the data attribute.

[0013] In one embodiment, the filtering out target data attributes from the data attributes based on the information gain includes: obtaining an average value of the information gain; and filtering out data attributes having information gain greater than the average value from the data attributes as the target data attributes.

[0014] In one embodiment, obtaining the information gain rate of each target data attribute based on the information gain of each target data attribute includes: obtaining the inherent value of the target data attribute; the inherent value is used to characterize the number of types of attribute values ​​in the target data attribute; and obtaining the information gain rate of the target data attribute based on the ratio of the information gain to the inherent value.

[0015] In one embodiment, after constructing the database index corresponding to the financial database, the method further includes: sending the database index to the data search tool in response to a data search command of the data search tool; and sending data corresponding to the search result to a data search terminal corresponding to the data search tool based on the search result obtained by the data search tool based on the database index.

[0016] In a second aspect, the present application also provides a financial database index construction device. The device includes:

[0017] a data volume acquisition module configured to, upon identifying a data search tool for a financial database as a target data search tool, acquire the data volume of target data within a search range of the data search tool in the financial database, acquire data attributes included in the target data, and acquire the number of attribute values ​​for each of the data attributes; wherein the target data search tool is a data search tool with an efficiency lower than a preset value;

[0018] a target data attribute acquisition module, configured to obtain information gains corresponding to the data attributes based on the data volume and the quantity, and to filter out target data attributes from the data attributes based on the information gains;

[0019] An index data attribute module, configured to obtain an information gain rate of each target data attribute according to the information gain of each target data attribute, and use the target data attribute with the largest information gain rate as an initial index data attribute;

[0020] The database index construction module uses the initial index data attributes as the data search tool to search for the database index of the financial database.

[0021] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are performed:

[0022] When a data search tool for a financial database is identified as a target data search tool, obtaining the amount of target data within a search range of the data search tool in the financial database, obtaining data attributes included in the target data, and obtaining the number of attribute values ​​in each of the data attributes; the target data search tool is a data search tool with an efficiency lower than a preset value;

[0023] Based on the data volume and the quantity, obtaining information gains corresponding to the data attributes, and filtering out target data attributes from the data attributes based on the information gains;

[0024] According to the information gain of each target data attribute, an information gain rate of each target data attribute is obtained, and the target data attribute with the largest information gain rate is used as the initial index data attribute;

[0025] The initial index data attribute is used as the database index of the financial database by the data search tool.

[0026] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:

[0027] When a data search tool for a financial database is identified as a target data search tool, obtaining the amount of target data within a search range of the data search tool in the financial database, obtaining data attributes included in the target data, and obtaining the number of attribute values ​​in each of the data attributes; the target data search tool is a data search tool with an efficiency lower than a preset value;

[0028] Based on the data volume and the quantity, obtaining information gains corresponding to the data attributes, and filtering out target data attributes from the data attributes based on the information gains;

[0029] According to the information gain of each target data attribute, an information gain rate of each target data attribute is obtained, and the target data attribute with the largest information gain rate is used as the initial index data attribute;

[0030] The initial index data attribute is used as the database index of the financial database by the data search tool.

[0031] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the following steps:

[0032] When a data search tool for a financial database is identified as a target data search tool, obtaining the amount of target data within a search range of the data search tool in the financial database, obtaining data attributes included in the target data, and obtaining the number of attribute values ​​in each of the data attributes; the target data search tool is a data search tool with an efficiency lower than a preset value;

[0033] Based on the data volume and the quantity, obtaining information gains corresponding to the data attributes, and filtering out target data attributes from the data attributes based on the information gains;

[0034] According to the information gain of each target data attribute, an information gain rate of each target data attribute is obtained, and the target data attribute with the largest information gain rate is used as the initial index data attribute;

[0035] The initial index data attribute is used as the database index of the financial database by the data search tool.

[0036] The above-mentioned financial database index construction method, device, computer device, storage medium and computer program product, by identifying that a data search tool for a financial database is a target data search tool, obtaining the data volume of the target data within the search range of the data search tool in the financial database, obtaining the data attributes contained in the target data, and obtaining the number of each attribute value in each data attribute; based on the data volume and the number, obtaining the information gain corresponding to each data attribute, and based on the information gain, filtering out the target data attribute from the data attributes; based on the information gain of each target data attribute, obtaining the information gain rate of each target data attribute, and using the target data attribute with the largest information gain rate as the initial index data attribute; using the initial index data attribute as the database index for the data search tool to search the financial database. This application can efficiently construct a financial database index by obtaining the data volume of the target data corresponding to the data search tool in the financial database, obtaining the number of each attribute value in the data attributes of the target data, then obtaining the information gain corresponding to each data attribute based on the data volume of the target data and the number of each attribute value, then filtering out the target data attribute from the data attributes based on the information gain, and obtaining the information gain rate of the target data attribute, and finally based on the information gain rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 Schematic diagram of a flow chart of a method for constructing a financial database index in one embodiment;

[0038] Figure 2 A schematic diagram of a process for further constructing a financial database index in one embodiment;

[0039] Figure 3 A schematic diagram of a process for obtaining target index data attributes in one embodiment;

[0040] Figure 4 Schematic diagram of a process for obtaining information gain corresponding to a data attribute in one embodiment;

[0041] Figure 5 A structural block diagram of a financial database index construction device in one embodiment;

[0042] Figure 6 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0044] It should be noted that the terms "first" and "second" as used in the embodiments of the present invention are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It is understood that the terms "first" and "second" may interchangeably represent a specific order or precedence, where permitted. It should be understood that the objects distinguished by "first" and "second" may be interchangeable, where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than that illustrated or described herein.

[0045] In one embodiment, Figure 1 As shown, a method for constructing a financial database index is provided. This embodiment uses the method applied to a server as an example for illustration. It is understood that the method can also be applied to a terminal, or to a system including a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0046] Step S101, when identifying that a data search tool for a financial database is a target data search tool, obtain the data volume of the target data within the search range of the data search tool in the financial database, obtain the data attributes contained in the target data, and obtain the number of each attribute value in each data attribute; the target data search tool is a data search tool with an efficiency value lower than a preset value.

[0047] The financial database is a database server that stores financial business data, and the data search tool is a database data search tool based on SQL statements corresponding to the financial database. The target data search tool is the data search tool whose data search efficiency value does not meet a preset value, wherein the data search efficiency value is calculated based on the search records in the process of searching the financial database by the data search tool. For example, the search records can be the time per thousand rows, the average execution time, etc. Then, the target data is the data within the search range of the data search tool in the financial database, wherein the search range is the range of data that each data search tool can search in the financial database, and the data volume is the amount of target data. Finally, the data attributes are multiple attributes of the target data. For example, the attributes of the target data in the financial database of this application can include partition, area code, business date, amount, merchant type, timestamp, etc., and the attribute value is the value of the data attribute. From the perspective of the data attribute, each data attribute has one or more values. For example, the data attribute "business date" may be multiple different dates, but from the perspective of the target data, the attribute value of a data attribute of a certain target data is only one. For example, the data attribute "business date" of a certain target data has only one value.

[0048] Specifically, the search records of the data search tool during the search process of searching the financial database are obtained. Based on the search records, the search efficiency value of the data search tool is obtained. If the efficiency value does not meet a preset value, the data search tool is determined to be a target data search tool. Finally, the amount of target data within the search range of the data search tool in the financial database is obtained, as well as the data attributes contained in the target data, and the number of attribute values ​​in each data attribute is obtained. For example, as shown in Table 1, the amount of target data D is 100, and there are 7 data attributes, namely a-partition, b-region code, c-date, d-currency, e-amount, f-merchant type, and g-timestamp. Attribute a(V) = 3 means that the data attribute "partition" has 3 attribute values, namely a1, a2, and a3. Among them, a1 = 10 means that there are 10 target data with attribute value a1, and the sum of the number of a1, a2, and a3 is exactly the amount of target data D, which is 100.

[0049] Target data D = 100 a-partition b-area code c-date d-Coin e-amount f-Merchant Type g-timestamp Number of attributes = 7 al=10 b1=10 c1=5 d1=15 e1=8 f1=10 g1=1 Attribute a(V) = 3 a2=30 b2=30 c2=5 d2=15 e2=10 f2=10 g2=1 Attribute b(V) = 3 a3=60 b3=60 …… d3=20 e3=2 f3=8 …… Attribute c(V) = 20 c19=5 d4=25 e4=4 f4=8 g99=1 Attribute d(V) = 5 c20=5 d5=25 e5=1 …… g100=1 Attribute e(V) = 80 e6=1 f11=8 Attribute f(V) = 12 …… f12=8 Attribute g(V) = 100 e79=1 e80=1

[0050] Table 1 - Target data attribute value statistics

[0051] Step S102 : Based on the data volume and quantity, the information gain corresponding to each data attribute is obtained, and based on the information gain, the target data attribute is screened out from the data attributes.

[0052] Among them, information gain is asymmetric in probability theory and information theory, and is used to measure the difference between two probability distributions P and Q. Information gain describes the difference when encoding using Q and then encoding using P. In this application, information gain is specifically used to indicate the rationality of indexing and classifying the above-mentioned target data using a certain data attribute, and the target data attribute is a data attribute that meets the preset conditions based on information gain.

[0053] Specifically, the information gain corresponding to each data attribute can be obtained through the data volume of the above-mentioned target data and the number of the above-mentioned attribute values ​​through the information gain calculation formula, and based on the information gain, the target data attributes that meet the preset conditions are screened out from the data attributes.

[0054] For example, suppose that the data attribute a has V possible values ​​{a 1 ,a 2 ,...,a v}, if a is used to divide the target data D, V branch nodes will be generated, where the vth branch node contains all the nodes in D whose value is a on the data attribute a. v The sample is recorded as D v . First calculate D v The information entropy of , and considering that different branch nodes contain different numbers of samples, the branch nodes are given weights |D v | / |D|, that is, the more samples a branch node has, the greater its influence. Therefore, the information gain obtained by dividing the target data D by data attribute a can be calculated as follows:

[0055]

[0056] Based on the above, the information gain of each data attribute can be calculated as: Gain(D,a)=0.55, Gain(D,b)=0.55, Gain(D,c)=0.78, Gain(D,d)=0.53, Gain(D,e)=0.88Gain(D,f)=0.70, Gain(D,g)=0.93. The three data attributes c, e, and g that meet the preset conditions are selected as the target data attributes.

[0057] Step S103 , obtaining the information gain rate of each target data attribute according to the information gain of each target data attribute, and taking the target data attribute with the largest information gain rate as the initial index data attribute.

[0058] Among them, the information gain rate is the ratio of the above information gain to the inherent value of the data attribute, wherein the inherent value is positively correlated with the number of attribute values ​​of the data attribute. The information gain rate, like the above information gain, is also used to characterize the rationality of a certain data attribute in indexing and classifying the above target data. However, a data attribute with a large number of information gain preference attribute values ​​will lead to inaccurate characterization of the rationality of a certain data attribute in indexing and classifying the above target data. The information gain rate removes the characteristics of the data attribute with a large number of information gain preference attribute values. Therefore, it is necessary to obtain the information gain rate of each target data attribute based on the information gain of each target data attribute, and use the target data attribute with the largest information gain rate as the initial index data attribute.

[0059] Specifically, the information gain rate of each target data attribute is obtained according to the information gain of each target data attribute, the data volume of the target data and the number of the attribute values, and the target data attribute with the largest information gain rate is used as the initial index data attribute.

[0060] For example, since information gain has a preference for data attributes with a large number of possible values, the gain rate in the C4.5 decision tree algorithm is further introduced here and defined as follows:

[0061]

[0062] in, is called the intrinsic value of data attribute a. The greater the number of possible values ​​for data attribute a (i.e., the larger V), the larger the value of IV(a). It should be noted that the gain rate criterion favors data attributes with a smaller number of possible values. Therefore, here, we first find the target data attribute with information gain above the average level among the data attributes, and then select the data attribute with the highest gain rate as the initial index data attribute.

[0063] Through the above formula, the information gain rate of each target data attribute can be calculated as follows: Gain ratio (D, c) = 0.18, Gain ratio (D, e) = 0.15, Gain ratio (D, g) = 0.14. The target data attribute c has the largest value, which is the initial index data attribute.

[0064] Step S104: Using the initial index data attributes as a data search tool to search for a database index of the financial database.

[0065] The database index is an index of the above-mentioned financial database, and the database index is used to quickly search for required data in the financial database.

[0066] Specifically, the aforementioned initial index data attributes are database indexes used by the data search tool to search for financial databases.

[0067] In the above-mentioned financial database index construction method, when identifying that a data search tool for a financial database is a target data search tool, the data volume of the target data within the search range of the data search tool in the financial database is obtained, as well as the data attributes contained in the target data, and the number of each attribute value in each data attribute is obtained; based on the data volume and the number, the information gain corresponding to each data attribute is obtained, and based on the information gain, the target data attribute is screened out from the data attributes; based on the information gain of each target data attribute, the information gain rate of each target data attribute is obtained, and the target data attribute with the largest information gain rate is used as the initial index data attribute; the initial index data attribute is used as the database index for the data search tool to search the financial database. This application obtains the data volume of the target data corresponding to the data search tool in the financial database, as well as the number of each attribute value in the data attributes of the target data, and then obtains the information gain corresponding to each data attribute based on the data volume of the target data and the number of each attribute value, and then screens the target data attribute from the data attributes based on the information gain, and obtains the information gain rate of the target data attribute, and finally, based on the information gain rate, can efficiently construct a financial database index.

[0068] In one embodiment, Figure 2 As shown, after using the initial index data attributes as a data search tool to search the database index of the financial database, the following steps are also included:

[0069] Step S201 , when the data search tool is again identified as the target data search tool, the target index data attribute is obtained from the current data attribute corresponding to the data attribute; the current data attribute is the data attribute other than the initial index data attribute.

[0070] The current data attributes are the data attributes of the target data except the initial index data attributes, and the target index data attributes are used to construct the data attributes of the database index.

[0071] Specifically, when the data search tool is again identified as the target data search tool based on the database index, it obtains the target index data attributes from the current data attributes other than the initial index data attributes. For example, as shown in Table 1, the number of target data D is 100, and there are 7 data attributes, namely a-partition, b-region code, c-date, d-currency, e-amount, f-merchant type, and g-timestamp. Among them, the data attribute c-date is the initial index data attribute, and the remaining data attributes are a-partition, b-region code, d-currency, e-amount, f-merchant type, and g-timestamp.

[0072] In step S202, the initial index data attribute and the target index data attribute are used as new initial index data attributes, and the process returns to the step of using the initial index data attribute as the database index for the data search tool to search the financial database until the data search tool is not identified as the target data search tool.

[0073] Specifically, the target index data attributes are added to the above database index to form a new database index. Based on the new database index, a check is performed again to see whether the data search tool is the target data search tool. The formation of a new database index is stopped until the data search tool is not identified as the target data search tool.

[0074] In this embodiment, by checking whether the data search tool is the target data search tool based on the new database index, and stopping the formation of the new database index until the data search tool is not identified as the target data search tool, the data search tool finally obtained is not the target data search tool.

[0075] In one embodiment, Figure 3 As shown, obtaining the target index data attribute from the current data attribute corresponding to the data attribute includes the following steps:

[0076] Step S301 : obtaining the data volume of the current data corresponding to the current data attribute in the target data, and obtaining the quantity of each attribute value in the current data attribute.

[0077] The current data is data in the target data except for the data corresponding to the initial index data attribute, that is, the current data is data in the target data that does not contain the initial index data attribute.

[0078] Specifically, the current data that does not include the initial index data attribute in the target data is acquired, the data volume of the current data is acquired, and the number of each attribute value in the current data attribute is acquired.

[0079] Step S302 : obtaining information gains corresponding to the attributes of the current data based on the amount of the current data and the number of each attribute value in the attributes of the current data.

[0080] Specifically, based on the data volume of the current data and the number of each attribute value in the current data attribute, the information entropy corresponding to the attribute value of each current data attribute is obtained, and based on the information entropy, the information gain corresponding to each current data attribute is obtained.

[0081] Step S303: obtaining a target index data attribute from the current data attributes based on the information gain corresponding to the current data attributes.

[0082] Specifically, the average value of the information gain corresponding to the current data attribute is obtained, the data attributes greater than the average value in the current data attribute are obtained, and the information gain rate of the data attributes greater than the average value is obtained, and the data attribute with the largest information gain rate is used as the target index data attribute.

[0083] In this embodiment, the target index data attribute can be more reasonably obtained from the current data attribute by calculating the data volume of the current data and the number of each attribute value in the current data attribute based on the principle of information gain.

[0084] In one embodiment, Figure 4 As shown in Figure 2, based on the amount and quantity of data, the information gain corresponding to each data attribute is obtained, including the following steps:

[0085] Step S401: Based on the data volume and quantity, the information entropy and weight corresponding to each attribute value in the data attribute are obtained.

[0086] Among them, the information entropy corresponding to each attribute value is the uncertainty of each attribute value as the only attribute value of the data attribute. As for the weight, it refers to the weight coefficient of each attribute value in a certain data attribute.

[0087] Specifically, assuming that the proportion of the k-th type of data attributes in the current target data D is P k (k=1, 2, ..., |y|), then the information entropy of D is defined as follows:

[0088]

[0089] Through the above information entropy calculation formula, based on the amount of data and quantity, the information entropy corresponding to each attribute value in the data attribute is obtained, and then based on the amount of data, quantity, and the information entropy, the weight corresponding to each attribute value in the data attribute is obtained.

[0090] For example, based on the data in Table 1, for data attribute a, |y|=1, according to The information entropy of attribute values ​​a1, a2, and a3 can be calculated as:

[0091]

[0092]

[0093]

[0094] Step S402: Obtain information gain corresponding to the data attribute based on the information entropy and weight corresponding to each attribute value in the data attribute.

[0095] Specifically, assume that data attribute a has V possible attribute values ​​{a 1 ,a 2 ,...,a v}, if a is used to divide the target data D, V branch nodes will be generated, where the vth branch node contains all the nodes in D whose value is a on the data attribute a. v The sample is recorded as D v . First calculate D v The information entropy of , and considering that different branch nodes contain different numbers of samples, the branch nodes are given weights |D v | / |D|, that is, the more samples a branch node has, the greater its influence. Therefore, the information gain obtained by dividing the target data D by data attribute a can be calculated: Through this formula, the information gain corresponding to the data attribute is obtained according to the information entropy and weight corresponding to each attribute value in the data attribute.

[0096] In this embodiment, the information entropy and weight corresponding to each attribute value in the data attribute are first calculated through the data volume and quantity, and then the information gain corresponding to the data attribute is further calculated, so that the information gain corresponding to the data attribute can be accurately calculated.

[0097] In one embodiment, filtering out target data attributes from data attributes based on information gain includes the following steps:

[0098] Obtain the average value of information gain; select data attributes whose information gain is greater than the average value from the data attributes as target data attributes.

[0099] Among them, the average value is the average information gain value of the information gain of each data attribute.

[0100] Specifically, the average information gain value of the information gain of each data attribute is calculated, and the data attribute whose information gain is greater than the average value is used as the target data attribute.

[0101] In this embodiment, by calculating the average information gain value of each data attribute information gain and taking the data attributes whose information gain is greater than the average value as the target data attributes, a group of target data attributes that can be more reasonably used as database indexes can be screened out.

[0102] In one embodiment, obtaining the information gain rate of each target data attribute according to the information gain of each target data attribute includes the following steps:

[0103] The intrinsic value of the target data attribute is obtained; the intrinsic value is used to characterize the number of attribute values ​​in the target data attribute; based on the ratio of information gain to the intrinsic value, the information gain rate of the target data attribute is obtained.

[0104] The intrinsic value is used to represent the number of attribute value types in the target data attribute.

[0105] Specifically, the intrinsic value of the target data attribute is obtained, and the ratio of the information gain to the intrinsic value is used as the information gain rate of the target data attribute.

[0106] In this embodiment, by obtaining the intrinsic value of the target data attribute and taking the ratio of the information gain to the intrinsic value as the information gain rate of the target data attribute, the information gain rate of the target data attribute can be accurately obtained.

[0107] In one embodiment, after constructing the database index corresponding to the financial database, the following steps are further included:

[0108] In response to a data search command of the data search tool, the database index is sent to the data search tool; according to the search result obtained by the data search tool based on the database index, the data corresponding to the search result is sent to the data search terminal corresponding to the data search tool.

[0109] Among them, the data search command is the target data search command carried by the data search tool. The data search command is generated by the data search terminal and written into the data search tool. The data search terminal is a data demand terminal for the financial database. As for the search result, it refers to the target data found by the data search tool based on the database index.

[0110] Specifically, the data search terminal generates a data search tool carrying a data search command and sends the data search tool to the financial database server. Then, the financial database server responds to the data search command of the data search tool and sends the database index to the data search tool. The data search tool obtains the search result based on the database index and sends the search result to the financial database server. The financial database server sends the data corresponding to the search result to the data search terminal corresponding to the data search tool based on the search result.

[0111] In this embodiment, the search results obtained by the data search tool based on the database index are sent to the data search terminal corresponding to the data search tool, so that the data search terminal can accurately obtain the required target data from the financial database.

[0112] In one embodiment, a method for constructing a financial database index is provided, which specifically includes the following steps:

[0113] 1. Sample data acquisition. If the data search tool for the financial database is determined to be inefficient, the target data involved in the data search tool in the financial database and the data attributes of the target data are obtained, such as the number of existing table records, field names, data attribute values, the number of records with corresponding attribute values, primary keys, indexes, etc. In particular, for data search tools that do not hit the index, the full table data is obtained as the target data (if the full data is particularly large, a partial sample is randomly selected according to a certain ratio). For data search tools that hit a partial index, the largest subset of the hit index is obtained as the target data.

[0114] 2. Introduce the C4.5 decision tree algorithm to achieve adaptive learning and generate database indexes.

[0115] First, calculate the gain rate of the data attributes of the target data. In the process of using decision trees to divide data attributes, it is expected that the samples contained in the branch nodes belong to the same category as much as possible, that is, the "purity" of the nodes is getting higher and higher. Here, information entropy is introduced as a representative. Information entropy is the most commonly used indicator to measure the purity of target data. Assume that the proportion of the k-th category data attribute in the current target data D is P k (k=1, 2, ..., |y|), the information entropy of D is defined as follows, and the smaller the value of Ent(D), the higher the purity of D.

[0116]

[0117] Assume that the data attribute a has V possible values ​​{a 1 ,a 2 ,...,a v}, if a is used to divide the target data D, V branch nodes will be generated, where the vth branch node contains all the nodes in D whose value is a on the data attribute a. v The sample is recorded as D v . First calculate D v The information entropy of , and considering that different branch nodes contain different numbers of samples, the branch nodes are given weights |D v | / |D|, that is, the more samples a branch node has, the greater its influence. Therefore, the information gain obtained by dividing the target data D by data attribute a can be calculated as follows:

[0118]

[0119] Generally speaking, the greater the information gain, the greater the purity improvement achieved by using data attribute a for partitioning. Since information gain favors data attributes with a large number of possible values, the gain rate in the C4.5 decision tree algorithm is further introduced here and defined as follows:

[0120]

[0121] in, This is called the intrinsic value of data attribute a. The greater the number of possible values ​​for data attribute a (i.e., the larger V), the larger the value of IV(a). It should be noted that the gain rate criterion favors data attributes with a smaller number of possible values. Therefore, here, we first find the target data attribute with information gain above the average level among the data attributes, and then select the data attribute with the highest gain rate as the database index.

[0122] 3. After each round of adaptive learning is completed, select the index data attribute that can be used as the database index. Then, use the index data attribute as the new index to access the financial database, calculate the relevant index feature item information, and determine whether the data search tool is inefficient based on the new index. If inefficient, take the largest subset of the target data and continue the above steps until the data search tool is no longer inefficient, and stop the next round of division.

[0123] In this embodiment, the data volume of the target data corresponding to the data search tool in the financial database and the number of each attribute value in the data attributes of the target data are obtained. Then, based on the data volume of the target data and the number of each attribute value, the information gain corresponding to each data attribute is obtained. Then, based on the information gain, the target data attribute is screened out from the data attributes, and the information gain rate of the target data attribute is obtained. Finally, based on the information gain rate, the financial database index can be efficiently constructed.

[0124] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0125] Based on the same inventive concept, embodiments of the present application also provide a financial database index construction device for implementing the aforementioned financial database index construction method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more embodiments of the financial database index construction device provided below can be found in the above-mentioned limitations of the financial database index construction method and will not be further elaborated here.

[0126] In one embodiment, Figure 5 As shown, a financial database index construction device is provided, including: a data volume acquisition module 501, a target data attribute acquisition module 502, an index data attribute module 503 and a database index construction module 504, wherein:

[0127] The data volume acquisition module 501 is configured to, upon identifying a data search tool for a financial database as a target data search tool, acquire the data volume of target data within the search range of the data search tool in the financial database, acquire data attributes included in the target data, and acquire the number of attribute values ​​for each attribute of each data attribute; the target data search tool being a data search tool with an efficiency lower than a preset value;

[0128] The target data attribute acquisition module 502 is used to obtain the information gain corresponding to each data attribute based on the data volume and quantity, and to filter out the target data attribute from the data attributes based on the information gain;

[0129] An index data attribute module 503 is configured to obtain an information gain rate of each target data attribute based on the information gain of each target data attribute, and use the target data attribute with the largest information gain rate as the initial index data attribute;

[0130] The database index building module 504 is used to use the initial index data attributes as a data search tool to search for the database index of the financial database.

[0131] In one embodiment, the database index construction module 504 is further used to obtain the target index data attribute from the current data attribute corresponding to the data attribute when the data search tool is again identified as the target data search tool; the current data attribute is the other data attribute in the data attribute except the initial index data attribute; the initial index data attribute and the target index data attribute are used as new initial index data attributes, and return to execute the step of using the initial index data attribute as the database index for the data search tool to search the financial database until the data search tool is not identified as the target data search tool.

[0132] In one embodiment, the database index construction module 504 is further used to obtain the data volume of the current data corresponding to the current data attribute in the target data, and obtain the number of each attribute value in the current data attribute; based on the data volume of the current data and the number of each attribute value in the current data attribute, obtain the information gain corresponding to each current data attribute; based on the information gain corresponding to the current data attribute, obtain the target index data attribute from the current data attribute.

[0133] In one embodiment, the target data attribute acquisition module 502 is further used to obtain the information entropy and weight corresponding to each attribute value in the data attribute based on the data volume and quantity; and obtain the information gain corresponding to the data attribute based on the information entropy and weight corresponding to each attribute value in the data attribute.

[0134] In one embodiment, the target data attribute acquisition module 502 is further configured to acquire an average value of information gain; and select data attributes having information gain greater than the average value from the data attributes as target data attributes.

[0135] In one embodiment, the index data attribute module 503 is further used to obtain the intrinsic value of the target data attribute; the intrinsic value is used to represent the number of types of attribute values ​​in the target data attribute; based on the ratio of information gain to the intrinsic value, the information gain rate of the target data attribute is obtained.

[0136] In one embodiment, the above-mentioned financial database index construction device also includes a data search module, which is further used to send the database index to the data search tool in response to the data search command of the data search tool; and according to the search result obtained by the data search tool based on the database index, send the data corresponding to the search result to the data search terminal corresponding to the data search tool.

[0137] Each module in the aforementioned financial database index construction device may be implemented in whole or in part through software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0138] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store financial database index construction data. The network interface of the computer device is used to communicate with an external terminal via a network connection. When executed by the processor, the computer program implements a financial database index construction method.

[0139] Those skilled in the art will understand that Figure 6The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0140] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0141] When a data search tool for a financial database is identified as a target data search tool, obtaining the amount of target data within a search range of the data search tool in the financial database, obtaining data attributes included in the target data, and obtaining the number of attribute values ​​for each attribute; the target data search tool is a data search tool with an efficiency lower than a preset value;

[0142] Based on the amount and quantity of data, the information gain corresponding to each data attribute is obtained, and based on the information gain, the target data attribute is filtered out from the data attributes;

[0143] According to the information gain of each target data attribute, the information gain rate of each target data attribute is obtained, and the target data attribute with the largest information gain rate is used as the initial index data attribute;

[0144] The initial index data attributes are used as a data search tool to find the database index of the financial database.

[0145] In one embodiment, when the processor executes the computer program, it also implements the following steps: when the data search tool is again identified as the target data search tool, the target index data attribute is obtained from the current data attribute corresponding to the data attribute; the current data attribute is the other data attribute in the data attribute except the initial index data attribute; the initial index data attribute and the target index data attribute are used as new initial index data attributes, and the processor returns to execute the step of using the initial index data attribute as the database index of the financial database for the data search tool to search until the data search tool is not identified as the target data search tool.

[0146] In one embodiment, when the processor executes the computer program, it also implements the following steps: obtaining the data volume of the current data corresponding to the current data attribute in the target data, and obtaining the number of each attribute value in the current data attribute; based on the data volume of the current data and the number of each attribute value in the current data attribute, obtaining the information gain corresponding to each current data attribute; based on the information gain corresponding to the current data attribute, obtaining the target index data attribute from the current data attribute.

[0147] In one embodiment, when the processor executes the computer program, it also implements the following steps: based on the amount of data and the quantity, obtain the information entropy and weight corresponding to each attribute value in the data attribute; according to the information entropy and weight corresponding to each attribute value in the data attribute, obtain the information gain corresponding to the data attribute.

[0148] In one embodiment, when the processor executes the computer program, the processor further implements the following steps: obtaining an average value of information gain; and screening out data attributes having information gain greater than the average value from the data attributes as target data attributes.

[0149] In one embodiment, when the processor executes the computer program, it also implements the following steps: obtaining the intrinsic value of the target data attribute; the intrinsic value is used to characterize the number of types of attribute values ​​in the target data attribute; based on the ratio of information gain to the intrinsic value, obtaining the information gain rate of the target data attribute.

[0150] In one embodiment, when the processor executes the computer program, it also implements the following steps: in response to a data search command of the data search tool, sending the database index to the data search tool; based on the search result obtained by the data search tool based on the database index, sending the data corresponding to the search result to the data search terminal corresponding to the data search tool.

[0151] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0152] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0153] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0154] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.

[0155] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0156] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A method for constructing a financial database index, characterized in that: The method comprises: When a data search tool for a financial database is identified as a target data search tool, obtaining the amount of target data within a search range of the data search tool in the financial database, obtaining data attributes included in the target data, and obtaining the number of attribute values ​​in each of the data attributes; the target data search tool is a data search tool with an efficiency lower than a preset value; Based on the data volume and the quantity, obtaining information gains corresponding to the data attributes, and filtering out target data attributes from the data attributes based on the information gains; According to the information gain of each target data attribute, an information gain rate of each target data attribute is obtained, and the target data attribute with the largest information gain rate is used as the initial index data attribute; The initial index data attribute is used as the database index of the financial database by the data search tool.

2. The method according to claim 1, characterized in that After using the initial index data attribute as the data search tool to search the database index of the financial database, the method further includes: When the data search tool is again identified as a target data search tool, obtaining a target index data attribute from the current data attributes corresponding to the data attribute; the current data attributes are other data attributes in the data attributes except the initial index data attribute; The initial index data attribute and the target index data attribute are used as new initial index data attributes, and the step of using the initial index data attribute as the database index for the data search tool to search the financial database is returned to execution until the data search tool is not identified as a target data search tool.

3. The method according to claim 2, characterized in that The acquiring the target index data attribute from the current data attribute corresponding to the data attribute includes: Acquire the data volume of the current data corresponding to the current data attribute in the target data, and acquire the quantity of each attribute value in the current data attribute; Obtaining information gains corresponding to the attributes of the current data based on the amount of the current data and the number of each attribute value in the attributes of the current data; Based on the information gain corresponding to the current data attribute, a target index data attribute is obtained from the current data attribute.

4. The method according to claim 1, wherein The obtaining of information gain corresponding to each of the data attributes based on the data volume and the quantity includes: Based on the data volume and the quantity, obtaining information entropy and weight corresponding to each attribute value in the data attribute; According to the information entropy and weight corresponding to each attribute value in the data attribute, the information gain corresponding to the data attribute is obtained.

5. The method according to claim 1, characterized in that The step of screening out target data attributes from the data attributes based on the information gain includes: Obtaining an average value of the information gain; Data attributes whose information gain is greater than the average value are screened out from the data attributes as the target data attributes.

6. The method according to claim 1, wherein Obtaining the information gain rate of each target data attribute according to the information gain of each target data attribute includes: Acquire an intrinsic value of the target data attribute; the intrinsic value is used to represent the number of types of attribute values ​​in the target data attribute; Based on the ratio of the information gain to the intrinsic value, an information gain rate of the target data attribute is obtained.

7. The method according to claim 1, characterized in that After constructing the database index corresponding to the financial database, the method further includes: In response to a data search command of the data search tool, sending the database index to the data search tool; According to the search result obtained by the data search tool based on the database index, data corresponding to the search result is sent to a data search terminal corresponding to the data search tool.

8. A financial database index construction device, characterized in that: The device comprises: a data volume acquisition module configured to, upon identifying a data search tool for a financial database as a target data search tool, acquire the data volume of target data within a search range of the data search tool in the financial database, acquire data attributes included in the target data, and acquire the number of attribute values ​​for each of the data attributes; wherein the target data search tool is a data search tool with an efficiency lower than a preset value; a target data attribute acquisition module, configured to obtain information gains corresponding to the data attributes based on the data volume and the quantity, and to filter out target data attributes from the data attributes based on the information gains; An index data attribute module, configured to obtain an information gain rate of each target data attribute according to the information gain of each target data attribute, and use the target data attribute with the largest information gain rate as an initial index data attribute; The database index construction module uses the initial index data attributes as the data search tool to search for the database index of the financial database.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

11. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Assembly manufacturing quality data processing method based on decision tree algorithm

    CN108170769A

  • Full-text indexing method and system based on graph database

    CN112800287A