[go: up one dir, main page]

CN110910237B - Data processing method and device in blockchain, intelligent terminal and storage medium - Google Patents

Data processing method and device in blockchain, intelligent terminal and storage medium Download PDF

Info

Publication number
CN110910237B
CN110910237B CN201911142959.8A CN201911142959A CN110910237B CN 110910237 B CN110910237 B CN 110910237B CN 201911142959 A CN201911142959 A CN 201911142959A CN 110910237 B CN110910237 B CN 110910237B
Authority
CN
China
Prior art keywords
data
processing
service data
processing sequence
sequence number
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911142959.8A
Other languages
Chinese (zh)
Other versions
CN110910237A (en
Inventor
李茂材
朱耿良
杨常青
刘区城
蓝虎
刘攀
周开班
时一防
王宗友
张劲松
黄焕坤
孔利
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911142959.8A priority Critical patent/CN110910237B/en
Publication of CN110910237A publication Critical patent/CN110910237A/en
Application granted granted Critical
Publication of CN110910237B publication Critical patent/CN110910237B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/02Banking, e.g. interest calculation or account maintenance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a data processing method, a device and an intelligent terminal in a blockchain, wherein the method is suitable for processing business data stored in a blockchain transaction pool, and comprises the following steps: acquiring current service data to be processed in a transaction pool, and taking a processing sequence number of the service data to be processed as a target processing sequence number; inquiring the associated processing sequence number in a directed acyclic graph set for service data in a transaction pool according to the target processing sequence number, wherein the associated processing sequence number is a processing sequence number which has a dependency relationship with the target processing sequence number and is recorded on the directed acyclic graph; detecting the processing state of the service data corresponding to each queried associated processing sequence number; and if the detected processing state meets the execution triggering condition, processing the service data to be processed. By adopting the embodiment of the invention, the processing efficiency of the business data in the transaction pool and the accuracy of data processing can be effectively improved.

Description

Data processing method and device in blockchain, intelligent terminal and storage medium
Technical Field
The present invention relates to the field of computer application technologies, and in particular, to a method and an apparatus for processing service data in a blockchain, an intelligent terminal, and a storage medium.
Background
In some application scenarios based on blockchain, when there is a new transaction or service, whether the service data created by the node or the service data broadcast by other nodes is added into the transaction pool, and when the block is packed, the corresponding service data is taken out from the transaction pool. After the block is generated, the block is identified, the transaction is performed, and the uplink block chain performs the transaction through the on-chain nodes. How to accurately and quickly process the transaction data of the user becomes a research hot problem on the basis of the existing transaction pool.
Disclosure of Invention
The embodiment of the invention provides a method and a device for processing service data in a blockchain, an intelligent terminal and a storage medium, which can divide a plurality of data sets and a directed acyclic graph to process the data rapidly and accurately.
In one aspect, an embodiment of the present invention provides a method for processing service data in a blockchain, where the method is adapted to process service data stored in a blockchain transaction pool, where N data sets are stored in the transaction pool, each data set includes a plurality of service data, and a processing sequence number is set in the service data in each data set, and the method includes:
Acquiring current service data to be processed in a transaction pool, and taking a processing sequence number of the service data to be processed as a target processing sequence number;
Inquiring an associated processing sequence number in a directed acyclic graph set for service data in the transaction pool according to the target processing sequence number, wherein the associated processing sequence number is a processing sequence number recorded on the directed acyclic graph and having a dependency relationship with the target processing sequence number;
detecting the processing state of the service data corresponding to each queried associated processing sequence number;
and if the detected processing state meets the execution triggering condition, processing the service data to be processed.
In another aspect, an embodiment of the present invention provides a processing apparatus for processing service data in a blockchain, where the apparatus is adapted to process service data stored in a blockchain transaction pool, where N data sets are stored in the transaction pool, each data set includes a plurality of service data, and a processing sequence number is set in the service data in each data set, and the apparatus includes:
The acquisition module is used for acquiring the current service data to be processed in the transaction pool and taking the processing sequence number of the service data to be processed as a target processing sequence number;
The query module is used for querying the associated processing sequence number in the directed acyclic graph set for the business data in the transaction pool according to the target processing sequence number, wherein the associated processing sequence number is a processing sequence number recorded on the directed acyclic graph and having a dependency relationship with the target processing sequence number;
the detection module is used for detecting the processing state of the service data corresponding to each queried associated processing sequence number;
And the processing module is used for processing the service data to be processed if the detected processing state meets the execution triggering condition.
Correspondingly, the embodiment of the invention also provides an intelligent terminal which comprises a storage device and a processor, wherein the storage device stores program instructions, and the program instructions are used for realizing the processing method of the business data in the block chain when being executed.
Accordingly, an embodiment of the present invention further provides a computer readable storage medium, where program instructions are stored, where when the program instructions are executed by a processor, the above-mentioned method for processing service data in a blockchain is implemented.
In the embodiment of the invention, on one hand, the business data are divided into different data sets so as to be capable of being executed simultaneously on the business data in a plurality of data sets, and the processing speed of the data is ensured; on the other hand, the established directed acyclic graph indicates the processing sequence of the service data, so that the service data can be ensured to be executed orderly, and the processing efficiency of the service data in the transaction pool and the accuracy of data processing are effectively improved based on the two aspects.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a sequence of processing business data in a blockchain transaction pool in accordance with an embodiment of the invention;
FIG. 2 is a schematic diagram of a processing sequence of a set of business data in a blockchain transaction pool in accordance with an embodiment of the invention;
FIG. 3 is a flow chart of a method of processing traffic data in a blockchain in accordance with an embodiment of the present invention;
FIG. 4 is a schematic diagram of a directed acyclic graph according to an embodiment of the invention;
FIG. 5 is a flow chart of a method of generating a directed acyclic graph according to an embodiment of the invention;
FIG. 6 is a flow chart of a method for updating a directed acyclic graph according to an embodiment of the invention;
FIG. 7 is a schematic diagram of an updated directed acyclic graph according to an embodiment of the invention;
FIG. 8 is a schematic diagram of a user interface according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of a device for processing service data in a blockchain according to an embodiment of the present invention;
Fig. 10 is a schematic structural diagram of an intelligent terminal according to an embodiment of the present invention.
Detailed Description
In the embodiment of the invention, the business data generated by a certain target user account or the business data associated with the target user account can be stored in a transaction pool of the blockchain network to be treated. These business data may be, for example, banking transaction related data such as transfer voucher data, collection voucher data, deposit voucher data and the like. On the one hand, the service data can be processed by calling the service function configured for the service corresponding to the corresponding service data, and on the other hand, the service data can be commonly recognized in the blockchain network and uplink processing can be performed after the common recognition is passed. For example, for the transfer voucher data, a corresponding forwarding processing function is called to carry out forwarding processing, the transfer voucher data is forwarded to a corresponding transfer settlement server, meanwhile, block data is created based on the transfer voucher data, consensus is initiated, and after the consensus is passed, the block data is recorded in a block chain, so that the transfer voucher data is stored, and the purpose of repudiation is achieved.
In the process of extracting transaction data from the transaction pool for processing, processing serial numbers can be set for all transaction data (or service data related to a certain target user account) in the transaction pool according to a processing sequence, and processing is sequentially performed according to the processing serial numbers during processing, for example, in fig. 1, after processing service data with a processing serial number of "1", processing is performed for service data with a processing serial number of "2", after processing service data with a processing serial number of "2", processing is performed for service data with a processing serial number of "3", and so on. After waiting for the service data processing of the previous processing sequence number to be completed, the service data of the next processing sequence number is used as new service data to be processed, and the corresponding service function is called to carry out service processing and uplink processing.
In addition to the above-mentioned sequential numbering of all traffic data (or traffic data related to only a certain target user account), all traffic data (or traffic data related to a certain target user account) may be divided into multiple data sets, which may be obtained in a random manner in one embodiment, or traffic data that will have a dependency relationship may be divided into and among one data set. Referring to fig. 2, for service data to be divided into sets, the service data may be divided into 4 (the number is merely an example) data sets, namely, a data set a, a data set b, a data set c and a data set d, where each data set is sequentially numbered to obtain a processing sequence number of each service data. The following describes in detail a method for processing service data in a blockchain according to an embodiment of the present invention with reference to fig. 2 and 3.
Referring to fig. 3, a flowchart of a method for processing service data in a blockchain according to an embodiment of the present invention may be implemented by an intelligent terminal, for example, a personal computer, a server, or even a mobile terminal with powerful processing performance, where the intelligent terminal may be a node device in a blockchain network. The embodiment of the present invention is used for processing service data stored in the transaction pool of the blockchain, where N data sets are stored in the transaction pool, N is a positive integer not less than 2, for example, N is 4 in fig. 2, four data sets a, b, c, d are involved, each data set includes a plurality of service data, for example, four service data in fig. 2, and a processing sequence number is set in the service data in each data set, for example, in data set a, including: service data 1-1, service data 1-2, service data 1-3, service data 1-4, wherein 1-1, 1-2, 1-3, and 1-4 refer to processing sequence numbers. Specifically, the method of the embodiment of the invention comprises the following steps.
In S301, the intelligent terminal acquires current service data to be processed in the transaction pool, and takes a processing sequence number of the service data to be processed as a target processing sequence number. The traffic data to be processed may be one unprocessed data in the respective data sets at the current moment. In one embodiment, if the processing period arrives, when the intelligent terminal is triggered to start data processing, the service data of the first processing sequence number in each data set is respectively used as the service data to be processed currently, and the service data of the first processing sequence number in each data set can be simultaneously started to be processed, for example, service data 1-1, service data 2-1, service data 3-1 and service data 4-1 are simultaneously executed in fig. 2, and for each service data to be processed currently, the subsequent steps of the embodiment of the present invention are executed.
In one embodiment, in the process of processing service data by the intelligent terminal, after the service data of a certain processing sequence number is executed, for example, after the service data has been uplink (recorded to the service data) and/or after a corresponding service function has been invoked to process, service data corresponding to a next processing sequence number of the service data of the executed processing sequence number is currently to-be-processed service data. For example, in the four data sets shown in fig. 2, in the data set a, after the service data 1-1 is executed, the service data 1-2 is used as a current service data to be processed, and the related steps of the embodiment of the present invention are started to be executed; in the data set b, the service data 2-1 is being processed, and the service data to be processed currently does not exist in the data set b; in the data set c, after the execution of the service data 3-1 is completed, the service data 3-2 is used as a current service data to be processed, and the related steps of the embodiment of the present invention are started to be executed. During the processing of the service data 4-2 in the data set d, no service data currently to be processed exists.
After determining one or more service data to be processed and acquiring a corresponding target processing sequence number, in S302, an associated processing sequence number is queried in a directed acyclic graph set for the service data in the transaction pool according to the target processing sequence number, where the associated processing sequence number is a processing sequence number recorded on the directed acyclic graph and having a dependency relationship with the target processing sequence number. The directed acyclic graph refers to a loop-free directed graph having a plurality of nodes through which processing numbers of service data in N sets are recorded, as shown in fig. 4, which is a schematic diagram of a directed acyclic graph according to an embodiment of the invention, the directed acyclic graph being generated from service data in 4 sets of fig. 2.
In one embodiment, the directed acyclic graph is constructed from dependencies between business data, the dependencies comprising: the dependency relationship between the business data in each data set and/or the dependency relationship between the business data in different data sets. The dependency relationships mentioned in the embodiments of the present invention mainly refer to: of the two business data having a dependency relationship, one business data needs to be executed after the other business data is executed. The arrow in fig. 4 indicates that there is a dependency relationship between the service data corresponding to the processing sequence numbers recorded by the two nodes, and the service data corresponding to the processing sequence numbers at one end of the arrow needs to wait for the service data corresponding to the processing sequence numbers at the non-arrow end to be processed, for example, the service data corresponding to 1-2 needs to wait for the service data of 1-1 and the service data of 2-1 to be processed, and the processing completion may refer to that the service data is successfully recorded in the blockchain or the service function is successfully invoked.
In one embodiment, the dependencies between business data within each data set refer to: within the data set, the traffic data of the current processing sequence number depends on the traffic data of the previous processing sequence number, for example, in the data set a, the traffic data of the processing sequence number 1-2 has to wait for the traffic data of the processing sequence number 1-1 to be processed, the traffic data of the processing sequence number 1-3 depends on the traffic data of the processing sequence number 1-2, and so on, the traffic data of the processing sequence number 1-4 depends on the traffic data of the processing sequence number 1-3. In addition, in the dependency relationship in the data set, the number can be based on the storage time sequence of the service data when the processing sequence number is set, namely, the service data is stored first, processed first, then processed next service data is processed after the processing is completed, and the time of storing the next service data into the transaction pool is later than the service data which is processed completely, but earlier than other service data which are not processed yet. Or when the processing sequence number is set, the processing sequence number can be numbered based on the processing sequence number when the processing sequence number originally exists among the service data, for example, when A transfers to B, the service data transferred from A is executed first, and then the service data transferred to B is executed.
In one embodiment, there may also be a dependency between the traffic data in the different data sets. Although there is no sequence in the processing sequence numbers between the service data existing in different data sets, there is no dependency relationship based on the processing sequence numbers, but there is a possibility that one service data depends on the execution of another service data, for example, a transfer service needs to execute the transferred-out service data processing first, there is the transferred-in service data processing, and the corresponding transferred-in service data of electronic resources such as the fund amount may not be included in one data set due to the time interval when the transaction pool is added, and at this time, the dependency relationship needs to be established based on the originally existing processing sequence between the service data.
Whether the dependency between the business data within the respective data sets or the dependency between the business data in the different data sets, in a simple embodiment, may be configured through a user interface. The intelligent terminal can automatically divide the service data into a plurality of data sets, the data sets are presented to the management user through the user interface, the management user establishes the dependency relationship between the service data, and then the directed acyclic graph is generated based on the dependency relationship, so that the service data can be processed according to the dependency relationship indicated by the directed acyclic graph or the processing sequence. For example, in some small-scale banking sites, for generated transfer service data, every other period, for example, 1 hour, may be presented to a corresponding management user, the management user configures the relationship of the service data, a directed acyclic graph is established, specifically, for example, summary information of the service data may be directly displayed, and the user may move the corresponding service data based on the summary information, so that a sequence exists between the service data, so as to implement correct numbering of processing sequence numbers in the same set; arrow symbols are edited between traffic data to determine dependencies between traffic data in different data sets.
After the related processing serial numbers are queried through the directed acyclic graph, the processing state of the service data corresponding to each queried related processing serial number is detected in S303. The processing state mainly refers to whether the service data is processed, and one service data can comprise the processed state and the in-process state. The processed state may be, for example, that the service function was successfully recorded in the blockchain and/or successfully invoked, that the service function was not, of course, successfully recorded in the blockchain and/or invoked, and that the service data processing failed, or that the service data is considered to be in a processed state.
After determining the processing state of the service data corresponding to the associated processing sequence number, judging whether the processing state meets the execution triggering condition of the service data to be processed, and if the detected processing state meets the execution triggering condition in S304, processing the service data to be processed. The processing of the service data to be processed comprises the following steps: and carrying out uplink processing on the service data so as to record the data into a block chain, and/or calling a service function of the service data to be processed. The execution trigger condition being met may mean that the processing state indicates that the service data of the associated processing sequence number is processed, and the processing state in the processing indicates that the processing state does not meet the trigger execution condition, and the next service data is not processed. For example, in fig. 4, the service data corresponding to the processing sequence number 2-3 needs to wait for the service data corresponding to the processing sequence numbers 1-2 and 2-2 to be processed after the execution.
In one embodiment, please refer to fig. 5, which is a schematic flow chart of a method for generating a directed acyclic graph according to an embodiment of the present invention, the method according to the embodiment of the present invention may be performed by the above-mentioned intelligent terminal, and the method according to the embodiment of the present invention includes the following steps.
S501: dividing service data associated with a target user account in a transaction pool into N data sets; the data set may be divided randomly or according to the storage time of the transaction pool, or may be divided manually by a professional technical management user through a user interface. In one embodiment, the target user account may refer to a number of enterprise user accounts, where different services may be generated by the enterprise user accounts within a certain time range, for example, there may be funds transfer services, including transferring funds from an enterprise account to other enterprise accounts, salary transfer services of staff in the enterprise, receiving funds transferred from other units or individuals, and so on. For the business data corresponding to the businesses in a certain time, the business data can be added into a transaction pool to wait for centralized processing, and the business data waiting for centralized processing in the playing transaction pool can be divided into a plurality of data sets, so that the data sets can be distinguished to execute a plurality of business data at the same time, and longer waiting time does not exist.
S502: and setting processing sequence numbers for the service data included in each data set, and determining the dependency relationship between the service data in each data set according to the sequence of the processing sequence numbers of the service data in each data set. Also, the processing sequence numbers may be divided based on the time when the business data is added to the transaction pool, for example, the business of salary transfer to the staff of the enterprise is sequentially performed according to the time sequence, then the processing sequence numbers of the transferred business data are sequentially ordered according to the storage time of the business data, for example, in the set a, the salary transfer business data of the staff a is added earliest, the salary transfer business data of the staff B is added secondly, the processing sequence numbers of the salary transfer business data of the staff a are 1-1, the processing sequence numbers of the staff B are 1-2, and so on.
S502: and determining the dependency relationship between the business data in different data sets according to the processing sequence between the business data in different data sets. In the data sets are divided, because there may be a dependency relationship between service data in different sets, for example, salary transfer service data 3-4 of employee C needs to be executed after the approval confirmation of lead D, and the relevant service data generated by the approval confirmation of lead D, for example, the processing sequence number in set b is 2-3, there is a dependency relationship between 2-3 and 3-4, which needs to be represented in the directed acyclic graph, as shown in fig. 4. The dependency relationship may also be configured through a user interface.
S503: and setting a directed acyclic graph about the target user account in the transaction pool according to the determined dependency relationship. The directed acyclic graph is shown in FIG. 4, described above. In one embodiment, the processing sequence number set for the service data included in each data set is set according to the processing sequence between the service data, that is, may not be set by the storage time. The processing sequence between the business data in the same data set and the processing sequence between the business data in different data sets can be obtained through configuration of a configuration interface. The user who is responsible for technical realization or the user who is responsible for transfer, or the user of human resources can configure the dependency relationship between a plurality of transaction data which are already stored in the transaction pool through the configuration interface according to the need, and the business data which have no direct processing sequence with each other can determine the dependency relationship based on the storage time, so that the dependency relationship is determined for each business data, and the processing sequence of the data between different data sets is determined. For example, there is no sequence of processing between the two business data (for example, the two business data are salary related data of the two staff of the same class), but one business data is stored in the transaction pool before the other business data, the business data stored first are numbered 3-1, and the business data stored later are numbered 3-2. Meanwhile, for business data of salary data of a certain employee, the business data can be processed after the other approval data processing is finished, at this time, the salary data of the employee is numbered 3-4, the corresponding business data of the approval is numbered 2-3, and a user can manually establish a dependency relationship between 2-3 and 3-4 as shown in fig. 4.
In addition, in other embodiments, the processing sequence number set for the service data included in each data set is set according to the processing sequence between service data, and the processing sequence between service data in the same data set and the processing sequence between service data in different data sets are determined according to the service processing flow. That is, the dependency relationship between service data may be automatically determined based on the service processing flow, for example, a complete transfer flow includes a service phase of electronic resource transfer and a service phase of electronic resource transfer, for example, service data corresponding to the service phase of electronic resource transfer may be numbered 4-1, and service data corresponding to the service phase of electronic resource transfer may be numbered 4-2.
In order to achieve the purposes of setting a processing sequence number and determining the dependency relationship between service data in different data sets, a fixed data format can be set for the service data, for example, in the transfer service data of the enterprise account, a field of the type of the service data such as wage transfer, wage transfer and the like needs to exist, and an associated user field of a certain employee needs to exist, and the associated user field records the information such as the last-level leading work number, name and the like of the employee, so that a user convenient to configure can well configure the processing sequence number and configure the dependency relationship between the service data in different data sets, and the intelligent terminal can automatically generate a directed acyclic graph conveniently.
In one embodiment, a suitable period may be set according to the data amount of service data of a target user account (e.g., the above-mentioned enterprise account) in the transaction pool, for example, the service data may be set to be 1 day or even 1 month as a period when the service data is smaller, and when the service data is more, the service data related to the target user account, such as the transfer service data of the target user account, may be acquired from the transaction pool in the set period, where the process of creating the directed acyclic graph as shown in fig. 5 is performed first, and then the process of the service data shown in fig. 3 is performed.
In another embodiment, after a directed acyclic graph is established, if one or more new service data is added, the directed acyclic graph is updated based on the new service data, please refer to fig. 6, which is a schematic flow chart of a method for updating the directed acyclic graph according to an embodiment of the present invention, and the method according to the embodiment of the present invention may be executed by an intelligent terminal, and includes the following steps.
S601: and when receiving new service data sent by the target user account, selecting a target data set for the new service data from the N data sets. For any generated business data, the business data can be added into a certain data set, and then the subsequent steps are performed to update the directed acyclic graph. The selection method includes a plurality of modes, such as randomly selecting one data set as a target data set, or selecting the data set with the least number as the target data set according to the number of unprocessed service data in each data set.
S602: setting a processing sequence number for the new service data according to the processing sequence number of the service data in the target data set; the new service data is provided with a processing sequence number according to the sequence numbering principle, for example, if the new service data is added into the data set a, the sequence number of the new service data is 1-5.
S603: and updating the directed acyclic graph according to the processing sequence number set for the new service data, the data set where other service data with a dependency relationship with the new service data exists in the N data sets and the processing sequence number thereof. At least after the service data of the previous processing sequence number is processed, the new service data is processed, that is, the new service data at least depends on the service data of the previous processing sequence number in the same data set. Meanwhile, the new service data may also depend on a certain service data in other data sets, and the new service data is executed after the certain service data is processed, specifically, the dependency relationship between the new service data and other service data in other data sets can be determined through a manual labeling mode. After the processing serial number is obtained and each dependency relationship in the new service data set and each dependency relationship outside the new service data set are determined through a manual or automatic identification mode, the directed acyclic graph of the target user account is updated, for example, service data 1-5 are added into a data set a, and the new directed acyclic graph is shown in fig. 7.
In one embodiment, based on the directed acyclic graph shown in fig. 4 or the directed acyclic graph shown in fig. 7, the intelligent terminal may generate a user interface, that is, the above-mentioned flow of the method for processing service data in a blockchain may further include: displaying data processing information in the transaction pool on a user interface according to the directed acyclic graph; the data processing information comprises a data processing schematic diagram, the data processing schematic diagram comprises a plurality of nodes, processing serial numbers of transaction data in a transaction pool are recorded on each node, arrow symbols between the nodes represent the dependency relationship between the transaction data corresponding to the processing serial numbers of the two nodes, and the display color of the node where the processing serial number corresponding to the processed transaction data is located is different from the display color of the node where the processing serial number corresponding to the unprocessed transaction data is located. Or the directed acyclic graph is considered to be directly displayed on the user interface, wherein the difference is that the color of the display is different between the node corresponding to the processed service data and the node corresponding to the unprocessed service data, or further, the color of the node corresponding to the processed service data is different from the color of the unprocessed and processed service data.
In one embodiment, the above mentioned user interface further comprises an edit button; the method further comprises the steps of: editing the displayed data processing schematic diagram according to the user operation on the editing button; the editing process includes any one or more of a deletion process, a movement process, and a dependency change process for a plurality of nodes included in the data processing diagram. In one embodiment, if the node is deleted, the service data corresponding to the processing serial number recorded by the node is deleted from the transaction pool at the same time as the node is deleted, and the deleting process mainly aims at the unprocessed service data, for example, in the user interface of fig. 8, if the node 1-4 is deleted, the service data corresponding to the processing serial number 1-4 recorded by the node is deleted, the serial number of the service data corresponding to the subsequent node 1-5 is adjusted to 1-4, and at this time, the directed acyclic graph is updated again, and the display of the user interface is updated again. The mobile processing is mainly used for automatically changing the dependency relationship of service data or moving the service data corresponding to the processing serial number recorded by a certain node from one data set to another data set, and after the mobile processing, the processing serial number and the directed acyclic graph of the transaction data are updated based on the new data set. The dependency change process can re-modify the dependency between two or more business data, and similarly, after the dependency change process is initiated, both the directed acyclic graph and the user interface can be updated with new dependencies.
In the embodiment of the invention, on one hand, the business data are divided into different data sets so as to be capable of being executed simultaneously on the business data in a plurality of data sets, and the processing speed of the data is ensured; on the other hand, the established directed acyclic graph indicates the processing sequence of the service data, so that the service data can be ensured to be executed orderly, and the processing efficiency of the service data in the transaction pool and the accuracy of data processing are effectively improved based on the two aspects.
Referring to fig. 9 again, a schematic structural diagram of a processing device for processing service data in a blockchain according to an embodiment of the present invention is suitable for processing service data stored in a blockchain transaction pool, where N data sets are stored in the transaction pool, each data set includes a plurality of service data, and a processing serial number is set in the service data in each data set, and specifically, the device may be set in an intelligent terminal such as a personal computer, a notebook computer, a smart phone, and the device may include the following modules.
The acquiring module 901 is configured to acquire current service data to be processed in a transaction pool, and take a processing sequence number of the service data to be processed as a target processing sequence number;
a query module 902, configured to query, according to the target processing sequence number, an associated processing sequence number in a directed acyclic graph set for service data in the transaction pool, where the associated processing sequence number is a processing sequence number recorded on the directed acyclic graph and having a dependency relationship with the target processing sequence number;
The detection module 903 is configured to detect a processing state of service data corresponding to the queried associated processing sequence numbers;
And the processing module 904 is configured to process the service data to be processed if the detected processing state meets an execution triggering condition.
In one embodiment, the directed acyclic graph is constructed from dependencies between business data, the dependencies comprising: the dependency relationship between the business data in each data set and/or the dependency relationship between the business data in different data sets.
In one embodiment, the apparatus further comprises: a setting module 905, configured to divide service data associated with a target user account in a transaction pool into N data sets; setting processing sequence numbers for the service data included in each data set, and determining the dependency relationship between the service data in each data set according to the sequence of the processing sequence numbers of the service data in each data set; determining the dependency relationship between the business data in different data sets according to the processing sequence between the business data in different data sets; and setting a directed acyclic graph about the target user account in the transaction pool according to the determined dependency relationship.
In one embodiment, the processing sequence number set for the service data included in each data set is set according to the processing sequence between service data, and the processing sequence between service data in the same data set and the processing sequence between service data in different data sets are configured by the configuration interface.
In one embodiment, the processing sequence number set for the service data included in each data set is set according to the processing sequence between service data, and the processing sequence between service data in the same data set and the processing sequence between service data in different data sets are determined according to the service processing flow.
In one embodiment, the N data sets include service data associated with a target user account, and the apparatus includes: a setting module 905, configured to, when receiving new service data sent by a target user account, select a target data set for the new service data from the N data sets; setting a processing sequence number for the new service data according to the processing sequence number of the service data in the target data set; and updating the directed acyclic graph according to the processing sequence number set for the new service data, the data set where other service data with a dependency relationship with the new service data exists in the N data sets and the processing sequence number thereof.
In one embodiment, the processing module 904 is further configured to display data processing information in the transaction pool on a user interface according to the directed acyclic graph; the data processing information comprises a data processing schematic diagram, the data processing schematic diagram comprises a plurality of nodes, processing serial numbers of transaction data in a transaction pool are recorded on each node, arrow symbols between the nodes represent the dependency relationship between the transaction data corresponding to the processing serial numbers of the two nodes, and the display color of the node where the processing serial number corresponding to the processed transaction data is located is different from the display color of the node where the processing serial number corresponding to the unprocessed transaction data is located.
In one embodiment, the user interface further includes an edit button thereon; the processing module 904 is further configured to edit the displayed data processing schematic according to a user operation on the edit button; the editing process includes any one or more of a deletion process, a movement process, and a dependency change process for a plurality of nodes included in the data processing diagram.
In the embodiment of the present invention, the specific implementation of each module included in the foregoing apparatus may refer to the description of the related content in the foregoing embodiment, which is not repeated herein. On the one hand, the embodiment of the invention divides the business data into different data sets so as to be capable of executing the business data in the data sets simultaneously and ensure the processing speed of the data; on the other hand, the established directed acyclic graph indicates the processing sequence of the service data, so that the service data can be ensured to be executed orderly, and the processing efficiency of the service data in the transaction pool and the accuracy of data processing are effectively improved based on the two aspects.
Referring to fig. 10 again, a schematic structural diagram of an intelligent terminal according to an embodiment of the present invention may refer to an intelligent terminal such as a personal computer, a notebook computer, a server, or even a smart phone, where the intelligent terminal may include a storage device 1001, a processor 1002, and may further include a communication interface 1003 and a user interface 1004. The intelligent terminal, as a node device in a blockchain network, may implement the various methods mentioned in the above embodiments.
The communication interface 1003 may be a wired communication interface or a wireless communication interface, and the communication interface 1003 may communicate wirelessly through a WiFi device, or may also communicate by wire through a router and a network cable. The intelligent terminal sends data to and receives data from other node devices or other types of devices in the blockchain network through the communication interface 1003. The user interface 1004 may be, for example, a data receiving device such as a keyboard, a mouse, etc., or may be an interface provided on the intelligent terminal for interaction with a user, for example, a physical key, a touch display screen, etc.
The storage 1001 may include volatile memory (RAM), such as random-access memory (RAM); the storage device 1001 may also include a nonvolatile memory (non-volatile memory), such as a flash memory (flash memory), a solid state disk (solid-state disk-STATE DRIVE, SSD), etc.; the storage 1001 may also include a combination of the above types of memory.
The processor 1002 may be a central processing unit (central processing unit, CPU). The processor 1002 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (programmable logic device, PLD), or the like. The PLD may be a field-programmable gate array (FPGA) of field-programmable GATE ARRAY, general-purpose array logic (GENERIC ARRAY logic, GAL), or the like.
Optionally, the storage device 1001 is further configured to store program instructions. The processor 1002 may invoke the program instructions to implement the relevant methods mentioned in the above embodiments.
In one embodiment, the intelligent terminal is adapted to process service data stored in a blockchain transaction pool, where N data sets are stored in the transaction pool, each data set includes a plurality of service data, and a processing sequence number is set in the service data in each data set, and the processor 1002 invokes a program instruction stored in the storage device 1001, to obtain the service data to be processed currently in the transaction pool, and uses the processing sequence number of the service data to be processed as a target processing sequence number; inquiring an associated processing sequence number in a directed acyclic graph set for service data in the transaction pool according to the target processing sequence number, wherein the associated processing sequence number is a processing sequence number recorded on the directed acyclic graph and having a dependency relationship with the target processing sequence number; detecting the processing state of the service data corresponding to each queried associated processing sequence number; and if the detected processing state meets the execution triggering condition, processing the service data to be processed.
In one embodiment, the storage device 1001 may also store the transaction pool.
In one embodiment, the directed acyclic graph is constructed from dependencies between business data, the dependencies comprising: the dependency relationship between the business data in each data set and/or the dependency relationship between the business data in different data sets.
In one embodiment, the processor 1002 is further configured to divide the service data associated with the target user account in the transaction pool into N data sets; setting processing sequence numbers for the service data included in each data set, and determining the dependency relationship between the service data in each data set according to the sequence of the processing sequence numbers of the service data in each data set; determining the dependency relationship between the business data in different data sets according to the processing sequence between the business data in different data sets; and setting a directed acyclic graph about the target user account in the transaction pool according to the determined dependency relationship.
In one embodiment, the processing sequence number set for the service data included in each data set is set according to the processing sequence between service data, and the processing sequence between service data in the same data set and the processing sequence between service data in different data sets are configured by the configuration interface.
In one embodiment, the processing sequence number set for the service data included in each data set is set according to the processing sequence between service data, and the processing sequence between service data in the same data set and the processing sequence between service data in different data sets are determined according to the service processing flow.
In one embodiment, the N data sets include service data associated with a target user account, and the processor 1002 is further configured to, when receiving new service data sent by the target user account, select a target data set for the new service data from the N data sets; setting a processing sequence number for the new service data according to the processing sequence number of the service data in the target data set; and updating the directed acyclic graph according to the processing sequence number set for the new service data, the data set where other service data with a dependency relationship with the new service data exists in the N data sets and the processing sequence number thereof.
In one embodiment, the processor 1002 is further configured to display data processing information in the transaction pool on a user interface according to the directed acyclic graph; the data processing information comprises a data processing schematic diagram, the data processing schematic diagram comprises a plurality of nodes, processing serial numbers of transaction data in a transaction pool are recorded on each node, arrow symbols between the nodes represent the dependency relationship between the transaction data corresponding to the processing serial numbers of the two nodes, and the display color of the node where the processing serial number corresponding to the processed transaction data is located is different from the display color of the node where the processing serial number corresponding to the unprocessed transaction data is located.
In one embodiment the user interface further comprises an edit button; the processor 1002 is further configured to edit the displayed data processing schematic according to a user operation on the edit button; the editing process includes any one or more of a deletion process, a movement process, and a dependency change process for a plurality of nodes included in the data processing diagram.
In the embodiment of the present invention, the specific implementation of the processor 1002 may refer to the description of the related content in the foregoing embodiment, which is not repeated herein. On the one hand, the embodiment of the invention divides the business data into different data sets so as to be capable of executing the business data in the data sets simultaneously and ensure the processing speed of the data; on the other hand, the established directed acyclic graph indicates the processing sequence of the service data, so that the service data can be ensured to be executed orderly, and the processing efficiency of the service data in the transaction pool and the accuracy of data processing are effectively improved based on the two aspects.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random-access Memory (Random Access Memory, RAM), or the like.
The above disclosure is only a few examples of the present invention, and it is not intended to limit the scope of the present invention, but it is understood by those skilled in the art that all or a part of the above embodiments may be implemented and equivalents thereof may be modified according to the scope of the present invention.

Claims (9)

1. A method for processing service data in a blockchain, the method being suitable for processing service data stored in a blockchain transaction pool, wherein N data sets are stored in the transaction pool, each data set includes a plurality of service data, and a processing sequence number is set in the service data in each data set, and the divided N data sets are used for simultaneously executing the plurality of service data by differentiating the data sets, and the N data sets include service data associated with a target user account, the method comprising:
Acquiring current service data to be processed in a transaction pool, and taking a processing sequence number of the service data to be processed as a target processing sequence number; when triggering the intelligent terminal to start data processing, the business data of the first processing sequence number in each data set are respectively used as the business data to be processed currently so as to start processing the business data of the first processing sequence number in each data set;
Inquiring an associated processing sequence number in a directed acyclic graph set for service data in the transaction pool according to the target processing sequence number, wherein the associated processing sequence number is a processing sequence number recorded on the directed acyclic graph and having a dependency relationship with the target processing sequence number; the directed acyclic graph is constructed according to the dependency relationship between service data, and the dependency relationship comprises: the dependency relationship between the business data in each data set and/or the dependency relationship between the business data in different data sets;
Detecting the processing state of the service data corresponding to each queried associated processing sequence number;
If the detected processing state meets the execution triggering condition, processing the service data to be processed;
Selecting a target data set from the N data sets for the new service data when the new service data sent by the target user account is received;
setting a processing sequence number for the new service data according to the processing sequence number of the service data in the target data set;
And updating the directed acyclic graph according to the processing sequence number set for the new service data, the data set where other service data with a dependency relationship with the new service data exists in the N data sets and the processing sequence number thereof.
2. The method of claim 1, wherein prior to obtaining the currently pending business data in the transaction pool, further comprising:
Dividing service data associated with a target user account in a transaction pool into N data sets;
Setting processing sequence numbers for the service data included in each data set, and determining the dependency relationship between the service data in each data set according to the sequence of the processing sequence numbers of the service data in each data set;
determining the dependency relationship between the business data in different data sets according to the processing sequence between the business data in different data sets;
and setting a directed acyclic graph about the target user account in the transaction pool according to the determined dependency relationship.
3. The method of claim 2, wherein the processing sequence number set for the service data included in each data set is set according to a processing sequence between service data, and the processing sequence between service data in the same data set and the processing sequence between service data in different data sets are configured through a configuration interface.
4. The method of claim 2, wherein the processing sequence number set for the service data included in each data set is set according to a processing sequence between service data, and the processing sequence between service data in the same data set and the processing sequence between service data in different data sets are determined according to a service processing procedure.
5. The method of any one of claims 1-4, further comprising:
displaying data processing information in the transaction pool on a user interface according to the directed acyclic graph;
The data processing information comprises a data processing schematic diagram, the data processing schematic diagram comprises a plurality of nodes, processing serial numbers of transaction data in a transaction pool are recorded on each node, arrow symbols between the nodes represent the dependency relationship between the transaction data corresponding to the processing serial numbers of the two nodes, and the display color of the node where the processing serial number corresponding to the processed transaction data is located is different from the display color of the node where the processing serial number corresponding to the unprocessed transaction data is located.
6. The method of claim 5, further comprising an edit button on the user interface; the method further comprises the steps of:
editing the displayed data processing schematic diagram according to the user operation on the editing button; the editing process includes any one or more of a deletion process, a movement process, and a dependency change process for a plurality of nodes included in the data processing diagram.
7. A processing device for processing service data in a blockchain, wherein the device is adapted to process service data stored in a blockchain transaction pool, N data sets are stored in the transaction pool, each data set includes a plurality of service data, and a processing sequence number is set in the service data in each data set, and the divided N data sets are used for simultaneously executing a plurality of service data by differentiating the data sets, and the N data sets include service data associated with a target user account, the device includes:
The acquisition module is used for acquiring the current service data to be processed in the transaction pool and taking the processing sequence number of the service data to be processed as a target processing sequence number; when triggering the intelligent terminal to start data processing, the business data of the first processing sequence number in each data set are respectively used as the business data to be processed currently so as to start processing the business data of the first processing sequence number in each data set;
The query module is used for querying the associated processing sequence number in the directed acyclic graph set for the business data in the transaction pool according to the target processing sequence number, wherein the associated processing sequence number is a processing sequence number recorded on the directed acyclic graph and having a dependency relationship with the target processing sequence number; the directed acyclic graph is constructed according to the dependency relationship between service data, and the dependency relationship comprises: the dependency relationship between the business data in each data set and/or the dependency relationship between the business data in different data sets;
the detection module is used for detecting the processing state of the service data corresponding to each queried associated processing sequence number;
the processing module is used for processing the service data to be processed if the detected processing state meets the execution triggering condition;
The setting module is used for selecting a target data set for the new service data from the N data sets when receiving the new service data sent by the target user account; setting a processing sequence number for the new service data according to the processing sequence number of the service data in the target data set; and updating the directed acyclic graph according to the processing sequence number set for the new service data, the data set where other service data with a dependency relationship with the new service data exists in the N data sets and the processing sequence number thereof.
8. An intelligent terminal comprising a memory device and a processor, wherein the memory device stores program instructions that, when executed, are configured to implement the method of processing traffic data in a blockchain as in any of claims 1-6.
9. A computer readable storage medium having stored therein program instructions which, when executed by a processor, implement a method of processing traffic data in a blockchain as claimed in any of claims 1 to 6.
CN201911142959.8A 2019-11-20 2019-11-20 Data processing method and device in blockchain, intelligent terminal and storage medium Active CN110910237B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911142959.8A CN110910237B (en) 2019-11-20 2019-11-20 Data processing method and device in blockchain, intelligent terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911142959.8A CN110910237B (en) 2019-11-20 2019-11-20 Data processing method and device in blockchain, intelligent terminal and storage medium

Publications (2)

Publication Number Publication Date
CN110910237A CN110910237A (en) 2020-03-24
CN110910237B true CN110910237B (en) 2024-05-24

Family

ID=69818430

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911142959.8A Active CN110910237B (en) 2019-11-20 2019-11-20 Data processing method and device in blockchain, intelligent terminal and storage medium

Country Status (1)

Country Link
CN (1) CN110910237B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111680194B (en) * 2020-06-11 2025-06-20 深圳前海微众银行股份有限公司 Cryptocurrency transaction tracking method, device, equipment and readable storage medium
CN112150286A (en) * 2020-09-27 2020-12-29 深圳壹账通智能科技有限公司 Transaction processing method and device based on block chain, electronic equipment and storage medium
CN113256046A (en) * 2020-12-15 2021-08-13 深圳市怡化时代科技有限公司 Service processing method and device, computer equipment and storage medium
CN112598524B (en) * 2021-02-26 2021-06-22 北京全息智信科技有限公司 Processing method and device for conditional block chain transaction and electronic equipment
CN115865645A (en) * 2022-12-22 2023-03-28 中移动信息技术有限公司 Link determination method, device, equipment, medium and product

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3341864A1 (en) * 2015-08-28 2018-07-04 Swirlds, Inc. Methods and apparatus for a distributed database within a network
CN108537543A (en) * 2018-03-30 2018-09-14 百度在线网络技术(北京)有限公司 Method for parallel processing, device, equipment and the storage medium of block chain data
CN108595157A (en) * 2018-04-28 2018-09-28 百度在线网络技术(北京)有限公司 Processing method, device, equipment and the storage medium of block chain data
CN109377232A (en) * 2018-12-20 2019-02-22 众安信息技术服务有限公司 DAG-based blockchain transaction sequencing method and device
CN109544344A (en) * 2018-12-24 2019-03-29 众安信息技术服务有限公司 The transaction processing method and equipment of block chain based on DAG
WO2019144353A1 (en) * 2018-01-25 2019-08-01 深圳前海达闼云端智能科技有限公司 Blockchain-based data training method and device, storage medium and blockchain node
CN110431579A (en) * 2019-01-08 2019-11-08 张季恒 Transaction allocation method and apparatus based on structuring directed acyclic graph

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10255108B2 (en) * 2016-01-26 2019-04-09 International Business Machines Corporation Parallel execution of blockchain transactions

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3341864A1 (en) * 2015-08-28 2018-07-04 Swirlds, Inc. Methods and apparatus for a distributed database within a network
WO2019144353A1 (en) * 2018-01-25 2019-08-01 深圳前海达闼云端智能科技有限公司 Blockchain-based data training method and device, storage medium and blockchain node
CN108537543A (en) * 2018-03-30 2018-09-14 百度在线网络技术(北京)有限公司 Method for parallel processing, device, equipment and the storage medium of block chain data
CN108595157A (en) * 2018-04-28 2018-09-28 百度在线网络技术(北京)有限公司 Processing method, device, equipment and the storage medium of block chain data
CN109377232A (en) * 2018-12-20 2019-02-22 众安信息技术服务有限公司 DAG-based blockchain transaction sequencing method and device
CN109544344A (en) * 2018-12-24 2019-03-29 众安信息技术服务有限公司 The transaction processing method and equipment of block chain based on DAG
CN110431579A (en) * 2019-01-08 2019-11-08 张季恒 Transaction allocation method and apparatus based on structuring directed acyclic graph

Also Published As

Publication number Publication date
CN110910237A (en) 2020-03-24

Similar Documents

Publication Publication Date Title
CN110910237B (en) Data processing method and device in blockchain, intelligent terminal and storage medium
CN104657396B (en) Data migration method and device
CN104239315B (en) A kind of method of picture association
US9965880B2 (en) Picture processing method and apparatus
US20180173709A1 (en) Content-aware filter options for media object collections
US10496696B2 (en) Search method and apparatus
WO2019047508A1 (en) Method for processing e-book comment information, electronic device and storage medium
CN103327182A (en) Method for rapidly sending pictures and mobile terminal thereof
WO2016110203A1 (en) File path storing and local file accessing method and device
US9875137B2 (en) Intelligent application back stack management
WO2017008646A1 (en) Method of selecting a plurality targets on touch control terminal and equipment utilizing same
CN110795180B (en) Two-dimensional code management method, system, electronic equipment and storage medium
CN114238703A (en) Event flow arrangement method, device and application
CN111596993A (en) Interface processing method, terminal equipment and storage medium
CN109542917B (en) Data reading method and computer readable medium
CN113849285A (en) Delay task processing method and device, electronic equipment and storage medium
KR20130118580A (en) Method and apparatus for providing contents based on voice call
CN103176800A (en) Application program login method and device
WO2019042403A1 (en) Mobile terminal and mobile terminal-based image selection method, and storage medium
CN106648284A (en) Method, device and terminal for icon sequencing
CN106161516A (en) For storing the method for data, device and system
HK40021907A (en) Data processing method, device, intelligent terminal and storage medium in blockchain
US9311612B2 (en) System and method for improved service oriented architecture
CN110222926A (en) Progress queries method and device, storage medium, the computer equipment of outgoing call task
CN116048930A (en) Risk event information display method, device and computer-readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40021907

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TG01 Patent term adjustment
TG01 Patent term adjustment