A financial data quick query method, system and electronic equipment
By classifying and merging capital chains in the financial database and constructing retrieval information, the problem of overlapping capital flows in financial data queries is solved, and more efficient financial data queries are achieved.
Patent Information
- Application Number
- CN202510976841.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-16
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-07-16
AI Technical Summary
In existing technologies, when querying financial data through natural language processing and model-based knowledge graphs, the capital flows of some financial data overlap, making it difficult to accurately query specific financial data.
Financial data files are obtained from the preset financial database, classified according to production projects based on capital flow information, and multiple first capital chains are constructed. A knowledge graph is generated through triple data and entity vectors, and capital chains are merged to construct retrieval information. The financial data that meets user needs is searched using retrieval keywords.
It effectively reduces the interference of similar files during the query process and improves the accuracy and speed of financial data query.
Smart Images

Figure CN120492411B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of electric digital data processing, and particularly relates to a financial data rapid query method and system and electronic equipment. BACKGROUND
[0002] Financial data is an important reference basis for enterprise management and decision-making. Through in-depth analysis of these financial data, internal decision management can be more rapid and accurate. However, due to the complexity of financial data, a method for quickly querying target financial data is needed before in-depth analysis.
[0003] In related technologies, natural language processing and models are mostly used to analyze the flow direction of funds, construct a knowledge graph of specific fund flow direction, and retrieve corresponding financial data in the knowledge graph. However, in an enterprise, there are many transfer subjects, abstracts, and other information tags similar to the flow of funds in the same project, which makes it necessary to traverse a large amount of financial data to find the required financial data when querying the required financial data. Therefore, when querying the required financial data, the fund flows of some financial data overlap each other, making it difficult to accurately query some financial data. SUMMARY
[0004] The main purpose of the present application is to provide a financial data rapid query method, system and electronic equipment, which aims to solve the technical problem that in related technologies, natural language processing and models are used to construct a knowledge graph, and corresponding financial data is retrieved in the knowledge graph. When querying the required financial data, the fund flows of some financial data overlap each other, making it difficult to accurately query some financial data.
[0005] To achieve the above purpose, the embodiments of the present application provide a financial data rapid query method, comprising:
[0006] Obtain a financial data file from a preset financial database, and determine fund flow information of each item of data based on the financial data file;
[0007] Classify the financial data files related to fund flow according to corresponding production projects based on the fund flow information, to obtain a plurality of first fund chains corresponding to each production project;
[0008] Construct retrieval information of each financial data file based on the production projects and the first fund chains;
[0009] Obtain a retrieval keyword, and query a financial data file meeting user demand based on the retrieval information and the retrieval keyword.
[0010] In a possible implementation of the present application, based on the fund flow information, the financial data files related to the fund flow are classified according to corresponding production projects, to obtain a plurality of first fund chains corresponding to each production project, including:
[0011] Based on the fund flow information, the financial data files related to the fund flow are converted into triple data, wherein the triple data includes a plurality of entity vectors;
[0012] For each production project, based on the flow relationship of the entity vectors and the triple data, a plurality of first fund chains are generated.
[0013] In a possible implementation of the present application, based on the fund flow information, the financial data files related to the fund flow are converted into triple data, including:
[0014] Based on the fund flow information, the fund flow of each financial data file is converted into a triple relationship;
[0015] Based on the entity vectors corresponding to the financial data files and the triple relationship, triple data is constructed.
[0016] In a possible implementation of the present application, based on the production project and the first fund chain, the retrieval information of each financial data file is constructed, including:
[0017] Each first fund chain is merged according to the production project to obtain a production fund flow;
[0018] According to the column information of the financial data file corresponding to each production fund flow, retrieval information corresponding to each production project is constructed.
[0019] In a possible implementation of the present application, each first fund chain is merged according to the production project to obtain a production fund flow, including:
[0020] The entity nodes that are in the same fund flow direction and have a plurality of first fund chains passing through at different time points are marked as difference nodes;
[0021] For each difference node, the time difference value of any two first fund chains is calculated;
[0022] Based on the time difference value, it is determined whether each first fund chain belongs to the same production project;
[0023] The first fund chains belonging to the same production project are merged to obtain a production fund flow corresponding to the current production project.
[0024] In a possible implementation of the present application, according to the column information of the financial data file corresponding to each production fund flow, retrieval information corresponding to each production project is constructed, including:
[0025] For each first fund chain in each production fund flow, a word segmentation is performed on each field of column information in the financial data file corresponding to the first fund chain, to obtain a first attribute word corresponding to the financial data file;
[0026] Based on the first attribute word, a field sequence corresponding to the target column is determined;
[0027] The field similarity of each field sequence on the target column is calculated;
[0028] Based on the field similarity, a quick search ability value of the target column as a search column of the financial data is calculated;
[0029] The target columns with a preset number of quick search ability values are selected as the search primary keys of the production project, and the first attribute words of each financial data file in the target column are taken as the search term group;
[0030] Based on the search term group and the search primary key, search information is generated.
[0031] In a possible implementation of the present application, based on the first attribute word, the field sequence corresponding to the target column is determined, including:
[0032] The cosine similarity between any two first attribute words in the target column is calculated, and the reciprocal of the cosine similarity is taken as the local similarity distance between the two first attribute words;
[0033] The local similarity distance is taken as the local distance between each first attribute word in the field sequence, and based on each local distance and a preset similarity algorithm, the field similarity of each field sequence on the target column is calculated.
[0034] In a possible implementation of the present application, based on the search information and the search keyword, the financial data file meeting the user's demand is queried, including:
[0035] The word vector in each entity node corresponding to the financial data file is extracted;
[0036] The first similarity between the search keyword and the word vector is calculated;
[0037] If the first similarity is greater than or equal to a preset similarity threshold, the current entity node is determined as a first node including the financial data file corresponding to the search keyword;
[0038] Each production fund flow in the first node is extracted, and the second similarity between the search information in the production project corresponding to the production fund flow and the search keyword is calculated;
[0039] Based on the second similarity, the financial data file meeting the user's demand is queried.
[0040] The application also provides a financial data rapid query system, which comprises:
[0041] A determination module is configured to acquire financial data files from a preset financial database, and determine fund flow information of each item of data based on the financial data files.
[0042] A classification module is configured to classify the financial data files related to fund flow according to corresponding production projects based on the fund flow information, and obtain a plurality of first fund chains corresponding to each production project.
[0043] A construction module is configured to construct retrieval information of each financial data file based on the production projects and the first fund chains.
[0044] A query module is configured to acquire a retrieval keyword, and query financial data files meeting user requirements based on the retrieval information and the retrieval keyword.
[0045] The application also provides a financial data rapid query device, which is an entity node device, and comprises a memory, a processor, and a program of a financial data rapid query method stored in the memory and executable on the processor, wherein the program of the financial data rapid query method can implement the steps of the financial data rapid query method as described above when executed by the processor.
[0046] The application provides a financial data rapid query method. In related technologies, a knowledge graph is constructed by using natural language processing and a model, and corresponding financial data is retrieved in the knowledge graph. When required financial data is queried, the fund flows of some financial data overlap each other, so that the required financial data is difficult to be accurately queried. In the application, financial data files are acquired from a preset financial database, fund flow information of each item of data is determined based on the financial data files, and the financial data files related to fund flow are classified according to corresponding production projects based on the fund flow information, so that a plurality of first fund chains corresponding to each production project are constructed. The retrieval information of each financial data file is constructed through the production projects and the first fund chains. Then, a retrieval keyword is acquired, the retrieval information is combined, and financial data files meeting user requirements are queried. Furthermore, the plurality of fund flow conditions in the same production project are grouped, and the retrieval information of the production project is established by using a plurality of fund chains, so that the interference of similar files in the query of the financial data files is effectively reduced, and the accuracy of the query of specific financial data is improved. BRIEF DESCRIPTION OF DRAWINGS
[0047] Figure 1A flowchart of a first embodiment of the financial data quick query method of the present application;
[0048] Figure 2 A schematic diagram of a fund flow record involved in the financial data quick query method of the present application;
[0049] Figure 3 A flowchart of a second embodiment involved in the embodiment scheme of the present application;
[0050] Figure 4 A schematic diagram of a financial data part column involved in the financial data quick query method of the present application;
[0051] Figure 5 A flowchart of a third embodiment involved in the financial data quick query method of the present application;
[0052] Figure 6 A schematic diagram of a device structure of a hardware running environment involved in the embodiment scheme of the present application. DETAILED DESCRIPTION
[0053] It should be understood that the specific embodiments described herein are merely intended to explain the present application and are not intended to limit the present application.
[0054] The embodiment of the present application provides a financial data quick query method. In a first embodiment of the financial data quick query method of the present application, referring to Figure 1 , the method comprises the following steps.
[0055] In step S10, a financial data file is obtained from a preset financial database, and fund flow information of each item of data is determined based on the financial data file.
[0056] In step S20, the financial data file related to fund flow is classified according to a corresponding production item based on the fund flow information, and a plurality of first fund chains corresponding to each production item are obtained.
[0057] In step S30, search information of each financial data file is constructed based on the production item and the first fund chain.
[0058] In step S40, a search keyword is obtained, and the financial data file meeting the user demand is searched based on the search information and the search keyword.
[0059] The embodiment aims to group the multiple fund flow situations in the same production item by using multiple fund chains to establish the search information corresponding to the production item, so as to effectively reduce the interference of similar files when searching the financial data file, and improve the accuracy of searching the specific financial data.
[0060] In the embodiment, the application scenario is as follows:
[0061] In an enterprise, a variety of financial data will be contained, and the enterprise can make internal decision management more quickly and accurately by deeply analyzing the information. However, the financial data is relatively complex, so the speed of querying the financial data needs to be improved when deeply analyzing. Since there are many transfer subjects in a project, some financial data may have overlapping fund flows, so the method can quickly and accurately query the financial data required by the user.
[0062] The specific steps are as follows:
[0063] Step S10, obtaining a financial data file from a preset financial database, and determining fund flow information of each item of data based on the financial data file.
[0064] As an example, the financial data quick query method can be applied to a financial data quick query device, and the financial data quick query device belongs to a financial data quick query system, and the financial data quick query system belongs to a financial data quick query equipment.
[0065] As an example, the preset financial database can be a financial database stored in a server in an enterprise, and the preset financial database includes all financial statements of the enterprise, financial reports in past periods (including monthly reports, quarterly reports, etc.), annual reports of the enterprise in the current year, and financial audit reports provided by the upgrading department and the third-party audit company.
[0066] As an example, the financial data file can be financial data of the past year, or a longer time dimension, which is not limited.
[0067] As an example, the fund flow information can be the direction of the fund flow and the destination, for example, enterprise A pays a total of X yuan to enterprise B, and the fund flow information of the fund X is that the fund X flows from enterprise A to enterprise B.
[0068] As an example, in each financial data file, the fund flow between the enterprise and each partner, and the order data, there are many fund flows in multiple projects, and the fund flow of a small project is divided into multiple times due to the division of production plans and stages, so the fund flow information of each fund can be extracted according to the fund flow direction and the order data.
[0069] Step S20, based on the fund flow information, classifying the financial data files related to the fund flow according to the corresponding production projects to obtain a plurality of first fund chains corresponding to each production project.
[0070] As an example, according to the fund flow information, the financial data files are classified according to the production projects, and in each production project, multiple order information and multiple financial data files are included, so that the numerous financial data files can be classified according to the production project categories, and the financial data files belonging to the same production project are classified into the same category.
[0071] As an example, the first fund chain can be a plurality of fund chains corresponding to each production project, and in a production project, multiple products can be purchased, and for each product, a fund chain is included, and each first fund chain includes multiple financial data files, such as a payer, a payee, a purchased product, and an amount of money paid.
[0072] As an example, in terms of classification, specifically, from the purchase of raw materials to the sale of products, the fund is first converted into raw materials and production costs, and then into various products, and then sold, which constitutes a fund flow cycle, and the surplus fund in the cycle is the profit, and in the cycle, each flow of resources (funds, raw materials, etc.) is related to each other, that is, one resource or fund is simultaneously the end point of one flow process and the starting point of another flow process, according to which a series of fund flows in a large project are integrated to build a complete fund chain, that is, multiple first fund chains can be obtained.
[0073] The step S20 of the financial data fast query method further includes:
[0074] In step S21, based on the fund flow information, the financial data files related to the fund flow are converted into triple data, and the triple data includes multiple entity vectors.
[0075] As an example, the triple data includes multiple entity vectors, and the entity vectors can be head entity vectors and tail entity vectors, and the triple data further includes a relationship vector, and the three vectors together constitute the triple data.
[0076] As an example, after the fund flow information is determined, the financial data files can be converted according to the fund flow direction for subsequent generation of a knowledge graph.
[0077] As an example, in the process of building the knowledge graph, the words and items in each row and column in each table in the receipts, financial statements and documents can be used as a word group, and the The language model for generating word vectors) in The model constructs the word vector of each word group, and the model is selected because the model can be quickly trained and can better handle massive data.
[0078] Pre-training the triple data and constructing the knowledge graph of the complete fund flow of each fund chain by the (Conversion embedding) algorithm.
[0079] Wherein, based on the fund flow information, the step S21 of converting the financial data file related to the fund flow into triple data includes:
[0080] Based on the fund flow information, the fund flow direction of each financial data file is converted into a triple relationship.
[0081] As an example, the triple relationship can be a relationship in the form of enterprise-fund use-cooperator, for example, the triple relationship can be "enterprise"—(purchase of raw materials A, 1 million yuan)—"cooperator".
[0082] As an example, the financial department often uses the debit and credit accounting method, and the same transaction is recorded in the asset table, liability table, etc. These records together constitute the fund flow corresponding to the transaction.
[0083] For example, in a certain entry of the accounting report:
[0084] Debit: raw materials A, 1 million yuan;
[0085] Debit: tax payable, value-added tax payable, 170,000 yuan;
[0086] Credit: bank deposit, 1.17 million yuan.
[0087] These three are recorded on the asset table, liability table, etc. Report, together constituting the purchase of raw materials A spending 1.17 million yuan.
[0088] That is, according to the changes on the bank deposit and the corresponding recording time, the relevant records at the same time can be found in the financial statements, combined with the principle of "every debit has a credit, and every debit and credit must be equal", therefore, each fund flow can be converted into a triple relationship.
[0089] Based on the entity vector corresponding to the financial data file and the triple relationship, the triple data is constructed.
[0090] As an example, the triple relationship is used as the training format, the debit side is used as the tail entity, the credit side is used as the head entity, and the specific amount is used as the relationship. In turn, the corresponding entity vector is constructed to obtain the triple data.
[0091] For example, with the project department bank deposit 1 million yuan to purchase raw materials six tons as an example: the project department bank deposit is the head entity, 1 million yuan is the relationship, and raw materials six tons are the tail entity, and the head entity vector+relationship vector=tail entity vector.
[0092] As an example, a schematic diagram of the fund flow record for the entire purchase, production, and sales process is as shown in FIG. 1, where 1, debit: raw materials, credit: bank deposit; 4, debit: bank deposit, credit: accounts receivable; 3, debit: accounts receivable, credit: production products; 2, debit: production products, credit: production expenses, raw materials, and the like. Figure 2 As can be seen, for each process, the tail entity of each process is the head entity of the next process, and the processes are connected. Figure 2
[0093] Step S22, for each production project, based on the flow relationship of the entity vector and the triple data, a plurality of first fund chains are generated.
[0094] As an example, for each production project, the triple data contains the entity vector of the fund flow, and according to the flow relationship between the entity vectors and the triple data, a plurality of first fund chains can be constructed, and the tail entity in each triple data is the head entity of the next process. In the constructed knowledge graph, there are directed line segments between the entity vectors, and the entity vectors are connected through these directed line segments, thereby forming a knowledge graph including a plurality of first fund chains. Then, the fund chain corresponding to each production project is constructed, that is, each fund chain also corresponds to a plurality of financial data used to record this production project.
[0095] Step S30, based on the production project and the first fund chain, the retrieval information of each financial data file is constructed.
[0096] As an example, after determining the production project and the first fund chain, the plurality of fund flows constructed are classified. For any production project or fund chain, there are corresponding serial numbers, business attribute fields (such as date, subject, abstract, etc.), and department and customer related field attributes. The independent conditions of the related field attributes of the plurality of fund flows in the same project can be analyzed to construct the retrieval information corresponding to the production project, so that the required financial data can be quickly queried in the subsequent system query.
[0097] Step S40, obtaining a retrieval keyword, based on the retrieval information and the retrieval keyword, querying the financial data file meeting the user's demand.
[0098] As an example, the retrieval keyword can be a retrieval keyword input by the user for retrieving related financial data. By receiving the retrieval keyword and calling the retrieval information corresponding to the retrieval keyword, the financial data file meeting the user's demand can be accurately queried in sequence.
[0099] In the present application, by analyzing a plurality of financial data, the corresponding fund flow of each transaction and operation and the corresponding financial document are obtained. Secondly, the fund flow process in the plurality of financial data is analyzed, and the fund flow process of the enterprise in the past year is constructed. Then, the difference of each fund flow in the overall data flow is analyzed, that is, the cause and result of the present fund flow are analyzed, and the cause and result of other fund flows of the same type are analyzed, the multiple fund flows in the same production project are grouped, and the independent situation of the related field attributes of the plurality of fund flows in the same production project is analyzed, and the corresponding search attribute of the production project is constructed according to the above, so that the interference of similar or similar files in subsequent search of financial data files can be effectively reduced, and the accuracy and speed of searching specific financial data can be improved.
[0100] The present application provides a financial data fast query method, system and electronic equipment. In related technologies, natural language processing and models are used to construct a knowledge graph, and the corresponding financial data is searched in the knowledge graph. When the required financial data is queried, the fund flows of some financial data overlap each other, so that it is difficult to accurately query some financial data. In the present application, the financial data files are obtained from the preset financial database, the fund flow information of each data is determined based on the financial data files, and the financial data files related to the fund flow are classified according to the corresponding production project based on the fund flow information, so that a plurality of first fund chains corresponding to each production project are constructed. The search information corresponding to each financial data file is constructed through the production project and each first fund chain, the input search keyword is obtained, the search information is combined to query the financial data file meeting the user's demand, and then the multiple fund flows in the same production project are grouped, and the search information corresponding to the production project is established by using the multiple fund chains, so that the interference of similar files in the query of the financial data file is effectively reduced, and the accuracy of searching specific financial data is improved.
[0101] Further, with reference to Figure 3 based on the first embodiment of the present application, another embodiment of the present application is provided, in which the step S30 of constructing the search information of each financial data file based on the production project and the first fund chain includes:
[0102] In step S31, each first fund chain is merged according to the production project to obtain a production fund flow.
[0103] As an example, a plurality of first fund chains are included in each production project, and a plurality of production projects are usually involved in an enterprise, and the purpose of merging the first fund chains according to the production projects is to merge and classify the fund chains belonging to the same production project, so that a large number of fund chains are integrated into production fund flow in the same production project, wherein the production fund flow includes a plurality of first fund chains and corresponds to one production project.
[0104] As an example, for financial data, the purchase and production processes corresponding to the same production project are recorded separately, but the total amount of each purchase and production is equal in the whole, so the fund chains belonging to the same production project can be merged to obtain the production fund flow of the production project.
[0105] The step S31 of merging the first fund chains according to the production projects to obtain the production fund flow includes:
[0106] The entity nodes that have a plurality of first fund chains passing through at different time points and in the same fund flow direction are marked as difference nodes.
[0107] As an example, the knowledge graph includes a plurality of entity nodes, and for an entity node, a plurality of fund chains may pass through the node at different time points and in different flow directions.
[0108] As an example, by analyzing a plurality of fund chains, the time points of each fund flow in the same entity node are determined, and the entity nodes that have a plurality of fund flows passing through at different time points and in the same flow direction are marked as difference nodes.
[0109] For each difference node, the time difference value of any two first fund chains is calculated.
[0110] As an example, the time difference value is used to evaluate the time uniformity of two fund chains passing through the difference node, or is used to evaluate the synchronization of two acquisitions of financial data corresponding to each difference node. When more than two fund chains pass through the same difference node, each fund chain can be compared with each other, and the time difference value of two fund chains is calculated.
[0111] As an example, the calculation method of the time difference value can be:
[0112]
[0113] wherein, represents the time difference value of the fund chain and the fund chain , which is used to evaluate the synchronization of two acquisitions of materials corresponding to each difference node.
[0114] wherein, denotes the same entity node in the two fund chains corresponding time difference, i.e. the same entity node in the two fund chains corresponding time difference; denotes the standard deviation calculation function, used to describe the uniformity of the time difference of the plurality of entity nodes; used for negative correlation normalization.
[0115] Based on the time difference value, it is determined whether the first fund chain belongs to the same production project.
[0116] As an example, after the time difference value is calculated, it is determined whether the two fund flows (two fund chains) belong to the same production project by calculating the confluence index of the two fund chains.
[0117] As an example, the calculation method of the confluence index can be:
[0118]
[0119] wherein, denotes the fund chain the confluence index of the fund chain and the fund chain , used to evaluate the possibility that the two fund chains belong to the same production project.
[0120] wherein, denotes the same entity node of the fund chain and the fund chain ; denotes the time difference value of the fund chain and the fund chain ; denotes the number of entity nodes involved in the fund chain ; denotes the number of entity nodes involved in the fund chain a, used for positive correlation normalization.
[0121] As an example, all the difference nodes are traversed, the confluence index of the fund chain where the difference node is located and other fund chains is calculated, and the confluence index is screened through a threshold , which can be preset or other values, if the confluence index between two fund chains is greater than or equal to the threshold , the two fund chains are marked, recorded as confluence fund chains, that is, the two fund chains belong to the same production project.
[0122] The first fund chains belonging to the same production project are merged to obtain the production fund flow corresponding to the current production project.
[0123] As an example, the first fund chain belonging to the same production project is also called a mergable fund chain. The mergable fund chains are merged according to the classification of the production projects to obtain a production fund flow corresponding to a current production project, that is, one production project corresponds to one production fund flow, and one production fund flow is composed of multiple first fund chains.
[0124] In step S32, retrieval information corresponding to each production project is constructed according to column information of the financial data file corresponding to each production fund flow.
[0125] As an example, the column information can be a currency code, a lending direction, an amount, and a department, etc. Each production fund flow corresponds to multiple financial data files, and these financial data files correspond to multiple column information. The retrieval column and the retrieval word required for retrieving the financial data file can be constructed according to the column information.
[0126] As an example, the retrieval information includes a retrieval keyword, a retrieval primary key, and a retrieval column, etc., which are not limited in particular.
[0127] In step S32, the retrieval information corresponding to each production project is constructed according to the column information of the financial data file corresponding to each production fund flow.
[0128] For multiple first fund chains in each production fund flow, the fields of the column information in the financial data file corresponding to each first fund chain are processed by word segmentation to obtain first attribute words corresponding to the financial data file.
[0129] As an example, after determining the numerous fund flows in each production project, the process of calling the numerous funds is classified according to the project to which it belongs. For financial data, each fund has a corresponding serial number, a business attribute field, and a department and a customer related field attribute. Most of the fund movements in the same project are between the corresponding departments and the corresponding customers, resulting in a certain similarity of most entry fields in these financial data. However, because of the different specific situations, there will always be some unique summaries or attribute fields, so it is necessary to analyze the independent situation of the related field attributes of the numerous fund flows in the same project, and construct the retrieval attribute corresponding to the production project according to the independent situation.
[0130] As an example, the fields of each column in the financial data file corresponding to each first fund chain are processed by word segmentation. The word segmentation processing can be performed by processing the fields by the jieba algorithm to obtain first attribute words corresponding to each financial data file. Each attribute word can be constructed by a word vector through a model in . .
[0131] Based on the first attribute word, determine the field sequence corresponding to the target column.
[0132] As an example, the target columns may be customer deposits, amount, department, etc. Specifically, a schematic diagram of some columns in a financial data file is shown as follows: Figure 4 As shown in the figure, in financial data, due to the limitations of databases and industry rules, the attributes of some columns in each financial data are relatively limited options, such as the code currency column. However, the records in some columns are more accurate, such as subjects and occurrence departments, and the information differences are greater. Therefore, it is necessary to first construct the similarity of the same column attributes between any two financial data in the target column based on the similarity between the contents (multiple attribute words) of the two financial data in the column.
[0133] As an example, by integrating the first attribute words, a field sequence corresponding to the target column can be obtained. For a single target column, multiple field sequences may correspond.
[0134] Calculate the field similarity of each field sequence in the target column.
[0135] As an example, the DTW (Dynamic Time Warping) algorithm is used to calculate the Group financial data (financial data and ) in the column Field similarity of the above field sequence The DTW algorithm is used to measure the DTW distance between two field sequences. The DTW distance is used to represent the field similarity between field sequences. The smaller the DTW distance, the higher the field similarity between the two field sequences. For example, the reciprocal of the DTW distance is used as the field similarity. Similarly, the field similarity between other financial data in the target column can be calculated.
[0136] The step of calculating the field similarity of each field sequence in the target column includes:
[0137] Calculate the cosine similarity between any two first attribute words in the target column, and use the inverse of the cosine similarity as the local similarity distance between the two first attribute words.
[0138] As an example, the cosine similarity is used to evaluate any two attribute words between the corresponding contents of two financial data in the target column. and Cosine similarity between , abbreviated as , by the inverse of the cosine similarity To evaluate these two financial data in the column The local similarity distance between the two attribute words in the field.
[0139] The local similarity distance is used as the local distance between each first attribute word in the field sequence. Based on each local distance and a preset similarity algorithm, the field similarity of each field sequence in the target column is calculated.
[0140] As an example, the preset similarity algorithm can be a DTW algorithm. When constructing the distance matrix corresponding to each field sequence, the local similarity distance is used as the local distance between the elements corresponding to each first attribute word. Then, based on the local distance, the field similarity between the two field sequences is calculated. The calculation method of the DTW algorithm has been recorded in the relevant technology and will not be repeated here.
[0141] Based on the field similarity, the quick search capability value of the target column as the search column for searching financial data is calculated.
[0142] As an example, for the fields (attributes) of financial data in a certain column (dimension), there are both identical fields and different fields. However, in order to quickly find the required financial data, it is necessary to select dimensions in which the attributes are relatively dispersed. That is, if the fields of many financial data in this column are generally similar, that is, they are similar to each other, then it means that it is difficult to distinguish many financial data from this column, and the cost-effectiveness of using this column as an attribute dimension for financial data retrieval is not high; on the contrary, if they are generally dissimilar, it means that the required financial data can be quickly found. Therefore, it is necessary to calculate the quick search capability value of the target column as the retrieval column for searching financial data. The quick search capability value is used to indicate the ability of a data structure, algorithm or system to efficiently locate or retrieve target data in a short time. The core it emphasizes is the performance superiority of the search operation.
[0143] As an example, quickly find the ability value The calculation method can be:
[0144]
[0145] Where, Indicates the Group financial data (financial data and ) in the column Field similarity of the above field sequence; Indicates that many financial data are in the column The average value of the similarity between the corresponding fields in the above field sequence; Indicates that many financial data are in the column The standard deviation of the similarity between the corresponding fields in the above field sequence; represents a normalization function for positive proportional normalization.
[0146] As an example, according to the method, the quick search capability value of each column in the production project in the target data in the plurality of financial data can be calculated.
[0147] The target columns with a preset number of the quick search capability value are selected as the search primary keys of the production project, and the first attribute words of each financial data file in the target columns are selected as the search word groups.
[0148] As an example, the preset number of the sorting can be 30%, and since each financial data has a corresponding serial number or a unique code such as an archive code, when the quick search capability value of each column is calculated, the columns with a preset number of 30% are selected as the search primary keys of the production project, and the attribute words of each financial data in the columns are selected as the search word groups.
[0149] Based on the search word groups and the search primary keys, the search information is generated.
[0150] As an example, the search primary keys and the search word groups are integrated to obtain the search information, and when the input search keyword is received, the corresponding financial data can be found by calling the search information.
[0151] In the embodiment, the quick search capability value of each target column is calculated based on the field similarity of the financial data file, so that the target columns / search primary keys for searching are reasonably arranged, and the searching speed is improved.
[0152] Further, referring to Figure 5 , based on the first and second embodiments, another embodiment of the present application is provided, in which, based on the search information and the search keyword, the step S40 of querying the financial data file meeting the user demand includes:
[0153] In step S41, the word vector in each entity node corresponding to the financial data file is extracted.
[0154] As an example, the search keyword is obtained by performing word segmentation on the input search sentence by using the jieba algorithm, and then the word vector corresponding to each entity node is determined, so that the similarity between the search keyword and the word vector is calculated, and then the entity node where the required financial data is located is determined.
[0155] In step S42, the first similarity between the search keyword and the word vector is calculated.
[0156] As an example, the first similarity can be a cosine similarity between the word groups, and the similarity between the two word groups is determined by calculating the cosine similarity.
[0157] In step S43, if the first similarity is greater than or equal to a preset similarity threshold, it is determined that the current entity node is a first node including the financial data file corresponding to the search keyword.
[0158] As an example, the preset similarity threshold can be 0.5, 0.7, etc., and is not limited in particular.
[0159] As an example, when a similarity is greater than or equal to a preset similarity threshold, it is considered that the keyword and the entity node correspond to each other; the approximate location of the file to be searched is obtained, i.e., it is determined that the current first node includes the financial data file corresponding to the search keyword.
[0160] In step S44, each production fund flow in the first node is extracted, and a second similarity between the search information in the production project corresponding to the production fund flow and the search keyword is calculated.
[0161] As an example, the second similarity between the search key, the search word group in the production project corresponding to the production fund flow, and the search keyword is calculated by determining the production fund flow in each entity node. In the specific comparison and calculation process, the search keyword is matched with the search key (column) first, and the target column matching the search keyword is found. After the target column is determined, the search keyword is compared and calculated with the search word group in the target column to determine the similarity, i.e., the second similarity. The second similarity can be a cosine similarity calculated by comparing the search keyword with the production fund flow.
[0162] In step S45, based on the second similarity, the financial data file meeting the user's demand is queried.
[0163] As an example, when the second similarity is greater than a preset threshold (0.6, 0.7), it can be determined that the financial data file in the current production fund flow corresponds to the search keyword. Each item of financial data file corresponding to the target column in the production fund flow is extracted to obtain the financial data file meeting the user's demand.
[0164] In this embodiment, by receiving the search keyword, comparing the search keyword with the production fund flow and the entity node, the technical effect of quickly searching for the required financial data file is achieved.
[0165] Specifically, the application embodiment also provides a financial data fast query system, which comprises:
[0166] The determining module is configured to acquire the financial data file from the preset financial database, and determine the fund flow information of each item based on the financial data file.
[0167] The classifying module is configured to classify the financial data file related to the fund flow according to the corresponding production item based on the fund flow information, and obtain a plurality of first fund chains corresponding to each production item.
[0168] The constructing module is configured to construct the search information of each financial data file based on the production item and the first fund chain.
[0169] The querying module is configured to acquire a search keyword, and query the financial data file meeting the user demand based on the search information and the search keyword.
[0170] Referring to Figure 6 , Figure 6 is a device structure schematic diagram of a hardware running environment involved in the embodiment scheme of the present application.
[0171] As Figure 6 shown, the financial data quick query device can include a processor 1001, a memory 1005, and a communication bus 1002. The communication bus 1002 is configured to realize the connection communication between the processor 1001 and the memory 1005.
[0172] Optionally, the financial data quick query device can further include a user interface, a network interface, a camera, an RF (Radio Frequency, radio frequency) circuit, a sensor, a WiFi module, and the like. The user interface can include a display screen (Display), an input sub-module such as a keyboard (Keyboard), and the optional user interface can further include a standard wired interface, a wireless interface. The network interface can include a standard wired interface, a wireless interface (such as a WI-FI interface).
[0173] Those skilled in the art can understand that Figure 6 the financial data quick query device structure shown in the embodiment is not a limitation on the financial data quick query device, and can include more or fewer components than the diagram, or combine certain components, or different component arrangements.
[0174] As Figure 6As shown, memory 1005, a storage medium, may include an operating system, a network communication module, and a financial data quick query program. The operating system manages and controls the hardware and software resources of the financial data quick query device, supporting the execution of the financial data quick query program and other software and / or programs. The network communication module facilitates communication between components within memory 1005, as well as with other hardware and software in the financial data quick query system.
[0175] exist Figure 6 In the financial data quick query device shown, the processor 1001 is used to execute the financial data quick query program stored in the memory 1005 to implement the steps of any of the above-mentioned financial data quick query methods.
[0176] The specific implementation of the financial data quick query device of the present application is basically the same as the various embodiments of the above-mentioned financial data quick query method, and will not be repeated here.
[0177] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.
[0178] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0179] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as mentioned above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods of each embodiment of the present application.
[0180] The above are only preferred embodiments of the present application and do not limit the scope of application of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application description and drawings, or directly or indirectly applied in other related technical fields, are also included in the scope of protection of the present application.
[0181] It is to be noted that the above-mentioned order of the embodiments of the present application is merely for description, and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the figures do not necessarily require the particular order shown or sequential order to achieve the desired results. In some implementations, multi-task processing and parallel processing are also possible or can be advantageous.
[0182] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment mainly explains the difference from other embodiments.
Claims
1. A method for quickly querying financial data, characterized in that: The method comprises: Obtaining financial data files from a preset financial database, and determining fund flow information of various data based on the financial data files; Based on the capital flow information, the financial data files related to the capital flow are classified according to the corresponding production projects to obtain multiple first capital chains corresponding to each of the production projects; Constructing search information for each of the financial data files based on the production project and the first capital chain; The step of constructing retrieval information of each of the financial data files based on the production project and the first capital chain includes: Merging the first capital chains according to the production projects to obtain a production capital flow, wherein the production capital flow includes multiple first capital chains, and each production capital flow corresponds to a production project. The first capital chains are merged by merging and classifying the first capital chains belonging to the same production project to form a production capital flow for the same production project; Constructing search information corresponding to each production project based on the column information of the financial data file corresponding to each production capital flow; A search keyword is obtained, and based on the search information and the search keyword, a financial data file that meets the user's needs is searched.
2. The method for rapid query of financial data according to claim 1, characterized in that: Based on the capital flow information, the financial data files related to the capital flow are classified according to the corresponding production projects to obtain multiple first capital chains corresponding to each production project, including: Based on the fund flow information, converting the financial data file related to the fund flow into triple data, wherein the triple data includes a plurality of entity vectors; For each of the production projects, multiple first capital chains are generated based on the flow relationship of the entity vectors and the triple data.
3. The method for rapid query of financial data according to claim 2, characterized in that: The converting of the financial data file related to the capital flow into triple data based on the capital flow information includes: Based on the fund flow information, convert the fund flow of each financial data file into a ternary relationship; Based on the entity vectors and ternary relationship corresponding to the financial data file, triple data is constructed.
4. The method for rapid query of financial data according to claim 1, wherein: The first capital chains are merged according to the production projects to obtain a production capital flow, including: Marking entity nodes that are in the same capital flow direction and have multiple first capital chains passing through at different time points as different nodes; For each of the difference nodes, calculate the time difference value of any two of the first capital chains; Determining, based on the time difference value, whether the first capital chains belong to the same production project; The first capital chains belonging to the same production project are merged to obtain the production capital flow corresponding to the current production project.
5. The method for rapid query of financial data according to claim 1, characterized in that: The step of constructing search information corresponding to each production project based on the column information of the financial data file corresponding to each production capital flow includes: For each of the plurality of first capital chains in the production capital flow, performing word segmentation processing on each field of column information in the financial data file corresponding to each first capital chain to obtain a first attribute word corresponding to the financial data file; Based on the first attribute word, determining a field sequence corresponding to the target column; Calculating the field similarity of each of the field sequences in the target column; Based on the field similarity, a quick search capability value of the target column as a search column for searching financial data is calculated; Selecting a preset number of target columns before the quick search capability value is sorted as the search primary key for the production project, and using the first attribute word in each of the financial data files in the target column as the search phrase; Based on the search phrase and the search key, search information is generated.
6. The method for rapid query of financial data according to claim 5, characterized in that: The calculating of the field similarity of each field sequence in the target column includes: Calculating the cosine similarity between any two first attribute words in the target column, and taking the reciprocal of the cosine similarity as the local similarity distance between the two first attribute words; The local similarity distance is used as the local distance between each of the first attribute words in the field sequence, and based on each of the local distances and a preset similarity algorithm, the field similarity of each of the field sequences in the target column is calculated.
7. The method for rapid query of financial data according to claim 1, characterized in that: The step of searching for a financial data file that meets the user's needs based on the search information and the search keywords includes: Extracting word vectors from entity nodes corresponding to the financial data file, where the entity nodes are nodes in a knowledge graph constructed based on the financial data file; Calculating a first similarity between the search keyword and the word vector; If the first similarity is greater than or equal to a preset similarity threshold, determining that the current entity node is the first node including the financial data file corresponding to the search keyword; Extracting each production capital flow from the first node and calculating a second similarity between the search information in the production project corresponding to the production capital flow and the search keyword, where the second similarity is calculated by matching the search keyword with the search information, determining a target column in the search information that matches the search keyword, and then comparing the search keyword with the search phrase in the target column to obtain a cosine similarity; Based on the second similarity, a financial data file that meets the user's needs is queried and obtained.
8. A financial data quick query system, characterized by: The financial data quick query system is used to implement the financial data quick query method according to claims 1 to 7, and the financial data quick query system includes: A determination module, the determination module is used to obtain a financial data file from a preset financial database, and determine the capital flow information of various data based on the financial data file; a classification module, the classification module being configured to classify the financial data files related to the capital flow according to the corresponding production projects based on the capital flow information, and obtain a plurality of first capital chains corresponding to each of the production projects; A construction module, the construction module being used to construct retrieval information of each of the financial data files based on the production project and the first capital chain; The query module is used to obtain search keywords and query financial data files that meet user needs based on the search information and the search keywords.
9. An electronic device, characterized in that: The electronic device includes: a memory, a processor, and a financial data quick query program stored in the memory and executable on the processor, wherein the financial data quick query program is configured to implement the steps of the financial data quick query method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Accounting document searching method and system
CN117807189A
Financial audit chain construction method and system based on knowledge graph
CN118113880A