Multi-currency fund allocation method, device and equipment and storage medium

CN122989307APending Publication Date: 2026-10-27INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611074419.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-20
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0004]但是,第一,上述约束条件须由技术人员以数学表达式形式硬编码写入系统,业务人员调整规则时,须经需求提交、开发排期、测试上线等完整流程,数学形式的约束条件完全确定可能需要数天时间,会导致求解多币种资金配置时的效率显著降低;第二,传统方案将币种分配与产品配置两类决策置于同一优化层,导致模型变量数目为币种数、期限数与产品数的乘积,约束条件规模也随之急剧扩张,约束条件规模较大时会导致求解多币种资金配置时的效率进一步降低

Benefits of technology

[0010]通过上述实施,第一,通过对资金多源异构数据进行预处理,可提升资金多源异构数据的数据质量,从而提升后续计算出的流动性缺口预测值与资金配置结果的准确性;第二,通过对通道特征向量集中各通道特征向量进行对齐与融合可将多通道先独立编码再压缩融合,大幅缩短输入序列长度,降低后续自注意力的计算开销。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122989307A_ABST
    Figure CN122989307A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of financial technology, and in particular to a multi-currency fund allocation method and device, equipment and a storage medium, wherein the method comprises the following steps: processing fund multi-source heterogeneous data based on a prediction model to obtain liquidity gap prediction values; determining currency prediction surpluses based on the liquidity gap prediction values; processing natural language constraint rules based on a large language model and a structured prompt template to obtain new constraints; updating a historical constraint set based on the new constraints to obtain a current constraint set; constructing an upper-layer currency level allocation objective function; solving the upper-layer currency level allocation objective function based on the current constraint set to obtain upper limits of currency investable funds; constructing a lower-layer product level allocation objective function; and solving the lower-layer product level allocation objective function based on the upper limits of currency investable funds and the current constraint set to obtain a fund allocation result. The application facilitates effectively improving the solving efficiency when solving multi-currency fund allocation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of financial technology, and in particular to a method, apparatus, device and storage medium for multi-currency fund allocation. Background Technology

[0002] When managing multi-currency foreign exchange pools, banks and other financial institutions need to make fund allocation decisions among multiple currencies (such as US dollars, euros, etc.), multiple investment periods, and multiple types of investment products (such as interbank lending, reverse repurchase agreements, interbank certificates of deposit, and bonds) to achieve multi-currency fund allocation.

[0003] Currently, the traditional approach to multi-currency fund allocation is to rely on human experience or a single linear programming model.

[0004] However, firstly, the aforementioned constraints must be hard-coded into the system by technical personnel in the form of mathematical expressions. When business personnel adjust the rules, they must go through a complete process including requirement submission, development scheduling, and testing and deployment. It may take several days to fully determine the mathematical constraints, which will significantly reduce the efficiency of solving multi-currency fund allocation. Secondly, the traditional solution places the two types of decisions, currency allocation and product allocation, in the same optimization layer, resulting in the number of model variables being the product of the number of currencies, the number of terms, and the number of products. The scale of the constraints also expands rapidly. When the scale of the constraints is large, it will further reduce the efficiency of solving multi-currency fund allocation. Summary of the Invention

[0005] To improve the efficiency of solving multi-currency fund allocation problems, this application provides a multi-currency fund allocation method, apparatus, device, and storage medium.

[0006] Firstly, this application provides a method for multi-currency fund allocation, including: Based on the pre-set prediction model, multi-source heterogeneous data of funds are processed to obtain the predicted value of the liquidity gap corresponding to the investment term combination of each currency; based on the predicted value of each liquidity gap, the predicted surplus of each currency is determined. The natural language constraint rules obtained based on the preset large language model and structured prompt template are used to obtain new constraints; the historical constraint set is updated based on the new constraints to obtain the current constraint set. Based on the predicted surplus of each currency, the investable funds of each currency, and the exchange rate risk of each currency, a higher-level currency-level allocation objective function is constructed; the higher-level currency-level allocation objective function is solved based on the current constraint set to obtain the upper limit of investable funds for each currency; Based on preset portfolio variables, liquidity costs, capital occupation costs, and risk penalties, a lower-level product-level allocation objective function is constructed; the lower-level product-level allocation objective function is solved based on the upper limit of investable funds for each currency and the current constraint set to obtain the fund allocation result.

[0007] Preferably, the step of processing the multi-source heterogeneous data of funds obtained based on a preset prediction model to obtain the predicted value of the liquidity gap corresponding to the investment maturity combination of each currency includes: Multi-channel feature encoding is performed on the acquired heterogeneous funding data from multiple sources to obtain term feature vectors corresponding to each investment term. Each of the aforementioned term feature vectors is fused with the corresponding term embedding vector in the self-attention layer of the prediction model to obtain the fused vector corresponding to each of the aforementioned term feature vectors; Based on the processing of each fusion vector by the self-attention layer, a set of context feature vectors is obtained; The context feature vector set is processed by the interactive attention layer of the prediction model to obtain the currency-enhanced feature vector set; Based on the prediction model, the enhanced feature vector set of the currency is processed to obtain the predicted value of the liquidity gap corresponding to the investment term combination of each currency.

[0008] Through the above implementation, firstly, a self-attention layer is used to focus the context feature vector on different fusion vectors and also incorporate the currency market information contained in other fusion vectors, so that the fused context feature vector reflects the degree of dependence between different investment periods, thereby improving the accuracy of the liquidity gap prediction value calculated based on the context feature vector; secondly, based on the obtained context feature vector, it is further fused with other context feature vectors to incorporate the currency market information contained in other context feature vectors, thereby further improving the accuracy of the subsequently calculated liquidity gap prediction value.

[0009] Preferably, the step of performing multi-channel feature encoding on the acquired multi-source heterogeneous funding data to obtain term feature vectors corresponding to each investment term includes: The acquired multi-source heterogeneous data on funds is preprocessed to obtain target multi-source heterogeneous data; the preprocessing includes at least one of missing value imputation, outlier detection, and standardization. Multi-channel feature encoding is performed on the target multi-source heterogeneous data to obtain a set of channel feature vectors; Align the dimensions of each channel feature vector in the channel feature vector set to obtain a feature vector set of the same dimension; Vector fusion is performed on each feature vector of the same dimension in the set of feature vectors of the same dimension to obtain the term feature vectors corresponding to each investment term.

[0010] Through the above implementation, firstly, by preprocessing the multi-source heterogeneous data of funds, the data quality of the multi-source heterogeneous data of funds can be improved, thereby improving the accuracy of the subsequently calculated liquidity gap prediction value and fund allocation result; secondly, by aligning and fusing the feature vectors of each channel in the channel feature vector set, the multi-channel can be independently encoded and then compressed and fused, which can significantly shorten the length of the input sequence and reduce the computational overhead of subsequent self-attention.

[0011] Preferably, the new constraints obtained from the natural language constraint rules based on the preset large language model and structured prompt template processing include: Based on the acquired natural language constraint rules and the structured prompt template, structured prompt words are constructed; The structured prompt words are processed based on a pre-defined large language model to obtain a constrained structured representation; Based on the structured representation of the constraints and the corresponding compilation template, new constraints are determined.

[0012] Through the above implementation, when determining mathematical constraints (i.e., new constraints), there is no need for technicians to manually code and then submit them for scheduling testing. Instead, the natural language constraint rules issued by technicians can be directly translated into new constraints through a large language model and structured prompt templates, which effectively improves the efficiency of determining mathematical constraints. Since the new constraints are used to solve multi-currency capital allocation, the solution efficiency can be effectively improved when solving multi-currency capital allocation.

[0013] Preferably, updating the historical constraint set based on the newly added constraints to obtain the current constraint set includes: In response to the fact that the newly added constraint is a variable constraint, a constraint set is constructed based on the newly added constraint, the historical basic rule set, and the historical variable constraint set. In response to the fact that the solution set of the constraint set is not empty, the new constraint is not redundant in the historical variable constraint set and is not dominated by the historical variable constraint set, the new constraint is added to the historical variable constraint set to obtain the target variable constraint set; Based on the target variable constraint set and the historical basic rule set, a constraint set is obtained.

[0014] By implementing the above methods and updating the historical variable constraint set, the real-time performance and accuracy of the current constraint set can be improved, thereby helping to improve the accuracy of the subsequently calculated capital allocation results.

[0015] Preferably, updating the historical constraint set based on the newly added constraints to obtain the current constraint set includes: In response to the newly added constraints as basic rules, a rule set is constructed based on the newly added constraints and the historical basic rule set; In response to the non-empty solution set of the rule set, the new constraint is added to the historical basic rule set to obtain the target basic rule set; Based on the target basic rule set and the historical variable constraint set, a constraint set is obtained.

[0016] By implementing the above methods and updating the historical basic rule set, the real-time performance and accuracy of the current constraint set can be improved, thereby helping to improve the accuracy of the subsequent calculated fund allocation results.

[0017] Preferably, after obtaining the constraint set based on the target basic rule set and the historical variable constraint set, the method further includes: Perform a cascaded re-examination on the target basic rule set to identify conflicting variable constraints in the historical variable constraint set; The reported conflicting variable constraints.

[0018] By implementing the above methods, once conflicting variable constraints are determined, they can be promptly reported to technical personnel to ensure the accuracy and conflict-free nature of the constraint set.

[0019] Secondly, this application provides a multi-currency fund allocation device, comprising: The surplus forecasting module is used to process the multi-source heterogeneous data of funds obtained based on a preset forecasting model to obtain the liquidity gap forecast value corresponding to the investment term combination of each currency; and to determine the forecasted surplus of each currency based on the liquidity gap forecast value. The constraint determination module is used to process the natural language constraint rules obtained based on the preset large language model and structured prompt template to obtain new constraints; and to update the historical constraint set based on the new constraints to obtain the current constraint set. The upper limit calculation module is used to construct an upper-level currency-level allocation objective function based on the predicted surplus of each currency, the investable funds of each currency, and the exchange rate risk of each currency; and to solve the upper-level currency-level allocation objective function based on the current constraint set to obtain the upper limit of investable funds for each currency. The configuration determination module is used to construct a lower-level product-level configuration objective function based on preset portfolio variables, liquidity costs, capital occupation costs, and risk penalties; and to solve the lower-level product-level configuration objective function based on the upper limit of investable funds for each currency and the current constraint set to obtain the fund allocation result.

[0020] Thirdly, this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the method described above.

[0021] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described method.

[0022] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.

[0023] The aforementioned multi-currency capital allocation method, apparatus, equipment, and storage medium, through processing multi-source heterogeneous capital data obtained based on a preset prediction model, obtains the predicted liquidity gap value corresponding to the investment term combination of each currency; determines the predicted surplus of each currency based on the predicted liquidity gap value; obtains new constraints based on natural language constraint rules obtained through processing based on a preset large language model and structured prompt template; updates the historical constraint set based on the new constraints to obtain the current constraint set; constructs an upper-level currency-level allocation objective function based on the predicted surplus of each currency, the investable funds of each currency, and the exchange rate risk of each currency; solves the upper-level currency-level allocation objective function based on the current constraint set to obtain the upper limit of investable funds for each currency; constructs a lower-level product-level allocation objective function based on preset portfolio variables, liquidity costs, capital occupation costs, and risk penalties; solves the lower-level product-level allocation objective function based on the upper limit of investable funds for each currency and the current constraint set to obtain the capital allocation result. Through the above implementation, firstly, when determining mathematical constraints (i.e., new constraints), this application eliminates the need for technicians to manually code and submit for scheduling testing. Instead, it directly translates the natural language constraint rules issued by technicians into new constraints through a large language model and structured prompt templates, effectively improving the efficiency of determining mathematical constraints. Since these new constraints are used to solve multi-currency capital allocation, the solution efficiency for multi-currency capital allocation is effectively improved. Secondly, this application places the solution for currency allocation (i.e., the solution for the upper limit of investable funds for each currency) in the upper optimization layer where the upper currency-level allocation objective function is located, and places the solution for product allocation (i.e., the solution for capital allocation results) in the lower optimization layer where the lower product-level allocation objective function is located. This achieves hierarchical processing of the two types of decisions: currency allocation and product allocation, thereby effectively preventing the constraint scale from becoming too large, and further facilitating the improvement of the solution efficiency for multi-currency capital allocation.

[0024] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description

[0025] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0026] Figure 1 This is a flowchart of a multi-currency fund allocation method provided in the embodiments of this application; Figure 2 This is a schematic diagram of the structure of a multi-currency fund allocation device provided in the embodiments of this application; Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application; Figure 4 This is an internal structural diagram of a computer-readable storage medium provided in an embodiment of this application. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of this disclosure clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this disclosure.

[0028] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings herein are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0029] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0030] Example 1 Figure 1 This is a flowchart of a multi-currency fund allocation method provided in Embodiment 1 of this application, for reference. Figure 1The method can be executed by a device that performs the method, which can be implemented in software and / or hardware, and the method includes: S110. Based on the preset prediction model, process the multi-source heterogeneous data of funds to obtain the predicted value of the liquidity gap corresponding to the investment term combination of each currency; determine the predicted surplus of each currency based on the predicted value of the liquidity gap.

[0031] It should be noted that when banks and other financial institutions manage multi-currency (such as USD, EUR, etc.) foreign exchange pools, in order to improve returns, they need to allocate funds for each currency. This allocation means determining the allocation of funds for each currency in each investment product corresponding to each investment period. The investment period ranges from overnight to one year, and the investment products include interbank lending, reverse repurchase agreements, interbank certificates of deposit, bonds, etc.

[0032] To determine the capital allocation, it is first necessary to analyze the liquidity gap of each currency at each investment period. This liquidity gap refers to the expected difference between the total inflow and outflow of funds for a particular currency at a future maturity date. If the inflow exceeds the outflow, the difference is positive, indicating that the currency has an investable surplus at that maturity. If the outflow exceeds the inflow, the difference is negative, indicating that the currency has a payment gap at that maturity, and the corresponding amount must be reserved as reserve funds and cannot be used for investment at that maturity. The combination of each currency and each investment period is denoted as a currency investment period combination. To predict the liquidity gap corresponding to each currency investment period combination, this embodiment pre-sets a prediction model. This prediction model is used to analyze and process the acquired multi-source heterogeneous data on funds, thereby predicting the liquidity gap corresponding to each currency investment period combination.

[0033] The multi-source heterogeneous data on funds can be collected by connecting to the fund management system, foreign exchange trading system and market data terminal. For example, the multi-source heterogeneous data on funds includes the feature category, feature name, sampling frequency and backtracking window for each currency. The feature category includes fund size, fund flow, market pricing and market liquidity. Taking fund size as an example, the feature name corresponding to this feature category includes the currency's daily closing balance and the currency's available balance during the day. Taking the currency's daily closing balance as an example, its corresponding sampling frequency is daily and the backtracking window is 90 days.

[0034] The preset prediction model can process and analyze the multi-source heterogeneous data of funds to predict the liquidity gap corresponding to each currency investment term combination, and the predicted liquidity gap is recorded as the liquidity gap prediction value.

[0035] It should be noted that, to determine the final allocation of funds, it is necessary to further calculate the corresponding projected surplus for each currency based on the predicted liquidity gap. For example, for currency c, the projected surplus for that currency is... The calculation formula is: ; in, This represents the predicted liquidity gap for currency type c. The predicted surplus for each currency type will be used to provide a reference for determining the final allocation of funds.

[0036] S120. The natural language constraint rules obtained based on the preset large language model and structured prompt template are processed to obtain new constraints; the historical constraint set is updated based on the new constraints to obtain the current constraint set.

[0037] It should be noted that this embodiment intends to calculate the capital allocation results of each currency by solving the optimization function. In order to achieve the solution, it is also necessary to match the corresponding mathematical constraints to the optimization function. Therefore, the corresponding constraints need to be determined before establishing the optimization function.

[0038] In this embodiment, technicians can first provide constraints in natural language form, referred to as natural language constraint rules. To convert these natural language constraint rules into mathematical constraints, this embodiment pre-sets a large language model and a structured prompt template. The natural language constraint rules and the structured prompt template are combined to generate guidance information for generating mathematical constraints. By inputting this guidance information into the large language model, the large language model can be guided to generate mathematical constraints, referred to as new constraints.

[0039] It should be noted that the business system stores multiple historical constraints, denoted as the historical constraint set. After the newly generated constraints are added, they need to be updated to this historical constraint set to update the historical constraint set. The updated historical constraint set is used to constrain the solution process when using the optimization function to solve the capital allocation result, so as to ensure the accuracy of the solved capital allocation result. The new constraint set obtained after updating the historical constraint set is denoted as the current constraint set.

[0040] S130. Based on the predicted surplus of each currency, the investable funds of each currency, and the exchange rate risk of each currency, construct an upper-level currency-level allocation objective function; solve the upper-level currency-level allocation objective function based on the current constraint set to obtain the upper limit of investable funds for each currency.

[0041] It should be noted that, in order to prevent the number of current constraints used during the solution process from being too large (restraint scale too large), which would result in a low solution effect, this embodiment intends to divide the entire solution process into two layers. The upper layer is used to solve the currency allocation (that is, to solve the upper limit of investable funds for each currency), and the lower layer is used to solve the product allocation (that is, to solve the fund allocation result). Each layer of solution does not need to use all the constraints in the current constraint set, but only the current constraints in the current constraint set that are relevant to the corresponding solution layer.

[0042] To achieve the upper-level solution (determining the maximum investable amount for each currency), this embodiment first needs to establish a corresponding optimization function, denoted as the upper-level currency-level allocation objective function. This function is constructed based on the predicted surplus of each currency, the investable funds for each currency, and the exchange rate risk for each currency. The calculation formula for this function is as follows: ; Where c represents the c-th currency, C represents the set of currencies, and α, For preset coefficients, For the investable funds corresponding to the c-th currency, For the predicted surplus of currency corresponding to currency type c, · This means that the cost of exchange rate risk is directly proportional to the amount allocated; allocating more funds to currencies with high exchange rate volatility will result in a higher exchange rate risk discount.

[0043] It should be noted that each current constraint in the current constraint set has its own corresponding constraint identifier, which includes currency, product, term, and rating. Among them, the current constraints with the currency identifier are used to constrain the upper-level solution, while the current constraints with the product, term, and rating identifiers are used to constrain the lower-level solution.

[0044] Specifically, in response to the completion of the upper-level currency allocation objective function, the current constraints identified by the currency are further determined from the current constraint set to obtain the upper-level constraint set. The upper-level constraint set is then used to constrain the solution process of the upper-level currency allocation objective function, and the upper limit of investable funds for each currency is obtained.

[0045] S140. Based on preset portfolio variables, liquidity costs, capital occupation costs, and risk penalties, construct a lower-level product-level allocation objective function; solve the lower-level product-level allocation objective function based on the upper limit of investable funds for each currency and the current constraint set to obtain the capital allocation result.

[0046] To achieve the lower-level solution (further solving for the capital allocation result based on the investable capital limit of each currency), this embodiment first needs to establish a corresponding optimization function, denoted as the lower-level product-level allocation objective function. This function is constructed based on preset portfolio variables, liquidity costs, capital occupation costs, and risk penalties. The calculation formula of this function is as follows: ; Where p represents the p-th investment product, and t represents the t-th investment period. , , , The preset coefficients, Indicate currency Chinese investment products During the investment period The configuration amount is a variable in the requirement solution. Liquidity costs (time discount for asset realization) Cost of capital (calculated based on risk-weighted assets) Risk penalties (covering duration risk and credit risk).

[0047] When solving the objective function of the lower-level product configuration, it is necessary to use the current constraints identified as product, term, and rating in the current constraint set for constraint, and record the current constraints identified as product, term, and rating in the current constraint set as the lower-level constraint set.

[0048] It should be noted that, in addition to using the lower-level constraint set to constrain the solution process of the lower-level product-level configuration objective function, it is also necessary to use the total amount of investable funds constrained by the upper limit of investable funds for each currency calculated in step S130.

[0049] The expression for the total amount of investable funds constraint is as follows: ; Specifically, by using the lower-level constraint set and the total amount of investable funds constraint, the solution process of the lower-level product-level allocation objective function is constrained, thereby obtaining the fund allocation results corresponding to each currency.

[0050] It should be noted that this embodiment obtains the predicted liquidity gap value corresponding to the investment term combination of each currency by processing the multi-source heterogeneous data of funds obtained based on a preset prediction model; determines the predicted surplus of each currency based on the predicted liquidity gap value; obtains new constraints by processing the natural language constraint rules obtained based on a preset large language model and structured prompt template; updates the historical constraint set based on the new constraints to obtain the current constraint set; constructs an upper-level currency-level allocation objective function based on the predicted surplus of each currency, the investable funds of each currency, and the exchange rate risk of each currency; solves the upper-level currency-level allocation objective function based on the current constraint set to obtain the upper limit of investable funds for each currency; constructs a lower-level product-level allocation objective function based on preset portfolio variables, liquidity cost, capital occupation cost, and risk penalty; solves the lower-level product-level allocation objective function based on the upper limit of investable funds for each currency and the current constraint set to obtain the fund allocation result. Through the above implementation, firstly, when determining mathematical constraints (i.e., new constraints), this application eliminates the need for technicians to manually code and submit for scheduling testing. Instead, it directly translates the natural language constraint rules issued by technicians into new constraints through a large language model and structured prompt templates, effectively improving the efficiency of determining mathematical constraints. Since these new constraints are used to solve multi-currency capital allocation, the solution efficiency for multi-currency capital allocation is effectively improved. Secondly, this application places the solution for currency allocation (i.e., the solution for the upper limit of investable funds for each currency) in the upper optimization layer where the upper currency-level allocation objective function is located, and places the solution for product allocation (i.e., the solution for capital allocation results) in the lower optimization layer where the lower product-level allocation objective function is located. This achieves hierarchical processing of the two types of decisions: currency allocation and product allocation, thereby effectively preventing the constraint scale from becoming too large, and further facilitating the improvement of the solution efficiency for multi-currency capital allocation.

[0051] Example 2 This application provides a multi-currency capital allocation method in Embodiment 2, which optimizes the "processing of multi-source heterogeneous capital data obtained based on a preset prediction model to obtain the predicted liquidity gap value corresponding to the investment term combination of each currency" in Embodiment 1. It should be noted that for parts not detailed in this embodiment, please refer to the descriptions in other embodiments. The method includes: S211. Perform multi-channel feature encoding on the acquired heterogeneous multi-source funding data to obtain the term feature vectors corresponding to each investment term.

[0052] In order to analyze and process multi-source heterogeneous data of funds to obtain the predicted value of liquidity gap, the prediction model preset in this embodiment is equipped with a multi-channel feature encoder at the input end. The multi-channel feature encoder has corresponding encoding channels for different sampling frequencies corresponding to the multi-source heterogeneous data of funds.

[0053] Taking a combination of a currency and an investment term to create a currency-investment-term combination as an example, the multi-source heterogeneous data corresponding to this currency-investment-term combination generally includes multiple collection frequencies. For example, the collection frequencies include minutes / time, hours / time, days / time, etc. The multi-channel feature encoder has a corresponding encoding channel for each collection frequency. Each encoding channel is used to encode the data of the corresponding frequency in the multi-source heterogeneous data of funds, thereby obtaining the single-frequency encoding result corresponding to the data of the corresponding frequency. Then, the single-frequency encoding results corresponding to different collection frequencies are fused to obtain the fused encoding result, which is denoted as the term feature vector.

[0054] S212. Fuse each of the term feature vectors with the corresponding term embedding vector in the self-attention layer of the prediction model to obtain the fusion vector corresponding to each of the term feature vectors.

[0055] It should be noted that when the prediction model predicts the liquidity gap corresponding to a specific investment period (such as overnight) for a certain currency, it does not look at the historical data of that period in isolation. Instead, it assigns a trainable and updatable numerical label (i.e., "term embedding vector") to each investment period (overnight, 1 week, 2 weeks, etc.), so that the self-attention mechanism of the prediction model can automatically calculate and capture the degree of dependence between different investment periods based on these labels.

[0056] In this model, the self-attention layer is pre-injected with a term embedding vector corresponding to each investment term. Taking a term embedding vector as an example, this term embedding vector is used to fuse with a term feature vector corresponding to the same investment term, thereby obtaining a fused feature vector, denoted as the fused vector.

[0057] S213. Based on the self-attention layer, process each of the fusion vectors to obtain a set of context feature vectors.

[0058] In the above prediction model, the self-attention layer is used to process the fusion vector and output the corresponding feature vector, which is denoted as the context feature vector. The context feature vector can be used to reflect the degree of dependence between different investment periods. The self-attention layer can process the fusion vectors corresponding to different currency investment period combinations, thereby obtaining the context feature vectors corresponding to different fusion vectors. The set of each context feature vector is denoted as the context feature vector set.

[0059] Taking the processing of a fusion vector by a self-attention layer as an example, the self-attention layer generates a query vector (Q), a key vector (K), and a value vector (V) by performing a linear transformation on the fusion vector. This makes the calculation of attention weights not only dependent on the similarity of feature values, but also affected by the semantic relationship between different investment periods. This allows the model to consciously draw information from the historical state of other investment periods when calculating the attention output for a certain period, thereby improving the accuracy of the subsequent prediction of liquidity gaps.

[0060] S214. The context feature vector set is processed by the interactive attention layer based on the prediction model to obtain the currency enhanced feature vector set.

[0061] To further improve the accuracy of the predicted liquidity gap, this embodiment aims to integrate the currency market information contained in other context feature vectors into the context feature vector set. To achieve this integration, this embodiment also sets an interactive attention layer after the self-attention layer of the prediction model. This interactive attention layer is used to integrate each context feature vector in the context feature vector set with other context feature vectors.

[0062] Taking one of the context feature vectors as an example, the fusion result of this context feature vector with other context feature vectors is denoted as the currency-enhanced feature vector, and the set of all currency-enhanced feature vectors is denoted as the currency-enhanced feature vector set.

[0063] S215. Based on the prediction model, process the enhanced feature vector set of the currency to obtain the predicted value of the liquidity gap corresponding to the investment term combination of each currency.

[0064] It should be noted that, in order to calculate the predicted liquidity gap value corresponding to the currency-enhanced feature vector set, this embodiment also sets a feedforward network after the interactive attention layer in the prediction model. This feedforward network is used to process the currency-enhanced feature vector set and then output the corresponding predicted liquidity gap value.

[0065] Through the above implementation, firstly, a self-attention layer is used to focus the context feature vector on different fusion vectors and also incorporate the currency market information contained in other fusion vectors, so that the fused context feature vector reflects the degree of dependence between different investment periods, thereby improving the accuracy of the liquidity gap prediction value calculated based on the context feature vector; secondly, based on the obtained context feature vector, it is further fused with other context feature vectors to incorporate the currency market information contained in other context feature vectors, thereby further improving the accuracy of the subsequently calculated liquidity gap prediction value.

[0066] S216. Determine the projected surplus for each currency based on the projected liquidity gap values.

[0067] S220. The natural language constraint rules obtained based on the preset large language model and structured prompt template are processed to obtain new constraints; the historical constraint set is updated based on the new constraints to obtain the current constraint set.

[0068] S230. Based on the predicted surplus of each currency, the investable funds of each currency, and the exchange rate risk of each currency, construct an upper-level currency-level allocation objective function; solve the upper-level currency-level allocation objective function based on the current constraint set to obtain the upper limit of investable funds for each currency.

[0069] S240. Based on preset portfolio variables, liquidity costs, capital occupation costs, and risk penalties, construct a lower-level product-level allocation objective function; solve the lower-level product-level allocation objective function based on the upper limit of investable funds for each currency and the current constraint set to obtain the fund allocation result.

[0070] Example 3 This application provides a multi-currency fund allocation method in Embodiment 3, which optimizes the "multi-channel feature encoding of the acquired multi-source heterogeneous fund data to obtain the term feature vectors corresponding to each investment term" in Embodiment 2. It should be noted that for parts not detailed in this embodiment, please refer to the descriptions in other embodiments. The method includes: S311A. Preprocess the acquired multi-source heterogeneous data of funds to obtain target multi-source heterogeneous data; the preprocessing includes at least one of missing value imputation, outlier detection, and standardization.

[0071] It should be noted that, taking heterogeneous funding data from multiple sources corresponding to a single currency investment horizon as an example, the initial quality of this data is generally poor. Since this data is subsequently used to calculate the liquidity gap forecast, the accuracy of the heterogeneous funding data must be ensured first. Common issues with the quality of heterogeneous funding data include: missing data, data anomalies, and inconsistent unit dimensions in the heterogeneous data.

[0072] In response to the potential for poor data quality in multi-source heterogeneous funding data, this embodiment employs corresponding preprocessing methods. For example, in the case of missing data, this embodiment performs missing value imputation on the multi-source heterogeneous funding data; in the case of data anomalies, this embodiment performs outlier detection on the multi-source heterogeneous funding data; in the case of inconsistent dimensions in heterogeneous data, this embodiment standardizes the multi-source heterogeneous funding data; and the new data obtained after preprocessing the multi-source heterogeneous funding data is denoted as the target multi-source heterogeneous data.

[0073] S311B. Perform multi-channel feature encoding on the target multi-source heterogeneous data to obtain a channel feature vector set.

[0074] The target multi-source heterogeneous data includes data with different collection frequencies, such as the daily end-of-day balance of a currency collected daily / times, and the daily available balance of a currency collected hourly / times. In this embodiment, the multi-channel encoder is set with a corresponding encoding channel for each collection frequency. Each encoding channel encodes the data in the target multi-source heterogeneous data corresponding to the collection frequency. Taking one encoding channel as an example, the vector output by the encoding channel is denoted as the channel feature vector. The set of channel feature vectors output by different encoding channels is denoted as the channel feature vector set.

[0075] S311C. Align the dimensions of each channel feature vector in the channel feature vector set to obtain a feature vector set of the same dimension.

[0076] It should be noted that different channel feature vectors in the channel feature vector set correspond to different sampling frequencies, resulting in different dimensions between the different channel feature vectors. Inconsistent sampling frequencies lead to natural timestamp misalignment in the corresponding data (e.g., minute-level exchange rate data points falling between two sampling points of daily balances), and the feature vectors output after encoding each channel have different dimensions. Without alignment, the subsequent self-attention mechanism cannot establish cross-channel correlations between information belonging to the same physical time or the same semantic window in different channels. Therefore, it is necessary to align the dimensions of the channel feature vectors in the channel feature vector set.

[0077] To achieve this dimensional alignment, this embodiment projects each channel feature vector in the channel feature vector set onto the same high-dimensional mathematical space. Within this space, the dimensional alignment of each channel feature vector in the channel feature vector set is achieved through methods such as attention or weighted summation. The new vector set obtained after dimensional alignment of the channel feature vector set is denoted as the same-dimensional feature vector set.

[0078] S311D. Perform vector fusion on each feature vector of the same dimension in the same dimension feature vector set to obtain the term feature vector corresponding to each investment term.

[0079] It should be noted that the same-dimensional feature vector set needs to be processed by the self-attention layer of the prediction model. The input of the self-attention layer is generally a feature vector, while the same-dimensional feature vector set contains multiple feature vectors. Therefore, it is necessary to fuse the same-dimensional feature vectors in the same-dimensional feature vector set.

[0080] Among them, fusion is achieved by using multi-head self-attention or gating weighting to dynamically aggregate the vectors (set of feature vectors of the same dimension) aligned by each channel dimension into a compact comprehensive representation vector, denoted as the term feature vector. Each investment term has a corresponding term feature vector.

[0081] It should be noted that, firstly, by preprocessing multi-source heterogeneous funding data, the data quality of multi-source heterogeneous funding data can be improved, thereby improving the accuracy of the subsequently calculated liquidity gap prediction and funding allocation results; secondly, by aligning and fusing the feature vectors of each channel in the channel feature vector set, multiple channels can be independently encoded and then compressed and fused, which can significantly shorten the length of the input sequence and reduce the computational overhead of subsequent self-attention.

[0082] S312. Fuse each of the term feature vectors with the corresponding term embedding vector in the self-attention layer of the prediction model to obtain the fusion vector corresponding to each of the term feature vectors.

[0083] S313. Based on the self-attention layer, process each of the fusion vectors to obtain a set of context feature vectors.

[0084] S314. The context feature vector set is processed by the interactive attention layer based on the prediction model to obtain the currency enhanced feature vector set.

[0085] S315. Based on the prediction model, process the enhanced feature vector set of the currency to obtain the predicted value of the liquidity gap corresponding to the investment term combination of each currency.

[0086] S316. Determine the projected surplus for each currency based on the projected liquidity gap values.

[0087] S320. The natural language constraint rules obtained based on the preset large language model and structured prompt template are processed to obtain new constraints; the historical constraint set is updated based on the new constraints to obtain the current constraint set.

[0088] S330. Based on the predicted surplus of each currency, the investable funds of each currency, and the exchange rate risk of each currency, construct an upper-level currency-level allocation objective function; solve the upper-level currency-level allocation objective function based on the current constraint set to obtain the upper limit of investable funds for each currency.

[0089] S340. Based on preset portfolio variables, liquidity costs, capital occupation costs, and risk penalties, construct a lower-level product-level allocation objective function; solve the lower-level product-level allocation objective function based on the upper limit of investable funds for each currency and the current constraint set to obtain the capital allocation result.

[0090] Example 4 This application provides a multi-currency fund allocation method in Embodiment 4, which optimizes the "obtaining new constraints based on natural language constraint rules acquired through processing a preset large language model and structured prompt template" in Embodiment 1. It should be noted that for parts not detailed in this embodiment, please refer to the descriptions in other embodiments. The method includes: S410. Based on the preset prediction model, process the multi-source heterogeneous data of funds to obtain the predicted value of the liquidity gap corresponding to the investment term combination of each currency; determine the predicted surplus of each currency based on the predicted value of the liquidity gap.

[0091] S421. Based on the acquired natural language constraint rules and the structured prompt template, construct structured prompt words.

[0092] Natural language constraint rules can be written and produced by technical personnel in a short time. Natural language constraint rules are constraints in natural language form, but such constraints cannot be directly applied to the solution process of the constraint objective function. They must first be converted into mathematical constraints. For example, a natural language constraint rule is "the proportion of Euro assets shall not be less than 20% of the total assets of the entire investment portfolio".

[0093] In this embodiment, a corresponding structured prompt template is preset for the natural language constraint rule. This structured prompt template is used to fill in the elements in the natural language constraint rule, thereby obtaining the corresponding structured prompt words. These structured prompt words are subsequently used to input into the large language model to guide the large language model to generate mathematical constraint information.

[0094] Specifically, the natural language constraint rules are input into a large language model that has been injected with structured prompt templates. The parsing engine of the large language model parses the natural language constraint rules to extract various elements, such as elements containing constraint_type as "proportional constraint", target_dimension as "currency", target_value as "Euro", operator as ">=", and threshold as "20%". These elements are then filled into the corresponding positions in the structured prompt template to obtain structured prompt words.

[0095] S422. Process the structured prompt words based on the preset large language model to obtain a constrained structured representation.

[0096] The structured prompts guide the large language model to generate a structured representation of constraints, which is a JSON structure with a predefined schema. This structure includes: constraint_type (constraint type, enumerated as proportional constraint / absolute amount constraint / category percentage constraint), target_dimension (dimensionality of the constraint target, enumerated as currency / product / term / rating), target_value (target identifier), operator (comparison operator), threshold (threshold and unit), constraint_scope (rule level, enumerated as basic rule / variable constraint), and scope (scope limitation).

[0097] S423. Based on the structured representation of the constraints and the corresponding compilation template, determine the new constraints.

[0098] To generate mathematical constraints, the structured representation of the constraint must be combined with a pre-defined compilation template. The compilation template is a standard mathematical equation framework pre-written for each type of constraint. The system automatically selects the corresponding framework based on the constraint type, fills in the fields such as the target, threshold, and operator in the JSON into the corresponding positions of the framework like filling in blanks, performs unit conversion, and applies linearization techniques. This transforms the "intent" behind the technical personnel's natural language into a standard linear mathematical expression that the optimization solver can directly parse and execute, i.e., a mathematical constraint, which is called a new constraint.

[0099] Through the above implementation, when determining mathematical constraints (i.e., new constraints), there is no need for technicians to manually code and then submit them for scheduling testing. Instead, the natural language constraint rules issued by technicians can be directly translated into new constraints through a large language model and structured prompt templates, which effectively improves the efficiency of determining mathematical constraints. Since the new constraints are used to solve multi-currency capital allocation, the solution efficiency can be effectively improved when solving multi-currency capital allocation.

[0100] S424. Update the historical constraint set based on the newly added constraints to obtain the current constraint set.

[0101] S430. Based on the predicted surplus of each currency, the investable funds of each currency, and the exchange rate risk of each currency, construct an upper-level currency-level allocation objective function; solve the upper-level currency-level allocation objective function based on the current constraint set to obtain the upper limit of investable funds for each currency.

[0102] S440. Based on preset portfolio variables, liquidity costs, capital occupation costs, and risk penalties, construct a lower-level product-level allocation objective function; solve the lower-level product-level allocation objective function based on the upper limit of investable funds for each currency and the current constraint set to obtain the fund allocation result.

[0103] Example 5 This application provides a multi-currency fund allocation method in Embodiment 5, which optimizes the "updating the historical constraint set based on the newly added constraints to obtain the current constraint set" in Embodiment 1. It should be noted that for parts not detailed in this embodiment, please refer to the descriptions in other embodiments. The method includes: S510. Based on the preset prediction model, process the multi-source heterogeneous data of funds to obtain the predicted value of the liquidity gap corresponding to the investment term combination of each currency; determine the predicted surplus of each currency based on the predicted value of the liquidity gap.

[0104] S521. Based on the preset large language model and structured prompt template, the natural language constraint rules are processed to obtain the new constraints.

[0105] S522. In response to the fact that the newly added constraint is a variable constraint, construct a constraint set based on the newly added constraint, the historical basic rule set, and the historical variable constraint set.

[0106] It should be noted that after a new constraint is generated, technical personnel will label it, thus generating a category identifier for the new constraint. This category identifier is used to identify the category to which the corresponding new constraint belongs, including variable constraints and basic rules. The business system also stores historical basic rule sets and historical variable constraint sets. When a new constraint is a variable constraint, it is necessary to further determine whether the new constraint is eligible to be added to the historical variable constraint set. If it is determined to be eligible, the new constraint is added to the historical variable constraint set to update the historical variable constraint set. The updated historical variable constraint set is used to constrain the subsequent solution process of the optimization function used to solve for the capital allocation results.

[0107] In this embodiment, it can first be determined whether the newly added constraint is a variable constraint by the type of the newly added constraint. If it is a variable constraint, it can then be further determined whether the newly added constraint is eligible to be added to the historical variable constraint set.

[0108] To determine whether a newly added constraint is eligible to be added to the historical variable constraint set, the newly added constraint must first be combined with the historical basic rule set and the historical variable constraint set to form an inequality set, which is denoted as the constraint set. By judging this constraint set, it can be determined whether the newly added constraint is eligible to be added to the historical variable constraint set.

[0109] S523. In response to the fact that the solution set of the constraint set is not empty, and that the newly added constraint is not redundant in the historical variable constraint set and is not dominated by the historical variable constraint set, the newly added constraint is added to the historical variable constraint set to obtain the target variable constraint set.

[0110] The criteria for determining whether a new constraint is eligible to be added to the historical variable constraint set are: the solution set of the constraint set is not empty, the new constraint is not redundant in the historical variable constraint set, and it is not dominated by the historical variable constraint set.

[0111] The meaning of "the newly added constraint is not redundant in the set of historical variable constraints" is that the newly added constraint is not included in any historical variable constraint in the set of historical variable constraints; the meaning of "not governed by the set of historical variable constraints" is that the result of solving the problem by solving the newly added constraint and the set of historical variable constraints simultaneously is not empty.

[0112] It should be noted that the solution set of the constraint set is not empty, indicating that the newly added constraint does not conflict with any constraint in the historical variable constraint set; the newly added constraint is not redundant in the historical variable constraint set and is not dominated by the historical variable constraint set, indicating that the newly added constraint is not a redundant or useless constraint, and can tighten the feasible region of the historical variable constraint set.

[0113] Specifically, when it is determined that a new constraint is eligible to be added to the historical variable constraint set, it is added to the historical variable constraint set, thereby updating the historical variable constraint set and obtaining a new variable constraint set, denoted as the target variable constraint set.

[0114] S524. Based on the target variable constraint set and the historical basic rule set, a constraint set is obtained.

[0115] The constraint set includes the target variable constraint set and the historical basic rule set.

[0116] It should be noted that updating the historical variable constraint set can improve the real-time performance and accuracy of the current constraint set, thereby helping to improve the accuracy of the subsequently calculated capital allocation results.

[0117] S530. Based on the predicted surplus of each currency, the investable funds of each currency, and the exchange rate risk of each currency, construct an upper-level currency-level allocation objective function; solve the upper-level currency-level allocation objective function based on the current constraint set to obtain the upper limit of investable funds for each currency.

[0118] S540. Based on preset portfolio variables, liquidity costs, capital occupation costs, and risk penalties, construct a lower-level product-level allocation objective function; solve the lower-level product-level allocation objective function based on the upper limit of investable funds for each currency and the current constraint set to obtain the fund allocation result.

[0119] Example 6 This application provides a multi-currency fund allocation method in Embodiment Six, which optimizes the "updating the historical constraint set based on the newly added constraints to obtain the current constraint set" in Embodiment One. It should be noted that for parts not detailed in this embodiment, please refer to the descriptions in other embodiments. The method includes: S610. Based on the preset prediction model, process the multi-source heterogeneous data of funds to obtain the predicted value of the liquidity gap corresponding to the investment term combination of each currency; determine the predicted surplus of each currency based on the predicted value of the liquidity gap.

[0120] S621. Based on the preset large language model and structured prompt template, the natural language constraint rules are processed to obtain the new constraints.

[0121] S622. In response to the newly added constraint as a basic rule, construct a rule set based on the newly added constraint and the historical basic rule set.

[0122] By adding a category identifier corresponding to the new constraint, it can be determined whether the new constraint is a basic rule. If it is a basic rule, it is necessary to further determine whether the new constraint is qualified to be added to the historical basic rule set. If it is qualified, the new constraint is added to the historical basic rule set, which can realize the update of the historical basic rule set.

[0123] To determine whether a new constraint is eligible to be included in the historical basic rule set, the new constraint must first be combined with the historical basic rule set to obtain a set of inequalities, denoted as the rule set.

[0124] S623. In response to the non-empty solution set of the rule set, the new constraint is added to the historical basic rule set to obtain the target basic rule set.

[0125] If the solution set obtained after solving the rule set is not empty, it means that the newly added constraint is not redundant or useless relative to the historical basic rules in the historical basic rule set. It can play a role in tightening the feasible domain corresponding to the historical basic rule set. Therefore, it is suitable to add it to the historical basic rule set to realize the update of the historical basic rule set. The new basic rule set obtained after updating the historical basic rule set is denoted as the target basic rule set.

[0126] It should be noted that updating the historical basic rule set can improve the real-time performance and accuracy of the current constraint set, thereby helping to improve the accuracy of the subsequent calculated fund allocation results.

[0127] S624. Based on the target basic rule set and the historical variable constraint set, a constraint set is obtained.

[0128] The constraint set includes the target basic rule set and the historical variable constraint set.

[0129] S630. Based on the predicted surplus of each currency, the investable funds of each currency, and the exchange rate risk of each currency, construct an upper-level currency-level allocation objective function; solve the upper-level currency-level allocation objective function based on the current constraint set to obtain the upper limit of investable funds for each currency.

[0130] S640. Based on preset portfolio variables, liquidity costs, capital occupation costs, and risk penalties, construct a lower-level product-level allocation objective function; solve the lower-level product-level allocation objective function based on the upper limit of investable funds for each currency and the current constraint set to obtain the capital allocation result.

[0131] Example 7 This application provides a multi-currency fund allocation method in Embodiment Seven, which supplements the steps following "obtaining a constraint set based on the target basic rule set and the historical variable constraint set" in Embodiment Six. It should be noted that for parts not detailed in this embodiment, please refer to the descriptions in other embodiments. The method includes: S710. Based on the preset prediction model, process the multi-source heterogeneous data of funds to obtain the predicted value of the liquidity gap corresponding to the investment term combination of each currency; determine the predicted surplus of each currency based on the predicted value of the liquidity gap.

[0132] S721. Based on the preset large language model and structured prompt template, the natural language constraint rules are processed to obtain the new constraints.

[0133] S722. In response to the newly added constraint as a basic rule, construct a rule set based on the newly added constraint and the historical basic rule set.

[0134] S723. In response to the non-empty solution set of the rule set, the new constraint is added to the historical basic rule set to obtain the target basic rule set.

[0135] S724. Based on the target basic rule set and the historical variable constraint set, a constraint set is obtained.

[0136] S725. Perform a cascaded re-examination of the target basic rule set to determine the conflicting variable constraints in the historical variable constraint set.

[0137] It should be noted that the newly generated target basic rule set may conflict with one or more historical variable constraints in the historical variable constraint set. To prevent this conflict, the target basic rule set needs to be cascaded and re-examined.

[0138] Specifically, all historical variable constraints are traversed one by one to verify their compatibility with the target basic rule set. If the feasible domain of a certain historical variable constraint is tightened to an empty set by the new target basic rule set, then the historical variable constraint is a conflicting variable constraint.

[0139] S726, The reported conflicting variable constraints.

[0140] Once conflicting variable constraints are determined, they must be reported to technical personnel in a timely manner so that they can adjust the historical variable constraint set in a timely manner, thereby ensuring the accuracy and conflict-free nature of the constraint set.

[0141] S730. Based on the predicted surplus of each currency, the investable funds of each currency, and the exchange rate risk of each currency, construct an upper-level currency-level allocation objective function; solve the upper-level currency-level allocation objective function based on the current constraint set to obtain the upper limit of investable funds for each currency.

[0142] S740. Based on preset portfolio variables, liquidity costs, capital occupation costs, and risk penalties, construct a lower-level product-level allocation objective function; solve the lower-level product-level allocation objective function based on the upper limit of investable funds for each currency and the current constraint set to obtain the fund allocation result.

[0143] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0144] Example 8 Based on the same inventive concept, this embodiment also provides a multi-currency fund allocation device for implementing the multi-currency fund allocation method described above. The solution provided by this device is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more embodiments of the multi-currency fund allocation device provided below can be found in the limitations of the multi-currency fund allocation method described above, and will not be repeated here.

[0145] In this embodiment, as Figure 2 As shown, a multi-currency fund allocation device is provided, comprising: The surplus forecasting module is used to process the acquired multi-source heterogeneous data of funds based on a preset forecasting model to obtain the liquidity gap forecast value corresponding to the investment term combination of each currency; and to determine the forecasted surplus of each currency based on the liquidity gap forecast value. The constraint determination module is used to process the natural language constraint rules obtained based on the preset large language model and structured prompt template to obtain new constraints; and to update the historical constraint set based on the new constraints to obtain the current constraint set. The upper limit calculation module is used to construct an upper-level currency-level allocation objective function based on the predicted surplus of each currency, the investable funds of each currency, and the exchange rate risk of each currency; and to solve the upper-level currency-level allocation objective function based on the current constraint set to obtain the upper limit of investable funds for each currency. The configuration determination module is used to construct a lower-level product-level configuration objective function based on preset portfolio variables, liquidity costs, capital occupation costs, and risk penalties; and to solve the lower-level product-level configuration objective function based on the upper limit of investable funds for each currency and the current constraint set to obtain the fund allocation result.

[0146] Each module in the aforementioned multi-currency fund allocation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the electronic device in hardware form or independent of it, or stored in the memory of the electronic device in software form, so that the processor can call and execute the corresponding operations of each module.

[0147] It should be noted that this embodiment obtains the predicted liquidity gap value corresponding to the investment term combination of each currency by processing the multi-source heterogeneous data of funds obtained based on a preset prediction model; determines the predicted surplus of each currency based on the predicted liquidity gap value; obtains new constraints by processing the natural language constraint rules obtained based on a preset large language model and structured prompt template; updates the historical constraint set based on the new constraints to obtain the current constraint set; constructs an upper-level currency-level allocation objective function based on the predicted surplus of each currency, the investable funds of each currency, and the exchange rate risk of each currency; solves the upper-level currency-level allocation objective function based on the current constraint set to obtain the upper limit of investable funds for each currency; constructs a lower-level product-level allocation objective function based on preset portfolio variables, liquidity cost, capital occupation cost, and risk penalty; solves the lower-level product-level allocation objective function based on the upper limit of investable funds for each currency and the current constraint set to obtain the fund allocation result. Through the above implementation, firstly, when determining mathematical constraints (i.e., new constraints), this application eliminates the need for technicians to manually code and submit for scheduling testing. Instead, it directly translates the natural language constraint rules issued by technicians into new constraints through a large language model and structured prompt templates, effectively improving the efficiency of determining mathematical constraints. Since these new constraints are used to solve multi-currency capital allocation, the solution efficiency for multi-currency capital allocation is effectively improved. Secondly, this application places the solution for currency allocation (i.e., the solution for the upper limit of investable funds for each currency) in the upper optimization layer where the upper currency-level allocation objective function is located, and places the solution for product allocation (i.e., the solution for capital allocation results) in the lower optimization layer where the lower product-level allocation objective function is located. This achieves hierarchical processing of the two types of decisions: currency allocation and product allocation, thereby effectively preventing the constraint scale from becoming too large, and further facilitating the improvement of the solution efficiency for multi-currency capital allocation.

[0148] Example 9 Figure 3 A schematic diagram of an electronic device 10, which can be used to implement embodiments of the present invention, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0149] like Figure 3As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0150] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0151] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as multi-currency fund allocation methods.

[0152] In some embodiments, the multi-currency funding allocation method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the multi-currency funding allocation method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the multi-currency funding allocation method by any other suitable means (e.g., by means of firmware).

[0153] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0154] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0155] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0156] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0157] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0158] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0159] Example 10 In this embodiment, a computer-readable storage medium is provided, such as... Figure 4 As shown, a computer program is stored thereon, and when the computer program is executed by the processor, it implements the steps in the above-described method embodiments.

[0160] Example 11 In this embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0161] It should be noted that the information collected is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data all comply with the relevant laws, regulations and standards of the relevant countries and regions, necessary confidentiality measures have been taken, and it does not violate public order and good morals. Corresponding operation portals are provided for users to choose to authorize or refuse.

[0162] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this disclosure can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this disclosure may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this disclosure may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0163] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0164] The embodiments described above are merely illustrative of several implementations of this disclosure, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent disclosure. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this disclosure, and these all fall within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the appended claims.

Claims

1. A method for multi-currency fund allocation, characterized in that, include: Based on the pre-set prediction model, the multi-source heterogeneous data of funds obtained are processed to obtain the predicted value of the liquidity gap corresponding to the investment maturity combination of each currency. The projected surplus for each currency is determined based on the aforementioned liquidity gap forecasts. The natural language constraint rules obtained based on the preset large language model and structured prompt template are used to obtain new constraints; the historical constraint set is updated based on the new constraints to obtain the current constraint set. Based on the predicted surplus of each currency, the investable funds of each currency, and the exchange rate risk of each currency, a higher-level currency-level allocation objective function is constructed. Based on the current constraint set, the objective function of the upper-level currency allocation is solved to obtain the upper limit of investable funds for each currency. Based on preset portfolio variables, liquidity costs, capital occupation costs, and risk penalties, a lower-level product-level allocation objective function is constructed; the lower-level product-level allocation objective function is solved based on the upper limit of investable funds for each currency and the current constraint set to obtain the fund allocation result.

2. The method according to claim 1, characterized in that, The multi-source heterogeneous data of funds obtained based on the preset prediction model are used to obtain the predicted liquidity gap values ​​corresponding to the investment maturity combinations of each currency, including: Multi-channel feature encoding is performed on the acquired heterogeneous funding data from multiple sources to obtain term feature vectors corresponding to each investment term. Each of the aforementioned term feature vectors is fused with the corresponding term embedding vector in the self-attention layer of the prediction model to obtain the fused vector corresponding to each of the aforementioned term feature vectors; Based on the processing of each fusion vector by the self-attention layer, a set of context feature vectors is obtained; The context feature vector set is processed by the interactive attention layer of the prediction model to obtain the currency-enhanced feature vector set; Based on the prediction model, the enhanced feature vector set of the currency is processed to obtain the predicted value of the liquidity gap corresponding to the investment term combination of each currency.

3. The method according to claim 2, characterized in that, The process of performing multi-channel feature encoding on the acquired multi-source heterogeneous funding data to obtain term feature vectors corresponding to each investment term includes: The acquired multi-source heterogeneous data on funds is preprocessed to obtain target multi-source heterogeneous data; the preprocessing includes at least one of missing value imputation, outlier detection, and standardization. Multi-channel feature encoding is performed on the target multi-source heterogeneous data to obtain a set of channel feature vectors; Align the dimensions of each channel feature vector in the channel feature vector set to obtain a feature vector set of the same dimension; Vector fusion is performed on each feature vector of the same dimension in the set of feature vectors of the same dimension to obtain the term feature vectors corresponding to each investment term.

4. The method according to claim 1, characterized in that, The natural language constraint rules obtained based on the preset large language model and structured prompt template processing yield new constraints, including: Based on the acquired natural language constraint rules and the structured prompt template, structured prompt words are constructed; The structured prompt words are processed based on a pre-defined large language model to obtain a constrained structured representation; Based on the structured representation of the constraints and the corresponding compilation template, new constraints are determined.

5. The method according to claim 1, characterized in that, The process of updating the historical constraint set based on the newly added constraints to obtain the current constraint set includes: In response to the fact that the newly added constraint is a variable constraint, a constraint set is constructed based on the newly added constraint, the historical basic rule set, and the historical variable constraint set. In response to the fact that the solution set of the constraint set is not empty, the new constraint is not redundant in the historical variable constraint set and is not dominated by the historical variable constraint set, the new constraint is added to the historical variable constraint set to obtain the target variable constraint set; Based on the target variable constraint set and the historical basic rule set, a constraint set is obtained.

6. The method according to claim 1, characterized in that, The process of updating the historical constraint set based on the newly added constraints to obtain the current constraint set includes: In response to the newly added constraints as basic rules, a rule set is constructed based on the newly added constraints and the historical basic rule set; In response to the non-empty solution set of the rule set, the new constraint is added to the historical basic rule set to obtain the target basic rule set; Based on the target basic rule set and the historical variable constraint set, a constraint set is obtained.

7. The method according to claim 6, characterized in that, After obtaining the constraint set based on the target basic rule set and the historical variable constraint set, the process further includes: Perform a cascaded re-examination on the target basic rule set to identify conflicting variable constraints in the historical variable constraint set; The reported conflicting variable constraints.

8. A multi-currency fund allocation device, characterized in that, The device includes: The surplus forecasting module is used to process the multi-source heterogeneous data of funds obtained based on a preset forecasting model to obtain the liquidity gap forecast value corresponding to the investment term combination of each currency; and to determine the forecasted surplus of each currency based on the liquidity gap forecast value. The constraint determination module is used to process the natural language constraint rules obtained based on the preset large language model and structured prompt template to obtain new constraints; and to update the historical constraint set based on the new constraints to obtain the current constraint set. The upper limit calculation module is used to construct an upper-level currency-level allocation objective function based on the predicted surplus of each currency, the investable funds of each currency, and the exchange rate risk of each currency; and to solve the upper-level currency-level allocation objective function based on the current constraint set to obtain the upper limit of investable funds for each currency. The configuration determination module is used to construct a lower-level product-level configuration objective function based on preset portfolio variables, liquidity costs, capital occupation costs, and risk penalties; and to solve the lower-level product-level configuration objective function based on the upper limit of investable funds for each currency and the current constraint set to obtain the fund allocation result.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the multi-currency capital allocation method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the multi-currency fund allocation method according to any one of claims 1-7.