WO2021008400A1 - Blockchain-based batch data processing method, apparatus, and storage medium - Google Patents

Blockchain-based batch data processing method, apparatus, and storage medium Download PDF

Info

Publication number
WO2021008400A1
WO2021008400A1 PCT/CN2020/100382 CN2020100382W WO2021008400A1 WO 2021008400 A1 WO2021008400 A1 WO 2021008400A1 CN 2020100382 W CN2020100382 W CN 2020100382W WO 2021008400 A1 WO2021008400 A1 WO 2021008400A1
Authority
WO
WIPO (PCT)
Prior art keywords
hotspot
unit
data
updated
data information
Prior art date
Application number
PCT/CN2020/100382
Other languages
French (fr)
Chinese (zh)
Inventor
曹晓橹
周佳敏
Original Assignee
深圳前海微众银行股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳前海微众银行股份有限公司 filed Critical 深圳前海微众银行股份有限公司
Publication of WO2021008400A1 publication Critical patent/WO2021008400A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/273Asynchronous replication or reconciliation
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • This application relates to the technical field of financial technology (Fintech), and in particular to blockchain-based data batch processing methods, devices, equipment, and computer-readable storage media.
  • the user can use his payment account to pay the amount of the product to the secured transaction intermediate account.
  • the secured transaction intermediate account will be involved.
  • the secured transaction intermediate account will become a hotspot.
  • Existing hotspot units keep accounts in a synchronous mode, that is, when performing transactions, they need to lock/unlock the hotspot account. This makes a large number of concurrent data processing requests need to be queued up and waited to be processed by the hotspot account, resulting in a large number of concurrent data processing requests being stringed Banking greatly reduces the efficiency of data processing.
  • the main purpose of this application is to propose a block chain-based data batch processing method, device, equipment, and computer-readable storage medium, aiming to solve the technical problem of low data processing efficiency in the existing serial processing method of hotspot units .
  • the data batch processing method includes the following steps:
  • each data recording request unit in the multiple blockchain nodes corresponding to the batch data record After receiving the batch data recording request, determine each data recording request unit in the multiple blockchain nodes corresponding to the batch data record, and determine the hot spot in each data recording request unit according to the preset hot spot configuration table unit;
  • the obtaining the change data information corresponding to the hotspot unit, and synchronize the change data information corresponding to the hotspot unit to the hotspot node to which the hotspot unit belongs, and generate the data to be changed corresponding to each hotspot node The specific steps of the list include:
  • the unsynchronized data in the list of data to be synchronized is fragmented, and the fragmented unsynchronized data is synchronized to the hotspot node to which the corresponding hotspot unit belongs, Generate a list of data to be changed corresponding to each hotspot node.
  • the steps of performing other non-numerical processing operations on each data record request unit based on the list of all changed data after the value is updated, and processing the data records in batches specifically include:
  • the hotspot unit corresponding to each change data information is updated respectively, and the hotspot configuration is updated according to the updated unit value corresponding to each hotspot unit The unit status corresponding to each hotspot unit described in the table.
  • the hotspot unit corresponding to each change data information is updated with a numerical value according to the respective change data information and the unit status of the corresponding hotspot unit, and the updated value corresponding to each hotspot unit is updated.
  • Unit value the step of updating the unit status corresponding to each hotspot unit in the hotspot configuration table specifically includes:
  • Judging whether the hotspot unit to be updated can update the value according to the value to be updated corresponding to the data information to be updated and the value status of the unit;
  • hotspot unit to be updated can perform a value update, lock the hotspot unit to be updated, modify the pending update state of the data information to be updated to the updated state, and perform a numerical value on the hotspot unit to be updated Update and update the unit value status corresponding to the hotspot unit to be updated in the hotspot configuration table.
  • the method further includes:
  • a corresponding transaction failure reminder message is generated according to the hot-spot unit to be updated.
  • each data recording request unit of the multiple blockchain nodes corresponding to the batch data record after receiving the batch data recording request, determine each data recording request unit of the multiple blockchain nodes corresponding to the batch data record, and according to a preset hotspot configuration table, After the step of determining the hotspot unit in each data recording request unit, it also includes:
  • each data recording request unit If the hotspot unit does not exist in each data recording request unit, the corresponding value of each data recording request unit is synchronously updated according to the preset general mode, and other non-numerical processing operations are performed on each data recording request unit To process the data records in batches.
  • the hotspot configuration table acquiring the hotspot unit status corresponding to the hotspot unit, and judging whether the hotspot unit can allow value updating according to the hotspot unit status;
  • hotspot unit allows value updating, execute: obtain the change data information corresponding to the hotspot unit, and synchronize the change data information corresponding to the hotspot unit to the hotspot node to which the hotspot unit belongs to generate each hotspot node Steps corresponding to the list of data to be changed;
  • the hot-spot unit is updated numerically, and other non-hot-spot units in the hot-spot node and other non-hot-spot units in the other non-hot-spot nodes are numerically updated Before the update steps, it also includes:
  • deduplication processing is performed on each change data information in the to-be-changed data list according to the repeated change data information identifier.
  • the present application also provides a block chain-based data batch processing device, which includes:
  • the hotspot unit determination module is used to determine each data record request unit of the multiple blockchain nodes corresponding to the batch data record after receiving the batch data record request, and set the data record request unit in each of the multiple blockchain nodes according to the preset hotspot configuration table. Determine the hotspot unit in the data record request unit;
  • the data list generating module is used to obtain the change data information corresponding to the hotspot unit, and synchronize the change data information corresponding to the hotspot unit to the hotspot node to which the hotspot unit belongs, and generate a list of data to be changed corresponding to each hotspot node ;
  • the unit value update module is used to update the value of the hotspot unit according to the list of data to be changed, and update the values of other non-hotspot units in the hotspot node and other non-hotspot units in other non-hotspot nodes ;
  • the value update processing module is used to perform other non-numerical processing operations on each data record request unit according to the list of all changed data after the value update to process the data records in batches.
  • the data list generating module specifically includes:
  • a synchronization list generating unit configured to obtain the changed data information corresponding to the hotspot unit, and generate a list of data to be synchronized
  • the synchronized data synchronization unit is configured to divide the unsynchronized data in the to-be-synchronized data list into fragments when there is unsynchronized data in the to-be-synchronized data list, and synchronize the fragmented unsynchronized data to the corresponding
  • the hotspot node to which the hotspot unit belongs generates a list of data to be changed corresponding to each hotspot node.
  • the value update processing module specifically includes:
  • the unit status obtaining subunit is used to obtain each change data information in the data list to be changed according to the data list to be changed, and obtain the hotspot unit corresponding to each change data information according to the hotspot configuration table The unit status;
  • the unit value update subunit is used to update the values of the hotspot units corresponding to the respective change data information according to the respective change data information and the unit status of the corresponding hotspot unit, and to update the values according to the updated data corresponding to each hotspot unit
  • the unit value updates the unit status corresponding to each hotspot unit in the hotspot configuration table.
  • the unit value update subunit is further used for:
  • Judging whether the hotspot unit to be updated can update the value according to the value to be updated corresponding to the data information to be updated and the value status of the unit;
  • hotspot unit to be updated can perform a value update, lock the hotspot unit to be updated, modify the pending update state of the data information to be updated to the updated state, and perform a numerical value on the hotspot unit to be updated Update and update the unit value status corresponding to the hotspot unit to be updated in the hotspot configuration table.
  • the block chain-based data batch processing device further includes a modified data deduplication module, and the modified data deduplication module is configured to:
  • deduplication processing is performed on each change data information in the to-be-changed data list according to the repeated change data information identifier.
  • this application also provides a block chain-based data batch processing device.
  • the block chain-based data batch processing device includes: a memory, a processor, and a storage A block chain-based data batch processing program running on the processor, and the block chain-based data batch processing program is executed by the processor to realize the above-mentioned blockchain-based data batch processing method step.
  • the present application also provides a computer-readable storage medium on which a blockchain-based data batch processing program is stored, and the blockchain-based data batch processing program is stored on the computer-readable storage medium.
  • the steps of the block chain-based data batch processing method as described above are realized.
  • this application determines each data record request unit in the multiple blockchain nodes corresponding to the batch data record, and according to the preset hotspot configuration table, in each data record request unit Determine the hotspot unit; obtain the change data information corresponding to the hotspot unit, and synchronize the change data information corresponding to the hotspot unit to the hotspot node to which the hotspot unit belongs, and generate a list of data to be changed corresponding to each hotspot node; State the list of data to be changed, update the values of the hotspot units, and update the values of other non-hotspot units in the hotspot node and other non-hotspot units in other non-hotspot nodes; according to all the changed data after the value update List, perform other non-numerical processing operations on each data record request unit to process the data records in batches.
  • this application processes data recording requests in batches, synchronizes the change data information corresponding to the hotspot unit to the data list to be changed of the hotspot node, synchronously records the changed data information of the hotspot unit, and then performs the hotspot unit according to the list of data to be changed Asynchronous update of changed data values and other non-numerical processing operations.
  • the data processing efficiency of the hotspot unit is improved, the success rate of data modification of the multi-node unit is improved, and the technical problem of low data processing efficiency in the existing serial processing method of the hotspot unit is solved.
  • FIG. 1 is a schematic diagram of a device structure of a hardware operating environment involved in a solution of an embodiment of the present application
  • FIG. 2 is a schematic flowchart of a first embodiment of a data batch processing method based on blockchain in this application.
  • FIG. 1 is a schematic diagram of the device structure of the hardware operating environment involved in the solution of the embodiment of the present application.
  • the block chain-based data batch processing device in the embodiment of the present application may be a PC or a server device, on which a Java virtual machine runs.
  • the block chain-based data batch processing device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002.
  • the communication bus 1002 is used to implement connection and communication between these components.
  • the user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface.
  • the network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
  • the memory 1005 can be a high-speed RAM memory or a stable memory (non-volatile memory), such as disk storage.
  • the memory 1005 may also be a storage device independent of the foregoing processor 1001.
  • FIG. 1 does not constitute a limitation on the device, and may include more or fewer components than those shown in the figure, or a combination of certain components, or different component arrangements.
  • the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a data batch processing program based on the blockchain.
  • the network interface 1004 is mainly used to connect to a back-end server and perform data communication with the back-end server;
  • the user interface 1003 is mainly used to connect to a client (user side) and perform data communication with the client;
  • the processor 1001 can be used to call a blockchain-based data batch processing program stored in the memory 1005, and execute the following operations in the blockchain-based data batch processing method.
  • Fig. 2 is a schematic flow chart of the first embodiment of a blockchain-based data batch processing method according to this application.
  • the blockchain-based data batch processing method includes:
  • Step S10 after receiving the batch data recording request, determine each data recording request unit in the multiple blockchain nodes corresponding to the batch data record, and according to the preset hotspot configuration table, in each data recording request unit Determine the hotspot unit;
  • the data recording request is a billing request
  • the data recording request unit is a billing request account
  • the hotspot unit is a hotspot account.
  • the account becomes a hot account.
  • the user can use his payment account to pay the amount of the product to the secured transaction intermediate account.
  • the secured transaction intermediate account will be involved.
  • the secured transaction intermediate account will become a hot account.
  • Hotspot accounts are accounted in a synchronous mode, that is, when transactions are executed, hotspot accounts need to be locked/unlocked, which makes a large number of concurrent transaction requests need to be queued and waited to be processed by hotspot accounts, resulting in a large number of concurrent transaction requests being serialized , Which greatly reduces the efficiency of data processing.
  • batch processing of billing requests is performed, the transaction flow corresponding to the hot account is synchronized to the pending flow list of the hot node, the transaction flow of the hot account is synchronously recorded, and then the hot account is performed according to the pending flow list Asynchronous update of balance and other non-balance processing operations.
  • the hotspot configuration table is preset, including the node routing information to which the hotspot account belongs, the allowed processing type of the hotspot account (debit hotspot, credit hotspot), current control status (judicial, bank control), account balance corresponding to the alert status, and alert Recover account balance threshold, pause status indicator, pause recovery account balance threshold, etc., and synchronize the hotspot configuration table to each node.
  • the allowed processing type of the hotspot account debit hotspot, credit hotspot
  • current control status judicial, bank control
  • account balance corresponding to the alert status and alert Recover account balance threshold, pause status indicator, pause recovery account balance threshold, etc.
  • the bookkeeping transaction request will be sent to the hotspot node, that is, the node to which the hot account belongs; if the two parties involved in the bookkeeping involve multiple nodes, the transaction request will be sent to the non-hotspot node to reduce synchronization Operation, avoid cross-node calls. If both parties to the account involve multiple nodes and both are hot nodes, the transaction is sent to any hot node.
  • the hotspot configuration table is checked to confirm whether there is a hotspot account in each billing request account. And register the transaction elements in the bookkeeping transaction of the hot account, such as the bookkeeping type, borrowing or transferring amount, etc.
  • step S10 it further includes:
  • each data recording request unit If the hotspot unit does not exist in each data recording request unit, the corresponding value of each data recording request unit is synchronously updated according to the preset general mode, and other non-numerical processing operations are performed on each data recording request unit To process the data records in batches.
  • the value is the balance
  • the other non-numerical processing operations are other non-balance processing operations. If there is no hot account in each billing request account, the general mode is processed according to the synchronous real-time balance update, that is, the account balance corresponding to each billing request account and other non-balance processing operations are updated in real time according to the billing request.
  • Step S20 Obtain the changed data information corresponding to the hotspot unit, and synchronize the changed data information corresponding to the hotspot unit to the hotspot node to which the hotspot unit belongs, and generate a list of data to be changed corresponding to each hotspot node;
  • the changed data information is a transaction flow
  • the list of data to be changed is a flow list to be processed. Get the transaction flow corresponding to each hotspot account, synchronize the transaction flow corresponding to each hotspot account in each hotspot node to their respective hotspot node, and add the transaction flow corresponding to all hotspot accounts under each hotspot node to each hotspot
  • step S20 it further includes:
  • the hotspot configuration table acquiring the hotspot unit status corresponding to the hotspot unit, and judging whether the hotspot unit can allow value updating according to the hotspot unit status;
  • step S20 If the hotspot unit allows value updating, perform: step S20;
  • the hotspot unit status is the hotspot account status
  • the value update is the balance update, that is, it is judged whether the hotspot account can conduct transactions.
  • the billing request includes multiple types of billing services.
  • the hotspot accounts are respectively set to: allow debit hotspots, allow credit hotspots, or both lending hotspots.
  • the hotspot configuration table also includes control information such as whether each hotspot account is judicially frozen.
  • the hotspot account status corresponding to the hotspot account is determined according to the hotspot configuration table, such as whether this type of hotspot is allowed, or whether the account of the hotspot account is in a controlled state, etc., to determine whether each hotspot account is allowed to conduct transactions, if If allowed, step S20 is executed to obtain the to-be-processed pipeline corresponding to each hotspot account. If not allowed, a reminder message of transaction failure is generated.
  • Step S30 according to the list of data to be changed, update the value of the hot spot unit, and update the value of other non-hot spot units in the hot spot node and other non-hot spot units in other non-hot spot nodes;
  • the data list to be changed is the pipeline list to be processed, and the other non-hot-spot units are other non-hot-spot accounts.
  • the transaction summary of the hotspot account is performed and the account balance of the hotspot account is updated.
  • the billing status of each hotspot account in the hotspot configuration table is further updated according to the updated account balance of each hotspot account.
  • synchronize the updated hotspot configuration table to all other nodes. As a result, the time difference between the hot account balance update and the corresponding status update is further reduced, so that the balance update and synchronization status change are more timely.
  • Step S40 Perform other non-numerical processing operations on each data record request unit according to the list of all changed data after the value is updated to process the data records in batches.
  • the all changed data list is a complete flow list
  • each data record request unit is each billing request account
  • the batch processing of the data records is the batch completion of the billing request.
  • other non-balance processing operations include inserting, deleting, and modifying multiple records, such as transaction details and accounting parts.
  • the corresponding transaction details and accounting calculations must also be registered, which takes a long time, so the balance is updated Operation and non-balance processing operations are separated to reduce the time difference of balance update, make balance update faster, and state synchronization more accurate.
  • each data recording request unit in the multiple blockchain nodes corresponding to the batch data recording is determined, and according to the preset hotspot configuration table, the data recording request unit Determine the hotspot unit; obtain the change data information corresponding to the hotspot unit, and synchronize the change data information corresponding to the hotspot unit to the hotspot node to which the hotspot unit belongs, and generate a list of data to be changed corresponding to each hotspot node; For the list of data to be changed, update the values of the hotspot units, and update the values of other non-hotspot units in the hotspot node and other non-hotspot units in other non-hotspot nodes; according to all the changes after the value update In the data list, other non-numerical processing operations are performed on each data record request unit to process the data records in batches.
  • this application processes data recording requests in batches, synchronizes the change data information corresponding to the hotspot unit to the data list to be changed of the hotspot node, synchronously records the changed data information of the hotspot unit, and then performs the hotspot unit according to the list of data to be changed Asynchronous update of changed data values and other non-numerical processing operations.
  • the data processing efficiency of the hotspot unit is improved, the success rate of data modification of the multi-node unit is improved, and the technical problem of low data processing efficiency in the existing serial processing method of the hotspot unit is solved.
  • step S20 specifically includes:
  • the unsynchronized data in the list of data to be synchronized is fragmented, and the fragmented unsynchronized data is synchronized to the hotspot node to which the corresponding hotspot unit belongs, Generate a list of data to be changed corresponding to each hotspot node.
  • the list of data to be synchronized is a pipeline to be synchronized
  • the unsynchronized data is an unsynchronized pipeline
  • the list of data to be changed is a pipeline to be processed.
  • the pending pipeline corresponding to each hot account is recorded, and a list of pipelines to be synchronized is generated, including transaction pipelines corresponding to all hot accounts to be synchronized to their own nodes, wherein each pipeline to be synchronized in the pipeline list to be synchronized
  • the initial state is unsynchronized.
  • the hotspot node then localizes the received transaction flow and stores it in the to-be-processed flow table, where the billing node directly calls the service through the message bus to perform flow synchronization and failed synchronization retry.
  • step S30 specifically includes:
  • the hotspot unit corresponding to each change data information is updated respectively, and the hotspot configuration is updated according to the updated unit value corresponding to each hotspot unit The unit status corresponding to each hotspot unit described in the table.
  • each change data information is each transaction flow
  • the unit status of the hotspot unit is the account status of the hotspot account
  • the unit value is the account balance.
  • the hotspot configuration table is used as the basis for checking the accounting type permission and accounting status in the accounting synchronization process. There are three situations that will cause the hotspot account status to change and need to be synchronized:
  • the status change caused by the account balance update that is, after each hotspot account performs the balance update operation, the account status of each hotspot account needs to be updated, such as the account balance value of each hotspot account is lower than the warning threshold, modify the configuration In the early warning state of the table status, the account balance is lower than the deactivation threshold, modify the deactivated state in the configuration table status.
  • the balance is higher than the early warning recovery threshold, and the normal state in the state of the configuration table is modified.
  • the hotspot units corresponding to the respective change data information are respectively updated with values, and according to the updated unit values corresponding to each hotspot unit,
  • the step of updating the unit status corresponding to each hotspot unit in the hotspot configuration table specifically includes:
  • Judging whether the hotspot unit to be updated can update the value according to the value to be updated corresponding to the data information to be updated and the value status of the unit;
  • hotspot unit to be updated can perform a value update, lock the hotspot unit to be updated, modify the pending update state of the data information to be updated to the updated state, and perform a numerical value on the hotspot unit to be updated Update and update the unit value status corresponding to the hotspot unit to be updated in the hotspot configuration table.
  • a corresponding transaction failure reminder message is generated according to the hot-spot unit to be updated.
  • the hotspot account before updating the balance of the hotspot account according to the transaction flow corresponding to each hotspot account, it is necessary to determine whether the hotspot account can perform a transaction operation for the amount corresponding to the transaction flow. Specifically, the transaction flow details in the synchronously recorded transaction flow are sequentially obtained, that is, each transaction flow is sequentially used as the flow to be updated, and the hot accounts corresponding to the transaction flow details are correspondingly processed. The hot account corresponding to the transaction flow details is used as the hot account to be updated corresponding to the brother's to be updated flow.
  • the amount to be updated corresponding to the flow to be updated that is, the transaction amount
  • the account balance status of the hot account to be updated such as a suspended status, a balance warning status, or a normal status (balance sufficient status). It is judged whether the balance of the hot account to be updated can be updated, that is, it is judged whether the amount to be updated is less than the account balance of the hot account to be updated.
  • the balance update operation can be performed, the hotspot account to be updated is locked, and the pending update status of the flow to be updated is changed to already Update the status, update the balance of the hotspot account to be updated, and update the account balance status corresponding to the hotspot account to be updated in the hotspot configuration table. If the amount to be updated is greater than the account balance of the hotspot account to be updated, the balance update operation cannot be performed, and a transaction failure reminder message corresponding to the hotspot account is generated.
  • the method before the step S30, the method further includes:
  • deduplication processing is performed on each change data information in the to-be-changed data list according to the repeated change data information identifier.
  • each change data information identifier is each transaction flow identifier
  • the repeated change data information identifier is a repeated flow identifier
  • each change data information is each transaction flow identifier.
  • each asynchronous task is deduplicated and failed retry processing.
  • asynchronous tasks include balance updates, other non-balance processing operations, etc.
  • each transaction flow identifier in the pending flow list where each transaction The flow corresponds to a unique transaction flow identifier, such as a trading flow number or a trading flow name. It is judged whether there is a repeated flow mark in each transaction flow mark, that is, it is judged whether there are two or more identical transaction flow marks in each transaction flow mark. If there is a repeated flow mark in each transaction flow mark, the repeated flow mark corresponding to the repeated flow mark is de-duplicated, so that each trading flow in the pending flow list is a unique trading flow. In a specific embodiment, when it is detected that the balance update task corresponding to each transaction flow in the pending flow list has failed, the balance update task corresponding to the transaction flow is restarted and executed according to a preset time interval.
  • the present application also provides a block chain-based data batch processing device, which includes:
  • the hotspot unit determination module is used to determine each data record request unit of the multiple blockchain nodes corresponding to the batch data record after receiving the batch data record request, and according to the preset hotspot configuration table, set Determine the hotspot unit in the data record request unit;
  • the data list generating module is used to obtain the change data information corresponding to the hotspot unit, and synchronize the change data information corresponding to the hotspot unit to the hotspot node to which the hotspot unit belongs, and generate a list of data to be changed corresponding to each hotspot node ;
  • the unit value update module is used to update the value of the hotspot unit according to the list of data to be changed, and update the values of other non-hotspot units in the hotspot node and other non-hotspot units in other non-hotspot nodes ;
  • the value update processing module is used to perform other non-numerical processing operations on each data record request unit according to the list of all changed data after the value update to process the data records in batches.
  • the data list generating module specifically includes:
  • a synchronization list generating unit configured to obtain the changed data information corresponding to the hotspot unit, and generate a list of data to be synchronized
  • the synchronized data synchronization unit is configured to divide the unsynchronized data in the to-be-synchronized data list into fragments when there is unsynchronized data in the to-be-synchronized data list, and synchronize the fragmented unsynchronized data to the corresponding
  • the hotspot node to which the hotspot unit belongs generates a list of data to be changed corresponding to each hotspot node.
  • the numerical value update processing module specifically includes:
  • the unit status obtaining subunit is used to obtain each change data information in the data list to be changed according to the data list to be changed, and obtain the hotspot unit corresponding to each change data information according to the hotspot configuration table The unit status;
  • the unit value update subunit is used to update the values of the hotspot units corresponding to the respective change data information according to the respective change data information and the unit status of the corresponding hotspot unit, and to update the values according to the updated data corresponding to each hotspot unit
  • the unit value updates the unit status corresponding to each hotspot unit in the hotspot configuration table.
  • unit value update subunit is also used for:
  • Judging whether the hotspot unit to be updated can update the value according to the value to be updated corresponding to the data information to be updated and the value status of the unit;
  • hotspot unit to be updated can perform a value update, lock the hotspot unit to be updated, modify the pending update state of the data information to be updated to the updated state, and perform a numerical value on the hotspot unit to be updated Update and update the unit value status corresponding to the hotspot unit to be updated in the hotspot configuration table.
  • the block chain-based data batch processing device further includes a modified data deduplication module, and the modified data deduplication module is used for:
  • deduplication processing is performed on each change data information in the to-be-changed data list according to the repeated change data information identifier.
  • the block chain-based data batch processing device further includes a hotspot unit identification module, and the hotspot unit identification module is used for:
  • each data recording request unit If the hotspot unit does not exist in each data recording request unit, the corresponding value of each data recording request unit is synchronously updated according to the preset general mode, and other non-numerical processing operations are performed on each data recording request unit To process the data records in batches.
  • the block chain-based data batch processing device further includes a unit value judgment module, and the unit value judgment module is configured to:
  • the hotspot configuration table acquiring the hotspot unit status corresponding to the hotspot unit, and judging whether the hotspot unit can allow value updating according to the hotspot unit status;
  • hotspot unit allows value updating, execute: obtain the change data information corresponding to the hotspot unit, and synchronize the change data information corresponding to the hotspot unit to the hotspot node to which the hotspot unit belongs to generate each hotspot node Steps corresponding to the list of data to be changed;
  • the application also provides a computer-readable storage medium.
  • the computer-readable storage medium of this application stores a block chain-based data batch processing program, and the block chain-based data batch processing program is executed by a processor to realize the block chain-based data batch processing method as described above A step of.
  • the method implemented when the block chain-based data batch processing program running on the processor is executed can refer to the various embodiments of the block chain-based data batch processing method of this application, which will not be repeated here.

Landscapes

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

Abstract

A blockchain-based batch data processing method, apparatus and device, and a storage medium. The method comprises: after a batch data recording request is received, determining each data recording request unit in multiple blockchain nodes corresponding to batch data recording, and determining a hotspot unit in each data recording request unit according to a pre-configured hotspot configuration table (S10); acquiring changed-data information corresponding to the hotspot unit, synchronizing the changed-data information corresponding to the hotspot unit, to a hotspot node to which the hotspot unit belongs, and generating a list of data to be changed corresponding to each hotspot node (S20); updating the value of the hotspot unit according to the list of data to be changed, and updating the values of non-hotspot units in the hot-spot node and the values of non-hotspot units in non-hotspot nodes (S30); and performing other non-numerical processing operations on each data recording request unit according to all of the lists of changed data having been subjected to value updating, so as to process data records in batches (S40).

Description

基于区块链的数据批量处理方法、装置、设备及存储介质Block chain-based data batch processing method, device, equipment and storage medium
本申请要求于2019年7月12日申请的、申请号为201910633067.1、名称为“基于区块链的数据批量处理方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on July 12, 2019, the application number is 201910633067.1, and the title is "Blockchain-based data batch processing methods, devices, equipment and storage media". The reference is incorporated in this application.
技术领域Technical field
本申请涉及金融科技(Fintech)技术领域,尤其涉及基于区块链的数据批量处理方法、装置、设备及计算机可读存储介质。This application relates to the technical field of financial technology (Fintech), and in particular to blockchain-based data batch processing methods, devices, equipment, and computer-readable storage media.
背景技术Background technique
随着计算机技术的发展,越来越多的技术(大数据、分布式、区块链Blockchain、人工智能等)应用在金融领域,传统金融业正在逐步向金融科技(Fintech)转变,但由于金融行业的安全性、实时性要求,也对技术提出了更高的要求。在某些特定的业务场景下,需要对单一的账户进行并发记账处理。在这种情况下,该账户就成为一个热点单元。With the development of computer technology, more and more technologies (big data, distributed, blockchain, artificial intelligence, etc.) are applied in the financial field. The traditional financial industry is gradually transforming to Fintech. However, due to financial The industry's security and real-time requirements also place higher requirements on technology. In some specific business scenarios, a single account needs to be processed concurrently. In this case, the account becomes a hotspot unit.
例如,当用户对某一商品进行在线支付时,用户可以利用自己的支付账户向担保交易中间账户支付该商品的金额,每个用户在进行在线支付时,都会涉及到担保交易中间账户,当短时间内大量的用户进行在线支付时,担保交易中间账户就会成为热点单元。现有热点单元通过同步模式记账,即执行交易时都需要锁定/解锁热点账户,由此使得大量的并发数据处理请求需要排队依次等待被热点账户处理,从而导致大量的并发数据处理请求被串行化,极大地降低了数据处理效率。For example, when a user makes an online payment for a product, the user can use his payment account to pay the amount of the product to the secured transaction intermediate account. When each user makes an online payment, the secured transaction intermediate account will be involved. When a large number of users make online payments within a period of time, the secured transaction intermediate account will become a hotspot. Existing hotspot units keep accounts in a synchronous mode, that is, when performing transactions, they need to lock/unlock the hotspot account. This makes a large number of concurrent data processing requests need to be queued up and waited to be processed by the hotspot account, resulting in a large number of concurrent data processing requests being stringed Banking greatly reduces the efficiency of data processing.
技术解决方案Technical solutions
本申请的主要目的在于提出一种基于区块链的数据批量处理方法、装置、设备及计算机可读存储介质,旨在解决现有热点单元的串行处理方法存在的数据处理效率低的技术问题。The main purpose of this application is to propose a block chain-based data batch processing method, device, equipment, and computer-readable storage medium, aiming to solve the technical problem of low data processing efficiency in the existing serial processing method of hotspot units .
为实现上述目的,本申请提供一种基于区块链的数据批量处理方法,所述数据批量处理方法包括如下步骤:In order to achieve the above objective, this application provides a block chain-based data batch processing method. The data batch processing method includes the following steps:
在接收到批量数据记录请求后,确定所述批量数据记录对应的多个区块链节点中的各个数据记录请求单元,并根据预设热点配置表,在所述各个数据记录请求单元中确定热点单元;After receiving the batch data recording request, determine each data recording request unit in the multiple blockchain nodes corresponding to the batch data record, and determine the hot spot in each data recording request unit according to the preset hot spot configuration table unit;
获取所述热点单元对应的变更数据信息,并将所述热点单元对应的变更数据信息同步至所述热点单元所属的热点节点,生成各个热点节点对应的待变更数据列表;Acquiring the change data information corresponding to the hotspot unit, and synchronize the change data information corresponding to the hotspot unit to the hotspot node to which the hotspot unit belongs, and generate a list of data to be changed corresponding to each hotspot node;
根据所述待变更数据列表,对所述热点单元进行数值更新,并对所述热点节点中的其他非热点单元以及其他非热点节点中的其他非热点单元进行数值更新;According to the list of data to be changed, update the values of the hotspot units, and update the values of other non-hotspot units in the hotspot node and other non-hotspot units in the other non-hotspot nodes;
根据数值更新后的全部变更数据列表,对各个数据记录请求单元进行其他非数值处理操作,以批量处理所述数据记录。Perform other non-numerical processing operations on each data record request unit according to the list of all changed data after the value is updated to process the data records in batches.
在一实施例中,所述获取所述热点单元对应的变更数据信息,并将所述热点单元对应的变更数据信息同步至所述热点单元所属的热点节点,生成各个热点节点对应的待变更数据列表的步骤具体包括:In an embodiment, the obtaining the change data information corresponding to the hotspot unit, and synchronize the change data information corresponding to the hotspot unit to the hotspot node to which the hotspot unit belongs, and generate the data to be changed corresponding to each hotspot node The specific steps of the list include:
获取所述热点单元对应的变更数据信息,生成待同步数据列表;Acquiring the changed data information corresponding to the hotspot unit, and generating a list of data to be synchronized;
在所述待同步数据列表中存在未同步数据时,将所述待同步数据列表中的未同步数据进行分片,并将分片后的未同步数据同步至对应的热点单元所属的热点节点,生成各个热点节点对应的待变更数据列表。When there is unsynchronized data in the list of data to be synchronized, the unsynchronized data in the list of data to be synchronized is fragmented, and the fragmented unsynchronized data is synchronized to the hotspot node to which the corresponding hotspot unit belongs, Generate a list of data to be changed corresponding to each hotspot node.
在一实施例中,所述根据数值更新后的全部变更数据列表,对各个数据记录请求单元进行其他非数值处理操作,以批量处理所述数据记录的步骤具体括:In an embodiment, the steps of performing other non-numerical processing operations on each data record request unit based on the list of all changed data after the value is updated, and processing the data records in batches specifically include:
根据所述待变更数据列表,依次获取所述待变更数据列表中的各个变更数据信息,并根据所述热点配置表,获取所述各个变更数据信息对应的热点单元的单元状态;According to the list of data to be changed, obtain each change data information in the list of data to be changed in turn, and obtain the unit status of the hotspot unit corresponding to each change data information according to the hotspot configuration table;
根据所述各个变更数据信息以及对应的热点单元的单元状态,对所述各个变更数据信息对应的热点单元分别进行数值更新,并根据各个热点单元对应的更新后的单元数值,更新所述热点配置表中所述各个热点单元对应的单元状态。According to each change data information and the unit status of the corresponding hotspot unit, the hotspot unit corresponding to each change data information is updated respectively, and the hotspot configuration is updated according to the updated unit value corresponding to each hotspot unit The unit status corresponding to each hotspot unit described in the table.
在一实施例中,所述根据所述各个变更数据信息以及对应的热点单元的单元状态,对所述各个变更数据信息对应的热点单元分别进行数值更新,并根据各个热点单元对应的更新后的单元数值,更新所述热点配置表中所述各个热点单元对应的单元状态的步骤具体包括:In an embodiment, the hotspot unit corresponding to each change data information is updated with a numerical value according to the respective change data information and the unit status of the corresponding hotspot unit, and the updated value corresponding to each hotspot unit is updated. Unit value, the step of updating the unit status corresponding to each hotspot unit in the hotspot configuration table specifically includes:
依次获取所述各个变更数据信息,作为待更新数据信息,获取所述待更新数据信息对应的热点单元,作为待更新热点单元,并获取所述待更新热点单元的单元数值状态;Acquiring each of the changed data information in sequence as the data information to be updated, acquiring the hot unit corresponding to the data information to be updated as the hot unit to be updated, and acquiring the unit value status of the hot unit to be updated;
根据所述待更新数据信息对应的待更新数值以及所述单元数值状态,判断所述待更新热点单元是否可以进行数值更新;Judging whether the hotspot unit to be updated can update the value according to the value to be updated corresponding to the data information to be updated and the value status of the unit;
若所述待更新热点单元可以进行数值更新,则对所述待更新热点单元进行加锁,将所述待更新数据信息的待更新状态修改为已更新状态,对所述待更新热点单元进行数值更新,并更新所述热点配置表中所述待更新热点单元对应的单元数值状态。If the hotspot unit to be updated can perform a value update, lock the hotspot unit to be updated, modify the pending update state of the data information to be updated to the updated state, and perform a numerical value on the hotspot unit to be updated Update and update the unit value status corresponding to the hotspot unit to be updated in the hotspot configuration table.
在一实施例中,所述根据所述待更新数据信息对应的待更新数值以及所述单元数值状态,判断所述待更新热点单元是否可以进行数值更新的步骤之后,还包括:In an embodiment, after the step of judging whether the hotspot unit to be updated can update the value according to the value to be updated corresponding to the data information to be updated and the value status of the unit, the method further includes:
若所述待更新热点单元不可以进行数值更新,则根据所述待更新热点单元生成对应的交易失败提醒消息。If the hot-spot unit to be updated cannot perform a value update, a corresponding transaction failure reminder message is generated according to the hot-spot unit to be updated.
在一实施例中,所述在接收到批量数据记录请求后,确定所述批量数据记录对应的多个区块链节点中的各个数据记录请求单元,并根据预设热点配置表,在所述各个数据记录请求单元中确定热点单元的步骤之后,还包括:In one embodiment, after receiving the batch data recording request, determine each data recording request unit of the multiple blockchain nodes corresponding to the batch data record, and according to a preset hotspot configuration table, After the step of determining the hotspot unit in each data recording request unit, it also includes:
判断所述各个数据记录请求单元是否存在所述热点单元;Judging whether the hotspot unit exists in each data recording request unit;
若所述各个数据记录请求单元中不存在所述热点单元,则根据预设通用模式同步更新所述各个数据记录请求单元对应的数值,并对所述各个数据记录请求单元进行其他非数值处理操作,以批量处理所述数据记录。If the hotspot unit does not exist in each data recording request unit, the corresponding value of each data recording request unit is synchronously updated according to the preset general mode, and other non-numerical processing operations are performed on each data recording request unit To process the data records in batches.
在一实施例中,所述获取所述热点单元对应的变更数据信息,并将所述热点单元对应的变更数据信息同步至所述热点单元所属的热点节点,生成各个热点节点对应的待变更数据列表的步骤之前,还包括:In an embodiment, the obtaining the change data information corresponding to the hotspot unit, and synchronize the change data information corresponding to the hotspot unit to the hotspot node to which the hotspot unit belongs, and generate the data to be changed corresponding to each hotspot node Before the steps of the list, it also includes:
根据所述热点配置表,获取所述热点单元对应的热点单元状态,并根据所述热点单元状态,判断所述热点单元是否可以允许进行数值更新;According to the hotspot configuration table, acquiring the hotspot unit status corresponding to the hotspot unit, and judging whether the hotspot unit can allow value updating according to the hotspot unit status;
若所述热点单元允许进行数值更新,则执行:获取所述热点单元对应的变更数据信息,并将所述热点单元对应的变更数据信息同步至所述热点单元所属的热点节点,生成各个热点节点对应的待变更数据列表的步骤;If the hotspot unit allows value updating, execute: obtain the change data information corresponding to the hotspot unit, and synchronize the change data information corresponding to the hotspot unit to the hotspot node to which the hotspot unit belongs to generate each hotspot node Steps corresponding to the list of data to be changed;
若所述热点单元不允许进行数值更新,则根据所述热点单元生成交易失败的提醒消息。If the hotspot unit is not allowed to update the value, a reminder message of transaction failure is generated according to the hotspot unit.
在一实施例中,所述根据所述待变更数据列表,对所述热点单元进行数值更新,并对所述热点节点中的其他非热点单元以及其他非热点节点中的其他非热点单元进行数值更新的步骤之前,还包括:In one embodiment, according to the list of data to be changed, the hot-spot unit is updated numerically, and other non-hot-spot units in the hot-spot node and other non-hot-spot units in the other non-hot-spot nodes are numerically updated Before the update steps, it also includes:
获取所述待变更数据列表中的各个变更数据信息标识,并判断所述各个变更数据信息标识中是否存在重复变更数据信息标识;Acquiring each changed data information identifier in the list of data to be changed, and determining whether there is a repeated change data information identifier in each of the changed data information identifiers;
若所述各个变更数据信息标识中存在重复变更数据信息标识,则根据所述重复变更数据信息标识,对所述待变更数据列表中的各个变更数据信息进行去重处理。If there is a repeated change data information identifier in each change data information identifier, deduplication processing is performed on each change data information in the to-be-changed data list according to the repeated change data information identifier.
此外,为实现上述目的,本申请还提供一种基于区块链的数据批量处理装置,所述基于区块链的数据批量处理装置包括:In addition, in order to achieve the above objective, the present application also provides a block chain-based data batch processing device, which includes:
热点单元确定模块,用于在接收到批量数据记录请求后,确定所述批量数据记录对应的多个区块链节点中的各个数据记录请求单元,并根据预设热点配置表,在所述各个数据记录请求单元中确定热点单元;The hotspot unit determination module is used to determine each data record request unit of the multiple blockchain nodes corresponding to the batch data record after receiving the batch data record request, and set the data record request unit in each of the multiple blockchain nodes according to the preset hotspot configuration table. Determine the hotspot unit in the data record request unit;
数据列表生成模块,用于获取所述热点单元对应的变更数据信息,并将所述热点单元对应的变更数据信息同步至所述热点单元所属的热点节点,生成各个热点节点对应的待变更数据列表;The data list generating module is used to obtain the change data information corresponding to the hotspot unit, and synchronize the change data information corresponding to the hotspot unit to the hotspot node to which the hotspot unit belongs, and generate a list of data to be changed corresponding to each hotspot node ;
单元数值更新模块,用于根据所述待变更数据列表,对所述热点单元进行数值更新,并对所述热点节点中的其他非热点单元以及其他非热点节点中的其他非热点单元进行数值更新;The unit value update module is used to update the value of the hotspot unit according to the list of data to be changed, and update the values of other non-hotspot units in the hotspot node and other non-hotspot units in other non-hotspot nodes ;
数值更新处理模块,用于根据数值更新后的全部变更数据列表,对各个数据记录请求单元进行其他非数值处理操作,以批量处理所述数据记录。The value update processing module is used to perform other non-numerical processing operations on each data record request unit according to the list of all changed data after the value update to process the data records in batches.
在一实施例中,所述数据列表生成模块具体包括:In an embodiment, the data list generating module specifically includes:
同步列表生成单元,用于获取所述热点单元对应的变更数据信息,生成待同步数据列表;A synchronization list generating unit, configured to obtain the changed data information corresponding to the hotspot unit, and generate a list of data to be synchronized;
同步数据同步单元,用于在所述待同步数据列表中存在未同步数据时,将所述待同步数据列表中的未同步数据进行分片,并将分片后的未同步数据同步至对应的热点单元所属的热点节点,生成各个热点节点对应的待变更数据列表。The synchronized data synchronization unit is configured to divide the unsynchronized data in the to-be-synchronized data list into fragments when there is unsynchronized data in the to-be-synchronized data list, and synchronize the fragmented unsynchronized data to the corresponding The hotspot node to which the hotspot unit belongs generates a list of data to be changed corresponding to each hotspot node.
在一实施例中,所述数值更新处理模块具体包括:In an embodiment, the value update processing module specifically includes:
单元状态获取子单元,用于根据所述待变更数据列表,依次获取所述待变更数据列表中的各个变更数据信息,并根据所述热点配置表,获取所述各个变更数据信息对应的热点单元的单元状态;The unit status obtaining subunit is used to obtain each change data information in the data list to be changed according to the data list to be changed, and obtain the hotspot unit corresponding to each change data information according to the hotspot configuration table The unit status;
单元数值更新子单元,用于根据所述各个变更数据信息以及对应的热点单元的单元状态,对所述各个变更数据信息对应的热点单元分别进行数值更新,并根据各个热点单元对应的更新后的单元数值,更新所述热点配置表中所述各个热点单元对应的单元状态。The unit value update subunit is used to update the values of the hotspot units corresponding to the respective change data information according to the respective change data information and the unit status of the corresponding hotspot unit, and to update the values according to the updated data corresponding to each hotspot unit The unit value updates the unit status corresponding to each hotspot unit in the hotspot configuration table.
在一实施例中,所述单元数值更新子单元还用于:In an embodiment, the unit value update subunit is further used for:
依次获取所述各个变更数据信息,作为待更新数据信息,获取所述待更新数据信息对应的热点单元,作为待更新热点单元,并获取所述待更新热点单元的单元数值状态;Acquiring each of the changed data information in sequence as the data information to be updated, acquiring the hot unit corresponding to the data information to be updated as the hot unit to be updated, and acquiring the unit value status of the hot unit to be updated;
根据所述待更新数据信息对应的待更新数值以及所述单元数值状态,判断所述待更新热点单元是否可以进行数值更新;Judging whether the hotspot unit to be updated can update the value according to the value to be updated corresponding to the data information to be updated and the value status of the unit;
若所述待更新热点单元可以进行数值更新,则对所述待更新热点单元进行加锁,将所述待更新数据信息的待更新状态修改为已更新状态,对所述待更新热点单元进行数值更新,并更新所述热点配置表中所述待更新热点单元对应的单元数值状态。If the hotspot unit to be updated can perform a value update, lock the hotspot unit to be updated, modify the pending update state of the data information to be updated to the updated state, and perform a numerical value on the hotspot unit to be updated Update and update the unit value status corresponding to the hotspot unit to be updated in the hotspot configuration table.
在一实施例中,所述基于区块链的数据批量处理装置还包括变更数据去重模块,所述变更数据去重模块用于:In an embodiment, the block chain-based data batch processing device further includes a modified data deduplication module, and the modified data deduplication module is configured to:
获取所述待变更数据列表中的各个变更数据信息标识,并判断所述各个变更数据信息标识中是否存在重复变更数据信息标识;Acquiring each changed data information identifier in the list of data to be changed, and determining whether there is a repeated change data information identifier in each of the changed data information identifiers;
若所述各个变更数据信息标识中存在重复变更数据信息标识,则根据所述重复变更数据信息标识,对所述待变更数据列表中的各个变更数据信息进行去重处理。If there is a repeated change data information identifier in each change data information identifier, deduplication processing is performed on each change data information in the to-be-changed data list according to the repeated change data information identifier.
此外,为实现上述目的,本申请还提供一种基于区块链的数据批量处理设备,所述基于区块链的数据批量处理设备包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的基于区块链的数据批量处理程序,所述基于区块链的数据批量处理程序被所述处理器执行时实现如上所述的基于区块链的数据批量处理方法的步骤。In addition, in order to achieve the above-mentioned object, this application also provides a block chain-based data batch processing device. The block chain-based data batch processing device includes: a memory, a processor, and a storage A block chain-based data batch processing program running on the processor, and the block chain-based data batch processing program is executed by the processor to realize the above-mentioned blockchain-based data batch processing method step.
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有基于区块链的数据批量处理程序,所述基于区块链的数据批量处理程序被处理器执行时实现如上所述的基于区块链的数据批量处理方法的步骤。In addition, in order to achieve the above-mentioned purpose, the present application also provides a computer-readable storage medium on which a blockchain-based data batch processing program is stored, and the blockchain-based data batch processing program is stored on the computer-readable storage medium. When executed by the processor, the steps of the block chain-based data batch processing method as described above are realized.
本申请在接收到批量数据记录请求后,确定所述批量数据记录对应的多个区块链节点中的各个数据记录请求单元,并根据预设热点配置表,在所述各个数据记录请求单元中确定热点单元;获取所述热点单元对应的变更数据信息,并将所述热点单元对应的变更数据信息同步至所述热点单元所属的热点节点,生成各个热点节点对应的待变更数据列表;根据所述待变更数据列表,对所述热点单元进行数值更新,并对所述热点节点中的其他非热点单元以及其他非热点节点中的其他非热点单元进行数值更新;根据数值更新后的全部变更数据列表,对各个数据记录请求单元进行其他非数值处理操作,以批量处理所述数据记录。通过上述方式,本申请批量处理数据记录请求,并将热点单元对应的变更数据信息同步至热点节点的待变更数据列表,同步记录热点单元的变更数据信息,然后根据待变更数据列表,进行热点单元变更数据数值的异步更新以及其他非数值类的处理操作。由此提高了热点单元的数据处理效率,提高了多节点单元数据变更的成功率,解决了现有热点单元的串行处理方法存在的数据处理效率低的技术问题。After receiving the batch data record request, this application determines each data record request unit in the multiple blockchain nodes corresponding to the batch data record, and according to the preset hotspot configuration table, in each data record request unit Determine the hotspot unit; obtain the change data information corresponding to the hotspot unit, and synchronize the change data information corresponding to the hotspot unit to the hotspot node to which the hotspot unit belongs, and generate a list of data to be changed corresponding to each hotspot node; State the list of data to be changed, update the values of the hotspot units, and update the values of other non-hotspot units in the hotspot node and other non-hotspot units in other non-hotspot nodes; according to all the changed data after the value update List, perform other non-numerical processing operations on each data record request unit to process the data records in batches. Through the above method, this application processes data recording requests in batches, synchronizes the change data information corresponding to the hotspot unit to the data list to be changed of the hotspot node, synchronously records the changed data information of the hotspot unit, and then performs the hotspot unit according to the list of data to be changed Asynchronous update of changed data values and other non-numerical processing operations. As a result, the data processing efficiency of the hotspot unit is improved, the success rate of data modification of the multi-node unit is improved, and the technical problem of low data processing efficiency in the existing serial processing method of the hotspot unit is solved.
附图说明Description of the drawings
图1是本申请实施例方案涉及的硬件运行环境的设备结构示意图;FIG. 1 is a schematic diagram of a device structure of a hardware operating environment involved in a solution of an embodiment of the present application;
图2为本申请基于区块链的数据批量处理方法第一实施例的流程示意图。FIG. 2 is a schematic flowchart of a first embodiment of a data batch processing method based on blockchain in this application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics, and advantages of the purpose of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings.
本发明的实施方式Embodiments of the invention
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described here are only used to explain the application, and are not used to limit the application.
如图1所示,图1是本申请实施例方案涉及的硬件运行环境的设备结构示意图。As shown in FIG. 1, FIG. 1 is a schematic diagram of the device structure of the hardware operating environment involved in the solution of the embodiment of the present application.
本申请实施例基于区块链的数据批量处理设备可以是PC机或服务器设备,其上运行有Java虚拟机。The block chain-based data batch processing device in the embodiment of the present application may be a PC or a server device, on which a Java virtual machine runs.
如图1所示,该基于区块链的数据批量处理设备可以包括:处理器1001,例如CPU,网络接口1004,用户接口1003,存储器1005,通信总线1002。其中,通信总线1002用于实现这些组件之间的连接通信。用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard),可选用户接口1003还可以包括标准的有线接口、无线接口。网络接口1004可选的可以包括标准的有线接口、无线接口(如WI-FI接口)。存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1005可选的还可以是独立于前述处理器1001的存储装置。As shown in FIG. 1, the block chain-based data batch processing device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to implement connection and communication between these components. The user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 can be a high-speed RAM memory or a stable memory (non-volatile memory), such as disk storage. Optionally, the memory 1005 may also be a storage device independent of the foregoing processor 1001.
本领域技术人员可以理解,图1中示出的设备结构并不构成对设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the structure of the device shown in FIG. 1 does not constitute a limitation on the device, and may include more or fewer components than those shown in the figure, or a combination of certain components, or different component arrangements.
如图1所示,作为一种计算机存储介质的存储器1005中可以包括操作系统、网络通信模块、用户接口模块以及基于区块链的数据批量处理程序。As shown in FIG. 1, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a data batch processing program based on the blockchain.
在图1所示的设备中,网络接口1004主要用于连接后台服务器,与后台服务器进行数据通信;用户接口1003主要用于连接客户端(用户端),与客户端进行数据通信;而处理器1001可以用于调用存储器1005中存储的基于区块链的数据批量处理程序,并执行下述基于区块链的数据批量处理方法中的操作。In the device shown in FIG. 1, the network interface 1004 is mainly used to connect to a back-end server and perform data communication with the back-end server; the user interface 1003 is mainly used to connect to a client (user side) and perform data communication with the client; and the processor 1001 can be used to call a blockchain-based data batch processing program stored in the memory 1005, and execute the following operations in the blockchain-based data batch processing method.
基于上述硬件结构,提出本申请基于区块链的数据批量处理方法实施例。Based on the above hardware structure, an embodiment of the data batch processing method based on the blockchain of this application is proposed.
参照图2,图2为本申请基于区块链的数据批量处理方法第一实施例的流程示意图,所述基于区块链的数据批量处理方法包括:Referring to Fig. 2, Fig. 2 is a schematic flow chart of the first embodiment of a blockchain-based data batch processing method according to this application. The blockchain-based data batch processing method includes:
步骤S10,在接收到批量数据记录请求后,确定所述批量数据记录对应的多个区块链节点中的各个数据记录请求单元,并根据预设热点配置表,在所述各个数据记录请求单元中确定热点单元;Step S10, after receiving the batch data recording request, determine each data recording request unit in the multiple blockchain nodes corresponding to the batch data record, and according to the preset hotspot configuration table, in each data recording request unit Determine the hotspot unit;
本实施例中,以金融业务场景进行举例说明,具体实施例中,本申请中的方案也可应用于其他应用场景。其中,所述数据记录请求即为记账请求,所述数据记录请求单元即为记账请求账户,所述热点单元即为热点账户。In this embodiment, a financial business scenario is used as an example for illustration. In a specific embodiment, the solution in this application can also be applied to other application scenarios. Wherein, the data recording request is a billing request, the data recording request unit is a billing request account, and the hotspot unit is a hotspot account.
目前在某些特定的金融业务场景下,需要对单一的账户进行并发记账处理。在这种情况下,该账户就成为一个热点账户。例如,当用户对某一商品进行在线支付时,用户可以利用自己的支付账户向担保交易中间账户支付该商品的金额,每个用户在进行在线支付时,都会涉及到担保交易中间账户,当短时间内大量的用户进行在线支付时,担保交易中间账户就会成为热点账户。现有热点账户通过同步模式记账,即执行交易时都需要锁定/解锁热点账户,由此使得大量的并发交易请求需要排队依次等待被热点账户处理,从而导致大量的并发交易请求被串行化,极大地降低了数据处理效率。为了解决上述问题,本实施例中批量处理记账请求,将热点账户对应的交易流水同步至热点节点的待处理流水列表,同步记录热点账户的交易流水,然后根据待处理流水列表,进行热点账户余额的异步更新以及其他非余额类的处理操作。由此提高了热点账户的交易处理效率,提高了多节点账户交易的成功率。具体地,预先设置热点配置表,包括热点账户所属节点路由信息,热点账户允许处理类型(借记热点、贷记热点)、当前管控状态(司法、银行管控)、预警状态对应的账户余额、预警恢复账户余额阀值、暂停状态标识、暂停恢复账户余额阀值等,并将热点配置表同步至各个节点。在接收到记账请求时,获取记账请求的双方,并将记账交易请求发送到双方所在的相关节点。若记账双方只涉及单节点的,则将记账交易请求发送至热点节点,即热点账户所属节点;若记账双方涉及多节点的,则将记账交易请求发送至非热点节点,减少同步操作,避免跨节点调用。若记账双方涉及多及节点且都是热点节点,则将交易发送至任一热点节点。通过上述方式,将多节点记账处理简化为单节点记账处理。在进行记账处理操作之前,需要对记账请求账户进行记账账户是热点账户或非热点账户的识别,对非热点账户进行同步记账,对热点账户进行同步登记流水以及异步更新余额等。因此,在接收到记账请求时,检查热点配置表,确认各个记账请求账户中是否存在热点账户。并登记热点账户的记账交易中的交易要素,如记账类型、借入或者转出金额等。At present, in certain specific financial business scenarios, it is necessary to perform concurrent accounting processing on a single account. In this case, the account becomes a hot account. For example, when a user makes an online payment for a product, the user can use his payment account to pay the amount of the product to the secured transaction intermediate account. When each user makes an online payment, the secured transaction intermediate account will be involved. When a large number of users make online payments within a period of time, the secured transaction intermediate account will become a hot account. Existing hotspot accounts are accounted in a synchronous mode, that is, when transactions are executed, hotspot accounts need to be locked/unlocked, which makes a large number of concurrent transaction requests need to be queued and waited to be processed by hotspot accounts, resulting in a large number of concurrent transaction requests being serialized , Which greatly reduces the efficiency of data processing. In order to solve the above problems, in this embodiment, batch processing of billing requests is performed, the transaction flow corresponding to the hot account is synchronized to the pending flow list of the hot node, the transaction flow of the hot account is synchronously recorded, and then the hot account is performed according to the pending flow list Asynchronous update of balance and other non-balance processing operations. This improves the transaction processing efficiency of hot accounts and improves the success rate of multi-node account transactions. Specifically, the hotspot configuration table is preset, including the node routing information to which the hotspot account belongs, the allowed processing type of the hotspot account (debit hotspot, credit hotspot), current control status (judicial, bank control), account balance corresponding to the alert status, and alert Recover account balance threshold, pause status indicator, pause recovery account balance threshold, etc., and synchronize the hotspot configuration table to each node. When receiving the billing request, obtain both parties of the billing request, and send the billing transaction request to the relevant node where both parties are located. If the two parties involved in the bookkeeping only involve a single node, then the bookkeeping transaction request will be sent to the hotspot node, that is, the node to which the hot account belongs; if the two parties involved in the bookkeeping involve multiple nodes, the transaction request will be sent to the non-hotspot node to reduce synchronization Operation, avoid cross-node calls. If both parties to the account involve multiple nodes and both are hot nodes, the transaction is sent to any hot node. Through the above method, the multi-node accounting process is simplified to the single-node accounting process. Before performing the accounting processing operation, it is necessary to identify whether the accounting request account is a hot account or a non-hot account, perform synchronous accounting for the non-hot account, synchronize the registration flow of the hot account, and update the balance asynchronously. Therefore, when a billing request is received, the hotspot configuration table is checked to confirm whether there is a hotspot account in each billing request account. And register the transaction elements in the bookkeeping transaction of the hot account, such as the bookkeeping type, borrowing or transferring amount, etc.
进一步地,所述步骤S10之后,还包括:Further, after the step S10, it further includes:
判断所述各个数据记录请求单元是否存在所述热点单元;Judging whether the hotspot unit exists in each data recording request unit;
若所述各个数据记录请求单元中不存在所述热点单元,则根据预设通用模式同步更新所述各个数据记录请求单元对应的数值,并对所述各个数据记录请求单元进行其他非数值处理操作,以批量处理所述数据记录。If the hotspot unit does not exist in each data recording request unit, the corresponding value of each data recording request unit is synchronously updated according to the preset general mode, and other non-numerical processing operations are performed on each data recording request unit To process the data records in batches.
本实施例中,所述数值即为余额,所述其他非数值处理操作即为其他非余额处理操作。若所述各个记账请求账户中不存在热点账户,则按照同步实时更新余额进行通用模式处理,即根据记账请求实时更新各个记账请求账户对应的账户余额以及其他非余额处理操作。In this embodiment, the value is the balance, and the other non-numerical processing operations are other non-balance processing operations. If there is no hot account in each billing request account, the general mode is processed according to the synchronous real-time balance update, that is, the account balance corresponding to each billing request account and other non-balance processing operations are updated in real time according to the billing request.
步骤S20,获取所述热点单元对应的变更数据信息,并将所述热点单元对应的变更数据信息同步至所述热点单元所属的热点节点,生成各个热点节点对应的待变更数据列表;Step S20: Obtain the changed data information corresponding to the hotspot unit, and synchronize the changed data information corresponding to the hotspot unit to the hotspot node to which the hotspot unit belongs, and generate a list of data to be changed corresponding to each hotspot node;
本实施例中,所述变更数据信息即为交易流水,所述待变更数据列表即为待处理流水列表。获取各个热点账户对应的交易流水,并将各个热点节点中的各个热点账户对应的交易流水同步至各自所属的热点节点,并将各个热点节点下面的所有热点账户对应的交易流水,添加至各个热点节点对应的待处理流水列表。In this embodiment, the changed data information is a transaction flow, and the list of data to be changed is a flow list to be processed. Get the transaction flow corresponding to each hotspot account, synchronize the transaction flow corresponding to each hotspot account in each hotspot node to their respective hotspot node, and add the transaction flow corresponding to all hotspot accounts under each hotspot node to each hotspot The pipeline list to be processed corresponding to the node.
进一步地,所述步骤S20之前,还包括:Further, before the step S20, it further includes:
根据所述热点配置表,获取所述热点单元对应的热点单元状态,并根据所述热点单元状态,判断所述热点单元是否可以允许进行数值更新;According to the hotspot configuration table, acquiring the hotspot unit status corresponding to the hotspot unit, and judging whether the hotspot unit can allow value updating according to the hotspot unit status;
若所述热点单元允许进行数值更新,则执行:步骤S20;If the hotspot unit allows value updating, perform: step S20;
若所述热点单元不允许进行数值更新,则根据所述热点单元生成交易失败的提醒消息。If the hotspot unit is not allowed to update the value, a reminder message of transaction failure is generated according to the hotspot unit.
本实施例中,所述热点单元状态即为热点账户状态,所述数值更新即为余额更新,也就是判断所述热点账户是否可以进行交易。记账请求包括多种记账业务类型,例如,在热点配置表中将热点账户分别设置为:允许借方热点、允许贷方热点或者借贷热点都允许。热点配置表中还包括各个热点账户是否被司法冻结等管控信息。由此,根据所述热点配置表确定所述热点账户对应的热点账户状态,如是否允许该类型的热点,或者该热点账户的账户是否为管控状态等,确定各个热点账户是否允许进行交易,若允许,则执行步骤S20,获取各个热点账户对应的待处理流水。若不允许,则生成交易失败的提醒消息。In this embodiment, the hotspot unit status is the hotspot account status, and the value update is the balance update, that is, it is judged whether the hotspot account can conduct transactions. The billing request includes multiple types of billing services. For example, in the hotspot configuration table, the hotspot accounts are respectively set to: allow debit hotspots, allow credit hotspots, or both lending hotspots. The hotspot configuration table also includes control information such as whether each hotspot account is judicially frozen. Therefore, the hotspot account status corresponding to the hotspot account is determined according to the hotspot configuration table, such as whether this type of hotspot is allowed, or whether the account of the hotspot account is in a controlled state, etc., to determine whether each hotspot account is allowed to conduct transactions, if If allowed, step S20 is executed to obtain the to-be-processed pipeline corresponding to each hotspot account. If not allowed, a reminder message of transaction failure is generated.
步骤S30,根据所述待变更数据列表,对所述热点单元进行数值更新,并对所述热点节点中的其他非热点单元以及其他非热点节点中的其他非热点单元进行数值更新;Step S30, according to the list of data to be changed, update the value of the hot spot unit, and update the value of other non-hot spot units in the hot spot node and other non-hot spot units in other non-hot spot nodes;
本实施例中,所述待变更数据列表即为待处理流水列表,所述其他非热点单元即为其他非热点账户。在各个热点节点上,根据各自的热点账户对应的待处理流水列表,对各自的热点账户进行交易汇总并更新各自热点账户的账户余额。具体实施例中,更新各个热点账户的账户余额的同时,进一步根据各个热点账户更新后的账户余额,对各个热点账户在热点配置表中的记账状态进行更新。并将更新后的热点配置表,同步给所有其他节点。由此,进一步减小热点账户余额更新及对应的状态更新时间差,使其更新余额及同步状态变更更及时。然后再进一步对各个热点节点中的相应的其他非热点账户进行余额更新,以及其他非热点节点中的其他非热点账户进行余额更新,由此完成所有记账请求账户的余额更新。In this embodiment, the data list to be changed is the pipeline list to be processed, and the other non-hot-spot units are other non-hot-spot accounts. On each hotspot node, according to the pending flow list corresponding to the hotspot account, the transaction summary of the hotspot account is performed and the account balance of the hotspot account is updated. In a specific embodiment, while updating the account balance of each hotspot account, the billing status of each hotspot account in the hotspot configuration table is further updated according to the updated account balance of each hotspot account. And synchronize the updated hotspot configuration table to all other nodes. As a result, the time difference between the hot account balance update and the corresponding status update is further reduced, so that the balance update and synchronization status change are more timely. Then, it further updates the balance of the corresponding other non-hot-spot accounts in each hot-spot node, and updates the balances of other non-hot-spot accounts in other non-hot-spot nodes, thereby completing the balance update of all billing request accounts.
步骤S40,根据数值更新后的全部变更数据列表,对各个数据记录请求单元进行其他非数值处理操作,以批量处理所述数据记录。Step S40: Perform other non-numerical processing operations on each data record request unit according to the list of all changed data after the value is updated to process the data records in batches.
本实施例中,所述全部变更数据列表即为全部流水列表,所述各个数据记录请求单元即为各个记账请求账户,所述批量处理所述数据记录即为批量完成所述记账请求。在完成所有记账请求账户的余额更新后,对其他非余额处理操作进行移出处理。其中,其他非余额处理操作包括插入、删除、修改多条记录等,例如交易明细和会计核算部分,对于涉及到的内部户也要登记对应的交易明细和会计核算,耗时长,因此将余额更新操作和非余额处理操作进行分离,减少余额更新的时间差,使余额更新更迅速,状态同步更准确。In this embodiment, the all changed data list is a complete flow list, each data record request unit is each billing request account, and the batch processing of the data records is the batch completion of the billing request. After the balance update of all billing request accounts is completed, other non-balance processing operations are moved out. Among them, other non-balance processing operations include inserting, deleting, and modifying multiple records, such as transaction details and accounting parts. For internal accounts involved, the corresponding transaction details and accounting calculations must also be registered, which takes a long time, so the balance is updated Operation and non-balance processing operations are separated to reduce the time difference of balance update, make balance update faster, and state synchronization more accurate.
本实施例在接收到批量数据记录请求后,确定所述批量数据记录对应的多个区块链节点中的各个数据记录请求单元,并根据预设热点配置表,在所述各个数据记录请求单元中确定热点单元;获取所述热点单元对应的变更数据信息,并将所述热点单元对应的变更数据信息同步至所述热点单元所属的热点节点,生成各个热点节点对应的待变更数据列表;根据所述待变更数据列表,对所述热点单元进行数值更新,并对所述热点节点中的其他非热点单元以及其他非热点节点中的其他非热点单元进行数值更新;根据数值更新后的全部变更数据列表,对各个数据记录请求单元进行其他非数值处理操作,以批量处理所述数据记录。通过上述方式,本申请批量处理数据记录请求,并将热点单元对应的变更数据信息同步至热点节点的待变更数据列表,同步记录热点单元的变更数据信息,然后根据待变更数据列表,进行热点单元变更数据数值的异步更新以及其他非数值类的处理操作。由此提高了热点单元的数据处理效率,提高了多节点单元数据变更的成功率,解决了现有热点单元的串行处理方法存在的数据处理效率低的技术问题。In this embodiment, after receiving a batch data recording request, each data recording request unit in the multiple blockchain nodes corresponding to the batch data recording is determined, and according to the preset hotspot configuration table, the data recording request unit Determine the hotspot unit; obtain the change data information corresponding to the hotspot unit, and synchronize the change data information corresponding to the hotspot unit to the hotspot node to which the hotspot unit belongs, and generate a list of data to be changed corresponding to each hotspot node; For the list of data to be changed, update the values of the hotspot units, and update the values of other non-hotspot units in the hotspot node and other non-hotspot units in other non-hotspot nodes; according to all the changes after the value update In the data list, other non-numerical processing operations are performed on each data record request unit to process the data records in batches. Through the above method, this application processes data recording requests in batches, synchronizes the change data information corresponding to the hotspot unit to the data list to be changed of the hotspot node, synchronously records the changed data information of the hotspot unit, and then performs the hotspot unit according to the list of data to be changed Asynchronous update of changed data values and other non-numerical processing operations. As a result, the data processing efficiency of the hotspot unit is improved, the success rate of data modification of the multi-node unit is improved, and the technical problem of low data processing efficiency in the existing serial processing method of the hotspot unit is solved.
进一步地,基于本申请基于区块链的数据批量处理方法第一实施例,提出本申请基于区块链的数据批量处理方法第二实施例。Further, based on the first embodiment of the blockchain-based data batch processing method of this application, a second embodiment of the blockchain-based data batch processing method of this application is proposed.
在本实施例中,所述步骤S20具体包括:In this embodiment, the step S20 specifically includes:
获取所述热点单元对应的变更数据信息,生成待同步数据列表;Acquiring the changed data information corresponding to the hotspot unit, and generating a list of data to be synchronized;
在所述待同步数据列表中存在未同步数据时,将所述待同步数据列表中的未同步数据进行分片,并将分片后的未同步数据同步至对应的热点单元所属的热点节点,生成各个热点节点对应的待变更数据列表。When there is unsynchronized data in the list of data to be synchronized, the unsynchronized data in the list of data to be synchronized is fragmented, and the fragmented unsynchronized data is synchronized to the hotspot node to which the corresponding hotspot unit belongs, Generate a list of data to be changed corresponding to each hotspot node.
本实施例中,所述待同步数据列表即为待同步流水列表,所述未同步数据即为未同步流水,所述待变更数据列表即为待处理流水列表。在同步处理任务中记录各个热点账户对应的待处理流水,生成待同步流水列表,包括全部热点账户对应的待同步至所属节点的交易流水,其中,所述待同步流水列表中各个待同步流水的初始状态均为未同步状态。获取所述待同步流水列表中未同步状态的交易流水,并在未同步状态的交易流水数量较大时,将其进行分片操作,然后将分片后的未同步状态的交易流水批量同步至所属热点节点。然后热点节点将接收到的交易流水落地本地并存储至待处理流水表,其中,记账节点通过消息总线直接调用服务进行流水同步及失败同步重试。In this embodiment, the list of data to be synchronized is a pipeline to be synchronized, the unsynchronized data is an unsynchronized pipeline, and the list of data to be changed is a pipeline to be processed. In the synchronization processing task, the pending pipeline corresponding to each hot account is recorded, and a list of pipelines to be synchronized is generated, including transaction pipelines corresponding to all hot accounts to be synchronized to their own nodes, wherein each pipeline to be synchronized in the pipeline list to be synchronized The initial state is unsynchronized. Obtain the unsynchronized state transaction flow in the pending synchronization flow list, and when the number of unsynchronized state transaction flow is large, perform the sharding operation, and then synchronize the fragmented unsynchronized state transaction flow to batch Owning hot node. The hotspot node then localizes the received transaction flow and stores it in the to-be-processed flow table, where the billing node directly calls the service through the message bus to perform flow synchronization and failed synchronization retry.
进一步地,所述步骤S30具体包括:Further, the step S30 specifically includes:
根据所述待变更数据列表,依次获取所述待变更数据列表中的各个变更数据信息,并根据所述热点配置表,获取所述各个变更数据信息对应的热点单元的单元状态;According to the list of data to be changed, obtain each change data information in the list of data to be changed in turn, and obtain the unit status of the hotspot unit corresponding to each change data information according to the hotspot configuration table;
根据所述各个变更数据信息以及对应的热点单元的单元状态,对所述各个变更数据信息对应的热点单元分别进行数值更新,并根据各个热点单元对应的更新后的单元数值,更新所述热点配置表中所述各个热点单元对应的单元状态。According to each change data information and the unit status of the corresponding hotspot unit, the hotspot unit corresponding to each change data information is updated respectively, and the hotspot configuration is updated according to the updated unit value corresponding to each hotspot unit The unit status corresponding to each hotspot unit described in the table.
本实施例中,所述各个变更数据信息即为各条交易流水,所述热点单元的单元状态即为所述热点账户的账户状态,所述单元数值即为账户余额。热点配置表作为记账同步处理中的记账类型许可、记账状态的检查依据,有三种情况会导致热点账户状态变更、并需要做同步:In this embodiment, each change data information is each transaction flow, the unit status of the hotspot unit is the account status of the hotspot account, and the unit value is the account balance. The hotspot configuration table is used as the basis for checking the accounting type permission and accounting status in the accounting synchronization process. There are three situations that will cause the hotspot account status to change and need to be synchronized:
1.预定义时的设置,即热点配置表中预先设置的各热点账户状态;1. Pre-defined settings, that is, the status of each hotspot account preset in the hotspot configuration table;
2.账户余额更新导致的状态变更,即每个热点账户进行余额更新操作之后,需要对各个热点账户的账户状态进行更新,如各个热点账户的账户余额值低于低于预警阀值,修改配置表状态中预警状态,账户余额低于停用阀值,修改配置表状态中停用状态。余额高于预警恢复阀值,修改配置表状态中正常状态等。2. The status change caused by the account balance update, that is, after each hotspot account performs the balance update operation, the account status of each hotspot account needs to be updated, such as the account balance value of each hotspot account is lower than the warning threshold, modify the configuration In the early warning state of the table status, the account balance is lower than the deactivation threshold, modify the deactivated state in the configuration table status. The balance is higher than the early warning recovery threshold, and the normal state in the state of the configuration table is modified.
3.司法冻结等管控导致记账状态变更,即司法、银行管控等导致热点账户不可交易的账户状态。3. Judicial freezing and other controls lead to changes in the accounting status, that is, judicial and bank controls that make hot accounts untradeable.
其中,配置表中状态变更后,需同步给其他各个节点,做后续同步记账的依据。Among them, after the status in the configuration table is changed, it needs to be synchronized to other nodes for subsequent synchronization accounting.
进一步地,所述根据所述各个变更数据信息以及对应的热点单元的单元状态,对所述各个变更数据信息对应的热点单元分别进行数值更新,并根据各个热点单元对应的更新后的单元数值,更新所述热点配置表中所述各个热点单元对应的单元状态的步骤具体包括:Further, according to the respective change data information and the unit status of the corresponding hotspot unit, the hotspot units corresponding to the respective change data information are respectively updated with values, and according to the updated unit values corresponding to each hotspot unit, The step of updating the unit status corresponding to each hotspot unit in the hotspot configuration table specifically includes:
依次获取所述各个变更数据信息,作为待更新数据信息,获取所述待更新数据信息对应的热点单元,作为待更新热点单元,并获取所述待更新热点单元的单元数值状态;Acquiring each of the changed data information in sequence as the data information to be updated, acquiring the hot unit corresponding to the data information to be updated as the hot unit to be updated, and acquiring the unit value status of the hot unit to be updated;
根据所述待更新数据信息对应的待更新数值以及所述单元数值状态,判断所述待更新热点单元是否可以进行数值更新;Judging whether the hotspot unit to be updated can update the value according to the value to be updated corresponding to the data information to be updated and the value status of the unit;
若所述待更新热点单元可以进行数值更新,则对所述待更新热点单元进行加锁,将所述待更新数据信息的待更新状态修改为已更新状态,对所述待更新热点单元进行数值更新,并更新所述热点配置表中所述待更新热点单元对应的单元数值状态。If the hotspot unit to be updated can perform a value update, lock the hotspot unit to be updated, modify the pending update state of the data information to be updated to the updated state, and perform a numerical value on the hotspot unit to be updated Update and update the unit value status corresponding to the hotspot unit to be updated in the hotspot configuration table.
若所述待更新热点单元不可以进行数值更新,则根据所述待更新热点单元生成对应的交易失败提醒消息。If the hot-spot unit to be updated cannot perform a value update, a corresponding transaction failure reminder message is generated according to the hot-spot unit to be updated.
本实施例中,在根据各个热点账户对应的交易流水更新所述热点账户的余额之前,需要判断所述热点账户是否可执行所述交易流水对应金额的交易操作。具体地,依次获取同步记录的交易流水中的各条交易流水明细,即依次将各条交易流水作为待更新流水,分别对各条交易流水明细对应的热点账户进行对应处理,其中,依次将各条交易流水明细对应的热点账户作为哥哥待更新流水对应的待更新热点账户。根据所述待更新流水对应的待更新金额,即交易金额,以及待更新热点账户中的账户余额状态,如暂停状态、余额预警状态或者正常状态(余额充裕状态)。判断所述待更新热点账户是否可以进行余额更新,即判断所述待更新金额是否小于所述待更新热点账户的账户余额。若所述待更新金额小于或等于所述待更新热点账户的账户余额,则可以进行余额更新操作,对所述待更新热点账户进行加锁,将所述待更新流水的待更新状态修改为已更新状态,对所述待更新热点账户进行余额更新,并更新所述热点配置表中所述待更新热点账户对应的账户余额状态。若所述待更新金额大于所述待更新热点账户的账户余额,则不可以进行余额更新操作,并生成该热点账户对应的交易失败提醒消息。In this embodiment, before updating the balance of the hotspot account according to the transaction flow corresponding to each hotspot account, it is necessary to determine whether the hotspot account can perform a transaction operation for the amount corresponding to the transaction flow. Specifically, the transaction flow details in the synchronously recorded transaction flow are sequentially obtained, that is, each transaction flow is sequentially used as the flow to be updated, and the hot accounts corresponding to the transaction flow details are correspondingly processed. The hot account corresponding to the transaction flow details is used as the hot account to be updated corresponding to the brother's to be updated flow. According to the amount to be updated corresponding to the flow to be updated, that is, the transaction amount, and the account balance status of the hot account to be updated, such as a suspended status, a balance warning status, or a normal status (balance sufficient status). It is judged whether the balance of the hot account to be updated can be updated, that is, it is judged whether the amount to be updated is less than the account balance of the hot account to be updated. If the amount to be updated is less than or equal to the account balance of the hotspot account to be updated, the balance update operation can be performed, the hotspot account to be updated is locked, and the pending update status of the flow to be updated is changed to already Update the status, update the balance of the hotspot account to be updated, and update the account balance status corresponding to the hotspot account to be updated in the hotspot configuration table. If the amount to be updated is greater than the account balance of the hotspot account to be updated, the balance update operation cannot be performed, and a transaction failure reminder message corresponding to the hotspot account is generated.
进一步地,基于本申请基于区块链的数据批量处理方法第二实施例,提出本申请基于区块链的数据批量处理方法第三实施例。Further, based on the second embodiment of the blockchain-based data batch processing method of this application, a third embodiment of the blockchain-based data batch processing method of this application is proposed.
在本实施例中,所述步骤S30之前,还包括:In this embodiment, before the step S30, the method further includes:
获取所述待变更数据列表中的各个变更数据信息标识,并判断所述各个变更数据信息标识中是否存在重复变更数据信息标识;Acquiring each changed data information identifier in the list of data to be changed, and determining whether there is a repeated change data information identifier in each of the changed data information identifiers;
若所述各个变更数据信息标识中存在重复变更数据信息标识,则根据所述重复变更数据信息标识,对所述待变更数据列表中的各个变更数据信息进行去重处理。If there is a repeated change data information identifier in each change data information identifier, deduplication processing is performed on each change data information in the to-be-changed data list according to the repeated change data information identifier.
本实施例中,所述各个变更数据信息标识即为各个交易流水标识,所述重复变更数据信息标识即为重复流水标识,所述各个变更数据信息即为各个交易流水。为了提高变更数据的处理效率与准确率,即为了提高记账数据的处理效率与准确率,具体地,对每个异步任务进行去重以及失败重试处理。其中,异步任务包括余额更新、其他非余额处理操作等。具体地,为了提高余额更新效率,获取余额更新异步任务时,获取所述余额更新异步任务对应的待处理流水列表,并获取所述待处理流水列表中的各个交易流水标识,其中,每个交易流水对应唯一一个交易流水标识,如交易流水编号或者交易流水名称等。判断所述各个交易流水标识中是否存在重复流水标识,即判断各个交易流水标识中是否存在两个或者多个相同的交易流水标识。若所述各个交易流水标识中存在重复流水标识,则将重复流水标识对应的重复交易流水进行去重,以使所述待处理流水列表中各个交易流水都是唯一交易流水。具体实施例中,在检测到所述待处理流水列表中的各个交易流水对应的余额更新任务失败时,根据预设时间间隔,重新拉起并执行该交易流水对应的余额更新任务。In this embodiment, each change data information identifier is each transaction flow identifier, the repeated change data information identifier is a repeated flow identifier, and each change data information is each transaction flow identifier. In order to improve the processing efficiency and accuracy of the change data, that is, to improve the processing efficiency and accuracy of the accounting data, specifically, each asynchronous task is deduplicated and failed retry processing. Among them, asynchronous tasks include balance updates, other non-balance processing operations, etc. Specifically, in order to improve the efficiency of balance update, when obtaining the balance update asynchronous task, obtain the pending flow list corresponding to the balance update asynchronous task, and obtain each transaction flow identifier in the pending flow list, where each transaction The flow corresponds to a unique transaction flow identifier, such as a trading flow number or a trading flow name. It is judged whether there is a repeated flow mark in each transaction flow mark, that is, it is judged whether there are two or more identical transaction flow marks in each transaction flow mark. If there is a repeated flow mark in each transaction flow mark, the repeated flow mark corresponding to the repeated flow mark is de-duplicated, so that each trading flow in the pending flow list is a unique trading flow. In a specific embodiment, when it is detected that the balance update task corresponding to each transaction flow in the pending flow list has failed, the balance update task corresponding to the transaction flow is restarted and executed according to a preset time interval.
本申请还提供一种基于区块链的数据批量处理装置,所述基于区块链的数据批量处理装置包括:The present application also provides a block chain-based data batch processing device, which includes:
热点单元确定模块,用于在接收到批量数据记录请求后,确定所述批量数据记录对应的多个区块链节点中的各个数据记录请求单元,并根据预设热点配置表,在所述各个数据记录请求单元中确定热点单元;The hotspot unit determination module is used to determine each data record request unit of the multiple blockchain nodes corresponding to the batch data record after receiving the batch data record request, and according to the preset hotspot configuration table, set Determine the hotspot unit in the data record request unit;
数据列表生成模块,用于获取所述热点单元对应的变更数据信息,并将所述热点单元对应的变更数据信息同步至所述热点单元所属的热点节点,生成各个热点节点对应的待变更数据列表;The data list generating module is used to obtain the change data information corresponding to the hotspot unit, and synchronize the change data information corresponding to the hotspot unit to the hotspot node to which the hotspot unit belongs, and generate a list of data to be changed corresponding to each hotspot node ;
单元数值更新模块,用于根据所述待变更数据列表,对所述热点单元进行数值更新,并对所述热点节点中的其他非热点单元以及其他非热点节点中的其他非热点单元进行数值更新;The unit value update module is used to update the value of the hotspot unit according to the list of data to be changed, and update the values of other non-hotspot units in the hotspot node and other non-hotspot units in other non-hotspot nodes ;
数值更新处理模块,用于根据数值更新后的全部变更数据列表,对各个数据记录请求单元进行其他非数值处理操作,以批量处理所述数据记录。The value update processing module is used to perform other non-numerical processing operations on each data record request unit according to the list of all changed data after the value update to process the data records in batches.
进一步地,所述数据列表生成模块具体包括:Further, the data list generating module specifically includes:
同步列表生成单元,用于获取所述热点单元对应的变更数据信息,生成待同步数据列表;A synchronization list generating unit, configured to obtain the changed data information corresponding to the hotspot unit, and generate a list of data to be synchronized;
同步数据同步单元,用于在所述待同步数据列表中存在未同步数据时,将所述待同步数据列表中的未同步数据进行分片,并将分片后的未同步数据同步至对应的热点单元所属的热点节点,生成各个热点节点对应的待变更数据列表。The synchronized data synchronization unit is configured to divide the unsynchronized data in the to-be-synchronized data list into fragments when there is unsynchronized data in the to-be-synchronized data list, and synchronize the fragmented unsynchronized data to the corresponding The hotspot node to which the hotspot unit belongs generates a list of data to be changed corresponding to each hotspot node.
进一步地,所述数值更新处理模块具体包括:Further, the numerical value update processing module specifically includes:
单元状态获取子单元,用于根据所述待变更数据列表,依次获取所述待变更数据列表中的各个变更数据信息,并根据所述热点配置表,获取所述各个变更数据信息对应的热点单元的单元状态;The unit status obtaining subunit is used to obtain each change data information in the data list to be changed according to the data list to be changed, and obtain the hotspot unit corresponding to each change data information according to the hotspot configuration table The unit status;
单元数值更新子单元,用于根据所述各个变更数据信息以及对应的热点单元的单元状态,对所述各个变更数据信息对应的热点单元分别进行数值更新,并根据各个热点单元对应的更新后的单元数值,更新所述热点配置表中所述各个热点单元对应的单元状态。The unit value update subunit is used to update the values of the hotspot units corresponding to the respective change data information according to the respective change data information and the unit status of the corresponding hotspot unit, and to update the values according to the updated data corresponding to each hotspot unit The unit value updates the unit status corresponding to each hotspot unit in the hotspot configuration table.
进一步地,所述单元数值更新子单元还用于:Further, the unit value update subunit is also used for:
依次获取所述各个变更数据信息,作为待更新数据信息,获取所述待更新数据信息对应的热点单元,作为待更新热点单元,并获取所述待更新热点单元的单元数值状态;Acquiring each of the changed data information in sequence as the data information to be updated, acquiring the hot unit corresponding to the data information to be updated as the hot unit to be updated, and acquiring the unit value status of the hot unit to be updated;
根据所述待更新数据信息对应的待更新数值以及所述单元数值状态,判断所述待更新热点单元是否可以进行数值更新;Judging whether the hotspot unit to be updated can update the value according to the value to be updated corresponding to the data information to be updated and the value status of the unit;
若所述待更新热点单元可以进行数值更新,则对所述待更新热点单元进行加锁,将所述待更新数据信息的待更新状态修改为已更新状态,对所述待更新热点单元进行数值更新,并更新所述热点配置表中所述待更新热点单元对应的单元数值状态。If the hotspot unit to be updated can perform a value update, lock the hotspot unit to be updated, modify the pending update state of the data information to be updated to the updated state, and perform a numerical value on the hotspot unit to be updated Update and update the unit value status corresponding to the hotspot unit to be updated in the hotspot configuration table.
进一步地,所述基于区块链的数据批量处理装置还包括变更数据去重模块,所述变更数据去重模块用于:Further, the block chain-based data batch processing device further includes a modified data deduplication module, and the modified data deduplication module is used for:
获取所述待变更数据列表中的各个变更数据信息标识,并判断所述各个变更数据信息标识中是否存在重复变更数据信息标识;Acquiring each changed data information identifier in the list of data to be changed, and determining whether there is a repeated change data information identifier in each of the changed data information identifiers;
若所述各个变更数据信息标识中存在重复变更数据信息标识,则根据所述重复变更数据信息标识,对所述待变更数据列表中的各个变更数据信息进行去重处理。If there is a repeated change data information identifier in each change data information identifier, deduplication processing is performed on each change data information in the to-be-changed data list according to the repeated change data information identifier.
进一步地,所述基于区块链的数据批量处理装置还包括热点单元识别模块,所述热点单元识别模块用于:Further, the block chain-based data batch processing device further includes a hotspot unit identification module, and the hotspot unit identification module is used for:
判断所述各个数据记录请求单元是否存在所述热点单元;Judging whether the hotspot unit exists in each data recording request unit;
若所述各个数据记录请求单元中不存在所述热点单元,则根据预设通用模式同步更新所述各个数据记录请求单元对应的数值,并对所述各个数据记录请求单元进行其他非数值处理操作,以批量处理所述数据记录。If the hotspot unit does not exist in each data recording request unit, the corresponding value of each data recording request unit is synchronously updated according to the preset general mode, and other non-numerical processing operations are performed on each data recording request unit To process the data records in batches.
进一步地,所述所述基于区块链的数据批量处理装置还包括单元数值判断模块,所述单元数值判断模块用于:Further, the block chain-based data batch processing device further includes a unit value judgment module, and the unit value judgment module is configured to:
根据所述热点配置表,获取所述热点单元对应的热点单元状态,并根据所述热点单元状态,判断所述热点单元是否可以允许进行数值更新;According to the hotspot configuration table, acquiring the hotspot unit status corresponding to the hotspot unit, and judging whether the hotspot unit can allow value updating according to the hotspot unit status;
若所述热点单元允许进行数值更新,则执行:获取所述热点单元对应的变更数据信息,并将所述热点单元对应的变更数据信息同步至所述热点单元所属的热点节点,生成各个热点节点对应的待变更数据列表的步骤;If the hotspot unit allows value updating, execute: obtain the change data information corresponding to the hotspot unit, and synchronize the change data information corresponding to the hotspot unit to the hotspot node to which the hotspot unit belongs to generate each hotspot node Steps corresponding to the list of data to be changed;
若所述热点单元不允许进行数值更新,则根据所述热点单元生成交易失败的提醒消息。If the hotspot unit is not allowed to update the value, a reminder message of transaction failure is generated according to the hotspot unit.
上述各程序模块所执行的方法可参照本申请基于区块链的数据批量处理方法各个实施例,此处不再赘述。For the methods executed by the above program modules, please refer to the various embodiments of the blockchain-based data batch processing method of this application, which will not be repeated here.
本申请还提供一种计算机可读存储介质。The application also provides a computer-readable storage medium.
本申请计算机可读存储介质上存储有基于区块链的数据批量处理程序,所述基于区块链的数据批量处理程序被处理器执行时实现如上所述的基于区块链的数据批量处理方法的步骤。The computer-readable storage medium of this application stores a block chain-based data batch processing program, and the block chain-based data batch processing program is executed by a processor to realize the block chain-based data batch processing method as described above A step of.
其中,在所述处理器上运行的基于区块链的数据批量处理程序被执行时所实现的方法可参照本申请基于区块链的数据批量处理方法各个实施例,此处不再赘述。Wherein, the method implemented when the block chain-based data batch processing program running on the processor is executed can refer to the various embodiments of the block chain-based data batch processing method of this application, which will not be repeated here.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。It should be noted that in this article, the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, It also includes other elements that are not explicitly listed, or elements inherent to the process, method, article, or system. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, article or system that includes the element.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the foregoing embodiments of the present application are for description only, and do not represent the superiority of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better.的实施方式。 Based on this understanding, the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM/RAM) as described above. , Magnetic disk, optical disk), including several instructions to make a terminal device (can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the method described in each embodiment of the present application.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only preferred embodiments of this application, and do not limit the scope of this application. Any equivalent structure or equivalent process transformation made using the content of the description and drawings of this application, or directly or indirectly used in other related technical fields , The same reason is included in the scope of patent protection of this application.

Claims (15)

  1. 一种基于区块链的数据批量处理方法,其中,所述数据批量处理方法包括如下步骤:A block chain-based data batch processing method, wherein the data batch processing method includes the following steps:
    在接收到批量数据记录请求后,确定所述批量数据记录对应的多个区块链节点中的各个数据记录请求单元,并根据预设热点配置表,在所述各个数据记录请求单元中确定热点单元;After receiving the batch data recording request, determine each data recording request unit in the multiple blockchain nodes corresponding to the batch data record, and determine the hot spot in each data recording request unit according to the preset hot spot configuration table unit;
    获取所述热点单元对应的变更数据信息,并将所述热点单元对应的变更数据信息同步至所述热点单元所属的热点节点,生成各个热点节点对应的待变更数据列表;Acquiring the change data information corresponding to the hotspot unit, and synchronize the change data information corresponding to the hotspot unit to the hotspot node to which the hotspot unit belongs, and generate a list of data to be changed corresponding to each hotspot node;
    根据所述待变更数据列表,对所述热点单元进行数值更新,并对所述热点节点中的其他非热点单元以及其他非热点节点中的其他非热点单元进行数值更新;According to the list of data to be changed, update the values of the hotspot units, and update the values of other non-hotspot units in the hotspot node and other non-hotspot units in the other non-hotspot nodes;
    根据数值更新后的全部变更数据列表,对各个数据记录请求单元进行其他非数值处理操作,以批量处理所述数据记录。Perform other non-numerical processing operations on each data record request unit according to the list of all changed data after the value is updated to process the data records in batches.
  2. 如权利要求1所述的基于区块链的数据批量处理方法,其中,所述获取所述热点单元对应的变更数据信息,并将所述热点单元对应的变更数据信息同步至所述热点单元所属的热点节点,生成各个热点节点对应的待变更数据列表的步骤具体包括:The block chain-based data batch processing method according to claim 1, wherein said acquiring change data information corresponding to said hotspot unit, and synchronizing the change data information corresponding to said hotspot unit to which said hotspot unit belongs For hotspot nodes, the steps of generating a list of data to be changed corresponding to each hotspot node specifically include:
    获取所述热点单元对应的变更数据信息,生成待同步数据列表;Acquiring the changed data information corresponding to the hotspot unit, and generating a list of data to be synchronized;
    在所述待同步数据列表中存在未同步数据时,将所述待同步数据列表中的未同步数据进行分片,并将分片后的未同步数据同步至对应的热点单元所属的热点节点,生成各个热点节点对应的待变更数据列表。When there is unsynchronized data in the list of data to be synchronized, the unsynchronized data in the list of data to be synchronized is fragmented, and the fragmented unsynchronized data is synchronized to the hotspot node to which the corresponding hotspot unit belongs, Generate a list of data to be changed corresponding to each hotspot node.
  3. 如权利要求2所述的基于区块链的数据批量处理方法,其中,所述根据数值更新后的全部变更数据列表,对各个数据记录请求单元进行其他非数值处理操作,以批量处理所述数据记录的步骤具体包括:The block chain-based data batch processing method of claim 2, wherein the data record request unit performs other non-numerical processing operations on each data recording request unit according to the list of all changed data after the value is updated to process the data in batches The recorded steps specifically include:
    根据所述待变更数据列表,依次获取所述待变更数据列表中的各个变更数据信息,并根据所述热点配置表,获取所述各个变更数据信息对应的热点单元的单元状态;According to the list of data to be changed, obtain each change data information in the list of data to be changed in turn, and obtain the unit status of the hotspot unit corresponding to each change data information according to the hotspot configuration table;
    根据所述各个变更数据信息以及对应的热点单元的单元状态,对所述各个变更数据信息对应的热点单元分别进行数值更新,并根据各个热点单元对应的更新后的单元数值,更新所述热点配置表中所述各个热点单元对应的单元状态。According to each change data information and the unit status of the corresponding hotspot unit, the hotspot unit corresponding to each change data information is updated respectively, and the hotspot configuration is updated according to the updated unit value corresponding to each hotspot unit The unit status corresponding to each hotspot unit described in the table.
  4. 如权利要求3所述的基于区块链的数据批量处理方法,其中,所述根据所述各个变更数据信息以及对应的热点单元的单元状态,对所述各个变更数据信息对应的热点单元分别进行数值更新,并根据各个热点单元对应的更新后的单元数值,更新所述热点配置表中所述各个热点单元对应的单元状态的步骤具体包括:The block chain-based data batch processing method according to claim 3, wherein the hotspot units corresponding to the respective changed data information are separately performed according to the respective changed data information and the unit status of the corresponding hotspot units. The step of updating the value, and updating the unit status corresponding to each hotspot unit in the hotspot configuration table according to the updated unit value corresponding to each hotspot unit specifically includes:
    依次获取所述各个变更数据信息,作为待更新数据信息,获取所述待更新数据信息对应的热点单元,作为待更新热点单元,并获取所述待更新热点单元的单元数值状态;Acquiring each of the changed data information in sequence as the data information to be updated, acquiring the hot unit corresponding to the data information to be updated as the hot unit to be updated, and acquiring the unit value status of the hot unit to be updated;
    根据所述待更新数据信息对应的待更新数值以及所述单元数值状态,判断所述待更新热点单元是否可以进行数值更新;Judging whether the hotspot unit to be updated can update the value according to the value to be updated corresponding to the data information to be updated and the value status of the unit;
    若所述待更新热点单元可以进行数值更新,则对所述待更新热点单元进行加锁,将所述待更新数据信息的待更新状态修改为已更新状态,对所述待更新热点单元进行数值更新,并更新所述热点配置表中所述待更新热点单元对应的单元数值状态。If the hotspot unit to be updated can perform a value update, lock the hotspot unit to be updated, modify the pending update state of the data information to be updated to the updated state, and perform a numerical value on the hotspot unit to be updated Update and update the unit value status corresponding to the hotspot unit to be updated in the hotspot configuration table.
  5. 如权利要求4所述的基于区块链的数据批量处理方法,其中,所述根据所述待更新数据信息对应的待更新数值以及所述单元数值状态,判断所述待更新热点单元是否可以进行数值更新的步骤之后,还包括:The block chain-based data batch processing method according to claim 4, wherein, according to the value to be updated corresponding to the data information to be updated and the unit value status, it is determined whether the hot unit to be updated can be performed After the value update step, it also includes:
    若所述待更新热点单元不可以进行数值更新,则根据所述待更新热点单元生成对应的交易失败提醒消息。If the hot-spot unit to be updated cannot perform a value update, a corresponding transaction failure reminder message is generated according to the hot-spot unit to be updated.
  6. 如权利要求1所述的基于区块链的数据批量处理方法,其中,所述在接收到批量数据记录请求后,确定所述批量数据记录对应的多个区块链节点中的各个数据记录请求单元,并根据预设热点配置表,在所述各个数据记录请求单元中确定热点单元的步骤之后,还包括:The block chain-based data batch processing method according to claim 1, wherein, after receiving the batch data recording request, determining each data recording request of the multiple blockchain nodes corresponding to the batch data recording Unit, and according to the preset hotspot configuration table, after the step of determining the hotspot unit in each data recording request unit, the method further includes:
    判断所述各个数据记录请求单元是否存在所述热点单元;Judging whether the hotspot unit exists in each data recording request unit;
    若所述各个数据记录请求单元中不存在所述热点单元,则根据预设通用模式同步更新所述各个数据记录请求单元对应的数值,并对所述各个数据记录请求单元进行其他非数值处理操作,以批量处理所述数据记录。If the hotspot unit does not exist in each data recording request unit, the corresponding value of each data recording request unit is synchronously updated according to the preset general mode, and other non-numerical processing operations are performed on each data recording request unit To process the data records in batches.
  7. 如权利要求1所述的基于区块链的数据批量处理方法,其中,所述获取所述热点单元对应的变更数据信息,并将所述热点单元对应的变更数据信息同步至所述热点单元所属的热点节点,生成各个热点节点对应的待变更数据列表的步骤之前,还包括:The block chain-based data batch processing method according to claim 1, wherein said acquiring change data information corresponding to said hotspot unit, and synchronizing the change data information corresponding to said hotspot unit to which said hotspot unit belongs Before the step of generating a list of data to be changed corresponding to each hot node, it also includes:
    根据所述热点配置表,获取所述热点单元对应的热点单元状态,并根据所述热点单元状态,判断所述热点单元是否可以允许进行数值更新;According to the hotspot configuration table, acquiring the hotspot unit status corresponding to the hotspot unit, and judging whether the hotspot unit can allow value updating according to the hotspot unit status;
    若所述热点单元允许进行数值更新,则执行:获取所述热点单元对应的变更数据信息,并将所述热点单元对应的变更数据信息同步至所述热点单元所属的热点节点,生成各个热点节点对应的待变更数据列表的步骤;If the hotspot unit allows value updating, execute: obtain the change data information corresponding to the hotspot unit, and synchronize the change data information corresponding to the hotspot unit to the hotspot node to which the hotspot unit belongs to generate each hotspot node Steps corresponding to the list of data to be changed;
    若所述热点单元不允许进行数值更新,则根据所述热点单元生成交易失败的提醒消息。If the hotspot unit is not allowed to update the value, a reminder message of transaction failure is generated according to the hotspot unit.
  8. 如权利要1-7中任一项所述的基于区块链的数据批量处理方法,其中,所述根据所述待变更数据列表,对所述热点单元进行数值更新,并对所述热点节点中的其他非热点单元以及其他非热点节点中的其他非热点单元进行数值更新的步骤之前,还包括:The block chain-based data batch processing method according to any one of claims 1-7, wherein, according to the list of data to be changed, the hotspot unit is updated numerically, and the hotspot node Before performing the steps of updating the values of other non-hot-spot elements in other non-hot-spot nodes and other non-hot-spot elements in other non-hot-spot nodes, it also includes:
    获取所述待变更数据列表中的各个变更数据信息标识,并判断所述各个变更数据信息标识中是否存在重复变更数据信息标识;Acquiring each changed data information identifier in the list of data to be changed, and determining whether there is a repeated change data information identifier in each of the changed data information identifiers;
    若所述各个变更数据信息标识中存在重复变更数据信息标识,则根据所述重复变更数据信息标识,对所述待变更数据列表中的各个变更数据信息进行去重处理。If there is a repeated change data information identifier in each change data information identifier, deduplication processing is performed on each change data information in the to-be-changed data list according to the repeated change data information identifier.
  9. 一种基于区块链的数据批量处理装置,其中,所述基于区块链的数据批量处理装置包括:A block chain-based data batch processing device, wherein the block chain-based data batch processing device includes:
    热点单元确定模块,用于在接收到批量数据记录请求后,确定所述批量数据记录对应的多个区块链节点中的各个数据记录请求单元,并根据预设热点配置表,在所述各个数据记录请求单元中确定热点单元;The hotspot unit determination module is used to determine each data record request unit of the multiple blockchain nodes corresponding to the batch data record after receiving the batch data record request, and according to the preset hotspot configuration table, set Determine the hotspot unit in the data record request unit;
    数据列表生成模块,用于获取所述热点单元对应的变更数据信息,并将所述热点单元对应的变更数据信息同步至所述热点单元所属的热点节点,生成各个热点节点对应的待变更数据列表;The data list generating module is used to obtain the change data information corresponding to the hotspot unit, and synchronize the change data information corresponding to the hotspot unit to the hotspot node to which the hotspot unit belongs, and generate a list of data to be changed corresponding to each hotspot node ;
    单元数值更新模块,用于根据所述待变更数据列表,对所述热点单元进行数值更新,并对所述热点节点中的其他非热点单元以及其他非热点节点中的其他非热点单元进行数值更新;The unit value update module is used to update the value of the hotspot unit according to the list of data to be changed, and update the values of other non-hotspot units in the hotspot node and other non-hotspot units in other non-hotspot nodes ;
    数值更新处理模块,用于根据数值更新后的全部变更数据列表,对各个数据记录请求单元进行其他非数值处理操作,以批量处理所述数据记录。The value update processing module is used to perform other non-numerical processing operations on each data record request unit according to the list of all changed data after the value update to process the data records in batches.
  10. 如权利要求9所述的基于区块链的数据批量处理装置,其中,所述数据列表生成模块具体包括:9. The block chain-based data batch processing device of claim 9, wherein the data list generating module specifically includes:
    同步列表生成单元,用于获取所述热点单元对应的变更数据信息,生成待同步数据列表;A synchronization list generating unit, configured to obtain the changed data information corresponding to the hotspot unit, and generate a list of data to be synchronized;
    同步数据同步单元,用于在所述待同步数据列表中存在未同步数据时,将所述待同步数据列表中的未同步数据进行分片,并将分片后的未同步数据同步至对应的热点单元所属的热点节点,生成各个热点节点对应的待变更数据列表。The synchronized data synchronization unit is configured to divide the unsynchronized data in the to-be-synchronized data list into fragments when there is unsynchronized data in the to-be-synchronized data list, and synchronize the fragmented unsynchronized data to the corresponding The hotspot node to which the hotspot unit belongs generates a list of data to be changed corresponding to each hotspot node.
  11. 如权利要求10所述的基于区块链的数据批量处理装置,其中,所述数值更新处理模块具体包括:The block chain-based data batch processing device according to claim 10, wherein the value update processing module specifically comprises:
    单元状态获取子单元,用于根据所述待变更数据列表,依次获取所述待变更数据列表中的各个变更数据信息,并根据所述热点配置表,获取所述各个变更数据信息对应的热点单元的单元状态;The unit status obtaining subunit is used to obtain each change data information in the data list to be changed according to the data list to be changed, and obtain the hotspot unit corresponding to each change data information according to the hotspot configuration table The unit status;
    单元数值更新子单元,用于根据所述各个变更数据信息以及对应的热点单元的单元状态,对所述各个变更数据信息对应的热点单元分别进行数值更新,并根据各个热点单元对应的更新后的单元数值,更新所述热点配置表中所述各个热点单元对应的单元状态。The unit value update subunit is used to update the values of the hotspot units corresponding to the respective change data information according to the respective change data information and the unit status of the corresponding hotspot unit, and to update the values according to the updated data corresponding to each hotspot unit The unit value updates the unit status corresponding to each hotspot unit in the hotspot configuration table.
  12. 如权利要求11所述的基于区块链的数据批量处理装置,其中,所述单元数值更新子单元还用于:The block chain-based data batch processing device according to claim 11, wherein the unit value update subunit is further used for:
    依次获取所述各个变更数据信息,作为待更新数据信息,获取所述待更新数据信息对应的热点单元,作为待更新热点单元,并获取所述待更新热点单元的单元数值状态;Acquiring each of the changed data information in sequence as the data information to be updated, acquiring the hot unit corresponding to the data information to be updated as the hot unit to be updated, and acquiring the unit value status of the hot unit to be updated;
    根据所述待更新数据信息对应的待更新数值以及所述单元数值状态,判断所述待更新热点单元是否可以进行数值更新;Judging whether the hotspot unit to be updated can update the value according to the value to be updated corresponding to the data information to be updated and the value status of the unit;
    若所述待更新热点单元可以进行数值更新,则对所述待更新热点单元进行加锁,将所述待更新数据信息的待更新状态修改为已更新状态,对所述待更新热点单元进行数值更新,并更新所述热点配置表中所述待更新热点单元对应的单元数值状态。If the hotspot unit to be updated can perform a value update, lock the hotspot unit to be updated, modify the pending update state of the data information to be updated to the updated state, and perform a numerical value on the hotspot unit to be updated Update and update the unit value status corresponding to the hotspot unit to be updated in the hotspot configuration table.
  13. 如权利要求9-12中任一项所述的基于区块链的数据批量处理装置,其中,所述基于区块链的数据批量处理装置还包括变更数据去重模块,所述变更数据去重模块用于:The block chain-based data batch processing device according to any one of claims 9-12, wherein the block chain-based data batch processing device further comprises a modification data deduplication module, and the modification data deduplication module Modules are used for:
    获取所述待变更数据列表中的各个变更数据信息标识,并判断所述各个变更数据信息标识中是否存在重复变更数据信息标识;Acquiring each changed data information identifier in the list of data to be changed, and determining whether there is a repeated change data information identifier in each of the changed data information identifiers;
    若所述各个变更数据信息标识中存在重复变更数据信息标识,则根据所述重复变更数据信息标识,对所述待变更数据列表中的各个变更数据信息进行去重处理。If there is a repeated change data information identifier in each change data information identifier, deduplication processing is performed on each change data information in the to-be-changed data list according to the repeated change data information identifier.
  14. 一种基于区块链的数据批量处理设备,其中,所述基于区块链的数据批量处理设备包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的基于区块链的数据批量处理程序,所述基于区块链的数据批量处理程序被所述处理器执行时实现如权利要求1至8中任一项所述的基于区块链的数据批量处理方法的步骤。A block chain-based data batch processing device, wherein the block chain-based data batch processing device includes: a memory, a processor, and a block-based data processing device stored on the memory and capable of running on the processor. Blockchain-based data batch processing program, when the blockchain-based data batch processing program is executed by the processor, realizes the blockchain-based data batch processing method according to any one of claims 1 to 8 step.
  15. 一种计算机可读存储介质,其中,所述计算机可读存储介质上存储有基于区块链的数据批量处理程序,所述基于区块链的数据批量处理程序被处理器执行时实现如权利要求1至8中任一项所述的基于区块链的数据批量处理方法的步骤。A computer-readable storage medium, wherein a blockchain-based data batch processing program is stored on the computer-readable storage medium, and the blockchain-based data batch processing program is executed by a processor as claimed Steps of the block chain-based data batch processing method described in any one of 1 to 8.
PCT/CN2020/100382 2019-07-12 2020-07-06 Blockchain-based batch data processing method, apparatus, and storage medium WO2021008400A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910633067.1A CN110363663B (en) 2019-07-12 2019-07-12 Block chain-based data batch processing method, device, equipment and storage medium
CN201910633067.1 2019-07-12

Publications (1)

Publication Number Publication Date
WO2021008400A1 true WO2021008400A1 (en) 2021-01-21

Family

ID=68219354

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/100382 WO2021008400A1 (en) 2019-07-12 2020-07-06 Blockchain-based batch data processing method, apparatus, and storage medium

Country Status (2)

Country Link
CN (1) CN110363663B (en)
WO (1) WO2021008400A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113034254A (en) * 2021-03-19 2021-06-25 北京字跳网络技术有限公司 Data processing method and device and electronic equipment

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110363663B (en) * 2019-07-12 2023-08-22 深圳前海微众银行股份有限公司 Block chain-based data batch processing method, device, equipment and storage medium
CN111211876B (en) * 2020-01-02 2021-10-12 支付宝(杭州)信息技术有限公司 Method and device for sending response message aiming at data request and block chain system
CN111984733A (en) * 2020-09-03 2020-11-24 深圳壹账通智能科技有限公司 Data transmission method and device based on block chain and storage medium
CN112487010B (en) * 2020-12-14 2024-02-23 深圳前海微众银行股份有限公司 Block chain user data table updating method, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107358420A (en) * 2017-06-09 2017-11-17 北京博晨技术有限公司 Method for realizing the block catenary system of focus account and realizing focus account
US20180054491A1 (en) * 2016-08-19 2018-02-22 Ca, Inc. Maintaining distributed state among stateless service clients
CN108492183A (en) * 2018-03-29 2018-09-04 深圳前海微众银行股份有限公司 Account trading method, system and the computer readable storage medium of block chain
CN109040029A (en) * 2018-07-13 2018-12-18 上海点融信息科技有限责任公司 The method and apparatus of affairs are executed in block chain
CN110363663A (en) * 2019-07-12 2019-10-22 深圳前海微众银行股份有限公司 Batch data processing method, device, equipment and storage medium based on block chain

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170132625A1 (en) * 2015-11-05 2017-05-11 Mastercard International Incorporated Method and system for use of a blockchain in a transaction processing network
CN108566420A (en) * 2018-03-29 2018-09-21 上海点融信息科技有限责任公司 Data processing method, equipment and computer readable storage medium for block chain
CN109446208A (en) * 2018-09-03 2019-03-08 深圳壹账通智能科技有限公司 A kind of date storage method, computer readable storage medium and server
CN109274752A (en) * 2018-10-10 2019-01-25 腾讯科技(深圳)有限公司 The access method and device, electronic equipment, storage medium of block chain data

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180054491A1 (en) * 2016-08-19 2018-02-22 Ca, Inc. Maintaining distributed state among stateless service clients
CN107358420A (en) * 2017-06-09 2017-11-17 北京博晨技术有限公司 Method for realizing the block catenary system of focus account and realizing focus account
CN108492183A (en) * 2018-03-29 2018-09-04 深圳前海微众银行股份有限公司 Account trading method, system and the computer readable storage medium of block chain
CN109040029A (en) * 2018-07-13 2018-12-18 上海点融信息科技有限责任公司 The method and apparatus of affairs are executed in block chain
CN110363663A (en) * 2019-07-12 2019-10-22 深圳前海微众银行股份有限公司 Batch data processing method, device, equipment and storage medium based on block chain

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113034254A (en) * 2021-03-19 2021-06-25 北京字跳网络技术有限公司 Data processing method and device and electronic equipment
CN113034254B (en) * 2021-03-19 2024-05-14 北京字跳网络技术有限公司 Data processing method and device and electronic equipment

Also Published As

Publication number Publication date
CN110363663A (en) 2019-10-22
CN110363663B (en) 2023-08-22

Similar Documents

Publication Publication Date Title
WO2021008400A1 (en) Blockchain-based batch data processing method, apparatus, and storage medium
TWI679874B (en) Cross-blockchain authentication method and device, and electronic equipment
US10733176B2 (en) Detecting phantom items in distributed replicated database
US11902450B2 (en) Blockchain generation method and system, and related device
TW201943250A (en) Cross-blockchain authentication method and apparatus, and electronic device
CN108470298B (en) Method, device and system for transferring resource numerical value
WO2020134895A1 (en) Blockchain-based accounting method and apparatus, and electronic device
TW201935383A (en) Asset management method and apparatus, and electronic device
TW201935384A (en) Asset management method and device, and electronic equipment
TW201935375A (en) Asset management method and apparatus, and electronic device
WO2019097322A1 (en) Optimization of high volume transaction performance on a blockchain
CN110569309A (en) Apparatus, method, system, and medium for implementing blockchains
CN107464151B (en) Order data processing method and device for high-concurrency service
EP3905172A1 (en) Blockchain-based invoice voiding method and apparatus, and electronic device
CN112075062A (en) Automated commit transaction management in blockchain networks
WO2023045617A1 (en) Transaction data processing method and apparatus, device and medium
CN108319617A (en) Determine the method, apparatus and method for handover control, device of database principal and subordinate's difference
WO2020088072A1 (en) Failover data processing method, apparatus, and system
TWI736608B (en) Method and device for facilitating expansion of payment subject
WO2023207529A1 (en) Data processing method and apparatus, device, medium, and product
KR20190086301A (en) System and method for distributed database using block chain
US20230259930A1 (en) Cross-chain transaction processing method and apparatus, electronic device, and storage medium
JP7460348B2 (en) Transaction processing system and method enabling blockchain expansion
US11881996B2 (en) Input and output for target device communication
CN107066315B (en) Service calling method and device

Legal Events

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

Ref document number: 20840163

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20840163

Country of ref document: EP

Kind code of ref document: A1