CN110119936A - It is a kind of for determining the method and system of the degree of balance of digital resource item - Google Patents

It is a kind of for determining the method and system of the degree of balance of digital resource item Download PDF

Info

Publication number
CN110119936A
CN110119936A CN201910363744.2A CN201910363744A CN110119936A CN 110119936 A CN110119936 A CN 110119936A CN 201910363744 A CN201910363744 A CN 201910363744A CN 110119936 A CN110119936 A CN 110119936A
Authority
CN
China
Prior art keywords
user equipment
digital resource
user
resource item
predetermined quantity
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910363744.2A
Other languages
Chinese (zh)
Inventor
吴文斐
徐可
胡安保
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Vanadium Megatitanium Intelligent Technology Co Ltd
Original Assignee
Shanghai Vanadium Megatitanium Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Vanadium Megatitanium Intelligent Technology Co Ltd filed Critical Shanghai Vanadium Megatitanium Intelligent Technology Co Ltd
Priority to CN201910363744.2A priority Critical patent/CN110119936A/en
Publication of CN110119936A publication Critical patent/CN110119936A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/10Payment architectures specially adapted for electronic funds transfer [EFT] systems; specially adapted for home banking systems

Abstract

This application discloses a kind of for determining the method and system of the degree of balance of digital resource item, and wherein method comprises determining that in network the quantity of digital resource item possessed by the number of devices of user equipment and each user equipment are currently;Each user equipment in network is ranked up according to the descending order of the quantity of digital resource item, to obtain the list of devices of user equipment;All user equipmenies in list of devices are divided into first part and second part, user equipment each in the user equipment of the first predetermined quantity is determined as calculate node;User equipment in second part is divided into the group of user equipments of the second predetermined quantity, and group of user equipments each in the group of user equipments of the second predetermined quantity is determined as calculate node;The degree of balance that the calculate node of calculate node and the second predetermined quantity based on the first predetermined quantity carries out digital resource item calculates, using the degree of balance being calculated as the degree of balance of the digital resource item of user equipmenies all in network.

Description

It is a kind of for determining the method and system of the degree of balance of digital resource item
Technical field
The present invention relates to information technology fields, and relate more specifically to, a kind of for determining the balance of digital resource item The method and system of degree.
Background technique
Digital cash (Cryptocurrency) is a kind of electricity for creating, issuing and circulate by verification and cryptographic technique Sub- currency.Be born first item digital cash for 2009: bit coin.Hereafter, various digital cash come into being.In recent years Come, digital cash is increasingly big well-established.Hold digital cash and the people to participate in business is also more and more.
Currently, the digital cash that people are held is extremely non-uniform.In general, initially distribution team has occupied a large amount of number Word currency.In addition, certain connected transaction can also allow digital cash to focus in specific one or multiple accounts.Gini coefficient is The common counter of one assessment wealth gaps.The maximum value of Gini coefficient is " 1 ", and minimum value is " 0 ".Gini coefficient more connects Nearly 0 shows that Wealthy distribution tends to equality, and Gini coefficient then shows that Wealthy distribution more concentrates on a few peoples closer to 1 In hand.This kind of index of such as Gini coefficient can contribute to the social networking relationships of analysis digital cash, insider trading, association Transaction etc..
But develop at present biggish digital cash block data it is all very huge, such as bit coin (BTC), ether mill (ETH) etc..In this case, the difficulty of data is analyzed according to traditional means greatly.In addition, in the meter of following Gini coefficient In calculation mode,
The molecular moiety of Δ be cartesian product calculating (specifically the set of the data with cash in hand of all addresses and itself Set calculates).The time complexity of above-mentioned calculation is O (n2) index rank.Therefore, in such as bit coin (BTC), ether In the block chain data of the relevant magnanimity such as mill (ETH), it is very big that this calculation will lead to calculation amount, and therefore can consume Plenty of time.
Summary of the invention
In view of this, the object of the present invention is to provide a kind of big data processing platforms for relying on HIVE, with big data Means handle block chain address data, and Rational Simplification meets the Gini coefficient calculation process of digital cash feature, reduce error And computational efficiency is improved, finally obtain the Gini coefficient changed by month.
Detailed description of the invention
By referring to the drawings to the description of the embodiment of the present invention, the above and other purposes of the present invention, feature and Advantage will be apparent from, in the accompanying drawings:
Fig. 1 is the flow chart according to the method for the degree of balance for determining digital resource item of the embodiment of the present invention;
Fig. 2 is the structural schematic diagram according to the system of the degree of balance for determining digital resource item of the embodiment of the present invention;
Fig. 3 is the structural schematic diagram according to the system of the Gini coefficient of the calculating digital cash of the embodiment of the present invention;
Fig. 4 is the flow chart according to the method for the Gini coefficient of the calculating digital cash of the embodiment of the present invention;
Fig. 5 is the schematic diagram according to the calculated result of the embodiment of the present invention.
Specific embodiment
Below based on embodiment, present invention is described, but the present invention is not restricted to these embodiments.
Fig. 1 is the flow chart according to the method 100 of the degree of balance for determining digital resource item of the embodiment of the present invention.Such as Shown in Fig. 1, method 100 is since step 101 place.In step 101, to the number for storing all user equipmenies in network The database file of the intersection record of resource items is parsed, to determine the number of devices of user equipment and each user in network Equipment currently possessed by digital resource item quantity.In this application, digital resource item for example can be video file, audio File, document files, digital resource, processor resource, storage resource and digital cash etc..User equipment can be various types of The equipment of type, for example, mobile terminal, personal computer, laptop computer.In addition, user equipment can also refer to make With, represent or the equipment of control personal account, personal address, individual private possession resources bank etc..Alternatively, user equipment can directly refer to For personal account, personal address, individual private possession resources bank etc..Database file includes the table structure for storing intersection record, The table structure includes with properties: block height, interaction time, interaction mark, the quantity of digital resource item, interaction provide Side, interaction recipient and resource type.For example, saving the friendship of the digital resource item of all user equipmenies in network in HIVE Mutually record.Intersection record may include a plurality of record, and every record all have block height, interaction time, interaction mark, The quantity of digital resource item, interaction provider, the interaction attributes such as recipient and resource type.In addition, database file includes In network in all user equipmenies the identifier of each user equipment list.In this case, by each in list The identifier of user equipment can determine the number of devices of user equipment in network.Wherein, the degree of balance refers to multiple user equipmenies The balanced degree of the digital resource item possessed, such as Gini coefficient.
According to the quantity and use of digital resource item possessed by user equipment each at the initial time in statistical time section Each user equipment at end time of the every record to determine statistical time section in the table structure of storage intersection record The quantity of digital resource item possessed by current.For example, statistical time section is 5 days, and initial time is July 15 in 2015 Day.So, it is first determined the quantity of digital resource item possessed by July 15th, 2015 each user equipment.Then, to 2015 Every record between on July 20, on July 15, to 2015 is parsed, with the institute in determining 5 days statistical time sections There is intersection record.Finally, according in 5 days statistical time sections all intersection records and each user on July 15th, 2015 The quantity of digital resource item possessed by equipment determines digital resource item possessed by each user equipment on July 20th, 2015 Quantity.Using the quantity of digital resource item possessed by each user equipment as the current possessed number money of each user equipment The quantity of source item.
In step 102, each user equipment in network is arranged according to the descending order of the quantity of digital resource item Sequence, to obtain the list of devices of user equipment.It, can also be suitable according to the ascending order of the quantity of digital resource item in the scheme of substitution Each user equipment in ordered pair network is ranked up.
In step 103, all user equipmenies in list of devices are divided into first part and second part, wherein first The user equipment for the first predetermined quantity for dividing the quantity including digital resource item most, will be in the user equipment of the first predetermined quantity Each user equipment is determined as calculate node.For example, will include digital resource item in all user equipmenies in list of devices Each user equipment in 1000 most user equipmenies of quantity is determined as calculate node.Preferably, calculate node is to be used for Calculate the basic unit of the degree of balance of digital resource item.Wherein in first part in all user equipmenies each user equipment number The quantity of word resource items is all larger than in second part the quantity of the digital resource item of any user equipment in all user equipmenies.By Each user equipment in first part is the set of the most user equipment of the quantity of digital resource item, therefore first part In in all user equipmenies the quantity of the digital resource item of each user equipment be all larger than in second part in all user equipmenies The quantity of the digital resource item of any user equipment.It is determined as by user equipment each in the user equipment of the first predetermined quantity After calculate node, the quantity of the digital resource item of user equipment each in the user equipment of the first predetermined quantity is determined as phase The quantity of the digital resource item for the calculate node answered.For example, in 1000 user equipmenies that the quantity of digital resource item is most In each user equipment be determined as calculate node after, by the digital resource item of each user equipment in 1000 user equipmenies Quantity be determined as corresponding calculate node digital resource item quantity.
In addition, the application determines the first predetermined quantity and the second predetermined quantity according to preset configuration file.Example Such as, the first predetermined quantity is described in configuration file or the second predetermined quantity is 500,800,1000 or 1500 etc..Alternatively, this Shen The first predetermined quantity and the second predetermined quantity are please determined according to the quantity of user equipment in network.For example, as user in network When the quantity of equipment is greater than 100,000,000, the first predetermined quantity and the second predetermined quantity are determined as 1000, or as user in network The quantity of equipment is greater than 1,000 ten thousand and when less than 100,000,000, and the first predetermined quantity and the second predetermined quantity are determined as 800.
In step 104, the user equipment in second part is divided into the group of user equipments of the second predetermined quantity, and by second Each group of user equipments is determined as calculate node in the group of user equipments of predetermined quantity.Wherein, the user in second part is set Back-up is the quantity that the group of user equipments of the second predetermined quantity is according to the digital resource item of the user equipment in second part What descending order was grouped.That is, the quantity of each user equipment number resource items is greater than any user in the 2nd group in the 1st group The quantity of apparatus figure resource items, and and so on.By user equipment each in the group of user equipments of the second predetermined quantity Group is determined as after calculate node, by all user equipmenies in group of user equipments each in the group of user equipments of the second predetermined quantity Digital resource item quantity average value as corresponding calculate node digital resource item quantity.For example, it is inciting somebody to action All user equipmenies are divided into after 1000 group of user equipments in second part, determine that 1000 group of user equipments are respectively included All user equipmenies digital resource item quantity average value.By 1000 group of user equipments, respectively included institute is useful Quantity of the average value of the quantity of the digital resource item of family equipment as the digital resource item of corresponding calculate node.
In step 105, the calculate node of calculate node and the second predetermined quantity based on the first predetermined quantity carries out number The degree of balance of resource items calculates, using the degree of balance being calculated as the balance of the digital resource item of user equipmenies all in network Degree.The calculate node of calculate node and the second predetermined quantity wherein based on the first predetermined quantity carries out the balance of digital resource item Degree calculates
The degree of balance of the digital resource item of all calculate nodes is calculated using following formula,
Wherein, n is the total quantity of calculate node, and u is the average value of the quantity of the digital resource item of all calculate nodes, Yj For j-th of calculate node, YiFor i-th of calculate node, wherein 0 < j≤n, 0 < i≤n.
For example, when the quantity of user equipment is 162565838, if directly carrying out number to these user equipmenies The calculating of the degree of balance of resource items, then time-consuming will be very inconvenient as unit of day.Aforesaid way through this embodiment, by institute After having user equipment to sort from large to small according to the quantity of digital resource item, 1000 later user equipmenies are divided into 1000 Group, preceding 1000 user equipmenies remain unchanged, and 2000 calculate nodes or 2000 groups of data are obtained.This is because in network In, the characteristics of digital resource item, is the amount occupied of the user equipment on head greatly and distinguishes greatly, user equipment in the backward Digital resource item it is smaller and more close.In this way, by originally sum for 162565838 number of user equipment simplify in order to 2000, calculation amount greatly reduces, and resultant error is minimum.
It needs the digital resource item to 162565838 user equipmenies to be subtracted each other two-by-two in the prior art and takes absolutely Value.But in this application, above-mentioned processing is carried out to 2000 calculate nodes or 2000 groups of data, that is, by 2000 groups of data two After two subtract each other and take absolute value, multiplied by the number of user equipment in the group subtracted each other, to get having arrived originally, needs will be in two groups The data that data are subtracted each other two-by-two.If Yi、YjNumber of addresses in group is respectively m, n, uses the calculation method needs directly subtracted each other two-by-two Carry out m*n calculating, only need once to be subtracted each other with method provided herein, primary result multiplied by m calculating, once tie Fruit calculates three times altogether multiplied by the calculating of n.
Fig. 2 is the structural representation according to the system 200 of the degree of balance for determining digital resource item of the embodiment of the present invention Figure.System 200 includes: apparatus for initializing 201, collator 202, dividing device 203 and computing device 204.Wherein, initially The database file that the intersection record of 201 pairs of digital resource items for storing all user equipmenies in network is set in makeup carries out Parsing, to determine in network the number of digital resource item possessed by the number of devices of user equipment and each user equipment are currently Amount.Database file includes the table structure for storing intersection record, and the table structure includes with properties: block height is handed over Mutual time, interaction mark, the quantity of digital resource item, interaction provider, interaction recipient and resource type.For example, The intersection record of the digital resource item of all user equipmenies in network is saved in HIVE.Intersection record may include a plurality of record, And every record all has block height, interaction time, interaction mark, the quantity of digital resource item, interaction provider, interaction The attributes such as recipient and resource type.In addition, database file includes each user equipment in all user equipmenies in network Identifier list.In this case, by the identifier to user equipment each in list, it can determine in network and use The number of devices of family equipment.
According to the quantity and use of digital resource item possessed by user equipment each at the initial time in statistical time section Each user equipment at end time of the every record to determine statistical time section in the table structure of storage intersection record The quantity of digital resource item possessed by current.For example, statistical time section is 5 days, and initial time is July 15 in 2015 Day.So, it is first determined the quantity of digital resource item possessed by July 15th, 2015 each user equipment.Then, to 2015 Every record between on July 20, on July 15, to 2015 is parsed, with the institute in determining 5 days statistical time sections There is intersection record.Finally, according in 5 days statistical time sections all intersection records and each user on July 15th, 2015 The quantity of digital resource item possessed by equipment determines digital resource item possessed by each user equipment on July 20th, 2015 Quantity.Using the quantity of digital resource item possessed by each user equipment as the current possessed number money of each user equipment The quantity of source item.
Collator 202 arranges each user equipment in network according to the descending order of the quantity of digital resource item Sequence, to obtain the list of devices of user equipment.It, can also be suitable according to the ascending order of the quantity of digital resource item in the scheme of substitution Each user equipment in ordered pair network is ranked up.
All user equipmenies in list of devices are divided into first part and second part by dividing device 203, wherein first Part includes the user equipment of the first most predetermined quantity of the quantity of digital resource item, by the user equipment of the first predetermined quantity In each user equipment be determined as calculate node.For example, will include digital resource item in all user equipmenies in list of devices Most 1000 user equipmenies of quantity in each user equipment be determined as calculate node.Preferably, calculate node is to use In the basic unit for the degree of balance for calculating digital resource item.Wherein each user equipment in all user equipmenies in first part The quantity of digital resource item is all larger than in second part the quantity of the digital resource item of any user equipment in all user equipmenies. Since each user equipment in first part is the set of the most user equipment of quantity of digital resource item, first The quantity of the digital resource item of each user equipment is all larger than all user equipmenies in second part in all user equipmenies in point In any user equipment digital resource item quantity.It is determined by user equipment each in the user equipment of the first predetermined quantity After calculate node, the quantity of the digital resource item of user equipment each in the user equipment of the first predetermined quantity is determined as The quantity of the digital resource item of corresponding calculate node.For example, being set by 1000 most users of the quantity of digital resource item After each user equipment in standby is determined as calculate node, by the digital resource of each user equipment in 1000 user equipmenies The quantity of item is determined as the quantity of the digital resource item of corresponding calculate node.
In addition, the application determines the first predetermined quantity and the second predetermined quantity according to preset configuration file.Example Such as, the first predetermined quantity is described in configuration file or the second predetermined quantity is 500,800,1000 or 1500 etc..Alternatively, this Shen The first predetermined quantity and the second predetermined quantity are please determined according to the quantity of user equipment in network.For example, as user in network When the quantity of equipment is greater than 100,000,000, the first predetermined quantity and the second predetermined quantity are determined as 1000, or as user in network The quantity of equipment is greater than 1,000 ten thousand and when less than 100,000,000, and the first predetermined quantity and the second predetermined quantity are determined as 800.
User equipment in second part is divided into the group of user equipments of the second predetermined quantity by dividing device 203, and by Each group of user equipments is determined as calculate node in the group of user equipments of two predetermined quantities.Wherein, by the user in second part The group of user equipments that equipment is divided into the second predetermined quantity is quantity according to the digital resource item of the user equipment in second part Descending order be grouped.That is, in the 1st group each user equipment number resource items quantity be greater than the 2nd group in arbitrarily use The quantity of family apparatus figure resource items, and and so on.It is set by user each in the group of user equipments of the second predetermined quantity Standby group is determined as after calculate node, and all users in group of user equipments each in the group of user equipments of the second predetermined quantity are set Quantity of the average value of the quantity of standby digital resource item as the digital resource item of corresponding calculate node.For example, exist After user equipmenies all in second part are divided into 1000 group of user equipments, determine that 1000 group of user equipments are respectively wrapped The average value of the quantity of the digital resource item of all user equipmenies included.1000 group of user equipments are respectively included all Quantity of the average value of the quantity of the digital resource item of user equipment as the digital resource item of corresponding calculate node.
The calculate node of calculate node and second predetermined quantity of the computing device 204 based on the first predetermined quantity carries out number The degree of balance of resource items calculates, using the degree of balance being calculated as the balance of the digital resource item of user equipmenies all in network Degree.The calculate node of calculate node and the second predetermined quantity wherein based on the first predetermined quantity carries out the balance of digital resource item Degree calculates
The degree of balance of the digital resource item of all calculate nodes is calculated using following formula,
Wherein, n is the total quantity of calculate node, and u is the average value of the quantity of the digital resource item of all calculate nodes, Yj For j-th of calculate node, YiFor i-th of calculate node, wherein 0 < j≤n, 0 < i≤n.
For example, when the quantity of user equipment is 162565838, if directly carrying out number to these user equipmenies The calculating of the degree of balance of resource items, then time-consuming will be very inconvenient as unit of day.Aforesaid way through this embodiment, by institute After having user equipment to sort from large to small according to the quantity of digital resource item, 1000 later user equipmenies are divided into 1000 Group, preceding 1000 user equipmenies remain unchanged, and 2000 calculate nodes or 2000 groups of data are obtained.This is because in network In, the characteristics of digital resource item, is the amount occupied of the user equipment on head greatly and distinguishes greatly, user equipment in the backward Digital resource item it is smaller and more close.In this way, by originally sum for 162565838 number of user equipment simplify in order to 2000, calculation amount greatly reduces, and resultant error is minimum.
It needs the digital resource item to 162565838 user equipmenies to be subtracted each other two-by-two in the prior art and takes absolutely Value.But in this application, above-mentioned processing is carried out to 2000 calculate nodes or 2000 groups of data, that is, by 2000 groups of data two After two subtract each other and take absolute value, multiplied by the number of user equipment in the group subtracted each other, to get having arrived originally, needs will be in two groups The data that data are subtracted each other two-by-two.If Yi、YjNumber of addresses in group is respectively m, n, uses the calculation method needs directly subtracted each other two-by-two Carry out m*n calculating, only need once to be subtracted each other with method provided herein, primary result multiplied by m calculating, once tie Fruit calculates three times altogether multiplied by the calculating of n.
Fig. 3 is the structural schematic diagram according to the system 300 of the Gini coefficient of the calculating digital cash of the embodiment of the present invention.? In the present embodiment, it is illustrated by taking the Gini coefficient for calculating digital cash as an example.System 300 includes: to measure computing module with cash in hand 301, it polymerize address module 302 and Gini coefficient computing module 303 with cash in hand.Wherein, computing module 301 is measured with cash in hand according to block chain Transaction data, calculate each address (for representing everyone or each user) finally holding by each monthly variation Coin is to get to " wealth " that everyone holds described in Gini coefficient.
It polymerize the calculation amount that address module 302 with cash in hand is used to simplify Gini coefficient.The calculation method of existing Gini coefficient In, the calculative number of addresses of direct computing method is huge, and result can be obtained as unit of day by causing directly to calculate.Digital cash Amount with cash in hand meet following characteristics: the digital cash amount that head is occupied is very big, and quantitative difference is big, and gradually difference is close later, There is address of the extremely large amount of volume of holding close to 0 in tail portion.For this feature, the application will be grouped after all address sorts, be taken Gini coefficient is calculated after every group of average value.Also, the present processes are to the calculating error very little of Gini coefficient.
Gini coefficient computing module 303 calculates the base of digital cash according to following calculation formula with big data means Buddhist nun's coefficient:
Wherein, n is sample size (number of addresses of i.e. all addresses), the digital cash that u is held by all addresses Average value, Y are the amount with cash in hand of every group or each address.The Y value that system 300 calculates every group (is denoted as Y1、Y2、……Yi、Yj), N and u are calculated separately out on this basis, are then calculated the cartesian product of Y set, are finally calculated G.
Introducing system 300 calculates the process of the Gini coefficient of digital cash by taking digital cash ETH as an example.System 300 The table of the transaction record of digital cash is saved in HIVE.The structure of table includes: block height, exchange hour, transaction id, transaction Amount, transaction output side, transaction input side and currency type.System 300 obtains the data for holding digital cash of each address.Example Such as, finally obtaining number of addresses is 162565838, that is, representing the user that can hold digital cash or account has 162565838 It is a.All addresses are ranked up by system 300 from big to small by the amount with cash in hand for holding digital cash, and will sequence 1000 with Since all addresses afterwards be divided into 1000 groups (that is, being ordered as 1001 addresses), and sorts and protect in preceding 1000 addresses It holds constant.2000 groups of data are obtained.This is because the characteristics of being measured with cash in hand according to digital cash, the amount that head is occupied greatly and Greatly, the amount with cash in hand of address in the backward is smaller and more close for difference.In this way, system 300 will sum be originally 162565838 Number of addresses simplify for 2000 (1000 individual addresses and 1000 groups).Therefore calculation amount greatly reduces and result is missed Difference is minimum.
System 300 is according to calculating formula
Calculate the Gini coefficient of digital cash.Wherein n is total number of addresses, i.e. 162565838, u is that all addresses are measured with cash in hand Average value.Computational complexity is in the prior art
It needs that the amount with cash in hand of 162565838 addresses is subtracted each other and taken absolute value two-by-two in the prior art.And system 300 carry out the calculating of Gini coefficient using 2000 obtained data.After this 2000 data are subtracted each other and are taken absolute value two-by-two, Multiplied by the number of addresses in the group subtracted each other to get to the data for needing two-by-two to subtract each other the data in two groups in the prior art. If YiAnd YjNumber of addresses in group is respectively m and n, then the prior art needs to carry out m*n using the calculation method directly subtracted each other two-by-two Secondary calculating.System 300 of the invention only needs once to be subtracted each other, primary result multiplied by the calculating of m, primary result multiplied by n meter It calculates, calculates three times altogether.
Fig. 4 is the flow chart according to the method 400 of the Gini coefficient of the calculating digital cash of the embodiment of the present invention.Method 400 include the following steps:
Step 401: the record of transferring accounts of the block chain of digital cash is imported into HIVE.Record of transferring accounts may include: to produce ground Location is transferred to address, trading volume, block height, exchange hour, transaction id, trading volume and currency type.
Step 402: the amount with cash in hand of the digital cash of each address is calculated by SQL.The following are the example source codes of SQL:
Wherein by taking " ETH " as an example, the Gini coefficient of " ETH " is calculated._ time_ is calculated for controlling by the end of some time The amount with cash in hand of point, the amount with cash in hand of different time range can be calculated by changing this value.The too small transaction of trading volume is eliminated in calculating (less than 0.000001).Specific calculating logic is the transaction record selected by the end of _ time_, excludes the minimum friendship of trading volume Easily, trading volume is subtracted to produce address, to be transferred to address plus trading volume.
Step 403: all addresses are sorted from large to small according to amount with cash in hand.Preceding 1000 addresses are constant, and will be subsequent All addresses be divided into 1000 groups.
Step 404: the average value of every group of 1000 groups of data average amount and 2000 groups of data with cash in hand after calculating.
Step 405: preceding 1000 data being configured to set A, and rear 1000 groups of data are configured to set B.It will collection It closes A and set B merges into set C.Data in set C are subtracted each other two-by-two, take absolute value (i.e. in calculating formula | Yj-Yi|, Y is Each group of average value), and by absolute value multiplied by YiAnd YjNumber of addresses in group.Even Y is the element in set A, then multiplied by 1, If Y is the element in set B, multiplied by every group of number of addresses for being included in B.This process is the flute for calculating C set with C set Block youngster's product.Step 405 is the calculating in order to simplify following formula and reduces the error calculated:
Step 406: being calculated according to the following formula
The result of step 405 is added up, divided by 2n2U, n is total number of addresses herein, and u is averaged for what all addresses were measured with cash in hand Value.
The SQL of step 406 is writeable are as follows:
The occupation ratio of the characteristics of being measured with cash in hand due to digital cash, head is very high, and long-tail later even levels off to 0. Therefore retaining preceding 1000 addresses, subsequent address is divided into 1000 groups, and multiplied by including in group when difference between calculating every group Number of addresses can approximatively obtain the value of following formula:
Can be obtained by method 400 it is as shown in Figure 5, by the Gini coefficient tendency diagram data of the ETH of Monthly changes.Fig. 5 For according to the schematic diagram of the calculated result of the embodiment of the present invention, wherein abscissa is the time, and ordinate is Gini coefficient.Make With it is of the present invention calculate Gini coefficient method, by original exponential other complexity abbreviation for Constant Grade, and Influence very little to error.
The above description is only a preferred embodiment of the present invention, is not intended to restrict the invention, for those skilled in the art For, the invention can have various changes and changes.All any modifications made within the spirit and principles of the present invention are equal Replacement, improvement etc., should all be included in the protection scope of the present invention.

Claims (10)

1. a kind of method for determining the degree of balance of digital resource item, which comprises
The database file of the intersection record of digital resource item for storing all user equipmenies in network is parsed, To determine in network the quantity of digital resource item possessed by the number of devices of user equipment and each user equipment are currently;
Each user equipment in network is ranked up according to the descending order of the quantity of digital resource item, is set with obtaining user Standby list of devices;
All user equipmenies in list of devices are divided into first part and second part, wherein first part includes digital resource The user equipment of the first most predetermined quantity of the quantity of item, user equipment each in the user equipment of the first predetermined quantity is true It is set to calculate node;
User equipment in second part is divided into the group of user equipments of the second predetermined quantity, and by the user of the second predetermined quantity Each group of user equipments is determined as calculate node in equipment group;Calculate node and the second predetermined quantity based on the first predetermined quantity Calculate node carry out digital resource item the degree of balance calculate, using the degree of balance being calculated as user equipmenies all in network Digital resource item the degree of balance.
2. described according to the method described in claim 1, the database file includes the table structure for storing intersection record Table structure includes with properties: block height, interaction mark, the quantity of digital resource item, interaction provider, is handed over interaction time Mutual recipient and resource type.
3. according to the method described in claim 1, the database file includes each user in all user equipmenies in network The list of the identifier of equipment.
4. according to the method described in claim 2, wherein, according to user equipment each at the initial time in statistical time section institute Every record in the quantity for the digital resource item having and the table structure for storing intersection record is to determine statistical time area Between end time at each user equipment currently possessed by digital resource item quantity.
5. according to the method described in claim 1, wherein in first part in all user equipmenies each user equipment number The quantity of resource items is all larger than in second part the quantity of the digital resource item of any user equipment in all user equipmenies.
6. according to the method described in claim 1, being determined as by user equipment each in the user equipment of the first predetermined quantity After calculate node, the quantity of the digital resource item of user equipment each in the user equipment of the first predetermined quantity is determined as phase The quantity of the digital resource item for the calculate node answered.
7. according to the method described in claim 1, determining the first predetermined quantity and second according to preset configuration file Predetermined quantity;Or the first predetermined quantity and the second predetermined quantity are determined according to the quantity of user equipment in network.
8. according to the method described in claim 1, group of user equipments each in the group of user equipments of the second predetermined quantity is true It is set to after calculate node, by the number of all user equipmenies in group of user equipments each in the group of user equipments of the second predetermined quantity Quantity of the average value of the quantity of word resource items as the digital resource item of corresponding calculate node.
9. according to the method described in claim 1, the calculating of calculate node and the second predetermined quantity based on the first predetermined quantity The degree of balance that node carries out digital resource item, which calculates, includes:
The degree of balance of the digital resource item of all calculate nodes is calculated using following formula,
Wherein, n is the total quantity of calculate node, and u is the average value of the quantity of the digital resource item of all calculate nodes, YjFor jth A calculate node, YiFor i-th of calculate node, wherein 0 < j≤n, 0 < i≤n.
10. a kind of system for determining the degree of balance of digital resource item, the system comprises:
Apparatus for initializing, to the data library text of the intersection record of the digital resource item for storing all user equipmenies in network Part is parsed, to determine in network digital resource item possessed by the number of devices of user equipment and each user equipment are currently Quantity;
Collator is ranked up each user equipment in network according to the descending order of the quantity of digital resource item, with Obtain the list of devices of user equipment;
All user equipmenies in list of devices are divided into first part and second part by dividing device, and wherein first part wraps The user equipment of the first predetermined quantity of the quantity of digital resource item at most is included, it will be each in the user equipment of the first predetermined quantity User equipment is determined as calculate node;User equipment in second part is divided into the group of user equipments of the second predetermined quantity, and Group of user equipments each in the group of user equipments of second predetermined quantity is determined as calculate node;
The calculate node of computing device, calculate node and the second predetermined quantity based on the first predetermined quantity carries out digital resource item The degree of balance calculate, using the degree of balance being calculated as the degree of balance of the digital resource item of user equipmenies all in network.
CN201910363744.2A 2019-04-30 2019-04-30 It is a kind of for determining the method and system of the degree of balance of digital resource item Pending CN110119936A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910363744.2A CN110119936A (en) 2019-04-30 2019-04-30 It is a kind of for determining the method and system of the degree of balance of digital resource item

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910363744.2A CN110119936A (en) 2019-04-30 2019-04-30 It is a kind of for determining the method and system of the degree of balance of digital resource item

Publications (1)

Publication Number Publication Date
CN110119936A true CN110119936A (en) 2019-08-13

Family

ID=67520356

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910363744.2A Pending CN110119936A (en) 2019-04-30 2019-04-30 It is a kind of for determining the method and system of the degree of balance of digital resource item

Country Status (1)

Country Link
CN (1) CN110119936A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102419773A (en) * 2011-12-13 2012-04-18 百度在线网络技术(北京)有限公司 Method, device and equipment used for sequencing resource items
CN102955829A (en) * 2011-08-30 2013-03-06 北京百度网讯科技有限公司 Method, device and equipment for sequencing resource items
US20170017936A1 (en) * 2015-07-14 2017-01-19 Fmr Llc Point-to-Point Transaction Guidance Apparatuses, Methods and Systems
CN107066337A (en) * 2017-04-13 2017-08-18 百度在线网络技术(北京)有限公司 Determination method, device, equipment and the storage medium of equilibrium of stock
CN108520412A (en) * 2018-04-18 2018-09-11 北京天德科技有限公司 A kind of settle accounts calculation transaction towards block chain divides the design method of account algorithm

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102955829A (en) * 2011-08-30 2013-03-06 北京百度网讯科技有限公司 Method, device and equipment for sequencing resource items
CN102419773A (en) * 2011-12-13 2012-04-18 百度在线网络技术(北京)有限公司 Method, device and equipment used for sequencing resource items
US20170017936A1 (en) * 2015-07-14 2017-01-19 Fmr Llc Point-to-Point Transaction Guidance Apparatuses, Methods and Systems
CN107066337A (en) * 2017-04-13 2017-08-18 百度在线网络技术(北京)有限公司 Determination method, device, equipment and the storage medium of equilibrium of stock
CN108520412A (en) * 2018-04-18 2018-09-11 北京天德科技有限公司 A kind of settle accounts calculation transaction towards block chain divides the design method of account algorithm

Similar Documents

Publication Publication Date Title
CN104331411B (en) The method and apparatus of recommended project
CN103391302B (en) Information sending method and system
CN101355457B (en) Test method and test equipment
CN106897909A (en) A kind of electronic invoice printing and the cloud service system and method for storage
US20070282741A1 (en) Order system payment routing
CN106682878A (en) Designer matching platform and method
CN109584119A (en) Legal affairs handles system and method
JP2001516929A (en) Order processing apparatus and method
CN112633973A (en) Commodity recommendation method and related equipment thereof
WO2014159296A1 (en) A method, system and program product for matching of transaction records
CN109034988A (en) A kind of accounting entry generation method and device
CN108399191B (en) Personalized recommendation method for bidding information
Bagnoli The big data relevant market
WO2020244468A1 (en) Financial product recommendation method and apparatus, and electronic device and computer storage medium
CN109977316A (en) A kind of parallel type article recommended method, device, equipment and storage medium
CN110135978A (en) User&#39;s financial risks appraisal procedure, device, electronic equipment and readable medium
Eberlein et al. Multiple curve Lévy forward price model allowing for negative interest rates
CN102222060A (en) Receipt conversion device and receipt conversion method
Chen et al. Hesitant multi-attribute two-sided matching: A perspective based on prospect theory
CN109615172A (en) A kind of method and terminal handling examination data
Xian et al. A ranking function based on principal‐value Pythagorean fuzzy set in multicriteria decision making
Govindan et al. Structure theorems for game trees
CN110119936A (en) It is a kind of for determining the method and system of the degree of balance of digital resource item
CN116485391A (en) Payment recommendation processing method and device
CN109450963A (en) Information push method and terminal device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190813