CREATING A BLOCKCHAIN WITH BLOCKS COMPLETING AN ADJUSTABLE NUMBER OF TRANSACTION BLOCKS AND MULTIPLE SUBBLOCKS
Patent Information
- Application Number
- DE502019011909
- Authority / Receiving Office
- DE · DE
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2018-12-14
- Filing Date
- 2019-11-13
- Publication Date
- 2024-08-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In industrial environments, the use of blockchain technology for storing data in devices with limited resources, such as automation, HMI, or IoT devices, faces challenges due to increasing storage space requirements as the blockchain grows, potentially leading to storage space shortages.
A method is introduced to create a blockchain with adjustable transaction blocks and intermediate blocks, where intermediate blocks reference previous blocks, allowing for flexible validation and tracing of the blockchain, enabling the omission of transaction blocks between intermediate blocks for storage space reduction, while maintaining integrity and tamper-proofness.
This approach reduces storage space requirements on nodes by removing unnecessary transaction blocks, allowing devices with limited resources to efficiently store and validate blockchain data, ensuring data integrity and availability without compromising tamper-proofness.
Description
[0001] The invention relates to a computer-implemented method for creating a blockchain with blocks comprising an adjustable number of transaction blocks and a plurality of intermediate blocks, as well as a storage medium of a device participating in a distributed database system comprising such a blockchain.
[0002] In the industrial environment, there is increasing interest in securely storing data relating to the device itself or an automation system in which the device is located, or data relating to a process carried out in the device's automation system, on the device itself. Of particular interest are quality data from an automation control system, performed operating actions, or a history of recorded status data. A blockchain and the use of a blockchain network are ideal for tamper-proof storage of such data on a device.
[0003] In an industrial environment, for example, a so-called public blockchain or a private blockchain is used. With a public blockchain, the consensus process is public, meaning an unknown group of users, for example, on the public internet, can confirm or validate a blockchain, or more precisely, validate individual blocks through mining. With a private blockchain, the consensus process takes place within a consortium whose members are known to each other or to an administrative authority, for example, or who meet a certain level of trust.
[0004] Blockchain technology creates a distributed, decentralized database in which transactions generated by participating nodes can be stored in a tamper-proof manner. Transactions are stored in a block, and each block is linked to a subsequent block using a checksum procedure. An explanation of blockchain technology can be found, for example, in the English-language Wikipedia article https: / / en.wikipedia.org / wiki / Blockchain. In addition to one or more transactions, a block contains, for example, a hash value of the previous block. The block is sent to the blockchain network by the node that generated it. Protection is provided by a majority of trusted nodes in a blockchain network, which validate blocks. In the network of nodes participating in a blockchain, a new block is created at regular intervals, and the hash value of an existing block is also stored.If there is no transaction in an interval, some blockchains do not create the block.
[0005] Thus, a blockchain stores the transactions that have been submitted to the blockchain for confirmation or made available to the blockchain network. As blocks are confirmed in the respective consensus process, the valid blockchain grows in length and thus in size with each confirmed block. The storage space requirements of a continued or confirmed blockchain thus continue to grow.
[0006] Because a checksum, specifically a hash value, of the previous block is inserted into each new block, a chain is formed. The checksum of the previous block, together with the transaction of the current block, forms the data record for the checksum of the subsequent block. It is also said that a block references the previous block. The transactions are thus protected from tampering, as a chain can be traced back to an initial block, also called the genesis block, by chaining the blocks. Because the transactions are available via the blockchain network, it is possible to trace at which block in the chain, for example, the content of a transaction no longer matches previous versions. Transactions are therefore stored in every verified blockchain, protected from tampering.A modification of a transaction in a block that was previously created in the network would be traceable if a checksum is calculated or verified across the existing blocks. Due to the constantly growing number of blocks within a blockchain, the use of blockchain technology in devices with limited resources carries the risk of insufficient storage space in the long term. For example, storage resources for automation devices, HMI devices, edge devices, or IoT devices are limited, unlike cloud-based systems.
[0007] The published patent application DE102017205163A1 relates to a bidirectional chained blockchain. An additional block is generated after a last block, and a first check value of the last block is added to the last block. The first check value of the last block is calculated using a first hash value, the calculation of which comprises applying a hash function to the data stored in the last block and the data to be stored in the additional block. A check value of the additional block is added to the additional block. The check value of the additional block is calculated using a second hash value, the calculation of which comprises applying the hash function to the data stored in the last block and the data to be stored in the additional block.
[0008] The published patent application US20170338957A1 concerns the rewriting of blockchains. This involves receiving instructions from a trusted authority to perform a non-tamper-proof rewriting, whereby modified data replaces the original data in a payload field.
[0009] The published patent application CN107995120A shows a method for creating a multi-blockchain with a main chain and service chains, where a service chain transmits data to the main chain.
[0010] The disclosure document US20160028552A1 describes a "slidechain" in which multiple valid branches or forks of a blockchain are continued.
[0011] The disclosure document CN106503992A shows two blockchain chains.
[0012] The published patent application CN108510268A shows a blockchain ring structure. Transaction data in existing blocks are closed by changing the ring closure, making the chain untraceable.
[0013] The published patent application CN108519985A shows a so-called backlink, which affects the traceability of the chain's tamper-evident nature. The backlink allows a previously generated block to be subsequently modified.
[0014] Against this background, it is an object of the present invention to provide a use of a blockchain in such a way that the storage space requirement for a blockchain on a node can be reduced.
[0015] This object is achieved by the subject matter of the independent claims. Advantageous embodiments are specified in the dependent claims.
[0016] The invention relates to a computer-implemented method for creating a blockchain with blocks comprising an adjustable number of transaction blocks and several intermediate blocks, wherein the blockchain is part of a distributed database system; wherein blocks are generated within the blockchain and a respective block references a respective preceding block, wherein a first intermediate block is provided; wherein at least one second intermediate block is generated; wherein the second intermediate block references a preceding block and at least the first intermediate block.
[0017] The blockchain is a component of a distributed database system. A distributed database system means that the database information, specifically the chain in the form of a blockchain, is available or storable at multiple locations or by multiple participants. The principle of a blockchain in a distributed database system is based on the decentralized availability of the information from the blockchain. Participants in the distributed database system can participate in the creation of new blockchains or review or verify blockchains. Furthermore, a participant can also access only one or more blockchains or use one or more individual blocks of a blockchain.
[0018] According to the present application, transaction blocks and intermediate blocks are provided as blocks. A transaction block that references a previous transaction block is known from the prior art. In particular, a blockchain is constructed by creating a transaction block, submitting a transaction to the distributed database system, and linking it to existing transaction blocks. In this way, an existing blockchain chain is essentially continued or expanded.
[0019] By selecting a referenced block in a blockchain chain, the chain is determined at which point, or based on which last transaction or block, the chain continues. In particular, the choice of the block referenced when creating a blockchain is arbitrary. Advantageously, the most recent block confirmed by the distributed database system is chosen for referencing. In this way, confirmed or validated chains are efficiently extended.
[0020] It is now proposed to generate at least one intermediate block. In addition to the regular reference to the previous block, an intermediate block has a second reference, namely one to a previous intermediate block. The term referencing can be understood, for example, as chaining with another block or integrating another block by means of a checksum via the integrated or chained block. This double referencing makes it possible to flexibly validate the blockchain thus generated and confirmed by the decentralized blockchain network: on the one hand, a complete replication of the generated blocks, in particular all generated blocks, can be carried out. Likewise, the chain can be reconstructed based on the intermediate blocks and their references to previous intermediate blocks.Blocks that lie between two intermediate blocks, especially transaction blocks, can be omitted from validation if the integrity of the chain is verified via the intermediate blocks.
[0021] For example, a second intermediate block is generated in a chain of transaction blocks. The second intermediate block is created in such a way that it almost regularly references a previous block. This means that the second intermediate block is generated as a block within the blockchain, extending or continuing an existing blockchain chain.
[0022] In addition, the second intermediate block references at least the first intermediate block. The second intermediate block thus contains at least two references. These could be, for example, the checksums of two different states of the blockchain. On the one hand, by concatenating the previous block, the blockchain continues in the usual way. The previous block is, in particular, a regular transaction block.
[0023] The second intermediate block contains a checksum of the blockchain chain up to the second intermediate block itself, based on the directly preceding block. Furthermore, the second intermediate block also contains a checksum of the blockchain for the status of a generated first intermediate block. For example, this is the state of the blockchain after creation or after validation of the first intermediate block.
[0024] Thus, by means of the second intermediate block, which references the first intermediate block, a reference to an earlier state of the blockchain is created.
[0025] Advantageously, the blockchain can be continued based on the second intermediate block. The integrity of transactions stored in the blockchain is possible thanks to the second intermediate block and the first intermediate block, even if transaction blocks generated between the first intermediate block and the second intermediate block are no longer available.
[0026] Advantageously, in the proposed method, a current transaction that is made available to the blockchain network and is to be chained becomes available to all nodes as the transaction block becomes available in the blockchain network. The method for creating a blockchain with an adjustable number of transaction blocks thus does not affect the availability of the current transaction blocks.
[0027] An intermediate block can be confirmed by the blockchain network in a similar way to conventional transaction block generation methods, such as mining. For example, an intermediate block is generated using a mechanism based on proof-of-work, proof-of-stake, or proof-of-authority.
[0028] In particular, the references of intermediate blocks to previous intermediate blocks do not require special attention when creating further blocks after an intermediate block. In particular, the validation and chaining of an intermediate block also occurs in the regular manner.
[0029] Other nodes, for example nodes in a cloud in which the blockchain network is distributed, can thus treat the blockchain with one or more intermediate blocks regularly and, for example, only consider the reference to the previous transaction block of the respective intermediate block.
[0030] The integrity of a blockchain is possible due to the referencing of the first intermediate block in the second intermediate block without any blocks generated between the first and second intermediate blocks.
[0031] According to one embodiment, the first intermediate block is a genesis block. In this embodiment, the first intermediate block plays a special role and is itself the genesis block. The second intermediate block then references the genesis block in addition to the previous block. In a variant in which the first intermediate block is the genesis block, blocks from the second intermediate block onward can be validated based on the reference to the genesis block. Transactions stored in blocks between the genesis block and the second intermediate block are not required to verify the integrity of the blocks from the second intermediate block onward.
[0032] According to one embodiment, a genesis block is provided, and furthermore, the first intermediate block is generated, wherein the first intermediate block references a preceding block and at least the genesis block. Depending on the nature of the chain or the frequency of generated blocks, in particular the generated transaction blocks, the first intermediate block can advantageously serve as a reference and data set for the checksum or hash value generation of the second intermediate block, independent of the genesis block.
[0033] According to one embodiment, at least one transaction block is generated between the first intermediate block and the second intermediate block. The second intermediate block is advantageously generated according to a rule that takes into account the circumstances of a blockchain application or the properties of a blockchain and that accordingly aims to achieve intermediate blocks after a certain number of transaction blocks. The rule can provide a variety of mechanisms to achieve this goal. The more transaction blocks are provided between the intermediate blocks, the more blocks can be ignored when checking the blockchain based on the intermediate blocks and their reference to previous intermediate blocks.
[0034] According to one embodiment, to shorten the blockchain, at least the number of transaction blocks between the second intermediate block and the first intermediate block is reduced. In particular, all transaction blocks generated between the second intermediate block and the first intermediate block are removed.
[0035] One or more transaction blocks located between the first intermediate block and the second intermediate block are removed, reducing the size and thus the required storage capacity of the blockchain on a node.
[0036] The node performing the shortening can be any of the nodes participating in the blockchain network. Ideally, the entire blockchain, including all transaction blocks, should be stored on at least one of the participating nodes, so that transaction blocks no longer present in the shortened blockchain can be accessed if necessary.
[0037] The shortened blockchain can still be verified for integrity or authenticity by using the reference of the second intermediate block to the first intermediate block. In this way, the integrity of the blocks from a genesis block up to the second intermediate block can be verified, since the chain is not interrupted by missing transaction blocks between the first intermediate block and the second intermediate block due to the reference to the first intermediate block. Advantageously, both the authenticity of the transactions still available in the shortened blockchain before the first intermediate block and that of the transactions after the second intermediate block can be verified, in particular by performing a checksum calculation across all blocks, including the intermediate blocks.Since the second intermediate block also contains the checksums of the first intermediate block, the blockchain can be continuously traced using checksums, even across the gap created by the removed transaction blocks. Thus, the transactions of the non-removed transaction blocks remain tamper-proof, even in the shortened blockchain.
[0038] The fact that the second intermediate block and all subsequent blocks can be trusted is ensured by the fact that the intermediate blocks are also confirmed by the blockchain's consensus mechanism, just like in a regular blockchain network.
[0039] Shortening the blockchain is particularly useful for nodes that are designed for devices with limited storage capacity. For example, in an industrial environment, these are so-called edge devices, which serve as an interface to a cloud and can also store or process relevant data locally within an industrial plant.
[0040] In particular, all transaction blocks between two intermediate blocks are removed. Transactions between two intermediate blocks are fully verifiable if all are present and all checksums can be recalculated, as is the case in a conventional blockchain. Therefore, shortening the blockchain can be advantageously optimized with regard to storage space requirements by ensuring that the shortened blockchain does not contain a transaction block between the second intermediate block and the first intermediate block. In special cases where, for example, no transaction block was generated between two intermediate blocks due to the policy governing the generation of an intermediate block or due to a lack of generated transaction blocks, shortening can be performed analogously.In this case, for example, an intermediate block contains the checksum of the previous intermediate block twice: once due to the reference to the immediate predecessor block and once due to the reference to the previous intermediate blocks. Shortening the blockchain does not reduce storage space in this special case.
[0041] According to one embodiment, a device participating in a distributed database system, in particular a device in a cloud, an edge device, or an IoT device, stores a shortened blockchain. In this way, a device with limited storage capacity can flexibly store a shortened blockchain that requires less storage space. For example, a device first stores the unabridged blockchain and then shortens it by deleting transaction blocks between any intermediate blocks.
[0042] According to one embodiment, to extend the blockchain, transaction blocks between the first intermediate block and the second intermediate block are retrieved from a stored, unabridged blockchain and inserted. Thus, a truncated blockchain can advantageously be extended back to an unabridged one. This extension can be performed for transaction blocks between selected intermediate blocks or for all removed transaction blocks, i.e., for transaction blocks between all intermediate blocks between which a shortening was previously performed.
[0043] According to one embodiment, referencing a block to be referenced comprises storing or storing a checksum of the block to be referenced or of a part of the block to be referenced in the referencing block. The checksum is, in particular, a hash value or a cryptographic hash value.
[0044] According to one embodiment, intermediate blocks do not contain any transactions. An intermediate block is confirmed by the blockchain network in a similar way to the known method for generating a transaction block, such as mining. Only the content of the generated intermediate block contains no payload data in this embodiment. In the case of a shortened blockchain, very little transaction data remains in the shortened blockchain. According to another variant, an intermediate block is a block that itself contains a transaction. This means that an intermediate block can have a dual function: on the one hand, it can be a transaction block within a blockchain, and at the same time, it can assume the functionality of an intermediate block through an additional reference to an earlier intermediate block.The transaction in an intermediate block is also protected against tampering, as subsequent transaction blocks also reference the intermediate block itself and thus link any transaction stored there. However, transactions stored in intermediate blocks are not removed when the blockchain is shortened.
[0045] Removing transaction blocks between all existing intermediate blocks, for example, between the genesis block and the first intermediate block, between the first intermediate block and the second intermediate block, and between the second intermediate block and another intermediate block, etc., results in a shortened blockchain containing only transactions subsequent to the last generated intermediate block. This is particularly advantageous in applications where the history of transaction data chained before the last generated intermediate block is no longer of interest. In such a scenario, a particularly large amount of storage space can be freed up, or the blockchain requires very little storage space, while still retaining all transaction data from the recent past.The period for which a transaction history is available can advantageously be controlled by the rule for generating the intermediate blocks or, alternatively, by specifying the transaction blocks to be deleted.
[0046] According to one embodiment, further intermediate blocks are generated, with each further intermediate block referencing a respective preceding block and a respective preceding intermediate block. The method can be extended to any number of intermediate blocks, with successive intermediate blocks each being configured analogously to the first and second intermediate blocks. A third intermediate block can thus follow the second, a fourth intermediate block the third, and so on.
[0047] According to a further development, the second or a respective further intermediate block is generated in a rule-based manner, for example at a predeterminable point in time or at a predeterminable time interval from a previous block or a predeterminable time interval from a previous intermediate block or after a predeterminable number of generated transaction blocks or by means of a context-based triggering condition or manually. Advantageously, it is possible to specify the frequency or regularity of generated intermediate blocks using a rule for generating the intermediate blocks. Depending on the application, intermediate blocks can be generated in such a way that transaction blocks from specific time ranges can be flexibly removed.
[0048] For example, this allows for the removal of generated blocks from a selectable time period with particularly fine granularity, for example, when the transaction history for this period is of little interest. For example, intermediate blocks can be created at longer intervals for use cases where experience has shown that only the most recent transaction data is of interest retrospectively on a device within the automation system. By removing transaction blocks from such a range, a large amount of storage space can be saved by performing a single delete action between two intermediate blocks.
[0049] In other use cases, an intermediate block can be generated at shorter intervals, for example if experience shows that only certain parts of the generated transaction blocks are of interest for historical analysis and other parts can be deleted from the history.
[0050] Advantageously, an intermediate block is only generated once a certain number of transaction blocks have been generated. This ensures that an intermediate block is only generated when removing the transaction blocks up to the previous intermediate block exceeds a certain storage space saving threshold. This prevents, for example, the removal of transaction blocks between two intermediate blocks from having little impact on the size or length of the entire blockchain.
[0051] A context-based condition advantageously generates an intermediate block depending on a context, such as the context of an automation project. For example, an order system controls the creation of an intermediate block. This advantageously allows intermediate blocks to be created at the beginning and after the completion of a batch. This allows the removal of transaction blocks between intermediate blocks or the retention of these blocks in the blockchain for a specific batch or order.
[0052] Furthermore, an intermediate block can be created, for example, when a new parameter setting is used in an automated process, for example after a tool change in a machine tool or after adjusting controllers in a production machine in response to environmental influences.
[0053] According to one embodiment, at least one of the further intermediate blocks references at least two of the preceding intermediate blocks by referencing several preceding intermediate blocks in one intermediate block, for example, by the hash value of several preceding intermediate blocks containing the status of the blockchain at the respective point in time. This makes it possible to shorten the blockchain to several lengths starting from the doubly referencing intermediate node. This means, for example, the section of the chain between the doubly referencing intermediate node and the older referenced intermediate node, or between the doubly referencing intermediate node and the younger referenced intermediate node, can be deleted from the blockchain.
[0054] In a further development, for example, an intermediate block can reference all previous intermediate blocks. While this increases complexity due to the inflation of references in the intermediate block, this allows a very large number of blocks (i.e., transaction blocks and previous intermediate blocks) to be removed from the blockchain in a single operation, thus efficiently shortening the blockchain.
[0055] According to one embodiment, each intermediate block references the respective preceding intermediate block, and selected intermediate blocks additionally reference further preceding intermediate blocks. This allows a compromise to be created so that, on the one hand, the number of references does not increase exponentially with newly generated intermediate blocks, while, on the other hand, selected intermediate blocks still reference two or more preceding intermediate blocks.
[0056] According to one embodiment, an intermediate block is generated as the selected intermediate block at a predeterminable time or at a predeterminable time interval from a previous or previously selected intermediate block, or after a predeterminable number of generated transaction blocks or intermediate blocks, or by means of a context-based triggering condition, or manually. The mechanisms that trigger the generation of a selected intermediate block with double or multiple references can be selected analogously to the creation of an intermediate block.
[0057] The invention further relates to a storage medium of a device participating in a distributed database system, in particular a device in a cloud or an edge device or IoT device, comprising a blockchain with blocks comprising an adjustable number of transaction blocks and a plurality of intermediate blocks, wherein the blockchain is part of the distributed database system; wherein a respective block references a respective preceding block; comprising a first intermediate block and at least one second intermediate block; wherein the second intermediate block references a preceding block and at least the first intermediate block.
[0058] According to one embodiment, the storage medium is implemented on an edge device or an IoT device and has stored a blockchain shortened according to the method described above.
[0059] Advantageously, a blockchain with the described intermediate blocks is generated, distributed, confirmed, decentrally managed, or stored in the blockchain network. A node in the blockchain network can thus decide in any way whether to store a complete blockchain, including the generated transaction blocks and intermediate blocks, or whether to shorten the blockchain according to the described method and store the shortened blockchain. In particular, network nodes with limited storage capacity, such as edge devices or IoT devices within automation systems, can advantageously store the shortened blockchain.
[0060] According to one embodiment, the storage medium is implemented on an edge device or IoT device and stores a blockchain extended according to the method described above. Advantageously, at least one node is provided in the blockchain network that reliably stores the entire blockchain. In an automation system connected to a cloud, this can be a blockchain node of the system operator or a blockchain node of the cloud service, for which a system operator defines rules, and which stores the entire blockchain, including all transaction blocks. For example, a device in the automation system that has only stored a shortened blockchain can then request the transaction blocks not contained in the shortened blockchain and integrate them back into the blockchain.In particular, this process can be used to verify whether all requested and provided transaction blocks are intact and untampered with by reconstructing the block checksums. This way, the device with the stored shortened blockchain receives the expanded blockchain again after integrating the blocks from the full blockchain. All removed blocks or only parts of them can be requested, so that the blockchain is expanded but still reduced compared to the full blockchain on the edge device or IoT device.
[0061] The invention further relates to an edge device comprising a storage medium according to one of the above-described embodiments of the storage medium.
[0062] The invention further relates to a computer program product comprising a computer program having means for carrying out the method according to one of the embodiments described above when the computer program is executed on a program-controlled device.
[0063] The invention is explained in more detail below by means of examples and the figures. They show: Figure 1 a schematic representation of two blockchains according to a first embodiment; Figure 2 a schematic representation of two blockchains according to a second embodiment of the invention; Figure 3 a schematic representation of two blockchains according to a third embodiment of the invention; Figure 4 a schematic representation of two blockchains according to a fourth embodiment of the invention; Figure 5a schematic representation of blockchain network nodes within a cloud environment and blockchain network nodes in an automation system.
[0064] According to a first embodiment of the invention, a blockchain is generated such that, in addition to regular transaction blocks, intermediate blocks are generated at regular intervals. The blockchain is based on a genesis block G. Transaction blocks are created based on the genesis block G and linked into the blockchain. Figure 1Such a transaction block T is marked as an example. For simplicity, only one transaction block has been provided with a reference symbol for illustration purposes. After a predefined and flexibly selectable time interval from the genesis block G, a first intermediate block A1 is created. This does not contain any transactions itself, but is created similarly to a transaction block, sent as a broadcast to the blockchain network, confirmed by a consensus mechanism used in the blockchain, and chained into the blockchain. As usual, it directly references the previous transaction block as well as the genesis block G.
[0065] If the first intermediate block A1 is successfully confirmed by participating nodes in the distributed database system that uses the blockchain, in particular through so-called mining, the first intermediate block A1 continues the blockchain like a regular block.
[0066] At a certain time interval from the first intermediate block A1, further intermediate blocks are generated. In this sequence, the (n-1)th intermediate block A n-1 is also generated. The nth intermediate block AN is generated again at a time interval. According to the first embodiment of the invention, the blockchain 10 thus generated is distributed within a blockchain network, for example, within a private blockchain network. For example, a blockchain network is provided within a group of companies that cooperate at various operational levels to produce a product. The complete blockchain 10 is stored, for example, in a node of each of the participating companies.
[0067] Also part of the blockchain network are nodes belonging to individual companies located within an automation network. This network is connected to the blockchain network NW. For example, one of the nodes of the blockchain network is located on an IoT device. The available storage space on this IoT device is limited. For example, the IoT device performs control tasks within the plant and is simultaneously connected to an office or IT network. The IoT device is particularly accessible via the internet. The IoT device accesses the blockchain to, for example, have transactions for a current automation project or for a current batch available in a tamper-proof manner. This transaction data can consist of parameter sets or configuration parameters, for example.
[0068] The transaction data can also include order data from an order. For example, the IoT device is interested in an area of the blockchain that contains transaction data created after the (n-1)th intermediate block A n-1.
[0069] The IoT device can advantageously store a shortened blockchain 11. For this purpose, transaction blocks that were created before the (n-1)th intermediate block are removed from the blockchain. The intermediate blocks remain in the blockchain. This creates a chain consisting of the genesis block G, the first intermediate block A 1 , possibly further intermediate blocks, the (n-1)th intermediate block A n-1 , and subsequent transaction blocks. Such a shortened blockchain 11 and the current transaction blocks contained therein can be validated starting from the genesis block G by tracing the checksum formation across the individual blocks. Due to the inclusion of the checksums from a respective previous intermediate block in an intermediate block, the chain of blocks contained in the shortened blockchain 11 is validatable.
[0070] The required storage space for the shortened blockchain 11 has been reduced by the size of all removed transaction blocks. Both the generation of the (n-1)th intermediate block A n-1 and its selection as an intermediate block for deleting previous transaction blocks can be customized to the automation project. If the generation of intermediate blocks depends on a selectable time interval from previous intermediate blocks, an intermediate block generated before the relevant section of the blockchain can be selected when shortening the blockchain.
[0071] In Figure 2 a second embodiment of the invention is shown, in which a blockchain 20 similar to that used in the context of Figure 1described blockchain 10 is created. In contrast to the first embodiment, for shortening the blockchain 20 by removing transaction blocks before the intermediate block A n, a section of the blockchain is excluded from the removal of the intermediate blocks. Transaction blocks that lie between the (b-1)th intermediate block A b-1 and the bth intermediate block A b are not removed according to the second embodiment of the invention. Thus, a shortened blockchain 21 is created which removes older transaction blocks that were generated before the intermediate block A n, except for those between the (b-1)th intermediate block A b-1 and the bth intermediate block A b.
[0072] Thus, the blockchain 20 is effectively reduced to a shortened blockchain 21, saving the storage space freed up by the removed transaction blocks. However, a time period is specifically excluded so that transaction blocks from this time period are also available in the shortened blockchain 21. For example, in the shortened blockchain 21, so-called golden batches, which are known from process engineering and represent a benchmark for current production batches, are retained as retrievable transaction data in the block change in order to be able to perform a corresponding comparison of the batch data in the shortened blockchain as well. In addition, for example, the most recent transaction data generated after the intermediate block A n is retained as history.
[0073] According to a third exemplary embodiment of the invention, a block change 30 is created in such a way that, for example, the n-th intermediate block A n, in addition to the directly preceding transaction block and the most recently generated (n-1)-th intermediate block A n -1, additionally references, for example, the first intermediate block A 1. In one variant, the n-th intermediate block A n references further intermediate blocks (not shown). When shortening the blockchain 30 to a shortened blockchain 31, between a selected time range, for example between the first intermediate block A 1 and the n-th intermediate block A n, in addition to the transaction blocks from this time period, the generated intermediate blocks in this time period, in particular the n-1-th intermediate block A n-1, can be removed.
[0074] The complete verifiability of the blockchain chain is nevertheless ensured in the shortened blockchain 31 by the reference of the nth intermediate block A n to the first intermediate block A 1 . Advantageously, not all intermediate blocks reference multiple previous intermediate blocks to avoid reference inflation and the associated complexity. However, such an intermediate block can be provided at longer time intervals, which in particular contains an additional intermediate block as a checksum.
[0075] In Figure 4Another possible alternative is shown: creating a blockchain 40 with intermediate blocks. Several or, in particular, all of the generated intermediate blocks also reference the genesis block G. A shortened blockchain 41 can then be generated such that transaction data before an (n-1)th intermediate block A n-1 is removed. This automatically shortens the blockchain to the shortest possible length. This configuration can be interesting for use cases in which transaction data is irrelevant in an initial phase of the blockchain, for example, because it is test data or test configuration data sets that should not be used in the further process, for example, because it leads to poor or non-optimized system conditions.
[0076] The options for referencing intermediate blocks and corresponding options for shortening the blockchain described in embodiments 1 to 4 can also be used in combination. For example, different mechanisms can be used to generate intermediate blocks at different time periods within the blockchain. The trigger mechanism for creating an intermediate block within a blockchain can also vary. For example, at the beginning of a blockchain, which is rebuilt when an automation system starts up, a fixed time interval can be specified, while intermediate blocks are triggered context-based as the process progresses.
[0077] Based on Figure 5 illustrates how shortened blockchains 11, 21, 31 are used in an application scenario of an automation system. Figure 5shows a blockchain network NW consisting of blockchain nodes 151, 152, 101, 201, 301. For illustrative purposes, only five nodes participating in the blockchain network NW were shown. In particular, in a cloud 150, which is shown in the upper half of the figure Figure 5 As shown, a large number of nodes participate. The nodes 151, 152 in the cloud 150 are connected via the blockchain network NW to nodes within an automation system 101, 201, 301.
[0078] The nodes of the automation systems are located in the lower half of the Figure 5This can, for example, be an industrial plant in which the nodes 101, 201, 301 are located close to each other and are implemented on different devices 100, 200, 300 of the automation system. Likewise, the nodes can be provided in several spatially separated plants, which, for example, belong to one company. Furthermore, the Figure 5 The nodes shown may be intended for use in networks of different companies.
[0079] This will be illustrated by the Figure 5 That there is usually sufficient storage space available for 150 nodes in the cloud. However, for nodes on 100, 200, or 300 devices within automation systems, available storage is often a limiting factor.
[0080] For example, an edge device 100 is provided in a first automation system, which serves as a gateway between an automation network that regulates the control of automation devices, and a communication network in the cloud 150. The edge device 100 collects data from the automation system that can be used for a service in the cloud 150. For example, monitoring data is collected in this way and is to be made available for big data analysis in the cloud 150. For example, the edge device 100 pre-processes the collected data before sending it to the cloud. For example, the recorded data is anonymized, or data from specific time periods is collected or sorted by time periods and made available.
[0081] In another automation system, for example, an ... edge device 200 is provided, which is also responsible for encrypted exchange with the cloud service.
[0082] In another automation system, for example, an IoT device 300 is provided, which, for example, controls a packaging process and at the same time has a communication connection to a logistics provider via an Internet connection.
[0083] Edge device 100, edge device 200, and IoT device 300 all have limited available storage space. These devices therefore have an interest in saving storage space. According to the fifth exemplary embodiment of the invention, a blockchain application is also implemented on the devices. Data relating to operator actions or quality control information is to be secured via a blockchain. This data is to be verifiably untampered with in the blockchain.
[0084] At the same time, the described devices—edge device 100, edge device 200, and IoT device 300—are used in the production and processing of a product in a manner close to automation. This means that, as a rule, a relatively recent history of recorded data is locally relevant. Data from this short-term archive should therefore ideally be available on the respective device. At the same time, the blockchain on the respective device should also require as little storage space as possible. This challenge is solved by the respective node 101, 201, 301 storing a shortened blockchain 11, 21, 31 on the respective device 100, 200, 300. The blockchains described above are suitable as shortened blockchains 11, 21, 31.
[0085] There are several ways for a respective node 101, 201, 301 to obtain a shortened blockchain. For example, as long as sufficient memory is available, the blockchain can be maintained regularly and without shortening it. As soon as a certain amount of memory space is occupied by the blockchain, a mechanism is triggered to shorten the blockchain. With this process, a respective node on the respective automation device has the largest possible number of transaction blocks, and thus also of completed transactions, such as recorded quality data, available until the available memory space is no longer sufficient. From this point on, for example, a part of the blockchain can be deleted regularly, or a larger section of the blockchain can be deleted once, until the memory space usage threshold is exceeded again.
[0086] In another variant, a node 101 from an automation system regularly queries the network for a blockchain status, for example, by communicating with a node 152 in the cloud, while simultaneously removing irrelevant transaction blocks. In this way, a shortened blockchain is stored on the edge device 100 from the outset.
[0087] In an advantageous way, it prevents a blockchain from constantly growing on a node that shortens the blockchain and thus causes memory overflow.
[0088] Especially for intermediate blocks that do not contain any transactions themselves, but only a reference to the last block and the preceding intermediate block, the footprint of an intermediate block is consistently small. The growth of chained intermediate blocks no longer poses a risk, even for devices with limited resources.
[0089] The deletion of blocks is advantageously performed locally on a blockchain node. In particular, any number of devices in the blockchain network (NW), with their specific constraints regarding available resources, can flexibly remove different time periods from the locally stored blockchain. The shortened blockchain can also be referred to as a stripped blockchain, and the node with the shortened blockchain can be referred to as a stripped node.
[0090] The proposed invention enables a targeted deletion and at the same time a deliberate retention of relevant user data stored in a blockchain in a selected period of time, which can be determined by intermediate blocks.
[0091] A stripped blockchain or a stripped node is capable of reclaiming previously deleted blocks from a complete blockchain or a full node and inserting them into the corresponding areas between the intermediate blocks selected for deletion. This is particularly advantageous when data from the removed area of the blockchain becomes relevant for later analysis, for example, when a customer of a product originating from a batch wants to obtain supply chain information. Furthermore, the data from the removed area may also be required as reference data for configuring a control system.
[0092] At the same time, even on the shortened blockchains, it is ensured that current transactions are locally available. In addition to the fact that the intermediate blocks for deletion can be flexibly selected, thus eliminating the need to select more recent intermediate blocks, the time period generated after the most recently generated intermediate block is exempt from data deletion.
[0093] Current transactions are therefore immediately available everywhere as soon as their block is available in the blockchain network, meaning that querying the most recent production data is just as possible via the cloud as querying historical data.
[0094] Historical information within a blockchain network therefore only needs to be available in blockchain nodes where it is relevant, for example, on long-term archive servers or in a cloud. At the same time, starting an IoT device that runs a reduced or stripped blockchain node is significantly faster because deleted blockchain sections do not need to be loaded.
Claims
1. Computer-implemented method for creating a blockchain (10, 11, 20, 21, 30, 31, 40, 41) with blocks comprising an adaptable number of transaction blocks (T) and a plurality of intermediate blocks (A1, A(b-1), Ab, A(n-1), An), - wherein the blockchain (10, 11, 20, 21, 30, 31, 40, 41) is part of a distributed database system (NW); - wherein blocks are generated within the blockchain (10, 11, 20, 21, 30, 31, 40, 41) and a respective block references a respective preceding block, - wherein a first intermediate block (A1, G) is provided; - wherein at least one second intermediate block (A2) is generated, - wherein at least one transaction block is generated between the first intermediate block (A1) and the second intermediate block (A2), - wherein the second intermediate block (A2) references a block preceding it and also references at least the first intermediate block (A1, G).
2. Method according to Claim 1, wherein the first intermediate block is a genesis block (G).
3. Method according to Claim 1, wherein a genesis block (G) is provided and the first intermediate block (A1) is furthermore generated, wherein the first intermediate block (A1) references a block preceding it and also references at least the genesis block (G).
4. Method according to any of the preceding claims, wherein for shortening the blockchain (10, 11, 20, 21, 30, 31, 40, 41) at least the number of transaction blocks between the second intermediate block (A2) and the first intermediate block (G, A1) is reduced, in particular all transaction blocks generated between the second intermediate block (A2) and the first intermediate block (G, A1) are removed.
5. Method according to any of the preceding claims, wherein a shortened blockchain is stored by a device (100, 200, 300) participating in a distributed database system (NW), in particular a device in a cloud or an edge device or IoT device.
6. Method according to any of the preceding claims, wherein for extending the blockchain (10, 11, 20, 21, 30, 31, 40, 41) transaction blocks between the first intermediate block (G, A1) and the second intermediate block (A2) are interrogated from a stored unshortened blockchain and are inserted.
7. Method according to any of the preceding claims, wherein referencing of a block to be referenced comprises recording or storing a checksum of the block to be referenced or of a part of the block to be referenced in the referencing block.
8. Method according to any of the preceding claims, wherein the first intermediate block (G, A1) and the second intermediate block (A2) each include no transaction.
9. Method according to any of the preceding claims, wherein further intermediate blocks (A(b-1), Ab, A(n-1), An) are generated, wherein a respective further intermediate block (A(b-1), Ab, A(n-1), An) references a respectively preceding block and also a respectively preceding intermediate block.
10. Method according to any of the preceding claims, wherein generating the second intermediate block (A2) or a respective further intermediate block (A(b-1), Ab, A(n-1), An) is effected in a rule-based manner, in particular at a predefinable point in time or with a predefinable time gap with respect to a preceding block or a predefinable time gap with respect to a preceding intermediate block or after a predefinable number of generated transaction blocks or by means of a context-based triggering condition, or is effected manually.
11. Method according to either of Claims 9 and 10, wherein at least one of the further intermediate blocks (A(b-1), Ab, A(n-1), An) references at least two of the preceding intermediate blocks.
12. Method according to any of the preceding claims, wherein a respective intermediate block references the respectively preceding intermediate block, and wherein selected intermediate blocks additionally reference further preceding intermediate blocks.
13. Method according to Claim 12, wherein as selected intermediate block an intermediate block is generated at a predefinable point in time or with a predefinable time gap with respect to a preceding or previously selected intermediate block or after a predefinable number of generated transaction blocks or intermediate blocks or by means of a context-based triggering condition or manually.
14. Storage medium of a device (100, 200, 300) participating in a distributed database system (NW), in particular of a device in a cloud or of an edge device or IoT device, for storage and use of a blockchain (10, 11, 20, 21, 30, 31, 40, 41) by one of the devices (100, 200, 300), the blockchain with blocks comprising an adaptable number of transaction blocks and a plurality of intermediate blocks, - wherein the blockchain (10, 11, 20, 21, 30, 31, 40, 41) is part of the distributed database system (NW); - wherein a respective block references a respective preceding block, - having a first intermediate block (A1, G) and at least one second intermediate block (A2), - wherein at least one transaction block is generated between the first intermediate block (A1) and the second intermediate block (A2), - wherein the second intermediate block (A2) references a block preceding it and also references at least the first intermediate block (A1, G).
15. Storage medium according to Claim 14, wherein the storage medium is implemented on an edge device or an IoT device and has stored a blockchain shortened in a manner according to Claim 5.
16. Storage medium according to Claim 14, wherein the storage medium is implemented on an edge device or IoT device and has stored a blockchain extended in a manner according to Claim 7.
17. Edge device having a storage medium according to any of Claims 14-16.
18. Computer program product with a computer program which has means for carrying out the method according to any of Claims 1 to 13 when the computer program is executed on a program-controlled device.
