Summary of the invention
In order to solve prior art problem, the present invention provides a kind of data processing methods based on block chain, server
And system, it can satisfy the demand of the processing of energy internet mass transmission of transaction data, node data compression storage.
Data processing method provided in an embodiment of the present invention, is applied to charging pile system, and the charging pile system includes more
A charging pile and server cluster, the Transaction Information of the multiple charging pile broadcast of server cluster real-time reception;The method,
Include:
Determine that the storage rule of this round, the storage rule of described round include being responsible for epicycle in the server cluster
Multiple server infos of secondary storage and the storage order of the multiple server;
Each server is perform the following steps in sequence according to the storage order of this round in the multiple server: according to pre-
If the Transaction Information set received in the period, into the multiple server, remaining server initiates common recognition, the common recognition
It is whether effective for verifying the Transaction Information set;If the common recognition result of remaining server feedback shows the Transaction Information
Set effectively, then generates block and stores the Transaction Information set, so that the Transaction Information set is total in the server cluster
It enjoys;Each server only generates a block in a round;
When distribution server generates block, the distribution server determines the storage rule of next one, described next
The storage rule of round includes the server info and next one clothes for being responsible for next one storage in the server cluster
The storage order of business device, the distribution server are the server of the last one generation block of this round;
The storage rule of the next one is stored in the block of generation by the distribution server, so that the storage is advised
Then shared in the server cluster.
Optionally, further includes:
When the distribution server generates block, the distribution server determines altogether according to target transaction information aggregate
Enjoy data, the target transaction data acquisition system is whole Transaction Informations of the multiple server storage, unit it is shared
The process resource of the corresponding unit of data;
The distribution server is split as multiple shared subdatas according to preset allocation rule, by the shared data,
Each server corresponds in the shared subdata and the multiple server;
The distribution server is corresponded according to server each in the shared subdata and the multiple server
Relationship obtains shared data distribution information;
The distribution server distributes the shared data to information preservation in the block of generation, so that the shared number
It is shared in the server cluster according to distribution information.
Optionally, the preset allocation rule is mean allocation.
Optionally, the feedback server distributes information, the determining and feedback server pair according to the shared data
The shared subdata answered, the feedback server are any one in the multiple server;
The feedback server generates multiple shared marks according to corresponding shared subdata, and a shared mark corresponds to
The shared subdata of one unit;
The feedback server shares the multiple shared mark of generation in the server cluster;
It is current by storing when the Transaction Information that the server cluster receives includes at least one described shared mark
At least one described described shared mark is stored in the block of generation by the server of the Transaction Information of reception, so as to
Process resource corresponding at least one described described shared mark is sent to the feedback server, the processing of a unit
The shared subdata of the corresponding unit of resource.
Server provided in an embodiment of the present invention is applied to charging pile system, and the charging pile system includes multiple chargings
Stake and server cluster, the Transaction Information of the multiple charging piles broadcast of the server cluster real-time reception and in the form of block chain
Minute wheel time storage is carried out to the Transaction Information, the server cluster includes the server;The server, comprising: letter
Cease receiving module, judgment module, common recognition processing module, data processing module and regular determining module;
The information receiving module, the storage rule of the transaction data and this round broadcasted for real-time reception charging pile,
The storage rule of described round includes the server info and this round for being responsible for the storage of this round in the server cluster
The storage order of server;
The judgment module judges whether to participate in the storage of this round for the storage rule according to described round;Also use
In the storage rule according to described round, judge whether the storage order of this round is N, the N is the server cluster
The middle number of servers for participating in the storage of this round;It is also used to the storage rule according to described round, judges whether to be responsible for current
The storage of moment transaction data;
The common recognition processing module is to participate in be responsible for current time number of deals for the judging result when the judgment module
According to storage when, the Transaction Information set received within a preset period of time according to the information receiving module, to the multiple
Remaining server initiates common recognition in server, and whether the common recognition is effective for verifying the Transaction Information set;It is also used to receive
The common recognition result of feedback;
The data processing module, for showing the Transaction Information when the received common recognition result of common recognition processing module
When gathering effective, generates block and store the Transaction Information set that the information receiving module receives within a preset period of time, with
Share the Transaction Information set in the server cluster;Each server only generates a block in a round;
It is also used to when the storage order that the judging result of the judgment module is this round is N, the storage rule of next one is protected
There are in the block of generation, so that the storage rule is shared in the server cluster, the storage rule of the next one
Including being responsible for the server info of next one storage and the storage order of next one server in the server cluster;
The rule determining module, for when the storage order that the judging result of the judgment module is this round is N,
Determine that the storage rule of next one, the storage rule of the next one include being responsible for next one in the server cluster
The server info of storage and the storage order of next one server.
Optionally, further includes: data acquisition module;
The data acquisition module, for obtaining the transaction data of the server cluster storage;
The data processing module is also used to when the storage order that the judging result of the judgment module is this round be N
And the data processing module is when generating block, according to target transaction information aggregate, determines shared data, unit it is shared
The process resource of the corresponding unit of data, the target transaction data acquisition system are to take described in the storage round of the server
Whole Transaction Informations of business device cluster-based storage;It is also used to be split as the shared data multiple according to preset allocation rule
Shared subdata, the shared subdata are corresponded with server each in the multiple server;It is also used to according to
Each server one-to-one relationship in shared subdata and the multiple server obtains shared data distribution information;Also use
In distributing the shared data to information preservation in the block of generation, so that the shared data distributes information in the service
It is shared in device cluster.
Optionally, the preset allocation rule is mean allocation.
Optionally, further includes: information identification module and resource processing module;
The data processing module is also used to distribute information, the determining and feedback server according to the shared data
Corresponding shared subdata, the feedback server are any one in the multiple server;It is also used to according to corresponding total
Subdata is enjoyed, multiple shared marks, a shared shared subdata for identifying a corresponding unit are generated;It is also used to generate
The multiple shared mark is shared in the server cluster;
The information identification module is to participate in be responsible for current time number of deals for the judging result when the judgment module
According to storage when, identify that the information receiving module receives the data content for including in Transaction Information;
The resource processing module, for determining that the Transaction Information includes described at least one when the information identification module
When shared mark, at least one described described shared mark is stored in the block of generation, so as to will with it is described at least one
The corresponding process resource of the shared mark is sent to the feedback server, the corresponding unit of the process resource of a unit
Shared subdata.
A kind of data processing system based on block chain provided in an embodiment of the present invention, including at least three above-described embodiments
Described in server.
Compared with prior art, the present invention has at least the following advantages:
In embodiments of the present invention, the transaction data of charging pile broadcast is stored in service with the structure distribution formula of block chain
In each server in device cluster, solves the problems, such as data high concentration.Only by a service in server cluster
Device is responsible for storing the transaction data that charging pile is broadcasted within a preset time, slows down (the store transaction number of block in server cluster
According to region) growth rate, can satisfy the processing of magnanimity transmission of transaction data in energy network, node data compression storage
Demand.After block generates, the data saved can not be modified, and ensure that the public letter property and safety of data storage.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention
Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only this
Invention a part of the embodiment, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art exist
Every other embodiment obtained under the premise of creative work is not made, shall fall within the protection scope of the present invention.
Currently, China's ev industry develops rapidly, and China's new-energy automobile ownership has reached nearly 550,000.It is public
It is to solve at this stage or even from now on electric vehicle trip charging mileage misgivings, trip is provided mends electricity with half public electrically-charging equipment network
The problems such as effective way.So far, China has built up father-in-law's charging pile 8.2 ten thousand, and it is high to build up " a four vertical two horizontal rings "
Fast fast charge network, electrically-charging equipment network begin to take shape.However there is substantial portion of charging equipment to be in idle state, reason in addition to
The layout of buildings of charging equipment is not reasonable outer, since charging equipment operator uses on the market the means of payment is not quite similar institute
Caused payment is inconvenient, is another major reason.Along with the operation of most charging equipments is unattended
It is completed under application scenarios, therefore a kind of unified means of payment is at least provided, independent of the specific charging equipment fortune of a certain family
The charging equipment of battalion quotient charges and realizes payment function, on the one hand brings in electric car charging process for user quick
Convenient payment experience, on the other hand but also user can arbitrarily select charging equipment accomplish with to, with fill, with payment without
It must consider the problems of charge, can pay, improve automobile user charging payment convenience, and then improve charging
The utilization rate of equipment.
In addition, energy internet is the emphasis of following China's energy field work, the energy internet that faces the future is " laterally more
Under energy complementation, longitudinal source-net-lotus-storage " coordination optimization mode, the open informations network such as internet will play bigger effect,
Grid company electric power payment client, the means of payment, payment flow etc. are both needed to be adjusted correspondingly to shake down
Demand.However grid company portfolio is huge, user group's numerous types, this makes using existing data processing method, nothing
Method adapts to the demand of energy internet, and there are the risk of data high concentration and the storage insufficient problems in section.
For this purpose, data processing method provided in an embodiment of the present invention, server and system, can generate charging equipment
Mass data is managed and stores, and being stored in for the data distribution formula generated on charging equipment in charging pile alliance is different
In server, to meet the needs of magnanimity transmission of transaction data processing, node data compression storage.In the base of the embodiment of the present invention
On plinth, light-weight authentication mechanism and unified payments mechanism can also be designed, improve the payment efficiency of user, safety of guaranteeing payment,
Enhance block chain scalability, promote the problems such as charging pile utilization rate, management and control payment risk design solution.
Based on above-mentioned thought, in order to make the foregoing objectives, features and advantages of the present invention clearer and more comprehensible, below with reference to
Specific embodiments of the present invention will be described in detail for attached drawing.
Embodiment of the method one:
Referring to Fig. 1, which is the flow diagram of data processing method embodiment one provided by the invention.
Data processing method provided in this embodiment is applied to charging pile system, and charging pile system includes multiple charging piles
And server cluster, the Transaction Information of the multiple charging pile broadcast of server cluster real-time reception.
It is understood that the Transaction Information that each charging pile is generated in charging pile system to server cluster into
Row the whole network is broadcasted, any one server in server cluster can receive the Transaction Information of each charging pile broadcast.
Method provided in this embodiment, specifically comprises the following steps S101-S104:
S101: determine that the storage rule of this round, the storage rule of this round include being responsible for this round in server cluster
Multiple server infos of storage and the storage order of multiple servers.
It should be noted that being responsible for round data storage to guarantee the accurate and effective of the transaction data received
Server both participate in data common recognition process, when the server for participating in the storage of this round all reaches altogether the Transaction Information of common recognition
Know, then explanation be responsible for the round data storage server received by transaction data it is authentic and valid can carry out book keeping operation deposit
Storage.
In the actual operation process, if Servers-all carries out the processing of transaction data in server cluster, in order to protect
The accurate of the transaction data received is demonstrate,proved, then needs Servers-all in server cluster to both participate in common recognition, each server is equal
Recognize to initiate the true, effective of transaction data received by the server of common recognition, i.e., Servers-all is equal in server cluster
Reach common understanding.Although above-mentioned common recognition method can guarantee the effective of storing data to the greatest extent, server cluster will lead to
Overhead is excessive, and common recognition process is complicated, time-consuming.Therefore, by carrying out minute wheel time storage, setting to received transaction data
By participating in the server (participating in the server of common recognition in this round) of data storage, Ke Yi in server cluster in every round
Guarantee data storage it is just with accurately on the basis of, improve the efficiency of data processing.
It should also be noted that, every round is responsible for the server of storage and its storage order can be deposited by being responsible for last round of time
The server of storage is determined from server cluster.
S102: each server is perform the following steps in sequence according to the storage order of this round in multiple servers: according to
The Transaction Information set received in preset time period, into multiple servers, remaining server initiates common recognition, to verify the friendship
Whether easy information aggregate is effective;If the common recognition result of remaining server feedback shows that the Transaction Information set is effective, generate
Block stores the Transaction Information set, so that the Transaction Information set is shared in server cluster.
In the actual operation process, the duration of preset time period can specifically be set according to actual needs, such as 1 second.Separately
Outside, common recognition can be realized using Byzantine failure tolerance algorithm.
Be responsible for storage server according to the Transaction Information set received in preset time period, into multiple servers its
Remaining server initiates common recognition, i.e., the Transaction Information received in first second store multiple servers by being responsible for this round first
A server, which is responsible for being packaged to remaining server for being responsible for the storage of this round, initiates common recognition.After knowing together successfully, it is responsible for storage
Server generates block and is stored in the Transaction Information received in first second.Then, the Transaction Information received in second second
It is responsible for being packaged to remaining server for being responsible for the storage of this round from second server of this multiple server and initiates to know together, and
Block, which is generated, after knowing together successfully is stored in the Transaction Information received in second second.Each server only generates in a round
One block.
It is understood that the server for participating in common recognition all agrees to the authenticity and validity of the data of common recognition, then
It knows together successfully.By a round storing process, the transaction data of charging pile broadcast is averagely stored in each service for participating in storage
In device, the data of storage are authenticated through multiple servers, and data are true, effective.
It should also be noted that, the data saved can not be modified after block generates, this guarantees the public affairs of data storage
Letter property and safety.
S103: when distribution server generates block, distribution server determines the storage rule of next one, next one
Storage rule include that the server info for being responsible for next one storage in server cluster and next one server are deposited
Order is stored up, distribution server is the server of the last one generation block of this round.
In the present embodiment, when the server that this round is responsible for storage generates block, the storage of this round terminates.By this
The server (i.e. distribution server) that the last one in round generates block determines the storage rule server cluster of next one
The middle server for participating in next one storage and its storage order.
It should be noted that in the actual operation process, those skilled in the art can set from clothes according to the actual situation
The book keeping operation sequence for the server that each round participates in the mode for the server kept accounts and every round is selected is selected in business device cluster,
The present embodiment is limited in any way not to this, is not also enumerated herein.
S104: the storage rule of next one is stored in the block of generation by distribution server, so that the storage rule
It is shared in server cluster.
In the present embodiment, distribution server saves the storage rule of next opinion analysis of generation within a block, not only may be used
So that in server cluster any one server determine whether participate in common recognition, can also subsequent reads fetch according to when, determine number
According to storage location.By connecting before and after storage rule between the block that every server generates in server cluster, area is formed
Block chain structure.
Data processing method provided in this embodiment based on block chain, the transaction data of charging pile broadcast is with block chain
In each server of structure distribution formula being stored in server cluster, solves the problems, such as data high concentration.Only by
A server in server cluster is responsible for storing the transaction data that charging pile is broadcasted within a preset time, slows down server
The growth rate of block (regions of store transaction data), can satisfy in energy network at magnanimity transmission of transaction data in cluster
Reason, the demand of node data compression storage.In addition, since the storage of data is to ensure that data on the basis of common recognition is successful
Storage it is just with it is accurate.After block generates, the data saved can not be modified, and ensure that the public letter property and safety of data storage
Property.
In order to facilitate understanding, below by for charging pile book keeping operation for combine concrete scene to data provided in this embodiment at
Reason method is illustrated:
Firstly, the number of deals that every charging equipment is generated in charging pile system (being referred to as charging pile alliance)
The whole network broadcast is carried out according to the server cluster into charging network, any one server, which can receive, in server cluster fills
The data of electric equipment broadcast.Wherein, charging pile is the transaction node (hereinafter referred to as transaction node) of charging pile alliance, server set
Group includes the more servers for store transaction data (hereinafter referred to as keeping accounts), and server is the book keeping operation section in charging pile alliance
Point (hereinafter referred to as accounting nodes).
Secondly, first determining the recording rules of this round in every round, i.e., being responsible for by which server in server cluster
The storage order of the storage of this round and server, then successively by the accounting nodes for being responsible for the book keeping operation of this round in server cluster
Generate the transaction data that block storage receives.Specifically, the transaction data that accounting nodes will receive in current slot
It is packaged, initiates common recognition to remaining accounting nodes that this round stores are participated in, know together and successfully illustrate that remaining accounting nodes are all same
The validity for the transaction data that meaning is packaged.After knowing together successfully, accounting nodes generate block and record the transaction data.
Again, after the accounting nodes for being responsible for the storage of this round generate block, the book keeping operation of block is generated by the last one
The recording rules of node next one, and the recording rules of next one is recorded in the block of generation in server cluster
It is shared, foundation is provided for next one storage and the subsequent transaction data for extracting transaction node in order.
Then, the accounting nodes kept accounts by participation next one carry out current time transaction data according to determining rule
Book keeping operation, and when generating the last one block, determine the recording rules of next one round.
Storing process through minute wheel time, transaction data the depositing with the formal distribution formula of block chain that multiple transaction nodes generate
Storage solves the problems, such as data high concentration in the server cluster being made of multiple accounting nodes.Each period only by
One accounting nodes is responsible for the storage of transaction data, can satisfy the processing of energy internet mass transmission of transaction data, number of nodes
According to the demand of compression storage.Also, the server in server cluster with after another server is reached common understanding in cluster,
The Transaction Information received is stored in the block of generation, it is ensured that the public letter property of data storage prevents data to be tampered.
After block generates, the data saved can not be modified, and ensure that the public letter property and safety of data storage.
Embodiment of the method two:
Referring to fig. 2, which is the process signal of the data processing method embodiment two provided by the invention based on block chain
Figure.Compared to Fig. 1, a kind of data processing method more specifically based on block chain is present embodiments provided.
In the present embodiment, step S201-S204 is identical as the step S101-S104 of embodiment of the method one, here no longer
It repeats.
In order to improve the treatment effeciency of server cluster, the data processing method provided in this embodiment based on block chain,
Further include resource allocation process, specifically includes step S205-S207.
S205: when distribution server generates block, distribution server determines shared number according to target transaction information aggregate
According to target transaction data acquisition system is whole Transaction Informations of multiple servers storage, and the shared data of a unit is one corresponding
The process resource of unit.
In the present embodiment, the book keeping operation when a book keeping operation round generates the last one block, in addition to determining next one
Rule, the last one distribution server for generating block is determined also according to the transaction data total value that this round stores participates in this round
The shared data that the server of storage can be shared.
In the specific implementation, distribution server can determine altogether according to the certain proportion (such as 10%) of transaction data total value
Enjoy data.The process resource of the corresponding unit of the shared data of one unit, the process resource of server is more, and efficiency is higher.
Reach common understanding between server due to participating in the storage of this round, then distribution server determines that the ratio of shared data also exists
Reach common understanding between the server of this round storage.
S206: distribution server is split as multiple shared subdatas, and root according to preset allocation rule, by shared data
According to each server one-to-one relationship in shared subdata and multiple servers, shared data distribution information is obtained;Shared son
Each server corresponds in data and multiple servers.
In the present embodiment, preset allocation rule can be mean allocation, also may be set according to actual conditions, here
No longer repeat one by one.If mean allocation, shared data is averagely allocated to by distribution server participates in all of this round storage
Server, the shared data (i.e. shared subdata) of the corresponding a mean allocation of each server.
It is understood that shared data distribution information includes that the shared subdata split is distributed to corresponding server
Information.
S207: distribution server distributes shared data to information preservation in the block of generation, so that shared data is distributed
Information is shared in server cluster.
In the present embodiment, after shared data distribution information being shared in server cluster, participate in sharing (participating in this
Round storage) server can learn and server can be promoted in server cluster to improve processing total amount to obtain and shared son
The treatment effeciency of server can be improved in the corresponding process resource of data, the acquisition of process resource.
It is understood that process resource is to be issued to server as the reward of processing.Therefore, possible in the present embodiment
Implementation in, further include resource distribution process after step S207, specifically include step S208-S210.
S208: feedback server distributes information according to shared data, determines shared subdata corresponding with feedback server,
Feedback server is any one in multiple servers.
In the present embodiment, feedback server is that shared server is participated in step S205-S207.Back services
Device can know the shared subdata for distributing to itself and the corresponding processing of shared subdata from shared data distribution information
Resource.
S209: feedback server generates multiple shared marks according to corresponding shared subdata, and a shared mark corresponds to
The shared subdata of one unit, and multiple shared marks of generation are shared in server cluster.
In the present embodiment, feedback server shares the corresponding process resource of subdata in order to obtain, generates and shared son
The corresponding shared mark of data, when the treating capacity of feedback server increases, shared mark exists with the transaction data of charging pile
The whole network is broadcasted in server cluster, so that the server for being responsible for current time storage in server cluster is receiving transaction data
When, process resource corresponding to the shared mark carried in transaction data is issued to feedback server.
It is apparent that feedback server need to be broadcasted after generating shared mark to server cluster, so as to be responsible for current hand over
The server of easy data storage can identify the shared mark that transaction data carries, by process resource corresponding to shared mark
It is issued to feedback server.
It is understood that a shared shared subdata for identifying a corresponding unit, and the shared son of a unit
Data are again corresponding with the process resource of a unit, then a shared mark is also corresponding with the process resource of a unit.
S210: when the Transaction Information that server cluster receives includes at least one shared mark, when by storing current
At least one shared mark being stored in the block of generation by the server for carving received Transaction Information, so as to will be at least one
The corresponding process resource of a shared mark is sent to feedback server, the corresponding unit of the process resource of a unit it is shared
Subdata.
In the present embodiment, server cluster is only responsible for the storage of data, therefore, is receiving the transaction for carrying shared mark
When data, currently the shared mark is stored in the block of its generation by responsible server, and block can not be repaired once generating
Change.Therefore, shared mark is saved within a block, can not only provide foundation for the granting of subsequent processing resource, it is ensured that place
Manage the correct and fair of resource granting.
Method provided in this embodiment is generated the server of block by the last one at the end of the storage of a round
It determines shared data, and shared data is distributed to each server for participating in the storage of this round, obtain shared data distribution letter
Breath.The server participated in the distribution distributes information according to shared data, determines corresponding shared subdata, and share subnumber according to this
It is broadcasted according to shared mark the whole network is generated.When including the shared mark in the received transaction data of server cluster, then by currently bearing
The server for blaming storage saves shared mark within a block, shares the corresponding server issues processing money of mark to this to be subsequent
Source provides foundation, motivates and improve the treatment effeciency of server.
In order to facilitate understanding, below with reference to concrete scene to the data processing method provided in this embodiment based on block chain
It is illustrated.
Firstly the need of explanation, charging pile alliance is the Multi center structure of decentralization, includes two class nodes, that is, trades
Node and accounting nodes.Each charging pile is exactly a transaction node, may be implemented charging delivery operation and Transaction Information with
The function of network interaction;Each accounting nodes is a center, is responsible for providing billed services to the whole network, and safeguard the whole network account
This.Charging pile alliance Zhong Ge charging pile operator often possesses an accounting nodes, it is necessary to pay certain guarantee gold, guarantee fund
Quantity can be fixed, can also mode by inch of candle determine.Initial fund pool is formed using guarantee fund, can be used for
The popularization of charging pile alliance and the reward of charging pile operator.But guarantee fund sets the threshold of book keeping operation power, needs to design corresponding
Book keeping operation incentive mechanism, to promote charging pile operator to receive charging pile alliance.Number provided in this embodiment based on block chain
According to processing method, charging pile alliance can be applied to, to promote charging pile operator to receive above scheme, be described as follows:
In charging pile alliance, every round is responsible for by M transaction node in charging pile alliance and is kept accounts.When this is responsible for book keeping operation
Accounting nodes generate block book keeping operation after, which terminates.At the end of each keeps accounts round, by the last one life
The service charge of certain proportion (such as 1%-10%) is collected according to the total transaction amount that this round is kept accounts at the accounting nodes of block.It should
The service charge collected is averagely allocated to the whole accounting nodes for participating in the book keeping operation of this round by accounting nodes, by service charge allocation result
The block of its generation is stored in share in charging pile alliance.
Charging pile operator belonging to the accounting nodes of book keeping operation is participated in, can be returned according to service charge allocation result with charging
The modes such as benefit, sale or red packet provide the virtual coupons (can be described as " electricity benefit beans ") of respective numbers to client.For example, 1 yuan of hand
Continue to pay dues the corresponding sharp beans of an electricity, or, corresponding sharp beans of an electricity of 10 yuan of service charges etc..Client can be used electric sharp beans and set in charging
Charging payment is carried out on standby, offsets partly or entirely charging expense.It is understood that charging pile operator can be according to reality
It needs, setting carries out the rule of charging payment using electric sharp beans, such as an electric sharp beans need and cash 1:1 collocation use, electricity
Sharp beans can only use on specific charging pile, will not enumerate here.In this way, client can not only be promoted in transaction node
Upper charging generates more transaction data, can be with the diplomatic utilization rate for improving charging pile.
Include after client is charged on charging pile using electric sharp beans, in the transaction data of charging pile broadcast using
The mark of electric benefit beans.It is responsible for the accounting nodes of current time book keeping operation after receiving the transaction data, record is corresponding within a block
The sharp beans consumption of electricity, so that service charge corresponding to the sharp beans of the electricity of consumption is issued to corresponding charging pile operation later
Quotient, to promote charging pile operator that charging pile alliance is added.
The data processing method based on block chain provided based on the above embodiment, the present invention also provides one kind to be based on area
The data processing server of block chain.
Installation practice:
Referring to Fig. 3, which is the structural representation of the data processing server provided in an embodiment of the present invention based on block chain
Figure.
Data processing server provided in this embodiment based on block chain is applied to charging pile system, charging pile system
Including multiple charging piles and server cluster, the Transaction Information of server cluster real-time reception multiple charging piles broadcast and with block
The form of chain carries out minute wheel time storage to Transaction Information, and server cluster includes server;
Server provided in this embodiment, comprising: information receiving module 100, judgment module 200, common recognition processing module
300, data processing module 400 and regular determining module 500;
Information receiving module 100, for the transaction data of real-time reception charging pile broadcast and the storage rule of this round, originally
The storage rule of round includes being responsible for the server info of this round storage and depositing for this round server in server cluster
Store up order.
Judgment module 200 judges whether to participate in the storage of this round for the storage rule according to this round;It is also used to root
According to the storage rule of this round, judge whether the storage order of this round is N, and N is that the storage of this round is participated in server cluster
Number of servers;It is also used to the storage rule according to this round, judges whether the storage for being responsible for current time transaction data;
Common recognition processing module 300 is to participate in be responsible for current time transaction data for the judging result when judgment module 200
Storage when, the Transaction Information set received within a preset period of time according to information receiving module, into multiple servers its
Whether remaining server initiates common recognition, know together effective for verifying the Transaction Information set;It is also used to receive the common recognition result of feedback;
Data processing module 400, for showing the set of transaction information when the common recognition received common recognition result of processing module 300
When closing effective, the Transaction Information set that block storage rule receiving module receives within a preset period of time is generated, so that the friendship
Easy information, which is integrated into server cluster, to be shared;Each server only generates a block in a round;It is also used to work as and sentence
The judging result of disconnected module 200 is the storage order of this round when being N, and the storage rule of next one is stored in the area of generation
In block, so that the storage rule is shared in server cluster, the storage rule of next one includes being responsible in server cluster
The server info of next one storage and the storage order of next one server;
Regular determining module 500, for when the storage order that the judging result of judgment module 200 is this round is N, really
Determine the storage rule of next one, the storage rule of next one includes the service for being responsible for next one storage in server cluster
The storage order of device information and next one server.
In some possible implementations of the present embodiment, the server further include: data acquisition module;
Data acquisition module, for obtaining the transaction data of server cluster storage;
Data processing module 400, be also used to the storage order that the judging result when judgment module 200 is this round be N and
When data processing module generates block, according to target transaction information aggregate, shared data, the shared data pair of a unit are determined
The process resource of a unit is answered, target transaction data acquisition system is the whole of server cluster storage in the storage round of server
Transaction Information;Be also used to according to preset allocation rule, shared data be split as multiple shared subdatas, share subdata with
Each server corresponds in multiple servers;It is also used to according to each server one in shared subdata and multiple servers
One corresponding relationship obtains shared data distribution information;It is also used to distribute shared data to information preservation in the block of generation, with
Share shared data distribution information in server cluster.
As an example, preset allocation rule is mean allocation.
In some possible implementations of the present embodiment, the server further include: information identification module and resource processing
Module;
Data processing module 400 is also used to distribute information according to shared data, determines corresponding with feedback server shared
Subdata, feedback server are any one in multiple servers;It is also used to be generated multiple total according to corresponding shared subdata
Enjoy mark, a shared shared subdata for identifying a corresponding unit;The multiple shared marks for being also used to generate are servicing
It is shared in device cluster;
Information identification module is to participate in be responsible for current time transaction data for the judging result when judgment module 200
When storage, identification information receiving module receives the data content for including in Transaction Information;
Resource processing module, for when information identification module determines that the Transaction Information includes at least one shared mark,
At least one shared mark is stored in the block of generation, so as to will process resource hair corresponding at least one shared mark
Give feedback server, the shared subdata of the corresponding unit of the process resource of a unit.
Data processing equipment provided in this embodiment based on block chain, the transaction data of charging pile broadcast is with block chain
In each server of structure distribution formula being stored in server cluster, solves the problems, such as data high concentration.Only by
A server in server cluster is responsible for storing the transaction data that charging pile is broadcasted within a preset time, slows down server
The growth rate of block (regions of store transaction data), can satisfy in energy network at magnanimity transmission of transaction data in cluster
Reason, the demand of node data compression storage.In addition, since the storage of data is to ensure that data on the basis of common recognition is successful
Storage it is just with it is accurate.After block generates, the data saved can not be modified, and ensure that the public letter property and safety of data storage
Property.
The data processing method and server based on block chain provided based on the above embodiment, the embodiment of the present invention also mention
A kind of data processing system based on block chain is supplied.
System embodiment:
Referring to fig. 4, which is that a kind of structure of data processing system based on block chain provided in an embodiment of the present invention is shown
It is intended to.
Data processing system provided in this embodiment based on block chain, including at least three claim 5-8 are any one
Server 10 described in.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can directly be held with hardware, processor
The combination of capable software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only deposit
Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology
In any other form of storage medium well known in field.
The above described is only a preferred embodiment of the present invention, being not intended to limit the present invention in any form.Though
So the present invention has been disclosed as a preferred embodiment, and however, it is not intended to limit the invention.It is any to be familiar with those skilled in the art
Member, without departing from the scope of the technical proposal of the invention, all using the methods and technical content of the disclosure above to the present invention
Technical solution makes many possible changes and modifications or equivalent example modified to equivalent change.Therefore, it is all without departing from
The content of technical solution of the present invention, according to the technical essence of the invention any simple modification made to the above embodiment, equivalent
Variation and modification, all of which are still within the scope of protection of the technical scheme of the invention.