Unified SDK (Software Development Kit) configuration center for multi-chain environment and implementation method thereof
Through the unified SDK configuration center, the blockchain platform configuration is dynamically managed, efficient adaptation and flexible switching in a multi-chain environment are achieved, development and maintenance costs are reduced, and system flexibility and scalability are improved.
Patent Information
- Application Number
- CN202510215945.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2045-02-26
AI Technical Summary
In a multi-chain environment, the existing technology needs to develop SDKs separately for each blockchain platform, resulting in high adaptation costs, complex maintenance, insufficient flexibility and waste of resources, and inefficient system upgrades, making it difficult to develop and debug.
It provides a unified SDK configuration center for multi-chain environments. Through the configuration center, dynamic management system configuration, loading the configuration files of the blockchain platform, initializing and connecting the blockchain client, and calling the interface method uniformly through ChainSDK, realizing decoupling from different underlying chains.
It simplifies development and operation and maintenance costs, improves system flexibility and scalability, and supports rapid switching of blockchain platforms without modifying business system code.
Smart Images

Figure CN120353510A_ABST
Abstract
Description
Technical Field
[0001] This document relates to the field of blockchain technology, and particularly to a unified SDK configuration center for a multi-chain environment and its implementation method. Background Art
[0002] As the core of the distributed ledger, blockchain technology has been widely applied in recent years in fields such as finance, supply chain, Internet of Things, digital identity, etc. However, with the rapid development of blockchain technology, a large number of blockchain platforms with different underlying technical architectures have emerged in the market (such as Ethereum, Fabric, BCOS, etc.). In blockchain application development, different application scenarios need to be docked with different blockchain platforms. For example, an enterprise may need to interact with the Fabric chain that supports privacy protection, the BCOS chain suitable for financial scenarios, and the general Ethereum chain at the same time. The differences between different blockchains lead to the need for developers to develop adapter components separately for each target chain, increasing the workload of system development and operation and maintenance.
[0003] Currently, there are the following core problems in the development of application systems in a multi-chain environment:
[0004] High adaptation cost: For each underlying chain, a dedicated SDK needs to be developed and deployed separately, and developers need to deeply understand the underlying implementation of the target chain, such as programming languages, smart contract structures, and call methods.
[0005] Complex maintenance: With the version update or function change of the blockchain platform, the existing SDK adaptation modules need to be adjusted frequently, increasing the maintenance difficulty.
[0006] Lack of flexibility: When an application needs to switch the underlying blockchain platform, it often needs to redesign the adaptation logic and cannot achieve quick switching, affecting the flexibility and scalability of the system.
[0007] Resource waste: Developing an SDK independently for each chain leads to repeated consumption of resources. Especially in the scenario of multi-chain parallelism, this method is inefficient.
[0008] Figure 1 It is a schematic diagram of the original mode of the application system in the multi-chain environment in the prior art. As Figure 1 shown, the deficiencies of the prior art solutions are as follows:
[0009] Repeated development: Every time a new target chain is added, a set of SDK logics need to be redesigned and implemented, resulting in an extended development cycle;
[0010] Inefficient system upgrade: The existing SDK solutions are often tightly coupled to a specific chain. With the upgrade of the blockchain underlying technology, the adaptation modules also need to be updated synchronously;
[0011] High technical barriers: Developers need to master the technical details of multiple underlying chains, including different smart contract languages (such as Solidity, Go, C++ etc.), which increases the difficulty of development and debugging. Summary of the Invention
[0012] The purpose of the present invention is to provide a unified SDK configuration center for a multi-chain environment and its implementation method, aiming to solve the above problems in the prior art.
[0013] The present invention provides a unified SDK configuration center for a multi-chain environment and its implementation method, including:
[0014] Dynamically manage system configurations through the configuration center, and based on the system configurations, select corresponding chain information according to user needs to adjust the blockchain platform accessed by the system;
[0015] When the system starts, load the configuration file of the blockchain platform through the configuration center, and initialize and connect the blockchain client through chain authentication information;
[0016] When the business system operates, according to the specific configuration of the configuration center, decouple from ChainSDK through the configuration center, and uniformly call the same interface method by loading ChainSDK to perform blockchain operations. The system automatically loads the corresponding implementation method according to the current chain environment, where all necessary blockchain SDK dependency packages are integrated in ChainSDK.
[0017] The present invention provides a unified SDK configuration center for a multi-chain environment, including:
[0018] A management module for dynamically managing system configurations, and based on the system configurations, selecting corresponding chain information according to user needs to adjust the blockchain platform accessed by the system;
[0019] A processing module for, when the system starts, loading the configuration file of the blockchain platform through the configuration center, and initializing and connecting the blockchain client through chain authentication information. When the business system operates, according to the specific configuration of the configuration center, decouple from ChainSDK through the configuration center, and uniformly call the same interface method by loading ChainSDK to perform blockchain operations. The system automatically loads the corresponding implementation method according to the current chain environment, where all necessary blockchain SDK dependency packages are integrated in ChainSDK.
[0020] An embodiment of the present invention further provides an electronic device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, the steps of the above unified SDK configuration center for a multi-chain environment and its implementation method are implemented.
[0021] An embodiment of the present invention further provides a computer-readable storage medium, on which an implementation program for information transmission is stored. When the program is executed by a processor, the steps of the above unified SDK configuration center for a multi-chain environment and its implementation method are realized.
[0022] By adopting the embodiment of the present invention, through the introduction of a configuration center, developers are allowed to dock with different underlying chains through simple configuration under a unified SDK framework, realizing the complete decoupling of the application system and the SDK. The configuration center is responsible for managing the bottom-chain adaptation logic in a multi-chain environment. Developers do not need to pay attention to the underlying implementation details, but only need to focus on the writing of smart contracts and interface calls. This method not only reduces the development and operation and maintenance costs, but also greatly improves the flexibility and scalability of the system, providing an efficient solution for application development in a multi-chain environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in one or more embodiments of this specification or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in this specification. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0024] Figure 1 is a schematic diagram of the original mode of an application system in a multi-chain environment in the prior art;
[0025] Figure 2 is a flowchart of the implementation method of the unified SDK configuration center for a multi-chain environment according to an embodiment of the present invention;
[0026] Figure 3 is a schematic diagram of the new mode system after introducing the configuration center according to an embodiment of the present invention;
[0027] Figure 4 is a schematic diagram of the unified SDK configuration center for a multi-chain environment according to an embodiment of the present invention;
[0028] Figure 5 is a schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0029] To enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the following will clearly and completely describe the technical solutions in one or more embodiments of this specification in conjunction with the accompanying drawings in one or more embodiments of this specification. Obviously, the described embodiments are only a part of the embodiments of this specification, rather than all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this document.
[0030] Method Embodiment
[0031] According to an embodiment of the present invention, there is provided a method for implementing a unified SDK configuration center for a multi-chain environment. Figure 2 It is a flowchart of the method for implementing a unified SDK configuration center for a multi-chain environment according to an embodiment of the present invention, as Figure 2 shown. The method for implementing a unified SDK configuration center for a multi-chain environment according to an embodiment of the present invention specifically includes:
[0032] Step S201, dynamically manage system configurations through a configuration center, and based on the system configurations, select corresponding chain information according to user requirements to adjust the blockchain platform accessed by the system; the blockchain platform specifically includes: Ant Chain, Unicom Chain, Fabric, BCOS Chain, and Chang'an Chain.
[0033] Step S202, when the system starts, load the configuration file of the blockchain platform through the configuration center, and initialize and connect the blockchain client through chain authentication information.
[0034] In an embodiment of the present invention, when it is necessary to expand support for a new blockchain platform, introduce a new blockchain SDK dependency package in ChainSDK, add a corresponding configuration file in the configuration center, register a new client, and implement specific business interface methods.
[0035] Step S203, when the business system operates, decouple from ChainSDK through the configuration center according to the specific configurations of the configuration center, and uniformly call the same interface method by loading ChainSDK to perform blockchain operations. The system automatically loads the corresponding implementation method according to the current chain environment, where all necessary blockchain SDK dependency packages are integrated in ChainSDK.
[0036] In an embodiment of the present invention, after the system starts, the configuration center dynamically switches the blockchain SDK dependency package according to the system configuration to switch the blockchain platform accessed by the system.
[0037] Figure 3 It is a system schematic diagram of the new mode after introducing the configuration center according to an embodiment of the present invention, asFigure 3 As shown in the figure, it specifically includes the following processing:
[0038] Prepare the work. The system runs in a Java environment and is developed based on the Spring Boot architecture. The configuration center uses Nacos to dynamically manage the system configuration, ensuring that the system can flexibly adjust the chain selection according to requirements during operation.
[0039] When the system starts, the configuration center loads the configuration file of the blockchain platform and initializes the corresponding blockchain client. All necessary blockchain SDK dependency packages have been introduced in advance. There is no need to introduce additional dependencies. Only the chain authentication information of the configuration center is required to complete the initialization and connection of the client.
[0040] The chain information of the configuration center determines the underlying chain platform connected by the system. For example, if Ant Chain is selected, the system initializes the connection of Ant Chain and automatically loads the corresponding chain client according to the configuration to achieve interaction with the chain.
[0041] The business system and ChainSDK are decoupled through the configuration center, and the business logic does not depend on the implementation of a specific chain. When the business system operates, it uniformly calls the same interface method for operations such as uploading to the chain and querying. The system will automatically load the corresponding implementation method according to the current chain environment. To switch the chain platform, only the configuration center needs to be modified and the service restarted, and the business system does not need to be changed at all.
[0042] Currently, the system supports multiple blockchain platforms, including Ant Chain, Unicom Chain, Fabric, BCOS Chain, Chang'an Chain, etc. If it is necessary to expand and support a new blockchain platform, only a new SDK dependency package needs to be introduced, a new client is registered, and the specific business interface method is implemented. There is no need to modify the existing business system code, ensuring the flexibility and scalability of the business system.
[0043] In summary, the embodiment of the present invention can achieve a set of codes to adapt to multiple blockchain environments, simplify the complexity of blockchain access, and improve the maintainability and scalability of the system. The business system can be deployed in multiple on-site environments, supporting rapid iteration and function expansion.
[0044] Embodiment 1 of the device
[0045] According to the embodiment of the present invention, a unified SDK configuration center for a multi-chain environment is provided. Figure 4 It is a schematic diagram of the unified SDK configuration center for a multi-chain environment according to the embodiment of the present invention. As Figure 4 shown, the unified SDK configuration center for a multi-chain environment according to the embodiment of the present invention specifically includes:
[0046] The management module 40 is used to dynamically manage the system configuration. Based on the system configuration, it selects the corresponding chain information according to user requirements to adjust the blockchain platform accessed by the system. The blockchain platform specifically includes: Ant Chain, Unicom Chain, Fabric, BCOS Chain, and Chang'an Chain. The management module 40 is further used for:
[0047] When it is necessary to expand the support for a new blockchain platform, introduce a new SDK dependency package, register a new client, and implement specific business interface methods. After the system starts, according to the system configuration, dynamically switch the blockchain SDK dependency package and switch the blockchain platform accessed by the system.
[0048] The processing module 42 is used to, when the system starts, load the configuration file of the blockchain platform through the configuration center, and initialize and connect the blockchain client through the chain authentication information. When the business system operates, according to the specific configuration of the configuration center, it is decoupled from ChainSDK through the configuration center, and uniformly calls the same interface method by loading ChainSDK to perform blockchain operations. The system automatically loads the corresponding implementation method according to the current chain environment, where all necessary blockchain SDK dependency packages are integrated in ChainSDK
[0049] The embodiment of the present invention is a device embodiment corresponding to the above method embodiment. The specific operations of each module can be understood by referring to the description of the method embodiment, and will not be elaborated here.
[0050] Device Embodiment Two
[0051] The embodiment of the present invention provides an electronic device, as Figure 5 shown, including: a memory 50, a processor 52, and a computer program stored on the memory 50 and executable on the processor 52. When the computer program is executed by the processor 52, the steps described in the method embodiment are implemented.
[0052] Device Embodiment Three
[0053] The embodiment of the present invention provides a computer-readable storage medium, on which an implementation program for information transmission is stored. When the program is executed by the processor 52, the steps described in the method embodiment are implemented.
[0054] The computer-readable storage medium described in this embodiment includes but is not limited to: ROM, RAM, magnetic disk, or optical disc, etc.
[0055] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for implementing a unified SDK configuration center for a multi-chain environment, characterized in that, Including: Dynamically manage system configurations through a configuration center, and based on the system configurations, select corresponding chain information according to user requirements to adjust the blockchain platform accessed by the system; When the system starts, load the configuration file of the blockchain platform through the configuration center, and initialize and connect the blockchain client through chain authentication information; When the business system operates, according to the specific configuration of the configuration center, decouple from ChainSDK through the configuration center, and uniformly call the same interface method by loading ChainSDK to perform blockchain operations. The system automatically loads the corresponding implementation method according to the current chain environment, where all necessary blockchain SDK dependency packages are integrated in ChainSDK.
2. The method according to claim 1, wherein The method further includes: When it is necessary to expand support for a new blockchain platform, introduce a new blockchain SDK dependency package in ChainSDK, add a corresponding configuration file in the configuration center, register a new client, and implement specific business interface methods.
3. The method according to claim 1, wherein The blockchain platform specifically includes: Ant Chain, Unicom Chain, Fabric, BCOS Chain, and Chang'an Chain.
4. The method according to claim 1, characterized in that, The method further includes: After the system starts, the configuration center dynamically switches the blockchain SDK dependency package according to the system configuration and switches the blockchain platform accessed by the system.
5. A unified SDK configuration center for a multi-chain environment, characterized in that, Including: A management module for dynamically managing system configurations, and based on the system configurations, selecting corresponding chain information according to user requirements to adjust the blockchain platform accessed by the system; A processing module for, when the system starts, loading the configuration file of the blockchain platform through the configuration center, and initializing and connecting the blockchain client through chain authentication information. When the business system operates, according to the specific configuration of the configuration center, decouple from ChainSDK through the configuration center, and uniformly call the same interface method by loading ChainSDK to perform blockchain operations. The system automatically loads the corresponding implementation method according to the current chain environment, where all necessary blockchain SDK dependency packages are integrated in ChainSDK.
6. The unified SDK configuration center for a multi-chain environment according to claim 5, characterized in that The management module is further used for: When it is necessary to expand support for a new blockchain platform, introduce a new blockchain SDK dependency package in ChainSDK, add a corresponding configuration file in the configuration center, register a new client, and implement specific business interface methods.
7. The unified SDK configuration center for a multi-chain environment according to claim 5, characterized in that, The blockchain platform specifically includes: Ant Chain, Unicom Chain, Fabric, BCOS Chain, and Chang'an Chain.
8. The unified SDK configuration center for a multi-chain environment according to claim 5, characterized in that The management module is further used for: After the system starts, dynamically switch the blockchain SDK dependency package according to the system configuration and switch the blockchain platform accessed by the system.
9. An electronic device, characterized in that, Including: A memory, a processor, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps of the unified SDK configuration center implementation method for a multi-chain environment as described in any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that, An information transfer implementation program is stored on the computer-readable storage medium. When the program is executed by the processor, it implements the steps of the unified SDK configuration center implementation method for a multi-chain environment as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Block chain system, and data storage method and apparatus
CN107018125A
Blockchain oriented universal service middleware system
CN107147704A
Crossing block chain platform business processing method and equipment and computer readable storage medium
CN108616578A
A multi-block chain underlying unified scheduling solution
CN109739485A
Multi-type blockchain deployment management system and method
CN111245624A