CN110716982A - Block chain real-time storage method and device, computer equipment and storage medium - Google Patents

Block chain real-time storage method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN110716982A
CN110716982A CN201910849650.6A CN201910849650A CN110716982A CN 110716982 A CN110716982 A CN 110716982A CN 201910849650 A CN201910849650 A CN 201910849650A CN 110716982 A CN110716982 A CN 110716982A
Authority
CN
China
Prior art keywords
node
data
block chain
cache
block
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.)
Granted
Application number
CN201910849650.6A
Other languages
Chinese (zh)
Other versions
CN110716982B (en
Inventor
林泽全
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Dianlian Technology Co ltd
Shenzhen Lian Intellectual Property Service Center
Original Assignee
Ping An Puhui Enterprise Management Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN201910849650.6A priority Critical patent/CN110716982B/en
Publication of CN110716982A publication Critical patent/CN110716982A/en
Application granted granted Critical
Publication of CN110716982B publication Critical patent/CN110716982B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

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

Abstract

The invention discloses a block chain real-time storage method, a block chain real-time storage device, computer equipment and a storage medium, and belongs to the technical field of block chains, wherein the block chain real-time storage method comprises the following steps: in response to a data change of a first node in a blockchain network, caching the changed data so that the data is used by the first node before completion of blockchain synchronization; generating a block from the data cached by the first node; synchronizing the block to other blockchain nodes in the blockchain network except the first node. Therefore, the delay problem in the use process of the block chain network is reduced, the risk of data tampering is avoided, the safety of data is guaranteed, and the use experience of a user is improved.

Description

Block chain real-time storage method and device, computer equipment and storage medium
Technical Field
The present invention relates to the field of blockchain technologies, and in particular, to a method and an apparatus for real-time storage of blockchains, a computer device, and a storage medium.
Background
In the prior art, the block chain has the characteristics of openness, transparency, non-falsification and the like, and is applied to various industries. However, when the application system is used in an actual application system, the blockchain network needs to generate a block from newly generated data every other predetermined time, and then synchronize the block into the blockchain network, and before the block is generated and synchronized into the blockchain network, the newly generated data at each node in the blockchain cannot be used, which may cause a problem of high latency, and the user experience with high latency may be very poor, resulting in that the user cannot normally use the application system based on the blockchain platform.
Disclosure of Invention
Based on the above, the invention provides a block chain real-time storage method, a block chain real-time storage device, a computer device and a storage medium, which are used for solving the technical problem that block chain real-time transaction delay is high in the related technology.
In a first aspect, a method for storing a blockchain in real time is provided, where each node in a blockchain network includes a cache module, and the method includes:
in response to a data change of a first node in a blockchain network, caching the changed data so that the data is used by the first node before completion of blockchain synchronization;
generating a block from the data cached by the first node;
synchronizing the block to other blockchain nodes in the blockchain network except the first node.
In one embodiment, after synchronizing the block to other blockchain nodes in the blockchain network except the first node, the method further includes:
and clearing all synchronous data in the data cached by the first node.
In one embodiment, after buffering the changed data in response to a change in data of a first node in the blockchain network so that the data is used by the first node before completion of blockchain synchronization, the method further comprises:
and responding to a data calling request of the first node, and calling the changed data cached by the first node.
In one embodiment, there are a plurality of cache modules of the first node, and the step of caching the changed data in response to a data change of the first node in the blockchain network specifically includes:
responding to data change of a first node in a block chain network, and inquiring cache loads of cache modules of the first node of the block chain;
and selecting a cache module for caching data according to the cache load of each cache module of the first node of the block chain.
In one embodiment, the step of generating a block from the data cached by the first node comprises:
encrypting the data cached by the first node;
and packaging the encrypted data to generate a block.
In one embodiment, the encrypting the data cached by the first node specifically includes:
creating a cryptographic module in the first node;
and the data cached by the first node is packaged in the cryptographic module, so that the data cached by the first node is packaged with the cryptographic module and then is synchronized to other nodes in the block chain network except the first node.
In one embodiment, the storing the data cached by the first node in the cryptographic module specifically includes:
splitting the data cached by the first node into cache subdata with the same number as that of the cryptographic modules;
the cache subdata is respectively and correspondingly stored in different cryptographic modules one by one, and each cryptographic module only stores one cache subdata;
and generating a storage sequence of the cache subdata, dynamically encrypting the storage sequence, and storing the storage sequence in the first node.
In a second aspect, a block chain real-time storage apparatus is provided, including:
and a data caching module. The data cache is used for responding to data change of a first node in the blockchain network, and caching the changed data so that the data can be used by the first node before blockchain synchronization is completed;
the block generation module is used for generating a block from the data cached by the first node;
a block synchronization module, configured to synchronize the block to other blockchain nodes in the blockchain network except the first node.
In a third aspect, a computer device is provided, which includes a memory and a processor, wherein the memory stores computer readable instructions, and the computer readable instructions, when executed by the processor, cause the processor to execute the steps of the above block chain real-time storage method.
In a fourth aspect, a storage medium is provided, in which computer readable instructions are stored, which, when executed by one or more processors, cause the one or more processors to perform the steps of the blockchain real-time storage method described above.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
according to the block chain real-time storage method, the block chain real-time storage device, the computer equipment and the storage medium, when data are generated at any node in the block chain network, the cache module of the node is firstly used for caching the data generated by the node so that the node can use the data before the block chain data synchronization is completed, therefore, each node can use the data which are not synchronously completed and are generated by the node before the block chain data synchronization is completed to process the data, the block chain data synchronization is not required to be waited to be completed, the delay problem in the use process of the block chain network is reduced, and the use experience of a user is improved. The data are packaged into blocks while being cached, and a block chain data synchronization program is carried out, and after the data synchronization is finished, the cached data can be replaced by the synchronized data, so that the risk of data tampering is avoided, and the safety of the data is ensured.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
Fig. 1 is an implementation environment diagram of a block chain real-time storage method provided in an embodiment.
Fig. 2 is a flow chart illustrating a method of real-time storage of a blockchain according to an example embodiment.
Fig. 3 is a flowchart illustrating another block chain real-time storage method according to a corresponding embodiment of fig. 2.
Fig. 4 is a flowchart illustrating another block chain real-time storage method according to the corresponding embodiment of fig. 2.
Fig. 5 is a flowchart illustrating an implementation of step S100 in the block chain real-time storage method according to the corresponding embodiment of fig. 2.
Fig. 6 is a flowchart illustrating another specific implementation of step S200 in the block chain real-time storage method according to the corresponding embodiment of fig. 2.
Fig. 7 is a flowchart illustrating another specific implementation of step S210 in the block chain real-time storage method according to the corresponding embodiment of fig. 6.
Fig. 8 is a flowchart illustrating another specific implementation of step S212 in the block chain real-time storage method according to the corresponding embodiment of fig. 6.
Fig. 9 is a block diagram illustrating a blockchain real-time storage device in accordance with an example embodiment.
Fig. 10 schematically illustrates an example block diagram of an electronic device for implementing the above-described blockchain real-time storage method.
Fig. 11 schematically illustrates a computer-readable storage medium for implementing the above-described blockchain real-time storage method.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Fig. 1 is a diagram of an implementation environment of a real-time blockchain storage method provided in an embodiment, as shown in fig. 1, in the implementation environment, a plurality of blockchain nodes 100 included in a blockchain network
The blockchain nodes 100 are server nodes of each unit department using the blockchain system, and form a blockchain network. When the data change occurs in the block chain node 100, the changed data is firstly cached, then the cached data is packaged to generate a new block, and after the cached data is generated into the block, the block is synchronized to all nodes in the block chain network. Since the blockchain node 100 has cached the data prior to the process of blockchain node generating and synchronizing the data to the blockchain network, the blockchain node 100 may use the data prior to synchronizing the data to the blockchain network when transacting data with other nodes in the blockchain network.
The blockchain node 100 may be, but is not limited to, a desktop computer server, a mainframe computer server, a cloud server, a server cluster, and various terminal servers. The block link nodes 100 may be connected to each other through wired, wireless or other communication connection methods, which is not limited herein.
As shown in fig. 2, in an embodiment, a method for real-time storage of a blockchain is provided, where the method for real-time storage of a blockchain may be applied to the blockchain node 100, and specifically includes the following steps:
step S100, responding to data change of a first node in a block chain network, caching the changed data so that the data can be used by the first node before the block chain synchronization is completed;
it should be understood that the first node or other blockchain node in the method may be any blockchain node 100 in fig. 1.
According to the scheme, a cache module is added in a node of a block chain to cache data, so that the problem of high delay in a block chain network is solved. The specific mode is that when the data of the blockchain node changes, the changed data is cached through the cache module of the node firstly, so that the changed data is used before the data synchronization is completed in the blockchain, and therefore even if the newly changed data in the blockchain node is not synchronized into the blockchain network, the data can be processed by using the cached data and is interacted with other nodes, the changed data does not need to be processed after being synchronized into the blockchain network, the waiting time is reduced, the problem of high delay of the blockchain is solved, the time of a user is saved, and the use experience of the user is improved.
Step S200, generating a block from the data cached by the first node;
after the data is cached in the corresponding cache module, the cached data uplink can be synchronized to the block chain network, and the data to be synchronized needs to be processed in the synchronization process to generate the block. After the data is cached, the changed data is conveniently used before the data synchronization is completed in the block chain, and the data is generated into the block in real time so as to be synchronized into the block chain network, so that the risk of tampering caused by untimely synchronization after the data is cached can be avoided, and the safety of the data is improved.
Step S300, synchronizing the block to other blockchain nodes in the blockchain network except the first node.
After the tiles are generated, the data can be synchronized to other nodes in the blockchain network. At this moment, the cache node still caches the corresponding data, so the cache node can still be used by the first node, and the first node does not need to wait for the completion of block chain synchronization when processing locally generated data, thereby greatly improving the user experience.
In one embodiment, the first node is a server node inside a unit, and when the server node inside the unit performs data interaction with another department server node in a block chain network at the same place, a large amount of data is generated, at this time, the server node inside the unit and the another department server node both cache data generated by the respective node in a cache module of the respective node, and directly use the data in the cache module of the respective node for data processing during data processing. Meanwhile, after the data is cached to the node module, the cached data is synchronized to the block chain network in real time, so that the risk that the cached data is tampered is avoided, and the safety of the data in the using process of the system is improved.
Fig. 3 shows that, in an embodiment, after step S300 in the corresponding embodiment of fig. 2, the block chain real-time storage method may further include the following steps:
step S400, clearing all synchronized data in the data cached by the first node.
After the data synchronization is completed, the data can be used by the first node even though the data is not cached, and at this time, the cached data can be cleared to utilize the cached space to the maximum extent, otherwise, when the data caching space is used up, other newly generated data cannot be cached continuously.
Fig. 4 shows that, in an embodiment, after step S100 in the corresponding embodiment of fig. 2, the block chain real-time storage method may further include the following steps:
step S101, responding to a data calling request of a first node, calling the changed data cached by the first node.
For example, in one embodiment, a customer conducts a transaction with a bank server through their own terminal, and the customer's terminal and the bank's server are each a node in a blockchain network. During the transaction process, if the newly generated data are needed to be used, the data in the cache nodes can be directly called for use, and the user terminal and the bank server do not need to wait until the block link point completes the data synchronization and then use the data.
Optionally, fig. 5 is a detailed description of step S100 in the block chain real-time storage method shown in the corresponding embodiment of fig. 2, where in the block chain real-time storage method, there are a plurality of cache modules of the first node, and step S100 may include the following steps:
step S110, responding to the data change of a first node in a block chain network, and inquiring the cache load of each cache module of the first node of the block chain;
and step S120, selecting a cache module for data caching according to the cache load of each cache module of the first node of the block chain.
The cache load may be the remaining cache capacity and the cached capacity of each cache module, the selection method may be to select the cache module with the smallest cache load as the cache module for performing data caching, or to select one of the nodes meeting the predetermined threshold as the module for performing data caching, which is not limited herein. The predetermined storage threshold is, for example, 215KB, 345MB, 46GB, etc., which is not limited herein.
In one embodiment, the cache load is a cached capacity of the cache module, and after the first node of the blockchain changes, the cached capacity of each cache module of the first node of the blockchain is queried first, and then the cache module with the smallest cached capacity is selected as the module for data caching.
In another embodiment, the cache load is a remaining cache capacity of the cache module, after the first node of the block chain changes, the remaining cache capacity of each cache module of the first node of the block chain is queried, and then it is determined whether the remaining cache capacity of each cache module exceeds a predetermined remaining storage threshold, and if the remaining cache capacity of each cache module exceeds the predetermined remaining storage threshold, a cache module with the largest storage capacity among the cache modules whose remaining cache capacities exceed the predetermined remaining storage threshold is selected.
In this embodiment, the predetermined remaining storage threshold is the size of the data to be cached, so that the storage space of each cache module can be utilized to the maximum extent in the using process, when the storage space of one cache module is used up, the synchronization of the cached data is directly completed, and after all the cached data are synchronized, the cached data are emptied in time. Therefore, the situation that data congestion occurs because a large amount of data is generated but the data cached by each cache module in the block chain node is not synchronously completed in the transaction process and cannot be cleared in time can be avoided.
Optionally, fig. 6 is a detailed description of step S200 in the block chain real-time storage method shown in the corresponding embodiment of fig. 2, where in the block chain real-time storage method, step S200 may include the following steps:
step S210, encrypting the data cached by the first node;
step S220, packing the encrypted data to generate a block.
In the scheme, when the block is generated, the data to be synchronized needs to be encrypted first, and then the data is packaged after the encryption is completed, and then a block is generated, and then the blocks can be synchronized. For example, the encryption method includes randomly dividing the data cached by the first node into a plurality of parts, generating a string of the data segments in the splicing sequence, and then encrypting the string by a hash algorithm. The encryption method can also be directly asymmetric encryption of the data. The encryption method can also directly carry out random encryption and dynamic encryption on the data.
Optionally, fig. 7 is a detailed description of step S210 in the block chain real-time storage method shown in the corresponding embodiment of fig. 6, where in the block chain real-time storage method, step S210 may include the following steps:
step S211, creating a cryptographic module in the first node;
step S212, the data cached by the first node is encapsulated in the cryptographic module, so that the data cached by the first node is packaged with the cryptographic module and then synchronized to other nodes in the block chain network except the first node.
In the scheme, the encryption mode is to newly establish a cryptographic module in the storage area and store the data cached by the first node in the cryptographic module so as to isolate the contact between the data cached by the first node and the outside. The cryptographic module has a strict boundary to block the external and internal connection, and if the data cached by the first node in the cryptographic module is required to be read, the data can be read only through a specific interface, so that the security of the data cached by the first node is ensured. When the data cached by the first node is sealed in the cryptographic module, the data is synchronized with the cryptographic module into all nodes of the block chain, all the nodes of the block chain acquire the cryptographic module with a strict boundary and the data sealed in the cryptographic module, and the data needs to be verified through a specific interface in the cryptographic module when the data is required to be acquired.
Optionally, fig. 8 is a detailed description of step S212 in the block chain real-time storage method shown in the corresponding embodiment of fig. 7, where in the block chain real-time storage method, step S212 may further include the following steps:
step S2121, dividing the data cached by the first node into cache subdata with the same number as that of the password modules;
step S2122, the cache subdata is respectively and correspondingly stored in different cryptographic modules one by one, and each cryptographic module only stores one cache subdata;
step S2123, generating a storage sequence of the cache subdata, dynamically encrypting the storage sequence, and storing the storage sequence in the first node.
According to the scheme, when the cryptographic module is created in the first node, a plurality of cryptographic modules are created, then the data cached in the first node is divided into cache subdata with the same number as the cryptographic modules according to the number of the cryptographic modules, then each cryptographic module stores one cache subdata, if the complete data cached in the first node is to be obtained, the data is read from all the cryptographic modules, all the cache subdata are obtained, and the cache subdata are spliced together in sequence to obtain the complete data cached in the first node, so that the security of data storage cached in the first node is improved.
In one embodiment of the present invention, the dynamic encryption method first needs to acquire and store the storage sequence to facilitate processing of the storage sequence data, and at this time, the storage sequence data may be regarded as a string of character strings to be stored in a local device. After acquiring and storing the storage sequence character string needing to be encrypted, performing specified abstract operation on specified characteristic information of the storage sequence, and determining initial characters for encrypting the storage sequence according to the result of the specified abstract operation. Then, starting from the start character, an encryption key is obtained in the storage sequence string. The stored sequential string is then encrypted using the encryption key according to a predetermined encryption algorithm, i.e., the algorithm that generated the encryption key. And finally, after encryption is finished, the encrypted storage data character string can be sent to other nodes of the block chain network.
In this embodiment, the specific feature information may be a length of a character string of the storage order, and may also be a size of the storage order in other embodiments.
The method of the digest operation is, for example, a hash operation, a random operation, etc., and in this embodiment, the method of the digest operation is calculated by the following formula
B=L mod rand(0,[lnL])
Wherein, B is the result of the summary operation, L is the string length of the storage sequence, mod is a remainder function, rand (x, y) is a random function whose domain is x to y, [ x ] is a rounding function, and ln is a natural logarithm function. The formula can ensure the randomness of the abstract operation result through a random function so as to ensure that the encrypted abstract operation result is not easy to be cracked, the encryption safety is improved, and the obtained result is not too large through the cooperation of a natural logarithm function and an integer function so as to ensure the safety of the subsequent encryption process.
In this embodiment, the method for encrypting the storage sequence character string is to extract every predetermined number of bits from a starting character to extract a predetermined length to form an encryption key, where the predetermined number of bits may be 1 bit, 2 bits, prime number bits, and the like, the predetermined length may be the length of the storage sequence character string, or may be 20 bits or 304 bits, and the predetermined number of bits and the predetermined length may be set according to specific situations, and the scheme is not limited.
As shown in fig. 9, in an embodiment, a block chain real-time storage device is provided, which may be integrated in the computer apparatus 100, and specifically includes: a data buffer module 110, a block generation module 120, and a block synchronization module 130.
A data caching module 110, configured to respond to a data change of a first node in a blockchain network, and cache the changed data so that the data is used by the first node before completion of blockchain synchronization;
a block generating module 120, configured to generate a block from the data cached by the first node;
a block synchronization module 130, configured to synchronize the block to other blockchain nodes in the blockchain network except the first node.
The implementation process of the functions and actions of each module in the above device is specifically described in detail in the implementation process of the corresponding step in the above block chain real-time storage method, and is not described herein again.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Moreover, although the steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that the steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 500 according to this embodiment of the invention is described below with reference to fig. 10. The electronic device 500 shown in fig. 10 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 10, the electronic device 500 is embodied in the form of a general purpose computing device. The components of the electronic device 500 may include, but are not limited to: the at least one processing unit 510, the at least one memory unit 520, and a bus 530 that couples various system components including the memory unit 520 and the processing unit 510.
Wherein the storage unit stores program code that is executable by the processing unit 510 to cause the processing unit 510 to perform steps according to various exemplary embodiments of the present invention as described in the above section "exemplary methods" of the present specification. For example, the processing unit 510 may execute step S110 shown in fig. 2, in response to a data change of a first node in the blockchain network, buffering the changed data so that the data is used by the first node before completion of blockchain synchronization; step S120, generating a block from the data cached by the first node; step S130, synchronizing the block to other blockchain nodes except the first node in the blockchain network.
The memory unit 520 may include a readable medium in the form of a volatile memory unit, such as a random access memory unit (RAM)5201 and/or a cache memory unit 5202, and may further include a read only memory unit (ROM) 5203.
Storage unit 520 may also include a program/utility 5204 having a set (at least one) of program modules 5205, such program modules 5205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 530 may be one or more of any of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 500 may also communicate with one or more external devices 700 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 500, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 500 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 550. Also, the electronic device 500 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 560. As shown, the network adapter 560 communicates with the other modules of the electronic device 500 over the bus 530. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above section "exemplary methods" of the present description, when said program product is run on the terminal device.
Referring to fig. 11, a program product 600 for implementing the above method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. A real-time storage method of a block chain is applied to a block chain network, each node in the block chain network comprises a cache module, and the method comprises the following steps:
in response to a data change of a first node in a blockchain network, caching the changed data so that the data is used by the first node before completion of blockchain synchronization;
generating a block from the data cached by the first node;
synchronizing the block to other blockchain nodes in the blockchain network except the first node.
2. The method of claim 1, wherein after synchronizing the block to other blockchain nodes in the blockchain network other than the first node, the method further comprises:
and clearing all synchronous data in the data cached by the first node.
3. The method of claim 1, wherein after buffering the changed data in response to a change in data for a first node in a blockchain network so that the data is used by the first node before completion of blockchain synchronization, the method further comprises:
and responding to a data calling request of the first node, and calling the changed data cached by the first node.
4. The method of claim 1, wherein there are a plurality of cache modules of the first node, and wherein the step of caching the changed data in response to a change in data of the first node in the blockchain network specifically comprises:
responding to data change of a first node in a block chain network, and inquiring cache loads of cache modules of the first node of the block chain;
and selecting a cache module for caching data according to the cache load of each cache module of the first node of the block chain.
5. The method of claim 1, wherein the step of generating a chunk of data cached by the first node comprises:
encrypting the data cached by the first node;
and packaging the encrypted data to generate a block.
6. The method of claim 5, wherein the encrypting the data cached by the first node specifically comprises:
creating a cryptographic module in the first node;
and the data cached by the first node is packaged in the cryptographic module, so that the data cached by the first node is packaged with the cryptographic module and then is synchronized to other nodes in the block chain network except the first node.
7. The method as claimed in claim 6, wherein said encapsulating the data cached by the first node in the cryptographic module specifically comprises:
splitting the data cached by the first node into cache subdata with the same number as that of the cryptographic modules;
the cache subdata is respectively and correspondingly stored in different cryptographic modules one by one, and each cryptographic module only stores one cache subdata;
and generating a storage sequence of the cache subdata, dynamically encrypting the storage sequence, and storing the storage sequence in the first node.
8. A block chain real-time storage apparatus, the apparatus comprising:
the data caching module is used for responding to data change of a first node in the block chain network and caching the changed data so that the data can be used by the first node before the block chain synchronization is completed;
the block generation module is used for generating a block from the data cached by the first node;
a block synchronization module, configured to synchronize the block to other blockchain nodes in the blockchain network except the first node.
9. A computer device comprising a memory and a processor, the memory having stored therein computer-readable instructions that, when executed by the processor, cause the processor to perform the method of any of claims 1 to 7.
10. A storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the method of any one of claims 1-7.
CN201910849650.6A 2019-09-09 2019-09-09 Block chain real-time storage method, device, computer equipment and storage medium Active CN110716982B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910849650.6A CN110716982B (en) 2019-09-09 2019-09-09 Block chain real-time storage method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910849650.6A CN110716982B (en) 2019-09-09 2019-09-09 Block chain real-time storage method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110716982A true CN110716982A (en) 2020-01-21
CN110716982B CN110716982B (en) 2024-02-02

Family

ID=69209754

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910849650.6A Active CN110716982B (en) 2019-09-09 2019-09-09 Block chain real-time storage method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110716982B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111382463A (en) * 2020-04-02 2020-07-07 中国工商银行股份有限公司 Block chain system and method based on stream data
CN113298653A (en) * 2021-05-27 2021-08-24 李政德 Block chain-based data tampering monitoring method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104506664A (en) * 2014-11-24 2015-04-08 小米科技有限责任公司 Domain name system caching method and device
US20170108937A1 (en) * 2015-10-16 2017-04-20 Seoul Viosys Co., Ltd. Compact light emitting diode chip, light emitting device and electronic device including the same
CN109067849A (en) * 2018-07-11 2018-12-21 杨国超 Method of data synchronization based on block
CN109462631A (en) * 2018-08-31 2019-03-12 腾讯科技(深圳)有限公司 Data processing method, device, storage medium and electronic device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104506664A (en) * 2014-11-24 2015-04-08 小米科技有限责任公司 Domain name system caching method and device
US20170108937A1 (en) * 2015-10-16 2017-04-20 Seoul Viosys Co., Ltd. Compact light emitting diode chip, light emitting device and electronic device including the same
CN109067849A (en) * 2018-07-11 2018-12-21 杨国超 Method of data synchronization based on block
CN109462631A (en) * 2018-08-31 2019-03-12 腾讯科技(深圳)有限公司 Data processing method, device, storage medium and electronic device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111382463A (en) * 2020-04-02 2020-07-07 中国工商银行股份有限公司 Block chain system and method based on stream data
CN113298653A (en) * 2021-05-27 2021-08-24 李政德 Block chain-based data tampering monitoring method and device

Also Published As

Publication number Publication date
CN110716982B (en) 2024-02-02

Similar Documents

Publication Publication Date Title
KR102151907B1 (en) Blockchain data processing and storage in a trusted execution environment
CN108540459B (en) Data storage method, device, system, electronic equipment and computer readable medium
US11829624B2 (en) Method, device, and computer readable medium for data deduplication
CN109995523B (en) Activation code management method and device and activation code generation method and device
CN109951546B (en) Transaction request processing method, device, equipment and medium based on intelligent contract
CN110825479A (en) Page processing method and device, terminal equipment, server and storage medium
WO2012087751A1 (en) Bulk initial download of mobile databases
US20160048703A1 (en) Securing integrity and consistency of a cloud storage service with efficient client operations
US11089081B1 (en) Inter-process rendering pipeline for shared process remote web content rendering
US20190245891A1 (en) Optimizing data reduction, security and encryption requirements in a network environment
CN110716982B (en) Block chain real-time storage method, device, computer equipment and storage medium
CN112434326B (en) Trusted computing method and device based on data flow
CN110086607B (en) Method and device for rapidly switching deployment key, computer equipment and storage medium
KR20180005542A (en) Apparatus and method for verifing data integrity
CN113411404A (en) File downloading method, device, server and storage medium
CN110442601B (en) Openstack mirror image data parallel acceleration method and device
CN109918381B (en) Method and apparatus for storing data
CN112416263B (en) Space-time certification blocking storage method and device based on random verification and electronic equipment
JP2023536304A (en) Methods, systems and programs for managing communication between microservices
CN116070240B (en) Data encryption processing method and device of multi-chip calling mechanism
CN114065704A (en) Data compression method, electronic device and computer program product
CN111414343A (en) Log writing method and device, electronic equipment and medium
CN107320959B (en) Game role identification information generation method, device, medium and electronic equipment
CN114362961B (en) Block chain-based account recovery method, device, equipment and storage medium
US11755549B2 (en) Method, electronic device, and computer program product for data processing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20240102

Address after: 301, 304, Building 2, COFCO Chuangxin R&D Center, 69 Xingdong Community, Xin'an Street, Bao'an District, Shenzhen, Guangdong 518000

Applicant after: SHENZHEN DIANLIAN TECHNOLOGY Co.,Ltd.

Address before: 518000 Room 202, block B, aerospace micromotor building, No.7, Langshan No.2 Road, Xili street, Nanshan District, Shenzhen City, Guangdong Province

Applicant before: Shenzhen LIAN intellectual property service center

Effective date of registration: 20240102

Address after: 518000 Room 202, block B, aerospace micromotor building, No.7, Langshan No.2 Road, Xili street, Nanshan District, Shenzhen City, Guangdong Province

Applicant after: Shenzhen LIAN intellectual property service center

Address before: Room 201, building a, No. 1, Qianwan 1st Road, Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong Province

Applicant before: PING AN PUHUI ENTERPRISE MANAGEMENT Co.,Ltd.

GR01 Patent grant
GR01 Patent grant