WO2020024650A1 - 数据处理方法和装置、客户端 - Google Patents

数据处理方法和装置、客户端 Download PDF

Info

Publication number
WO2020024650A1
WO2020024650A1 PCT/CN2019/086841 CN2019086841W WO2020024650A1 WO 2020024650 A1 WO2020024650 A1 WO 2020024650A1 CN 2019086841 W CN2019086841 W CN 2019086841W WO 2020024650 A1 WO2020024650 A1 WO 2020024650A1
Authority
WO
WIPO (PCT)
Prior art keywords
server
data
coordination
server cluster
data processing
Prior art date
Application number
PCT/CN2019/086841
Other languages
English (en)
French (fr)
Inventor
杨新颖
Original Assignee
阿里巴巴集团控股有限公司
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 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Priority to SG11202010202XA priority Critical patent/SG11202010202XA/en
Priority to EP19845116.3A priority patent/EP3779693A4/en
Publication of WO2020024650A1 publication Critical patent/WO2020024650A1/zh
Priority to US17/086,155 priority patent/US11233878B2/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1029Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers using data related to the state of servers by a load balancer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/2895Intermediate processing functionally located close to the data provider application, e.g. reverse proxies
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • H04L9/0637Modes of operation, e.g. cipher block chaining [CBC], electronic codebook [ECB] or Galois/counter mode [GCM]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/501Performance criteria
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Definitions

  • the embodiments of the present specification relate to the field of computer technology, and in particular, to a data processing method and device, and a client.
  • Blockchain technology has become the focus of attention and research in many technical fields due to its own decentralization, immutability, and distribution.
  • the data processing system may include a business server and a blockchain server.
  • the blockchain server can join a blockchain network as a blockchain node.
  • the business server needs to perform frequent read and write operations on the blockchain server, such as reading data blocks from the blockchain server; or writing account status data to the blockchain server.
  • the read and write operations of the business server with respect to the blockchain server are relatively frequent, which causes greater access pressure to the blockchain server and reduces the data processing speed of the data processing system.
  • the purpose of the embodiments of the present specification is to provide a data processing method and device, and a client to improve data processing speed.
  • an embodiment of the present specification provides a data processing method, including: selecting a target coordination server from a plurality of coordination servers according to performance information of the server cluster; the plurality of coordination servers are respectively affiliated with multiple server clusters; Sending a data processing request to the target coordination server, so that the server cluster to which the target coordination server belongs can preferentially process the data processing request.
  • an embodiment of the present specification provides a data processing apparatus, including: a selecting unit, configured to select a target coordination server from a plurality of coordination servers according to performance information of a server cluster; the plurality of coordination servers belong to Multiple server clusters; a sending unit, configured to send a data processing request to the target coordination server, so that the server cluster to which the target coordination server belongs can preferentially process the data processing request.
  • an embodiment of the present specification provides a client, including: a memory for storing computer instructions; a processor for executing the computer instructions to implement the following steps: according to the performance information of the server cluster, coordinate from a plurality of A target coordination server is selected from the servers; the multiple coordination servers belong to multiple server clusters respectively; and a data processing request is sent to the target coordination server so that the server cluster to which the target coordination server belongs can preferentially process the data processing request.
  • the client may select a target coordination server from multiple coordination servers according to the performance information of the server cluster; and may send data to the target coordination server.
  • Process the request so that the server cluster to which the target coordination server belongs can preferentially process the data processing request.
  • the client can send data processing requests to different coordination servers according to different performance information of the server cluster; load balancing of multiple server clusters is achieved, thereby speeding up data processing processing.
  • FIG. 1 is a schematic structural diagram of a data processing system according to an embodiment of the present specification
  • FIG. 2 is a flowchart of a data processing method according to an embodiment of the present specification
  • FIG. 3 is a flowchart of a block data reading method according to an embodiment of the present specification.
  • FIG. 5 is a flowchart of a block data reading method according to an embodiment of the present specification.
  • FIG. 6 is a flowchart of a method for reading block data according to an embodiment of the present specification
  • FIG. 7 is a flowchart of a transaction data reading method according to an embodiment of the present specification.
  • FIG. 9 is a schematic structural diagram of a data processing device according to an embodiment of the present specification.
  • FIG. 10 is a schematic structural diagram of a client according to an embodiment of the present specification.
  • Blockchain is a distributed ledger that organizes multiple block data in a chain structure in chronological order, and uses cryptographic algorithms to ensure security, traceability, and non-tampering.
  • the blockchain can include a public blockchain, a joint blockchain (also known as an alliance blockchain), a private blockchain, and the like.
  • Each block data can record at least one transaction data generated by a member of the block chain within a specific time interval, and can specifically include a block header and a body.
  • the blockchain can correspond to multiple status data.
  • Each status data may correspond to a member identification; the status data may be used to describe the status of the member identification.
  • the member identification may include a member account, and the status data may include an asset balance of the member account.
  • the member account and asset balance here are just examples. In fact, the member identification and the status data may also be other data, respectively.
  • a blockchain can include multiple block data. Each block data in the blockchain can have a position value. Different block data have different position values.
  • the position value may be used to indicate a position of block data in the blockchain. Block data can be obtained from the blockchain based on the position value.
  • the position value may also be related to the creation time of the block data. Specifically, the block data with an earlier creation time has a smaller position value; the block data with a later creation time has a larger position value.
  • the position value may include a block height. Of course, the position value may also include any other data capable of deriving the position of the block data.
  • Blockchain can be implemented based on the blockchain network.
  • the blockchain network may include a P2P network (peer-to-peer network) and the like.
  • the blockchain network may include multiple blockchain nodes. Each blockchain node can store all or part of the block data in the blockchain.
  • Each blockchain node can be a server or a distributed server cluster that includes multiple servers.
  • a distributed server cluster can include a coordination server and multiple task servers.
  • the coordination server may be responsible for task allocation and management.
  • the task server may be responsible for processing of tasks.
  • the distributed server cluster can provide external business services as a whole.
  • the distributed server cluster may be specifically implemented based on an MPP (Massively Parallel Processing) architecture technology.
  • MPP Massively Parallel Processing
  • the distributed server cluster may also be implemented based on other architecture technologies, which are not specifically limited in the embodiments of the present specification.
  • the data processing system may include a blockchain platform.
  • the blockchain platform can be used as a blockchain node in a blockchain network.
  • the blockchain platform may include at least two server clusters.
  • the at least two server clusters may include a first server cluster and a second server cluster.
  • the first server cluster may include a first coordination server and a plurality of first task servers.
  • the second server cluster may include a second coordination server and a plurality of second task servers.
  • the second task server may have a better hardware configuration and / or software configuration. Therefore, compared to the first server cluster, the second server cluster may have a larger data processing capability.
  • the first server cluster and the second server cluster may respectively store at least one block data in a blockchain.
  • the block data in the first server cluster and the second server cluster can be considered as the block data stored by the blockchain platform.
  • the blockchain platform can be used as a blockchain node in a blockchain network.
  • the block data in the first server cluster and the second server cluster can also be considered as the block data stored by the blockchain node.
  • the block data in the first server cluster and the second server cluster may be different.
  • the sum of the amounts of block data in the first server cluster and the second server cluster may be less than or equal to the number of block data in the blockchain.
  • the set formed by the block data in the first server cluster may be used as the block data set.
  • the block data in the block data set may be distributed and stored in each first task server according to a first specific rule.
  • the first specific rule can be flexibly set according to actual needs.
  • the first server cluster may include N first task servers.
  • Each first task server may have a first server identification.
  • the first server identifier may be used to identify the first task server, and may be, for example, an IP address, a MAC address, or a number of the first task server.
  • the first server identifiers of the N first task servers may be A0, A1, A2, ..., A (N-1), respectively.
  • the block data in which the remainder of the position value divided by N in the block data set is 0 may be stored in the first task server whose first server is identified as A0; the position value in the block data set The block data whose remainder divided by N is 1, may be stored in the first task server whose first server is identified as A1; and so on, the remainder of the position value divided by N in the block data set is N-1.
  • the block data can be stored in the first task server whose first server is identified as A (N-1).
  • the first coordination server may store position value configuration data.
  • the position value configuration data may include at least one position value.
  • Each position value in the position value configuration data may correspond to a first server identifier; the block data pointed to by the position value may be stored in a first task server identified by the first server identifier.
  • the way of storing block data in the second server cluster may be similar to that of the first server cluster.
  • the block data in the first server cluster and the second server cluster can be considered as the block data stored by the blockchain platform.
  • Block data is usually immutable after it is generated.
  • Operations on block data usually include only read operations (such as reading block data, reading transaction data in the block data, etc.). Read operations consume less performance resources (such as CPU, memory, external memory, etc.).
  • performance resources such as CPU, memory, external memory, etc.
  • a large amount of block data with an earlier creation time in the blockchain platform may be stored in the first server cluster;
  • a small amount of block data created later in the blockchain platform is stored in the second server cluster.
  • the second server cluster may have a larger data processing capability.
  • the newly added block data of the blockchain platform may come from the second server cluster, for example, from a second coordination server and / or a second task server in the second server cluster.
  • the newly added block data of the blockchain platform may first be stored in the second server cluster, for example, a second task server stored in the second server cluster according to a first specific rule.
  • the second coordination server may migrate the block data that satisfies the position value judgment condition in each second task server to the first server cluster every first preset time interval.
  • the second coordination server may obtain block data that satisfies a position value judgment condition from each second task server; and may send the obtained block data to the first coordination server.
  • the first coordination server may receive block data; and may store the received block data to a first task server according to a first specific rule.
  • the size of the first preset time interval can be flexibly set according to actual needs, for example, it can be 5 hours, 1 day, or 2 days.
  • the position value judgment conditions can be flexibly set according to actual needs.
  • the position value judgment condition may include: a difference between the position value and a maximum position value is greater than or equal to a first preset threshold.
  • the maximum position value may be a position value of the latest block data at the time of creation.
  • the first preset threshold may be, for example, 1000, 1052, or 1070.
  • the position value judgment condition may further include: the position value is less than or equal to a second preset threshold.
  • the second server cluster may further store state data of the blockchain.
  • the state data of the blockchain can be changed.
  • Operations on status data may include read operations and write operations.
  • the state data of the blockchain can be stored in the second server cluster.
  • the second server cluster may include N second task servers.
  • Each second task server may have a second server identification.
  • the second server identifier may be used to identify the second task server, for example, it may be an IP address, a MAC address, or a number of the second task server.
  • the second server identifiers of the N second task servers may be B0, B1, B2, ..., B (N-1), respectively.
  • the state data in which the remainder of the member ID divided by N in the state data set is 0 may be stored in the second task server whose second server ID is B0; the member ID is divided by N in the state data set.
  • the status data whose remainder is 1 may be stored in the second task server whose second server is identified as B1; and so on, the member data in the block data set is divided by N and the remaining data is N-1, It may be stored in the second task server whose second server is identified as B (N-1).
  • the second coordination server may store member identification configuration data.
  • the member identification configuration data may include at least one member identification.
  • Each member identifier in the member identifier configuration data may correspond to a second server identifier; status data corresponding to the member identifier may be stored in a second task server identified by the second server identifier.
  • the first coordination server in the first server cluster may further store first coding value configuration data.
  • the second coordination server in the second server cluster may further store second encoding value configuration data.
  • Each of the first encoding value configuration data and the second encoding value configuration data may include at least one encoding value.
  • Each of the encoding values in the first encoding value configuration data and the second encoding value configuration data may correspond to a position value.
  • the sum of the number of position values corresponding to each of the encoded values in the first encoded value configuration data and the second encoded value configuration data may be less than or equal to the number of block data in the blockchain platform.
  • the encoding value may be an encoding value of block data or an encoding value of transaction data.
  • the encoded value of the block data may be used to identify the block data, and may specifically correspond to the position value of the block data.
  • the encoded value of the transaction data may be used to identify the transaction data, and may specifically correspond to the position value of the block data containing the transaction data.
  • the encoded value may include a hash value.
  • the hash value may be calculated based on a hash algorithm.
  • the hash algorithm may include SHA-1, SHA-224, SHA-256, SHA-512, and the like.
  • the first encoding value configuration data and the second encoding value configuration data are the encoding values of transaction data
  • the first encoding value configuration data and the second encoding value configuration data can also correspond to an offset; the offset can be used to indicate the offset position of the transaction data corresponding to the encoded value in the block data, so that the transaction data can be quickly obtained from the block data.
  • the newly added block data of the blockchain platform may be stored in the second server cluster first.
  • the encoding value corresponding to the newly added block data in the blockchain platform may be first added to the second encoding value configuration data.
  • the encoding value corresponding to the newly added block data may be the encoding value of the block data, or the encoding value of the transaction data in the block data.
  • the second coordination server may migrate the coding value that satisfies the coding value judgment condition in the second coding value configuration data to the first coordination server every second preset time interval.
  • the second coordination server may obtain, from the second encoded value configuration data, an encoded value that meets a judgment condition of the encoded value; and may send the obtained encoded value to the first coordination server.
  • the first coordination server may receive an encoded value; and may add the received encoded value to the first encoded value configuration data.
  • the size of the second preset time interval can be flexibly set according to actual needs, for example, it can be 10 hours, 5 days, or 10 days.
  • the coding value judgment conditions can be flexibly set according to actual needs.
  • the encoding value judgment condition may include: the encoding value is less than or equal to a third preset threshold.
  • the data processing system may further include a client.
  • the client may be a service server, or a server cluster including multiple service servers.
  • the client may select a target coordination server from multiple coordination servers according to the performance information of the server cluster, and the multiple coordination servers belong to multiple server clusters respectively; and may send a data processing request to the target coordination server so that A server cluster to which the target coordination server belongs can preferentially process the data processing request.
  • the embodiment of the present specification provides a data processing method.
  • the data processing method uses a client as an execution subject, and may include the following steps.
  • Step S10 Select a target coordination server from a plurality of coordination servers according to the performance information of the server cluster.
  • the performance information may be used to represent a data processing capability of a server cluster.
  • the performance information may include at least one of the following: the number of block data stored in the server cluster, the ratio of the number of block data stored in the server cluster to the number of block data in the blockchain, the throughput of the server cluster (TPS), the server Cluster concurrency, server cluster response time, server cluster hardware configuration, server cluster software configuration.
  • the hardware configuration may include, for example, a CPU, a memory, an external memory, and the like.
  • the software configuration may include, for example, a version of the software. Specifically, when the number of block data stored in the server cluster is larger, it indicates that the data processing capacity of the server cluster is smaller.
  • the ratio of the amount of block data stored in the server cluster to the amount of block data in the blockchain is larger, it means that the data processing capacity of the server cluster is smaller.
  • the throughput of a server cluster is larger, it means that the data processing capacity of the server cluster is smaller.
  • the concurrency of a server cluster is larger, it means that the data processing capacity of the server cluster is smaller.
  • the larger the response time of a server cluster the smaller the data processing capacity of the server cluster.
  • the plurality of coordination servers may include a first coordination server and a second coordination server.
  • the client may compare the data processing capabilities of the first server cluster and the second server cluster based on the performance information of the first server cluster and the second server cluster; when the data processing capabilities of the first server cluster are greater than the second server cluster, The first coordination server may be selected as the target coordination server; when the data processing capacity of the first server cluster is less than the second server cluster, the second coordination server is selected as the target coordination server.
  • the client may obtain performance information of the first server cluster and the second server cluster every preset time interval. Specifically, the client may send a performance information acquisition request to the first coordination server and the second coordination server at preset time intervals, respectively.
  • the first coordination server may receive a performance information acquisition request; may acquire performance information of a server cluster in which the first coordination server is located; and may send the obtained performance information to the client.
  • the second coordination server may receive a performance information acquisition request; may acquire performance information of a server cluster in which it is located; and may send the acquired performance information to the client.
  • the client may receive performance information sent by the first coordination server and the second coordination server, respectively.
  • the first coordination server may also actively push performance information of the server cluster where the first coordination server is located to the client every preset time interval.
  • the client may receive performance information sent by the first coordination server.
  • the second coordination server may also actively push the performance information of the server cluster where the second coordination server is located to the client every preset time interval.
  • the client may receive the performance information sent by the second coordination server.
  • Step S12 Send a data processing request to the target coordination server, so that the server cluster to which the target coordination server belongs can preferentially process the data processing request.
  • the data processing request may include at least one of the following: a block data read request, a status data read request, a status data write request, and a transaction data read request.
  • the block data read request may carry a position value of the block data to be read or an encoded value of the block data to be read;
  • the status data read request may carry a member identifier;
  • the status data write request may carry a member identification and the pending data;
  • the transaction data read request may carry an encoded value of the transaction data to be read.
  • the data processing request may be directed to the data to be processed.
  • the data to be processed may be understood as the block data to be read.
  • the data processing request is a status data read request
  • the data to be processed may be understood as status data to be read.
  • the data processing request is a status data write request
  • the data to be processed may be understood as the status data to be written.
  • the data processing request is a transaction data read request
  • the data to be processed may be understood as the transaction data to be read.
  • the server cluster to which the target coordination server belongs preferentially processes the data processing request, which can be understood as: when the server cluster to which the target coordination server belongs can independently process the data processing request, the target The server cluster to which the coordination server belongs separately implements processing of the data processing request; when the server cluster to which the target coordination server belongs cannot process the data processing request separately, the target coordination server may communicate with other coordination servers Therefore, the server cluster to which the target coordination server belongs and the server clusters to which the other coordination servers belong jointly implement the processing of the data processing request.
  • the data to be processed may be block data to be read.
  • the client may select a first coordination server as a target coordination server; and may send a block data read request to the first coordination server.
  • the block data read request may carry a position value of the block data to be read.
  • the first coordination server may receive a block data read request; and may determine whether the position value meets a position value determination condition.
  • the first coordination server When the position value satisfies a condition for determining the position value, the first coordination server considers that the block data pointed to by the position value is stored in the server cluster where it is located; and can obtain the block data pointed by the position value; The acquired block data may be sent to the client.
  • the client may receive block data.
  • the first coordination server may obtain the first server identifier corresponding to the location value based on the location value configuration data; and may send the location value to the first task server identified by the obtained first server identifier.
  • the first task server identified by the obtained first server identifier may receive a location value; may locally obtain block data pointed to by the location value; and may send block data to the first coordination server.
  • the first coordination server may receive block data.
  • the first coordination server When the location value does not satisfy the location value judgment condition, the first coordination server considers that the block data pointed to by the location value is stored in a second server cluster; the location may be sent to the second coordination server value.
  • the second coordination server may receive a position value; may obtain block data pointed to by the position value; and may send block data to the first coordination server.
  • the first coordination server may receive block data; and may send block data to the client.
  • the client may receive block data.
  • the process by which the second coordination server obtains the block data pointed to by the position value may be similar to the process by which the first coordination server obtains the block data pointed by the position value. Both can be explained with reference.
  • the data to be processed may be block data to be read.
  • the client may select a second coordination server as a target coordination server; and may send a block data read request to the second coordination server.
  • the block data read request may carry a position value of the block data to be read.
  • the second coordination server may receive a block data read request; and may determine whether the position value meets a position value determination condition.
  • the second coordination server When the position value satisfies the position value judgment condition, the second coordination server considers that the block data pointed to by the position value is stored in the first server cluster; the position value may be sent to the first coordination server .
  • the first coordination server may receive a position value; may obtain block data pointed to by the position value; and may send block data to the second coordination server.
  • the second coordination server may receive block data; and may send block data to the client.
  • the client may receive block data.
  • the second coordination server When the position value does not satisfy the position value judgment condition, the second coordination server considers that the block data pointed to by the position value is stored in the server cluster in which it is located; the block data pointed by the position value can be obtained ; Block data may be sent to the client. The client may receive block data.
  • the data to be processed may be status data to be read.
  • the client may select a second coordination server as a target coordination server; and may send a status data read request to the second coordination server.
  • the status data reading request may carry a member identification.
  • the second coordination server may receive the status data read request; may acquire a second server identifier corresponding to the member identifier based on the member identifier configuration data; and may send a second task server identified by the acquired second server identifier Sending the member identification.
  • the second task server identified by the obtained second server identifier may receive the member identifier; may obtain the status data corresponding to the member identifier locally; and may send the status data to the second coordination server.
  • the second coordination server may receive status data; and may send status data to the client.
  • the client can receive status data.
  • the data to be processed may be status data to be read.
  • the client may select a first coordination server as a target coordination server; and may send a status data read request to the first coordination server.
  • the status data reading request may carry a member identification.
  • the first coordination server may receive the status data read request; and may send a member identification to the second coordination server.
  • the second coordination server may receive a member identification; may obtain status data corresponding to the member identification; and may send the status data to the first coordination server.
  • the first coordination server may receive status data; and may send status data to the client.
  • the client can receive status data.
  • the second coordination server obtains the status data corresponding to the member identifier refer to the foregoing embodiment.
  • the data to be processed may be status data to be written.
  • the client may select a second coordination server as a target coordination server; and may send a status data write request to the second coordination server.
  • the status data write request may carry a member identifier and status data to be written.
  • the second coordination server may receive the status data write request; may obtain a second server identifier corresponding to the member identifier based on the member identifier configuration data; and may send to the second task server identified by the obtained second server identifier The member identification and the status data to be written.
  • the second task server identified by the obtained second server identifier may receive the member identifier and the status data to be written; the status data to be written may be stored as the status data corresponding to the member identifier;
  • the second coordination server sends a response message.
  • the second coordination server may receive response information; and may send response information to the client.
  • the client may receive response information.
  • the data to be processed may be status data to be written.
  • the client may select a first coordination server as a target coordination server; and may send a status data write request to the first coordination server.
  • the status data write request may carry a member identifier and status data to be written.
  • the first coordination server may receive the status data write request; and may send a member identifier and status data to be written to the second coordination server.
  • the second coordination server may receive a member identification and status data to be written; may perform a write operation based on the member identification and the status data to be written; and may send response information to the first coordination server.
  • the first coordination server may receive response information; and may send response information to the client.
  • the client may receive response information.
  • the data to be processed may be block data to be read.
  • the client may select a first coordination server as a target coordination server; and may send a block data read request to the first coordination server.
  • the block data read request may carry an encoded value of the block data to be read.
  • the first coordination server may receive a block data read request; and may match the encoded value in the first encoded value configuration data.
  • the first coordination server may obtain a position value corresponding to the encoded value based on the first encoded value configuration data; may determine the position value Whether the position value judgment condition is satisfied.
  • the first coordination server considers that the block data pointed to by the position value is stored in the server cluster where it is located; and can obtain the block data pointed by the position value; Block data may be sent to the client.
  • the client may receive block data.
  • the first coordination server considers that the block data pointed to by the location value is stored in a second server cluster; the location may be sent to the second coordination server value.
  • the second coordination server may receive the position value; may obtain block data pointed to by the position value; and may send block data to the first coordination server.
  • the first coordination server may receive block data; and may send block data to the client.
  • the client may receive block data.
  • Matching the encoding value in the first encoding value configuration data can be understood as: finding the encoding value in the first encoding value configuration data.
  • the first coordination server When the encoding value is not matched in the first encoding value configuration data, the first coordination server considers that the encoding value can be matched from the second encoding value configuration data; The encoded value is transmitted.
  • the second coordination server may receive the encoded value; may configure data based on the second encoded value to obtain a position value corresponding to the encoded value; and may determine whether the position value satisfies a position value judgment condition.
  • the second coordination server considers that the block data pointed to by the position value is stored in the server cluster in which it is located; the block data pointed by the position value can be obtained ; May send block data to the first coordination server.
  • the first coordination server may receive block data; and may send block data to the client.
  • the client may receive block data.
  • the second coordination server considers that the block data pointed to by the position value is stored in the first server cluster; the position value may be sent to the first coordination server .
  • the first coordination server may receive the position value; may obtain block data pointed to by the position value; and may send block data to the client.
  • the client may receive block data.
  • the data to be processed may be block data to be read.
  • the client may select a second coordination server as a target coordination server; and may send a block data read request to the second coordination server.
  • the block data read request may carry an encoded value of the block data to be read.
  • the second coordination server may receive a block data read request; and the encoded value may be matched in the second encoded value configuration data.
  • the second coordination server may obtain a position value corresponding to the encoding value based on the second encoding value configuration data; may determine the position value Whether the position value judgment condition is satisfied.
  • the second coordination server considers that the block data pointed to by the position value is stored in the first server cluster; the position value may be sent to the first coordination server .
  • the first coordination server may receive a position value; may obtain block data pointed to by the position value; and may send block data to the second coordination server.
  • the second coordination server may receive block data; and may send block data to the client.
  • the client may receive block data.
  • the second coordination server When the position value does not satisfy the position value judgment condition, the second coordination server considers that the block data pointed to by the position value is stored in the server cluster in which it is located; the block data pointed by the position value can be obtained ; Block data may be sent to the client. The client may receive block data.
  • the second coordination server When the encoding value is not matched in the first encoding value configuration data, the second coordination server considers that the encoding value can be matched from the first encoding value configuration data;
  • the encoded value is transmitted.
  • the first coordination server may receive the encoded value; may configure data based on the first encoded value to obtain a position value corresponding to the encoded value; and may determine whether the position value meets a position value judgment condition.
  • the first coordination server considers that the block data pointed to by the position value is stored in the server cluster where it is located; and can obtain the block data pointed by the position value; Block data may be sent to the second coordination server.
  • the second coordination server may receive block data; and may send block data to the client.
  • the client may receive block data.
  • the first coordination server considers that the block data pointed to by the location value is stored in a second server cluster; the location may be sent to the second coordination server value.
  • the second coordination server may receive the position value; may obtain block data pointed to by the position value; and may send block data to the client.
  • the client may receive block data.
  • the data to be processed may be transaction data to be read.
  • the client may select a first coordination server as a target coordination server; and may send a transaction data read request to the first coordination server.
  • the transaction data reading request may carry an encoded value of the transaction data to be read.
  • the first coordination server may receive a transaction data read request; and the encoded value may be matched in the first encoded value configuration data.
  • the first coordination server may obtain a position value corresponding to the encoded value based on the first encoded value configuration data; may determine the position value Whether the position value judgment condition is satisfied.
  • the first coordination server considers that the block data pointed to by the position value is stored in the server cluster where it is located; and can obtain the block data pointed by the position value;
  • the transaction data pointed to by the encoded value may be obtained from the block data; the transaction data may be sent to the client.
  • the client can receive transaction data.
  • the first coordination server When the location value does not satisfy the location value judgment condition, the first coordination server considers that the block data pointed to by the location value is stored in a second server cluster; the location may be sent to the second coordination server value.
  • the second coordination server may receive the position value; may obtain block data pointed to by the position value; and may send block data to the first coordination server.
  • the first coordination server may receive block data; may obtain transaction data pointed to by the encoded value from the block data; and may send transaction data to the client.
  • the client can receive transaction data.
  • the first coordination server When the encoding value is not matched in the first encoding value configuration data, the first coordination server considers that the encoding value can be matched from the second encoding value configuration data; The encoded value is transmitted.
  • the second coordination server may receive the encoded value; may configure data based on the second encoded value to obtain a position value corresponding to the encoded value; and may determine whether the position value satisfies a position value judgment condition.
  • the second coordination server considers that the block data pointed to by the position value is stored in the server cluster in which it is located; the block data pointed by the position value can be obtained ; May send block data to the first coordination server.
  • the first coordination server may receive block data; may obtain transaction data pointed to by the encoded value from the block data; and may send transaction data to the client.
  • the client can receive transaction data.
  • the second coordination server considers that the block data pointed to by the position value is stored in the first server cluster; the position value may be sent to the first coordination server .
  • the first coordination server may receive the position value; may obtain block data pointed to by the position value; may obtain transaction data pointed to by the encoded value from the block data; and may send transaction data to the client .
  • the client can receive transaction data.
  • the first coordination server may obtain the position value and the offset corresponding to the encoded value based on the first encoded value configuration data; and may further obtain the transaction data pointed to by the encoded value from the block data based on the offset.
  • the second coordination server may obtain the position value and the offset corresponding to the encoded value based on the second encoded value configuration data; and may send the offset to the first coordination server.
  • the first coordination server may obtain the transaction data pointed to by the encoded value from the block data based on the offset.
  • the data to be processed may be transaction data to be read.
  • the client may select a second coordination server as the target coordination server; and may send a transaction data read request to the second coordination server.
  • the transaction data reading request may carry an encoded value of the transaction data to be read.
  • the second coordination server may receive a transaction data read request; the encoded value may be matched in the second encoded value configuration data.
  • the second coordination server may obtain a position value corresponding to the encoding value based on the second encoding value configuration data; may determine the position value Whether the position value judgment condition is satisfied.
  • the second coordination server considers that the block data pointed to by the position value is stored in the first server cluster; the position value may be sent to the first coordination server .
  • the first coordination server may receive a position value; may obtain block data pointed to by the position value; and may send block data to the second coordination server.
  • the second coordination server may receive block data; may obtain transaction data pointed to by the encoded value from the block data; and may send transaction data to the client.
  • the client can receive transaction data.
  • the second coordination server When the position value does not satisfy the position value judgment condition, the second coordination server considers that the block data pointed to by the position value is stored in the server cluster in which it is located; the block data pointed by the position value can be obtained ; The transaction data pointed to by the encoded value may be obtained from the block data; the transaction data may be sent to the client. The client can receive transaction data.
  • the second coordination server When the encoding value is not matched in the first encoding value configuration data, the second coordination server considers that the encoding value can be matched from the first encoding value configuration data;
  • the encoded value is transmitted.
  • the first coordination server may receive the encoded value; may configure data based on the first encoded value to obtain a position value corresponding to the encoded value; and may determine whether the position value meets a position value judgment condition.
  • the first coordination server considers that the block data pointed to by the position value is stored in the server cluster where it is located; and can obtain the block data pointed by the position value; Block data may be sent to the second coordination server.
  • the second coordination server may receive block data; may obtain transaction data pointed to by the encoded value from the block data; and may send transaction data to the client.
  • the client can receive transaction data.
  • the first coordination server considers that the block data pointed to by the location value is stored in a second server cluster; the location may be sent to the second coordination server value.
  • the second coordination server may receive the position value; may obtain block data pointed to by the position value; may obtain transaction data pointed to by the encoded value from the block data; may send transaction data to the client .
  • the client can receive transaction data.
  • the client may select a target coordination server from a plurality of coordination servers according to the performance information of the server cluster; and may send a data processing request to the target coordination server so that the target coordination server belongs to The server cluster can preferentially process the data processing request.
  • the client can send data processing requests to different coordination servers according to different performance information of the server cluster; load balancing of multiple server clusters is achieved, thereby speeding up data processing processing.
  • the embodiment of the present specification also provides a data processing apparatus, which is applied to a client.
  • the data processing apparatus may include the following units.
  • a selecting unit 20 is configured to select a target coordination server from a plurality of coordination servers according to the performance information of the server cluster; the plurality of coordination servers belong to a plurality of server clusters, respectively;
  • the sending unit 22 is configured to send a data processing request to the target coordination server, so that a server cluster to which the target coordination server belongs can preferentially process the data processing request.
  • the embodiment of the present specification also provides a client.
  • the client may include a memory and a processor.
  • the memory includes, but is not limited to, dynamic random access memory (DRAM), static random access memory (SRAM), and the like.
  • DRAM dynamic random access memory
  • SRAM static random access memory
  • the memory may be used to store computer instructions.
  • the processor may be implemented in any suitable manner.
  • the processor may take, for example, a microprocessor or processor and a computer-readable medium, logic gate, switch, dedicated integration that stores computer-readable program code (e.g., software or firmware) executable by the (micro) processor.
  • Circuits Application Specific Integrated Circuits, ASICs
  • programmable logic controllers and forms of embedded microcontrollers.
  • the processor may be configured to execute the computer instructions to implement the following steps: selecting a target coordination server from multiple coordination servers according to the performance information of the server cluster; the multiple coordination servers are respectively affiliated with multiple server clusters; The target coordination server sends a data processing request so that the server cluster to which the target coordination server belongs can preferentially process the data processing request.
  • a programmable logic device Programmable Logic Device (PLD)
  • PLD Programmable Logic Device
  • FPGA Field Programmable Gate Array
  • HDL Hardware Description Language
  • VHDL Very-High-Speed Integrated Circuit Hardware Description Language
  • Verilog2 Verilog2.
  • the system, device, module, or unit described in the foregoing embodiments may be specifically implemented by a computer chip or entity, or a product with a certain function.
  • a typical implementation device is a computer.
  • the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or A combination of any of these devices.
  • This manual can be used in many general-purpose or special-purpose computer system environments or configurations.
  • program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
  • This specification can also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected through a communication network.
  • program modules may be located in local and remote computer storage media, including storage devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Computer And Data Communications (AREA)

Abstract

本说明书实施例提供一种数据处理方法和装置、客户端。所述方法包括:根据服务器集群的性能信息,从多个协调服务器中选取目标协调服务器;所述多个协调服务器分别隶属于多个服务器集群;向所述目标协调服务器发送数据处理请求,以便于所述目标协调服务器隶属的服务器集群能够优先处理所述数据处理请求。

Description

数据处理方法和装置、客户端 技术领域
本说明书实施例涉及计算机技术领域,特别涉及一种数据处理方法和装置、客户端。
背景技术
随着互联网的迅速发展,各类数据成爆发式涌现和增长。区块链技术因其自身的去中心化、不可篡改、分布式等特点,目前已成为许多技术领域中的重点关注和研究的方向。
在相关技术中,数据处理系统可以包括业务服务器和区块链服务器。所述区块链服务器可以作为一个区块链节点加入区块链网络。在实际的业务中,业务服务器需要对所述区块链服务器进行频繁的读写操作,例如从所述区块链服务器中读取数据块;或者,将账户状态数据写入所述区块链服务器。上述相关技术中,业务服务器针对区块链服务器的读写操作是比较频繁的,给区块链服务器造成了较大的访问压力,降低了数据处理系统的数据处理速度。
发明内容
本说明书实施例的目的是提供一种数据处理方法和装置、客户端,以提高数据处理速度。
为实现上述目的,本说明书实施例提供一种数据处理方法,包括:根据服务器集群的性能信息,从多个协调服务器中选取目标协调服务器;所述多个协调服务器分别隶属于多个服务器集群;向所述目标协调服务器发送数据处理请求,以便于所述目标协调服务器隶属的服务器集群能够优先处理所述数据处理请求。
为实现上述目的,本说明书实施例提供一种数据处理装置,包括:选取单元,用于根据服务器集群的性能信息,从多个协调服务器中选取目标协调服务器;所述多个协调服务器分别隶属于多个服务器集群;发送单元,用于向所述目标协调服务器发送数据处理请求,以便于所述目标协调服务器隶属的服务器集群能够优先处理所述数据处理请求。
为实现上述目的,本说明书实施例提供一种客户端,包括:存储器,用于存储计算机指令;处理器,用于执行所述计算机指令实现以下步骤:根据服务器集群的性能信息, 从多个协调服务器中选取目标协调服务器;所述多个协调服务器分别隶属于多个服务器集群;向所述目标协调服务器发送数据处理请求,以便于所述目标协调服务器隶属的服务器集群能够优先处理所述数据处理请求。
由以上本说明书实施例提供的技术方案可见,本说明书实施例中,所述客户端可以根据服务器集群的性能信息,从多个协调服务器中选取目标协调服务器;可以向所述目标协调服务器发送数据处理请求,以便于所述目标协调服务器隶属的服务器集群能够优先处理所述数据处理请求。这样所述客户端可以根据服务器集群的性能信息的不同,向不同的协调服务器发送数据处理请求;实现了多个服务器集群的负载均衡,从而加快了数据处理处理的速度。
附图说明
为了更清楚地说明本说明书实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本说明书实施例一种数据处理系统的结构示意图;
图2为本说明书实施例一种数据处理方法的流程图;
图3为本说明书实施例一种区块数据读取方法的流程图;
图4为本说明书实施例一种区块数据读取方法的流程图;
图5为本说明书实施例一种区块数据读取方法的流程图;
图6为本说明书实施例一种区块数据读取方法的流程图;
图7为本说明书实施例一种交易数据读取方法的流程图;
图8为本说明书实施例一种交易数据读取方法的流程图;
图9为本说明书实施例一种数据处理装置的结构示意图;
图10为本说明书实施例一种客户端的结构示意图。
具体实施方式
下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行清楚、 完整地描述,显然,所描述的实施例仅仅是本说明书一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本说明书保护的范围。
为了便于本领域技术人员理解本说明书实施例的技术方案,下面先对本说明书实施例的技术术语进行说明。
区块链(Block Chain),是一种按照时间先后顺序,将多个区块数据以链式结构进行组织,并以密码学算法保证安全、可追溯、且不可篡改的分布式账本。所述区块链可以包括公有区块链、联合区块链(也称为联盟区块链)、和私有区块链等。
多个用户个体、群体、或机构之间可以基于区块链技术建立区块链,从而加入所述区块链并成为其中的成员。成员之间的交易数据可以存储至所述区块链中的区块数据(Block)。每个区块数据能够记录所述区块链中的成员在特定时间区间内产生的至少一个交易数据,具体可以包括区块头(Header)和区块体(Body)等。
区块链可以对应有多个状态数据。每个状态数据可以对应有成员标识;该状态数据可以用于描述该成员标识的状态。例如,所述成员标识可以包括成员账户,所述状态数据可以包括成员账户的资产余额。当然,此处的成员账户和资产余额仅为示例,实际上所述成员标识和所述状态数据还可以分别为其它的数据。
区块链可以包括多个区块数据。区块链中的每个区块数据可以具有位置值。不同区块数据所具有的位置值是不同的。所述位置值可以用于表示区块数据在所述区块链中的位置。根据所述位置值可以从所述区块链中获得区块数据。此外,位置值还可以与区块数据的创建时刻具有关联关系。具体地,创建时刻较早的区块数据,其位置值较小;创建时刻较晚的区块数据,其位置值较大。所述位置值可以包括区块高度。当然,所述位置值还可以包括其它任意能够推导出区块数据的位置的数据。
区块链可以基于区块链网络来实现。所述区块链网络可以包括P2P网络(peer-to-peer network)等。所述区块链网络可以包括多个区块链节点。每个区块链节点可以存储所述区块链中的全部区块数据或部分区块数据。每个区块链节点可以为一个服务器,还可以为包括多个服务器的分布式服务器集群。
分布式服务器集群,可以包括协调服务器和多个任务服务器。所述协调服务器可以负责任务的分配与管理。所述任务服务器可以负责任务的处理。所述分布式服务器集群可以作为一个整体对外提供业务服务。所述分布式服务器集群具体可以基于MPP (Massively Parallel Processing)架构技术来实现。当然,所述分布式服务器集群还可以基于其它架构技术来实现,本说明书实施例对此并不做具体限定。
请参阅图1。本说明书实施例提供一种数据处理系统。
在本实施例中,所述数据处理系统可以包括区块链平台。所述区块链平台可以作为区块链网络中的一个区块链节点。所述区块链平台可以包括至少两个服务器集群。所述至少两个服务器集群可以包括第一服务器集群和第二服务器集群。所述第一服务器集群可以包括第一协调服务器和多个第一任务服务器。所述第二服务器集群可以包括第二协调服务器和多个第二任务服务器。相较于第一任务服务器,第二任务服务器可以具有较好的硬件配置和/或软件配置。因而相较于所述第一服务器集群,所述第二服务器集群可以具有较大的数据处理能力。
在本实施例中,所述第一服务器集群和所述第二服务器集群可以分别存储有区块链中的至少一个区块数据。所述第一服务器集群和所述第二服务器集群中的区块数据,可以认为是所述区块链平台存储的区块数据。此外,如前所述,所述区块链平台可以作为区块链网络中的一个区块链节点。如此,所述第一服务器集群和所述第二服务器集群中的区块数据,还可以认为是该区块链节点存储的区块数据。所述第一服务器集群和所述第二服务器集群中的区块数据可以不同。所述第一服务器集群和所述第二服务器集群中区块数据的数量之和,可以小于或等于所述区块链中区块数据的数量。
以下介绍在所述第一服务器集群中区块数据的存储方式。为了便于描述,这里可以将所述第一服务器集群中的区块数据形成的集合作为区块数据集合。在所述第一服务器集群中,所述区块数据集合中的区块数据可以依据第一特定规则被分布存储于各个第一任务服务器。所述第一特定规则可以根据实际需要灵活设定。例如,所述第一服务器集群可以包括N个第一任务服务器。每个第一任务服务器可以具有第一服务器标识。这里第一服务器标识可以用于标识第一任务服务器,例如可以为第一任务服务器的IP地址、MAC地址、或编号等。所述N个第一任务服务器的第一服务器标识可以分别为A0、A1、A2、….、A(N-1)。那么,在所述区块数据集合中位置值除以N的余数为0的区块数据,可以被存储于第一服务器标识为A0的第一任务服务器;在所述区块数据集合中位置值除以N的余数为1的区块数据,可以被存储于第一服务器标识为A1的第一任务服务器;依次类推,在所述区块数据集合中位置值除以N的余数为N-1的区块数据,可以被存储于第一服务器标识为A(N-1)的第一任务服务器。在所述第一服务器集群中,所述第一协调服务器可以存储有位置值配置数据。所述位置值配置数据可以包括至 少一个位置值。在所述位置值配置数据中每个位置值可以对应有第一服务器标识;该位置值指向的区块数据可以被存储于该第一服务器标识所标识的第一任务服务器。在所述第二服务器集群中区块数据的存储方式,可以与所述第一服务器集群相类似。
需要说明的是,如前所述,所述第一服务器集群和所述第二服务器集群中的区块数据,可以认为是所述区块链平台存储的区块数据。区块数据在生成以后通常是不能够发生变动的。针对区块数据的操作通常仅包括读操作(例如读取区块数据、读取区块数据中的交易数据等)。读操作占用的性能资源(例如CPU、内存、外存等)较少。为了给所述第二服务器集群留取较多的性能资源以处理其它类型的数据,可以将所述区块链平台中创建时间较早的大量区块数据存储于所述第一服务器集群;可以将所述区块链平台中创建时间较晚的少量区块数据存储于所述第二服务器集群。具体地,如前所述,相较于所述第一服务器集群,所述第二服务器集群可以具有较大的数据处理能力。如此,所述区块链平台新增加的区块数据,可以来自所述第二服务器集群,例如来自所述第二服务器集群中的第二协调服务器和/或第二任务服务器。所述区块链平台新增加的区块数据,可以首先被存储于所述第二服务器集群,例如依据第一特定规则被存储于所述第二服务器集群中的第二任务服务器。这样所述第二协调服务器可以每间隔第一预设时间间隔,将各个第二任务服务器中满足位置值判断条件的区块数据,迁移至所述第一服务器集群。具体地,所述第二协调服务器可以从各个第二任务服务器中获取满足位置值判断条件的区块数据;可以向所述第一协调服务器发送获取的区块数据。所述第一协调服务器可以接收区块数据;可以依据第一特定规则将接收的区块数据存储至第一任务服务器。这里第一预设时间间隔的大小可以根据实际需要灵活设定,例如可以为5个小时、1天、或2天等。位置值判断条件可以根据实际需要灵活设定。例如,所述位置值判断条件可以包括:位置值与最大位置值之间的差值大于或等于第一预设阈值。所述最大位置值可以为创建时刻最晚的区块数据所具有的位置值。所述第一预设阈值例如可以为1000、1052、或1070等。另举一例,所述位置值判断条件还可以包括:位置值小于或等于第二预设阈值。
在本实施例中,所述第二服务器集群还可以存储有区块链的状态数据。具体地,区块链的状态数据是能够发生变动的。针对状态数据的操作可以包括读操作和写操作。为了加快针对状态数据的处理速度,可以将区块链的状态数据存储于所述第二服务器集群。
以下介绍在所述第二服务器集群中状态数据的存储方式。为了便于描述,这里可以将所述区块链的各个状态数据形成的集合作为状态数据集合。在所述第二服务器集群中, 所述状态数据集合中的状态数据可以依据第二特定规则被分布存储于各个第二任务服务器。所述第二特定规则可以根据实际需要灵活设定。例如,所述第二服务器集群可以包括N个第二任务服务器。每个第二任务服务器可以具有第二服务器标识。这里第二服务器标识可以用于标识第二任务服务器,例如可以为第二任务服务器的IP地址、MAC地址、或编号等。所述N个第二任务服务器的第二服务器标识可以分别为B0、B1、B2、….、B(N-1)。那么,在所述状态数据集合中成员标识除以N的余数为0的状态数据,可以被存储于第二服务器标识为B0的第二任务服务器;在所述状态数据集合中成员标识除以N的余数为1的状态数据,可以被存储于第二服务器标识为B1的第二任务服务器;依次类推,在所述区块数据集合中成员标识除以N的余数为N-1的状态数据,可以被存储于第二服务器标识为B(N-1)的第二任务服务器。在所述第二服务器集群中,所述第二协调服务器可以存储有成员标识配置数据。所述成员标识配置数据可以包括至少一个成员标识。在所述成员标识配置数据中每个成员标识可以对应有第二服务器标识;该成员标识对应的状态数据可以被存储于该第二服务器标识所标识的第二任务服务器。
在本实施例的一个实施方式中,所述第一服务器集群中的第一协调服务器还可以存储有第一编码值配置数据。所述第二服务器集群中的第二协调服务器还可以存储有第二编码值配置数据。所述第一编码值配置数据和所述第二编码值配置数据均可以包括至少一个编码值。在所述第一编码值配置数据和所述第二编码值配置数据中每个编码值可以对应有位置值。所述第一编码值配置数据和所述第二编码值配置数据中各个编码值对应的位置值的数量的和,可以小于或等于所述区块链平台中区块数据的数量。其中,所述编码值可以为区块数据的编码值、或交易数据的编码值。区块数据的编码值可以用于标识区块数据,具体可以与该区块数据的位置值相对应。交易数据的编码值可以用于标识交易数据,具体可以与包含有该交易数据的区块数据的位置值相对应。所述编码值可以包括哈希值。所述哈希值可以基于哈希算法计算得到。所述哈希算法可以包括SHA-1、SHA-224、SHA-256、SHA-512等。此外,在所述第一编码值配置数据和所述第二编码值配置数据中的编码值为交易数据的编码值时,在所述第一编码值配置数据和所述第二编码值配置数据中每个编码值还可以对应有偏移量;该偏移量可以用于表示该编码值对应的交易数据在区块数据中的偏移位置,便于从区块数据中快速地获取到交易数据。
需要说明的是,如前所述,所述区块链平台新增加的区块数据,可以首先被存储于所述第二服务器集群。如此,所述区块链平台中新增加的区块数据所对应的编码值,可以首先被加入所述第二编码值配置数据。新增加的区块数据所对应的编码值可以为该区块数据的编码值、或该区块数据中交易数据的编码值。这样所述第二协调服务器可以每 间隔第二预设时间间隔,将所述第二编码值配置数据中满足编码值判断条件的编码值,迁移至所述第一协调服务器。具体地,所述第二协调服务器可以从所述第二编码值配置数据中获取满足编码值判断条件的编码值;可以向所述第一协调服务器发送获取的编码值。所述第一协调服务器可以接收编码值;可以将接收的编码值加入所述第一编码值配置数据。这里第二预设时间间隔的大小可以根据实际需要灵活设定,例如可以为10个小时、5天、或10天等。编码值判断条件可以根据实际需要灵活设定。例如,所述编码值判断条件可以包括:编码值小于或等于第三预设阈值。
在本实施例中,所述数据处理系统还可以包括客户端。所述客户端可以为业务服务器、或包括多个业务服务器的服务器集群等。所述客户端可以根据服务器集群的性能信息,从多个协调服务器中选取目标协调服务器,所述多个协调服务器分别隶属于多个服务器集群;可以向所述目标协调服务器发送数据处理请求,以便于所述目标协调服务器隶属的服务器集群能够优先处理所述数据处理请求。
请参阅图2。本说明书实施例提供一种数据处理方法。所述数据处理方法以客户端为执行主体,可以包括以下步骤。
步骤S10:根据服务器集群的性能信息,从多个协调服务器中选取目标协调服务器。
在本实施例中,所述性能信息可以用于表示服务器集群的数据处理能力。所述性能信息可以包括以下至少一种:服务器集群存储的区块数据数量、服务器集群存储的区块数据数量与区块链中区块数据数量的比值、服务器集群的吞吐量(TPS)、服务器集群的并发量、服务器集群的响应时间、服务器集群的硬件配置、服务器集群的软件配置。硬件配置例如可以包括CPU、内存、外存等。软件配置例如可以包括软件的版本等。具体地,在服务器集群存储的区块数据的数量越多时,表示该服务器集群的数据处理能力越小。在服务器集群存储的区块数据数量与区块链中区块数据数量的比值越大时,表示该服务器集群的数据处理能力越小。在服务器集群的吞吐量越大时,表示该服务器集群的数据处理能力越小。在服务器集群的并发量越大时,表示该服务器集群的数据处理能力越小。在服务器集群的响应时间越大时,表示该服务器集群的数据处理能力越小。在服务器集群的硬件配置越强时,表示该服务器集群的数据处理能力越大。
在本实施例中,所述多个协调服务器可以包括第一协调服务器和第二协调服务器。关于所述第一协调服务器和所述第二协调服务器的介绍可以参见前述实施例。所述客户端可以根据第一服务器集群和第二服务器集群的性能信息,比较第一服务器集群和第二服务器集群的数据处理能力;在第一服务器集群的数据处理能力大于第二服务器集群时, 可以选取第一协调服务器作为目标协调服务器;在在第一服务器集群的数据处理能力小于第二服务器集群时,选取第二协调服务器作为目标协调服务器。
需要说明的是,所述客户端可以每间隔预设时间间隔,获取所述第一服务器集群和所述第二服务器集群的性能信息。具体地,所述客户端可以每间隔预设时间间隔,分别向第一协调服务器和第二协调服务器发送性能信息获取请求。所述第一协调服务器可以接收性能信息获取请求;可以获取自身所在服务器集群的性能信息;可以向所述客户端发送获取的性能信息。所述第二协调服务器可以接收性能信息获取请求;可以获取自身所在服务器集群的性能信息;可以向所述客户端发送获取的性能信息。所述客户端可以分别接收所述第一协调服务器和所述第二协调服务器发来的性能信息。或者,所述第一协调服务器还可以每间隔预设时间间隔,主动向所述客户端推送自身所在服务器集群的性能信息。所述客户端可以接收所述第一协调服务器发来的性能信息。相类似地,所述第二协调服务器还可以每间隔预设时间间隔,主动向所述客户端推送自身所在服务器集群的性能信息。所述客户端可以接收所述第二协调服务器发来的性能信息。
步骤S12:向所述目标协调服务器发送数据处理请求,以便于所述目标协调服务器隶属的服务器集群能够优先处理所述数据处理请求。
在本实施例中,所述数据处理请求可以包括以下至少一种:区块数据读取请求、状态数据读取请求、状态数据写请求、交易数据读取请求。其中,所述区块数据读取请求中可以携带有待读取的区块数据的位置值或待读取的区块数据的编码值;所述状态数据读取请求中可以携带有成员标识;所述状态数据写请求中可以携带有成员标识和所述待处理数据;所述交易数据读取请求中可以携带有待读取的交易数据的编码值。
在本实施例中,所述数据处理请求可以指向所述待处理数据。具体地,在所述数据处理请求为区块数据读取请求时,所述待处理数据可以理解为待读取的区块数据。在所述数据处理请求为状态数据读取请求时,所述待处理数据可以理解为待读取的状态数据。在所述数据处理请求为状态数据写请求时,所述待处理数据可以理解为待写入的状态数据。在所述数据处理请求为交易数据读取请求时,所述待处理数据可以理解为待读取的交易数据。
在本实施例中,所述目标协调服务器隶属的服务器集群优先处理所述数据处理请求,可以理解为:在所述目标协调服务器隶属的服务器集群能够单独处理所述数据处理请求时,所述目标协调服务器隶属的服务器集群单独实现对所述数据处理请求的处理;在所述目标协调服务器隶属的服务器集群不能够单独处理所述数据处理请求时,所述目标协 调服务器可以与其它协调服务器进行通信,从而所述目标协调服务器隶属的服务器集群和所述其它协调服务器隶属的服务器集群共同实现所述数据处理请求的处理。
以下通过几个实施方式,详细介绍本实施例的具体实现。
请参阅图3。在本实施例的一个实施方式中,所述待处理数据可以为待读取的区块数据。所述客户端可以选取第一协调服务器作为目标协调服务器;可以向所述第一协调服务器发送区块数据读取请求。所述区块数据读取请求中可以携带有待读取的区块数据的位置值。所述第一协调服务器可以接收区块数据读取请求;可以判断所述位置值是否满足位置值判断条件。
在所述位置值满足位置值判断条件时,所述第一协调服务器便认为所述位置值指向的区块数据被存储于自身所在的服务器集群;可以获取所述位置值指向的区块数据;可以向所述客户端发送获取的区块数据。所述客户端可以接收区块数据。具体地,所述第一协调服务器可以基于位置值配置数据,获取所述位置值对应的第一服务器标识;可以向获取的第一服务器标识所标识的第一任务服务器发送所述位置值。获取的第一服务器标识所标识的第一任务服务器可以接收位置值;可以从本地获取所述位置值指向的区块数据;可以向所述第一协调服务器发送区块数据。所述第一协调服务器可以接收区块数据。关于所述位置值配置数据的介绍可以参见前述实施例。
在所述位置值不满足位置值判断条件时,所述第一协调服务器便认为所述位置值指向的区块数据被存储于第二服务器集群;可以向所述第二协调服务器发送所述位置值。所述第二协调服务器可以接收位置值;可以获取所述位置值指向的区块数据;可以向所述第一协调服务器发送区块数据。所述第一协调服务器可以接收区块数据;可以向所述客户端发送区块数据。所述客户端可以接收区块数据。所述第二协调服务器获取所述位置值指向的区块数据的过程,可以与所述第一协调服务器获取所述位置值指向的区块数据的过程,相类似。二者可以参照解释。
请参阅图4。在本实施例的另一个实施方式中,所述待处理数据可以为待读取的区块数据。所述客户端可以选取第二协调服务器作为目标协调服务器;可以向所述第二协调服务器发送区块数据读取请求。所述区块数据读取请求中可以携带有待读取的区块数据的位置值。所述第二协调服务器可以接收区块数据读取请求;可以判断所述位置值是否满足位置值判断条件。
在所述位置值满足位置值判断条件时,所述第二协调服务器便认为所述位置值指向 的区块数据被存储于第一服务器集群;可以向所述第一协调服务器发送所述位置值。所述第一协调服务器可以接收位置值;可以获取所述位置值指向的区块数据;可以向所述第二协调服务器发送区块数据。所述第二协调服务器可以接收区块数据;可以向所述客户端发送区块数据。所述客户端可以接收区块数据。
在所述位置值不满足位置值判断条件时,所述第二协调服务器便认为所述位置值指向的区块数据被存储于自身所在的服务器集群;可以获取所述位置值指向的区块数据;可以向所述客户端发送区块数据。所述客户端可以接收区块数据。
在本实施例的一个实施方式中,所述待处理数据可以为待读取的状态数据。所述客户端可以选取第二协调服务器作为目标协调服务器;可以向所述第二协调服务器发送状态数据读取请求。所述状态数据读取请求中可以携带有成员标识。所述第二协调服务器可以接收所述状态数据读取请求;可以基于成员标识配置数据,获取所述成员标识对应的第二服务器标识;可以向获取的第二服务器标识所标识的第二任务服务器发送所述成员标识。获取的第二服务器标识所标识的第二任务服务器可以接收成员标识;可以从本地获取所述成员标识对应的状态数据;可以向所述第二协调服务器发送状态数据。所述第二协调服务器可以接收状态数据;可以向所述客户端发送状态数据。所述客户端可以接收状态数据。关于所述成员标识配置数据的介绍可以参见前述实施例。
在本实施例的另一个实施方式中,所述待处理数据可以为待读取的状态数据。所述客户端可以选取第一协调服务器作为目标协调服务器;可以向所述第一协调服务器发送状态数据读取请求。所述状态数据读取请求中可以携带有成员标识。所述第一协调服务器可以接收所述状态数据读取请求;可以向所述第二协调服务器发送成员标识。所述第二协调服务器可以接收成员标识;可以获取所述成员标识对应的状态数据;可以向所述第一协调服务器发送所述状态数据。所述第一协调服务器可以接收状态数据;可以向所述客户端发送状态数据。所述客户端可以接收状态数据。其中,所述第二协调服务器获取成员标识对应的状态数据的过程,可以参见前述实施方式。
在本实施例的一个实施方式中,所述待处理数据可以为待写入的状态数据。所述客户端可以选取第二协调服务器作为目标协调服务器;可以向所述第二协调服务器发送状态数据写请求。所述状态数据写请求中可以携带有成员标识和待写入的状态数据。所述第二协调服务器可以接收所述状态数据写请求;可以基于成员标识配置数据,获取所述成员标识对应的第二服务器标识;可以向获取的第二服务器标识所标识的第二任务服务器发送所述成员标识和所述待写入的状态数据。获取的第二服务器标识所标识的第二任 务服务器可以接收成员标识和待写入的状态数据;可以将所述待写入的状态数据作为所述成员标识对应的状态数据进行存储;可以向所述第二协调服务器发送应答信息。所述第二协调服务器可以接收应答信息;可以向所述客户端发送应答信息。所述客户端可以接收应答信息。
在本实施例的另一个实施方式中,所述待处理数据可以为待写入的状态数据。所述客户端可以选取第一协调服务器作为目标协调服务器;可以向所述第一协调服务器发送状态数据写请求。所述状态数据写请求中可以携带有成员标识和待写入的状态数据。所述第一协调服务器可以接收所述状态数据写请求;可以向所述第二协调服务器发送成员标识和待写入的状态数据。所述第二协调服务器可以接收成员标识和待写入的状态数据;可以基于所述成员标识和所述待写入的状态数据执行写操作;可以向所述第一协调服务器发送应答信息。所述第一协调服务器可以接收应答信息;可以向所述客户端发送应答信息。所述客户端可以接收应答信息。其中,所述第二协调服务器基于所述成员标识和所述待写入的状态数据来执行写操作的过程,可以参见前述实施方式。
请参阅图5。在本实施例的一个实施方式中,所述待处理数据可以为待读取的区块数据。所述客户端可以选取第一协调服务器作为目标协调服务器;可以向所述第一协调服务器发送区块数据读取请求。所述区块数据读取请求中可以携带有待读取的区块数据的编码值。所述第一协调服务器可以接收区块数据读取请求;可以将所述编码值在第一编码值配置数据中进行匹配。
在在第一编码值配置数据中匹配到所述编码值时,所述第一协调服务器可以基于所述第一编码值配置数据,获取所述编码值对应的位置值;可以判断所述位置值是否满足位置值判断条件。在所述位置值满足位置值判断条件时,所述第一协调服务器便认为所述位置值指向的区块数据被存储于自身所在的服务器集群;可以获取所述位置值指向的区块数据;可以向所述客户端发送区块数据。所述客户端可以接收区块数据。在所述位置值不满足位置值判断条件时,所述第一协调服务器便认为所述位置值指向的区块数据被存储于第二服务器集群;可以向所述第二协调服务器发送所述位置值。所述第二协调服务器可以接收所述位置值;可以获取所述位置值指向的区块数据;可以向所述第一协调服务器发送区块数据。所述第一协调服务器可以接收区块数据;可以向所述客户端发送区块数据。所述客户端可以接收区块数据。其中,所述第一协调服务器和所述第二协调服务器获取位置值指向的区块数据的过程,可以参见前述实施方式。在第一编码值配置数据中匹配到所述编码值可以理解为:在第一编码值配置数据中查找到所述编码值。
在在第一编码值配置数据中没有匹配到所述编码值时,所述第一协调服务器便认为能够从第二编码值配置数据中匹配到所述编码值;可以向所述第二协调服务器发送所述编码值。所述第二协调服务器可以接收所述编码值;可以基于第二编码值配置数据,获取所述编码值对应的位置值;可以判断所述位置值是否满足位置值判断条件。在所述位置值不满足位置值判断条件时,所述第二协调服务器便认为所述位置值指向的区块数据被存储于自身所在的服务器集群;可以获取所述位置值指向的区块数据;可以向所述第一协调服务器发送区块数据。所述第一协调服务器可以接收区块数据;可以向所述客户端发送区块数据。所述客户端可以接收区块数据。在所述位置值满足位置值判断条件时,所述第二协调服务器便认为所述位置值指向的区块数据被存储于第一服务器集群;可以向所述第一协调服务器发送所述位置值。所述第一协调服务器可以接收所述位置值;可以获取所述位置值指向的区块数据;可以向所述客户端发送区块数据。所述客户端可以接收区块数据。其中,在第一编码值配置数据中没有匹配到所述编码值可以理解为:在第一编码值配置数据中没有查找到所述编码值。
请参阅图6。在本实施例的另一个实施方式中,所述待处理数据可以为待读取的区块数据。所述客户端可以选取第二协调服务器作为目标协调服务器;可以向所述第二协调服务器发送区块数据读取请求。所述区块数据读取请求中可以携带有待读取的区块数据的编码值。所述第二协调服务器可以接收区块数据读取请求;可以将所述编码值在第二编码值配置数据中进行匹配。
在在第二编码值配置数据中匹配到所述编码值时,所述第二协调服务器可以基于所述第二编码值配置数据,获取所述编码值对应的位置值;可以判断所述位置值是否满足位置值判断条件。在所述位置值满足位置值判断条件时,所述第二协调服务器便认为所述位置值指向的区块数据被存储于第一服务器集群;可以向所述第一协调服务器发送所述位置值。所述第一协调服务器可以接收位置值;可以获取所述位置值指向的区块数据;可以向所述第二协调服务器发送区块数据。所述第二协调服务器可以接收区块数据;可以向所述客户端发送区块数据。所述客户端可以接收区块数据。在所述位置值不满足位置值判断条件时,所述第二协调服务器便认为所述位置值指向的区块数据被存储于自身所在的服务器集群;可以获取所述位置值指向的区块数据;可以向所述客户端发送区块数据。所述客户端可以接收区块数据。
在在第一编码值配置数据中没有匹配到所述编码值时,所述第二协调服务器便认为能够从第一编码值配置数据中匹配到所述编码值;可以向所述第一协调服务器发送所述 编码值。所述第一协调服务器可以接收所述编码值;可以基于第一编码值配置数据,获取所述编码值对应的位置值;可以判断所述位置值是否满足位置值判断条件。在所述位置值满足位置值判断条件时,所述第一协调服务器便认为所述位置值指向的区块数据被存储于自身所在的服务器集群;可以获取所述位置值指向的区块数据;可以向所述第二协调服务器发送区块数据。所述第二协调服务器可以接收区块数据;可以向所述客户端发送区块数据。所述客户端可以接收区块数据。在所述位置值不满足位置值判断条件时,所述第一协调服务器便认为所述位置值指向的区块数据被存储于第二服务器集群;可以向所述第二协调服务器发送所述位置值。所述第二协调服务器可以接收所述位置值;可以获取所述位置值指向的区块数据;可以向所述客户端发送区块数据。所述客户端可以接收区块数据。
请参阅图7。在本实施例的一个实施方式中,所述待处理数据可以为待读取的交易数据。所述客户端可以选取第一协调服务器作为目标协调服务器;可以向所述第一协调服务器发送交易数据读取请求。所述交易数据读取请求中可以携带有待读取的交易数据的编码值。所述第一协调服务器可以接收交易数据读取请求;可以将所述编码值在第一编码值配置数据中进行匹配。
在在第一编码值配置数据中匹配到所述编码值时,所述第一协调服务器可以基于所述第一编码值配置数据,获取所述编码值对应的位置值;可以判断所述位置值是否满足位置值判断条件。在所述位置值满足位置值判断条件时,所述第一协调服务器便认为所述位置值指向的区块数据被存储于自身所在的服务器集群;可以获取所述位置值指向的区块数据;可以从区块数据中获取所述编码值指向的交易数据;可以向所述客户端发送交易数据。所述客户端可以接收交易数据。在所述位置值不满足位置值判断条件时,所述第一协调服务器便认为所述位置值指向的区块数据被存储于第二服务器集群;可以向所述第二协调服务器发送所述位置值。所述第二协调服务器可以接收所述位置值;可以获取所述位置值指向的区块数据;可以向所述第一协调服务器发送区块数据。所述第一协调服务器可以接收区块数据;可以从区块数据中获取所述编码值指向的交易数据;可以向所述客户端发送交易数据。所述客户端可以接收交易数据。
在在第一编码值配置数据中没有匹配到所述编码值时,所述第一协调服务器便认为能够从第二编码值配置数据中匹配到所述编码值;可以向所述第二协调服务器发送所述编码值。所述第二协调服务器可以接收所述编码值;可以基于第二编码值配置数据,获取所述编码值对应的位置值;可以判断所述位置值是否满足位置值判断条件。在所述位 置值不满足位置值判断条件时,所述第二协调服务器便认为所述位置值指向的区块数据被存储于自身所在的服务器集群;可以获取所述位置值指向的区块数据;可以向所述第一协调服务器发送区块数据。所述第一协调服务器可以接收区块数据;可以从区块数据中获取所述编码值指向的交易数据;可以向所述客户端发送交易数据。所述客户端可以接收交易数据。在所述位置值满足位置值判断条件时,所述第二协调服务器便认为所述位置值指向的区块数据被存储于第一服务器集群;可以向所述第一协调服务器发送所述位置值。所述第一协调服务器可以接收所述位置值;可以获取所述位置值指向的区块数据;可以从区块数据中获取所述编码值指向的交易数据;可以向所述客户端发送交易数据。所述客户端可以接收交易数据。
此外,如前所述,在所述第一编码值配置数据和所述第二编码值配置数据中的编码值为交易数据的编码值时,在所述第一编码值配置数据和所述第二编码值配置数据中每个编码值还可以对应有偏移量。如此,所述第一协调服务器可以基于所述第一编码值配置数据,获取编码值对应的位置值和偏移量;进而可以基于偏移量,从区块数据中获取编码值指向的交易数据。或者,所述第二协调服务器可以基于所述第二编码值配置数据,获取编码值对应的位置值和偏移量;可以向所述第一协调服务器发送偏移量。进而所述第一协调服务器可以基于偏移量,从区块数据中获取编码值指向的交易数据。
请参阅图8。在本实施例的另一个实施方式中,所述待处理数据可以为待读取的交易数据。所述客户端可以选取第二协调服务器作为目标协调服务器;可以向所述第二协调服务器发送交易数据读取请求。所述交易数据读取请求中可以携带有待读取的交易数据的编码值。所述第二协调服务器可以接收交易数据读取请求;可以将所述编码值在第二编码值配置数据中进行匹配。
在在第二编码值配置数据中匹配到所述编码值时,所述第二协调服务器可以基于所述第二编码值配置数据,获取所述编码值对应的位置值;可以判断所述位置值是否满足位置值判断条件。在所述位置值满足位置值判断条件时,所述第二协调服务器便认为所述位置值指向的区块数据被存储于第一服务器集群;可以向所述第一协调服务器发送所述位置值。所述第一协调服务器可以接收位置值;可以获取所述位置值指向的区块数据;可以向所述第二协调服务器发送区块数据。所述第二协调服务器可以接收区块数据;可以从区块数据中获取所述编码值指向的交易数据;可以向所述客户端发送交易数据。所述客户端可以接收交易数据。在所述位置值不满足位置值判断条件时,所述第二协调服务器便认为所述位置值指向的区块数据被存储于自身所在的服务器集群;可以获取所述 位置值指向的区块数据;可以从区块数据中获取所述编码值指向的交易数据;可以向所述客户端发送交易数据。所述客户端可以接收交易数据。
在在第一编码值配置数据中没有匹配到所述编码值时,所述第二协调服务器便认为能够从第一编码值配置数据中匹配到所述编码值;可以向所述第一协调服务器发送所述编码值。所述第一协调服务器可以接收所述编码值;可以基于第一编码值配置数据,获取所述编码值对应的位置值;可以判断所述位置值是否满足位置值判断条件。在所述位置值满足位置值判断条件时,所述第一协调服务器便认为所述位置值指向的区块数据被存储于自身所在的服务器集群;可以获取所述位置值指向的区块数据;可以向所述第二协调服务器发送区块数据。所述第二协调服务器可以接收区块数据;可以从区块数据中获取所述编码值指向的交易数据;可以向所述客户端发送交易数据。所述客户端可以接收交易数据。在所述位置值不满足位置值判断条件时,所述第一协调服务器便认为所述位置值指向的区块数据被存储于第二服务器集群;可以向所述第二协调服务器发送所述位置值。所述第二协调服务器可以接收所述位置值;可以获取所述位置值指向的区块数据;可以从区块数据中获取所述编码值指向的交易数据;可以向所述客户端发送交易数据。所述客户端可以接收交易数据。
在本实施例中,所述客户端可以根据服务器集群的性能信息,从多个协调服务器中选取目标协调服务器;可以向所述目标协调服务器发送数据处理请求,以便于所述目标协调服务器隶属的服务器集群能够优先处理所述数据处理请求。这样所述客户端可以根据服务器集群的性能信息的不同,向不同的协调服务器发送数据处理请求;实现了多个服务器集群的负载均衡,从而加快了数据处理处理的速度。
请参阅图9。本说明书实施例还提供一种数据处理装置,应用于客户端。所述数据处理装置可以包括以下单元。
选取单元20,用于根据服务器集群的性能信息,从多个协调服务器中选取目标协调服务器;所述多个协调服务器分别隶属于多个服务器集群;
发送单元22,用于向所述目标协调服务器发送数据处理请求,以便于所述目标协调服务器隶属的服务器集群能够优先处理所述数据处理请求。
请参阅图10。本说明书实施例还提供一种客户端。所述客户端可以包括存储器和处理器。
在本实施例中,所述存储器包括但不限于动态随机存取存储器(Dynamic Random  Access Memory,DRAM)和静态随机存取存储器(Static Random Access Memory,SRAM)等。所述存储器可以用于存储计算机指令。
在本实施例中,所述处理器可以按任何适当的方式实现。例如,所述处理器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式等等。所述处理器可以用于执行所述计算机指令实现以下步骤:根据服务器集群的性能信息,从多个协调服务器中选取目标协调服务器;所述多个协调服务器分别隶属于多个服务器集群;向所述目标协调服务器发送数据处理请求,以便于所述目标协调服务器隶属的服务器集群能够优先处理所述数据处理请求。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其对于数据处理装置实施例、和客户端实施例而言,由于其基本相似于数据处理方法实施例,所以描述的比较简单,相关之处参见数据处理方法实施例的部分说明即可。
此外,可以理解的是,所属领域技术人员在阅读本说明书文件之后,可以无需创造性劳动想到本说明书文件中列举的部分或全部实施例之间可以组合,这些组合也在本说明书公开和保护的范围内。
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable Gate Array,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片2。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression  Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit Hardware Description Language)与Verilog2。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机。具体的,计算机例如可以为个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本说明书可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本说明书的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本说明书各个实施例或者实施例的某些部分所述的方法。
本说明书可用于众多通用或专用的计算机系统环境或配置中。例如:个人计算机、服务器计算机、手持设备或便携式设备、平板型设备、多处理器系统、基于微处理器的系统、置顶盒、可编程的消费电子设备、网络PC、小型计算机、大型计算机、包括以上任何系统或设备的分布式计算环境等等。
本说明书可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本说明书,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。
虽然通过实施例描绘了本说明书,本领域普通技术人员知道,本说明书有许多变形和变化而不脱离本说明书的精神,希望所附的权利要求包括这些变形和变化而不脱离本说明书的精神。

Claims (10)

  1. 一种数据处理方法,包括:
    根据服务器集群的性能信息,从多个协调服务器中选取目标协调服务器;所述多个协调服务器分别隶属于多个服务器集群;
    向所述目标协调服务器发送数据处理请求,以便于所述目标协调服务器隶属的服务器集群能够优先处理所述数据处理请求。
  2. 如权利要求1所述的方法,所述性能信息包括以下至少一种:
    服务器集群存储的区块数据数量;
    服务器集群存储的区块数据数量与区块链中区块数据数量的比值;
    服务器集群的吞吐量;
    服务器集群的并发量;
    服务器集群的响应时间;
    服务器集群的硬件配置。
  3. 如权利要求1所述的方法,所述性能信息用于表示服务器集群的数据处理能力;所述多个服务器集群对应同一区块链节点。
  4. 如权利要求1所述的方法,所述多个协调服务器包括第一协调服务器和第二协调服务器;所述第一协调服务器隶属于第一服务器集群;所述第二协调服务器隶属于第二服务器集群;相应地,所述从多个协调服务器中选取目标协调服务器,包括:
    根据服务器集群的性能信息,比较第一服务器集群和第二服务器集群的数据处理能力;
    在第一服务器集群的数据处理能力大于第二服务器集群时,选取第一协调服务器作为目标协调服务器;或者,在第一服务器集群的数据处理能力小于第二服务器集群时,选取第二协调服务器作为目标协调服务器。
  5. 如权利要求1所述的方法,所述数据处理请求包括区块数据读取请求;所述区块数据读取请求中携带有待读取的区块数据的位置值或编码值。
  6. 如权利要求1所述的方法,所述数据处理请求包括状态数据读取请求;所述状态数据读取请求中携带有成员标识。
  7. 如权利要求1所述的方法,所述数据处理请求包括状态数据写请求;所述状态数据写请求中携带有成员标识和待写入的状态数据。
  8. 如权利要求1所述的方法,所述数据处理请求包括交易数据读取请求;所述交易数据读取请求中携带有待读取的交易数据的编码值。
  9. 一种数据处理装置,包括:
    选取单元,用于根据服务器集群的性能信息,从多个协调服务器中选取目标协调服务器;所述多个协调服务器分别隶属于多个服务器集群;
    发送单元,用于向所述目标协调服务器发送数据处理请求,以便于所述目标协调服务器隶属的服务器集群能够优先处理所述数据处理请求。
  10. 一种客户端,包括:
    存储器,用于存储计算机指令;
    处理器,用于执行所述计算机指令实现以下步骤:根据服务器集群的性能信息,从多个协调服务器中选取目标协调服务器;所述多个协调服务器分别隶属于多个服务器集群;向所述目标协调服务器发送数据处理请求,以便于所述目标协调服务器隶属的服务器集群能够优先处理所述数据处理请求。
PCT/CN2019/086841 2018-08-01 2019-05-14 数据处理方法和装置、客户端 WO2020024650A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
SG11202010202XA SG11202010202XA (en) 2018-08-01 2019-05-14 Data processing method, apparatus, and client device
EP19845116.3A EP3779693A4 (en) 2018-08-01 2019-05-14 METHOD AND DEVICE FOR DATA PROCESSING AND CLIENT
US17/086,155 US11233878B2 (en) 2018-08-01 2020-10-30 Data processing method, apparatus, and client device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810861740.2 2018-08-01
CN201810861740.2A CN109032803B (zh) 2018-08-01 2018-08-01 数据处理方法和装置、客户端

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/086,155 Continuation US11233878B2 (en) 2018-08-01 2020-10-30 Data processing method, apparatus, and client device

Publications (1)

Publication Number Publication Date
WO2020024650A1 true WO2020024650A1 (zh) 2020-02-06

Family

ID=64648246

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/086841 WO2020024650A1 (zh) 2018-08-01 2019-05-14 数据处理方法和装置、客户端

Country Status (6)

Country Link
US (1) US11233878B2 (zh)
EP (1) EP3779693A4 (zh)
CN (1) CN109032803B (zh)
SG (1) SG11202010202XA (zh)
TW (1) TWI694700B (zh)
WO (1) WO2020024650A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109032803B (zh) * 2018-08-01 2021-02-12 创新先进技术有限公司 数据处理方法和装置、客户端
CN109145053B (zh) * 2018-08-01 2021-03-23 创新先进技术有限公司 数据处理方法和装置、客户端、服务器
CN109032804B (zh) * 2018-08-01 2020-12-11 创新先进技术有限公司 数据处理方法和装置、服务器
CN109785132A (zh) * 2018-12-21 2019-05-21 众安信息技术服务有限公司 一种基于区块链的防伪溯源方法、装置及存储介质
CN110046036A (zh) 2018-12-25 2019-07-23 阿里巴巴集团控股有限公司 一种操作请求分配方法、装置及设备
GB2581504A (en) * 2019-02-20 2020-08-26 Smartpipe Tech Ltd Processing data in a network

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106817408A (zh) * 2016-12-27 2017-06-09 中国银联股份有限公司 一种分布式服务器集群调度方法及装置
US20170279774A1 (en) * 2016-03-28 2017-09-28 International Business Machines Corporation Decentralized Autonomous Edge Compute Coordinated by Smart Contract On A Blockchain
CN109032803A (zh) * 2018-08-01 2018-12-18 阿里巴巴集团控股有限公司 数据处理方法和装置、客户端

Family Cites Families (33)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6681251B1 (en) * 1999-11-18 2004-01-20 International Business Machines Corporation Workload balancing in clustered application servers
US7693991B2 (en) * 2004-01-16 2010-04-06 International Business Machines Corporation Virtual clustering and load balancing servers
US8230426B2 (en) 2004-10-06 2012-07-24 Digipede Technologies, Llc Multicore distributed processing system using selection of available workunits based on the comparison of concurrency attributes with the parallel processing characteristics
CN101431520A (zh) * 2008-12-24 2009-05-13 金蝶软件(中国)有限公司 一种建立连接的方法、重定向连接的方法及相关设备
US8745128B2 (en) * 2010-09-01 2014-06-03 Edgecast Networks, Inc. Optimized content distribution based on metrics derived from the end user
US9842299B2 (en) * 2011-01-25 2017-12-12 Telepathy Labs, Inc. Distributed, predictive, dichotomous decision engine for an electronic personal assistant
CN102761528A (zh) * 2011-04-28 2012-10-31 中兴通讯股份有限公司 数据管理系统及方法
US9569771B2 (en) * 2011-04-29 2017-02-14 Stephen Lesavich Method and system for storage and retrieval of blockchain blocks using galois fields
US10628578B2 (en) * 2013-03-15 2020-04-21 Imagine Communications Corp. Systems and methods for determining trust levels for computing components using blockchain
CN104780210B (zh) * 2015-04-13 2019-01-25 新华三技术有限公司 负载均衡方法以及装置
CN104834722B (zh) * 2015-05-12 2018-03-02 网宿科技股份有限公司 基于cdn的内容管理系统
US9965330B2 (en) 2015-09-18 2018-05-08 Salesforce.Com, Inc. Maintaining throughput of a stream processing framework while increasing processing load
CN105719185B (zh) * 2016-01-22 2019-02-15 杭州复杂美科技有限公司 区块链的数据对比及共识方法
US10311026B2 (en) * 2016-05-27 2019-06-04 International Business Machines Corporation Compressed data layout for optimizing data transactions
CN105959395B (zh) * 2016-06-15 2019-04-19 徐州医科大学 一种集群自反馈式负载均衡调度系统及方法
CN107645519B (zh) * 2016-07-21 2021-08-06 阿里巴巴集团控股有限公司 一种数据处理方法及系统、客户端及服务器
CN106326641A (zh) * 2016-08-13 2017-01-11 深圳市樊溪电子有限公司 基于压缩感知和稀疏重构算法的区块链系统数据处理方法
CN106339255B (zh) * 2016-08-24 2019-10-11 北京小米移动软件有限公司 定时任务的调度方法、系统、装置及服务器
US20180060133A1 (en) 2016-09-01 2018-03-01 Amazon Technologies, Inc. Event-driven resource pool management
CN106357405A (zh) * 2016-09-19 2017-01-25 弗洛格(武汉)信息科技有限公司 一种基于区块链技术一致性算法的数据管理方法及系统
CN106713412B (zh) * 2016-11-09 2020-11-06 弗洛格(武汉)信息科技有限公司 一种区块链系统及区块链系统的架构方法
CN106598490A (zh) * 2016-11-25 2017-04-26 深圳前海微众银行股份有限公司 区块链数据的访问方法和区块链管理系统
CN107079059B (zh) * 2016-12-21 2019-12-10 深圳前海达闼云端智能科技有限公司 区块链存储方法、装置及节点设备
CN106487936A (zh) * 2016-12-29 2017-03-08 深圳市优必选科技有限公司 数据传输方法及设备、分布式存储系统
JP6827327B2 (ja) * 2017-01-05 2021-02-10 株式会社日立製作所 分散コンピューティングシステム
CN107040582B (zh) 2017-02-17 2020-08-14 创新先进技术有限公司 一种数据处理方法及装置
CN106959826A (zh) * 2017-03-28 2017-07-18 联想(北京)有限公司 一种数据存储系统及方法
CN107360206B (zh) 2017-03-29 2020-03-27 创新先进技术有限公司 一种区块链共识方法、设备及系统
CN106991164A (zh) * 2017-03-31 2017-07-28 北京京东金融科技控股有限公司 基于区块链的用于金融数据处理的方法、装置及电子设备
CN107317841B (zh) * 2017-05-31 2019-11-22 北京奇艺世纪科技有限公司 一种数据服务请求处理方法及装置
CN107436813A (zh) * 2017-08-03 2017-12-05 郑州云海信息技术有限公司 一种元数据服务器动态负载均衡的方法及系统
CN107317730B (zh) * 2017-08-21 2020-09-04 上海点融信息科技有限责任公司 用于监控区块链节点状态的方法、设备和系统
CN108345643A (zh) * 2018-01-12 2018-07-31 联动优势电子商务有限公司 一种数据处理方法及装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170279774A1 (en) * 2016-03-28 2017-09-28 International Business Machines Corporation Decentralized Autonomous Edge Compute Coordinated by Smart Contract On A Blockchain
CN106817408A (zh) * 2016-12-27 2017-06-09 中国银联股份有限公司 一种分布式服务器集群调度方法及装置
CN109032803A (zh) * 2018-08-01 2018-12-18 阿里巴巴集团控股有限公司 数据处理方法和装置、客户端

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SHAO, QIFENG ET AL: "Blockcahin: architecture and Research Progress", CHINESE JOURNAL OF COMPUTER, vol. 41, no. 5, 31 May 2018 (2018-05-31), pages 969 - 988, XP055684768 *
TREACLE TIAN: "MPP distributed scheme based on Postgres-XL", CSDN BLOG, 16 November 2016 (2016-11-16), XP055684765, Retrieved from the Internet <URL:https://blog.csdn.net/sunziyue/article/details/53189304> *

Also Published As

Publication number Publication date
EP3779693A1 (en) 2021-02-17
SG11202010202XA (en) 2020-11-27
TWI694700B (zh) 2020-05-21
US20210051215A1 (en) 2021-02-18
EP3779693A4 (en) 2021-06-02
CN109032803B (zh) 2021-02-12
TW202008763A (zh) 2020-02-16
US11233878B2 (en) 2022-01-25
CN109032803A (zh) 2018-12-18

Similar Documents

Publication Publication Date Title
WO2020024650A1 (zh) 数据处理方法和装置、客户端
US10706023B2 (en) Blockchain consensus method and device
US10594489B2 (en) Method and device for processing service request
EP3547170B1 (en) Blockchain-based consensus method and device
CN113766035B (zh) 一种业务受理及共识的方法及装置
WO2020024648A1 (zh) 数据处理方法和装置、客户端、服务器
US10789085B2 (en) Selectively providing virtual machine through actual measurement of efficiency of power usage
EP3565219B1 (en) Service execution method and device
JP2020515976A (ja) ブロックチェーンコンセンサスのための方法、装置およびシステム
US11366925B2 (en) Methods and apparatuses for chaining service data
US10999283B2 (en) Addressing transaction conflict in blockchain systems
WO2023131058A1 (zh) 一种企业数字中台中资源服务应用的调度系统和方法
TW201727517A (zh) 資料儲存與業務處理的方法及裝置
WO2020024649A1 (zh) 数据处理方法和装置、服务器
WO2023207087A1 (zh) 用于区块链的最优链路选择方法及装置和电子设备
WO2024092932A1 (zh) 交易执行方法和区块链节点

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19845116

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2019845116

Country of ref document: EP

Effective date: 20201027

NENP Non-entry into the national phase

Ref country code: DE