Detailed Description
The present disclosure is described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary system architecture 100 of an embodiment of a data uplink method based on a block chain technology or a data uplink apparatus based on a block chain technology to which an embodiment of the present disclosure may be applied.
As shown in fig. 1, system architecture 100 may include end devices 111, 112, 121, 122, 131, 132, networks 113, 123, 133, 101, and servers 110, 120, 130, 102. Network 113 is the medium used to provide communication links between terminal devices 111, 112 and server 110. Network 123 is the medium used to provide communication links between terminal devices 121, 122 and server 120. Network 133 is the medium used to provide communication links between terminal devices 131, 132 and server 130. Network 101 serves as a medium for providing communication links between servers 110, 120, 130 and server 102. The networks 113, 123, 133, 101 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with server 110 via network 113 using terminal devices 111, 112, or with server 120 via network 123 using terminal devices 121, 122, or with server 130 via network 133 using terminal devices 131, 132 to receive or transmit data (e.g., data processing requests), etc. The terminal devices 111, 112, 121, 122, 131, 132 may have various client applications installed thereon, such as digital currency transaction software, banking client applications, web browser applications, shopping-like applications, search-like applications, instant messaging tools, mailbox clients, social platform software, and the like.
The terminal devices 111, 112, 121, 122, 131, and 132 may be hardware or software. When the terminal devices 111, 112, 121, 122, 131, 132 are hardware, they may be various electronic devices having a display screen and supporting page browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like. When the terminal devices 111, 112, 121, 122, 131, and 132 are software, they can be installed in the electronic devices listed above. It may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The servers 110, 120, 130, 102 may be servers that provide various services. For example, server 110 may provide a background web server supporting pages displayed on terminal devices 111, 112; the server 120 may be a background web server that provides support for pages displayed on the terminal devices 121, 122; the server 130 may provide a back-end server supporting the pages displayed on the end devices 131, 132. Illustratively, the background server may support at least one of the following operations on the asset, which are performed by the user through the terminal device: first purchase, cyclic purchase, repayment, refund, overdue, and replacement by entering a pool. The server 102 may determine whether the obtained data processing request is endorsed through after obtaining the data processing request from the servers 110, 120, 130, wherein an endorsement node in a predetermined node set determines whether the data processing request is endorsed through based on an endorsement policy, and in case the data processing request is endorsed through, add a request message indicating the data processing request to a request message queue in a predetermined distributed publish-subscribe message system, and sequentially uplink data to be uplink corresponding to the data processing request indicated by the request message in the order of the request messages in the request message queue. Wherein each node in the node set may be a server 110, 120, 130. As an example, the servers 110, 120, 130, 102 may be cloud servers or physical servers.
The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be noted that the block chain technology-based data uplink method provided by the embodiments of the present disclosure is generally performed by a server. Accordingly, various parts (e.g., units, sub-units, modules, sub-modules) included in the data uplink apparatus based on the block chain technology may be disposed in the server.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. Further, the server or terminal device in fig. 1 is merely exemplary. According to actual needs, the server in the figure can be replaced by the terminal device, or the terminal device in the figure can be replaced by the server. For example, the servers 110, 120, 130 in fig. 1 may also be terminal devices.
With continued reference to fig. 2, a flow 200 of one embodiment of a block chain technology based data uplink method in accordance with the present disclosure is shown. The data uplink method based on the block chain technology comprises the following steps:
step 201, a data processing request is obtained.
In the present embodiment, an executing entity (e.g., the server 102 shown in fig. 1) of the data uplink method based on the blockchain technique can obtain the data processing request.
The data processing request may be a request for processing data. For example, the data processing request may be used to uplink data to be uplink, query the uplink data, and upload or download files.
Step 202, if the data processing request is for uplink transmission of data to be uplink transmitted, determining whether the data processing request is endorsed through.
In this embodiment, in a case that the data processing request is for uplink of data to be uplink, the execution main body may determine whether the data processing request obtained in step 201 passes endorsement. And the endorsement node in the predetermined node set determines whether the data processing request passes the endorsement based on the endorsement strategy.
Wherein, the node (peer) in the node set refers to a communication entity of the block chain. A node belongs to a logical concept, and multiple nodes of different types can run on the same physical device (e.g., a server).
It is understood that all nodes in the node set are accounting nodes (Committer). And partial nodes in the node set can execute transactions according to the setting of the endorsement policy, and sign endorsements on the results, thereby playing the role of an endorsement node (Endorser). The endorsement node is a dynamic role, each chain code can set an endorsement strategy when being instantiated, and nodes in the node set are appointed to be effective after transaction endorsement. The node is the endorsement node only when the application initiates a transaction endorsement request to the node, otherwise it is the ordinary accounting node. Each endorsement node in the predetermined set of nodes may determine whether the data processing request passes the endorsement policy based on the endorsement policy. Functionally, the endorsement node is primarily used to endorse transactions prior to submission of the transaction in response to an endorsement request for a particular chain code. It should be noted that each chain code may specify an endorsement policy (i.e., the endorsement policies may be different and may be specified), and these endorsement policies often involve a collection of endorsement nodes. Further, the endorsement policy defines the requirements of legal transaction endorsements (the most typical endorsement policy is to specify some nodes to endorse, form a set of endorsement nodes, complete the signature of a set of endorsement nodes, and combine the signature). In practice, it may be determined that the data processing request endorses a pass in the case that the data processing request satisfies the endorsement policy of the target number of endorsement nodes in the predetermined set of nodes.
The target number may be a predetermined number, or may be a product of the number of endorsement nodes in the node set and a predetermined number. As an example, the target number may be a product of the number of endorsement nodes in the node set and two thirds, or may be a majority of the number of endorsement nodes in the node set. In the case where the target number is the majority of the number of endorsement nodes in the node set, this step 202 may be equivalently expressed as: if the data processing request is used for uplink transmission of data to be uplink transmitted, determining whether the data processing request meets an endorsement policy of a plurality of endorsement nodes in a predetermined node set.
And step 203, if the data processing request endorsement passes, adding a request message indicating the data processing request to a request message queue in a predetermined distributed publish-subscribe message system.
In this embodiment, in the case that the data processing request endorsement passes, the execution agent may add a request message indicating the data processing request to a request message queue in the predetermined distributed publish-subscribe message system.
The distributed publish-subscribe message system may be Kafka, or a distributed publish-subscribe message system developed by a technician according to actual needs. Wherein, Kafka is a distributed publish-subscribe messaging system. Kafka can provide persistence of messages (i.e., request messages) by a disk data structure of algorithmic complexity O (1) that can maintain stable performance for even millions of bytes (TB) of message storage for long periods of time. Furthermore, Kafka also has the feature of high throughput, even with ordinary hardware, which can produce about 25 thousand messages per second (50MB) and process 55 thousand messages per second (110 MB). Support for partitioning messages by Kafka server and consumer clusters, and support for Hadoop parallel data loading.
The request message may be the data processing request itself, or may be data requested to be processed by the data processing request, or may be an identifier of the data requested to be processed by the data processing request (for example, encrypted data of the data requested to be processed by the data processing request).
Step 204, according to the sequence of the request messages in the request message queue, sequentially uplink data to be uplink corresponding to the data processing request indicated by the request message.
In this embodiment, the execution main body may sequentially uplink data to be uplink corresponding to the data processing request indicated by the request message according to the order of the request messages in the request message queue.
Here, the manner of uplink data to be uplink may include, but is not limited to: content certificate storage, Hashima certificate storage, link certificate storage, privacy certificate storage and shared privacy certificate storage. Wherein, the content certification means to put the data to be linked directly into the block chain. The Hash certificate is used for storing the uplink of the hash value of the data to be uplink. The hash value of the data to be uplink is also commonly referred to as "digital fingerprint" and can be obtained by performing a hash operation on the data to be uplink. The link certificate is equivalent to adding a Uniform Resource Identifier (URI) address of the data to be uplink on the basis of the hash certificate, so that the address and the digital fingerprint of the data to be uplink are stored in the block chain and can be mutually verified. The privacy certification is to encrypt the data to be linked and store the encrypted data on the blockchain, which is a policy adopted to deal with the fact that the data on the blockchain are all publicly transparent. The privacy sharing is to encrypt the data to be linked and then encrypt the encrypted key again by using asymmetric encryption. That is, the first encryption of the file content is symmetric encryption, and the second encryption of the key is asymmetric encryption.
With continued reference to fig. 3, fig. 3 is a schematic diagram illustrating an application scenario of the data uplink method based on the block chain technique according to the present embodiment. In the application scenario of fig. 3, the server 301 obtains a data processing request 3011 from the node 302. Then, in the case that the data processing request is used for uplink of data to be uplink, the server 301 determines whether the data processing request is endorsed through. And the endorsement node in the predetermined node set determines whether the data processing request passes the endorsement based on the endorsement strategy. In the application scenario shown in fig. 3, the server 301 determines that the data processing request endorsement passes. Thereafter, the server 301 adds a request message indicating the data processing request 3011 to a request message queue 3012 in the predetermined distributed publish-subscribe message system. Finally, the server 301 sequentially uplink the to-be-uplink data 3013 corresponding to the data processing request indicated by the request message in the order of the request messages in the request message queue 3012, and obtains the uplink data 3014.
The data uplink method based on the block chain technology provided by the above embodiments of the present disclosure enriches uplink modes by acquiring a data processing request, then determining whether the data processing request passes endorsement if the data processing request is used for uplink of data to be uplink, where an endorsement node in a predetermined node set determines whether the data processing request passes endorsement based on an endorsement policy, then adding a request message indicating the data processing request to a request message queue in a predetermined distributed publish-subscribe message system if the data processing request passes endorsement, and finally, sequentially uplink data to be uplink corresponding to the data processing request indicated by the request message according to an order of the request messages in the request message queue, since the distributed publish-subscribe message system can process tens of millions (typically more than 1500 tens of millions) of messages per second, and the data aggregation rate is high (usually close to 1Tbps), and the distributed publish-subscribe message system simplifies the processing of the data stream, and has high throughput capability and expandability, thereby improving the speed of data uplink and reducing the occupation time of resources such as CPU (Central processing Unit), bandwidth and the like in the data uplink process.
In some optional implementations of the embodiment, the data to be uplink is used to indicate an exchange amount of the first item and the second item for exchange. The exchange volume includes a reduced quantity of the first item and an increased quantity of the second item. And, the executing body may further execute the steps of:
the method comprises the first step of determining whether the decreased quantity of the first article is matched with the increased quantity of the second article according to a preset time interval.
Here, in the case where the number of first item reductions and the number of second item increases are equal, it may be determined that the number of first item reductions and the number of second item increases match; in the case where the number of first item reductions and the number of second item increases are not equal, it may be determined that the number of first item reductions and the number of second item increases do not match.
Optionally, it may also be determined whether the decreased amount of the first item and the increased amount of the second item match by:
first, the difference between the total value variation of the first item and the total value variation of the second item is calculated. The total value variation of the first item is the product of the value of a single first item and the number of the first items decreased, and the total value variation of the second item is the product of the value of a single second item and the number of the second items increased.
Then, the sum of the total value variation of the first item and the total value variation of the second item is calculated.
Then, the absolute value of the ratio of the obtained difference to the sum is taken as a calculation result.
Finally, in the case that the above calculation result is less than or equal to the preset threshold, it may be determined that the number of the first article decrease matches the number of the second article increase; in the case where the calculation result is greater than the preset threshold, it may be determined that the number of first item reductions and the number of second item increases do not match.
And a second step of generating information indicating that the exchange amount of the first item does not match the exchange amount of the second item in a case where the decreased amount of the first item does not match the increased amount of the second item.
It is understood that the determination of whether the uplink data is correct may be made by determining whether the decreased amount of the first item matches the increased amount of the second item. Under the condition that the decreased number of the first article is not matched with the increased number of the second article, information for indicating that the exchange quantity of the first article is not matched with that of the second article can be generated, so that the problems existing in the uplink data can be timely found, and the accuracy, reliability, consistency and stability of the uplink data are guaranteed.
In some optional implementations of this embodiment, the data to be uplink is generated by a node in the set of nodes. And the executing agent or the electronic device communicatively connected to the executing agent may obtain the data to be uplink corresponding to the node in the node set through the following generating steps:
and encrypting the data of the preset type generated by the node by adopting an encryption mode predetermined for the node to obtain encrypted data corresponding to the node, and taking the encrypted data corresponding to the node as the data to be uplink corresponding to the node.
Here, a relevant person (e.g., a technician or a person in charge of managing the nodes) may determine an encryption manner in advance for each node. The encryption modes of the respective nodes may be different from each other. Therefore, the security of the uplink data can be ensured. In addition, the encryption information of the encryption mode predetermined for each node can be stored in the node (for example, in the Mysql database of the node), thereby further ensuring the security of the uplink data.
In some optional implementations of this embodiment, the generating step further includes the following sub-steps:
the data to be uplink is stored in a predetermined relational database. The relational database may be Mysql, Postpresql, or the like.
It can be understood that, in the case of storing the data to be linked in the Mysql database, the Mysql database may monitor the Binlog log function, and perform monitoring and task generation on the newly configured system. In addition, the execution main body may call the data to be uplink in the relational database at every preset time period, so as to uplink the data.
In some optional implementations of this embodiment, the executing entity may further store the uplink data in a predetermined Hbase database of the distributed storage system. The Hbase is distributed open source data facing columns, and a distributed storage system of structured data.
Here, after the execution entity stores the uplink data in the Hbase database, it can further perform consensus in the blockchain, provide query services through the prepackaged interface, and thus query the uplink data in real time and monitor the uplink data.
In practice, the Hbase table (i.e. the table structure of Hbase) can be split into several regions (basic units of data storage and management in Hbase) according to the rowkey range. Each region contains all the rows before the start key and end key of the region. Each Region may be assigned to some of the nodes in the node set for management, and the nodes for managing the regions may be referred to as Region servers, and the Region servers are responsible for processing read and write requests of uplink data. Each Region Server can manage about 1000 regions. In addition, the HBase may use a reliable coordination system (Zookeeper) of the distributed system for distributed management services to maintain the state of all services in the cluster. Zookeeper can use a consistency protocol to ensure consistency of the distributed state. The Region Servers and the central node (HMaster), Zookeeper in the above node set maintain the session. Zookeeper can maintain all temporary nodes through heartbeat detection. The Meta table is a special HBasetable that maintains a list of all the regions in the system. Tablel resembles a B-tree. When the service of a certain node is down and the like, the normal operation of other nodes is not influenced.
It can be understood that in the existing technical solution for querying uplink data, paging query for uplink data is often not supported, and in the optional implementation manner, the uplink data may be stored in a predetermined distributed storage system Hbase database, so that paging query for the uplink data is implemented.
In some optional implementations of this embodiment, in a case where the data processing request is sent through a target browser via a node in the node set and is used for uploading or downloading a file, the execution subject may upload or download the file through the target browser. The target browser may be a browser supported by a node (e.g., terminal devices 111, 112, 121, 122, 131, and 132 shown in fig. 1) installed in the node set or a node (e.g., servers 110, 120, and 130 shown in fig. 1) in the node set. As an example, the target browser may be a blockchain browser.
It is understood that the alternative implementation may implement the file uploading or downloading function through a pre-packaged interface. Therefore, the function expansion of the target browser is realized.
In some optional implementations of this embodiment, the executing main body may execute the step 204 by:
and through the local area network, according to the sequence of the request messages in the request message queue, sequentially calling the request messages from the request message queue, and performing uplink on the data to be uplink corresponding to the data processing request indicated by each called request message.
It can be understood that the data security of each node can be ensured by invoking the request message from the request message queue through the local area network, not through the external network.
In some optional implementations of this embodiment, the executing main body may also execute the step 204 by using the following steps:
according to the sequence of the request messages in the request message queue, determining whether the data to be uplink corresponding to the data processing request indicated by the request message meets a target rule or not for each request message in the request message queue, and if so, performing uplink on the data to be uplink corresponding to the data processing request indicated by the request message, wherein the target rule is determined by a node in the node set corresponding to the data to be uplink. The target rule may be a rule determined by the node for determining whether uplink data can be uplink-treated.
Here, the relevant person (e.g., a technician or a person responsible for managing the nodes) may have one or more target rules predetermined for each node. The target rules corresponding to the respective nodes may be different from each other. Therefore, the security of the uplink data can be ensured. In addition, the target rule determined by each node can be stored locally at the node (e.g., in the Mysql database of the node), thereby further improving the security of the data.
With further reference to fig. 4, a flow 400 of yet another embodiment of a block chain technology based data uplink method is shown. The process 400 of the block chain technology based data uplink method includes the following steps:
step 401, a data processing request is obtained.
In this embodiment, step 401 is substantially the same as step 201 in the corresponding embodiment of fig. 2, and is not described here again.
Step 402, if the data processing request is for uplink transmission of data to be uplink transmitted, determining whether the data processing request is endorsed through.
In this embodiment, step 402 is substantially the same as step 202 in the corresponding embodiment of fig. 2, and is not described herein again.
In step 403, if the data processing request endorsement passes, a request message indicating the data processing request is added to a request message queue in the predetermined distributed publish-subscribe message system.
In this embodiment, step 403 is substantially the same as step 203 in the corresponding embodiment of fig. 2, and is not described herein again.
Step 404, sequentially uplink data to be uplink corresponding to the data processing request indicated by the request message according to the sequence of the request messages in the request message queue.
In this embodiment, step 404 is substantially the same as step 204 in the corresponding embodiment of fig. 2, and is not described herein again.
Step 405 stores the uplink data in a predetermined Hbase database of the distributed storage system.
In the present embodiment, the performing entity (e.g., the server 102 shown in fig. 1) of the data uplink method based on the blockchain technique may store the uplink data in a predetermined Hbase database of the distributed storage system.
In this embodiment, step 405 is substantially the same as the optional implementation manner of the embodiment corresponding to fig. 2, and is not described here again.
In step 406, if the data processing request is sent through the target browser via a node in the node set and is used for querying the uplink data, querying the data indicated by the data processing request from the Hbase database so that the queried data is presented through the target browser.
In this embodiment, in a case where a data processing request is sent through a target browser via a node in the node set and is used for querying the uplink data, the executing entity may query the Hbase database for data indicated by the data processing request, so that the queried data is presented through the target browser. The target browser may be a browser installed on a node in the node set (e.g., the terminal devices 111, 112, 121, 122, 131, 132 or the servers 110, 120, 130 shown in fig. 1). As an example, the target browser may be a blockchain browser.
As an example, please refer to fig. 5A-5D. Fig. 5A-5D are merely examples and should not be construed as limiting the embodiments of the present application in any way.
Referring to fig. 5A, fig. 5A is a block diagram of an embodiment of a data uplink method based on a block chain technique according to the present disclosure.
The framework diagram shown in fig. 5A includes a data interface layer, a Service processing layer, and a bas (Backend as a Service) Service.
The data interface layer is used for providing an interactive interface with nodes such as an asset service organization, a dealer service, a bank hosting system and the like. The service interface layer is deployed on an SDK (software development Kit, i.e., ChainCode-API in fig. 5B) provided by a resource management technology platform group, and performs data loading and transmission through respective private keys of organizations, TLS certificate authentication, and rights management control. The standardized configuration module is used for verifying through an interfacing configuration reading rule engine, configuring an encryption form of data to be linked in a user-defined mode, storing the encryption form into a relational database Mysql, transmitting the data through an external system interface, writing the data into a distributed storage database Hbase and a levelDB database, realizing the functions of block query, transaction and basic information query through a target browser (such as a block chain browser), and configuring system parameters, uplink dimension configuration, a desensitization rule engine, asset contracts and the like. The distributed storage system of the service interface layer can support large-scale, distributed and data-intensive distributed data storage, and relevant data query can be carried out in a large amount of data. The service processing layer is provided with a data management module, a message queue module and an event monitoring module. The data management module can perform AKS algorithm and DES algorithm on the data to be uplink, perform data encryption by adopting a public key, and verify the node. The message queue module may provide a template for interacting with the message queue, and is responsible for publishing the basic information and the data to be uplinked onto a distributed storage system (e.g., Kafka). The event monitoring module can realize the function of monitoring the Binlog log by the Mysql database, and monitor and generate tasks for the newly configured system.
With continuing reference to fig. 5B, fig. 5B is a block chain technology-based execution architecture diagram of an embodiment of a data uplink method according to the present disclosure. The execution architecture diagram shown in fig. 5B is merely an example, and should not be used in any way to limit embodiments of the present application.
As shown in fig. 5B, an executing entity executing the data chaining method based on the block chain technology of the present disclosure may obtain the data processing request from a node server of an asset service organization, a node server of a dealer service organization, a node server of a bank hosting system, a node server of a fund stock system, a node server of a bond system, or other node servers.
In the case that the acquired data processing request is for uplink of data to be uplink, the executing entity may determine whether the data processing request is endorsed through. And the endorsement node in the predetermined node set determines whether the data processing request passes the endorsement based on the endorsement strategy. In the case that the data processing request endorsement passes, the execution agent may add a request message indicating the data processing request to a request message queue in the predetermined distributed publish-subscribe message system Kafka.
The data to be linked corresponding to the node in the node set (i.e. the node server of the asset service organization, the node server of the dealer service organization, the node server of the bank hosting system, the node server of the fund stock system, the node server of the bond system, or other node servers) may be obtained through the following steps: and taking the encrypted data corresponding to the node as the data to be uplink linked corresponding to the node, and storing the data to be uplink linked in a predetermined relational database Mysql.
In some cases, the data to be uplink may be data obtained by performing data desensitization processing on original data.
The execution main body can monitor the Binlog log through the Mysql database, monitor the newly configured system and generate tasks, so that a task scheduling platform (schedule) can perform task scheduling.
The execution main body can also provide message service for the outside through Kafka, check the data to be uplink by adopting an intelligent contract through data consumption of a message queue, and write the data to the Hbase distributed storage database and the LevelDB block chain database after the data to be uplink is checked to pass. Here, the target browser may be provided with data query, file upload, file download, smart contract execution, and the like.
Therefore, the execution main body can sequentially uplink data to be uplink corresponding to the data processing request indicated by the request message according to the sequence of the request message in the request message queue, and provide the query service for the target browser.
Please refer to fig. 5C, which is a schematic structural diagram of a distributed storage system based on a block chain technology data uplink method according to the present disclosure.
In fig. 5C, the Hbase table is split horizontally into several regions according to the range of rowkey. Each region contains all the rows between the start key and the end key of this region. Regions are assigned to certain nodes in the cluster to manage, i.e., Region servers, which are responsible for processing read and write requests for data. Each Region Server can manage approximately 1000 regions.
HBase uses Zookeeper as distributed management service to maintain the state of all services in the cluster. Zookeeper maintains which servers are healthily available and notifies when a server fails. Zookeeper uses a consistency protocol to ensure consistency of the distributed state. The Region Servers and online HMaster and Zookeeper maintain sessions. Zookeeper maintains all temporary nodes through heartbeat detection.
The Meta table is a special HBase table that maintains a list of all regions in the system. Tablel resembles a B-tree. When the service of a certain node is down and the like, which cannot work normally, the normal operation of the service system and the block chain service system of other mechanisms cannot be influenced.
Finally, referring to fig. 5D, fig. 5D is an interactive schematic diagram of an embodiment of a block chain technology-based data uplink method according to the present disclosure.
In fig. 5D, the service system performs first purchase, cyclic purchase, repayment, refund, overdue, replacement of each asset according to an interface provided by the introduced BS SDK, sends data, configures intelligent contract verification of a special plan protocol number, standardizes and configures data to be uplinked to be persistent in the Mysql database, sends the data to a message queue and persists in the Hbase database through a timing task scheduler, performs consensus in a block chain, provides a relevant interface for service processing to provide query service for a browser, and each service party can view relevant data in real time and monitor the special plan relevant assets.
Now return to fig. 4.
It should be noted that, in addition to the above-mentioned contents, the present embodiment may further include the same or similar features and effects as those of the embodiment corresponding to fig. 2, and details are not repeated herein.
As can be seen from fig. 4, in the case that the data processing request is sent through the target browser via a node in the node set and is used to query the uplink data, the flow 400 of the data uplink method based on the block chain technique in this embodiment queries the data indicated by the data processing request from the Hbase database, so that the queried data is presented through the target browser, and thus the uplink data can be stored in the Hbase database, paging query on the uplink data is implemented, and the comprehensiveness of the queried uplink data is improved.
With further reference to fig. 6, as an implementation of the method shown in fig. 2, the present disclosure provides an embodiment of a data uplink apparatus based on a block chain technology, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the embodiment of the apparatus may further include the same or corresponding features as the embodiment of the method shown in fig. 2, in addition to the features described below, and produce the same or corresponding effects as the embodiment of the method shown in fig. 2. The device can be applied to various electronic equipment.
As shown in fig. 6, the block chain technology based data uplink apparatus 600 of the present embodiment includes: an acquiring unit 601, a first determining unit 602, an adding unit 603 and an uplink unit 604. Wherein the obtaining unit 601 is configured to obtain a data processing request; the first determining unit 602 is configured to determine whether the data processing request is endorsed through if the data processing request is used for uplink of data to be uplink, wherein an endorsement node in the predetermined set of nodes determines whether the data processing request is endorsed through based on an endorsement policy; the adding unit 603 is configured to add a request message indicating a data processing request to a request message queue in the predetermined distributed publish-subscribe message system if the data processing request endorses through a target number of nodes in the set of nodes; the uplink unit 604 is configured to sequentially uplink data to be uplink corresponding to the data processing requests indicated by the request messages in the order of the request messages in the request message queue.
In the present embodiment, the acquiring unit 601 of the data uplink apparatus 600 based on the block chain technique can acquire the data processing request.
The data processing request may be a request for processing data. For example, the data processing request may be used to uplink data to be uplink, query the uplink data, and upload or download files.
In this embodiment, in a case that the data processing request acquired by the acquiring unit 601 is used for uplink of data to be uplink, the first determining unit 602 may determine whether the data processing request passes an endorsement policy, where an endorsement node in a predetermined node set determines whether the data processing request passes the endorsement policy.
Wherein, the node (peer) in the node set refers to a communication entity of the block chain. A node belongs to a logical concept, and multiple nodes of different types can run on the same physical device (e.g., a server).
In this embodiment, in a case where the data processing request endorses through a target number of nodes in the node set, the adding unit 603 may add a request message indicating the data processing request to a request message queue in the predetermined distributed publish-subscribe message system.
The distributed publish-subscribe message system may be Kafka, or a distributed publish-subscribe message system developed by a technician according to actual needs. The request message may be the data processing request itself, or may be data requested to be processed by the data processing request, or may be an identifier of the data requested to be processed by the data processing request (for example, encrypted data of the data requested to be processed by the data processing request).
In this embodiment, the uplink unit 604 may sequentially uplink data to be uplink corresponding to the data processing request indicated by the request message according to the order of the request messages in the request message queue.
In the data uplink device based on the block chain technology according to the above embodiment of the present disclosure, the obtaining unit obtains the data processing request, and then, in a case that the data processing request is used for uplink of the data to be uplink, the first determining unit determines whether the data processing request is endorsed through, where an endorsement node in a predetermined node set determines whether the data processing request is endorsed through based on an endorsement policy, and then, in a case that the data processing request is endorsed through a target number of nodes in the node set, the adding unit adds the request message indicating the data processing request to a request message queue in a predetermined distributed publish-subscribe message system, and finally, the uplink unit sequentially uplink the data to be uplink corresponding to the data processing request indicated by the request message according to an order of the request messages in the request message queue, the uplink mode is enriched, because the distributed publish-subscribe message system can process tens of millions of messages (usually more than 1500 tens of thousands) per second, and the data aggregation rate is high (usually close to 1Tbps), and the distributed publish-subscribe message system simplifies the processing of data streams and has high throughput and expandability, the uplink speed of data is improved, and the occupation time of resources such as a CPU (Central processing Unit), bandwidth and the like in the uplink process of data is reduced.
In some optional implementations of this embodiment, the to-be-uplink data is used to indicate an exchange amount for exchanging the first item with the second item, where the exchange amount includes a decreased number of the first item and an increased number of the second item. And, the apparatus 600 may further include: a second determining unit configured to determine whether the decreased number of the first item and the increased number of the second item match at preset time intervals; a generating unit configured to generate information indicating that the exchange amount of the first item does not match the exchange amount of the second item if the decreased amount of the first item and the increased amount of the second item do not match.
In some optional implementations of this embodiment, the data to be uplink is generated by a node in the set of nodes. And obtaining the data to be uplink corresponding to the nodes in the node set by the following generation steps: and encrypting the data of the preset type generated by the node by adopting an encryption mode predetermined for the node to obtain encrypted data corresponding to the node, and taking the encrypted data corresponding to the node as the data to be uplink corresponding to the node.
In some optional implementations of this embodiment, the generating step further includes: the data to be uplink is stored in a predetermined relational database.
In some optional implementations of this embodiment, the apparatus 600 may further include: the storage unit (not shown) is configured to store the uplink data in a predetermined distributed storage system Hbase database.
In some optional implementations of this embodiment, the apparatus 600 further includes: the querying unit (not shown in the figure) is configured to query the data indicated by the data processing request from the Hbase database if the data processing request is sent through the target browser via a node in the node set and is used for querying the uplink data, and to present the queried data through the target browser.
In some optional implementations of this embodiment, the apparatus 600 further includes: the upload or download unit (not shown in the figure) is configured to upload or download a file by a target browser if a data processing request is sent by the target browser via a node in the node set and used to upload or download the file.
In some optional implementations of the present embodiment, the uplink unit 604 may include: the first uplink module (not shown in the figure) is configured to invoke the request messages from the request message queue in sequence according to the order of the request messages in the request message queue through the local area network, and uplink the to-be-uplink data corresponding to the data processing request indicated by each invoked request message.
In some optional implementations of the present embodiment, the uplink unit 604 may also include: the second uplink module (not shown in the figure) is configured to determine, for each request message in the request message queue according to an order of the request messages in the request message queue, whether to-be-uplink data corresponding to the data processing request indicated by the request message conforms to a target rule, and if so, uplink the to-be-uplink data corresponding to the data processing request indicated by the request message, wherein the target rule is determined by a node in the node set corresponding to the to-be-uplink data.
Referring now to FIG. 7, a block diagram of an electronic device (e.g., the server of FIG. 1) 700 suitable for use in implementing embodiments of the present disclosure is shown. The electronic device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 7, electronic device 700 may include a processing means (e.g., central processing unit, graphics processor, etc.) 701 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from storage 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the electronic apparatus 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Generally, the following devices may be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 708 including, for example, magnetic tape, hard disk, etc.; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. While fig. 7 illustrates an electronic device 700 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 7 may represent one device or may represent multiple devices as desired.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via the communication means 709, or may be installed from the storage means 708, or may be installed from the ROM 702. The computer program, when executed by the processing device 701, performs the above-described functions defined in the methods of embodiments of the present disclosure.
It should be noted that the computer readable medium described in the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In embodiments of the present disclosure, however, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring a data processing request; if the data processing request is used for uplink transmission of the data to be uplink transmitted, determining whether the data processing request passes an endorsement, wherein an endorsement node in a predetermined node set determines whether the data processing request passes the endorsement based on an endorsement policy; if the data processing request passes through the node endorsement, adding a request message indicating the data processing request to a request message queue in a predetermined distributed publishing and subscribing message system; and according to the sequence of the request messages in the request message queue, sequentially carrying out uplink transmission on the data to be uplink corresponding to the data processing request indicated by the request message.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an acquisition unit, a first determination unit, an addition unit, and a cochain unit. The names of these units do not in some cases constitute a limitation on the units themselves, and for example, the acquiring unit may also be described as a "unit that acquires a data processing request".
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is possible without departing from the inventive concept as defined above. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.