Detailed Description
Embodiments disclosed in the present specification are described below with reference to the accompanying drawings.
The embodiment of the specification discloses a method for determining liquidity indexes of business assets, and firstly introduces the inventive concept of the method and a system architecture related to the application scenario of the method. The method is based mainly on the following observations and statistics:
liquidity management is essentially a data-driven management method, and liquidity risk conditions are calculated and analyzed from complex business data, bank flow, financial market data and the like, so as to reflect liquidity levels and risk conditions of financial institutions. At present, most of liquidity management systems adopt the system architecture of fig. 1, wherein the bottom layer is an original data layer, the original data mainly comes from data such as orders, transactions, details, user information and the like which are fallen to the ground of a related business system of a financial institution, and also comes from general data of a financial market, and the original data specifically may include bank position, a payment account, business flow, public opinion information, interest rate information, exchange rate information and the like; the original data is cleaned by a data platform, that is, a distributed platform with mass data processing and analyzing capability, including an offline computing platform, a streaming computing platform and an algorithm computing platform, such as an open source computing platform Spark, Hadoop and the like, and then falls into a mobility management system, and the mobility management system performs index presentation, monitoring and even automatic processing according to the condition of the cleaned data.
However, the data types required for large-scale display of fluidity indexes, monitoring or automatic operation are complicated. At present, a liquidity management system can only write a calculation method of a liquidity index into the system, so that the expansibility is poor, and along with the development of financial business, the liquidity index which needs to be analyzed correspondingly can be changed due to the change of the business side requirement, such as the mass increase.
Based on the above observation and statistics, as shown in fig. 2, compared with the general mobility system architecture shown in fig. 1, in the index calculation architecture based on the expression engine provided in the embodiment of the present specification, the calculation of the index no longer depends on the data platform completely, but on the basis of the index of the data platform, a layer of index processing layer based on the expression engine is abstracted. More specifically, according to embodiments of the present specification, a liquidity index is divided into a base index and a derived index, where the base index is determined based on source data of various business assets. And the index processing layer processes the basic index according to the self-defined expression of the index user, so as to generate the derivative index. The following describes a method for determining a fluidity index disclosed in the examples of the present specification, with reference to specific examples.
According to a specific implementation, firstly, an index expression customized for liquidity indexes of business assets is obtained, and the index expression is used for calculating derivative indexes based on liquidity basic indexes, for example, the obtained index expression is sum (balance (x), balance (y)), wherein balance (x) and balance (y) respectively represent balances of an account x and an account y, sum (balance (x), balance (y)) represents a total balance of the account x and the account y, and the expression is used for calculating the derivative indexes, namely the total balance of the account x and the account y, based on the basic indexes, namely account information; then, performing syntax parsing on the index expression to identify at least one function included in the index expression, for example, for index expression sum (balance (x), balance (y)), the functions included in the index expression sum can be identified as balance and sum; then, at least one computing component corresponding to the at least one function is determined from the function container, for example, computing components corresponding to the functions balance and sum, respectively, may be determined; and calling a calculation method corresponding to the at least one calculation component based on the basic index so as to determine the value of the derived index. Next, concrete implementation steps of the above process are described.
FIG. 3 illustrates a flow diagram of a method of determining a liquidity indicator for a business asset, according to one embodiment. The execution subject of the method may be a device with processing capabilities: a server or a system or device. As shown in fig. 3, the method flow includes the following steps: step S310, obtaining an index expression customized for the liquidity index of the business asset, wherein the index expression is used for calculating a derivative index based on the basic index of liquidity; step S320, carrying out grammar analysis on the index expression so as to identify at least one function included in the index expression; step S330, determining at least one computing component corresponding to the at least one function from the function container; step S340, based on the basic index, invoking a calculation method corresponding to the at least one calculation component to determine a value of the derived index.
First, in step S310, an index expression customized for the liquidity index of the business asset is obtained, and the index expression is used for calculating a derived index based on a basic index of liquidity.
In one embodiment, the index expression is generated by the index user according to the business requirement, wherein the index user may be any entity that needs to calculate and obtain the liquidity index, such as the liquidity management layer in fig. 1 and fig. 2, and more specifically, for example, the global large disk presentation entity, the transaction management and monitoring entity therein may be used as the index user to define the expression according to the required index.
The customized index expression is used for calculating the derived index based on the basic index. In one embodiment, the base indicator is determined based on source data of the business asset. In one example, the source data may include the bottom-most raw data of fig. 2, and accordingly, in one example, the base indicator determined based on the source data may include the account information and data shown in fig. 2, such as the account name and the corresponding account balance, the business information and data, the transaction information and data, such as the account name and the transaction amount of the transaction party, the product information and data, such as the product name and the corresponding rate, and the global data.
In one embodiment, the derived indicator may be a new fluidity indicator defined by the indicator user based on the base indicator according to actual needs. In one example, the base index may include the account information and data shown in fig. 2, for example, account names of a plurality of accounts belonging to the same user and account balances corresponding to the account names, such as account names corresponding to a fund account and a stock account, respectively, and account balances in a payment instrument. Accordingly, in one example, the derivative indicators may include the account derivative indicators shown in FIG. 2, for example, may include the account total for any number of the plurality of accounts, such as the account total corresponding to the fund account and the stock account in the payment instrument.
In one embodiment, the index expression corresponding to the derived index refers to an expression method of a calculation formula having a specific format and capable of representing the derived index. In one example, the specific format may be a function, and the function corresponds to a specific calculation function, for example, it may be set that balance of the function corresponds to a calculation function of acquiring an account balance, and sum of the function corresponds to a calculation function of summing parameters, and accordingly, in a specific example, the index expression may be sum (balance (x), balance (y)), where balance (x) and balance (y) respectively express a balance of the account x and a balance of the account y, and the index expression expresses a total balance of the account x and the account y.
In one embodiment, obtaining the index expression may include: and receiving an expression calculation request, and extracting a corresponding index expression from the request. In one example, the expression computation request may be generated based on a commit operation of the index expression by the index user. In another example, the request may be generated based on a confirmed evaluation operation of the derived metric corresponding to the metric expression by the metric user.
In the above, the user-defined index expression corresponding to the derived index can be obtained. Next, in step S320, the index expression is parsed to identify at least one function included in the index expression.
According to an example, the index expression may be sum (balance (x) and balance (y)), and the functions balance and sum included in the index expression may be identified by performing syntax analysis on the index expression. In one embodiment, identifying at least one function may further include: the parameters included in each function are identified. Further, in one example, parameters x and y of the function balance, and parameters balance (x) and balance (y) of the function sum may also be identified.
In one embodiment, parsing the index expression may include: and resolving the index expression into an interface calling expression in a general calling form corresponding to the used programming language, wherein the expression correspondingly identifies the at least one function. In one example, the programming language used is Java, and the corresponding interface call expression may be a Java interface call expression. According to a specific example, the target expression sum (balance (x), balance (y)) may be parsed into corresponding Java interface call expressions, i.e., sum.computer (balance.computer (x), balance.computer (y)), where the sum and balance are identified using the computer correspondence.
After identifying at least one function included in the index expression, next, at step S330, at least one computation component corresponding to the at least one function is determined from the function container.
In one embodiment, where a function is referred to in the foregoing as corresponding to a particular computing function, accordingly, the computing components corresponding to the function may be used to implement the particular computing function. For example, if the function balance corresponds to a computing function for acquiring an account balance, the computing component corresponding to balance may be used to implement the computing function for acquiring an account balance.
In one example, the computing component may be a Spring bean component. It is understood that Spring is an open source framework based on Java, where Spring beans are Java objects that are instantiated, assembled, and managed by Spring containers. Spring beans can be viewed as defined components whose role is to implement a defined function. When the defined function is a function operation, the Spring bean component can be used as a computing component corresponding to the function.
In one embodiment, determining at least one computing component may include: and determining the computing components corresponding to each function in at least one function according to the mapping relation between the pre-stored functions and the computing components. In one example, the mapping relationship may be stored in a function container, for example, the function container may be a Spring framework based control inversion Ioc container. In one example, determining at least one computing component may include: analyzing the interface call expression determined in the step S320 by using a Jexl engine to obtain at least one function identified in the interface call expression, and determining at least one computing component corresponding to the at least one function according to a mapping relation stored in a function container. According to a specific example, a Jexl engine may be used to analyze the expression, for example, sum.computer (x) and sum.computer (y)), of the Java interface call, and analyze the computation components corresponding to the sum and balance functions, respectively.
It should be noted that, the calculation component is usually generated by configuring and defining in advance when a system developer develops, which results in that the calculation of the fluidity index expression only depends on the existing function in the system, and if the existing function cannot meet the actual requirement, the system development is required again. Based on this, in one embodiment disclosed in the present specification, the computation component may include a computation component dynamically loaded into the function container, hereinafter referred to as a first computation component. Therefore, research personnel can customize the calculation component according to the required function, so that the available function and the corresponding calculation component are expanded, and the calculation of the liquidity index is more flexible.
Further, in a particular embodiment, the first compute component may be dynamically loaded by: firstly, a function container receives a request for refreshing a function list; then, the function container acquires the latest script data according to the request, wherein the script data defines the calculation logic of the first calculation component; then, the function container generates and loads the first computing component according to the script data. In addition to generating such a first calculation component, the mapping relationship between the function and the calculation component may be updated, and the newly generated relationship between the first calculation component and the function corresponding to the calculation logic thereof may be added to the mapping relationship, so that the first calculation component may be used when calculating the liquidity index.
In one example, the script data may be a Groovy language-based script data, and the first computing component may be a Spring bean. Next, with reference to fig. 4, a description will be given of a dynamic loading method of the first computing component according to a specific example. As shown in fig. 4, first, in step S41, a developer may edit a Groovy script through the liquidity background; then, in step S42, submitting the edited Groovy script to the landing database, and in step S43, triggering the function container to refresh the function list; then, in step S44, the function container queries and obtains the latest Groovy script from the database, and in step S45, generates a corresponding Spring bean according to the latest Groovy script by using the hot loading capability of the Spring framework; in step S46, the function container feeds back the refresh result to the liquidity background, for example, the refresh is successful. In this way, the computing component Spring bean is dynamically loaded by using the Groovy scripting language and the hot loading mechanism of the Spring framework, so that new computing logic is added for computing the liquidity index without restarting the system.
In the above, at least one computing component corresponding to at least one function may be determined. Next, in step S340, based on the basic index, a calculation method corresponding to the at least one calculation component is called to determine a value of the derived index.
In one embodiment, the various compute components are stored and managed by function containers, each configured with a corresponding compute method, or compute logic. Accordingly, the corresponding calculation method of the at least one calculation component may be called from a function container storing a plurality of calculation components, and the value of the derived index may be determined by applying the corresponding calculation method to the base index.
In one embodiment, the at least one function identified in step S320 includes a first function, and the parameter of the first function includes a first parameter, and the first parameter belongs to the base indicator. That is, the parameters of the first function include the basic index, and the basic index can be directly operated and operated. In one example, in step S320, function sum and balance may be identified from index expression sum (balance (x), balance (y)), where balance is a first function, and the parameters of balance include first parameters x and y, and x and y respectively correspond to account information in the base index, namely account x and account y. Accordingly, in one embodiment, invoking a computing method corresponding to the at least one computing component may include: and inquiring the value of a first parameter from the basic index, and applying a calculation method corresponding to the first function to the first parameter at least to obtain an operation result of the first function. In an example, account information corresponding to the first parameters x and y may be queried from the basic index, and a calculation method corresponding to balance, that is, a calculation method for obtaining an account balance, may be applied to the account x and the account y, so as to obtain a first function operation result, that is, obtain a balance of the account x and obtain a balance of the account y.
Further, in one embodiment, the at least one function further comprises a second function, and the parameter of the second function comprises an operation result of the first function. In an example, the second function may be sum, and the parameters of the second function may include operation results of the first functions balance (x) and balance (y), that is, the obtained balance of account x and the obtained balance of account y. Accordingly, in an embodiment, invoking a computing method corresponding to the at least one computing component may further include: and applying a calculation method corresponding to the second function to at least the operation result of the first function. In one example, a calculation method corresponding to sum may be applied to the balance of account x and the balance of account y, that is, a calculation method for summing the balances of accounts. Accordingly, the operation result of the second function, that is, the value of the derived index, i.e., the total balance of the account x and the account y, can be obtained.
The parameters of the first function, whether it be the first function or the second function, may also include incoming parameters. For example, to obtain the balance fluctuation of an account x in a certain time interval T, a function balance (x, T) may be used, where the value of T is not directly specified in the function, but is introduced when the expression engine is invoked. For example, if a balance fluctuation of the account 001 within T3 days is to be acquired, the function may not be designated as balance (001, 3), but when the expression engine is called, the following manner is adopted:
ExpressionEngine.caculate(balance(x,T),001,3),
thus, when the calculation method is called for calculation, the actual parameter value is used to replace the parameter placeholder in the function expression, that is, the parameter value is transmitted to the corresponding parameter.
The value of the derived indicator is determined by applying a calculation method corresponding to the function in the expression to the base indicator, and optionally the incoming parameters.
In summary, in the method for determining a liquidity index of a business asset disclosed in this specification, first, an index expression customized for the liquidity index of the business asset is obtained, and syntax parsing is performed on the index expression to identify at least one function included in the index expression; then, at least one calculation component corresponding to the at least one function is determined from the function container, a calculation method corresponding to the at least one calculation component is called based on the basic index, and the value of the index expression is determined, so that the value of the derivative index corresponding to the index expression is flexibly and conveniently determined.
The method for determining liquidity index of business assets provided in the present specification is further described according to a specific example with reference to fig. 5. As shown in fig. 5, the method may include the steps of:
and step S51, the index user defines an index expression corresponding to the derived index of the fluidity according to the actual requirement in a view or a decision layer.
In one example, the index expression may include at least one function, for example, the index expression may be sum (balance (x), balance (y)), where the functions balance (x) and balance (y) respectively represent balances of account x and account y, and the function sum (balance (x), balance (y)) represents a total balance of account x and account y.
In step S52, the expression engine receives the expression calculation request and extracts the corresponding index expression from the request.
In one example, the expression computation request may be generated from a business person submitting an index expression.
In step S53, the expression engine parses the index expression to identify at least one function included in the expression and parameters corresponding to each function.
In one example, the result of the syntax parsing is a Java interface expression based on a generic call form of a Java language interface, e.g., balance.
At step S54, at least one computing component corresponding to the at least one function is determined.
In one example, the Java interface expression may be parsed using a Jexl engine to determine the at least one compute component, which in one example may be a Spring bean.
Step S55, based on the basic index, calling a calculation method corresponding to at least one computer component from the function container to determine the value of the derived index.
In one example, the step S55 may include a step S551 and a step S552, in which the step S551 queries the basic index data related to the parameter identified in the step S53, and the step S552 calls a calculation method corresponding to at least one calculation component from the function container to calculate the value of the derived index.
In step S56, the expression engine obtains the value of the derived index from the function container.
In step S57, the expression engine provides the value of the derived index to the view or the decision layer, so that the index user can know the value of the derived index he or she defines.
Therefore, the calculation logic of the liquidity index can be flexibly and conveniently expressed through the expression engine, and the index result is calculated by using syntax analysis and the Jexl engine.
The execution of the embodiment is described above in connection with examples of the Java language. However, the above implementation is not limited to the Java language, but may be applied to other object-oriented languages, such as C + +, C #. At this time, reusable calculation components need to be constructed in advance according to the characteristics of the corresponding language, and a mapping relation between functions in the index expression and the calculation components is established. On this basis, according to the manner of the above embodiment, the user-defined index expression may be analyzed as a function, and the calculation component corresponding to the function is used to calculate the basic index, thereby determining the derived index.
According to an embodiment of another aspect, a determination apparatus is also provided. FIG. 6 illustrates an apparatus for determining a liquidity indicator for a business asset in accordance with one embodiment. As shown in fig. 6, the apparatus 600 includes: an obtaining module 610 configured to obtain an index expression customized for a liquidity index of a business asset, the index expression being used for calculating a derivative index based on a basic index of liquidity, the basic index being determined based on source data of the business asset; a parsing module 620 configured to parse the index expression to identify at least one function included in the index expression; a determining module 630 configured to determine at least one computing component corresponding to at least one function from the function container; the invoking module 640 is configured to invoke a computing device corresponding to the at least one computing component to determine a value of the derived metric based on the base metric.
According to one embodiment, the obtaining module 610 is specifically configured to receive an expression calculation request and extract an index expression from the expression calculation request.
According to one embodiment, the parsing module 620 is specifically configured to parse the index expression into a Java interface call expression, where the Java interface call expression corresponds to and identifies at least one function; the determining module 630 is specifically configured to parse the Java interface call expression using the Jexl engine to determine at least one computing component corresponding to the identified at least one function.
Further, in one embodiment, the function container is a Spring framework based control inversion Ioc container and the at least one computing component is a Spring bean component.
According to one embodiment, the at least one function comprises a first function, the parameters of the first function comprise a first parameter, the first parameter belonging to the base indicator; the calling module 640 is specifically configured to query the value of the first parameter from the basic index, and apply a calculation method corresponding to the first function to the first parameter at least to obtain an operation result of the first function.
Further, in one embodiment, the at least one function further includes a second function, and the parameter of the second function includes an operation result of the first function;
the calling module 640 is further configured to apply a calculation method corresponding to the second function to at least the operation result of the first function.
According to one embodiment, the at least one compute component includes a first compute component dynamically loaded into the function container.
Further, in one embodiment, wherein the first compute component is dynamically loaded by: receiving a request to refresh a function list; acquiring latest script data according to the request, wherein the script data defines the calculation logic of the first calculation component; a first computing component is generated and loaded from the script data.
Further, in one embodiment, the script data is a Groovy language based script data and the first computing component is a Spring bean.
In summary, in the apparatus for determining a liquidity index of a business asset disclosed in this specification, the obtaining module 610 is configured to obtain an index expression customized for the liquidity index of the business asset, and the parsing module 620 is configured to parse the index expression to identify at least one function included in the index expression; the determining module 630 is configured to determine at least one computing component corresponding to at least one function in the function container, and the calling module 640 is configured to call a computing method corresponding to at least one computing component based on the basic index, and determine the value of the index expression, thereby flexibly and conveniently determining the value of the derivative index corresponding to the index expression.
As above, according to an embodiment of a further aspect, there is also provided a computer readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method described in connection with fig. 3.
According to an embodiment of yet another aspect, there is also provided a computing device comprising a memory having stored therein executable code, and a processor that, when executing the executable code, implements the method described in connection with fig. 3.
Those skilled in the art will recognize that, in one or more of the examples described above, the functions described in the embodiments disclosed herein may be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium.
The above-mentioned embodiments, objects, technical solutions and advantages of the embodiments disclosed in the present specification are further described in detail, it should be understood that the above-mentioned embodiments are only specific embodiments of the embodiments disclosed in the present specification, and are not intended to limit the scope of the embodiments disclosed in the present specification, and any modifications, equivalent substitutions, improvements and the like made on the basis of the technical solutions of the embodiments disclosed in the present specification should be included in the scope of the embodiments disclosed in the present specification.