[summary of the invention]
The technical problem to be solved in the invention is:
When company is there are when equity pledge, conventional method data store, data are synchronous, data in terms of time-consuming
It is long, for pledge risk carry out comprehensively, the assessment of system anticipation, stock invester can not understand the risk of company's equity pledge in time;
Relevant equity pledge data source can not be presented to stock invester, can not trace to its source and carry out information return visit, it is also difficult to which judgement is related
The confidence level of data;External interface is transferred slowly, poor user experience.
The present invention reaches above-mentioned purpose by following technical solution:
In a first aspect, the present invention provides a kind of methods of risk assessment of equity pledge, comprising:
The relevant various initial data of equity pledge in underlying database are synchronized to kudu data by Binlog process
In library;
Multilist association is carried out to the various initial data in kudu database by Impala SQL to calculate, and is obtained corresponding
Equity pledge intermediate result table;
The intermediate result table in kudu database is read by TAF process, according to the equity pledge number in intermediate result table
Redis is stored according to progress risk assessment operation, and by finally obtained risk evaluation result;
Equity pledge service content is provided by the external interface of TAF frame, so that user obtains corresponding risk assessment
As a result.
Preferably, the risk assessment operation specifically includes:
Based on the equity pledge data estimation exit price in the intermediate result table, and the share price pledged according to every is away from institute
The distance of exit price is stated, every risk score pledged is calculated;
The number of share of stock Zhan that every is pledged always is pledged into the ratio of number of share of stock as weight, by adding to the risk score that every is pledged
Power calculates, and obtains all the first integrated risk scorings pledged, determines stock so that user scores according to first integrated risk
Power pledges risk.
Preferably, in the risk score weighted calculation by pledging to every, all the first synthesis pledged are obtained
After risk score, the method also includes:
According to always pledging the corresponding risk factor of the ratio-dependent for accounting for shareholding equity, and score in conjunction with first integrated risk
With the risk factor, the scoring of the second integrated risk is obtained;
Confirmation form shareholder, which pledges, accounts for its ratio for holding capital stock, when pledging ratio more than preset ratio there are sub-thread east,
Increase preset value on the basis of the scoring of the second integrated risk and obtain the scoring of third integrated risk, so that user is according to the third
Integrated risk, which scores, determines equity pledge risk.
Preferably, the interface modes of the TAF frame external interface specifically:
TAF Protocol transfers interface;Alternatively, interface is transferred in HTTP post request.
Preferably, the initial data includes that listed company pledges bulletin content, equity pledge associated statistical information, listing
It is one or more in each shareholder's information of company, listed company's historical stock price and history suspension information;Wherein, the initial data
Data source include one or more in finance data, market data and crawler data.
Preferably, before carrying out risk assessment operation, the method also includes:
According to the corresponding data source location of various initial data, corresponding access link is established respectively, and be based on data source
Confidence level scoring is carried out to various initial data;
Then after carrying out risk assessment operation, the corresponding data source access link of each initial data and confidence level are scored
As a result, Redis is stored in the risk evaluation result, so as to user's acquisition.
Preferably, it is described based on data source to various initial data carry out confidence level scoring after, by various original numbers
According to confidence level appraisal result be compared with default score value, to judge the confidence level of various initial data;
Then when carrying out risk assessment operation, the initial data that confidence level scoring is less than default score value is abandoned, only root
It is calculated according to the initial data that confidence level scoring is more than or equal to default score value.
Preferably, before carrying out risk assessment operation, the method also includes:
The matching of data content is carried out to the same initial data from different data sources;If data content matching is different
It causes, then the corresponding information issuing time node of the same initial data by described from different data sources is compared, to sentence
Disconnected timing node it is successive;
Then when carrying out risk assessment operation, data of the timing node after of being subject to are calculated;Alternatively, continuing to sentence
The corresponding confidence level scoring of data of the timing node after of breaking, if the scoring of corresponding confidence level is more than or equal to default score value,
Data of the timing node after of being then subject to are calculated.
Preferably, when carrying out risk assessment operation, the risk evaluation result is arranged according to the timing node of operation
Time tag, and time tag is corresponded into the risk evaluation result and is stored in Redis together, so that the wind that user finally gets
Corresponding time tag is carried in dangerous assessment result.
Second aspect, the present invention also provides a kind of risk assessment devices of equity pledge, including at least one processor
And memory, it is connected between at least one described processor and memory by data/address bus, the memory is stored with can quilt
The instruction that at least one described processor executes, described instruction by the processor after being executed, for completing above-mentioned first party
The methods of risk assessment of equity pledge described in face.
Compared with prior art, the beneficial effects of the present invention are:
Equity pledge methods of risk assessment provided by the invention is synchronous using kudu, and basic primary data is passed through Binlog
Process Synchronization is handled up, distributed computing characteristic carries out multilist association and is calculated pair into kudu using the height of big data platform
The intermediate result table answered, then serviced by TAF and carry out complicated risk assessment operation, data processing time-consuming is short, obtained assessment
As a result stock invester can be helped to understand the risk of company's equity pledge, find the light of the beacon in chaos market;Meanwhile stock invester can also be straight
It obtains and relevant data source and confidence level is taken to score, be conducive to the confidence level for carrying out information return visit and judging data of tracing to its source,
Improve user experience.
Embodiment 1:
The embodiment of the present invention is based on equity pledge product development and goes out corresponding equity pledge function, provides a kind of equity matter
The methods of risk assessment of signature can help stock invester to understand company and pledge situation, forecasting risk.Wherein, equity pledge product here
The APP with correlation function is typically referred to, when user uses APP by intelligent terminal, the risk of equity pledge can be obtained
Assessment result.
As shown in Figure 1, methods of risk assessment provided in an embodiment of the present invention includes:
Step 10, the relevant various initial data of equity pledge in underlying database are synchronized to by Binlog process
In kudu database.
Data flow in equity pledge calculation process process as shown in connection with fig. 2 and equity pledge product shown in Fig. 3, bottom
Layer data library (MySQL database i.e. in figure) is mainly used to store the relevant various data of equity pledge of most original, referred to as
Initial data.The initial data includes that pledge bulletin content, equity pledge associated statistical information, listed company each for listed company
It is one or more in the data such as shareholder's information, listed company's historical stock price and history suspension information.The number of the initial data
It mainly include three aspect of finance data, market data and crawler data according to source;Wherein, finance data refers to that financial service quotient mentions
The data of confession, market data refer to that the data provided by market center, crawler data refer to the number of the offers such as each media, website
According to.
Herein, equity pledge storage calculate rely on big data platform can be used Hadoop, HDFS, ZOOKEEPER,
The associated components such as kudu and SPARK, combined data real-time synchronization component Binlog, by big data platform, face is carried out in use
Dimension degrades, convenient for developer's understanding and business development.Wherein, the embodiment of the present invention passes through in such a way that kudu is synchronous
Monitor the variation of MySQL database in real time, the various initial data of bottom can service same by MySQL Binlog process by TAF
It walks in kudu database, the kudu database is middle layer big data platform.
Step 20, multilist association is carried out to the various initial data in kudu database by Impala SQL to calculate, obtain
To corresponding equity pledge intermediate result table;
Wherein, the max calculation advantage of middle layer big data platform is that distributed computation ability and MapReduce are special
Property, can make it have quick reading mass data, carry out multilist correlation data query ability.Continuing with Fig. 2 and Fig. 3,
In middle layer big data platform, according to business demand, is handled up, distributed computing characteristic, passed through using the height of big data platform
The multilist that Impala SQL carries out mass data, which is associated with, to be calculated, and the information relevant to equity pledge being distributed in various tables is joined
Table checks out, and is stored in multiple new equity pledge product middle tables, obtains corresponding equity pledge intermediate result table, at data
Reason is rapid, time-consuming short.
Step 30, the intermediate result table in kudu database is read by TAF process, according to the equity in intermediate result table
It pledges data and carries out risk assessment operation, and finally obtained risk evaluation result is stored in Redis.
In embodiments of the present invention, for the part of complex logic operation in equity pledge, the later period by TAF service is needed
Processing.With continued reference to Fig. 2 and Fig. 3, after intermediate layer data connection table processing calculates, analyzed into middle layer TAF data, at this
In layer, TAF process will be exported the equity pledge data in intermediate result table from big data platform kudu database, and according to
Equity pledge data carry out complex logic operation, including risk assessment operation, early warning valence calculate, exit price calculates etc., and then will
In the risk evaluation result deposit Redis finally obtained, Convenient interface layer is read out.Complex logic in the embodiment of the present invention
Operation is mainly risk assessment operation, i.e., makees corresponding risk score according to the equity pledge situation of listed company, for user
With reference to.
Step 40, equity pledge service content is provided by the external interface of TAF frame, so that user obtains corresponding wind
Dangerous assessment result.
In embodiments of the present invention, by the stable high concurrent of external interface service offer of TAF Development of Framework to external
Mouthful, interface modes can be used TAF Protocol and transfer interface, i.e. TAF client call TAF services end interface;It can also make
Interface is transferred with HTTP post request, i.e. external service accesses result data collection by HTTP POST request, obtains Jason lattice
The risk evaluation result of formula, as shown in figure 4, more convenient, flexible, efficient to make user obtain data.In order to client deployment and
The convenience used, usually can externally provide equity pledge service content by HTTP interface, externally only need provide at this time only
One authentication service of Single port, with jason format returned data.
Wherein, the result data collection in Fig. 4 is exactly the data set of risk evaluation result, that is, corresponding equity pledge
APP product is capable of providing to the data of user, mainly includes listed company's stock code, current share prices, this listed company stock
Power pledges the scoring of situation overall risk, the nearest 1 year equity pledge stock quantity tendency of this listed company and every and weighs matter in option share
Give as security transaction data etc., described every phase equity pledge transaction data include again this pen pledges the shareholder that trades, this pen pledges number of share of stock,
This pen pledges that number of share of stock accounts for shareholder's shareholding ratio, this pen pledges early warning valence, this pen pledges exit price, each total matter of big shareholder's equity pledge
Give as security shareholding ratio shared by number of share of stock and each big shareholder's totality equity pledge etc..Therefore, pass through the external interface of TAF frame, Yong Huke
Any one of the above results data set equity pledge data are obtained, rather than just risk score;Specific to corresponding equity
It pledges on APP product, user can realize the switching of the display page by the movements such as clicking, sliding, thus browsable corresponding
Risk evaluation result.
Equity pledge methods of risk assessment provided in an embodiment of the present invention is in such a way that kudu is synchronous, the various originals of bottom
Beginning data, into kudu, carry out multilist association meter using the distributed computing characteristic of big data platform by Binlog Process Synchronization
Calculation obtains intermediate result table, then is serviced by TAF and carry out risk assessment operation, and data source is wide, calculates accurate quick, obtains
Assessment result can help stock invester to understand the risk of company's equity pledge, find the light of the beacon in chaos market;And pass through TAF
The external interface service of Development of Framework can provide the external interface of stable high concurrent, improve user experience.
In step 30, the process of the risk assessment operation can refer to Fig. 5, specifically include:
Step 301, based on the equity pledge data estimation exit price in the intermediate result table, and pledged according to every
Distance of the share price away from the exit price calculates every risk score pledged.
The step pledges carry out risk score to every, wherein the estimation of exit price is as follows: exit price=line/matter of closing a position
Give as security number of share of stock;=(total financing+financing interest * 30 daily assuming that being calculated according to 30 days primary pay interest, line of closing a position) * closes a position line ratio
Rate, line ratio of closing a position here generally take 140%.After determining exit price, each pen is pledged and calculates separately a risk
Scoring, such as: assuming that current share prices drop t% reach exit price, then when t >=50 when, scoring x be 0 point;As 0 < t < 50, comment
Dividing x is 100-2*t;As t≤0, scoring x is 100.Certainly, specific score value can flexible setting according to the actual situation, not only
One limits.
Step 302, the ratio for the number of share of stock Zhan that every is pledged always being pledged number of share of stock passes through the wind pledged to every as weight
Scoring weighted calculation in danger obtains all the first integrated risk scorings pledged, so that user comments according to first integrated risk
Divide and determines equity pledge risk.
The risk score x pledged in the step according to every carries out integrated risk scoring to all pledge.For any pen
For pledging, it is assumed that pledging number of share of stock is m strand, it is current it is all pledging number of share of stock be n strands, then the weight that this pledges is y=m/n*
100%.After determining the weighted value that every is pledged, all the first integrated risk scoring p pledged are every the sum of x*y pledged.
Wherein, mainly start with from price dimension in conjunction with Fig. 6, the step 301 and step 302, value-at-risk is counted
It calculates, the equity pledge data pledging basic data and being extracted from the intermediate result table in figure.In general, price factor is
The most important factor for influencing risk assessment can be directly stored in Redis after obtaining the first integrated risk scoring p by price, so as to
User obtains the first integrated risk scoring p by corresponding APP product, and then primarily determines equity matter according to scoring p
Give as security risk.
Step 303, according to always pledging the corresponding risk factor of the ratio-dependent for accounting for shareholding equity, and it is comprehensive in conjunction with described first
Risk score and the risk factor obtain the scoring of the second integrated risk.
In actual assessment, always the ratio of pledging is also an important concern index, when always pledging the total stock of number of share of stock Zhan
This ratio is excessive, once pledge risk, it will generate very serious consequence.Therefore, in addition to considering price factor, the step
Suddenly further start with from always pledging ratio dimension, value-at-risk is calculated.Ratio will always be pledged as a coefficient, i.e. risk
Coefficient g then considers after always pledging ratio that final score is the second integrated risk scoring F=p*g.
Further, since the total ratio of pledging is an important concern index, except being commented for calculation risk
Exceptionally, the equity pledge ratio trend graph in certain time dimension can be showed in a manner of curve graph herein, as shown in fig. 7,
When user obtains corresponding risk evaluation result, corresponding equity pledge ratio trend graph can be got simultaneously, help stock invester
Concern is overall to pledge risk.Wherein, the time dimension can flexible setting, such as settable nearest 1 year;If listing date
Not year and a day, then the time started can be counted from Time To Market.
Step 304, confirmation form shareholder, which pledges, accounts for its ratio for holding capital stock, is more than default when pledging ratio there are sub-thread east
When ratio, the second integrated risk scoring on the basis of increase preset value obtain third integrated risk scoring, so as to user according to
The third integrated risk, which scores, determines equity pledge risk.
In actual assessment, it also can be bigger risk that it is excessive, which to pledge ratio, for sub-thread east, therefore in this step into one
Step, which from sub-thread east pledges ratio dimension and starts with, to be carried out pledging statistics, is calculated value-at-risk;Scope of statistics is at present also in matter
Stock in signature is counted by shareholder, counts pledging for each shareholder and account for the shareholder institute share-holding ticket ratio.Wherein, the default ratio
Example and the preset value can flexible settings according to the actual situation, it is assumed that preset value a, when ratio is pledged in sub-thread east in the present embodiment
It is high risk when more than 50%, 20%~50% is risk, and 20% the following are low-risk, then preset ratio desirable 50%.Such as
Fruit has shareholder to pledge number of share of stock to account for its share-holding ticket ratio greater than 50%, then risk class needs to improve, can be by the second integrated risk
The F that scores increases a, obtains third integrated risk scoring F '=F+a;It can not adjust, can also increase when risk on the basis of former F
Add a value for being less than a, herein without limitation.
Meanwhile sub-thread east is pledged the data of ratio and can be also presented to the user, as shown in figure 8, when user obtains corresponding wind
When dangerous assessment result, corresponding sub-thread east can be got simultaneously and pledges ratio situation, stock invester can be helped to find out the ratio of pledging at a glance
Higher shareholder, knows risk in time.
In conjunction with Fig. 6 it is found that the embodiment of the present invention pledges ratio from price, always respectively and three dimensions of ratio are pledged in sub-thread east
Start with, comprehensively considered and pledge related many factors, using complicated logical algorithm calculate one it is simple as a result,
I.e. final risk score F ', and then help what stock invester understood the said firm at a glance to pledge risk.
Further, for risk evaluation result is more intuitively presented to stock invester, final third integrated risk can be commented
The division for dividing F ' to carry out risk class, F ' is smaller, and risk class is lower, and F ' is bigger, and risk class is higher.By taking Fig. 9 as an example, pledge
Risk is divided into five grades by low-risk to high risk, and currently pledging risk class is high risk.Wherein, different risk etc.
Grade can be indicated in figure with different colors, for example, can gradually deepen from low-risk to high risk color, until high risk Shi Weishen
Red, then pass through the gradual change and comparison of color, and visual effect further enhances, stock invester can be made more intuitively to recognize and pledge wind
Danger.
In conclusion methods of risk assessment through the embodiment of the present invention, corresponding equity pledge APP can be used to produce for user
Product get required risk evaluation result of pledging, corresponding risk score and risk class be presented on the display page for
Family browsing.Meanwhile corresponding equity pledge ratio trend graph can be also browsed by page switching, ratio data is pledged in sub-thread east
And other relevant equity pledge initial data etc., obtain various information.
With continued reference to Fig. 2 it is found that data source comes from tripartite, then out one may further be fed back for the respective source of data
The confidence level of a channel scores, and especially for crawler data, acquisition modes are from each online media sites, and data really have
There are biggish uncertainties for effect property.Therefore, before carrying out risk assessment operation, the method also includes:
According to the corresponding data source location of various initial data, corresponding access link is established respectively, and be based on data source
Confidence level scoring is carried out to various initial data.Wherein, it establishes access link and is easy for user's subsequent access;Confidence level scoring can
It is carried out according to the accuracy of the historical data in corresponding data source, for example, for the data that some websites in crawler data provide,
Learn that the information accuracy rate of the website is higher according to historical statistics, then corresponding initial data can give higher confidence level and comment
Point, it is on the contrary then give lower confidence level and score;Market data and finance data can also be used similar means and carry out.
Then after carrying out risk assessment operation, can directly by each initial data and corresponding data source access link and
Confidence level appraisal result is stored in Redis with the risk evaluation result.Therefore, when the subsequent browsing risk assessment knot of user
When fruit, data source location and its confidence level scoring can be obtained to a deep level.For example, when user is to the risk assessment knot of presentation
When fruit interface carries out single-click operation, it may occur that the content that the switching at interface forms data source is presented, and gives corresponding data source
Access link and confidence level appraisal result allow user not only to obtain finally to give the return visit function of user's corresponding informance
Risk evaluation result also can be traced to source and obtain corresponding data source.Further, after carrying out risk assessment operation,
It can also be scored based on the confidence level of various initial data, confidence level comprehensive score be carried out to obtained risk evaluation result, and deposit
Enter Redis, so as to user's acquisition.
Wherein, for the lower initial data of confidence level scoring, if continuing on for subsequent risk assessment operation, undoubtedly
It will affect the accuracy of ultimate risk assessment result.Therefore, a score value can be preset according to the actual situation as reference, i.e.,
Default score value;It is generally believed that the initial data confidence level that confidence level scoring is more than or equal to default score value is higher, confidence level is commented
Divide the initial data confidence level for being less than default score value lower.Various initial data are carried out based on data source described as a result,
After confidence level scoring, the confidence level appraisal result of various initial data can be compared with default score value, it is each to judge
The confidence level of kind initial data;Then when carrying out risk assessment operation, confidence level scoring is less than to the original number of default score value
According to discarding, the initial data for being more than or equal to default score value according only to confidence level scoring is calculated, to ensure final result
Accuracy.
Further, since the data of stock market update comparatively fast, for same data, newest data are more practical
Property.Accordingly, it is considered to the matter of time of data is arrived, before carrying out risk assessment operation, the method also includes:
The matching of data content is carried out to the same initial data from different data sources;If data content matching is different
It causes, then the corresponding information issuing time node of the same initial data by described from different data sources is compared, to sentence
Disconnected timing node it is successive.Then when carrying out risk assessment operation, data of the timing node after of being subject to are calculated.Example
Such as, each shareholder's information of company A can be obtained from three data sources (i.e. market data, finance data and crawler data), then will
The information under three data sources carries out the matching of data content, if matching is consistent, i.e. A of the explanation from different data sources is public
Take charge of each shareholder's information be all it is identical, then illustrate that the accuracy of the information is higher, can be directly used for subsequent risk assessment operation;And
If matching is inconsistent, the issuing time node of the information in further relatively three data sources is needed, if market data
Issuing time is later than finance data and is later than crawler data, then it is newest to can determine whether that each shareholder's information of the company A in market data belongs to
Data, accuracy is higher, therefore each shareholder's information of company A in market data is used for subsequent risk assessment operation.
Wherein, it is the accuracy for further ensuring that data, can also increases confidence level on the basis of timing node judges and comment
Sentence, i.e., after the timing node of completeer each data, continue to judge the corresponding confidence level scoring of data of the timing node after,
If corresponding confidence level scoring is more than or equal to default score value, data of the timing node after of being subject to are calculated;
If corresponding confidence level scoring is not (being less than default score value) up to standard, even if timing node also not uses rearward.For example,
After the above-mentioned each shareholder's information for judging company A in market data belongs to latest data, further compare the credible of the data
The size of degree scoring and default score value;If confidence level scoring is more than or equal to default score value, can continue to use the data
Carry out operation;If confidence level scoring is less than default score value, the accuracy of the data decreases, can have to take the second best,
The data of timing node time rearward are selected, and repeat above-mentioned Appraisal process.
Except above by comparing under different data sources in addition to the information issuing time node of initial data of the same race, in optional side
In case, a preset time point can be also directly taken according to demand, when carrying out risk assessment operation, by the information issuing time described
Data filtering before preset time point falls, and chooses data of the information issuing time after the preset time point and is counted
It calculates, it is ensured that the actual effect of data.For example, the data that can be chosen within nearly one month are calculated, pervious data are temporary within one month
Do not consider.
It being updated comparatively fast accordingly, due to the data of stock market, various initial data may constantly updated, therefore for
The risk assessment operation of equity pledge is also to regularly update, for example updated once per several hours, or update daily primary;
Newer assessment result, it is believed that effective stronger, reference significance is bigger.It therefore, can root when carrying out risk assessment operation
Time tag is arranged to the risk evaluation result according to the timing node of operation, and time tag is corresponded into the risk assessment knot
Fruit is stored in Redis together, so that carrying corresponding time tag in the risk evaluation result that user finally gets.Namely
It says, when user passes through APP products browse risk evaluation result, corresponding assessment result can be presented simultaneously by showing on the page is generated
Time, for example, the page shows that corresponding assessment result is according to the data statistics before 1 hour, user can determine whether the assessment knot
Fruit is relatively new, therefore has biggish reference value.
By the above method, stock invester can directly acquire relevant data source and confidence level scoring according to risk evaluation result,
The return visit function of giving user's corresponding informance, is conducive to user and traces to its source, and more intuitively judges the confidence level of data, avoids touching
Thunder risk.Meanwhile increasing the judgement of timing node and the setting of time tag, it can be ensured that the actual effect of data, and then ensure to comment
Estimate the actual effect of result, increases reference value.