Block chain-as-a-service-oriented cross-virtual-machine collaborative parallel computing method and system

By constructing a cross-heterogeneous virtual machine collaborative computing architecture and utilizing machine learning and parallel execution result correction mechanisms, the problems of low collaborative efficiency and high conflict rate of multiple virtual machines in blockchain platforms are solved, achieving efficient and secure cross-platform data sharing and collaborative computing.

CN121387435APending Publication Date: 2026-01-23SHANGHAI JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511550698.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-28
Publication Date
2026-01-23

AI Technical Summary

Technical Problem

Compatibility issues between different blockchain platforms and virtual machine environments make it difficult for cross-chain applications to perform efficient, secure, and flexible collaborative computing, increasing system development costs and maintenance complexity, and limiting the scalability and universality of blockchain services.

Method used

We construct a collaborative computing architecture across heterogeneous virtual machines, extract source code features through machine learning to build a conflict prediction model, apply a parallel execution result correction mechanism, realize data sharing and collaborative execution across heterogeneous virtual machines, provide a unified locking and synchronization mechanism, and support parallel processing of multi-granularity objects.

Benefits of technology

It improves the efficiency and resource utilization of cross-virtual machine collaborative computing, reduces the overhead of execution conflicts, achieves high-performance and secure cross-platform interoperability, and supports user-adaptive parallel execution and data sharing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121387435A_ABST
    Figure CN121387435A_ABST
Patent Text Reader

Abstract

The invention provides a cross-virtual-machine collaborative parallel computing method and system for block chain-as-a-service, and the method comprises the steps: S1, constructing a parallel cross-heterogeneous virtual machine collaborative computing architecture, and providing a plurality of intelligent contract parallel execution mechanisms; s2, under the collaborative computing architecture of the cross-heterogeneous virtual machine, extracting effective features of source codes by using machine learning to construct a conflict prediction model; s3, performing parallel execution result correction on the multi-granularity object based on the output of the conflict prediction model; and S4, completing data sharing and collaborative execution based on a critical data locking and synchronization mechanism of the cross-heterogeneous virtual machine and a correction result. The invention provides a data sharing and collaboration mechanism of a cross-heterogeneous virtual machine, a critical data locking and synchronization mechanism of the cross-heterogeneous virtual machine is introduced, a data sharing and synchronization module is designed, an efficient and parallel heterogeneous virtual machine collaboration execution system is constructed, and fusion and intercommunication of the heterogeneous virtual machines are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer application technology, and more specifically, to a method and system for cross-virtual machine collaborative parallel computing for blockchain-as-a-service. Background Technology

[0002] Blockchain is a decentralized distributed ledger technology that allows multiple participants to collaboratively maintain and verify a shared record of data without a central administrator or intermediary. Blockchain ensures data security, integrity, and immutability through cryptographic algorithms and consensus mechanisms. Blockchain services refer to various functions and services provided based on blockchain technology, leveraging its decentralized, cryptographically secure, and transparent characteristics to offer users different solutions. Blockchain services can cover multiple areas, from data storage to smart contract execution. Blockchain-as-a-Service (BaaS) refers to a cloud platform that provides blockchain development, deployment, and management services. Enterprises can build and deploy their own blockchain applications on a BaaS platform without having to build their own complex infrastructure.

[0003] The rapid expansion and increasing complexity of blockchain applications across diverse scenarios are becoming increasingly apparent. With the emergence of decentralized finance, supply chain management, and trusted data exchange in the Internet of Things, compatibility issues between different blockchain platforms and virtual machine environments are becoming increasingly prominent. A single virtual machine architecture can no longer meet the demands of cross-chain applications for efficient, secure, and flexible collaborative computing. Traditional smart contract execution environments are mostly limited to specific virtual machines, such as EVM and WASM, making direct interaction of application logic and data between different ecosystems difficult. This increases system development costs and maintenance complexity, and also limits the scalability and universality of blockchain services. Therefore, there is an urgent need for software and systems that can support unified scheduling and collaborative computing across multiple virtual machine environments. This would ensure cross-platform interoperability while improving computing efficiency and resource utilization while maintaining security and trustworthiness. It would provide stronger underlying support for blockchain-as-a-service platforms, driving blockchain applications from single-chain to cross-chain, and from isolation to integration, meeting the needs of future diversified business scenarios. Summary of the Invention

[0004] To address the shortcomings of existing technologies, the purpose of this invention is to provide a method and system for cross-virtual machine collaborative parallel computing oriented towards Blockchain-as-a-Service.

[0005] A method for cross-virtual machine collaborative parallel computing for blockchain-as-a-service provided by the present invention includes: Step S1: Construct a parallel cross-heterogeneous virtual machine collaborative computing architecture to provide multiple parallel execution mechanisms for smart contracts; Step S2: Under the cross-heterogeneous virtual machine collaborative computing architecture, machine learning is used to extract effective features from the source code to build a conflict prediction model; Step S3: Based on the output of the conflict prediction model, correct the parallel execution results of the multi-granularity objects; Step S4: Based on the critical data locking and synchronization mechanism across heterogeneous virtual machines and the correction results, complete data sharing and collaborative execution.

[0006] Preferably, step S2 includes the following sub-steps: Step S2.1: Perform static analysis based on machine learning, train and learn the key features in the source code that induce conflicts, filter the features that have an impact on parallel execution conflicts through feature selection algorithm, select an appropriate model according to the size of the dataset, and evaluate the model performance. Step S2.2: Perform static analysis based on shared data. According to the definition of shared data objects in the smart contract source code, extract the set of resources occupied by the transaction, record the dependencies between transactions, and predict transaction conflicts. Step S2.3: For heterogeneous blockchain virtualization platforms, build a unified and adaptable conflict prediction framework based on static code analysis to support smart contract transactions across heterogeneous virtual machines.

[0007] Preferably, step S3 includes: Parallel execution result correction applies parallel capability optimization and performance consistency guarantee techniques to multi-granularity objects, and designs strategy matching, generation, and execution mechanisms and corresponding system frameworks based on heterogeneous virtualization platforms to support user-adaptive conflict avoidance and handling; the multi-granularity objects include programming entities, transactions, and system-level parallel protocols.

[0008] Preferably, step S3 includes the following sub-steps: Step S3.1: Based on the static conflict detection results, apply parallel optimization methods to state-class critical programming entities; Step S3.2: Based on the distribution of state-class critical programming entities across the entire smart contract, and using transactions as the granularity, model and represent the transaction execution chain in the smart contract to achieve intelligent identification and automatic resolution of parallel bottlenecks; Step S3.3: For dynamic conflict scenarios that cannot be resolved by parallel capability optimization, apply an optimistic concurrency control mechanism oriented towards interrupt consistency based on the optimistic concurrency control concept. Step S3.4: Based on a series of strategies for multi-granularity objects in the blockchain system, establish an automatic matching, generation and execution mechanism, implement the corresponding system framework, and connect the core links of conflict detection, parallel optimization and result correction.

[0009] Preferably, step S4 includes the following sub-steps: Step S4.1: Critical data locking and synchronization mechanism across heterogeneous virtual machines. This provides users with unified locking and synchronization execution logic in heterogeneous virtual machines, simplifies the writing of smart contract execution processes, and reduces the additional overhead in the critical data synchronization operation between virtual machines. Step S4.2: Provide function interfaces for inter-virtual machine contract calls, provide users with a transparent cross-virtual machine call process, and automatically establish data type and format conversion mapping rules for calls between heterogeneous virtual machines; Step S4.3: Monitor the platform's execution load status through the monitoring module, and establish a load-aware smart contract dynamic deployment and execution automatic distribution and scheduling mechanism.

[0010] A system for cross-virtual machine collaborative parallel computing for blockchain-as-a-service, provided by the present invention, includes: The static analysis conflict prediction module is used to predict conflicts through static analysis, machine learning, and shared data. The adaptive conflict handling module corrects the parallel execution results of multi-granularity objects based on the conflict prediction results. The data sharing and synchronization module is used to achieve data sharing and collaborative execution through critical data locking and synchronization mechanisms across heterogeneous virtual machines.

[0011] Preferred options also include: The monitoring module is used to monitor the platform's execution load status and provide load information.

[0012] Preferably, the conflict prediction process includes: Static analysis based on machine learning is used to train and learn the key features in the source code that induce conflicts. Feature selection algorithms are used to filter features that have an impact on parallel execution conflicts. Based on the size of the dataset, an appropriate model is selected and the model performance is evaluated. Static analysis is performed based on shared data. According to the definition of shared data objects in the source code of smart contracts, the set of resources occupied by transactions is extracted, the dependencies between transactions are recorded, and transaction conflicts are predicted. For heterogeneous blockchain virtualization platforms, a unified and adaptable conflict prediction framework based on static code analysis is built to support smart contract transactions across heterogeneous virtual machines.

[0013] Preferably, the adaptive conflict handling module includes: Parallel execution result correction applies parallel capability optimization and performance consistency guarantee techniques to multi-granularity objects, and designs strategy matching, generation, and execution mechanisms and corresponding system frameworks based on heterogeneous virtualization platforms to support user-adaptive conflict avoidance and handling; the multi-granularity objects include programming entities, transactions, and system-level parallel protocols.

[0014] Preferably, the adaptive conflict handling module further includes: Based on the static conflict detection results, a parallel optimization method is applied to state-class critical programming entities. Based on the distribution of state-class critical programming entities across the entire smart contract, and using transactions as the granularity, we obtain the modeling and representation of the transaction execution chain in the smart contract, thereby achieving intelligent identification and automatic resolution of parallel bottlenecks. For dynamic conflict scenarios that cannot be resolved by parallel capability optimization, an optimistic concurrency control mechanism oriented towards interrupt consistency is applied based on the idea of ​​optimistic concurrency control. Based on a series of strategies for multi-granularity objects in blockchain systems, an automatic matching, generation, and execution mechanism is established, and the corresponding system framework is implemented, connecting the core links of conflict detection, parallel optimization, and result correction.

[0015] Compared with the prior art, the present invention has the following beneficial effects: 1. This invention provides a cross-virtual machine collaborative parallel computing method for blockchain-as-a-service. First, by using a code static analysis conflict prediction module and a parallel execution result correction module, the additional overhead of execution conflicts generated by smart contracts under high parallelism is reduced. Second, through a data sharing and collaboration mechanism across heterogeneous virtual machines, high-performance dynamic combination and deployment of parallel strategies are achieved, thereby improving the overall system execution efficiency.

[0016] 2. This invention proposes a cross-heterogeneous virtual machine collaborative computing architecture that supports efficient parallelism. This architecture can support cross-heterogeneous virtual machine interconnection and interoperability, provide a variety of scalable smart contract parallel execution mechanisms, and support dynamic combination and deployment of high-performance parallel strategies.

[0017] 3. This invention proposes a code static analysis conflict prediction module for parallel execution of virtual machines. Based on machine learning and shared data analysis, it breaks through the limitations of traditional static analysis methods, accurately constructs data dependency relationships, and uniformly adapts to heterogeneous blockchain virtual machines, thereby achieving high availability, high throughput, and low latency in high-concurrency blockchain smart contract systems.

[0018] 4. This invention proposes a parallel execution result correction method based on conflict detection, which is applicable to multi-granularity objects such as programming entities, transactions, and system-level parallel protocols. It connects the core links of conflict detection, parallel optimization, and result correction, and achieves efficient, adaptive, and user-transparent parallel execution conflict handling.

[0019] 5. This invention proposes a data sharing and collaboration mechanism across heterogeneous virtual machines, introduces a critical data locking and synchronization mechanism across heterogeneous virtual machines, designs a cross-virtual machine smart contract calling interface and data sharing module, and constructs an efficient parallel heterogeneous virtual machine collaborative execution system to realize the integration and interoperability of heterogeneous virtual machines.

[0020] 6. This invention overcomes the technical difficulties of atomic synchronization between heterogeneous virtual machines and dynamic correction of conflicts in large-scale parallel tasks, and effectively solves the technical problems of low collaborative efficiency of multiple virtual machines and high conflict rate of parallel execution in blockchain platforms. Attached Figure Description

[0021] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 The flowchart illustrates the cross-virtual machine collaborative parallel computing method for blockchain-as-a-service provided by this invention.

[0022] Figure 2 This is a flowchart illustrating the static code analysis conflict prediction module for parallel execution of code in an embodiment of the present invention.

[0023] Figure 3 This is a flowchart illustrating the parallel execution result correction module based on conflict detection in an embodiment of the present invention.

[0024] Figure 4 This is a flowchart illustrating the data sharing and collaboration module across heterogeneous virtual machines in an embodiment of the present invention. Detailed Implementation

[0025] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the protection scope of the present invention.

[0026] Reference Figure 1 As shown, a method for cross-virtual machine collaborative parallel computing for Blockchain-as-a-Service includes: Step S1: Construct a parallel cross-heterogeneous virtual machine collaborative computing architecture to provide multiple parallel execution mechanisms for smart contracts; Step S2: Under the cross-heterogeneous virtual machine collaborative computing architecture, machine learning is used to extract effective features from the source code to build a conflict prediction model; Step S3: Based on the output of the conflict prediction model, correct the parallel execution results of the multi-granularity objects; Step S4: Based on the critical data locking and synchronization mechanism across heterogeneous virtual machines and the correction results, complete data sharing and collaborative execution.

[0027] In one embodiment, a method for cross-virtual machine collaborative parallel computing for Blockchain-as-a-Service specifically includes the following steps: S1: Construct a cross-heterogeneous virtual machine collaborative computing architecture that supports efficient parallelism. This architecture supports cross-heterogeneous virtual machine interconnection and interoperability, provides multiple scalable smart contract parallel execution mechanisms, and supports dynamic combination and deployment of high-performance parallel strategies. S2: Static analysis of conflict prediction, using machine learning to extract effective features from source code to build a conflict prediction model, and constructing a resource dependency graph based on shared data analysis to achieve a high-performance, high-accuracy conflict prediction framework; S3: Parallel execution result correction. For multi-granularity objects such as programming entities, transactions, and system-level parallel protocols, it applies parallel capability optimization and high-performance consistency guarantee technology, and designs strategy matching, generation, and execution mechanisms and corresponding system frameworks based on heterogeneous virtualization platforms to support user-adaptive conflict avoidance and handling. S4: Data sharing and collaborative execution across heterogeneous virtual machines. Based on the critical data locking and synchronization mechanism that supports cross-heterogeneous virtual machines, a cross-virtual machine smart contract calling interface and data format conversion module are designed to build an efficient and parallel heterogeneous virtual machine collaborative execution system. S2 improves the accuracy and performance of conflict prediction through static analysis, machine learning, and shared data analysis. Specifically, S2 includes: S2.1: Based on machine learning, static analysis is performed to train and learn the key features in the source code that induce conflicts. Feature selection algorithms are used to filter features that have an impact on parallel execution conflicts. According to the size of the dataset, an appropriate model is selected and the model effect is evaluated to achieve high-efficiency and high-accuracy machine learning-based conflict prediction. S2.2: Static analysis based on shared data: According to the definition of shared data objects in the smart contract source code, extract the set of resources occupied by the transaction, record the dependencies between transactions, accurately predict transaction conflicts, improve the throughput of the transaction system and reduce latency; S2.3: For heterogeneous blockchain virtualization platforms, build a unified and adaptable conflict prediction framework based on static code analysis, support smart contract transactions across heterogeneous virtual machines, and ensure the security and consistency of transactions executed across heterogeneous virtual machines; S3 specifically includes: S3.1: Based on the static conflict detection results, targeted parallel optimization methods are applied to state-class critical programming entities to achieve fine-grained, code-level parallel capability improvement; S3.2: Based on the distribution of state-class critical programming entities throughout the smart contract, and with transactions as the granularity, modeling and representation of the transaction execution chain in the smart contract are obtained, so as to realize the intelligent identification and automatic resolution of parallel bottlenecks and achieve coarse-grained, transaction-level parallel capability improvement. S3.3: For dynamic conflict scenarios that cannot be resolved by parallel capability optimization, an optimistic concurrency control mechanism oriented towards interrupt consistency is applied based on the idea of ​​optimistic concurrency control. S3.4: Based on a series of strategies for reducing the probability of conflicts and efficiently handling conflicts for multi-granularity objects in blockchain systems, establish an automatic matching, generation and execution mechanism, implement the corresponding system framework, connect the core links of conflict detection, parallel optimization and result correction, realize the functional integration with heterogeneous blockchain virtualization platforms, and support users to transparently adapt to the parallel execution of blockchain virtual machines to avoid and handle conflicts. S4 specifically includes: S4.1: Critical data locking and synchronization mechanism across heterogeneous virtual machines. It provides users with unified locking and synchronization execution logic in heterogeneous virtual machines, simplifies the writing of smart contract execution processes, and reduces the additional overhead in the critical data synchronization operation between virtual machines. S4.2: Provides function interfaces for inter-virtual machine contract calls, providing users with a transparent cross-virtual machine call process, and automatically establishes data type and format conversion mapping rules for calls between heterogeneous virtual machines; S4.3: Monitor the platform's execution load status through the monitoring module, and establish a load-aware smart contract dynamic deployment and execution automatic distribution and scheduling mechanism.

[0028] A system for cross-virtual machine collaborative parallel computing for blockchain-as-a-service includes: The monitoring module is used to monitor the platform's execution load status and provide load information.

[0029] The static analysis conflict prediction module is used to predict conflicts through static analysis, machine learning, and shared data. The process of conflict prediction includes: Based on machine learning, static analysis is performed to train and learn the key features in the source code that induce conflicts. Feature selection algorithms are used to filter features that have an impact on parallel execution conflicts. According to the size of the dataset, an appropriate model is selected and the model performance is evaluated to achieve high-efficiency and high-accuracy machine learning-based conflict prediction. Static analysis based on shared data: According to the definition of shared data objects in the source code of smart contracts, the set of resources occupied by transactions is extracted, the dependencies between transactions are recorded, transaction conflicts are accurately predicted, the throughput of the transaction system is improved and the latency is reduced. For heterogeneous blockchain virtualization platforms, a unified and adaptable conflict prediction framework based on static code analysis is built to support smart contract transactions across heterogeneous virtual machines and ensure the security and consistency of transactions executed across heterogeneous virtual machines. The adaptive conflict resolution module corrects the parallel execution results of multi-granularity objects based on the conflict prediction results. Based on the static conflict detection results, targeted parallel optimization methods are applied to state-class critical programming entities to achieve fine-grained, code-level parallel capability enhancement. Based on the distribution of state-class critical programming entities throughout the smart contract, and taking transactions as the granularity, we obtain the modeling and representation of the transaction execution chain in the smart contract, realize the intelligent identification and automatic resolution of parallel bottlenecks, and achieve coarse-grained, transaction-level parallel capability improvement. For dynamic conflict scenarios that cannot be resolved by parallel capability optimization, an optimistic concurrency control mechanism oriented towards interrupt consistency is applied based on the idea of ​​optimistic concurrency control. Based on a series of strategies for reducing the probability of conflicts and efficiently handling conflicts for multi-granularity objects in blockchain systems, an automatic matching, generation and execution mechanism is established, and the corresponding system framework is implemented. The core links of conflict detection, parallel optimization and result correction are connected, and the functions are integrated with heterogeneous blockchain virtualization platforms. This supports user-transparent adaptive blockchain virtual machines to perform parallel execution of conflict avoidance and handling. The data sharing and synchronization module is used to achieve data sharing and collaborative execution through critical data locking and synchronization mechanisms across heterogeneous virtual machines. Specifically, it includes: The critical data locking and synchronization mechanism across heterogeneous virtual machines provides users with unified locking and synchronization execution logic in heterogeneous virtual machines, simplifies the writing of smart contract execution processes, and reduces the additional overhead in the critical data synchronization operation between virtual machines. It provides function interfaces for inter-virtual machine contract calls, offering users a transparent cross-virtual machine call process and automatically establishing data type and format conversion mapping rules for calls between heterogeneous virtual machines; By monitoring the platform's execution load status through the monitoring module, a load-aware smart contract dynamic deployment, execution, automatic distribution, and scheduling mechanism is established.

[0030] Example 1 This embodiment provides a cross-virtual machine collaborative parallel computing method for Blockchain-as-a-Service, the scheme of which includes: First, a scalable parallel execution mechanism for smart contracts is provided. The basic steps are as follows: S1, using a static analysis conflict prediction module: addressing the execution conflict problem of smart contracts and transactions introduced by the parallel execution of blockchain virtual machines, it uses a highly versatile conflict prediction technology based on machine learning to deduce conflict scenarios and code snippets, and uses a precise conflict prediction technology based on shared data analysis to accurately construct data dependencies for predicting conflicts in the parallel execution of smart contracts. It designs a code static analysis scheme for heterogeneous virtual machines, abstracts shared data and the feature extraction process, establishes a unified framework adapted to heterogeneous blockchain virtual machines, and provides an intuitive and easy-to-use interface. S2 utilizes an adaptive conflict handling module: for multi-granularity objects such as programming entities, transactions, and system-level parallel protocols, it applies parallel capability optimization and high-performance consistency guarantee technology to achieve conflict avoidance and handling; based on a heterogeneous blockchain virtualization platform, it designs a strategy matching, generation, and execution mechanism and a corresponding system framework to support user-transparent adaptive conflict avoidance and handling.

[0031] Secondly, it provides high-performance parallel strategy dynamic combination and deployment technology, the basic steps of which are: (1) Utilizing the critical data locking and synchronization module across heterogeneous virtual machines: providing unified locking and synchronization execution logic in heterogeneous virtual machines to simplify the writing of smart contract execution processes; and realizing high-performance data communication sharing and state synchronization operations designed for multiple virtual machines to access critical data through low-overhead cross-virtual machine mutexes, semaphores, and inter-process communication methods. (2) Utilize cross-virtual machine smart contract call interface and data sharing module: provide users with a transparent cross-virtual machine call process, automatically establish data type and format conversion mapping rules between heterogeneous virtual machines, and provide seamless contract calls across heterogeneous virtual machines; (3) Utilize load-aware smart contract dynamic deployment and execution automatic distribution and scheduling module: Monitor the platform execution load status through the monitoring module, and based on the obtained platform load information, under the premise that the parallel execution strategy allows, use heuristic algorithms, machine learning and other means to dynamically combine smart contracts deployed and executed in parallel, improve the efficiency of multi-virtual machine collaborative execution, and realize a high-efficiency parallel heterogeneous virtual machine collaborative execution system framework.

[0032] Secondly, the basic steps for providing a collaborative computing architecture that supports heterogeneous virtual machines are as follows: S1 introduces a data sharing and collaborative execution mechanism for heterogeneous virtual machines (EVM, WASM, etc.), opens up cross-contract call links for heterogeneous virtual machine execution, and realizes a user-transparent infrastructure for heterogeneous smart contract virtual machine execution. S2 utilizes a conflict prediction and avoidance module based on static code analysis to provide transaction-level parallel mode and consistency guarantee technology during dynamic execution, reducing the additional overhead of execution conflicts in smart contracts under high parallelism. S3 designs a decoupled multi-level parallel algorithm hybrid execution model to achieve efficient dynamic combination of parallel strategies and improve the overall execution efficiency of the system.

[0033] Example 2 This embodiment provides a cross-virtual machine collaborative parallel computing method for Blockchain-as-a-Service, the method comprising: S1: To improve the conflict prediction performance of heterogeneous blockchain virtual machines, a static analysis conflict prediction module is constructed to improve the accuracy and performance of conflict prediction through static analysis, machine learning, and shared data analysis. S2: To address the parallel conflict problem of multi-granularity objects, an adaptive conflict handling system and strategy are designed based on a heterogeneous blockchain virtualization platform. An adaptive conflict handling module is constructed to provide consistency assurance and parallel capability optimization for the system. S3: To address the issues of contract compatibility and data interoperability in heterogeneous virtual machines, a data sharing and synchronization module was proposed, and an efficient parallel collaborative execution framework for heterogeneous virtual machines was constructed.

[0034] like Figure 1 The diagram shown is a flowchart of a cross-virtual machine collaborative parallel computing method for blockchain-as-a-service.

[0035] In one implementation, S1 specifically includes: S1.1: Static analysis conflict prediction module for parallel execution of virtual machines. Input cross-virtual machine smart contract call requests, including smart contract source code and transaction list; input smart contract source code into machine learning model, infer and output code snippets that may conflict; analyze the resource set occupied by the transaction list, construct dependency graph, accurately predict and output transactions that may conflict; S1.2: As Figure 2 As shown, sufficient code samples are collected, and features that influence parallel execution conflicts are selected through feature selection algorithms such as correlation analysis; according to the size of the dataset, an appropriate model is selected, features are extracted to construct the dataset, the model is trained and its performance is evaluated; the trained high-accuracy model is used to predict conflicts in the smart contract source code and infer the code segments that may conflict. S1.3: As Figure 2 As shown, based on the definition of shared data objects in the smart contract source code, the set of resources occupied by the transaction is extracted, and the dependency relationship between transactions is recorded. When there is a write-write conflict or read-write conflict between two transactions, there is a possibility of conflict during parallel execution. A dependency graph is constructed based on the shared resource occupation relationship. Through the dependency graph, it is possible to intuitively predict the transactions that may have conflicts and how to break the dependency cycle to resolve the conflict. S1.4: Considering the diversity of programming languages ​​used by heterogeneous virtual machines, the process of extracting shared data objects from the source code is abstracted to form a unified interface management, standardizes the analysis of smart contract resource consumption, and further constructs a dependency graph on the standardized resource consumption to complete accurate conflict prediction; the process of extracting features from the source code is abstracted without considering the differences in programming languages ​​used by the blockchain, realizing a transparent and automated machine learning model construction process for developers.

[0036] In one implementation, S2 specifically includes: S2.1: A parallel adaptive conflict processing module based on conflict detection, taking static conflict detection results as input; optimizing parallel capabilities for state-class critical transformations into entities and transactions; handling dynamic conflict scenarios that cannot be resolved by parallel capability optimization based on optimistic concurrency control; providing a series of strategies to reduce the probability of conflict and efficiently handle conflicts for multi-granularity objects in blockchain systems; establishing an automatic matching, generation and execution mechanism; and implementing the corresponding system framework. S2.2: As Figure 3 As shown, at the fine-grained, code, and level levels, parallel capabilities are optimized by sharing state-class critical programming entities; at a higher level, based on the distribution of state-class critical programming entities across the entire smart contract, the modeling and representation of the transaction execution chain in the smart contract are obtained, thereby achieving coarse-grained and transaction-level parallel capability enhancement. S2.3: Based on the results of conflict prediction, the structural features of smart contracts are extracted through feature engineering, machine learning, deep learning and other means, and the parallel capabilities of code-level and transaction-level are automatically optimized to achieve high-performance consistency guarantee.

[0037] In one implementation, S3 specifically includes: S3.1: A cross-heterogeneous virtual machine data sharing, collaborative execution, and synchronization module that provides users with critical data locking and synchronization interfaces as well as function interfaces for inter-virtual machine contract calls; it monitors the platform's execution load status through a monitoring module, dynamically combines smart contracts that are deployed and executed in parallel, and finally deploys and executes them on the blockchain heterogeneous virtual machine platform; S3.2: As Figure 4 As shown, to ensure the atomicity of smart contract execution across heterogeneous virtual machines, a critical data locking and synchronization mechanism is introduced across heterogeneous virtual machines. This provides users with locking and synchronization interfaces and offers unified locking and synchronization execution logic across heterogeneous virtual machines, simplifying the writing of smart contract execution processes. Through low-overhead cross-virtual machine mutexes, semaphores, and inter-process communication methods, high-performance data communication sharing and state synchronization operations are achieved during the critical data access process of multiple virtual machines. S3.3: For example Figure 4 As shown, the target virtual machine architecture is determined by analyzing the bytecode features of the user-specified or target smart contract, and automatic conversion and adaptation to the target virtual machine is performed by combining prior data type and format conversion mapping rules. For frequent data transfers across virtual machines, the virtual machine memory allocation and release overhead is reduced based on the memory pool concept, and data transfer overhead is reduced through a designed data sharing module. S3.4: Monitor the platform's execution load status through the monitoring module. Based on the platform load status and contract parallel execution strategy, establish a load-aware smart contract dynamic deployment and execution automatic distribution and scheduling mechanism. Based on the acquired platform load information, and provided that the parallel execution strategy allows, use heuristic algorithms, machine learning and other means to dynamically combine smart contracts deployed and executed in parallel to improve the efficiency of multi-virtual machine collaborative execution.

[0038] The above-described technical solutions in this application embodiment, on the domestic server platform (Kunpeng 920), have at least one or more of the following technical effects: 1) Improved optimization performance: The existing FISCO BCOS v2.9.1 system shows more than 2 times the performance in cross-virtual machine calls and more than 20% improved throughput in parallel environments; 2) The virtual machine's basic instruction execution rate reaches over 10 million instructions per second.

[0039] 3) It achieves efficient parallel computing, intelligent conflict prediction, and stable cross-virtual machine execution, and has a certain degree of domestic adaptation capability.

[0040] Those skilled in the art will understand that, besides implementing the system and its various devices, modules, and units provided by this invention in the form of purely computer-readable program code, the same functions can be achieved entirely through logical programming of the method steps, making the system and its various devices, modules, and units of this invention function in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, the system and its various devices, modules, and units provided by this invention can be considered as a hardware component, and the devices, modules, and units included therein for implementing various functions can also be considered as structures within the hardware component; alternatively, the devices, modules, and units for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.

[0041] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. Unless otherwise specified, the embodiments and features described in this application can be arbitrarily combined with each other.

Claims

1. A method for cross-virtual machine collaborative parallel computing for Blockchain-as-a-Service, characterized in that, include: Step S1: Construct a parallel cross-heterogeneous virtual machine collaborative computing architecture to provide multiple parallel execution mechanisms for smart contracts; Step S2: Under the cross-heterogeneous virtual machine collaborative computing architecture, machine learning is used to extract effective features from the source code to build a conflict prediction model; Step S3: Based on the output of the conflict prediction model, correct the parallel execution results of the multi-granularity objects; Step S4: Based on the critical data locking and synchronization mechanism across heterogeneous virtual machines and the correction results, complete data sharing and collaborative execution.

2. The method for cross-virtual machine collaborative parallel computing for blockchain-as-a-service as described in claim 1, characterized in that, Step S2 includes the following sub-steps: Step S2.1: Perform static analysis based on machine learning, train and learn the key features in the source code that induce conflicts, filter the features that have an impact on parallel execution conflicts through feature selection algorithm, select an appropriate model according to the size of the dataset, and evaluate the model performance. Step S2.2: Perform static analysis based on shared data. According to the definition of shared data objects in the smart contract source code, extract the set of resources occupied by the transaction, record the dependencies between transactions, and predict transaction conflicts. Step S2.3: For heterogeneous blockchain virtualization platforms, a unified conflict prediction framework based on static code analysis is adopted to support smart contract transactions across heterogeneous virtual machines.

3. The method for cross-virtual machine collaborative parallel computing for blockchain-as-a-service as described in claim 1, characterized in that, Step S3 includes: Parallel execution result correction involves optimizing parallel capabilities and ensuring performance consistency for multi-granularity objects. Based on a heterogeneous virtualization platform, a strategy matching, generation, and execution mechanism and corresponding system framework are designed to support user-adaptive conflict avoidance and handling. The multi-granularity objects include programming entities, transactions, and system-level parallel protocols.

4. The method for cross-virtual machine collaborative parallel computing for blockchain-as-a-service as described in claim 3, characterized in that, Step S3 includes the following sub-steps: Step S3.1: Based on the static conflict detection results, implement a parallel optimization method for state-class critical programming entities; Step S3.2: Based on the distribution of state-class critical programming entities throughout the smart contract, and with transactions as the granularity, model and represent the transaction execution chain in the smart contract to achieve intelligent identification and automatic resolution of parallel bottlenecks; Step S3.3: For dynamic conflict scenarios that cannot be resolved by parallel capability optimization, an optimistic concurrency control mechanism oriented towards interruption consistency is developed based on the idea of ​​optimistic concurrency control. Step S3.4: Based on a series of strategies for multi-granularity objects in the blockchain system, establish an automatic matching, generation and execution mechanism, implement the corresponding system framework, and connect the core links of conflict detection, parallel optimization and result correction.

5. The method for cross-virtual machine collaborative parallel computing for blockchain-as-a-service as described in claim 1, characterized in that, Step S4 includes the following sub-steps: Step S4.1: Critical data locking and synchronization mechanism across heterogeneous virtual machines. This provides users with unified locking and synchronization execution logic in heterogeneous virtual machines, simplifies the writing of smart contract execution processes, and reduces the additional overhead in the critical data synchronization operation between virtual machines. Step S4.2: Provide function interfaces for inter-virtual machine contract calls, provide users with a transparent cross-virtual machine call process, and automatically establish data type and format conversion mapping rules for calls between heterogeneous virtual machines; Step S4.3: Monitor the platform's execution load status through the monitoring module, and establish a load-aware smart contract dynamic deployment and execution automatic distribution and scheduling mechanism.

6. A system for cross-virtual machine collaborative parallel computing for Blockchain-as-a-Service, characterized in that, include: The static analysis conflict prediction module is used to predict conflicts through static analysis, machine learning, and shared data. The adaptive conflict handling module corrects the parallel execution results of multi-granularity objects based on the conflict prediction results. The data sharing and synchronization module is used to achieve data sharing and collaborative execution through critical data locking and synchronization mechanisms across heterogeneous virtual machines.

7. The system for cross-virtual machine collaborative parallel computing for blockchain-as-a-service as described in claim 6, characterized in that, Also includes: The monitoring module is used to monitor the platform's execution load status and provide load information.

8. The system for cross-virtual machine collaborative parallel computing for blockchain-as-a-service as described in claim 6, characterized in that, The process of conflict prediction includes: Static analysis based on machine learning is used to train and learn the key features in the source code that induce conflicts. Feature selection algorithms are used to filter features that have an impact on parallel execution conflicts. Based on the size of the dataset, an appropriate model is selected and the model performance is evaluated. Static analysis is performed based on shared data. According to the definition of shared data objects in the source code of smart contracts, the set of resources occupied by transactions is extracted, the dependencies between transactions are recorded, and transaction conflicts are predicted. A unified conflict prediction framework based on static code analysis is provided for heterogeneous blockchain virtualization platforms, supporting smart contract transactions across heterogeneous virtual machines.

9. The system for cross-virtual machine collaborative parallel computing for blockchain-as-a-service as described in claim 6, characterized in that, The adaptive conflict handling module includes: Parallel execution result correction involves optimizing parallel capabilities and ensuring performance consistency for multi-granularity objects. Based on a heterogeneous virtualization platform, a strategy matching, generation, and execution mechanism and corresponding system framework are designed to support user-adaptive conflict avoidance and handling. The multi-granularity objects include programming entities, transactions, and system-level parallel protocols.

10. The system for cross-virtual machine collaborative parallel computing for blockchain-as-a-service as described in claim 9, characterized in that, The adaptive conflict handling module further includes: Based on static conflict detection results, a parallel optimization method for state-class critical programming entities is proposed. Based on the distribution of state-class critical programming entities throughout the smart contract, and with transactions as the granularity, the modeling and representation of the transaction execution chain in the smart contract enables intelligent identification and automatic resolution of parallel bottlenecks. For dynamic conflict scenarios that cannot be resolved by parallel capability optimization, an optimistic concurrency control mechanism oriented towards interruption consistency is proposed based on the idea of ​​optimistic concurrency control. Based on a series of strategies for multi-granularity objects in blockchain systems, an automatic matching, generation, and execution mechanism is established, and the corresponding system framework is implemented, connecting the core links of conflict detection, parallel optimization, and result correction.