Blockchain Smart Contract Swapping With Array-Based Process Management
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The existing method for swapping smart contract processes in and out of docker environments in blockchain systems, using a least recently used (LRU) algorithm with linked lists, consumes excessive resources and reduces transaction processing efficiency due to complex operations and resource overheads.
Innovation Solution
A maintenance array is used to manage smart contract processes, utilizing flag values to determine which processes to swap in and out, reducing the need for complex linked list operations and minimizing resource usage.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If a linked list is used to implement LRU algorithm for contract process swapping, then contract process management is achieved, but a large amount of docker resources are occupied and operations become complicated
Solution Approach 1:
The patent uses a simplified array structure to copy and store contract process information, replacing the complex linked list. The array stores contract process IDs and their access times, providing a simpler way to manage contract processes without the overhead of linked list node allocations and pointer manipulations.
Solution Approach 2:
The patent replaces the mechanical linked list data structure with a more efficient array-based system. Instead of using linked list nodes with pointers, the invention uses a fixed-size array with indices to track contract processes, reducing the complexity of operations and resource requirements.
2Productivity
If a linked list is used for LRU algorithm, then contract process swapping is implemented, but docker resources are excessively occupied
Solution Approach 1:
The patent creates a simplified representation of contract processes using an array, copying only the essential information (contract process ID and access time) needed for LRU functionality. This eliminates the need for complex linked list structures and reduces docker resource consumption significantly.
Solution Approach 2:
The patent changes the data structure parameter from a linked list to an array, which has different memory characteristics and lower overhead. The array provides a more compact and resource-efficient way to store and manage contract process information while maintaining LRU functionality.
3Reliability
If complex linked list operations are used for contract process swapping, then LRU algorithm is implemented, but transaction processing efficiency is reduced
Solution Approach 1:
The patent uses a simplified array structure to copy and store contract process information, replacing the complex linked list. The array stores contract process IDs and their access times, providing a simpler way to manage contract processes without the overhead of linked list node allocations and pointer manipulations, thereby improving transaction processing efficiency.
Solution Approach 2:
The patent replaces the mechanical linked list data structure with a more efficient array-based system. Instead of using linked list nodes with pointers, the invention uses a fixed-size array with indices to track contract processes, reducing the complexity of operations and resource requirements, which directly improves transaction processing efficiency.
Data Source
AI summary
A block chain-based transaction processing method includes: determining a smart contract configured for processing a transaction; determining a target resident contract process according to flag values corresponding to resident contract processes recorded in a maintenance array, the maximum number of resident contract processes recorded in the maintenance array being the maximum number of contract processes supported by a docker deployed in a block chain node; replacing, in the maintenance array, the target resident contract process with a target contract process corresponding to the smart contract, and modifying a target flag value corresponding to the target contract process to a first value, the first value characterizing that a corresponding contract process is in an executed state; and transmitting the transaction to the target contract process for processing.


