Specific embodiment
In order to better understand the above technical scheme, below by attached drawing and specific embodiment to this specification embodiment
Technical solution be described in detail, it should be understood that the specific features in this specification embodiment and embodiment are to this explanation
The detailed description of book embodiment technical solution, rather than the restriction to this specification technical solution, in the absence of conflict,
Technical characteristic in this specification embodiment and embodiment can be combined with each other.
This specification embodiment provides a kind of Modeling Platform system and method based on graph data structure, the system and method
It is adapted to construct model under various businesses scene, for example, applying the network finance application scenarios of finance metering, using machine learning
Various lines on or line under application scenarios, such as electric business to image data carry out study reach to image carry out classifying and dividing field
Scape.In short, the system and method that this specification embodiment provides, do not carry out which kind of model constructed under which kind of business scenario
It limits, that is, the system and method that this specification embodiment provides, suitable for each under existing or future various businesses scene
Kind model.For convenience of description, this specification embodiment is illustrated the realization of scheme with the application scenarios of finance metering, can
To understand, it is only used as exemplary illustration, does not constitute the restriction to this specification embodiment.
Finance metering, the method for referring to integrated use mathematics, statistics and computer programming to solve monetary affair.
With the development of the network financial system (hereinafter referred to as: financial metering system) based on finance metering, traditional passing through purely is compiled
The developing direction of the unsuitable financial metering system of the mode of program writing code, this specification embodiment are intended to by utilizing figure
The Modeling Platform of data structure improves the efficiency of building and the execution of financial metering system model.
It referring to Figure 1, is the Modeling Platform system application scenarios signal based on graph data structure of this specification embodiment
Figure.The scene shows Modeling Platform system 10 (hereinafter referred to as: Modeling Platform system 10), upstream industry based on graph data structure
Business system 20 and user 30, wherein user 30 may be generally understood to model development personnel, and user 30 is according to upstream business system
20 demand carries out the foundation and operation of model in Modeling Platform system 10.Modeling Platform system 10, using visualization, figure
The method that shape writes model keeps the platform fine in such a way that complicated model is described in graph data structure
Ground provides patterned interface, reduces the difficulty of the modeling of user 30, meanwhile, the mode of this graph data structure also facilitates progress
The calculating and execution of model, improve the efficiency of model foundation and operation.
In a first aspect, this specification embodiment provides a kind of Modeling Platform system based on graph data structure.It should be based on figure
The Modeling Platform system of data structure constructs object module according to business demand for user, and so-called object module refers to flat
The model constructed on platform, it is accurate in order to state, it is referred to object module.
Fig. 2 is referred to, for the structural schematic diagram of the Modeling Platform system based on graph data structure.As shown in Figure 2, this is
System includes model list module 201, algorithm assembly module 202, graph structure module 203, interpreter module 204 and control centre's mould
Block 205.
The operation principle and process of modules is explained as follows below.
Model list module 201, for storing and showing that model list, model list include at least one preset model.
For meeting the plateform system of financial metering system business demand, model list module 201 is stored and is shown
Model list include but is not limited to following preset model: stochastic interest rate models, bond rate model, Risk Model, phase
Weigh pricing model, Asset Pricing Model etc..These preset models cover the various models of business demand substantially, straight for user
Selecting takes use.
Preset model has been determined, that is, can determine the data structure of model, in modeling process, has also needed to further determine that fortune
The algorithm and operation result of each operator (computing module) in row model, and finally obtain the calculated result of model.
Algorithm assembly module 202, for having stored and having shown each algorithm assembly of various algorithms built-in.
Still for meeting the plateform system of financial metering system business demand, algorithm assembly module 202 is stored and is shown
Each algorithm assembly include but is not limited to: maximum return algorithm assembly, minimum variation algorithm module matrix variance computational algorithm
Component, calculating standard deviation algorithm assembly etc., each algorithm assembly can be understood as realizing the component of some computing function, utilize group
The calculating of some particular problem can be achieved in part.
As described before, it is determined that preset model can determine whole data structure, for example, data structure includes 5
Operator, then, the specific implementation of each operator, then completed by the algorithm assembly of selection in this 5 operators.A kind of optional
A batch algorithm assembly is corresponded in mode, under each preset model, i.e., configures what the model may be used under each preset model
Algorithm assembly can quickly determine used algorithm assembly on the basis of determining preset model as a result,.
Graph structure module 203 generates and shows the target of graph data structure for determining preset model and algorithm assembly
Model, wherein each node indicates the operator in object module in graph data structure, and the connection relationship of each node indicates each
Data flow between operator.
Determine preset model and algorithm assembly implementation can there are many.For example, request analysis can be passed through
Mode, i.e. plateform system receive user modeling request, by the input parameter and configuration information in analysis request, from model list
Suitable preset model is matched in module, and, suitable component is matched from algorithm assembly module.Alternatively, can be by
User directly carries out the selection of preset model and algorithm assembly in plateform system, thereby determines that out preset model and algorithm assembly.
So-called graph data structure, it is possible to understand that be the structure determined by selected preset model, such as wrapped in model
5 nodes are included, then the connection relationship of this 5 nodes constitutes graph data structure.And each node represents an operator, the calculation
The specific implementation of son is completed by selected algorithm assembly.Connection relationship (" side " i.e. in figure) generation between each node
Data flow between each operator of table.
Figure interpreter module 204, for providing figure interpreter, figure interpreter is used for operator each in graph data structure
Algorithm data is converted into executable script, and determine each operator executes sequence.
Figure interpreter module 204, analyzes graph data structure, determines each node (operator) operation order in figure
And dependence, moreover, the algorithm data of each operator is converted to the executable script that system can be run.
Control centre's module 205 adjusts each operator for executing sequence according to operator each in object module
Degree, obtains the calculated result of object module.
Control centre's module 205 executes sequence according between operator, the operator that can currently carry out operation is put into is
Carry out operation in system, and monitor operation result, after pre-operator calculates, control centre's module 205 can go inquiry according to
The subsequent operator for relying this step to calculate, and subsequent operator is put into system and carries out operation, it so recycles, until a graph structure
On all operators run complete.
In order to construct object module, the graph data structure operation data process according to object module is needed, obtains calculating knot
Fruit.The algorithm data of each operator is analyzed and is explained by figure interpreter module 204, so that being converted to plateform system can
The executable script of operation, the script of each operator executes sequence in entire object module, such as can pass through topological sorting
Mode, by figure interpreter module 204 determine.On this basis, by control centre's module 205, according to holding for each operator
Row sequence, is successively scheduled each operator, after the scheduling for completing all operators, finally obtains the calculating knot of object module
Fruit.
For example, it is assumed that the preset model of user's selection includes 5 operators (such as operator a, b, c, d, e), and this 5 are calculated
Son has respectively corresponded 5 algorithm assemblies, then, by figure interpreter 204, the algorithm data of each operator is converted to executable foot
This, and determine this 5 operators execute sequence (such as sequence are as follows: a-b-d-c-e), then pass through control centre's module 205, according to
This 5 operators of secondary scheduling a-b-d-c-e, finally obtain the calculated result of object module.
In optional way, the Modeling Platform system based on graph data structure that this specification embodiment provides can also be wrapped
Include one or more of chart database module, result display module, Custom component module.Fig. 3 is referred to, is this specification
Another structural schematic diagram of Modeling Platform system based on graph data structure of embodiment first aspect.Compared with Fig. 2, which increases
Chart database module 206, result display module 207 and Custom component module 208 are added.It should be noted that above three
Binding relationship is not present in newly-increased module, can only increase any one or more modules on the basis of Fig. 2, for example, on the basis of Fig. 2
Only increase chart database module 206, be a kind of implementation, alternatively, increasing chart database module 206 and knot on the basis of Fig. 2
Fruit display module 207 is another implementation, etc..
In a kind of optional way, as shown in Figure 3, which further includes chart database module on the basis of Fig. 2
206.The chart database module 206 provides a chart database, and the chart database is for storing number caused by graph data structure
According to these data include but is not limited to the data flow of graph data structure, the execution sequence of each operator and the calculating of object module
The data such as a result.These data are stored in chart database, is conducive to control centre's module 205 and calculating process is supervised
Control.
In a kind of optional way, as shown in Figure 3, which further includes result display module on the basis of Fig. 2
207.The result display module 207 is for the intermediate result of each operator of graph data structure to be shown, if intermediate knot
Fruit is undesirable, and user can pass through the algorithm assembly of 205 update operator of control centre's module.
In a kind of optional way, as shown in Figure 3, which further includes Custom component mould on the basis of Fig. 2
Block 208.The Custom component module 208 is used to provide a user the programmed portal of Custom component, receives user's customized generation
Code, obtains Custom component;Wherein, graph structure module 203 is also used to according to the selected preset model of user, algorithm assembly
And Custom component, generate and show the object module of graph data structure.It is appreciated that Custom component module 208 is to calculation
A kind of supplement of method assembly module 202, when the algorithm assembly that plateform system provides is unsatisfactory for user demand, user can voluntarily be compiled
Code is write, realizes Custom component.
Fig. 4 is referred to, is Modeling Platform system example displaying schematic diagram of this specification embodiment based on graph data structure.
The example is shown for meeting the plateform system of financial metering system business demand.In Fig. 4, shown in left-hand column
Common model (corresponding foregoing model list block 201), which can be regarded as a public modeling tool collection, mention
It is selected for the model of various financial classes for user;Left-hand column also shows financial operator (corresponding aforementioned algorism assembly module 202),
The finance operator can be regarded as being integrated with the component of each algorithm, the computing function for each operator of support model.On the right side of Fig. 4
Main part shows the example of the object module of a graph data structure, includes obtaining fund market, index group in the example
Part, matrix mean value solve, covariance matrix solve, calculate this 5 operators of irrelevance, and by arrow line show each operator it
Between execute above-mentioned 5 operators in sequence, such as figure execute sequence are as follows: be first carried out and obtain fund market;Then square is carried out
Battle array mean value solves and covariance matrix solves, and on the basis of matrix mean value solves and covariance matrix solves, finally combines index
Component executes and calculates irrelevance.
With Fig. 4 example, a kind of Modeling Platform system optionally based on graph data structure that this specification embodiment is provided
System is illustrated.The optional plateform system includes all modules of earlier figures 3, therefore best performance.As shown in Figure 4, it should
Plateform system provides a graphical, modular Modeling interface and process, and the related data of the object module of user's creation is logical
A graph data structure is crossed to be shown and store.In node on behalf one complicated Financial Engineering model in graph data structure
One operator (computing module), the operator basic configuration information (such as input parameter, output parameter, document links, version letter
Breath etc.) it is stored in chart database.The specific implementation code that model executes can be looked into chart database by basic configuration information
It finds.Plateform system can provide the algorithm assembly of some basic Financial Engineering, also provide user by addition and make finance by oneself
Engineering Algorithm component carries out the exploitation that Java Python script edit completes Custom component.
User indicates the process of algorithm in entire complex model by the vertex in each computing module of connection.Entire figure
Calculated result be storable in chart database, facilitate inquiry and compile the information and relationship on each vertex in entire figure.
The detailed data realized to the algorithm of entire graph data structure and corresponding operator is converted to by a figure interpreter
Script can be performed in workflow.The realization of figure interpreter, it is possible to understand that be by being divided the information of the graph structure of algorithm description
Analysis, finds each node (operator of representative model) operation order and the dependence in figure, these information is stored in figure number
According in library.It is held by a workflow schedule center (aforementioned control centre's module) to dispatch each operator of entire complex model
Capable sequence and process.The working principle at workflow schedule center is, according to the information of the operator node of figure interpreter storage,
The operator that can carry out operation at present, which is put into system, carries out operation, and monitors operation result, has been calculated into when pre-operator
Later, workflow schedule center can go inquiry rely on this step calculate subsequent operator node, and place them into system into
Row operation.So circulation is completed until all operators on a graph structure are run.Workflow schedule center executes each operator
The intermediate result and output information of generation, and the corresponding vertex of respective algorithms component is updated accordingly, plateform system can be by result
It is shown and exports.Centre and final result that entire complex model calculates can also feed back to the data of graph structure, convenient
User's checking and inspection problem.
The workflow processing process of entire plateform system can for example be divided into following several parts:
(1) request analysis.
User modeling request is analyzed, input parameter and configuration information are obtained.
(2) model adaptation
According to input parameter and configuration information, the model of model list is adapted to, so that it is determined that graph data structure.
(3) workflow generation
The sequence of the execution of each operator in model is determined according to graph data structure.
(4) workflow execution
Sequence is executed according to determining each operator, executes the calculating process of each operator.The result of execution can carry out
Caching facilitates the value that front nodal is obtained for subsequent node.
(5) result treatment
The calculated result of generation is handled or shown, the ginseng that can be consumed for front end or upstream business system is generated
Number.
As it can be seen that the plateform system that this specification embodiment provides, using graph data structure as the data structure of model development,
The modularization of Modeling Platform system, graphical and visualization are realized, modeling complexity is reduced, improves modeling efficiency, and
And due to being prefixed model and algorithm assembly, user can be facilitated to call directly, write model code without user, it is time saving
It is laborsaving, further improve modeling efficiency.
Moreover, because standardization definition is carried out to operator by preset algorithm assembly, and the operator of these standardization can
Easily get through big data processing computing platform, big data computing platform can by the efficient processing capacity of mass data,
Accelerate the speed calculated, to greatly improve the handling capacity of single operator computational efficiency and entire model.
In addition, describing the process relationship between algorithms of different by graph data structure, it can know that entire complex model is calculated
Thus the flow direction of data between son can be improved and directly carry out data communication completion Data Migration between different data storage medium
Ability to mitigate the burden of platform processes data significantly, while can also be accelerated to calculate the same complex model in different platform
Efficiency.
Second aspect, based on the same inventive concept, this specification embodiment provide a kind of modeling based on graph data structure
Method, for carrying out the model foundation based on graph data structure according to preset model and algorithm assembly, referring to FIG. 5, the side
Method includes:
S501: determining preset model and algorithm assembly, generates and show the object module of graph data structure, wherein figure
Each node indicates the operator in object module in data structure, and the connection relationship of each node indicates the number between each operator
According to stream;
S502: executable script is converted into the algorithm data of operator each in graph data structure, and determines each operator
Execute sequence;
S503: sequence is executed according to operator each in object module, each operator is scheduled, object module is obtained
Calculated result.
In a kind of optional way, the above method further includes following steps: data flow, each operator to graph data structure
Execution sequence and object module one of calculated result or a variety of data stored.
In a kind of optional way, the above method further includes following steps: by the centre of each operator of graph data structure
As a result it is shown, and, according to the intermediate result of operator, update the algorithm assembly for being used for operator.
In a kind of optional way, the above method further includes following steps: providing a user being programmed into for Custom component
Mouthful, user's custom code is received, Custom component is obtained;According to the selected preset model of user, algorithm assembly and make by oneself
Adopted component generates and shows the object module of graph data structure.
In a kind of optional way, in the regulation goal model before the execution sequence of each operator, the above method
Further include following steps: topological sorting is carried out to the graph data structure, so that it is determined that the execution of script can be performed in each operator
Sequentially.
The third aspect, based on the inventive concept with the modeling method in previous embodiment based on graph data structure, the present invention
A kind of server is also provided, as shown in fig. 6, including memory 604, processor 602 and being stored on memory 604 and can locate
The computer program run on reason device 602, the processor 602 are realized described previously based on diagram data knot when executing described program
The step of either modeling method of structure method.
Wherein, in Fig. 6, bus architecture (is represented) with bus 600, and bus 600 may include any number of interconnection
Bus and bridge, bus 600 will include the one or more processors represented by processor 602 and what memory 604 represented deposits
The various circuits of reservoir link together.Bus 600 can also will peripheral equipment, voltage-stablizer and management circuit etc. it
Various other circuits of class link together, and these are all it is known in the art, therefore, no longer carry out further to it herein
Description.Bus interface 606 provides interface between bus 600 and receiver 601 and transmitter 603.Receiver 601 and transmitter
603 can be the same element, i.e. transceiver, provide the unit for communicating over a transmission medium with various other devices.Place
It manages device 602 and is responsible for management bus 600 and common processing, and memory 604 can be used for storage processor 602 and execute behaviour
Used data when making.
Fourth aspect, based on the inventive concept with the modeling method in previous embodiment based on graph data structure, the present invention
A kind of computer readable storage medium is also provided, computer program is stored thereon with, before being realized when which is executed by processor
The step of either the literary modeling method based on graph data structure method.
This specification is referring to the method, equipment (system) and computer program product according to this specification embodiment
Flowchart and/or the block diagram describes.It should be understood that can be realized by computer program instructions every in flowchart and/or the block diagram
The combination of process and/or box in one process and/or box and flowchart and/or the block diagram.It can provide these computers
Processor of the program instruction to general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices
To generate a machine, so that generating use by the instruction that computer or the processor of other programmable data processing devices execute
In setting for the function that realization is specified in one or more flows of the flowchart and/or one or more blocks of the block diagram
It is standby.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of equipment, the commander equipment realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Although the preferred embodiment of this specification has been described, once a person skilled in the art knows basic wounds
The property made concept, then additional changes and modifications may be made to these embodiments.So the following claims are intended to be interpreted as includes
Preferred embodiment and all change and modification for falling into this specification range.
Obviously, those skilled in the art can carry out various modification and variations without departing from this specification to this specification
Spirit and scope.In this way, if these modifications and variations of this specification belong to this specification claim and its equivalent skill
Within the scope of art, then this specification is also intended to include these modifications and variations.