Method, device and system for calling foreign exchange derivative valuation data
By establishing a valuation index library for foreign exchange derivative transactions and optimizing request parameters, the problem of multiple requests to obtain foreign exchange derivative valuation data in the existing technology is solved, and the data results of a single call are returned to multiple valuation scenarios are realized, which improves system efficiency and user reading efficiency.
Patent Information
- Application Number
- CN202410686433.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-05-30
AI Technical Summary
When querying foreign exchange derivative transaction valuation messages, the prior art needs to issue multiple requests to obtain valuation data in different valuation scenarios, resulting in high complexity of data call and return processing, increased system burden, and low user reading efficiency.
By loading the valuation data of foreign exchange derivative transactions in advance, and optimizing the request parameters of business requests, using the optimization request parameters to query the valuation index library, integrating the returned valuation data results to achieve a single call to return the data results of multiple valuation scenarios.
It realizes that a single call returns data results in multiple valuation scenarios, increases data call and processing efficiency, reduces system burden, and better processes results through the field scalable function of JSON packets.
Smart Images

Figure CN118445316B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data request and call processing, and in particular to a method, device and system for calling foreign exchange derivative valuation data. Background Art
[0002] The foreign exchange market is a global currency trading market that determines the exchange rate of each currency, including all aspects of buying, selling and exchanging currencies at current or determined prices. Foreign exchange derivatives (also known as foreign exchange derivatives) generally refer to foreign exchange trading instruments derived from native assets, whose value depends on one or more underlying assets or indices. The basic varieties include forwards, futures, swaps and options, and can also include structured financial instruments with one or more characteristics of forwards, futures, swaps and options. During the life of foreign exchange derivatives, due to changes in market exchange rates, the market value of foreign exchange trading products will fluctuate, resulting in gains and losses.
[0003] When conducting foreign exchange derivative transactions, it is necessary to obtain valuation information of foreign exchange derivative transactions. In the existing valuation information query, the corresponding valuation scenarios are usually processed separately according to the foreign exchange derivative transaction types (such as foreign exchange forwards, foreign exchange swaps, foreign exchange options, foreign exchange structured options, foreign exchange currency swaps, foreign exchange interest rate swaps, etc.), combined with valuation methods (such as commonly used valuation methods include mark-to-market method, discount method, etc.) and valuation exchange rate types (such as accounting exchange rate, end-of-day exchange rate, quotation market, transaction price, mid-price, etc.). Different transaction types, valuation methods and / or valuation exchange rate types correspond to different valuation scenarios, and the result data returned under different transaction types, different valuation methods and different valuation exchange rate types are not exactly the same.
[0004] Currently, when users query the valuation information of foreign exchange derivative transactions, they need to make multiple requests for different valuation scenarios of a transaction to obtain valuation data under different valuation scenarios (usually a query request needs to be made for each valuation scenario), and receive multiple returned result data (for each query request, the system calls the data and returns the result data once). Due to the wide variety of foreign exchange derivative transactions, and the diversity of valuation methods and valuation exchange rate types, the processing complexity of data calls and return results has increased. As an example, taking foreign exchange forwards as an example, if you need to obtain the forward valuation data of a transaction - for example, you need to obtain the valuation content of the foreign exchange forward under the discount method and the mark-to-market method, the end-of-day exchange rate, and the quotation market, the specific requests that need to be sent are as follows:
[0005] Request 1:
[0006] MarketIndicator=14#Foreign Exchange Forward
[0007] CalcMethod = 11#Discount method
[0008] ExecId = 5.1.0.234212#Business transaction number
[0009] ValuationDate = 20240223#Evaluation date
[0010] QueryParamType = AR# calculate exchange rate
[0011] Request 2:
[0012] MarketIndicator=14#Foreign Exchange Forward
[0013] CalcMethod = 11#Discount method
[0014] ExecId = 5.1.0.234212#Business transaction number
[0015] ValuationDate = 20240223#Evaluation date
[0016] QueryParamType = BR#end-of-day exchange rate
[0017] Request 3:
[0018] MarketIndicator=14#Foreign Exchange Forward
[0019] CalcMethod = 11#Discount method
[0020] ExecId = 5.1.0.234212#Business transaction number
[0021] ValuationDate = 20240223#Evaluation date
[0022] QueryParamType = CMDSLAST# Quotes
[0023] Request 4:
[0024] MarketIndicator=14#Foreign Exchange Forward
[0025] CalcMethod = 12#Market-to-Market Method
[0026] ExecId = 5.1.0.234212#Business transaction number
[0027] ValuationDate = 20240223#Evaluation date
[0028] QueryParamType = AR# calculate exchange rate
[0029] Request 5:
[0030] MarketIndicator=14#Foreign Exchange Forward
[0031] CalcMethod = 12#Market-to-Market Method
[0032] ExecId = 5.1.0.234212#Business transaction number
[0033] ValuationDate = 20240223#Evaluation date
[0034] QueryParamType = BR#end-of-day exchange rate
[0035] Request 6:
[0036] MarketIndicator=14#Foreign Exchange Forward
[0037] CalcMethod = 12#Market-to-Market Method
[0038] ExecId = 5.1.0.234212#Business transaction number
[0039] ValuationDate = 20240223#Evaluation date
[0040] QueryParamType = CMDSLAST# Quotes
[0041] That is, six query requests need to be sent (corresponding to the valuation data of six scenarios). For the six query requests, the trading system will call the data six times and return six result data when processing. For example, the six return results for the above-mentioned requests 1 to 6 are as follows:
[0042] Returns 1:
[0043] MarketIndicator=14#Foreign Exchange Forward
[0044] CalcMethod = 11#Discount method
[0045] ExecId = 5.1.0.234212#Business transaction number
[0046] ValuationDate = 20240223#Evaluation date
[0047] QueryParamType = AR# calculate exchange rate
[0048] ProfitLoss=432.11#Profit and loss
[0049] LocalPL = 323.12# Profit and loss converted to local currency
[0050] FrstCurrency=USD#Currency 1
[0051] FrstCurrencyAmnt=1000.00#Currency 1 amount
[0052] FrstCurrencyPresent=#Currency 1 current value
[0053] FrstCurrencyPresentLocal=#Currency 1 current value converted to local currency
[0054] FrstCurrencyDiscount=#Currency 1 discount factor
[0055] ScndCurrency=CNY#Currency 2
[0056] ScndCurrencyAmnt = #Currency 2 amount
[0057] ScndCurrencyPresent = #Currency 2 current value
[0058] ScndCurrencyPresentLocal = #Currency 2 current value converted to local currency
[0059] ScndCurrencyDiscount = #Currency2 discount factor
[0060] Return 2:
[0061] MarketIndicator=14#Foreign Exchange Forward
[0062] CalcMethod = 11#Discount method
[0063] ExecId = 5.1.0.234212#Business transaction number
[0064] ValuationDate = 20240223#Evaluation date
[0065] QueryParamType = BR#end-of-day exchange rate
[0066] ProfitLoss=412.11#Profit and loss
[0067] LocalPL = 313.12# Profit and loss converted into local currency
[0068] FrstCurrency=USD#Currency 1
[0069] FrstCurrencyAmnt=1000.00#Currency 1 amount FrstCurrencyPresent=#Currency 1 present value FrstCurrencyPresentLocal=#Currency 1 present value converted to local currency FrstCurrencyDiscount=#Currency 1 discount factor ScndCurrency=CNY#Currency 2 currency
[0070] ScndCurrencyAmnt=#Currency 2 amountScndCurrencyPresent=#Currency 2 present valueScndCurrencyPresentLocal=#Currency 2 present value discounted in local currencyScndCurrencyDiscount=#Currency 2 discount factorReturn 3:
[0071] MarketIndicator = 14#Foreign exchange forward CalcMethod = 11#Discount method
[0072] ExecId = 5.1.0.234212#Business transaction numberValuationDate = 20240223#Evaluation dateQueryParamType = CMDSLAST#Quotation priceProfitLoss = 462.31#Profit and loss
[0073] LocalPL = 343.12# Profit and loss converted to local currency
[0074] FrstCurrency=USD#Currency 1
[0075] FrstCurrencyAmnt=1000.00#Currency 1 amount FrstCurrencyPresent=#Currency 1 present value FrstCurrencyPresentLocal=#Currency 1 present value converted to local currency FrstCurrencyDiscount=#Currency 1 discount factor ScndCurrency=CNY#Currency 2 currency
[0076] ScndCurrencyAmnt=#Currency 2 amountScndCurrencyPresent=#Currency 2 present valueScndCurrencyPresentLocal=#Currency 2 present value discounted in local currencyScndCurrencyDiscount=#Currency 2 discount factorReturn 4:
[0077] MarketIndicator=14#Foreign exchange forwardCalcMethod=12#Market-to-market methodExecId=5.1.0.234212#Business transaction numberValuationDate=20240223#Valuation dateQueryParamType=AR#Calculation exchange rateProfitLoss=472.11#Total profit and loss (local currency)MaturityDate=#Maturity dateSpotDate=#Spot value dateSwapPoint=#Market-to-market swap pointLocalPL=#Market-to-market profit and loss
[0078] TrateType=T#Entire transactionValuationCurrency=USD#Currency 1CurrencyMTMPL=1000.00#Market-to-market profit and lossLocalMTMPL=#Market-to-market profit and loss (local currency)PresentValue=#Market-to-market profit and loss discountLocalPV=#Market-to-market profit and loss discount (local currency)DiscountRate=#Discount factor (original currency)Return 5:
[0079] MarketIndicator=14#Foreign exchange forwardCalcMethod=12#Market-to-market methodExecId=5.1.0.234212#Business transaction numberValuationDate=20240223#Valuation dateQueryParamType=BR#End-of-day exchange rateProfitLoss=442.31#Total profit and loss (local currency)MaturityDate=#Maturity dateSpotDate=#Spot value dateSwapPoint=#Market-to-market swap pointLocalPL=#Market-to-market profit and loss
[0080] TrateType=T#Entire transaction ValuationCurrency=USD#Currency 1 Currency MTMPL=1000.00#Market profit and loss LocalMTMPL=#Market profit and loss (local currency)
[0081] PresentValue = #Market-to-Market Profit and Loss Discount
[0082] LocalPV = #Market-to-Market Profit and Loss Discount (local currency)
[0083] DiscountRate = #Discount factor (original currency)
[0084] Returns 6:
[0085] MarketIndicator=14#Foreign Exchange Forward
[0086] CalcMethod = 12#Market-to-Market Method
[0087] ExecId = 5.1.0.234212#Business transaction number
[0088] ValuationDate = 20240223#Evaluation date
[0089] QueryParamType = CMDSLAST# Quotes
[0090] ProfitLoss = 502.13 # Total profit and loss (local currency)
[0091] MaturityDate = #Maturity date
[0092] SpotDate = #Spot Value Date
[0093] SwapPoint=#Market-to-Market Swap Points
[0094] LocalPL=#Market-to-Market Profit and Loss
[0095] TrateType = T# the entire transaction
[0096] ValuationCurrency=USD#Currency 1
[0097] MTMPL=1000.00#Market profit and loss
[0098] LocalMTMPL = #Market-to-Market Profit and Loss (local currency)
[0099] PresentValue = #Market-to-Market Profit and Loss Discount
[0100] LocalPV = #Market-to-Market Profit and Loss Discount (local currency)
[0101] DiscountRate = #Discount factor (original currency)
[0102] In the above process, the system needs to perform multiple data calls and multiple return result processing, and frequent data calls and return processing will undoubtedly increase the system burden. If you need to query the valuation content of multiple valuation exchange rate types of multiple foreign exchange derivatives under different valuation methods, you need to request the valuation data of each valuation exchange rate type under different valuation methods for each derivative trading variety. The number of data calls and data returns that the system needs to process increases exponentially, which greatly increases the system burden and easily leads to unstable system operation or failure; moreover, frequent data calls will also occupy computer resources and database resources, causing the system to respond slowly or freeze.
[0103] On the other hand, the fields of the data results in different valuation scenarios returned based on multiple requests are not the same. The numerous and scattered field display contents make it difficult for users to read, reducing the efficiency of users in reading and understanding valuation data. Summary of the invention
[0104] The purpose of the present invention is to overcome the deficiencies of the prior art and provide a method, device and system for calling foreign exchange derivative valuation data. The technical solution for calling foreign exchange derivative valuation data provided by the present invention first loads the valuation data of foreign exchange derivative transactions in advance to establish a valuation index library, and optimizes the request parameters of the business request at the same time. A query is performed in the valuation index library through the optimized request parameters, and data integration is performed according to the valuation data results returned by the valuation index library to obtain an integrated valuation message, and the integrated valuation message is returned to the requesting party once, which can realize a single call to return data results of multiple valuation scenarios, increase data call and processing efficiency, and reduce system burden. Furthermore, the present invention can, on the basis of reducing the call frequency, comprehensively use the field extensibility of JSON messages and other functions to return processing results better and more intuitively.
[0105] To achieve the above objectives, the present invention provides the following technical solutions:
[0106] A method for calling foreign exchange derivative valuation data comprises the following steps:
[0107] Extract valuation data within the institution and build a valuation index library;
[0108] Acquiring a request for a valuation service from a requester, wherein the request information includes request parameters for one or more valuation scenarios; optimizing the request parameters to obtain optimized request parameters;
[0109] Use the optimized request parameters to query the aforementioned valuation index library to obtain matching valuation data results;
[0110] The valuation data results obtained above are integrated to obtain an integrated valuation message, and the integrated valuation message is returned to the requesting party at one time; wherein, the common data and non-common data are integrated based on the field characteristics of the data.
[0111] Further, the valuation service request is a request for valuation content of valuation scenarios of all unexpired transactions under a transaction type, and the valuation scenarios of all unexpired transactions include a single valuation scenario of a single transaction, multiple valuation scenarios of a single transaction under different valuation methods and different valuation exchange rate types, or multiple valuation scenarios of multiple transactions under one valuation method or one valuation exchange rate type;
[0112] When the valuation service request includes multiple valuation scenarios, the optimization is: performing field processing on request parameters corresponding to different valuation scenarios to obtain request parameters capable of querying valuation contents of all valuation scenarios at one time.
[0113] Further, for multiple valuation scenarios of the same transaction under different valuation methods and different valuation exchange rate types, the valuation service request information sent by the requester includes request parameters for each valuation scenario respectively;
[0114] At this time, when optimizing the request parameters, field comparison is performed on the request parameters of each valuation scenario. After obtaining the common field information and non-common field information in the request parameters of all valuation scenarios through the field comparison, the common field information is extracted as the optimized request parameters.
[0115] Further, for multiple valuation scenarios of multiple transactions under the same valuation method and / or the same valuation exchange rate type, the valuation service request information sent by the requester includes request parameters for respectively requesting valuation contents under the same valuation scenario for different transactions;
[0116] At this time, when optimizing the request parameters, after obtaining the common field information and the non-common field information in the request parameters of all transactions through field comparison, the common field information is extracted as the optimized request parameters.
[0117] Furthermore, when the valuation service request includes multiple valuation scenarios, the matching valuation data results returned by the valuation index library include the valuation contents of the aforementioned multiple valuation scenarios;
[0118] The step of integrating the valuation data results includes: according to the valuation scenarios involved in the aforementioned valuation business request information, respectively obtaining the valuation contents of each valuation scenario from the matching valuation data results, and merging the common data and non-common data in the valuation contents according to the data field characteristics in the valuation contents of each valuation scenario; wherein the fields configured for the common data include the query request number, valuation date, reference currency, business transaction number, currency pair and transaction type, and other data are configured as non-common data, and after the non-common data is encapsulated into an array and a json big data string, an integrated valuation message is obtained;
[0119] The common fields in the integrated valuation message are displayed in front of the non-common fields; corresponding to multiple valuation scenarios, the integrated valuation message is configured with a corresponding number of arrays, and one valuation scenario corresponds to one array.
[0120] Furthermore, the fields of the non-common data are configured to include basic fields and derived fields, which are encapsulated in an array as a whole, and the array format is configured by a preset array start character and array end character;
[0121] The basic fields include valuation method, valuation exchange rate type, valuation gain / loss amount, and valuation gain / loss converted into local currency;
[0122] The derived field information uses a combined JSON field message to output other data that is not the basic field data through a JSON large data string.
[0123] Furthermore, when constructing the valuation index library, all unexpired data of each transaction product within the institution on that day are extracted in batches on a daily basis according to the set data extraction time point. For the extracted data, the full amount of data is landed in the interface index library according to different valuation methods and valuation exchange rate types, and then valuation index libraries of different dimensions are formed according to the transaction number, transaction product, valuation method and valuation exchange rate type information. The valuation day is the day when the data is extracted.
[0124] Furthermore, the valuation index library supports data reuse, which is as follows: for each trading product, after obtaining the valuation scenarios of all unexpired transactions of the trading product, the valuation data results of each valuation scenario are requested from the valuation index library, and the valuation data results are stored; when analyzing the valuation scenario information in the valuation business request issued by the requester, and determining that the same valuation scenario involves the same trading product, the aforementioned stored valuation data results corresponding to the valuation scenario are reused.
[0125] The present invention also provides a foreign exchange transaction valuation device, comprising:
[0126] Memory for storing computer programs;
[0127] A processor is used to implement the steps of any of the methods described above when executing the computer program.
[0128] The present invention also provides a foreign exchange transaction data system, the system comprising a foreign exchange valuation data processing device, the device comprising:
[0129] Initialization module, used to extract valuation data within the institution and build a valuation index library;
[0130] A request optimization module, used to obtain the valuation service request information of the requester, wherein the request information includes request parameters for one or more valuation scenarios; optimize the request parameters to obtain optimized request parameters;
[0131] A query module is used to obtain optimization request parameters, and use the optimization request parameters to query the aforementioned valuation index library to obtain matching valuation data results;
[0132] The result output module is used to integrate the valuation data results obtained above to obtain an integrated valuation message, and return the integrated valuation message to the requesting party at one time; wherein, the common data and non-common data are integrated based on the field characteristics of the data.
[0133] Due to the adoption of the above technical scheme, the present invention has the following advantages and positive effects compared with the prior art, as an example: the technical scheme for calling foreign exchange derivative valuation data provided by the present invention first establishes a valuation index library by loading the valuation data of foreign exchange derivative transactions in advance, and optimizes the request parameters of the business request at the same time, performs a query in the valuation index library through the optimized request parameters, and integrates the data according to the valuation data results returned by the valuation index library to obtain an integrated valuation message, and returns the integrated valuation message to the requester at one time, which can realize the return of data results of multiple valuation scenarios in a single call, increase data call and processing efficiency, and reduce system burden.
[0134] Furthermore, on the basis of reducing the calling frequency, the present invention comprehensively utilizes the functions such as field extensibility of the JSON message to return the processing result better and more intuitively. BRIEF DESCRIPTION OF THE DRAWINGS
[0135] Figure 1 A flow chart of a method for calling foreign exchange derivative valuation data provided by an embodiment of the present invention.
[0136] Figure 2 A schematic diagram of data loading of a valuation index library provided in an embodiment of the present invention.
[0137] Figure 3 A schematic diagram of a process for obtaining and returning matching valuation results through a valuation index library provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0138] The following is a further detailed description of the method, device and system for calling foreign exchange derivative valuation data disclosed in the present invention in conjunction with the accompanying drawings and specific embodiments. It should be noted that the technology (including methods and devices) known to ordinary technicians in the relevant field may not be discussed in detail, but in appropriate cases, the above-mentioned known technology is considered to be part of the specification. At the same time, other examples of exemplary embodiments may have different values. The structures, proportions, sizes, etc. illustrated in the drawings of this specification are only used to match the contents disclosed in the specification for people familiar with this technology to understand and read, and are not used to limit the limiting conditions for the implementation of the invention.
[0139] In the description of the embodiments of the present application, " / " means or, and "and / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" means: A and B exist alone, B exists alone, and A and B exist at the same time. In the description of the embodiments of the present application, "multiple" means two or more.
[0140] Terminology explanation:
[0141] 1) Foreign exchange derivative transactions: foreign exchange forwards, foreign exchange swaps, foreign exchange options, foreign exchange currency swaps, foreign exchange interest rate swaps, etc.
[0142] 2) JSON: (JavaScript Object Notation) is a lightweight data exchange format. It is based on a subset of ECMAScript (the js specification developed by the European Computer Manufacturers Association) and uses a text format that is completely independent of the programming language to store and represent data.
[0143] 3) Business transaction number: the unique number of a derivative transaction.
[0144] 4) Valuation date: the valuation date of foreign exchange derivative transactions.
[0145] 5) Forward foreign exchange valuation mark-to-market method: All valuation calculations are performed using currency 2 as the denominated currency unit. If NPV denominated in currency 1 is required, simply multiply or divide by the marked-to-market exchange rate.
[0146] 6) Foreign exchange forward valuation discount method: In the calculation of foreign exchange forward valuation, the discount method does not involve the calculation of net cash flow discount. Instead, it directly converts the PV present value of the principal amount denominated in currency 1 discounted by the discount factor of currency 1 into currency 2 using the forward exchange rate, and adds it to the PV present value of the principal amount denominated in currency 2 discounted by the discount factor of currency 2 to obtain the final NPV.
[0147] 7) Marking-to-Market Method for Foreign Exchange Swap Valuation: When calculating NPV using the marking-to-market method, the swap contract needs to be split into two foreign exchange forward contracts, one near-end and one far-end, and the present value PV is calculated for each contract, and the sum is finally added up to get the swap NPV.
[0148] The technical concept and solution of the present invention are introduced below based on exemplary application scenarios.
[0149] Example
[0150] In the existing foreign exchange trading system, foreign exchange derivative valuation messages are usually processed separately according to the transaction types (such as foreign exchange forwards, foreign exchange swaps, foreign exchange options, foreign exchange structured options, foreign exchange currency swaps, foreign exchange interest rate swaps, etc.), valuation methods (such as commonly used valuation methods include mark-to-market method, discount method, etc.), valuation exchange rate type (such as accounting exchange rate, end-of-day exchange rate, quotation market, transaction price, mid-price, etc.) and other information to handle the corresponding valuation scenarios separately, and handle different contents separately for different valuation scenarios. When the transaction types, valuation methods, and valuation exchange rate types change, the valuation scenarios also change.
[0151] The result data returned under different transaction types, different valuation methods and different valuation exchange rate types are not the same. Taking forward valuation as an example, when using the discount method for valuation, the fields presented in the returned valuation message can usually include: query request number, valuation date, reference currency, business transaction number, currency pair, profit and loss calculation method, profit and loss amount, profit and loss discount to local currency, currency 1, currency 1 transaction amount, currency 1 present value, currency 1 present value discount to local currency, currency 1 discount factor, currency 2, currency 2 transaction amount, currency 2 present value, currency 2 present value discount to local currency, currency 2 discount factor, etc. When the mark-to-market method is used for valuation, the fields presented in the valuation message may usually include: query request number, valuation date, reference currency, business transaction number, currency pair, profit and loss calculation method, total profit and loss (local currency), maturity date, spot value date, mark-to-market swap point, transaction mark-to-market profit and loss, T:Trade whole transaction, original currency, original currency mark-to-market profit and loss, original currency mark-to-market profit and loss (local currency), original currency mark-to-market profit and loss discount, original currency mark-to-market profit and loss discount (local currency), discount factor (original currency), etc. It can be seen that some fields in the returned result data are the same, some fields are different, and the same field may have different data contents due to different valuation methods.
[0152] If the valuation contents of foreign exchange forward and foreign exchange swap market marking, discount method exchange rate, end-of-day exchange rate, etc. are needed at the same time, the user needs to make repeated requests multiple times, and the system needs to make multiple data calls and return structured data according to the multiple requests. The present invention improves the above-mentioned prior art and proposes a standardized method for calling foreign exchange derivative valuation data, through which the valuation data under multiple valuation scenarios can be returned through a single call.
[0153] For details, see Figure 1 As shown, a method for calling foreign exchange derivative valuation data provided by this embodiment includes the following steps.
[0154] S100, extract valuation data within the institution and build a valuation index library.
[0155] S200, obtaining a valuation service request information for foreign exchange derivatives issued by a requesting party, wherein the request information includes request parameters for one or more valuation scenarios; optimizing the request parameters to obtain optimized request parameters.
[0156] S300, using the optimized request parameters to query the aforementioned valuation index library to obtain matching valuation data results.
[0157] S400, integrating the valuation data results obtained above to obtain an integrated valuation message, and returning the integrated valuation message to the requesting party at one time. The common data and the non-common data are integrated based on the field characteristics of the data.
[0158] Specifically, when constructing the valuation index library in step S100, all unexpired data of each transaction type in the institution on that day can be extracted in batches on a daily basis according to the set data extraction time point. For the extracted data, according to different valuation methods (such as mark-to-market method, discount method, etc.) and valuation exchange rate types (such as accounting exchange rate, end-of-day exchange rate, quotation market, etc.), the full amount of data is landed in the interface index library for data integration to construct the valuation database on the evaluation day, and the evaluation day is the day when the data is extracted. The valuation database on the evaluation day is for use by the requesting party.
[0159] Preferably, when constructing the valuation index library for the valuation date, valuation index libraries for the valuation date of different dimensions can be formed according to information such as transaction number, transaction type, valuation method, and valuation exchange rate type. For example, a valuation index library of the transaction number dimension can be formed according to the transaction number; or a valuation index library of the transaction type dimension can be formed according to the transaction type. Optionally, the valuation index library supports dimension customization, so that users can configure one or more dimensions of the valuation index library as needed.
[0160] Take the construction of the valuation index library of the trading product dimension as an example. For example, for foreign exchange forward trading products, see Figure 2 As shown, when extracting data to build the corresponding valuation index library on the valuation date, the data that needs to be extracted include the accounting exchange rate valuation data when the foreign exchange forward is valued using the mark-to-market method on the valuation date, the end-of-day exchange rate valuation data when the foreign exchange forward is valued using the mark-to-market method on the valuation date, the quoted market valuation data when the foreign exchange forward is valued using the mark-to-market method on the valuation date, the accounting exchange rate valuation data when the foreign exchange forward is valued using the discount method on the valuation date, the end-of-day exchange rate valuation data when the foreign exchange forward is valued using the discount method on the valuation date, and the quoted market valuation data when the foreign exchange forward is valued using the discount method on the valuation date.
[0161] In this embodiment, the valuation service request may be a request for the valuation content of the valuation scenarios of all unexpired transactions under a transaction type. The valuation scenarios of all unexpired transactions may include a single valuation scenario of a single transaction, multiple valuation scenarios of a single transaction under different valuation methods and different valuation exchange rate types, and multiple valuation scenarios of multiple transactions under one valuation method or one valuation exchange rate type.
[0162] When the valuation service request includes multiple valuation scenarios, the optimization is: performing field processing on request parameters corresponding to different valuation scenarios to obtain request parameters capable of querying valuation contents of all valuation scenarios at one time.
[0163] Specifically, for multiple valuation scenarios of the same transaction under different valuation methods and different valuation exchange rate types, the valuation service request information sent by the requesting party includes request parameters for each valuation scenario. At this time, when optimizing the request parameters, the request parameters of each valuation scenario are compared by fields, and after obtaining the common field information and non-common field information in the request parameters of all valuation scenarios through the field comparison, the common field information is extracted as the optimized request parameters.
[0164] For multiple valuation scenarios under the same valuation method and / or the same valuation exchange rate type for multiple transactions, the valuation service request information sent by the requester includes request parameters for requesting the valuation content under the same valuation scenario for different transactions. At this time, when optimizing the request parameters, after obtaining the common field information and non-common field information in the request parameters of all transactions through field comparison, the common field information is extracted as the optimization request parameter.
[0165] The following describes the specific implementation method of optimizing request parameters by taking multiple valuation scenarios of the same transaction under different valuation methods and different valuation exchange rate types as an example.
[0166] For example, a valuation service request sent by a user includes request parameters for six valuation scenarios, as follows:
[0167] Request 1:
[0168] MarketIndicator=14#Foreign Exchange Forward
[0169] CalcMethod = 11#Discount method
[0170] ExecId = 5.1.0.234212#Business transaction number
[0171] ValuationDate = 20240223#Evaluation date
[0172] QueryParamType = AR# calculate exchange rate
[0173] Request 2:
[0174] MarketIndicator=14#Foreign Exchange Forward
[0175] CalcMethod = 11#Discount method
[0176] ExecId = 5.1.0.234212#Business transaction number
[0177] ValuationDate = 20240223#Evaluation date
[0178] QueryParamType = BR#end-of-day exchange rate
[0179] Request 3:
[0180] MarketIndicator=14#Foreign Exchange Forward
[0181] CalcMethod = 11#Discount method
[0182] ExecId = 5.1.0.234212#Business transaction number
[0183] ValuationDate = 20240223#Evaluation date
[0184] QueryParamType = CMDSLAST# Quotes
[0185] Request 4:
[0186] MarketIndicator=14#Foreign Exchange Forward
[0187] CalcMethod = 12#Market-to-Market Method
[0188] ExecId = 5.1.0.234212#Business transaction number
[0189] ValuationDate = 20240223#Evaluation date
[0190] QueryParamType = AR# calculate exchange rate
[0191] Request 5:
[0192] MarketIndicator=14#Foreign Exchange Forward
[0193] CalcMethod = 12#Market-to-Market Method
[0194] ExecId = 5.1.0.234212#Business transaction number
[0195] ValuationDate = 20240223#Evaluation date
[0196] QueryParamType = BR#end-of-day exchange rate
[0197] Request 6:
[0198] MarketIndicator=14#Foreign Exchange Forward
[0199] CalcMethod = 12#Market-to-Market Method
[0200] ExecId = 5.1.0.234212#Business transaction number
[0201] ValuationDate = 20240223#Evaluation date
[0202] QueryParamType = CMDSLAST# Quotes
[0203] When optimizing the request parameters of the aforementioned six valuation scenarios, first perform field comparison on each field of the request parameters of the six valuation scenarios. Through the field comparison, obtain the common field information in the request parameters of all valuation scenarios, including the transaction type field MarketIndicator=14, the business transaction number field ExecId=5.1.0.234212 and the valuation date field ValuationDate=20240223, as well as non-common field information, including the valuation method field and the valuation exchange rate type field. Extract the common field information as the optimization request parameter. The configuration information of the optimization request parameter is as follows:
[0204] MarketIndicator=14#Foreign Exchange Forward
[0205] ExecId = 5.1.0.234212#Business transaction number
[0206] ValuationDate = 20240223#Evaluation date
[0207] Then, the above optimized request parameters are used to query the valuation index library to obtain matching valuation data results. This query process only requires one data call in the valuation index library.
[0208] For the above optimization request parameters, the matching valuation data results returned by the valuation index library include the valuation content of all the above valuation scenarios. At this time, the valuation data results need to be processed to meet the valuation service request issued by the requester.
[0209] Specifically, the step of integrating the valuation data results includes: according to the valuation scenarios involved in the aforementioned valuation business request information, respectively obtaining the valuation content of each valuation scenario from the matching valuation data results, and merging the common data and non-common data in the valuation content according to the data field characteristics in the valuation content of each valuation scenario.
[0210] The fields configured with common data may include query request number, valuation date, reference currency, business transaction number, currency pair and transaction type; other fields are configured with non-common data. After the non-common data is encapsulated into an array and a json big data string, an integrated valuation message is obtained.
[0211] Preferably, the common fields in the integrated valuation message are displayed before the non-common fields. Corresponding to multiple valuation scenarios, the integrated valuation message is configured with a corresponding number of arrays, one valuation scenario corresponding to one array.
[0212] In this embodiment, the fields of the non-common data are preferably configured to include basic fields and derived fields. The basic field and derived field data are encapsulated as a whole in an array, and the array format is configured by preset array start and array end characters.
[0213] The basic fields include valuation method, valuation exchange rate type, valuation gain or loss amount, and valuation gain or loss converted into local currency.
[0214] The derived field information uses a combined JSON field message to output other data that is not the basic field data through a JSON large data string.
[0215] As an example, taking two valuation scenarios as an example, the general data format of the returned valuation message can be as follows:
[0216] Query Request Number Field
[0217] Valuation Date Field
[0218] Reference currency field
[0219] Business transaction number field
[0220] Currency Pair Field
[0221] Transaction Type Field
[0222] Array format - start (starting character)
[0223] Profit and loss calculation method
[0224] Valuation rate type
[0225] Profit and loss amount
[0226] Profit and loss in local currency
[0227] Derived fields (combined json field message)
[0228] Array format - end (terminator)
[0229] Array format - start (starting character)
[0230] Profit and loss calculation method
[0231] Valuation rate type
[0232] Profit and loss amount
[0233] Profit and loss in local currency
[0234] Derived fields (combined json field message)
[0235] Array format - end (terminator)
[0236] Preferably, the preset array start character and array end character may adopt the same string, for example, List-List is adopted to construct the array format.
[0237] As an example but not a limitation, take foreign exchange forward as an example. If the valuation data results returned by the valuation index library include the valuation content of the foreign exchange forward's accounting exchange rate under the discount method and the mark-to-market method, the end-of-day exchange rate, and the quotation market, the returned integrated valuation message can be as follows:
[0238] RequestNumber=******#Query request number
[0239] ValuationDate#Evaluation date
[0240] Currency
[0241] ExecId#Business transaction number
[0242] Symbol#Currency Pair
[0243] MarketIndicator#Forex Forward
[0244] List
[0245] CalcMethod = 11# Valuation method
[0246] QueryParamType = AR# exchange rate type
[0247] ProfitLost#Valuation profit and loss
[0248] LocalPL# Valuation profit and loss converted into local currency
[0249] ExtendCodes = {
[0250] FrstCurrency=USD#Currency 1
[0251] FrstCurrencyAmnt=1000.00#Currency 1 amount
[0252] FrstCurrencyPresent=#Currency 1 current value
[0253] FrstCurrencyPresentLocal=#Currency 1 current value converted to local currency
[0254] FrstCurrencyDiscount=#Currency 1 discount factor
[0255] ScndCurrency=CNY#Currency 2
[0256] ScndCurrencyAmnt = #Currency 2 amount
[0257] ScndCurrencyPresent = #Currency 2 current value
[0258] ScndCurrencyPresentLocal = #Currency 2 current value converted to local currency
[0259] ScndCurrencyDiscount = #Currency2 discount factor
[0260] }#derived fields (json fields)
[0261] List
[0262] List
[0263] CalcMethod = 11# Valuation method
[0264] QueryParamType = BR# exchange rate type
[0265] ProfitLost#Valuation profit and loss
[0266] LocalPL# Valuation profit and loss converted into local currency
[0267] ExtendCodes = {
[0268] FrstCurrency=USD#Currency 1
[0269] FrstCurrencyAmnt=1000.00#Currency 1 amount FrstCurrencyPresent=#Currency 1 present value FrstCurrencyPresentLocal=#Currency 1 present value converted to local currency FrstCurrencyDiscount=#Currency 1 discount factor ScndCurrency=CNY#Currency 2 currency
[0270] ScndCurrencyAmnt=#Currency 2 amountScndCurrencyPresent=#Currency 2 present valueScndCurrencyPresentLocal=#Currency 2 present value discounted in local currencyScndCurrencyDiscount=#Currency 2 discount factor
[0271] }#derived fields (json fields)
[0272] List
[0273] List
[0274] CalcMethod = 11# Valuation method
[0275] QueryParamType = CMDSLAST# exchange rate type
[0276] ProfitLost#Valuation profit and loss
[0277] LocalPL# Valuation profit and loss converted into local currency
[0278] ExtendCodes = {
[0279] FrstCurrency=USD#Currency 1
[0280] FrstCurrencyAmnt=1000.00#Currency 1 amount FrstCurrencyPresent=#Currency 1 present value FrstCurrencyPresentLocal=#Currency 1 present value converted to local currency FrstCurrencyDiscount=#Currency 1 discount factor ScndCurrency=CNY#Currency 2 currency
[0281] ScndCurrencyAmnt=#Currency 2 amountScndCurrencyPresent=#Currency 2 present valueScndCurrencyPresentLocal=#Currency 2 present value discounted in local currencyScndCurrencyDiscount=#Currency 2 discount factor
[0282] }#derived fields (json fields)
[0283] List
[0284] List
[0285] CalcMethod = 12#Evaluation method
[0286] QueryParamType = AR# exchange rate type
[0287] ProfitLost#Valuation profit and loss
[0288] LocalPL# Valuation profit and loss converted into local currency
[0289] ExtendCodes = {
[0290] MaturityDate = #Maturity Date SpotDate = #Spot Value Date SwapPoint = #Market Swap Point LocalPL = #Market Profit and Loss
[0291] TrateType = T# the entire transaction
[0292] ValuationCurrency=USD#Currency 1CurrencyMTMPL=1000.00#Market profit and lossLocalMTMPL=#Market profit and loss (local currency)
[0293] PresentValue = #Market-to-Market Profit and Loss DiscountLocalPV = #Market-to-Market Profit and Loss Discount (local currency)DiscountRate = #Discount Factor (original currency)
[0294] }#derived fields (json fields)
[0295] List
[0296] List
[0297] CalcMethod = 12#Evaluation method
[0298] QueryParamType = BR# exchange rate type
[0299] ProfitLost#Valuation profit and loss
[0300] LocalPL# Valuation profit and loss converted into local currency
[0301] ExtendCodes = {
[0302] MaturityDate = #Maturity Date SpotDate = #Spot Value Date SwapPoint = #Market Swap Point LocalPL = #Market Profit and Loss
[0303] TrateType = T# the entire transaction
[0304] ValuationCurrency=USD#Currency 1CurrencyMTMPL=1000.00#Market profit and lossLocalMTMPL=#Market profit and loss (local currency)
[0305] PresentValue = #Market-to-Market Profit and Loss DiscountLocalPV = #Market-to-Market Profit and Loss Discount (local currency)DiscountRate = #Discount Factor (original currency)
[0306] }#derived fields (json fields)
[0307] List
[0308] List
[0309] CalcMethod = 12#Evaluation method
[0310] QueryParamType = CMDSLAST # Exchange rate type ProfitLost # Valuation profit and loss
[0311] LocalPL# Valuation profit and loss converted into local currency
[0312] ExtendCodes = {
[0313] MaturityDate = #Maturity date
[0314] SpotDate = #Spot Value Date
[0315] SwapPoint=#Market-to-Market Swap Points
[0316] LocalPL=#Market-to-Market Profit and Loss
[0317] TrateType = T# the entire transaction
[0318] ValuationCurrency=USD#Currency 1
[0319] MTMPL=1000.00#Market profit and loss
[0320] LocalMTMPL = #Market-to-Market Profit and Loss (local currency)
[0321] PresentValue = #Market-to-Market Profit and Loss Discount
[0322] LocalPV = #Market-to-Market Profit and Loss Discount (local currency)
[0323] DiscountRate = #Discount factor (original currency)
[0324] }#derived fields (json fields)
[0325] List
[0326] The above-mentioned integrated valuation message including multiple valuation scenarios is returned to the requester at one time. As follows, the valuation message can be easily fed back to the requester. Compared with the existing scheme of multiple calls to data and multiple returns of data, the valuation data processing method provided by the present invention supports returning the valuation data of multiple valuation scenarios in the form of an array link. On the one hand, by pre-loading the valuation data of foreign exchange derivative transactions to establish a valuation index library, and building the index library by pre-loading data, the interaction efficiency is improved and the call stickiness is increased. On the other hand, the request parameters can be optimized by extracting the common fields of multiple request parameters, and the optimized request parameters are used to perform a query in the valuation index library to obtain the data content of multiple valuation scenarios; at the same time, data integration is performed according to the valuation data results returned by the valuation index library to obtain the integrated valuation messages corresponding to multiple valuation scenarios. During integration, the common fields ProfitLoss and LocalPL are extracted, and the non-common fields are further divided into basic fields and derived fields, so that the non-basic data in the non-common fields are placed in the derived fields in json format; then the integrated valuation message is returned to the requester at one time. In this way, it is possible to return data results for multiple valuation scenarios in a single call, increase data call and processing efficiency, and reduce system burden.
[0327] Optionally, the user can also customize the parameter method for obtaining valuation data as needed to obtain valuation data that best matches the valuation result.
[0328] Preferably, the valuation index library provided by the present invention also supports data reuse. The data reuse is as follows: for each trading variety, after obtaining the valuation scenarios of all unexpired transactions of the trading variety, the valuation data results of each valuation scenario are requested from the valuation index library, and the valuation data results are stored; the valuation scenario information in the valuation business request issued by the requester is analyzed, and when it is determined that the same valuation scenario involves the same trading variety, the aforementioned stored valuation data results corresponding to the valuation scenario are directly reused. In this way, under the same valuation scenario of the same trading variety, the valuation return content of each transaction can provide reuse rules, and the valuation data results returned by the valuation index library can be directly used without the need for additional development.
[0329] Another embodiment of the present invention further provides a foreign exchange transaction valuation device.
[0330] The device includes a memory and a processor.
[0331] The memory is used to store computer programs;
[0332] The processor is used to implement the steps of any of the methods described above when executing the computer program.
[0333] For other technical features, please refer to the description of the previous embodiment and will not be repeated here.
[0334] Another embodiment of the present invention further provides a foreign exchange transaction data system, which includes a foreign exchange valuation data processing device.
[0335] The foreign exchange valuation data processing device includes an initialization module, a request optimization module, a query module and a result output module.
[0336] The initialization module is used to extract valuation data within the organization and build a valuation index library.
[0337] The request optimization module is used to obtain the valuation service request information of the requester, wherein the request information includes request parameters for one or more valuation scenarios; and optimize the request parameters to obtain optimized request parameters.
[0338] The query module is used to obtain optimization request parameters, and use the optimization request parameters to query the aforementioned valuation index library to obtain matching valuation data results.
[0339] The result output module is used to integrate the valuation data results obtained above to obtain an integrated valuation message, and return the integrated valuation message to the requesting party at one time; wherein, the common data and non-common data are integrated based on the field characteristics of the data.
[0340] For other technical features, please refer to the description of the previous embodiment and will not be repeated here.
[0341] The present invention also provides a computer-readable storage medium for storing a computer program that can be executed by a processing unit, wherein the computer program implements the above-mentioned method when executed by the processing unit.
[0342] The storage medium may include any medium that can store program codes, such as a USB flash drive, a mobile hard disk, a read only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0343] For other technical features, please refer to the description of the previous embodiment and will not be repeated here.
[0344] In the above description, the disclosure of the present invention is not intended to limit itself to these aspects. Rather, within the scope of the target protection of the present disclosure, the components can be selectively and operatively combined in any number. In addition, terms such as "include", "encompass" and "have" should be interpreted as inclusive or open by default, rather than exclusive or closed, unless they are explicitly defined to the contrary. All technical, scientific or other terms are consistent with the meanings understood by those skilled in the art, unless they are defined to the contrary. Common terms found in dictionaries should not be interpreted too idealistically or too impractically in the context of relevant technical documents, unless the present disclosure explicitly defines them as such. Any changes and modifications made by a person of ordinary skill in the field of the present invention based on the above disclosure belong to the scope of protection of the claims.
Claims
1. A method for calling foreign exchange derivative valuation data, characterized in that Includes steps: Extract valuation data within the institution and build a valuation index library; Acquire the valuation service request information of the requester, wherein the request information includes request parameters for multiple valuation scenarios; optimize the request parameters to obtain optimized request parameters; the optimization is: perform field processing on the request parameters corresponding to different valuation scenarios to obtain request parameters that can query the valuation contents of all valuation scenarios at one time; Use the optimized request parameters to query the aforementioned valuation index library to obtain matching valuation data results; The valuation data results obtained above are integrated to obtain an integrated valuation message, and the integrated valuation message is returned to the requesting party at one time; wherein the common data and the non-common data are integrated based on the field characteristics of the data; corresponding to multiple valuation scenarios, the integrated valuation message is configured with a corresponding number of arrays, and one valuation scenario corresponds to one array; During integration, common fields are extracted and non-common fields are divided into basic fields and derived fields. The basic fields and derived fields of a valuation scenario are encapsulated as a whole in an array, and the array format is configured by preset array start and array end characters; the derived field information uses a combined json field message, and the data of the derived field is output through a json big data string.
2. The method according to claim 1, characterized in that: The valuation business request is for requesting the valuation content of the valuation scenarios of all unexpired transactions under a transaction product. The valuation scenarios of all unexpired transactions include multiple valuation scenarios of a single transaction under different valuation methods and different valuation exchange rate types, or multiple valuation scenarios of multiple transactions under one valuation method and / or one valuation exchange rate type.
3. The method according to claim 2, characterized in that: For multiple valuation scenarios of the same transaction under different valuation methods and different valuation exchange rate types, the valuation service request information sent by the requester includes request parameters for each valuation scenario respectively; At this time, when optimizing the request parameters, field comparison is performed on the request parameters of each valuation scenario. After obtaining the common field information and non-common field information in the request parameters of all valuation scenarios through the field comparison, the common field information is extracted as the optimized request parameters.
4. The method according to claim 2, characterized in that: For multiple valuation scenarios of multiple transactions under the same valuation method and / or the same valuation exchange rate type, the valuation service request information sent by the requester includes request parameters for requesting valuation content under the same valuation scenario for different transactions respectively; At this time, when optimizing the request parameters, after obtaining the common field information and the non-common field information in the request parameters of all transactions through field comparison, the common field information is extracted as the optimized request parameters.
5. The method according to any one of claims 2 to 4, characterized in that: The matching valuation data results returned by the valuation index library include the valuation contents of the aforementioned multiple valuation scenarios; The step of integrating the valuation data results includes: according to the valuation scenarios involved in the aforementioned valuation business request information, respectively obtaining the valuation contents of each valuation scenario from the matching valuation data results, and merging the common data and non-common data in the valuation contents according to the data field characteristics in the valuation contents of each valuation scenario; wherein the fields configured with the common data include the query request number, valuation date, reference currency, business transaction number, currency pair and transaction type, and the data in other fields are configured as non-common data, and after the non-common data is encapsulated into an array and a json big data string, an integrated valuation message is obtained; Common fields in the consolidated valuation message appear before non-common fields.
6. The method according to claim 5, characterized in that: The basic fields include valuation method, valuation exchange rate type, valuation gain or loss amount, and valuation gain or loss converted into local currency.
7. The method according to claim 1, characterized in that: When constructing the valuation index library, all unexpired data of each transaction product within the institution on that day are extracted in batches on a daily basis according to the set data extraction time point. For the extracted data, the full amount of data is landed in the interface index library according to different valuation methods and valuation exchange rate types, and then valuation index libraries of different dimensions are formed according to the transaction number, transaction product, valuation method and valuation exchange rate type information. The valuation day is the day when the data is extracted.
8. The method according to claim 1, characterized in that: The valuation index library supports data reuse, which is as follows: for each trading product, after obtaining the valuation scenarios of all unexpired transactions of the trading product, the valuation data results of each valuation scenario are requested from the valuation index library, and the valuation data results are stored; when analyzing the valuation scenario information in the valuation business request issued by the requester and determining that the same valuation scenario involves the same trading product, the aforementioned stored valuation data results corresponding to the valuation scenario are reused.
9. A foreign exchange transaction valuation device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the method according to any one of claims 1 to 8 when executing the computer program.
10. A foreign exchange transaction data system, characterized in that: The system comprises a foreign exchange valuation data processing device, the device comprising: Initialization module, used to extract valuation data within the institution and build a valuation index library; A request optimization module is used to obtain the valuation service request information of the requester, wherein the request information includes request parameters for multiple valuation scenarios; optimize the request parameters to obtain optimized request parameters; the optimization is: performing field processing on the request parameters corresponding to different valuation scenarios to obtain request parameters that can query the valuation contents of all valuation scenarios at one time; A query module is used to obtain optimization request parameters, and use the optimization request parameters to query the aforementioned valuation index library to obtain matching valuation data results; A result output module is used to integrate the valuation data results obtained above to obtain an integrated valuation message, and return the integrated valuation message to the requester at one time; wherein the common data and the non-common data are integrated based on the field characteristics of the data; corresponding to multiple valuation scenarios, the integrated valuation message is configured with a corresponding number of arrays, and one valuation scenario corresponds to one array; During integration, common fields are extracted and non-common fields are divided into basic fields and derived fields. The basic fields and derived fields of a valuation scenario are encapsulated as a whole in an array, and the array format is configured by preset array start and array end characters; the derived field information uses a combined json field message, and the data of the derived field is output through a json big data string.
Citation Information
Patent Citations
Compressed graph construction method and device based on relational data
CN114443686A