WO2020233352A1 - 区块链数据入链方法、装置、计算机设备和存储介质 - Google Patents
区块链数据入链方法、装置、计算机设备和存储介质 Download PDFInfo
- Publication number
- WO2020233352A1 WO2020233352A1 PCT/CN2020/087147 CN2020087147W WO2020233352A1 WO 2020233352 A1 WO2020233352 A1 WO 2020233352A1 CN 2020087147 W CN2020087147 W CN 2020087147W WO 2020233352 A1 WO2020233352 A1 WO 2020233352A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- blockchain
- identifier
- distributed processing
- block chain
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
- G06F16/2365—Ensuring data consistency and integrity
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
Definitions
- This application relates to the technical field of blockchain databases, and in particular to a method, device, computer equipment and storage medium for entering blockchain data into the chain.
- the database and the blockchain perform different processing procedures when the data is processed abnormally, which easily leads to inconsistencies between the data in the database and the data in the blockchain.
- a blockchain data entry method includes:
- the process data corresponding to the current distributed processing recorded in the database is stored in the blockchain.
- a block chain data entry device which includes:
- the receiving module is used to receive data processing requests
- the extraction module is used to extract the data identification and data processing type in the data processing request
- the query module is used to query the blockchain storage identifier corresponding to the data identifier from the database;
- the obtaining module is used to obtain block chain data from the corresponding block chain according to the block chain storage identifier
- the recording module is used to perform distributed processing on the obtained blockchain data according to the data processing type, and record the process data generated by the distributed processing in the database;
- the delete module is used to delete the process data corresponding to the abnormal distributed processing process when the distributed processing is abnormal;
- the storage module is used to store the process data corresponding to the current distributed processing process recorded in the database in the blockchain when the distributed processing is completed.
- a computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
- the process data corresponding to the current distributed processing recorded in the database is stored in the blockchain.
- the computer program is executed by a processor, the following steps are implemented:
- the process data corresponding to the current distributed processing recorded in the database is stored in the blockchain.
- the above-mentioned blockchain entry method, device, computer equipment and storage medium perform distributed processing of business data according to data processing requests.
- the database will simultaneously record the distributed processing data; when the distributed processing is in progress
- the database automatically deletes the data corresponding to the data processing exception and rolls back to the data storage state before the distributed processing process; when the distributed processing is completed, the processing data corresponding to each distributed processing task is stored in the area
- the block chain can ensure the consistency of the data in the database and the block chain.
- Fig. 1 is an application scenario diagram of the blockchain data entry method in an embodiment
- FIG. 2 is a schematic flowchart of a method for entering blockchain data into a chain in an embodiment
- FIG. 3 is a schematic diagram of the flow of blockchain data entering the chain in another embodiment
- FIG. 4 is a schematic flowchart of the step of querying the blockchain storage identifier corresponding to the data identifier from the database in an embodiment
- FIG. 5 is a schematic flowchart of the steps of obtaining blockchain data from the corresponding blockchain according to the blockchain storage identifier in an embodiment
- FIG. 6 is a flow diagram of the steps of performing distributed processing on the obtained blockchain data according to the data processing type in an embodiment, and recording the process data generated by the distributed processing into the database;
- FIG. 7 is a flow diagram of the steps of storing the process data corresponding to the current distributed processing process recorded in the database in the blockchain when the distributed processing is completed in an embodiment
- Figure 8 is a block diagram of a block chain data entry device in an embodiment
- FIG. 9 is a block diagram of a block chain data entry device in another embodiment.
- Figure 10 is a structural block diagram of a query module in an embodiment
- Figure 11 is a structural block diagram of an acquisition module in an embodiment
- Figure 12 is a structural block diagram of a recording module in an embodiment
- Figure 13 is a structural block diagram of a storage module in an embodiment
- Fig. 14 is an internal structure diagram of a computer device in an embodiment.
- the blockchain data entry method provided in this application can be applied to the application environment as shown in Figure 1.
- the terminal 102 communicates with the distributed server 104 through the network through the network.
- the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablets, and portable wearable devices.
- the distributed server 104 can be an independent distributed server or a distributed server composed of multiple distributed servers. Server cluster to achieve.
- the terminal 102 detects that the data processing button in the business processing page is clicked, it obtains the data identification and data processing type selected in the business processing page, generates a data processing request according to the data identification and data processing type, and sends the data processing request To the distributed server 104.
- the distributed server 104 After the distributed server 104 receives the data processing request, it extracts the data identification and data processing type in the data processing request, queries the database for the blockchain storage identification corresponding to the data identification, and obtains it from the corresponding blockchain according to the blockchain storage identification Blockchain data, according to the type of data processing, perform distributed processing on the acquired blockchain data, record the process data generated by distributed processing in the database, when the distributed processing is abnormal, delete the abnormal distributed processing process Process data, when the distributed processing is completed, the process data corresponding to the current distributed processing process recorded in the database is stored in the blockchain.
- a method for blockchain entry is provided. Taking the method applied to the distributed server in FIG. 1 as an example, the method includes the following steps:
- Step 202 Receive a data processing request.
- the data processing request is a request for processing the data to be processed.
- the terminal detects that the data processing button in the business processing page is clicked, it obtains the data identification and data processing type selected in the business processing page, generates a data processing request according to the data identification and data processing type, and sends the data processing request to Distributed server.
- the distributed server receives the data processing request sent by the terminal.
- the data identifier is used to indicate the identifier of the data to be processed.
- the data processing type is used to identify the processing type for processing the data.
- Step 204 Extract the data identifier and data processing type in the data processing request.
- the data identifier is used to indicate the identifier of the data to be processed
- the data processing type is used to identify the processing type for processing the data.
- the distributed server may analyze the data processing request, and extract the data identification and data processing type in the data processing request through the analysis.
- Step 206 Query the blockchain storage identifier corresponding to the data identifier from the database.
- the blockchain storage identifier is used to identify the location where the data is stored in the blockchain.
- Blockchain is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, etc. It is essentially a decentralized database.
- the database is a data collection, and the database stores a blockchain storage identifier corresponding to the data identifier, that is, a data blockchain identifier mapping relationship table formed by pre-stored data identifiers and corresponding blockchain storage identifiers in the database.
- the distributed server queries the database for the extracted data identifier, and obtains the blockchain storage identifier corresponding to the extracted data identifier.
- Step 208 Obtain block chain data from the corresponding block chain according to the block chain storage identifier.
- the block chain data refers to the data related to the block corresponding to the block chain storage identifier.
- the distributed server determines the block in the blockchain according to the blockchain storage identifier, extracts the block data corresponding to the blockchain storage identifier from the determined block, and decrypts the block data. Obtain the blockchain data corresponding to the blockchain storage identifier.
- Step 210 Perform distributed processing on the obtained blockchain data according to the data processing type, and record the process data generated by the distributed processing in the database.
- distributed processing is a computer that connects multiple computers with different locations, or with different functions, or with different data through a communication network, and under the unified management and control of the control system, computers that coordinately complete large-scale information processing tasks system. To put it simply, multiple connected computers each undertake different parts of the same task, run at the same time, and jointly complete the same task.
- the distributed server creates distributed processing tasks based on the acquired data according to the data processing types, distributes and executes the distributed processing tasks, and obtains distributed processing process data. Further, when the distributed server performs distributed tasks, it writes the process data generated by distributed processing into the database in real time at the same time, and the database records the process data generated by each distributed processing.
- Step 212 When the distributed processing is abnormal, the process data corresponding to the abnormal distributed processing is deleted.
- the distributed processing exception refers to an abnormal situation in the distributed processing. Specifically, when an abnormality occurs when the distributed server executes a distributed task, it determines all the process data corresponding to the current data processing, deletes the determined process data, and keeps the stored data before the current data processing.
- the corresponding data stored in the database includes A1 and B2.
- A1 and B1 need to be updated respectively to A2 And B2
- A2 and B2 are correspondingly stored in the database.
- the third task is executed, the data A2 and B2 need to be updated to A3 and B3, but the third task is executed When an exception occurs, the third task failed to execute successfully, only A3 was updated, and B3 failed to update successfully.
- the corresponding process data (including A3) of the third task in the database is determined, delete A3 from the database and return Roll to the data storage state before the third task is not executed, that is, the data corresponding to the first task and the second task are stored in the database to achieve data rollback. Further, when all tasks are executed, the corresponding data in the database is stored in the blockchain, thereby ensuring that the data in the blockchain is consistent with the data in the database, and there is no junk data.
- Step 214 When the distributed processing is completed, the process data corresponding to the current distributed processing recorded in the database is stored in the blockchain.
- the distributed server determines all the process data corresponding to the current data processing, the distributed server stores the determined process data in the blockchain, and obtains the block identification of the stored process data in the blockchain, The block identifier is recorded in the database as the block storage identifier.
- the business data is distributed processing according to the data processing request.
- the database will simultaneously record the distributed processing data; when the data processing abnormality occurs during the distributed processing, the database The data corresponding to the abnormal data processing will be automatically deleted and rolled back to the data storage state before the distributed processing; when the distributed processing is completed, the processing data corresponding to each distributed processing task will be stored on the blockchain to ensure that the database and The consistency of data in the blockchain.
- Step 302 Generate a data processing notification according to the data processing result.
- the distributed server after the distributed server stores the process data corresponding to the distributed processing process in the block, it can also push the data processing notification to the terminal where the customer account is logged in.
- the data processing notification is a notification used to notify the terminal that the customer account logs in.
- a data processing notification can be generated based on the data processing result, that is, the data processing notification includes the data processing result.
- Step 304 Determine the customer account corresponding to the current data processing process, and push the data processing notification to the terminal logged in with the customer account.
- the customer account corresponding to the current data processing process is determined, and after the determination, the data processing notification is pushed to the terminal logged in with the customer account.
- the distributed server receives the transfer request sent by the terminal logged in by the customer account, extracts the transfer request, the transfer request, and the transfer amount, and first queries the block chain corresponding to the transfer client account and transfer client account.
- the balance information is modified according to the transfer amount from the balance information of the transferred customer account and written to the database at the same time.
- the balance information transferred to the customer account is modified according to the transfer amount and written into the database at the same time.
- the distributed server determines the process data corresponding to the transfer request in the database (including the transfer data from the customer account and the transfer data from the customer account), and the process data corresponding to the determined transfer Delete from the database, that is, roll back to the data storage state when the transfer is not performed, without the need to process data into the chain, to avoid storing too much useless data in the blockchain; when the balance information transferred to the customer account is successfully modified, it is completed
- the distributed server determines the process data corresponding to the transfer request (including the modified balance information, the balance information corresponding to the transferred-out customer account and the balance information corresponding to the transferred-in customer account), and performs the process data corresponding to the determined transfer request
- the operation of data entering the chain and storing it in the block chain ensures that the data stored in the block chain is the completed data of the processing process, reducing the dirty data in the block chain.
- the data processing process of the customer transfer business is a distributed processing
- extracting the data identification and data processing type in the data processing request includes: parsing the data processing request, and extracting the data identification and data processing type in the data processing request through the analysis.
- the distributed server when the distributed server receives a data processing request, since the data processing request carries the data identification and data processing type, in order to obtain the data identification and data processing type in the data processing request, the data processing request needs to be parsed and passed Analyze and extract the data identification and data processing type in the data processing request.
- querying the blockchain storage identifier corresponding to the data identifier from the database includes:
- Step 402 Obtain a preset data blockchain identifier mapping relationship table.
- the preset data blockchain identifier mapping relationship table includes a mapping relationship between a data identifier and a corresponding blockchain storage identifier.
- the preset data blockchain identifier mapping relationship table is a relationship table formed by pre-stored data identifiers and corresponding blockchain storage identifiers in the database.
- the data identifiers and corresponding Blockchain storage identification is a one-to-one mapping relationship.
- the distributed server queries the database for the blockchain storage identifier corresponding to the data identifier in the data processing request, and preferably needs to obtain the preset data blockchain identifier mapping relationship table pre-stored in the database, according to the preset data block
- the chain identifier mapping relationship table includes the mapping relationship between the data identifier and the corresponding blockchain storage identifier to query the blockchain storage identifier that matches the data identifier in the data request.
- Step 404 Query the preset data blockchain identifier mapping relationship table according to the data identifier to obtain the corresponding blockchain storage identifier.
- the matching blockchain storage identifier is obtained by querying the preset data blockchain identifier mapping relationship table according to the data identifier. Specifically, it can firstly search for the target data identifier matching the data identifier in the data request from the preset data blockchain identifier mapping relationship table, and then transfer the area corresponding to the target data identifier in the preset data blockchain identifier mapping relationship table.
- the block chain storage identification is determined as the block chain storage identification matching the data request.
- obtaining blockchain data from the corresponding blockchain according to the blockchain storage identifier includes:
- Step 502 Determine the corresponding target block in the blockchain according to the storage identifier of the blockchain.
- the target block refers to the block stored in the block chain and the block chain, and the block is the basic unit of the block chain. Specifically, after querying the blockchain storage identifier corresponding to the data identifier from the database, the corresponding target block is found from the blockchain according to the blockchain storage identifier.
- Step 504 Extract target block data corresponding to the blockchain storage identifier from the target block.
- the blocks in the blockchain store the corresponding block data
- the target block needs to be extracted to obtain the target area.
- the target block data corresponding to the blockchain storage identifier in the block.
- step 506 the target block data is decrypted, and the block chain storage identifier is obtained through the decryption result to obtain the block chain data from the corresponding block chain.
- decrypting the target block data may be decrypting the target block data through a blockchain decryption algorithm.
- blockchain encryption algorithms include but are not limited to symmetric encryption algorithms, asymmetric encryption algorithms, and hash encryption algorithms
- blockchain decryption algorithms include, but are not limited to, decryption algorithms corresponding to symmetric encryption algorithms and asymmetric encryption algorithms.
- the decryption result is used to obtain the blockchain storage identifier to obtain the blockchain data from the corresponding blockchain.
- distributed processing is performed on the obtained blockchain data according to the data processing type, and the process data generated by the distributed processing is recorded in the database, including:
- Step 602 Create a distributed processing task based on the acquired blockchain data according to the data processing type.
- step 604 the distributed processing tasks are allocated and executed to obtain process data generated by the distributed processing.
- Step 606 Write the process data generated by the distributed processing into the database in real time.
- distributed processing is to make multiple connected computers each undertake different parts of the same task, run at the same time, and jointly complete the same task.
- a distributed processing task is created for the obtained blockchain data.
- different distributed processing tasks can be created for different types of data processing types.
- the distributed processing task is Tasks that the distributed processing server needs to perform.
- the distributed server allocates and commands according to the distributed processing task, and the distributed server generates corresponding process data when executing the distributed processing task.
- the process data here is the data generated during the execution of distributed processing tasks.
- the distributed server needs to write the process data generated by the distributed processing into the database in real time for storage.
- the process data corresponding to the current distributed processing recorded in the database is stored in the blockchain, including:
- Step 702 When the distributed processing is completed, determine current process data corresponding to the current distributed processing process.
- Step 704 Store the current process data in the blockchain, and obtain the current block identifier for storing the current process data in the blockchain.
- Step 706 Record the current block identifier as the blockchain storage identifier in the database.
- the distributed server has processed the corresponding distributed processing task
- the current process data generated by the current distributed processing process is determined, and the current process data generated by the current distributed processing process is obtained.
- the acquired current process data is stored in the blockchain, and specifically, the acquired current process data may be written into the blockchain. Since the block chain stores the block identification corresponding to each process data, the current block identification corresponding to the current process data stored in the block chain is obtained. The block identifier is used to identify the block of stored process data.
- the current block identifier of the acquired current process data is recorded in the database as the blockchain storage identifier.
- steps in the above flowchart are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless specifically stated in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the above flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The order of execution is not necessarily performed sequentially, but may be performed alternately or alternately with other steps or at least a part of sub-steps or stages of other steps.
- a block chain data entry device 800 which includes: a receiving module 802, an extraction module 804, a query module 806, an acquisition module 808, a recording module 810, and a deletion module 812 And storage module 814, where:
- the receiving module 802 is used to receive data processing requests.
- the extraction module 804 is used to extract the data identification and data processing type in the data processing request.
- the query module 806 is used to query the blockchain storage identifier corresponding to the data identifier from the database.
- the obtaining module 808 is used to obtain block chain data from the corresponding block chain according to the block chain storage identifier.
- the recording module 810 is configured to perform distributed processing on the acquired blockchain data according to the data processing type, and record the process data generated by the distributed processing in the database.
- the deleting module 812 is used to delete the process data corresponding to the abnormal distributed processing process when the distributed processing is abnormal.
- the storage module 814 is configured to store the process data corresponding to the current distributed processing process recorded in the database in the blockchain when the distributed processing is completed.
- the blockchain data entry device 800 further includes: a generating module 816 and a notification module 818, wherein:
- the generating module 816 is configured to generate a data processing notification according to the data processing result.
- the notification module 818 is used to determine the customer account corresponding to the current data processing process, and push the data processing notification to the terminal logged in with the customer account.
- the extraction module 804 is further configured to analyze the data processing request, and extract the data identification and data processing type in the data processing request through the analysis.
- the query module 806 includes:
- the obtaining unit 806a is configured to obtain a preset data blockchain identifier mapping relationship table, and the preset data blockchain identifier mapping relationship table includes a mapping relationship between a data identifier and a corresponding blockchain storage identifier.
- the query unit 806b is configured to query the preset data blockchain identifier mapping relationship table according to the data identifier to obtain the corresponding blockchain storage identifier.
- the acquiring module 808 includes:
- the target block determining unit 808a is configured to determine the corresponding target block in the blockchain according to the storage identifier of the blockchain.
- the target block data extraction unit 808b is configured to extract target block data corresponding to the blockchain storage identifier from the target block.
- the decryption unit 808c is used to decrypt the target block data, and obtain the block chain storage identifier through the decryption result to obtain the block chain data from the corresponding block chain.
- the recording module 810 includes:
- the creating unit 810a is configured to create a distributed processing task according to the data processing type according to the obtained blockchain data.
- the execution unit 810b is configured to allocate and execute distributed processing tasks to obtain process data generated by distributed processing.
- the writing unit 810c is used to write the process data generated by the distributed processing into the database in real time.
- the storage module 814 includes:
- the processing unit 814a is configured to determine the current process data corresponding to the current distributed processing process when the distributed processing is completed.
- the storage unit 814b is configured to store the current process data in the blockchain, and obtain the current block identifier for storing the current process data in the blockchain.
- the recording unit 814c is used to record the current block identifier as the blockchain storage identifier in the database.
- the various modules in the above-mentioned blockchain data entry device can be implemented in whole or in part by software, hardware, and combinations thereof.
- the foregoing modules may be embedded in the form of hardware or independent of the processor in the computer device, or may be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the foregoing modules.
- a computer device is provided.
- the computer device may be a server, and its internal structure diagram may be as shown in FIG. 10.
- the computer equipment includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide calculation and control capabilities.
- the memory of the computer device includes a non-volatile storage medium and an internal memory.
- the non-volatile storage medium stores an operating system, a computer program, and a database.
- the internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium.
- the database of the computer equipment is used to store blockchain data.
- the network interface of the computer device is used to communicate with an external terminal through a network connection.
- the computer program is executed by the processor to realize a blockchain data entry method.
- FIG. 10 is only a block diagram of part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied.
- the specific computer device may Including more or fewer parts than shown in the figure, or combining some parts, or having a different arrangement of parts.
- a computer device including a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the blockchain data entry method.
- the steps of the blockchain data entry method may be the steps in the blockchain data entry method of each of the above embodiments.
- the steps include 202, receiving a data processing request; 204, extracting the data identifier and data processing type in the data processing request; 206, querying the blockchain storage identifier corresponding to the data identifier from the database; 208, according to the The block chain storage identifier obtains block chain data from the corresponding block chain; 210.
- a computer-readable storage medium which stores a computer program.
- the processor causes the processor to execute the steps of the blockchain data entry method.
- the steps of the blockchain data entry method may be the steps in the blockchain data entry method of the above embodiments.
- the steps include 202, receiving a data processing request; 204, extracting the data identifier and data processing type in the data processing request; 206, querying the blockchain storage identifier corresponding to the data identifier from the database; 208, according to the The block chain storage identifier obtains block chain data from the corresponding block chain; 210. Distribute the obtained block chain data according to the data processing type, and record the process data generated by the distributed processing In the database; 212. When the distributed processing is abnormal, delete the process data corresponding to the abnormal distributed processing process; 214. When the distributed processing is completed, the current distributed processing process recorded in the database The corresponding process data is stored in the blockchain.
- Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
- Volatile memory may include random access memory (RAM) or external cache memory.
- RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Computer Security & Cryptography (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本申请涉及区块链技术领域,提供了一种区块链数据入链方法、装置、计算机设备和存储介质。该方法包括:接收数据处理请求;提取数据处理请求中数据标识和数据处理类型;从数据库中查询数据标识对应的区块链存储标识;根据区块链存储标识从对应的区块链获取区块链数据;按照数据处理类型对获取到的区块链数据进行分布式处理,记录分布式处理产生的过程数据到数据库中;当分布式处理异常时,则删除异常分布式处理过程对应的过程数据;当分布式处理完毕时,将数据库中记录的当前分布式处理过程对应的过程数据存储至区块链中。采用本方法能够保证数据库与区块链中数据的一致性。
Description
本申请于2019年5月22日提交中国专利局、申请号为201910427167.9,发明名称为“区块链数据入链方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉区块链数据库技术领域,特别是涉及一种区块链数据入链方法、装置、计算机设备和存储介质。
随着数据处理技术的发展,出现了区块链技术,区块链的存储数据安全性,使得区块链技术被应用在各种业务数据的处理上。在业务数据的处理过程中,需要对数据进行操作,将操作数据存储到区块链。
然而,发明人发现,在业务数据的处理过程中,需要同时依赖于数据库和区块链来对数据进行处理,需要保证数据库与区块链中数据的一致性。但是,当发生数据处理异常时,数据库和区块链对数据处理异常时执行的处理过程不同,容易导致数据库中的数据与区块链中的数据不一致。
发明内容
基于此,有必要针对上述技术问题,提供一种区块链数据入链方法、装置、计算机设备和存储介质,当发生数据处理异常时,数据库和区块链对数据处理异常时执行的处理过程不同,能够保证数据库与区块链中数据的一致性。
一种区块链数据入链方法,该方法包括:
接收数据处理请求;
提取数据处理请求中数据标识和数据处理类型;
从数据库中查询数据标识对应的区块链存储标识;
根据区块链存储标识从对应的区块链获取区块链数据;
按照数据处理类型对获取到的区块链数据进行分布式处理,记录分布式处理产生的过程数据到数据库中;
当分布式处理异常时,则删除异常分布式处理过程对应的过程数据;
当分布式处理完毕时,将数据库中记录的当前分布式处理过程对应的过程数据存储至区块链中。
一种区块链数据入链装置,该装置包括:
接收模块,用于接收数据处理请求;
提取模块,用于提取数据处理请求中数据标识和数据处理类型;
查询模块,用于从数据库中查询数据标识对应的区块链存储标识;
获取模块,用于根据区块链存储标识从对应的区块链获取区块链数据;
记录模块,用于按照数据处理类型对获取到的区块链数据进行分布式处理,记录分布式处理产生的过程数据到数据库中;
删除模块,用于当分布式处理异常时,则删除异常分布式处理过程对应的过程数据;
存储模块,用于当分布式处理完毕时,将数据库中记录的当前分布式处理过程对应的过程数据存储至区块链中。
一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现以下步骤:
接收数据处理请求;
提取数据处理请求中数据标识和数据处理类型;
从数据库中查询数据标识对应的区块链存储标识;
根据区块链存储标识从对应的区块链获取区块链数据;
按照数据处理类型对获取到的区块链数据进行分布式处理,记录分布式处理产生的过程数据到数据库中;
当分布式处理异常时,则删除异常分布式处理过程对应的过程数据;
当分布式处理完毕时,将数据库中记录的当前分布式处理过程对应的过程数据存储至区块链中。
一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:
接收数据处理请求;
提取数据处理请求中数据标识和数据处理类型;
从数据库中查询数据标识对应的区块链存储标识;
根据区块链存储标识从对应的区块链获取区块链数据;
按照数据处理类型对获取到的区块链数据进行分布式处理,记录分布式处理产生的过程数据到数据库中;
当分布式处理异常时,则删除异常分布式处理过程对应的过程数据;
当分布式处理完毕时,将数据库中记录的当前分布式处理过程对应的过程数据存储至区块链中。
上述区块链入链方法、装置、计算机设备和存储介质,根据数据处理请求对业务数据进行分布式处理,在分布式处理过程中,数据库会同时记录分布式处理数据;当分布式处理过程中发生数据处理异常时,数据库会自动删除数据处理异常对应的数据,回滚到分布式处理过程之前的数据存储状态;当分布式处理完毕后,将各分布式处理任务对应的处理数据存储至区块链,能够保证数据库与区块链中数据的一致性。
图1为一个实施例中区块链数据入链方法的应用场景图;
图2为一个实施例中区块链数据入链方法的流程示意图;
图3为另一个实施例中区块链数据入链的流程示意图;
图4为一个实施例中从数据库中查询数据标识对应的区块链存储标识步骤的流程示意图;
图5为一个实施例中根据区块链存储标识从对应的区块链获取区块链数据步骤的流程示意图;
图6为一个实施例中按照数据处理类型对获取到的区块链数据进行分布式处理,记录分布式处理产生的过程数据到数据库中步骤的流程示意图;
图7为一个实施例中当分布式处理完毕时,将数据库中记录的当前分布式处理过程对应的过程数据存储至区块链中步骤的流程示意图;
图8为一个实施例中区块链数据入链装置的结构框图;
图9为另一个实施例中区块链数据入链装置的结构框图;
图10为一个实施例中查询模块的结构框图;
图11为一个实施例中获取模块的结构框图;
图12为一个实施例中记录模块的结构框图;
图13为一个实施例中存储模块的结构框图;
图14为一个实施例中计算机设备的内部结构图。
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请提供的区块链数据入链方法,可以应用于如图1所示的应用环境中。其中,终端102通过网络与分布式服务器104通过网络进行通信。其中,终端102可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备,分布式服务器104可以用独立的分布式服务器或者是多个分布式服务器组成的分布式服务器集群来实现。
具体地,终端102检测到业务处理页面中的数据处理按钮被点击时,获取业务处理页面中选取的数据标识和数据处理类型,根据数据标识和数据处理类型生成数据处理请求,将数据处理请求发送至分布式服务器104。分布式服务器104接收到数据处理请求后,提取数据处理请求中数据标识和数据处理类型,从数据库中查询数据标识对应的区块链存储标识,根据区块链存储标识从对应的区块链获取区块链数据,按照数据处理类型对获取到的区块链数据进行分布式处理,记录分布式处理产生的过程数据到数据库中,当分布式处理异常时,则删除异常分布式处理过程对应的过程数据,当分布式处理完毕时,将数据库中 记录的当前分布式处理过程对应的过程数据存储至区块链中。
在一个实施例中,如图2所示,提供了一种区块链入链方法,以该方法应用于图1中的分布式服务器为例进行说明,包括以下步骤:
步骤202,接收数据处理请求。
其中,数据处理请求是用来对待处理数据进行处理的请求。具体地,终端检测到业务处理页面中的数据处理按钮被点击时,获取业务处理页面中选取的数据标识和数据处理类型,根据数据标识和数据处理类型生成数据处理请求,将数据处理请求发送至分布式服务器。分布式服务器接收终端发送的数据处理请求。数据标识用于表示待处理数据的标识。数据处理类型用于标识对数据进行处理的处理类型。
步骤204,提取数据处理请求中数据标识和数据处理类型。
其中,数据标识用于表示待处理数据的标识,而数据处理类型用于标识对数据进行处理的处理类型。具体地,分布式服务器在接收到数据处理请求后,可对数据处理请求进行解析,通过解析提取数据处理请求中的数据标识和数据处理类型。
步骤206,从数据库中查询数据标识对应的区块链存储标识。
其中,区块链存储标识用于标识数据在区块链中存储位置的标识。区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式,本质上是一个去中心化的数据库。而数据库是数据集合,数据库存储着与数据标识对应的区块链存储标识,即数据库中预先存储着数据标识和对应的区块链存储标识形成的数据区块链标识映射关系表。具体地,分布式服务器在提取到数据标识后,在数据库中查询提取到的数据标识,获取与提取到的数据标识对应的区块链存储标识。
步骤208,根据区块链存储标识从对应的区块链获取区块链数据。
其中,区块链数据是指与区块链存储标识对应的区块相关的数据。具体地,分布式服务器根据区块链存储标识确定区块链中的区块,从确定的区块中提取与区块链存储标识对应的区块数据,对区块数据进行解密,通过解密的得到区块链存储标识对应的区块链数据。
步骤210,按照数据处理类型对获取到的区块链数据进行分布式处理,记录分布式处理产生的过程数据到数据库中。
其中,分布式处理是将不同地点的,或具有不同功能的,或拥有不同数据的多台计算机通过通信网络连接起来,在控制系统的统一管理控制下,协调地完成大规模信息处理任务的计算机系统。简单来说就是多台相连的计算机各自承担同一工作任务的不同部分,同时运行,共同完成同一件工作任务。
具体地,分布式服务器按照数据处理类型根据获取到的数据创建分布式处理任务,将分布式处理任务进行分配并执行,得到分布式处理的过程数据。进 一步地,分布式服务器在执行分布式任务时,同时将分布式处理产生的过程数据实时写入到数据库中,而数据库则记录每个分布式处理产生的过程数据。
步骤212,当分布式处理异常时,则删除异常分布式处理过程对应的过程数据。
其中,分布式处理异常是指分布式处理出现非正常情况。具体地,分布式服务器在执行分布式任务时发生异常时,确定本次数据处理对应的所有过程数据,将确定的过程数据进行删除,保持存储的数据为本次数据处理之前的数据
在一个实施例中,例如,分布式服务器在执行第一次任务时,在数据库中对应存储的数据包括A1和B2,在执行第二次任务时,需要将A1和B1分别更新,更新为A2和B2,若第二次任务执行正常,则将A2和B2对应存储在数据库中,在执行第三次任务的时,需要将数据A2和B2更新为A3和B3,但是在执行第三次任务时发生异常,第三次任务未能执行成功,只更新了A3,B3未能更新成功,确定第三次任务在数据库中对应的过程数据(包括A3),则从数据库中将A3删除,回滚至第三次任务未执行之前的数据存储状态,即数据库中存储第一次任务和第二次任务对应的数据,实现数据回滚。进一步地,当所有任务执行完毕时,将数据库中对应的数据存储至区块链,从而保证了区块链中的数据与数据库中的数据一致,且不存在垃圾数据。
步骤214,当分布式处理完毕时,将数据库中记录的当前分布式处理过程对应的过程数据存储至区块链中。
具体地,分布式处理异常时,分布式服务器确定当前数据处理对应的所有过程数据,分布式服务器将确定的过程数据存储至区块链中,获取区块链中存储过程数据的区块标识,将区块标识作为区块存储标识记录在数据库中。
上述区块链入链方法中,根据数据处理请求对业务数据进行分布式处理,在分布式处理过程中,数据库会同时记录分布式处理数据;当分布式处理过程中发生数据处理异常时,数据库会自动删除数据处理异常对应的数据,回滚到分布式处理过程之前的数据存储状态;当分布式处理完毕后,将各分布式处理任务对应的处理数据存储至区块链,能够保证数据库与区块链中数据的一致性。
在一个实施例中,如图3所示,将数据库中记录的当前分布式处理过程对应的过程数据存储至区块链中之后,包括:
步骤302,根据数据处理结果生成数据处理通知。
其中,分布式服务器在将分布式处理过程对应的过程数据存储至区块中之后,还可推送数据处理通知至客户账号登录的终端。其中,数据处理通知是用来通知客户账号登录的终端的通知。具体可根据数据处理结果生成数据处理通知,也就是说数据处理通知中包括数据处理结果。
步骤304,确定当前数据处理过程对应的客户账号,将数据处理通知推送至以客户账号登录的终端。
具体地,在根据数据处理结果生成数据处理通知后,确定当前数据处理过程对应的客户账号,确定之后将数据处理通知推送至以客户账号登录的终端。
例如,以客户转账的业务进行举例说明。分布式服务器接收客户账号登录的终端发送的转账请求,提取转账请求中的转出客户账号、转入客户账号和转账金额,先分别从区块链查询转出客户账号和转入客户账号对应的余额信息,按照转账金额从转出客户账号的余额信息进行修改,同时写入数据库,按照转账金额对转入客户账号的余额信息进行修改,同时写入数据库,当对转入客户账号的余额信息修改失败时,发生转账异常,分布式服务器在数据库中确定转账请求对应的过程数据(包括转出客户账号的转出数据和转入客户账号的转入数据),将确定的转账对应的过程数据从数据库中删除,即回滚到未进行转账时数据存储状态,无需进行数据入链处理,避免区块链中存储过多无用的数据;当对转入客户账号的余额信息修改成功时,完成转账处理,分布式服务器确定转账请求对应的过程数据(包括修改后的余额信息,转出客户账号对应的余额信息和转入客户账号对应的余额信息),将确定的转账请求对应的过程数据进行数据入链操作,存储至区块链中,保证了区块链中存储数据为处理过程完成的数据,减少了区块链中的脏数据。其中,客户转账的业务的数据处理过程为分布式处理过程,由多个系统进行分布式处理。
在一个实施例中,提取数据处理请求中数据标识和数据处理类型,包括:对数据处理请求进行解析,通过解析提取数据处理请求中的数据标识和数据处理类型。
具体地,分布式服务器在接收到数据处理请求时,由于数据处理请求携带数据标识和数据处理类型,为了获取数据处理请求中的数据标识和数据处理类型,则需要对数据处理请求进行解析,通过解析提取数据处理请求中的数据标识和数据处理类型。
在一个实施例中,如图4所示,从数据库中查询数据标识对应的区块链存储标识,包括:
步骤402,获取预设数据区块链标识映射关系表,预设数据区块链标识映射关系表包括数据标识和对应的区块链存储标识的映射关系。
其中,预设数据区块链标识映射关系表是数据库中预先存储着数据标识和对应的区块链存储标识形成的关系表,在预设数据区块链标识映射关系表中数 据标识和对应的区块链存储标识是一一对应的映射关系。具体地,分布式服务器从数据库中查询数据处理请求中的数据标识对应的区块链存储标识,首选需要获取数据库中预先存储的预设数据区块链标识映射关系表,根据预设数据区块链标识映射关系表包括数据标识和对应的区块链存储标识的映射关系查询与数据请求中的数据标识匹配的区块链存储标识。
步骤404,根据数据标识从预设数据区块链标识映射关系表查询得到对应的区块链存储标识。
具体地,在获取数据中预先存储的预设数据区块链标识映射关系表后,根据数据标识从预设数据区块链标识映射关系表中查询得到匹配的区块链存储标识。具体可以是首先从预设数据区块链标识映射关系表中查找与数据请求中的数据标识匹配的目标数据标识,再将预设数据区块链标识映射关系表中与目标数据标识对应的区块链存储标识确定为与数据请求相匹配的区块链存储标识。
在一个实施例中,如图5所示,根据区块链存储标识从对应的区块链获取区块链数据,包括:
步骤502,根据区块链存储标识确定区块链中对应的目标区块。
其中,目标区块是指区块链中与区块链存储标识的区块,区块是区块链的基本组成单位。具体地,在从数据库中查询数据标识对应的区块链存储标识后,根据区块链存储标识从区块链中查找得到对应的目标区块。
步骤504,从目标区块中提取与区块链存储标识对应的目标区块数据。
其中,由于区块链中的区块存储着对应的区块数据,因此在根据区块链存储标识确定区块链中对应的目标区块后,需要对目标区块进行提取,提取得到目标区块中与区块链存储标识对应的目标区块数据。
步骤506,对目标区块数据进行解密,通过解密结果得到区块链存储标识从对应的区块链获取区块链数据。
具体地,在从目标区块中提取与区块链存储标识对应的目标区块数据后,对目标区块数据进行解密,可以是通过区块链解密算法对目标区块数据进行解密等。其中,由于区块链加密算法包括但不限于对称加密算法、非对称加密算法以及哈希hash加密算法,则区块链解密算法包括但不限于对称加密算法对应的解密算法、非对称加密算法对应的解密算法以及哈希hash加密算法对应的解密算法。进一步地,再通过解密结果进而得到区块链存储标识从对应的区块链中获取区块链数据。
在一个实施例中,如图6所示,按照数据处理类型对获取到的区块链数据进行分布式处理,记录分布式处理产生的过程数据到数据库中,包括:
步骤602,按照数据处理类型根据获取到的区块链数据创建分布式处理任务。
步骤604,根据分布式处理任务进行分配并执行,得到分布式处理产生的过 程数据。
步骤606,将分布式处理产生的过程数据实时写入数据库中。
其中,分布式处理是使多台相连的计算机各自承担同一工作任务的不同部分,同时运行,共同完成同一件工作任务。具体地,按照数据处理请求中的数据处理类型为获取到的区块链数据创建分布式处理任务,具体可以是为不同类型的数据处理类型创建不同的分布式处理任务,该分布式处理任务为分布式处理服务器需要执行的任务。
其次,在创建分布式处理任务后,分布式服务器根据分布式处理任务进行分配并指令,分布式服务器在执行分布式处理任务时会产生对应的过程数据。这里的过程数据是分布式处理任务在执行时产生的数据。最后,分布式服务器需要将分布式处理产生的过程数据实时写入数据库进行存储。
在一个实施例中,如图7所示,当分布式处理完毕时,将数据库中记录的当前分布式处理过程对应的过程数据存储至区块链中,包括:
步骤702,当分布式处理完毕时,确定当前分布式处理过程对应的当前过程数据。
步骤704,将当前过程数据存储至区块链中,获取区块链存储当前过程数据的当前区块标识。
步骤706,将当前区块标识作为区块链存储标识记录在数据库中。
具体地,在分布式服务器处理完对应的分布式处理任务时,当分布式处理任务处理完毕时,则确定当前分布式处理过程产生的当前过程数据,获取当前分布式处理过程产生的当前过程数据。然后,将获取到的当前过程数据存储至区块链中,具体可以是将获取到的当前过程数据写入至区块链中。由于区块链存储着各个过程数据对应的区块标识,则获取区块链存储当前过程数据对应的当前区块标识。而区块标识是用来标识存储过程数据的区块。
进一步地,将获取到的当前过程数据的当前区块标识作为区块链存储标识记录在数据库中。
应该理解的是,虽然上述流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,上述流程图中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
在一个实施例中,如图8所示,提供了一种区块链数据入链装置800,包括:接收模块802、提取模块804、查询模块806、获取模块808、记录模块810、删除模块812和存储模块814,其中:
接收模块802,用于接收数据处理请求。
提取模块804,用于提取数据处理请求中数据标识和数据处理类型。
查询模块806,用于从数据库中查询数据标识对应的区块链存储标识。
获取模块808,用于根据区块链存储标识从对应的区块链获取区块链数据。
记录模块810,用于按照数据处理类型对获取到的区块链数据进行分布式处理,记录分布式处理产生的过程数据到数据库中。
删除模块812,用于当分布式处理异常时,则删除异常分布式处理过程对应的过程数据。
存储模块814,用于当分布式处理完毕时,将数据库中记录的当前分布式处理过程对应的过程数据存储至区块链中。
在一个实施例中,如图9所示,区块链数据入链装置800还包括:生成模块816和通知模块818,其中:
生成模块816,用于根据数据处理结果生成数据处理通知。
通知模块818,用于确定当前数据处理过程对应的客户账号,将数据处理通知推送至以客户账号登录的终端。
在一个实施例中,提取模块804还用于对数据处理请求进行解析,通过解析提取数据处理请求中的数据标识和数据处理类型。
在一个实施例中,如图10所示,查询模块806包括:
获取单元806a,用于获取预设数据区块链标识映射关系表,预设数据区块链标识映射关系表包括数据标识和对应的区块链存储标识的映射关系。
查询单元806b,用于根据数据标识从预设数据区块链标识映射关系表查询得到对应的区块链存储标识。
在一个实施例中,如图11所示,获取模块808包括:
目标区块确定单元808a,用于根据区块链存储标识确定区块链中对应的目标区块。
目标区块数据提取单元808b,用于从目标区块中提取与区块链存储标识对应的目标区块数据。
解密单元808c,用于对目标区块数据进行解密,通过解密结果得到区块链存储标识从对应的区块链获取区块链数据。
在一个实施例中,如图12所示,记录模块810包括:
创建单元810a,用于按照数据处理类型根据获取到的区块链数据创建分布式处理任务。
执行单元810b,用于根据分布式处理任务进行分配并执行,得到分布式处理产生的过程数据。
写入单元810c,用于将分布式处理产生的过程数据实时写入数据库中。
在一个实施例中,如图13所示,存储模块814包括:
处理单元814a,用于当分布式处理完毕时,确定当前分布式处理过程对应的当前过程数据。
存储单元814b,用于将当前过程数据存储至区块链中,获取区块链存储当前过程数据的当前区块标识。
记录单元814c,用于将当前区块标识作为区块链存储标识记录在数据库中。
关于区块链数据入链装置的具体限定可以参见上文中对于区块链数据入链方法的限定,在此不再赘述。上述区块链数据入链装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图10所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储区块链数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种区块链数据入链方法。
本领域技术人员可以理解,图10中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在一个实施例中,提供了一种计算机设备,包括存储器和处理器,存储器存储有计算机程序,计算机程序被处理器执行时,使得处理器执行上述区块链数据入链方法的步骤。此处区块链数据入链方法的步骤可以是上述各个实施例区块链数据入链方法中的步骤。所述步骤包括202、接收数据处理请求;204、提取所述数据处理请求中数据标识和数据处理类型;206、从数据库中查询所述数据标识对应的区块链存储标识;208、根据所述区块链存储标识从对应的区块链获取区块链数据;210、按照所述数据处理类型对获取到的所述区块链数据进行分布式处理,记录所述分布式处理产生的过程数据到数据库中;212、当所述分布式处理异常时,则删除异常分布式处理过程对应的过程数据;214、当所述分布式处理完毕时,将所述数据库中记录的当前分布式处理过程对应的过程数据存储至区块链中。
在一个实施例中,提供了一种计算机可读存储介质,存储有计算机程序,计算机程序被处理器执行时,使得处理器执行上述区块链数据入链方法的步骤。此处区块链数据入链方法的步骤可以是上述各个实施例的区块链数据入链方法 中的步骤。所述步骤包括202、接收数据处理请求;204、提取所述数据处理请求中数据标识和数据处理类型;206、从数据库中查询所述数据标识对应的区块链存储标识;208、根据所述区块链存储标识从对应的区块链获取区块链数据;210、按照所述数据处理类型对获取到的所述区块链数据进行分布式处理,记录所述分布式处理产生的过程数据到数据库中;212、当所述分布式处理异常时,则删除异常分布式处理过程对应的过程数据;214、当所述分布式处理完毕时,将所述数据库中记录的当前分布式处理过程对应的过程数据存储至区块链中。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,的计算机程序可存储于一非易失性计算机可读取存储介质中,也可存储于一易失性计算机可读存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。
Claims (20)
- 一种区块链数据入链方法,所述方法包括:接收数据处理请求;提取所述数据处理请求中数据标识和数据处理类型;从数据库中查询所述数据标识对应的区块链存储标识;根据所述区块链存储标识从对应的区块链获取区块链数据;按照所述数据处理类型对获取到的所述区块链数据进行分布式处理,记录所述分布式处理产生的过程数据到数据库中;当所述分布式处理异常时,则删除异常分布式处理过程对应的过程数据;当所述分布式处理完毕时,将所述数据库中记录的当前分布式处理过程对应的过程数据存储至区块链中。
- 根据权利要求1所述的方法,其中,所述将所述数据库中记录的当前分布式处理过程对应的过程数据存储至区块链中之后,包括:根据数据处理结果生成数据处理通知;确定当前数据处理过程对应的客户账号,将数据处理通知推送至以客户账号登录的终端。
- 根据权利要求1所述的方法,其中,所述提取所述数据处理请求中数据标识和数据处理类型,包括:对所述数据处理请求进行解析,通过解析提取所述数据处理请求中的所述数据标识和所述数据处理类型。
- 根据权利要求1所述的方法,其中,所述从数据库中查询所述数据标识对应的区块链存储标识,包括:获取预设数据区块链标识映射关系表,所述预设数据区块链标识映射关系表包括数据标识和对应的区块链存储标识的映射关系;根据所述数据标识从所述预设数据区块链标识映射关系表查询得到对应的区块链存储标识。
- 根据权利要求1所述的方法,其中,所述根据所述区块链存储标识从对应的区块链获取区块链数据,包括:根据所述区块链存储标识确定区块链中对应的目标区块;从所述目标区块中提取与所述区块链存储标识对应的目标区块数据;对所述目标区块数据进行解密,通过解密结果得到所述区块链存储标识从对应的区块链获取区块链数据。
- 根据权利要求1所述的方法,其中,所述按照所述数据处理类型对获取到的所述区块链数据进行分布式处理,记录所述分布式处理产生的过程数据到数据库中,包括:按照所述数据处理类型根据获取到的所述区块链数据创建分布式处理任务;根据所述分布式处理任务进行分配并执行,得到所述分布式处理产生的过程数据;将所述分布式处理产生的过程数据实时写入所述数据库中。
- 根据权利要求1所述的方法,其中,所述当所述分布式处理完毕时,将所述数据库中记录的当前分布式处理过程对应的过程数据存储至区块链中,包括:当所述分布式处理完毕时,确定当前分布式处理过程对应的当前过程数据;将所述当前过程数据存储至所述区块链中,获取所述区块链存储所述当前过程数据的当前区块标识;将所述当前区块标识作为区块链存储标识记录在所述数据库中。
- 一种区块链数据入链装置,其中,所述装置包括:接收模块,用于接收数据处理请求;提取模块,用于提取所述数据处理请求中数据标识和数据处理类型;查询模块,用于从数据库中查询所述数据标识对应的区块链存储标识;获取模块,用于根据所述区块链存储标识从对应的区块链获取区块链数据;记录模块,用于按照所述数据处理类型对获取到的所述区块链数据进行分布式处理,记录所述分布式处理产生的过程数据到数据库中;删除模块,用于当所述分布式处理异常时,则删除异常分布式处理过程对应的过程数据;存储模块,用于当所述分布式处理完毕时,将所述数据库中记录的当前分布式处理过程对应的过程数据存储至区块链中。
- 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其中,所述处理器执行所述计算机程序时实现如下步骤:接收数据处理请求;提取所述数据处理请求中数据标识和数据处理类型;从数据库中查询所述数据标识对应的区块链存储标识;根据所述区块链存储标识从对应的区块链获取区块链数据;按照所述数据处理类型对获取到的所述区块链数据进行分布式处理,记录所述分布式处理产生的过程数据到数据库中;当所述分布式处理异常时,则删除异常分布式处理过程对应的过程数据;当所述分布式处理完毕时,将所述数据库中记录的当前分布式处理过程对应的过程数据存储至区块链中。
- 根据权利要求9所述的计算机设备,其中,所述将所述数据库中记录的当前分布式处理过程对应的过程数据存储至区块链中之后,包括:根据数据处理结果生成数据处理通知;确定当前数据处理过程对应的客户账号,将数据处理通知推送至以客户账 号登录的终端。
- 根据权利要求9所述的计算机设备,其中,所述提取所述数据处理请求中数据标识和数据处理类型,包括:对所述数据处理请求进行解析,通过解析提取所述数据处理请求中的所述数据标识和所述数据处理类型。
- 根据权利要求9所述的计算机设备,其中,所述从数据库中查询所述数据标识对应的区块链存储标识,包括:获取预设数据区块链标识映射关系表,所述预设数据区块链标识映射关系表包括数据标识和对应的区块链存储标识的映射关系;根据所述数据标识从所述预设数据区块链标识映射关系表查询得到对应的区块链存储标识。
- 根据权利要求9所述的计算机设备,其中,所述根据所述区块链存储标识从对应的区块链获取区块链数据,包括:根据所述区块链存储标识确定区块链中对应的目标区块;从所述目标区块中提取与所述区块链存储标识对应的目标区块数据;对所述目标区块数据进行解密,通过解密结果得到所述区块链存储标识从对应的区块链获取区块链数据。
- 根据权利要求9所述的计算机设备,其中,所述按照所述数据处理类型对获取到的所述区块链数据进行分布式处理,记录所述分布式处理产生的过程数据到数据库中,包括:按照所述数据处理类型根据获取到的所述区块链数据创建分布式处理任务;根据所述分布式处理任务进行分配并执行,得到所述分布式处理产生的过程数据;将所述分布式处理产生的过程数据实时写入所述数据库中。
- 根据权利要求9所述的计算机设备,其中,所述当所述分布式处理完毕时,将所述数据库中记录的当前分布式处理过程对应的过程数据存储至区块链中,包括:当所述分布式处理完毕时,确定当前分布式处理过程对应的当前过程数据;将所述当前过程数据存储至所述区块链中,获取所述区块链存储所述当前过程数据的当前区块标识;将所述当前区块标识作为区块链存储标识记录在所述数据库中。
- 一种计算机可读存储介质,其上存储有计算机程序,其中,所述计算机程序被处理器执行时实现如下步骤:接收数据处理请求;提取所述数据处理请求中数据标识和数据处理类型;从数据库中查询所述数据标识对应的区块链存储标识;根据所述区块链存储标识从对应的区块链获取区块链数据;按照所述数据处理类型对获取到的所述区块链数据进行分布式处理,记录所述分布式处理产生的过程数据到数据库中;当所述分布式处理异常时,则删除异常分布式处理过程对应的过程数据;当所述分布式处理完毕时,将所述数据库中记录的当前分布式处理过程对应的过程数据存储至区块链中。
- 根据权利要求16所述的计算机可读存储介质,其中,所述将所述数据库中记录的当前分布式处理过程对应的过程数据存储至区块链中之后,包括:根据数据处理结果生成数据处理通知;确定当前数据处理过程对应的客户账号,将数据处理通知推送至以客户账号登录的终端。
- 根据权利要求16所述的计算机可读存储介质,其中,所述提取所述数据处理请求中数据标识和数据处理类型,包括:对所述数据处理请求进行解析,通过解析提取所述数据处理请求中的所述数据标识和所述数据处理类型。
- 根据权利要求16所述的计算机可读存储介质,其中,所述从数据库中查询所述数据标识对应的区块链存储标识,包括:获取预设数据区块链标识映射关系表,所述预设数据区块链标识映射关系表包括数据标识和对应的区块链存储标识的映射关系;根据所述数据标识从所述预设数据区块链标识映射关系表查询得到对应的区块链存储标识。
- 根据权利要求16所述的计算机可读存储介质,其中,所述根据所述区块链存储标识从对应的区块链获取区块链数据,包括:根据所述区块链存储标识确定区块链中对应的目标区块;从所述目标区块中提取与所述区块链存储标识对应的目标区块数据;对所述目标区块数据进行解密,通过解密结果得到所述区块链存储标识从对应的区块链获取区块链数据。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910427167.9 | 2019-05-22 | ||
| CN201910427167.9A CN110209681A (zh) | 2019-05-22 | 2019-05-22 | 区块链数据入链方法、装置、计算机设备和存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020233352A1 true WO2020233352A1 (zh) | 2020-11-26 |
Family
ID=67788083
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2020/087147 Ceased WO2020233352A1 (zh) | 2019-05-22 | 2020-04-27 | 区块链数据入链方法、装置、计算机设备和存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN110209681A (zh) |
| WO (1) | WO2020233352A1 (zh) |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113572599A (zh) * | 2021-06-21 | 2021-10-29 | 深圳供电局有限公司 | 电力数据的传输方法、数据源设备及数据访问设备 |
| CN114499963A (zh) * | 2021-12-24 | 2022-05-13 | 杭州趣链科技有限公司 | 多层级跨链协同方法、装置、计算机设备及存储介质 |
| WO2022199567A1 (zh) * | 2021-03-26 | 2022-09-29 | 中兴通讯股份有限公司 | 数据处理方法、设备和存储介质 |
| CN115470293A (zh) * | 2022-08-25 | 2022-12-13 | 国网冀北电力有限公司信息通信分公司 | 数据处理方法、装置、设备和存储介质 |
| CN120541151A (zh) * | 2025-07-28 | 2025-08-26 | 陕西安康玮创达信息技术有限公司 | 一种基于区块链的数据管理系统 |
Families Citing this family (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110209681A (zh) * | 2019-05-22 | 2019-09-06 | 深圳壹账通智能科技有限公司 | 区块链数据入链方法、装置、计算机设备和存储介质 |
| CN110633323B (zh) * | 2019-09-16 | 2023-10-20 | 腾讯科技(深圳)有限公司 | 业务数据存储方法、装置、存储介质和计算机设备 |
| CN110808839B (zh) * | 2019-10-30 | 2022-07-12 | 百度在线网络技术(北京)有限公司 | 一种区块链异常数据的处理方法、装置、设备和介质 |
| CN112632080B (zh) * | 2020-12-29 | 2023-01-13 | 杭州趣链科技有限公司 | 基于区块链的数据存储方法、装置及设备 |
| CN114092043B (zh) * | 2021-11-09 | 2024-12-24 | 中国建设银行股份有限公司 | 数据管理平台、方法、设备及计算机可读存储介质 |
| CN114741447B (zh) * | 2022-03-28 | 2023-05-02 | 国网北京市电力公司 | 一种分布式能源站数据处理方法及装置 |
| CN117290354A (zh) * | 2023-08-21 | 2023-12-26 | 中国银行股份有限公司 | 数据处理方法、装置、计算机设备和存储介质 |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107193490A (zh) * | 2017-05-16 | 2017-09-22 | 北京中星仝创科技有限公司 | 一种基于区块链的分布式数据存储系统及方法 |
| CN107426170A (zh) * | 2017-05-24 | 2017-12-01 | 阿里巴巴集团控股有限公司 | 一种基于区块链的数据处理方法及设备 |
| CN108846745A (zh) * | 2018-04-19 | 2018-11-20 | 深圳市网心科技有限公司 | 区块链交易处理辅助系统、区块链数据处理系统及方法 |
| CN109101528A (zh) * | 2018-06-21 | 2018-12-28 | 深圳市买买提信息科技有限公司 | 数据处理方法、数据处理装置及电子设备 |
| CN109598505A (zh) * | 2018-10-31 | 2019-04-09 | 阿里巴巴集团控股有限公司 | 一种基于区块链的质量数据处理方法和装置 |
| CN110209681A (zh) * | 2019-05-22 | 2019-09-06 | 深圳壹账通智能科技有限公司 | 区块链数据入链方法、装置、计算机设备和存储介质 |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106899680B (zh) * | 2017-03-09 | 2019-07-30 | 深圳壹账通智能科技有限公司 | 多区块链的分片处理方法和装置 |
| CN108985757B (zh) * | 2017-11-27 | 2021-03-30 | 京东数字科技控股有限公司 | 信息处理方法、装置及系统、存储介质、电子设备 |
| CN109118219B (zh) * | 2018-08-01 | 2021-09-14 | 中国联合网络通信集团有限公司 | 交易数据处理方法和装置 |
| CN109522330B (zh) * | 2018-10-18 | 2021-05-04 | 上海达家迎信息科技有限公司 | 基于区块链的云平台数据处理方法、装置、设备及介质 |
-
2019
- 2019-05-22 CN CN201910427167.9A patent/CN110209681A/zh active Pending
-
2020
- 2020-04-27 WO PCT/CN2020/087147 patent/WO2020233352A1/zh not_active Ceased
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107193490A (zh) * | 2017-05-16 | 2017-09-22 | 北京中星仝创科技有限公司 | 一种基于区块链的分布式数据存储系统及方法 |
| CN107426170A (zh) * | 2017-05-24 | 2017-12-01 | 阿里巴巴集团控股有限公司 | 一种基于区块链的数据处理方法及设备 |
| CN108846745A (zh) * | 2018-04-19 | 2018-11-20 | 深圳市网心科技有限公司 | 区块链交易处理辅助系统、区块链数据处理系统及方法 |
| CN109101528A (zh) * | 2018-06-21 | 2018-12-28 | 深圳市买买提信息科技有限公司 | 数据处理方法、数据处理装置及电子设备 |
| CN109598505A (zh) * | 2018-10-31 | 2019-04-09 | 阿里巴巴集团控股有限公司 | 一种基于区块链的质量数据处理方法和装置 |
| CN110209681A (zh) * | 2019-05-22 | 2019-09-06 | 深圳壹账通智能科技有限公司 | 区块链数据入链方法、装置、计算机设备和存储介质 |
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2022199567A1 (zh) * | 2021-03-26 | 2022-09-29 | 中兴通讯股份有限公司 | 数据处理方法、设备和存储介质 |
| US12261739B2 (en) | 2021-03-26 | 2025-03-25 | Zte Corporation | Data processing method, device, and storage medium |
| CN113572599A (zh) * | 2021-06-21 | 2021-10-29 | 深圳供电局有限公司 | 电力数据的传输方法、数据源设备及数据访问设备 |
| CN113572599B (zh) * | 2021-06-21 | 2023-11-28 | 深圳供电局有限公司 | 电力数据的传输方法、数据源设备及数据访问设备 |
| CN114499963A (zh) * | 2021-12-24 | 2022-05-13 | 杭州趣链科技有限公司 | 多层级跨链协同方法、装置、计算机设备及存储介质 |
| CN115470293A (zh) * | 2022-08-25 | 2022-12-13 | 国网冀北电力有限公司信息通信分公司 | 数据处理方法、装置、设备和存储介质 |
| CN120541151A (zh) * | 2025-07-28 | 2025-08-26 | 陕西安康玮创达信息技术有限公司 | 一种基于区块链的数据管理系统 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110209681A (zh) | 2019-09-06 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020233352A1 (zh) | 区块链数据入链方法、装置、计算机设备和存储介质 | |
| CN111177302B (zh) | 业务单据处理方法、装置、计算机设备和存储介质 | |
| CN109558404B (zh) | 数据存储方法、装置、计算机设备和存储介质 | |
| US12282582B2 (en) | Compromise free cloud data encryption and security | |
| US9189641B2 (en) | Methods and systems for deleting requested information | |
| US10467192B2 (en) | Method and apparatus for updating data table in keyvalue database | |
| CN112969996A (zh) | 跟踪数据库数据的中间变化 | |
| CN112969997A (zh) | 跟踪数据库数据的变化 | |
| US20190087437A1 (en) | Scheduling database compaction in ip drives | |
| WO2021073510A1 (zh) | 一种数据库的统计方法及装置 | |
| CN115994148B (zh) | 多表数据的更新方法、装置、电子设备及可读存储介质 | |
| CN112307049A (zh) | 数据库的读写分离方法、装置、设备及可读存储介质 | |
| WO2016029744A1 (zh) | 一种元数据恢复方法及相关装置 | |
| CN113672640A (zh) | 数据查询方法、装置、计算机设备和存储介质 | |
| CN113377789A (zh) | 数据库变更数据的处理方法、装置、计算机设备和介质 | |
| CN103716384A (zh) | 跨数据中心实现云存储数据同步的方法和装置 | |
| CN110866011B (zh) | 数据表同步方法、装置、计算机设备和存储介质 | |
| CN110019092B (zh) | 数据存储的方法、控制器和系统 | |
| CN106776795A (zh) | 基于Hbase数据库的数据写入方法及装置 | |
| CN115842818A (zh) | 大数据传输方法、装置、计算机设备及存储介质 | |
| CN101447886B (zh) | 一种比较海量数据的方法及装置 | |
| CN114461574A (zh) | 高兼容性的档案资料存储方法、系统、设备及存储介质 | |
| CN114385633A (zh) | 一种海量数据的同步调取方法及相关设备 | |
| US12141271B2 (en) | Utilizing progress identifiers to rewrite an event query | |
| WO2019242112A1 (zh) | 审计字段信息获取方法、装置、计算机设备和存储介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20809205 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: 20809205 Country of ref document: EP Kind code of ref document: A1 |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 18/03/2022) |
