Risk information generation method and device, electronic equipment and storage medium

By integrating multiple risk pricing engines in the dynamic link library and using the JNI interface to quantify the risk of target products, the problem of inaccurate risk information in financial institutions in transactions is solved, the objectivity and accuracy of risk information is achieved, and risk management that quickly responds to market changes is supported.

CN120278519APending Publication Date: 2025-07-08CSC FINANCIAL CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510425874.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-07
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

When financial institutions conduct financial product transactions, the objectivity and accuracy of risk information in the existing technology are affected by human subjective factors, resulting in inaccurate risk assessment.

Method used

By integrating multiple risk pricing engines in the dynamic link library, selecting the applicable risk pricing engine according to the target product type, using the JNI interface to call the engine for risk quantification, generating risk prices and quantitative indicators, avoiding the situation where human experience involves multiple products in a single engine.

Benefits of technology

It improves the objectivity and accuracy of risk information, reduces judgment bias, supports rapid response to market changes and achieves efficient risk management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120278519A_ABST
    Figure CN120278519A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a risk information generation method and device, electronic equipment and a storage medium, and relates to the technical field of data processing, and the method comprises the steps: responding to a risk pricing request for a target product, and according to the risk pricing information, carried in the risk pricing request, of the target product, generating risk information of the target product; determining a first risk pricing engine used for carrying out risk quantification on the target product from a plurality of risk pricing engines stored in the first dynamic link library; calling a first risk pricing engine through a JNI interface of the first risk pricing engine by taking the risk pricing information as a calling parameter; and obtaining a risk price of the target product output by the first risk pricing engine by taking the risk pricing information as input information and a first risk quantitative index of the target product at the risk price, and obtaining risk information of the target product including the risk price and the first risk quantitative index. By applying the scheme provided by the embodiment of the invention, the risk information with strong objectivity and high accuracy can be generated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and particularly to a method, apparatus, electronic device, and storage medium for generating risk information. Background Art

[0002] When financial institutions conduct financial product trading business, they are easily affected by various market factors. There may be risks when trading financial products, resulting in losses. Therefore, before conducting financial product trading, financial institutions expect to understand relevant risk information.

[0003] Currently, the staff of financial institutions generally understand risk information based on experience or from the Internet. However, no matter which of the above methods, it is limited by human subjective factors such as human experience and information volume, resulting in low objectivity and poor accuracy of the risk information obtained by the staff of financial institutions. Summary of the Invention

[0004] The purpose of the embodiments of the present invention is to provide a method, apparatus, electronic device, and storage medium for generating risk information to enhance the objectivity of the obtained risk information and improve the accuracy of the obtained risk information. The specific technical solutions are as follows:

[0005] In the first aspect of the embodiments of the present invention, a method for generating risk information is provided. The method includes:

[0006] In response to a risk pricing request for a target product, according to the risk pricing information of the target product carried in the risk pricing request, determine a first risk pricing engine for risk quantification of the target product from multiple risk pricing engines stored in a first dynamic link library;

[0007] Use the risk pricing information as a call parameter, and call the first risk pricing engine through the JNI interface of the first risk pricing engine;

[0008] Obtain the risk price of the target product output by the first risk pricing engine with the risk pricing information as input information, and the first risk quantification index of the target product at the risk price, and obtain the risk information of the target product including the risk price and the first risk quantification index.

[0009] In an embodiment of the present invention, the step of determining a first risk pricing engine for risk quantification of the target product from multiple risk pricing engines stored in a first dynamic link library according to the risk pricing information of the target product carried in the risk pricing request includes:

[0010] Parse the risk pricing information of the target product carried in the risk pricing request to obtain the first product type included in the risk pricing information;

[0011] Determine the first risk pricing engine corresponding to the first product type from multiple risk pricing engines stored in the first dynamic link library.

[0012] In one embodiment of the present invention, the first risk quantification index includes at least one of the following indexes:

[0013] The first sensitivity of the risk price to the price change of the target product underlying;

[0014] The second sensitivity of the first sensitivity to the price change of the target product underlying;

[0015] The third sensitivity of the risk price to the change of the trading deadline;

[0016] The fourth sensitivity of the risk price to the change of the price volatility of the target product underlying;

[0017] The fifth sensitivity of the risk price to the change of interest rate.

[0018] In one embodiment of the present invention, the method further includes:

[0019] If the first risk pricing engine does not exist in the first dynamic link library, obtain a dynamic link library containing the first risk pricing engine, and update the local first dynamic link library with the obtained dynamic link library to obtain a new first dynamic link library;

[0020] Wherein, the dynamic link library containing the first risk pricing engine is obtained in the following manner:

[0021] Obtain the source code of the first risk pricing engine written in the first language, and add the obtained source code to the source code library;

[0022] Compile the source code library to generate a static library;

[0023] Create a class described in the second language, and declare a native method for calling the dynamic link library in the created class;

[0024] Generate a header file written in the first language corresponding to the native method;

[0025] Compile the header file and the source code of the first risk pricing engine to obtain the JNI interface of the first risk pricing engine;

[0026] Compile the JNI interfaces of the static library and the first risk pricing engine to obtain a dynamic link library containing the first risk pricing engine.

[0027] In an embodiment of the present invention, after updating the local first dynamic link library, the method further includes:

[0028] Obtain the test risk pricing information of the test product, where the test product is of the same type as the target product type;

[0029] Use the test risk pricing information as a call parameter, and call the first risk pricing engine through the JNI interface of the first risk pricing engine;

[0030] Obtain the test price of the test product output by the first risk pricing engine with the test risk pricing information as input information, and the test risk quantification index of the test product at the test price;

[0031] Send the test price and the test risk quantification index to the test front end, so that testers can determine whether the test price and the test risk quantification index meet the risk quantification requirements based on the information displayed on the test front end.

[0032] In an embodiment of the present invention, the first language is C++; the second language is Java.

[0033] In the second aspect of the embodiments of the present invention, a risk information generation device is further provided. The device includes:

[0034] A first risk pricing engine determination module, configured to respond to a risk pricing request for a target product, and determine a first risk pricing engine for risk quantification of the target product from multiple risk pricing engines stored in a first dynamic link library according to the risk pricing information carried in the risk pricing request;

[0035] A first risk pricing engine call module, configured to use the risk pricing information as a call parameter and call the first risk pricing engine through the JNI interface of the first risk pricing engine;

[0036] A risk information acquisition module, configured to obtain the risk price of the target product output by the first risk pricing engine with the risk pricing information as input information, and the first risk quantification index of the target product at the risk price, and obtain the risk information of the target product including the risk price and the first risk quantification index.

[0037] In one embodiment of the present invention, the first risk pricing engine determination module is specifically configured to parse the risk pricing information of the target product carried in the risk pricing request to obtain a first product type included in the risk pricing information; and determine a first risk pricing engine corresponding to the first product type from a plurality of risk pricing engines stored in a first dynamic link library.

[0038] In one embodiment of the present invention, the first risk quantification index includes at least one of the following indexes: a first sensitivity degree of the risk price to a price change of the target product underlying; a second sensitivity degree of the first sensitivity degree to a price change of the target product underlying; a third sensitivity degree of the risk price to a change in the trading deadline; a fourth sensitivity degree of the risk price to a change in the price volatility of the target product underlying; a fifth sensitivity degree of the risk price to an interest rate change.

[0039] In one embodiment of the present invention, the device further includes: a first dynamic link library obtaining module, configured to, if the first risk pricing engine does not exist in the first dynamic link library, obtain a dynamic link library containing the first risk pricing engine, and update the local first dynamic link library with the obtained dynamic link library to obtain a new first dynamic link library; wherein, the first dynamic link library is obtained in the following manner:

[0040] Obtain the source code of the first risk pricing engine written in a first language, and add the obtained source code to a source code library; compile the source code library to generate a static library; create a class described in a second language, and declare a native method for calling the dynamic link library in the created class; generate a header file written in the first language corresponding to the native method; compile the header file and the source code of the first risk pricing engine to obtain the JNI interface of the first risk pricing engine; and compile the static library and the JNI interface of the first risk pricing engine to obtain a dynamic link library containing the first risk pricing engine.

[0041] In one embodiment of the present invention, the device further includes: a risk pricing engine verification module, configured to obtain test risk pricing information of a test product, where the test product is of the same type as the target product; using the test risk pricing information as a call parameter, through the JNI interface of the first risk pricing engine, call the first risk pricing engine; obtain the test price of the test product output by the first risk pricing engine with the test risk pricing information as input information and the test risk quantification index of the test product at the test price; send the test price and the test risk quantification index to the test front end, so that testers can determine whether the test price and the test risk quantification index meet the risk quantification requirements based on the information displayed on the test front end.

[0042] In one embodiment of the present invention, the first language is C++; the second language is Java.

[0043] In the third aspect of the embodiments of the present invention, an electronic device is further provided, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete mutual communication through the communication bus;

[0044] The memory is used to store a computer program;

[0045] The processor is configured to implement the method steps described in any one of the above first aspects when executing the program stored on the memory.

[0046] In the fourth aspect of the embodiments of the present invention, a computer-readable storage medium is further provided, where the computer-readable storage medium stores a computer program, and the computer program implements the method steps described in any one of the above first aspects when executed by a processor.

[0047] Advantages of the embodiments of the present invention:

[0048] In the solution provided by the embodiments of the present invention, the first dynamic link library integrates multiple risk pricing engines, so that the risk pricing engine applicable to the target product can be determined according to the product type of the target product, and then the risk of the target product can be quantified by the determined risk pricing engine, avoiding judgment deviations caused by the intervention of manual experience and enhancing the objectivity of the obtained risk information. Since the risk pricing engine applicable to the target product is determined in the first dynamic link library, the situation where a single risk pricing engine is used for multiple products is also avoided, thereby improving the accuracy of the obtained risk information.

[0049] Of course, it is not necessary for any product or method implementing the present invention to achieve all the above advantages simultaneously. Description of the Drawings

[0050] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other embodiments based on these drawings.

[0051] Figure 1 It is a schematic flowchart of a risk information generation method provided by an embodiment of the present invention;

[0052] Figure 2 It is a schematic flowchart of a method for obtaining a dynamic link library provided by an embodiment of the present invention;

[0053] Figure 3 It is a schematic flowchart of a method for testing a risk pricing engine provided by an embodiment of the present invention;

[0054] Figure 4 It is a schematic structural diagram of a risk information generation device provided by an embodiment of the present invention;

[0055] Figure 5 It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. Detailed implementation manners

[0056] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art based on this application belong to the scope of protection of the present invention.

[0057] When a financial institution conducts financial product trading business, it is easily affected by various market factors and faces various risks, such as market risk, credit risk, etc. In order to control the risk exposure and accurately evaluate the value and risk of financial products, it is necessary to generate risk information with strong objectivity and high accuracy, so that the staff of the financial institution can formulate corresponding hedging strategies to reduce risks. Therefore, the embodiments of the present invention provide a risk information generation method, device, electronic device, computer-readable storage medium and computer program product. First, the risk information generation method provided by the embodiments of the present invention will be introduced below.

[0058] As Figure 1 shown, Figure 1 It is a schematic flowchart of a risk information generation method provided by an embodiment of the present invention, and this method includes the following steps S101-S103:

[0059] S101: In response to a risk pricing request for a target product, according to the risk pricing information of the target product carried in the risk pricing request, determine, from multiple risk pricing engines stored in the first dynamic link library, a first risk pricing engine for risk quantification of the target product.

[0060] S102: Using the risk pricing information as a call parameter, call the first risk pricing engine through the JNI interface of the first risk pricing engine.

[0061] S103: Obtain the risk price of the target product output by the first risk pricing engine with the risk pricing information as input information, and the first risk quantification index of the target product at the risk price, to obtain the risk information of the target product including the risk price and the first risk quantification index.

[0062] In the solution provided by the embodiment of the present invention, the first dynamic link library integrates multiple risk pricing engines, so that the risk pricing engine applicable to the target product can be determined according to the product type of the target product, and then the risk of the target product can be quantified by the determined risk pricing engine, avoiding judgment deviation caused by the intervention of human experience, enhancing the objectivity of the obtained risk information. Since the risk pricing engine applicable to the target product is determined in the first dynamic link library, the situation where a single risk pricing engine is used for multiple products is also avoided, thereby improving the accuracy of the obtained risk information.

[0063] The risk information generation solution provided by the embodiment of the present invention can be applied to any server that needs to generate risk information. The target product mentioned in the embodiment of the present invention is various carriers traded in the financial market. The risk pricing engine mentioned is a tool for determining the risk price of the target product and quantitatively evaluating the risk of the target product accordingly. The risk pricing information mentioned is a set of various information and data required for risk quantification of the target product.

[0064] The above-mentioned target product can be financial derivatives such as options, futures, and bonds. The risk pricing information of an option can be the contract information and option type of the option. The risk pricing information of a futures can be risk premium and market volatility, etc. The risk pricing information of a bond can be the face value and coupon rate of the bond, etc. The following takes the target product as an over-the-counter option as an example to illustrate the risk information generation method provided by the embodiment of the present invention.

[0065] In an embodiment of the present invention, after the server receives a risk pricing request for a target product, in response to the risk pricing request, parse the risk pricing information of the target product carried in the risk pricing request to obtain the first product type included in the risk pricing information, and then determine, from multiple risk pricing engines stored in the first dynamic link library, the risk pricing engine corresponding to the first product type.

[0066] The above risk pricing engine can be a risk pricing engine such as a BSM (Black-Scholes-Merton) pricing engine or a binomial tree pricing engine. Among them, the BSM pricing engine is applicable to calculating the risk prices of over-the-counter options and European options, and the binomial tree pricing engine is applicable to calculating the risk prices of American options and can also be used for European options.

[0067] The above over-the-counter options include different types of options such as barrier options, portfolio options, snowball options, and European options. For example, after the server parses that the first product type in the risk pricing information is a common type of European option, it can determine in the first dynamic link library that the first risk pricing engine applicable to risk quantification of the common type of European option is the BSM risk pricing engine.

[0068] In the solution provided by the embodiments of the present invention, by parsing the risk pricing information to determine the risk pricing engine applicable to the target product, and then using the determined risk pricing engine to quantify the risk of the target product, it is possible to avoid judgment deviations caused by the intervention of human experience and the situation where a single risk pricing engine is used for multiple products, thereby improving the accuracy of the obtained risk information and enhancing the objectivity of the obtained risk information.

[0069] The above JNI (Java Native Interface) interface is an access interface for the risk pricing engine, and its form is the JNI form. In this way, when the risk pricing engine needs to be used, the JNI interface of the risk pricing engine can be called to use the risk pricing engine.

[0070] In the embodiments of the present invention, the risk pricing information of the target product can be used as a call parameter, and through the JNI interface of the first risk pricing engine, the above call parameter is transmitted to the first risk pricing engine, and the first risk pricing engine calculates the risk price of the target product and the first risk quantification index of the target product at the risk price.

[0071] In addition to the first product type, the above risk pricing information may further include contract information of over-the-counter options to be priced. The contract information of over-the-counter options may be the volatility of the price of the target product, the risk-free interest rate of the over-the-counter option, the trading deadline of the over-the-counter option, etc. After determining that the first risk pricing engine for risk quantification of ordinary European options is the BSM risk pricing engine, the server uses the contract information of the ordinary European options in the risk pricing information as the call parameter, and through the JNI interface of the BSM risk pricing engine, calls the BSM risk pricing engine in the first dynamic link library to generate the risk price of the ordinary European options and the risk quantification index at the risk price of the ordinary European options, and outputs the risk price of the ordinary European options and the risk quantification index at the risk price of the ordinary European options to the server, so that the server obtains risk information including the risk price and risk quantification index of the ordinary European options. Among them, the specific implementation manner of configuring the JNI interface will be described in the subsequent embodiment of obtaining the new first dynamic link library, which will not be elaborated here.

[0072] Specifically, the BSM risk pricing engine may use the contract information of the ordinary European options as input data and input it into the following expression to obtain the risk price of the ordinary European options:

[0073] C = S·N(d1) - X·exp(-r·T)·N(d2);

[0074] Where C is the risk price of the ordinary European options, S is the current price of the underlying of the ordinary European options, X is the trading price specified in the contract information of the ordinary European options, exp is the natural exponential function. T is the trading deadline of the ordinary European options, r is the risk-free interest rate of the ordinary European options, N() is the cumulative probability distribution function of the standard normal distribution, d1 represents the degree to which the ratio of S to X deviates from the mean of the standard normal distribution on the logarithmic scale, and d2 is the square root of subtracting the product of the volatility σ and T from d1.

[0075] The expression of the above d1 is:

[0076]

[0077] The expression of the above d2 is:

[0078]

[0079] In an embodiment of the present invention, the first risk quantification index includes at least one of the following indexes:

[0080] The first sensitivity of the risk price to the price change of the underlying of the target product;

[0081] The second sensitivity of the first sensitivity to the price change of the target product underlying;

[0082] The third sensitivity of the risk price to the change in the trading deadline;

[0083] The fourth sensitivity of the risk price to the change in the price volatility of the target product underlying;

[0084] The fifth sensitivity of the risk price to the change in interest rate.

[0085] In a possible implementation, Delta (Δ) can represent the first sensitivity of the risk price to the price change of the target product underlying, Gamma (Γ) can represent the second sensitivity of the first sensitivity to the price change of the target product underlying, Theta (Θ) can represent the third sensitivity of the risk price to the change in the trading deadline, Vega (ν) can represent the fourth sensitivity of the risk price to the change in the price volatility of the target product underlying, and Rho (ρ) can represent the fifth sensitivity of the risk price to the change in interest rate.

[0086] As mentioned in the above example, after calculating d1 and d2 through the above expressions by the BSM risk pricing engine, the risk quantification indicators of ordinary European options can be calculated according to the following expressions of risk quantification indicators. When the ordinary European option is a call option and a put option, the expressions of Delta (Δ) are respectively:

[0087] Δ = N(d1);

[0088] Δ = N(d1) - 1;

[0089] Among them, the value range of Delta (Δ) is between -1 and 1. For example, if the Delta (Δ) of an ordinary European option is 0.5, when the price of the target product underlying rises by 1 unit, the risk price will rise by 0.5 unit.

[0090] The expression of Gamma (Γ) is:

[0091] Γ = SσTN(d1)

[0092] Among them, the value range of Gamma (Γ) is between 0 and 1. For example, if the Delta (Δ) of an ordinary European option is 0.5 and Gamma (Γ) is 0.05, when the price of the target product underlying rises by 1 unit, Delta (Δ) will increase by 0.05 and become 0.55.

[0093] When the ordinary European option is a call option and a put option respectively, the expressions of Theta (Θ) are respectively:

[0094]

[0095] Among them, the value of Theta (Θ) is negative. For example, if the Theta (Θ) of a regular European option is -1.2, it means that within the next trading day, the risk price of the regular European option will decrease by 1.2 points due to the passage of time.

[0096] The expression of Vega (ν) is:

[0097]

[0098] Among them, the value of Vega (ν) is positive. For example, if the Vega (ν) of a regular European option is 0.0029, then for every 1% change in the trading price volatility of the underlying of the target product, the risk price changes by 0.0029 yuan.

[0099] When the regular European option is a call option and a put option respectively, the expressions of Rho (ρ) are:

[0100]

[0101] Among them, the value of Rho (ρ) can be positive or negative. For example, for a call option, Rho (ρ) is positive, indicating that when the interest rate rises, the risk price also rises; for a put option, Rho (ρ) is negative, indicating that when the interest rate rises, the risk price will fall.

[0102] In a possible implementation manner, after obtaining the risk information of the target product, the server can output a risk analysis report for the target product based on the risk information of the target product and the contract information of the target product. For example, when the target product is a regular European option, the risk analysis report can include the obtained risk price of the regular European option, the risk quantification index of the regular European option at this risk price, and the contract information of the regular European option. The server can display this risk report to the staff of the financial institution, so that the staff of the financial institution can compare the risk prices of similar options in the market with the risk price of the regular European option in the risk report, evaluate whether the risk price of the regular European option calculated by the BSM risk pricing engine is reasonable, and also evaluate the risk quantification index in the report, understand the risk exposure of the regular European option position, and evaluate the potential impact of the regular European option position on the investment portfolio, so that the risk exposure of the regular European option is within a controllable range.

[0103] In a possible implementation, the server can also calculate the risk prices and risk quantification indicators of multiple financial products. The staff of the financial institution can set multiple financial products to be risk-quantified and the time nodes for the server to execute. The server calculates the risk prices of the pre-set financial products and the risk quantification indicators of the financial products at the risk prices according to the pre-set time nodes every day, and displays the obtained results to the staff of the financial institution, so that the staff of the financial institution can timely discover problems and take corresponding measures to effectively implement the risk management policy of the financial institution.

[0104] In the solution provided by the embodiment of the present invention, the risk price and the first risk quantification indicator output by the risk pricing engine applicable to the target product avoid the judgment deviation caused by the intervention of manual experience, and also avoid the situation where a single risk pricing engine is used for multiple products, making the obtained risk information have the advantages of strong objectivity and high accuracy, so that the staff of the financial institution can formulate or adjust the hedging strategy based on the risk information with strong objectivity and high accuracy to reduce or eliminate potential market risks and achieve efficient risk management.

[0105] As an implementation manner of the embodiment of the present invention, if the first dynamic link library does not have the first risk pricing engine, the server obtains the dynamic link library containing the first risk pricing engine, and uses the obtained dynamic link library to update the local first dynamic link library to obtain a new first dynamic link library.

[0106] As Figure 2 shown, Figure 2 It is a schematic flowchart of a method for obtaining a dynamic link library provided by the embodiment of the present invention. The server can obtain the dynamic link library containing the first risk pricing engine according to the following steps S201-S206:

[0107] S201: Obtain the source code of the first risk pricing engine written in the first language, and add the obtained source code to the source code library.

[0108] S202: Compile the source code library to generate a static library.

[0109] S203: Create a class described in the second language, and declare a native method for calling the dynamic link library in the created class.

[0110] S204: Generate a header file written in the first language corresponding to the native method.

[0111] S205: Compile the header file and the source code of the first risk pricing engine to obtain the JNI interface of the first risk pricing engine.

[0112] S206: Compile the JNI interfaces of the static library and the first risk pricing engine to obtain a dynamic link library containing the first risk pricing engine.

[0113] In a possible implementation, when the first risk pricing engine applicable to the target product does not exist in the above-mentioned first dynamic link library, the server can send a prompt message indicating that the first risk pricing engine does not exist in the first dynamic link library to the front end and display the prompt message to the staff of the financial institution, so that the staff of the financial institution can determine the risk quantification requirements for the risk pricing information of the financial products that need to be risk-quantified and inform the R & D personnel of the financial institution of their risk quantification requirements. The R & D personnel can develop the implementation code of a new first risk pricing engine that meets the risk quantification requirements according to the risk quantification requirements of the financial products that need to be risk-quantified, so that the server can obtain the implementation code of the first risk pricing engine and add the obtained implementation code to the source code library.

[0114] The above-mentioned front end is software for direct interaction between the server and the staff of the financial institution. For example, the front end can be an application program of the staff of the financial institution. The above-mentioned prompt message can be an email or a pop-up window in the internal system. The server can prompt the staff of the financial institution to intervene quickly by pushing an alarm email indicating that the first risk pricing engine does not exist in the first dynamic link library.

[0115] In an embodiment of the present invention, the above-mentioned first language is C++, and the above-mentioned second language is Java.

[0116] Specifically, the above-mentioned step S204 can use the javac -h instruction to generate a JNI header file (.h file) according to the interface on the Java side. The header file contains the function names of the above-mentioned native methods.

[0117] In a possible implementation, after the server adds the obtained source code to the source code library, it compiles the source code library after adding the implementation code to generate a.lib static library, creates a class described in Java, declares a native method for calling the dynamic link library in the created class, uses the javac -h instruction to generate a JNI header file (.h file) according to the interface on the Java side, and compiles the JNI header file and the source code of the first risk pricing engine to obtain the JNI interface of the first risk pricing engine. After the server obtains the JNI interface of the first risk pricing engine, it can implement the methods declared in the JNI header file in C++. Subsequently, it can use a compiler such as g++ to compile the static library and the JNI interface of the first risk pricing engine to obtain a dynamic link library including the first risk pricing engine, and use the obtained dynamic link library to update the local first dynamic link library to obtain a new dynamic link library.

[0118] In addition, the method for the server to call the first risk pricing engine using JAVA code can be to use the System.loadLibrary method to load the above-mentioned first dynamic link library; use the risk pricing information as the call parameter, and pass the call parameter to the first risk pricing engine through the JNI interface of the first risk pricing engine; call the first risk pricing engine to perform risk quantification calculation for the target product.

[0119] In the solution provided by the embodiment of the present invention, when the first dynamic link library does not have the first risk pricing engine, the server can update the first dynamic link library after obtaining the source code of the first risk pricing engine, and obtain the first dynamic link library including the first risk pricing engine, realizing the dynamic update of the dynamic link library. In this way, when the market conditions change, it can quickly respond to the changes in market demand, and then achieve rapid function upgrade.

[0120] In addition, when the first language is C++ and the second language is Java, the risk pricing engine is implemented based on C++ code. Therefore, when the first dynamic link library needs to be updated, only the version of the C++ library needs to be updated, and the JNI interface of the first risk pricing engine remains unchanged, reducing the adaptation workload. Thus, it can support the rapid iteration of the first dynamic link library. And, by using the JNI interface configured by the first risk pricing engine, parameter passing can be realized, solving the problems of low efficiency and easy errors in manual configuration in the traditional method. Moreover, the first risk pricing engine can be directly accessed just like calling a Java method, which eliminates the additional intermediate layer and reduces the performance overhead. Especially when processing a large amount of market and position data and performing intensive operations, it can greatly reduce the calculation latency, and then quickly and accurately calculate the risk price of the target product and the risk quantification index of the target product at this risk price.

[0121] In an embodiment of the present invention, as Figure 3 shown, Figure 3 FIG. is a schematic flowchart of a process for testing a risk pricing engine provided by an embodiment of the present invention. After the server updates the local first dynamic link library, it can also test whether the first risk pricing engine meets the risk quantification requirements through the following steps S301-S304:

[0122] S301: Obtain the test risk pricing information of the test product.

[0123] Among them, the test product has the same type as the target product.

[0124] S302: Use the test risk pricing information as the call parameter, and call the first risk pricing engine through the JNI interface of the first risk pricing engine.

[0125] S303: Obtain the first risk pricing engine to test the risk pricing information as the input information, the test price of the output test product, and the test risk quantification index of the test product at the test price.

[0126] S304: Send the test price and the test risk quantification index to the test front end so that the tester can determine whether the test price and the test risk quantification index meet the risk quantification requirements based on the information displayed on the test front end.

[0127] The test product and the test risk pricing information of the test product can be obtained from the historical project data in the local information database of the financial institution or from the network information database, which is not limited here. In addition, the process of obtaining the JNI interface of the first risk pricing engine and calculating the test price and the test risk quantification index of the test product is similar to the solution provided in the above embodiment, and will not be elaborated here.

[0128] In a possible implementation manner, the server can compare the obtained test price with the historical risk price, analyze the fluctuation of the test price under different market conditions and the possible risk level. The server can also set a risk threshold based on the historical risk quantification index of the test product, compare the obtained test risk quantification index with the historical risk quantification index. If the test risk quantification index is less than or equal to the preset risk threshold, it can be considered that the test risk quantification index meets the proposed risk quantification requirements. The server can also evaluate the value of the test risk quantification index or set different market scenarios to evaluate whether the risk quantification index in these market scenarios is reasonable to determine whether it meets the risk quantification requirements.

[0129] Taking the test risk quantification index as the above Delta (Δ) as an example, Delta (Δ) represents the first sensitivity of the risk price to the change in the underlying price of the target product. The server can calculate the square value of Delta (Δ). If the square value of Delta (Δ) is closer to 1, it indicates that Delta (Δ) can accurately quantify the underlying price risk of the target product.

[0130] For example, the server can perform a stress test on the test product, set a scenario where the underlying price of the target product fluctuates greatly, and modify the risk pricing information of the target product, so as to obtain Gamma (Γ) in different scenarios, and evaluate its impact on the underlying price of the target product and the portfolio risk. If Gamma (Γ) can still accurately reflect the risk change in this scenario, it indicates that Gamma (Γ) calculated by the first risk pricing engine can meet the risk quantification requirements.

[0131] The server can also design different market scenarios, such as bull markets, bear markets, or oscillating markets, etc. According to the market scenarios, different scenarios with rising or falling volatility are designed to obtain the risk pricing information of the test product after designing the market scenario, so as to obtain Vega (ν) under the designed market scenario, and evaluate the response ability of Vega (ν) to the test price risk under the designed market scenario. If Vega (ν) can reasonably reflect the risk change under the designed market scenario, it indicates that the first risk pricing engine meets the risk quantification requirements.

[0132] The server can determine whether the test price and the test risk quantification index meet the risk quantification requirements through a variety of different methods, which will not be limited here.

[0133] In the solution provided by the embodiment of the present invention, the server can perform risk quantification on the test product according to the risk information generation method provided in the above embodiment, obtain the risk price of the test product with high accuracy and the multi-dimensional test risk quantification indexes at this risk price. Based on the price of the test product and the test risk quantification indexes at this price, risk information with strong objectivity and high accuracy can be obtained, so that it is possible to more accurately evaluate whether the new risk pricing engine meets the risk quantification requirements.

[0134] Corresponding to the above risk information generation method, as Figure 4 shown, the embodiment of the present invention provides a structural schematic diagram of a risk information generation device, and the device includes:

[0135] A first risk pricing engine determination module 401, configured to respond to a risk pricing request for a target product, and determine a first risk pricing engine for performing risk quantification on the target product from a variety of risk pricing engines stored in the first dynamic link library according to the risk pricing information of the target product carried in the risk pricing request;

[0136] A first risk pricing engine invocation module 402, configured to use the risk pricing information as an invocation parameter and invoke the first risk pricing engine through the JNI interface configured by the first risk pricing engine;

[0137] A risk information acquisition module 403, configured to obtain the risk price of the target product output by the first risk pricing engine with the risk pricing information as input information and the first risk quantification index of the target product at the risk price, and obtain the risk information of the target product including the risk price and the first risk quantification index.

[0138] In the solution provided by the embodiment of the present invention, the first dynamic link library integrates multiple risk pricing engines, so that the risk pricing engine applicable to the target product can be determined according to the product type of the target product, and then the determined risk pricing engine quantifies the risk of the target product, avoiding judgment deviation caused by the intervention of manual experience, enhancing the objectivity of the obtained risk information. Since the risk pricing engine applicable to the target product is determined in the first dynamic link library, the situation where a single risk pricing engine is used for multiple products is also avoided, thereby improving the accuracy of the obtained risk information.

[0139] In one embodiment of the present invention, the above-mentioned first risk pricing engine determination module 401 is specifically configured to parse the risk pricing information of the target product carried in the risk pricing request to obtain the first product type included in the risk pricing information; and determine the first risk pricing engine corresponding to the first product type from the multiple risk pricing engines stored in the first dynamic link library.

[0140] In one embodiment of the present invention, the first risk quantification index includes at least one of the following indexes:

[0141] The first sensitivity of the risk price to the price change of the target product underlying;

[0142] The second sensitivity of the first sensitivity to the price change of the target product underlying;

[0143] The third sensitivity of the risk price to the change of the trading deadline;

[0144] The fourth sensitivity of the risk price to the change of the price volatility of the target product underlying;

[0145] The fifth sensitivity of the risk price to the change of the interest rate.

[0146] In one embodiment of the present invention, the above-mentioned risk information generation device further includes:

[0147] The first dynamic link library obtaining module is configured to, if the first risk pricing engine does not exist in the first dynamic link library, obtain a dynamic link library containing the first risk pricing engine, and update the local first dynamic link library with the obtained dynamic link library to obtain a new first dynamic link library;

[0148] Wherein, the above-mentioned new first dynamic link library is obtained in the following manner:

[0149] Obtain the source code of the first risk pricing engine written in the first language, and add the obtained source code to the source code library;

[0150] Compile the source code library to generate a static library;

[0151] Create a class described in a second language, and declare in the created class a native method for calling a dynamic link library;

[0152] Generate a header file written in a first language corresponding to the native method;

[0153] Compile the header file and the source code of the first risk pricing engine to obtain the JNI interface of the first risk pricing engine;

[0154] Compile the static library and the JNI interface of the first risk pricing engine to obtain a dynamic link library containing the first risk pricing engine.

[0155] In one embodiment of the present invention, the above risk information generation device further includes:

[0156] A test risk pricing information acquisition module, configured to acquire test risk pricing information of a test product, where the test product has the same type as the target product type;

[0157] The above first risk pricing engine call module 402 is specifically configured to use the test risk pricing information as a call parameter, and call the first risk pricing engine through the JNI interface configured by the first risk pricing engine;

[0158] The above risk information acquisition module 403 is specifically configured to acquire the test price of the test product output by the first risk pricing engine with the test risk pricing information as input information, and the test risk quantification index of the test product at the test price;

[0159] A sending module, configured to send the test price and the test risk quantification index to a test front end, so that a tester can determine whether the test price and the test risk quantification index meet the risk quantification requirements based on the information displayed by the test front end.

[0160] In one embodiment of the present invention, the above first language is C++, and the above second language is Java.

[0161] An embodiment of the present invention further provides an electronic device, as Figure 5 shown, including a processor 501, a communication interface 502, a memory 503, and a communication bus 504, where the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504.

[0162] The memory 503 is used to store a computer program;

[0163] The processor 501 is configured to implement the risk information generation solution provided in the foregoing method embodiments when executing the programs stored in the memory 503. The communication bus mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity, only a thick line is used in the figure to represent it, but it does not mean that there is only one bus or one type of bus.

[0164] The communication interface is used for communication between the above electronic device and other devices.

[0165] The memory may include a Random Access Memory (RAM), or may also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.

[0166] The above-mentioned processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0167] In another embodiment provided by the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the above risk information generation methods are implemented.

[0168] In another embodiment provided by the present invention, there is also provided a computer program product containing instructions, which when running on a computer, causes the computer to execute any of the risk information generation methods in the above embodiments.

[0169] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer, or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)).

[0170] It should be noted that in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including", or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article, or device that includes a series of elements includes not only those elements but also other elements that are not explicitly listed, or elements that are inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article, or device that includes the element.

[0171] Each embodiment in this specification is described in a related manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and reference can be made to the corresponding part of the method embodiment for the relevant content.

[0172] The above are only the preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention are all included in the protection scope of the present invention.

Claims

1. A risk information generation method, characterized in that, The method includes: In response to a risk pricing request for a target product, according to the risk pricing information of the target product carried in the risk pricing request, determine, from multiple risk pricing engines stored in a first dynamic link library, a first risk pricing engine for risk quantification of the target product; Using the risk pricing information as a call parameter, call the first risk pricing engine through the JNI interface of the first risk pricing engine; Obtain the risk price of the target product output by the first risk pricing engine with the risk pricing information as input information, and the first risk quantification index of the target product at the risk price, to obtain the risk information of the target product including the risk price and the first risk quantification index.

2. The method according to claim 1, characterized in that, The step of determining, from multiple risk pricing engines stored in a first dynamic link library, a first risk pricing engine for risk quantification of the target product according to the risk pricing information of the target product carried in the risk pricing request includes: Analyze the risk pricing information of the target product carried in the risk pricing request to obtain a first product type included in the risk pricing information; Determine, from multiple risk pricing engines stored in the first dynamic link library, a first risk pricing engine corresponding to the first product type.

3. The method according to claim 1, characterized in that, The first risk quantification index includes at least one of the following indexes: A first sensitivity of the risk price to a price change of the underlying of the target product; A second sensitivity of the first sensitivity to a price change of the underlying of the target product; A third sensitivity of the risk price to a change in the trading deadline; A fourth sensitivity of the risk price to a change in the price volatility of the underlying of the target product; A fifth sensitivity of the risk price to an interest rate change.

4. The method according to claim 1, wherein The method further includes: If the first risk pricing engine does not exist in the first dynamic link library, obtain a dynamic link library containing the first risk pricing engine, and use the obtained dynamic link library to update the local first dynamic link library to obtain a new first dynamic link library; Wherein, the dynamic link library containing the first risk pricing engine is obtained in the following manner: Obtain the source code of the first risk pricing engine written in a first language, and add the obtained source code to a source code library; Compile the source code library to generate a static library; Create a class described in a second language, and declare a native method for calling the dynamic link library in the created class; Generate a header file written in the first language corresponding to the native method; Compile the header file and the source code of the first risk pricing engine to obtain the JNI interface of the first risk pricing engine; Compile the static library and the JNI interface of the first risk pricing engine to obtain a dynamic link library containing the first risk pricing engine.

5. The method according to claim 4, characterized in that After updating the local first dynamic link library, the method further includes: Obtain test risk pricing information of a test product, wherein the test product is of the same type as the target product; Using the test risk pricing information as a call parameter, the first risk pricing engine is called through the JNI interface of the first risk pricing engine; Obtain the test price of the test product output by the first risk pricing engine with the test risk pricing information as input information, and the test risk quantification index of the test product at the test price; Send the test price and the test risk quantification index to the test front end, so that testers can determine whether the test price and the test risk quantification index meet the risk quantification requirements based on the information displayed on the test front end.

6. The method according to any one of claims 1-5, characterized in that, The first language is C++; The second language is Java.

7. A risk information generation device, characterized in that, The device includes: A first risk pricing engine determination module, configured to, in response to a risk pricing request for a target product, determine a first risk pricing engine for risk quantification of the target product from multiple risk pricing engines stored in a first dynamic link library according to the risk pricing information carried in the risk pricing request; A first risk pricing engine call module, configured to use the risk pricing information as a call parameter and call the first risk pricing engine through the JNI interface of the first risk pricing engine; A risk information acquisition module, configured to obtain the risk price of the target product output by the first risk pricing engine with the risk pricing information as input information, and the first risk quantification index of the target product at the risk price, to obtain the risk information of the target product including the risk price and the first risk quantification index.

8. The device according to claim 7, wherein The first risk pricing engine determination module is specifically configured to parse the risk pricing information of the target product carried in the risk pricing request to obtain a first product type included in the risk pricing information; Determine a first risk pricing engine corresponding to the first product type from multiple risk pricing engines stored in the first dynamic link library; And / or The first risk quantification index includes at least one of the following indexes: the first sensitivity of the risk price to the price change of the target product underlying; The second sensitivity of the first sensitivity to the price change of the target product underlying; The third sensitivity of the risk price to the change of the trading deadline; the fourth sensitivity of the risk price to the change of the price volatility of the target product underlying; The fifth sensitivity of the risk price to the change of interest rate; And / or The device further includes: a first dynamic link library acquisition module, configured to, if the first risk pricing engine does not exist in the first dynamic link library, obtain a dynamic link library containing the first risk pricing engine, and update the local first dynamic link library with the obtained dynamic link library to obtain a new first dynamic link library; wherein, the first dynamic link library is obtained in the following manner: Obtain the source code of the first risk pricing engine written in the first language, add the obtained source code to the source code library; compile the source code library to generate a static library; create a class described in the second language, and declare a native method for calling the dynamic link library in the created class; generate a header file written in the first language corresponding to the native method; compile the header file and the source code of the first risk pricing engine to obtain the JNI interface of the first risk pricing engine; compile the static library and the JNI interface of the first risk pricing engine to obtain a dynamic link library containing the first risk pricing engine; and / or The device further includes: a risk pricing engine verification module, configured to obtain test risk pricing information of a test product, where the test product is of the same type as the target product type; use the test risk pricing information as a call parameter, and call the first risk pricing engine through the JNI interface of the first risk pricing engine; obtain the test price of the test product output by the first risk pricing engine with the test risk pricing information as input information, and the test risk quantification index of the test product at the test price; send the test price and the test risk quantification index to the test front end, so that testers can determine whether the test price and the test risk quantification index meet the risk quantification requirements based on the information displayed on the test front end; and / or The first language is C++; the second language is Java.

9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus; The memory is used to store computer programs; The processor is configured to implement the method steps described in any one of claims 1-6 when executing the programs stored on the memory.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, it implements the method steps described in any one of claims 1-6.