A method, device, and medium for retrieving file information
By selecting the file information retrieval path through scoring, the problem of poor flexibility in existing technologies is solved, and efficient and accurate data retrieval and analysis are achieved.
Patent Information
- Application Number
- CN202511181411.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-22
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2045-08-22
AI Technical Summary
Existing technologies lack flexibility in retrieving file information, making it difficult to accurately select the optimal retrieval path, which affects efficiency and data quality.
By calculating the number of data tables and time difference for each combination method, the scoring selects the optimal call path, and optimizes the call process by combining the number of fields and the update time of the data tables.
It improves file retrieval efficiency and data analysis accuracy, reduces computing resource consumption, and ensures the timeliness and comprehensiveness of data.
Smart Images

Figure CN120687414B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of file retrieval technology, and in particular to a method, device and medium for retrieving file information. Background Technology
[0002] In many fields such as finance, public security, and healthcare, systems typically need to retrieve information from multiple data sources—database tables, API interfaces, file storage, etc.—and combine and calculate data according to business rules to assess user status. For example, in the financial sector, multiple pieces of user information need to be combined to calculate risk scores, while in the public security sector, various user data need to be queried to analyze behavioral patterns. Currently, common methods for retrieving file information include: predefined, centralized, and fixed field combinations, with one selected for each call, but this lacks flexibility; or manual specification of the call path, which fails to accurately detect changes in data tables and makes it difficult to accurately select the optimal call path. When the same business objective can be achieved through multiple field combinations, existing technologies lack an automatic evaluation mechanism, affecting file retrieval efficiency and data quality.
[0003] Therefore, there is an urgent need to provide a method for retrieving file information that is efficient and helps improve the accuracy of user evaluation. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention provides a method, device, and medium for retrieving file information. By considering the number of data tables corresponding to each combination method and the time difference between different data tables, it improves the efficiency of file retrieval and the accuracy of data analysis and evaluation from two dimensions: the amount of data retrieved and timeliness.
[0005] According to a first aspect of the present invention, a method for retrieving file information is provided, comprising the following steps:
[0006] S100: Based on several possible combinations of call fields in the file information call request text and the identifier of the stored data table corresponding to each possible combination of call fields obtained in advance, calculate the first selection score value for each possible combination of call fields.
[0007] S200: For any field to be selected, if the stored data table corresponding to the field to be selected is unique, the corresponding stored data table is determined as the target data table corresponding to the field to be selected; if the stored data table corresponding to the field to be selected is not unique, the target data table corresponding to the field to be selected is filtered out.
[0008] S300: For any combination of fields to be selected, for several target data tables, calculate the second selection score corresponding to the combination of fields to be selected based on the update time of each target data table.
[0009] S400, based on the first selection score and the second selection score corresponding to each combination of fields to be selected, calculate the final selection score for each combination of fields to be selected.
[0010] S500: Obtain several candidate call fields from the candidate call field combination method corresponding to the largest final selection score, and call the file where the target data table corresponding to each obtained candidate call field is located.
[0011] According to a second aspect of the present invention, a non-transitory computer-readable storage medium is provided, wherein at least one instruction or at least one program is stored therein, the at least one instruction or the at least one program being loaded and executed by a processor to implement the above-described method for retrieving file information.
[0012] According to a third aspect of the present invention, an electronic device is provided, including a processor and the aforementioned non-transitory computer-readable storage medium.
[0013] The present invention has at least the following beneficial effects:
[0014] This invention provides a method for retrieving file information. First, based on several possible combinations of fields to be retrieved in the file information retrieval request text and the identifier of the stored data table corresponding to each field, a first selection score is obtained for each combination. By analyzing the number of fields and the corresponding data tables for each combination, the amount of data retrieved is reduced while ensuring data comprehensiveness. Then, the target data table corresponding to each field to be retrieved is determined, and a second selection score is obtained based on the update time of each target data table. By considering the time difference between different data tables, the retrieved file has better timeliness. Finally, a final selection score is obtained for each combination of fields to be retrieved based on the first and second selection scores. The final selection score determines the chosen combination of fields, thus retrieving the file. This invention considers both the amount of data retrieved and timeliness, reducing data computation resources and improving file retrieval efficiency as well as the accuracy of data analysis and evaluation. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 A flowchart illustrating a method for retrieving file information provided in an embodiment of the present invention. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] This invention provides a method for retrieving file information, such as... Figure 1 As shown, the method includes the following steps:
[0019] S100: Based on several possible combinations of fields to be selected in the file information retrieval request text and the identifier of the stored data table corresponding to each field to be selected in advance, a first selection score value is calculated for each possible combination of fields to be selected. In this embodiment, there are at least two possible combinations of fields to be selected. For example, if a bank needs to retrieve a user's multi-dimensional data to calculate the user's risk score or to manage assets, two possible combinations of fields are provided: combination A includes fields such as credit score and transaction amount in the past three months, and combination B includes fields such as asset valuation, debt ratio, and occupational stability. The file information retrieval request text also includes the option to select a method and retrieve the required file according to the selected method.
[0020] Furthermore, the identifier of the stored data table corresponding to each field to be selected is obtained through the following steps:
[0021] S10, obtain the field-data table storage address mapping table stored in the preset database; the field-data table storage address mapping table is updated in real time. For example, when a new data table is added for the same field, the mapping table is updated promptly according to the storage location of the new data table.
[0022] S20: Find the data table storage address corresponding to each field to be selected from the field-data table storage address mapping table, and use the data table storage address corresponding to each field to be selected as the identifier of the stored data table corresponding to each field to be selected.
[0023] By establishing a mapping table between fields and data table storage addresses, users can quickly understand the storage address and number of data tables corresponding to each field to be selected, while occupying very little storage space. This helps to filter out the more needed data tables for retrieval.
[0024] In a specific embodiment, the first selection score value of the combination of fields to be called is calculated through the following steps:
[0025] S101, assign an initial score to each combination of fields to be selected based on the number of fields to be selected in each combination of fields to be selected; the initial score is inversely proportional to the number of fields to be selected.
[0026] In specific implementation, when the first combination of fields to be selected includes three fields to be selected and the second combination of fields to be selected includes four fields to be selected, the initial score of the first combination of fields to be selected is greater than the initial score of the second combination of fields to be selected. This embodiment does not limit the specific method of determining the initial score. For example, the specific score setting can be determined according to the reciprocal of the number of fields to be selected included in the combination of fields to be selected.
[0027] S102, based on the stored data table corresponding to each field to be selected, analyze the number of fields to be selected in each stored data table that belong to the same combination of fields to be selected, and determine the minimum number of stored data tables to be called for each combination of fields to be selected.
[0028] To facilitate understanding of the solution, an example is provided below: The combination of fields to be selected corresponds to Field 1, Field 2, and Field 3. The first stored data table contains Field 1 and Field 2, the second stored data table contains Field 1, Field 2, and Field 3, and the third stored data table contains Field 2. Therefore, calling only the second stored data table can meet the calling requirements and minimizes the number of stored data tables called.
[0029] S103, based on the minimum number of stored data tables called for each selected field combination method, assign an association score to each selected field combination method; the association score is inversely proportional to the minimum number of stored data tables called.
[0030] S104, the sum of the initial score and the associated score corresponding to the combination of fields to be selected is determined as the first selection score value of the combination of fields to be selected.
[0031] As mentioned above, the fewer the number of fields to be selected and the fewer the number of stored data tables to be called, the higher the score of the first selection. This setting makes the combination of fields to be selected tend to include fewer fields and fewer stored data tables, which helps to improve the efficiency of file retrieval and reduce the consumption of computing resources during data analysis.
[0032] S200: For any field to be selected, if the stored data table corresponding to the field to be selected is unique, the corresponding stored data table is determined as the target data table corresponding to the field to be selected; if the stored data table corresponding to the field to be selected is not unique, the target data table corresponding to the field to be selected is filtered out. It can be understood that: the stored data table corresponding to the field to be selected is unique means that the field to be selected exists in only one stored data table.
[0033] Specifically, if the stored data table corresponding to the field to be selected is not unique, the process of filtering out the target data table corresponding to the field to be selected includes the following steps:
[0034] S201, if the stored data table corresponding to the field to be selected is not unique, obtain the data source of each stored data table corresponding to the field to be selected and the preset importance level of the data source.
[0035] S202, when the number of stored data tables corresponding to the highest preset importance level among the preset importance levels of each data source is 1, the stored data table corresponding to the highest preset importance level is used as the target data table corresponding to the field to be selected and called; this can be understood as: the preset importance levels of multiple data sources corresponding to the field to be selected and called are of varying degrees, and there is only 1 data source with the highest preset importance level.
[0036] S203, when the number of stored data tables corresponding to the highest preset importance level in each data source is greater than 1, based on the number of records under the field to be selected in each stored data table, the stored data table with the most records is taken as the target data table corresponding to the field to be selected.
[0037] As mentioned above, when a field to be selected corresponds to multiple stored data tables, the data table with the highest preset importance level, i.e., the highest authority level, is selected first. For example, data from the central bank is higher than data from third parties, which is conducive to retrieving more accurate data. If there are multiple data tables with the highest preset importance level among the multiple preset importance levels, the field with the most records is selected to make the statistical data more comprehensive.
[0038] S300: For any combination of fields to be selected, for several target data tables, calculate the second selection score corresponding to the combination of fields to be selected based on the update time of each target data table.
[0039] Specifically, the second choice score value corresponding to the combination of fields to be selected is calculated through the following steps:
[0040] S301, iterate through all the fields to be selected in the combination of fields to be selected, obtain the update timestamp in the target data table corresponding to each field to be selected, and select the most recent update timestamp as the base time.
[0041] S302, calculate the time difference between the update timestamp and the base time of the target data table corresponding to each field to be selected and called; it can be understood that the time difference refers to the duration between the update timestamp and the base time.
[0042] S303, substitute each time difference into the preset exponential decay model, and use the output result as the timeliness score of the corresponding field to be selected for call.
[0043] The preset exponential decay model meets the following conditions:
[0044] , of which S i S represents the timeliness score of the i-th field to be selected. max ΔT is the preset maximum scoring threshold, λ is the preset attenuation coefficient, and ΔT is the maximum scoring threshold. i This represents the time difference between the update timestamp of the target data table corresponding to the i-th field to be selected and the baseline time. In specific implementations, the maximum scoring threshold can be set to 100 or 10, and the preset attenuation coefficient is between 0 and 1. Those skilled in the art can set it according to the required attenuation rate, which will not be elaborated here.
[0045] S304, the average timeliness score of all the fields to be selected in the combination of fields to be selected is determined as the second selection score value corresponding to the combination of fields to be selected.
[0046] As mentioned above, when calculating the second choice score, not only the update time of the target data table is considered, but also the update time difference between different fields is introduced. The larger the time difference, the more asynchronous the field updates are. Data from the same period can be more matched, making the statistical analysis of the data more accurate. Therefore, the above method of calculating the second choice score affects the final selection score of the combination of fields to be called from the perspective of timeliness, enabling more accurate and reliable data analysis and evaluation based on the final called file.
[0047] S400, based on the first selection score and the second selection score corresponding to each combination of fields to be selected, calculate the final selection score for each combination of fields to be selected.
[0048] Specifically, the S400 procedure includes the following steps:
[0049] S401, input the file information retrieval request text into the preset classification model to obtain the task label corresponding to the file information retrieval request text; the task label includes statistical analysis tasks and real-time tasks; it can be understood that: the preset classification model is a pre-trained binary classification model, and the training dataset includes a set of request text samples and the task label corresponding to each request text sample; those skilled in the art know the training process of the classification model, and will not elaborate further here.
[0050] S402, if the task tag corresponding to the file information retrieval request text is a statistical analysis task, the preset index weight assigned to the first selection score is greater than the preset index weight assigned to the second selection score. Those skilled in the art can set specific preset index weight values according to actual needs, or determine the preset index weight values based on the confidence level output by a preset classification model.
[0051] S403, if the task tag corresponding to the file information retrieval request text is a real-time task, the preset index weight assigned to the first selection score value is less than the preset index weight assigned to the second selection score value.
[0052] S404, the first selection score value and the second selection score value corresponding to the combination of fields to be selected are normalized respectively. Based on the processed first selection score value, second selection score value, and the preset index weights corresponding to the first selection score value and the second selection score value respectively, the final selection score value of the combination of fields to be selected is calculated by weighted summation.
[0053] As described above, when calculating the final selection score, different indicator weights are assigned to the first and second selection scores based on the task type corresponding to the file information request text. If the request text is a real-time task, a higher indicator weight is assigned to the second selection score, which is beneficial for filtering out call field combinations with higher real-time performance. If the request text is a statistical analysis task, a higher indicator weight is assigned to the first selection score, which results in fewer data tables being filtered out and each data table containing as many fields to be called as possible. Since the fields in the same data table are synchronously statistical data, the statistical analysis of the data is more accurate.
[0054] S500: Obtain several candidate call fields from the candidate call field combination method corresponding to the largest final selection score, and call the file where the target data table corresponding to each obtained candidate call field is located.
[0055] By selecting the file with the highest final selection score, the process involves querying first and then calling. Querying consumes very little data computing resources, while calling involves file size and file transfer. This method reduces the number of target data tables to be called, thus reducing the call path and improving call efficiency and post-call data screening efficiency. Furthermore, the target data tables have a large number of records and are updated more recently, which is beneficial for comprehensive and reliable data analysis.
[0056] In another embodiment, the method further includes the following steps:
[0057] S1, if the file information retrieval request text contains only one possible combination of retrieval fields, obtain the target data table corresponding to each retrieval field in the possible retrieval field combination. This is consistent with the method for obtaining the target data table in step S200, and will not be repeated here.
[0058] S2 calls the file containing the target data table corresponding to each of the obtained fields to be selected.
[0059] Embodiments of the present invention also provide a non-transitory computer-readable storage medium, which can be disposed in an electronic device to store at least one instruction or at least one program related to implementing a method in the method embodiments, wherein the at least one instruction or the at least one program is loaded and executed by the processor to implement the file information retrieval method provided in the above embodiments.
[0060] Embodiments of the present invention also provide an electronic device, including a processor and the aforementioned non-transitory computer-readable storage medium.
[0061] While specific embodiments of the invention have been described in detail by way of example, those skilled in the art should understand that the examples are for illustrative purposes only and not intended to limit the scope of the invention. It should also be understood that various modifications can be made to the embodiments without departing from the scope and spirit of the invention. The scope of the invention is defined by the appended claims.
Claims
1. A method for retrieving file information, characterized in that, The method includes the following steps: S100, based on several possible combinations of call fields in the file information call request text and the identifier of the stored data table corresponding to each possible combination of call fields obtained in advance, calculate the first selection score value for each possible combination of call fields. The first selection score for the chosen combination of fields to be called is calculated through the following steps: S101, assign an initial score to each combination of fields to be selected based on the number of fields to be selected in each combination of fields to be selected; the initial score is inversely proportional to the number of fields to be selected. S102, based on the stored data table corresponding to each field to be selected, analyze the number of fields to be selected in each stored data table that belong to the same combination of fields to be selected, and determine the minimum number of stored data tables to be called for each combination of fields to be selected. S103, based on the minimum number of stored data tables called for each selected field combination method, assign an association score to each selected field combination method; the association score is inversely proportional to the minimum number of stored data tables called. S104, the sum of the initial score and the associated score corresponding to the combination of fields to be selected is determined as the first selection score of the combination of fields to be selected; S200: For any field to be selected, if the stored data table corresponding to the field to be selected is unique, the corresponding stored data table is determined as the target data table corresponding to the field to be selected itself. If the stored data table corresponding to the field to be selected is not unique, filter out the target data table corresponding to the field to be selected. S300: For any combination of fields to be selected, for several target data tables, calculate the second selection score value corresponding to the combination of fields to be selected based on the update time of each target data table. S400, calculate the final selection score for each combination of fields to be selected based on the first selection score and the second selection score corresponding to each combination of fields to be selected; S500: Obtain several candidate call fields from the candidate call field combination method corresponding to the largest final selection score, and call the file where the target data table corresponding to each obtained candidate call field is located.
2. The method for retrieving file information according to claim 1, characterized in that, The identifier of the stored data table corresponding to each field to be selected is obtained through the following steps: S10, obtain the mapping relationship table between fields stored in the preset database and data table storage addresses; The mapping table between the fields and the data table storage addresses is updated in real time; S20: Find the data table storage address corresponding to each field to be selected from the field-data table storage address mapping table, and use the data table storage address corresponding to each field to be selected as the identifier of the stored data table corresponding to each field to be selected.
3. The method for retrieving file information according to claim 1, characterized in that, In step S200, if the stored data table corresponding to the field to be selected is not unique, filtering out the target data table corresponding to the field to be selected includes the following steps: S201, If the stored data table corresponding to the field to be selected is not unique, obtain the data source of each stored data table corresponding to the field to be selected and the preset importance level of the data source; S202, when the number of stored data tables corresponding to the highest preset importance level in each data source is 1, the stored data table corresponding to the highest preset importance level is used as the target data table corresponding to the field to be selected for call. S203, when the number of stored data tables corresponding to the highest preset importance level in each data source is greater than 1, based on the number of records under the field to be selected in each stored data table, the stored data table with the most records is taken as the target data table corresponding to the field to be selected.
4. The method for retrieving file information according to claim 1, characterized in that, In step S300, the second selection score value corresponding to the combination of fields to be selected is calculated through the following steps: S301, iterate through all the fields to be selected in the combination of fields to be selected, obtain the update timestamp in the target data table corresponding to each field to be selected, and select the most recent update timestamp as the base time; S302, calculate the time difference between the update timestamp of the target data table corresponding to each field to be selected and called and the base time; S303, substitute each time difference into the preset exponential decay model, and use the output result as the timeliness score of the corresponding field to be selected for call; S304, the average timeliness score of all the fields to be selected in the combination of fields to be selected is determined as the second selection score value corresponding to the combination of fields to be selected.
5. The method for retrieving file information according to claim 1, characterized in that, The S400 procedure includes the following steps: S401, Input the file information retrieval request text into the preset classification model to obtain the task label corresponding to the file information retrieval request text; the task label includes statistical analysis tasks and real-time tasks; S402, if the task tag corresponding to the file information call request text is a statistical analysis task, the preset index weight assigned to the first selection score value is greater than the preset index weight assigned to the second selection score value. S403, if the task tag corresponding to the file information call request text is a real-time task, the preset index weight assigned to the first selection score value is less than the preset index weight assigned to the second selection score value. S404, the first selection score value and the second selection score value corresponding to the combination of fields to be selected are normalized respectively. Based on the processed first selection score value, second selection score value, and the preset index weights corresponding to the first selection score value and the second selection score value respectively, the final selection score value of the combination of fields to be selected is calculated by weighted summation.
6. The method for retrieving file information according to claim 1, characterized in that, The method further includes the following steps: S1, if there is only one combination of call fields to be selected in the file information call request text, obtain the target data table corresponding to each call field to be selected in the combination of call fields to be selected; S2 calls the file containing the target data table corresponding to each of the obtained fields to be selected.
7. A non-transitory computer-readable storage medium, wherein the storage medium stores at least one instruction or at least one program segment, characterized in that, The at least one instruction or the at least one program segment is loaded and executed by the processor to implement the file information retrieval method as described in any one of claims 1-6.
8. An electronic device, characterized in that, Includes a processor and the non-transitory computer-readable storage medium as described in claim 7.
Citation Information
Patent Citations
Information calling method and device, electronic equipment and readable storage medium
CN113411400A
File acquisition method and device, computer equipment and storage medium
CN114036187A