WO2022077846A1 - Blockchain-based operation and maintenance method and system, computer device and storage medium - Google Patents

Blockchain-based operation and maintenance method and system, computer device and storage medium Download PDF

Info

Publication number
WO2022077846A1
WO2022077846A1 PCT/CN2021/078571 CN2021078571W WO2022077846A1 WO 2022077846 A1 WO2022077846 A1 WO 2022077846A1 CN 2021078571 W CN2021078571 W CN 2021078571W WO 2022077846 A1 WO2022077846 A1 WO 2022077846A1
Authority
WO
WIPO (PCT)
Prior art keywords
maintenance
message
blockchain
node
message queue
Prior art date
Application number
PCT/CN2021/078571
Other languages
French (fr)
Chinese (zh)
Inventor
姜勇
韩永楠
陈宇峰
Original Assignee
杭州云链趣链数字科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 杭州云链趣链数字科技有限公司 filed Critical 杭州云链趣链数字科技有限公司
Publication of WO2022077846A1 publication Critical patent/WO2022077846A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/20Administration of product repair or maintenance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Definitions

  • the present application relates to the field of blockchain technology, in particular to a blockchain-based operation and maintenance method, system, computer equipment and storage medium.
  • an embodiment of the present application provides a blockchain-based operation and maintenance method, including the following steps:
  • the operation and maintenance message is acquired from the message queue, and an operation and maintenance operation corresponding to the operation and maintenance message is performed on the node according to the operation and maintenance message.
  • the method further includes: updating an on-chain configuration file and an operation and maintenance record on the blockchain according to the operation and maintenance request, and pushing the operation and maintenance message to each a message queue of a node, wherein the operation and maintenance message includes the operation and maintenance record;
  • the operation and maintenance message is acquired from the message queue, and an operation and maintenance operation corresponding to the operation and maintenance message is performed on the node according to the operation and maintenance record in the operation and maintenance message.
  • the operation and maintenance record includes an identifier, a system type, and an operation and maintenance policy.
  • the method when the operation and maintenance request is a version update, the method further includes:
  • Update the on-chain configuration file on the blockchain according to the operation and maintenance request upload the bytecode file to the blockchain, and push the operation and maintenance message to the messages of each node on the blockchain a queue, wherein the bytecode file corresponds to the operation and maintenance request;
  • the method when the operation and maintenance request is a version rollback, the method further includes:
  • the method further includes: when a preset rollback process is triggered, obtaining a rollback version number according to the rollback process, and obtaining and matching the rollback version number from the blockchain.
  • a fallback version bytecode file corresponding to the fallback version is updated, and the fallback version bytecode file is updated to the node corresponding to the message queue.
  • the method further includes:
  • the loading of the bytecode file is completed by a hot loader.
  • the pushing the operation and maintenance message to the message queue of each node on the blockchain includes:
  • the operation and maintenance message fails to be pushed, the operation and maintenance message is reissued through the oracle machine until the operation and maintenance message is pushed successfully.
  • updating the on-chain configuration file on the blockchain according to the operation and maintenance request, and pushing the operation and maintenance message to the message queue of each node on the blockchain includes:
  • the embodiments of the present application further provide a blockchain-based operation and maintenance system, the system includes an operation and maintenance system access party and a blockchain platform, and the operation and maintenance system access party is connected in a node manner Enter the blockchain platform and deploy smart contracts on the blockchain platform, and the operation and maintenance system access parties have their own message queues:
  • the smart contract is used to update the on-chain configuration file on the blockchain according to the operation and maintenance request of the access party of the operation and maintenance system, and push the operation and maintenance message to the message queue of each node on the blockchain.
  • the operation and maintenance message is successfully pushed to the message queue
  • the operation and maintenance message pushed to the message queue of each node on the blockchain is recorded on the blockchain in the form of a transaction, wherein the The on-chain configuration file corresponds to the operation and maintenance request, and the operation and maintenance message corresponds to the operation and maintenance request;
  • the operation and maintenance system access party obtains the operation and maintenance message from the message queue, and performs the operation and maintenance operation corresponding to the operation and maintenance message on the node according to the operation and maintenance message.
  • the smart contract includes a data processing module and a message push module:
  • the data processing module is used to update the bytecode file and the operation and maintenance record on the blockchain according to the operation and maintenance request of the operation and maintenance system access party;
  • the message pushing module is configured to push the operation and maintenance message to the message queue, wherein the operation and maintenance message includes the operation and maintenance record.
  • an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and running on the processor, the processor implementing the above-mentioned region-based program when executing the computer program The operation and maintenance method of the blockchain.
  • an embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned blockchain-based operation and maintenance method is implemented.
  • the above blockchain-based operation and maintenance method, system, computer equipment and storage medium update the on-chain configuration file on the blockchain according to the operation and maintenance request, and push the operation and maintenance message to the message queue of each node on the blockchain.
  • the push operation is recorded on the blockchain as a transaction; the operation and maintenance message is obtained from the message queue, and the operation and maintenance message corresponding to the operation and maintenance message is executed on the node according to the operation and maintenance message.
  • the operation and maintenance operation through the consensus among the blockchain nodes, realizes that one operation and maintenance operation takes effect on multiple systems at the same time, and realizes the credit endorsement of the whole process to ensure the consistency and security of the operation and maintenance version.
  • FIG. 1 is an application scenario diagram of a blockchain-based operation and maintenance method according to an embodiment of the present application
  • FIG. 2 is a flowchart of a blockchain-based operation and maintenance method according to an embodiment of the present application
  • Fig. 3 is a processing flow chart of operation and maintenance records in the blockchain-based operation and maintenance method according to an embodiment of the present application
  • FIG. 4 is a schematic structural diagram of a blockchain-based operation and maintenance system according to an embodiment of the present application.
  • FIG. 5 is a schematic diagram of the architecture of a blockchain-based operation and maintenance system according to an optional embodiment of the present application.
  • FIG. 6 is a flowchart of a blockchain-based operation and maintenance method according to an optional embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a blockchain-based operation and maintenance computer device according to an embodiment of the present application.
  • Words like "connected,” “connected,” “coupled,” and the like referred to in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
  • the “plurality” referred to in this application refers to two or more.
  • “And/or” describes the association relationship between associated objects, indicating that there can be three kinds of relationships. For example, “A and/or B” can mean that A exists alone, A and B exist at the same time, and B exists alone.
  • the character “/” generally indicates that the associated objects are an “or” relationship.
  • the terms “first”, “second”, “third”, etc. involved in this application are only to distinguish similar objects, and do not represent a specific order for the objects.
  • the blockchain is a distributed database, and the data stored by each node participating in the blockchain behavior maintains data consistency through consensus.
  • the blockchain technology adopted in this application will be illustrated first.
  • the electronic device runs the blockchain technology to become a node of the blockchain network
  • the blockchain platform infrastructure includes a blockchain presentation layer, an application layer, a service layer, and a blockchain core support module.
  • the presentation layer is used to display system functions, and then realize user interaction.
  • Each file subject can log in to the interface displayed by the corresponding presentation layer through the system client to access the application layer and obtain information resources, including registration interface, operation execution interface, query interface, application management interface, administrator interface, etc.
  • the application layer is used to display the specific functions of the blockchain network and is an important part of file storage. It can be divided into user management, permission control, and directory management according to different functions.
  • the service layer is used to effectively integrate and manage application-related functions through distributed servers, such as user registration, user identity management, encryption and decryption services, distributed ledger services, smart contract services, and data management services.
  • the core support modules of the blockchain include data layer, network layer, consensus layer and contract layer.
  • the data layer is used to encapsulate the underlying data blocks and related technologies such as data encryption and time stamping.
  • the network layer encapsulates the P2P networking mode, message dissemination protocol and data verification mechanism of the blockchain network system, so that each node has equal status and is connected and interacted with each other in a flat topology, with distributed, autonomous, open Features such as free entry and exit. Every node in the blockchain network can participate in the verification and accounting process of the block data. Only when the block data is verified by most of the nodes in the entire network can it be recorded in the blockchain.
  • the decentralized design of blockchain ensures that file data cannot be tampered with or forged.
  • the consensus layer encapsulates a method to quickly complete consensus in a topology network with highly decentralized decision-making power to participate in the consensus mechanism of the blockchain network.
  • the contract layer encapsulates the contract code of the data access policy. When the conditions in the contract code are triggered, the corresponding transaction is automatically executed, and the corresponding data can be accessed through the corresponding access conditions specified in the contract content.
  • FIG. 1 is an application scenario diagram of the blockchain-based operation and maintenance method according to an embodiment of the present application.
  • the blockchain-based operation and maintenance method provided by the present application can be applied to the application environment shown in FIG. 1 .
  • the blockchain network 10 includes an operation and maintenance requester node 12, a first node 14 and a second node 16, and the first node 14, the second node 16 and the operation and maintenance requester node 12 are all access parties of the unified operation and maintenance system. According to the data consistency characteristics of the blockchain, all nodes on the blockchain network 10 share all source code data of the operation and maintenance system.
  • the operation and maintenance requester node 12 has operation authority such as uploading, editing, adding or deleting source code data to the blockchain network 10 .
  • the blockchain network 10 updates the on-chain configuration file on the blockchain according to the operation and maintenance request of the operation and maintenance requester node 12, and pushes the operation and maintenance messages to the operation and maintenance requester node 12, the first node 14 and the operation and maintenance requester node 12 on the blockchain respectively.
  • the message queue of the second node 16 records the push operation on the blockchain network 10 in the form of a transaction when the operation and maintenance message is successfully pushed to the message queue; each node of the blockchain network 10 obtains from the message queue Operation and maintenance messages, and perform operation and maintenance operations corresponding to the operation and maintenance messages on the node according to the operation and maintenance messages.
  • the above-mentioned operation and maintenance requester node 12 , the first node 14 and the second node 16 may specifically be any electronic device, such as a server, a mobile phone, a computer, a tablet computer, and the like. It can be understood that, the above-mentioned operation and maintenance requester node 12, the first node 14 and the second node 16 can communicate with each other.
  • the operation and maintenance requester node may include a file node, the first node may include a user node, and the second node may include an accounting node.
  • the distinction between the above nodes is determined according to the identity information logged in through the node.
  • the above blockchain is a private blockchain or a consortium blockchain, and the story is first completed on the blockchain platform. For registration, the corresponding subjects of the above nodes need to complete the registration on the blockchain platform in advance, and obtain the corresponding public and private keys.
  • FIG. 2 is a flowchart of a blockchain-based operation and maintenance method according to an embodiment of the present application, which provides a blockchain-based operation and maintenance method, which is applied to the area in FIG. 1 .
  • the blockchain network 10 is used as an example to illustrate, including the following steps:
  • Step S210 Update the on-chain configuration file on the blockchain according to the operation and maintenance request, and push the operation and maintenance message to the message queue of each node on the blockchain.
  • All access parties of the unified operation and maintenance system access the blockchain network in the form of nodes, and all nodes have all the source code data of the unified operation and maintenance system.
  • the source code data is written into the contract ledger by the script calling the smart contract during initialization.
  • each node needs to build its own message queue service. The node acts as a message producer to push messages to the message queue, and the unified operation and maintenance service access party acts as a message consumer to subscribe to the message queue.
  • the smart contract updates the on-chain configuration file on the blockchain according to the update or modification in the operation and maintenance request when it receives an external operation and maintenance request.
  • the content of the operation and maintenance request generates an operation and maintenance message, and pushes the operation and maintenance message to the message queue of each access party of the unified operation and maintenance system.
  • Each access party of the above unified operation and maintenance system may be each terminal of the same system, or may be access parties of different systems that are applied to the same operation and maintenance management logic but are physically isolated.
  • Step S220 In the case that the operation and maintenance message is successfully pushed to the message queue, record the operation and maintenance message to the message queue of each node on the blockchain in transaction form on the blockchain. After confirming that the operation and maintenance message has been successfully sent to the message queue of each node, the consensus and placement of on-chain transactions are carried out, and written into the blockchain ledger to ensure that the message queue service of each node has completed the placement of the message.
  • the contract and blockchain consensus mechanism carry out credit endorsement for the operation and maintenance process. Optionally, if the operation and maintenance message is not successfully sent, the transaction is rolled back.
  • Step S230 Obtain the operation and maintenance message from the message queue, and perform the operation and maintenance operation corresponding to the operation and maintenance message on the node according to the operation and maintenance message.
  • Each operation and maintenance system access node subscribes to the messages in the message queue, obtains the operation and maintenance message from the message queue when receiving the message, and executes the operation according to the operation and maintenance operation indicated in the operation and maintenance message. For example, if the operation and maintenance request requires the unified shutdown of all the operation and maintenance system access parties on the chain, the blockchain sends a shutdown command, and the access end will receive the operation and maintenance message indicating the shutdown. When the configuration information corresponding to the request is at the administrator level, all clients accessing the blockchain will shut down the system.
  • steps S210 to S230 based on the characteristics of the blockchain platform, combined with the message queue to achieve unified operation and maintenance management of multiple systems, since the system time in the blockchain network is unified for each node, the transaction placement time is for each node.
  • the nodes are also consistent, which improves the time consistency of the operation and maintenance system; at the same time, the smart contract and blockchain consensus mechanism are used to endorse the operation and maintenance process, which improves the security and reliability of the operation and maintenance process.
  • the blockchain platform updates the on-chain configuration file on the blockchain according to the operation and maintenance request, and receives the uploaded updated bytecode file and saves it to the block
  • each operation and maintenance system access node obtains the operation and maintenance message from the message queue, obtains the updated bytecode file from the blockchain according to the operation and maintenance message, and replaces the original on the node with the updated bytecode file.
  • the updated bytecode file is loaded to complete the update.
  • the operation and maintenance request is a version rollback
  • the blockchain since the blockchain will save all files and data on the chain in history, it only needs to obtain the bytecode version number that needs to be rolled back, and the node can download Obtain the bytecode file of the lower version corresponding to the version on the blockchain, replace the bytecode file of the higher version on the node with the bytecode file of the lower version, and load the bytecode file of the lower version.
  • Implement version fallback is not necessarily a rollback to the previous version of the existing version, but may be any historical version.
  • the access node of the operation and maintenance system can also be downgraded according to its own needs.
  • the access side of the operation and maintenance system has a preset rollback process, and the process indicates that if the update fails during the update process, the node automatically rolls back to the specified version.
  • the rollback process is triggered, the node will obtain the bytecode corresponding to the rollback version number from the blockchain according to the rollback version number preset in the rollback process, and update the rollback version.
  • the bytecode is loaded to this node, so as to realize the spontaneous version fallback of the access node.
  • the on-chain configuration file on the blockchain is updated according to the operation and maintenance request, and the execution node corresponding to the operation and maintenance request is determined according to the on-chain configuration file; the operation and maintenance message is pushed to the message queue of the execution node.
  • an execution node that performs an operation and maintenance operation may be specified in a configuration file through an operation and maintenance request. If the instruction of the configuration information is a version update, and not all access parties will be updated at the same time, only the access parties indicated in the configuration information will be updated, and other nodes do not need to be updated. In the process of updating, the update needs to be obtained from the blockchain. The manner provided in this embodiment makes the operation and maintenance more flexible.
  • FIG. 3 is a flowchart of the processing of operation and maintenance records in the blockchain-based operation and maintenance method according to an embodiment of the present application, as shown in FIG. 3 .
  • the blockchain-based operation and maintenance method includes the following steps:
  • Step S310 Update the on-chain configuration file and the operation and maintenance record on the blockchain according to the operation and maintenance request, and push the operation and maintenance message to the message queue of each node on the blockchain.
  • the blockchain also stores the operation and maintenance records for the source code data.
  • the operation object, operation content, etc. corresponding to each operation and maintenance operation may be recorded in the above operation and maintenance record.
  • the smart contract receives an external operation and maintenance request, it updates the on-chain configuration file stored on the blockchain according to the update or modification content in the operation and maintenance request, while maintaining the corresponding operation and maintenance record.
  • the operation and maintenance message pushed to the message queue of each node also includes the operation and maintenance record corresponding to the operation and maintenance message.
  • Step S320 In the case that the operation and maintenance message is successfully pushed to the message queue, record the push operation on the blockchain in the form of a transaction. As mentioned above, the operation and maintenance message is pushed to the message queue of each node. After confirming that the operation and maintenance message has been successfully sent to the message queue of each node, the consensus and placement of on-chain transactions are carried out and written into the blockchain ledger.
  • Step S330 Obtain the operation and maintenance message from the message queue, and perform the operation and maintenance operation corresponding to the operation and maintenance message on the node according to the operation and maintenance record in the operation and maintenance message.
  • steps S310 to S330 not only source code data but also operation and maintenance records are stored on the blockchain.
  • the process of operation and maintenance can be better managed and tracked, and the security of operation and maintenance can be improved.
  • the access party of the operation and maintenance system in the case of frequent or complex operation and maintenance operations, the updated content can be accurately obtained from the blockchain according to the operation and maintenance records in the operation and maintenance message, so as to prevent the update of the updated version. Obfuscation further improves the consistency and security of operation and maintenance.
  • the operation and maintenance record includes an identifier, a system type, and an operation and maintenance policy.
  • the identifier is unique and is used to indicate the operation and maintenance operation uniquely corresponding to the operation and maintenance record
  • the system type indicates the system type corresponding to the operation and maintenance operation
  • the operation and maintenance strategy can be customized. For example, if the operation and maintenance operation is an urgent bug fix, an automatic pull update is performed; if the operation and maintenance operation is a regular update, the system administrator decides whether to perform it.
  • the operation and maintenance strategy in the smart contract is initialized at the beginning of the construction of the blockchain platform, and the operation and maintenance strategy of each application server, that is, the unified operation and maintenance service access party, can be customized according to the operation and maintenance strategy of the blockchain.
  • the contents included in the above operation and maintenance records can improve the accuracy and flexibility of the operation and maintenance process.
  • the smart contract pushes operation and maintenance messages to the message queues of each node through the oracle machine.
  • the function of the oracle machine is to write external information into the blockchain to complete the data exchange between the blockchain and the real world. It allows certain smart contracts to respond to the uncertain external world, and is the way for smart contracts to interact with the outside world, and it is also the interface between the blockchain and the real world.
  • the smart contract runs in the sandbox environment and does not directly interact with external data.
  • the message push process uses the oracle to interact with the outside world. After confirming that the message is successfully sent to the node message queue, the consensus and placement of the on-chain transaction are carried out, and written to the area. Blockchain ledger.
  • the operation and maintenance message push status is obtained through the oracle machine, which can better ensure that the operation and maintenance message is sent to the message queue of each node, so as to better ensure that the operation and maintenance process is executed on each node. Improve the consistency of operation and maintenance.
  • the message push process uses the oracle machine to interact with the outside world. If the message queue of a node fails to produce messages, the oracle machine re-sends the failed message. The purpose is to ensure that the message queue service of each node has completed the message placement. , so that each access party of the operation and maintenance system can complete the operation and maintenance operation.
  • the loading of the bytecode file is completed by the hot loader.
  • the hot loader of the code means that the changed code can take effect without restarting the service.
  • the hot loader can significantly improve the efficiency of development and debugging.
  • the system realizes non-stop maintenance through hot loading technology. The system only needs to pull the latest bytecode and replace the bytecode file in its running container, and use the code hot loader to load it into the running environment to complete the maintenance and upgrade process.
  • FIG. 4 is a schematic structural diagram of a blockchain-based operation and maintenance system implemented according to the present application.
  • a blockchain-based operation and maintenance system 40 is provided, and the system 40 includes The operation and maintenance system access party 42 and the blockchain platform 44.
  • the operation and maintenance system access party 42 accesses the blockchain platform 44 in the form of a node and deploys a smart contract on the blockchain platform 44.
  • the operation and maintenance system The access party has its own message queue 46;
  • the smart contract is used to update the on-chain configuration file on the blockchain according to the operation and maintenance request of the operation and maintenance system access party 42 , and push the operation and maintenance message to the message queue 46 , in the case that the operation and maintenance message is successfully pushed to the message queue 46
  • the push operation is recorded on the blockchain in the form of a transaction, wherein the configuration file on the chain corresponds to the operation and maintenance request, and the operation and maintenance message corresponds to the operation and maintenance request;
  • the operation and maintenance system access party 42 obtains the operation and maintenance message from the message queue 46, and performs the operation and maintenance operation corresponding to the operation and maintenance message on the node according to the operation and maintenance message.
  • the smart contract includes a data processing module and a message push module: the data processing module is used to update the on-chain configuration file and the operation and maintenance record on the blockchain according to the operation and maintenance request of the operation and maintenance system access party 42; the message The push module is used to push the operation and maintenance message to the message queue 46, wherein the operation and maintenance message includes the operation and maintenance record.
  • Figure 4 only shows the situation that the blockchain-based operation and maintenance system includes three operation and maintenance system access parties, three message queues, and three nodes on the blockchain platform. In an application, there may be more or less than three parties. And in some embodiments, the system may not include the operation and maintenance system access party 42, and is only used for the operation and maintenance of blockchain nodes.
  • the operation and maintenance system access party 42 may be various forms of third-party operation and maintenance tools, operation and maintenance platforms, or operation and maintenance systems.
  • the specific definition of the operation and maintenance system based on the blockchain please refer to the definition of the operation and maintenance method based on the blockchain above, which will not be repeated here.
  • Each module in the above-mentioned blockchain-based operation and maintenance system can be implemented in whole or in part by software, hardware and combinations thereof.
  • the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
  • the above blockchain-based operation and maintenance system updates the on-chain configuration file on the blockchain according to the operation and maintenance request, and pushes the operation and maintenance message to the message queue of each node on the blockchain, wherein the on-chain configuration file and the operation and maintenance
  • the operation and maintenance message corresponds to the request
  • the operation and maintenance message corresponds to the operation and maintenance request
  • the push operation is recorded on the blockchain in the form of a transaction
  • the operation and maintenance message is obtained from the message queue.
  • message and update the node configuration file corresponding to the operation and maintenance message on the node according to the operation and maintenance message.
  • Fig. 5 is a schematic diagram of the architecture of a blockchain-based operation and maintenance system according to an optional embodiment of the present application.
  • the underlying blockchain platform needs to build multiple nodes, and all access parties of the unified operation and maintenance system use nodes as nodes. way to access. All the nodes have all the source code data of the application system. The source code data is written into the contract ledger by the script calling the smart contract during initialization.
  • the node side needs to build its own message queue service.
  • the node acts as a message producer to push messages to the message queue, and the unified operation and maintenance service access party acts as a message consumer to subscribe to the message queue.
  • smart contracts are divided into two modules in design. Including data processing and message push modules.
  • the data processing module receives and processes external operation and maintenance requests and code bytecode files required for operation and maintenance. Specifically, the data processing module updates the source code file, that is, the bytecode file, on the chain according to the external request, and maintains the corresponding operation and maintenance records.
  • the operation and maintenance records include unique identifiers, system types, and operation and maintenance strategies.
  • the message push module monitors the behavior of the data processing module, and pushes the operation and maintenance messages according to the newly added operation and maintenance records of the data processing module.
  • the smart contract runs in the sandbox environment and does not directly interact with external data.
  • the message push process uses the oracle to interact with the outside world.
  • the consensus and placement of the on-chain transaction are carried out, and written to the area.
  • Blockchain ledger otherwise the transaction is rolled back. If a node fails to produce a message, the oracle machine reissues the failed message, and finally ensures that the message queue service of each node completes the message placement.
  • the access party consumes the messages in its message queue through the unified operation and maintenance subscription service, pulls the latest code bytecode file on the chain according to the system type and operation and maintenance strategy in the operation and maintenance message, and updates the code bytecode file in the running container , and use the hot loader to complete the hot loading of bytecode files to achieve the ultimate goal of operation and maintenance.
  • the operation and maintenance strategy can be customized.
  • an automatic pull update is performed. If it is a regular update, the system administrator decides whether to perform it.
  • the operation and maintenance strategy in the smart contract is initialized at the beginning of the construction of the blockchain platform.
  • the operation and maintenance strategy of each application server, that is, the unified operation and maintenance service access party, can be customized according to the operation and maintenance strategy of the blockchain.
  • FIG. 6 is a flowchart of a blockchain-based operation and maintenance method according to an optional embodiment of the present application. As shown in FIG. 6 , the blockchain-based operation and maintenance process includes the following steps:
  • Step S610 The smart contract obtains a unified operation and maintenance request.
  • a unified operation and maintenance request is initiated from outside the blockchain platform.
  • Step S620 The smart contract executes data processing logic. Update on-chain source code bytecode files and maintain operation and maintenance records.
  • Step S630 The smart contract publishes the operation and maintenance message to the message queue through the oracle machine. After the smart contract completes data processing, it publishes operation and maintenance messages to the message queue corresponding to the server where each node is located through the oracle machine.
  • Step S640 Determine whether the operation and maintenance message is successfully published.
  • Step S650 in the case that the publishing of the operation and maintenance message fails, the operation and maintenance operation is rolled back.
  • Step S660 In the case that the operation and maintenance message is published successfully, a node consensus is performed, and the transaction is placed. After the oracle machine determines that the node corresponding to the message queue receives the message, each node reaches a consensus, synchronizes the transaction data, and completes the transaction.
  • Step S670 the access party consumes the message from the message queue.
  • the node access party that is, the unified operation and maintenance service access party, consumes messages and pulls the latest bytecode files on the chain.
  • Step S680 The application system container updates the bytecode file and performs hot loading.
  • the application system container replaces the existing bytecode file in the system running container with the latest bytecode file obtained on the chain, and uses the hot loader to hot load the bytecode file, and finally completes the entire operation and maintenance process.
  • the blockchain-based operation and maintenance method in the above-mentioned optional embodiment realizes unified operation and maintenance management of multiple systems, and physical isolation of multiple systems. It is effective for multiple systems, and based on this, the credit endorsement of the entire process is realized to ensure the consistency of operation and maintenance versions, and at the same time, historical updates can be traced back and easily restored. Through this technology, the system can be maintained without downtime. The system only needs to pull the latest bytecode and replace the bytecode file in its running container, and use the code hot loader to load it into the running environment to complete the maintenance and upgrade process. Based on the characteristics of the blockchain platform, combined with message queue and code file hot loading technology to achieve unified operation and maintenance management of multiple systems, use smart contracts and blockchain consensus mechanism to endorse the operation and maintenance process, and finally realize the blockchain-based unified operation and maintenance plan.
  • the above optional embodiments are mainly aimed at the operation and maintenance of external application systems, but the method provided in this application is not limited to the operation and maintenance scenarios of external application systems in the above optional embodiments, for example, code hot loading
  • the controller can point to the blockchain node in the reverse direction, so as to realize the self-update of the blockchain node.
  • this solution can also be provided to the blockchain Chain nodes respond to self-update of new business requirements.
  • the method provided by this application can also be combined with other systems with operation and maintenance requirements, and the modification and improvement of the scheme made under the premise of not departing from the concept of this application all belong to the protection scope of this application.
  • steps in the flowcharts in FIGS. 2 to 6 are sequentially displayed in accordance with the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, the execution of these steps is not strictly limited to the order, and these steps may be performed in other orders. Moreover, at least a part of the steps in FIG. 2 to FIG. 6 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed and completed at the same time, but may be executed at different times. These sub-steps or stages may be executed at different times. The order of execution of the stages is also not necessarily sequential, but may be performed alternately or alternately with other steps or sub-steps of other steps or at least a portion of a stage.
  • FIG. 7 is a schematic structural diagram of a blockchain-based operation and maintenance computer device according to an embodiment of the present application. As shown in FIG. 7 , its internal The structure diagram can be shown in Figure 7.
  • the computer equipment includes a processor, memory, a network interface, a display screen, and an input device connected by a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium, an internal memory.
  • the nonvolatile storage medium stores an operating system and a computer program.
  • the internal memory provides an environment for the execution of the operating system and computer programs in the non-volatile storage medium.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the computer program is executed by the processor to implement a blockchain-based operation and maintenance method.
  • the display screen of the computer equipment may be a liquid crystal display screen or an electronic ink display screen
  • the input device of the computer equipment may be a touch layer covered on the display screen, or a button, a trackball or a touchpad set on the shell of the computer equipment , or an external keyboard, trackpad, or mouse.
  • FIG. 7 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied. Include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
  • a computer device including a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor implements the above blockchain-based operation and maintenance method when the computer program is executed .
  • the above-mentioned blockchain-based operation and maintenance computer equipment updates the on-chain configuration file on the blockchain according to the operation and maintenance request, and pushes the operation and maintenance message to the message queue of each node on the blockchain.
  • the operation and maintenance message corresponds to the operation and maintenance request; when the operation and maintenance message is successfully pushed to the message queue, the push operation is recorded on the blockchain in the form of a transaction; the operation and maintenance message is obtained from the message queue.
  • maintenance message and execute the operation and maintenance operation corresponding to the operation and maintenance message on the node according to the operation and maintenance message.
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the foregoing blockchain-based operation and maintenance method is implemented.
  • the above-mentioned blockchain-based operation and maintenance computer-readable storage medium updates the on-chain configuration file on the blockchain according to the operation and maintenance request, and pushes the operation and maintenance message to the message queue of each node on the blockchain, wherein the on-chain configuration
  • the file corresponds to the operation and maintenance request
  • the operation and maintenance message corresponds to the operation and maintenance request
  • the push operation is recorded on the blockchain in the form of a transaction
  • Nonvolatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • RAM is available in various forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Road (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous chain Road (Synchlink) DRAM
  • SLDRAM synchronous chain Road (Synchlink) DRAM
  • Rambus direct RAM
  • DRAM direct memory bus dynamic RAM
  • RDRAM memory bus dynamic RAM

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Human Resources & Organizations (AREA)
  • Marketing (AREA)
  • Finance (AREA)
  • Economics (AREA)
  • Strategic Management (AREA)
  • Data Mining & Analysis (AREA)
  • General Business, Economics & Management (AREA)
  • Tourism & Hospitality (AREA)
  • Quality & Reliability (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Operations Research (AREA)
  • Development Economics (AREA)
  • Technology Law (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A blockchain-based operation and maintenance method and system, a computer device and a storage medium. The method comprises: updating an on-chain configuration file on a blockchain according to an operation and maintenance request, and pushing an operation and maintenance message to a message queue of each node on the blockchain, wherein the on-chain configuration file corresponds to the operation and maintenance request, and the operation and maintenance message corresponds to the operation and maintenance request; under the condition that the operation and maintenance message is successfully pushed to the message queue, recording the push operation on the blockchain in the form of a transaction; and obtaining the operation and maintenance message from the message queue and according to the operation and maintenance message, performing an operation and maintenance operation corresponding to the operation and maintenance message on the node.

Description

基于区块链的运维方法、系统、计算机设备和存储介质Blockchain-based operation and maintenance method, system, computer equipment and storage medium
相关申请Related applications
本申请要求2020年10月15日申请的,申请号为202011101503.X,发明名称为“基于区块链的运维方法、系统、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on October 15, 2020, the application number is 202011101503.X, and the invention name is "blockchain-based operation and maintenance method, system, computer equipment and storage medium", all of which The contents are incorporated herein by reference.
技术领域technical field
本申请涉及区块链技术领域,特别是涉及一种基于区块链的运维方法、系统、计算机设备和存储介质。The present application relates to the field of blockchain technology, in particular to a blockchain-based operation and maintenance method, system, computer equipment and storage medium.
背景技术Background technique
在系统运维中软件版本迭代是十分常见的需求,目前持续集成(Continuous integration,简称CI)已成为在整个软件开发生命周期内侧重于保证代码质量的常见做法,它是一种实践,旨在缓和和稳固软件的构建过程。而持续交付(Continuous Delivery,简称CD)是在持续集成CI的基础上,将集成后的代码部署到更贴近真实运行环境中。然而,相关技术中,现有的系统运维方案例如采用Jenkins作为CI工具,多个系统进行统一的运维管理时难以保证时效性和安全性。例如,多个运维系统的系统时间不一致,则在迭代时可能出现迭代过程的时间差较大,使得各个系统无法完成协同工作;又例如,多个运维系统无法确保其升级维护的内容一致,可能会导致升级过程中出现漏洞,引发安全性问题。Software version iteration is a very common requirement in system operation and maintenance. At present, continuous integration (CI) has become a common practice focusing on ensuring code quality throughout the software development life cycle. It is a practice aimed at Ease and stabilize the software build process. Continuous Delivery (CD for short) is based on continuous integration of CI, deploying the integrated code to a more realistic operating environment. However, in the related art, the existing system operation and maintenance scheme, for example, uses Jenkins as a CI tool, and it is difficult to ensure timeliness and security when multiple systems are unified for operation and maintenance management. For example, if the system time of multiple operation and maintenance systems is inconsistent, there may be a large time difference in the iterative process during iteration, so that each system cannot complete the collaborative work; for another example, multiple operation and maintenance systems cannot ensure that the content of their upgrade and maintenance is consistent. It may lead to vulnerabilities in the upgrade process and cause security issues.
针对相关技术中,运维方案中时效性和安全性差的问题,目前尚未提出有效的解决方案。Aiming at the problems of poor timeliness and security in the operation and maintenance scheme in related technologies, no effective solution has been proposed yet.
发明内容SUMMARY OF THE INVENTION
基于此,有必要针对上述技术问题,提供一种基于区块链的运维方法、系统、计算机设备和存储介质。Based on this, it is necessary to provide a blockchain-based operation and maintenance method, system, computer equipment and storage medium for the above technical problems.
第一方面,本申请实施例提供了一种基于区块链的运维方法,包括以下步骤:In a first aspect, an embodiment of the present application provides a blockchain-based operation and maintenance method, including the following steps:
根据运维请求更新区块链上的链上配置文件,并推送运维消息至所述区块链上各个节点的消息队列,其中,所述链上配置文件与所述运维请求对应,所述运维消息与所述运维请求对应;Update the on-chain configuration file on the blockchain according to the operation and maintenance request, and push the operation and maintenance message to the message queue of each node on the blockchain, wherein the on-chain configuration file corresponds to the operation and maintenance request, so The operation and maintenance message corresponds to the operation and maintenance request;
在所述运维消息被成功推送至所述消息队列的情况下,将所述推送运维消息至所述区块链上各个节点的消息队列以交易形式记录在所述区块链上;In the case that the operation and maintenance message is successfully pushed to the message queue, record the push operation and maintenance message to the message queue of each node on the blockchain in the form of a transaction on the blockchain;
从所述消息队列中获取所述运维消息,并根据所述运维消息在所述节点上执行与所述运维消息对应的运维操作。The operation and maintenance message is acquired from the message queue, and an operation and maintenance operation corresponding to the operation and maintenance message is performed on the node according to the operation and maintenance message.
在其中一个实施例中,所述方法还包括:根据所述运维请求更新所述区块链上的链上配置文件以及运维记录,推送所述运维消息至所述区块链上各个节点的消息队列,其中,所述运维消息包括所述运维记录;In one embodiment, the method further includes: updating an on-chain configuration file and an operation and maintenance record on the blockchain according to the operation and maintenance request, and pushing the operation and maintenance message to each a message queue of a node, wherein the operation and maintenance message includes the operation and maintenance record;
从所述消息队列中获取所述运维消息,并根据所述运维消息中的所述运维记录在所述节点上执行与所述运维消息对应的运维操作。The operation and maintenance message is acquired from the message queue, and an operation and maintenance operation corresponding to the operation and maintenance message is performed on the node according to the operation and maintenance record in the operation and maintenance message.
在其中一个实施例中,所述运维记录包括标识符、系统类型和运维策略。In one embodiment, the operation and maintenance record includes an identifier, a system type, and an operation and maintenance policy.
在其中一个实施例中,在所述运维请求为版本更新的情况下,所述方法还包括:In one embodiment, when the operation and maintenance request is a version update, the method further includes:
根据所述运维请求更新所述区块链上的链上配置文件,并上传字节码文件至所述区块链上,推送所述运维消息至所述区块链各个上节点的消息队列,其中,所述字节码文件与所述运维请求对应;Update the on-chain configuration file on the blockchain according to the operation and maintenance request, upload the bytecode file to the blockchain, and push the operation and maintenance message to the messages of each node on the blockchain a queue, wherein the bytecode file corresponds to the operation and maintenance request;
在所述运维消息被成功推送至所述消息队列的情况下,将所述推送所述运维消息至所述区块链上各个节点的消息队列以交易形式记录在所述区块链上;In the case that the operation and maintenance message is successfully pushed to the message queue, record the message queue that pushes the operation and maintenance message to each node on the blockchain in the form of a transaction on the blockchain ;
从所述消息队列中获取所述运维消息,根据所述运维消息从所述区块链上获取所述字节码文件,并将所述字节码文件更新至所述节点。Obtain the operation and maintenance message from the message queue, obtain the bytecode file from the blockchain according to the operation and maintenance message, and update the bytecode file to the node.
在其中一个实施例中,在所述运维请求为版本回退的情况下,所述方法还包括:In one embodiment, when the operation and maintenance request is a version rollback, the method further includes:
获取所述运维请求的回退版本号,推送所述运维消息至所述区块链上各个节点的消息队列,其中,所述区块链中存储了与所述字节码文件的对应的版本号;Obtain the rollback version number of the operation and maintenance request, and push the operation and maintenance message to the message queue of each node on the blockchain, where the corresponding bytecode file is stored in the blockchain version number;
从所述消息队列中获取所述运维消息,根据所述运维消息从所述区块链上获取与所述回退版本对应的回退版字节码文件,并将所述回退版字节码文件更新至与所述消息队列对应的所述节点。Obtain the operation and maintenance message from the message queue, obtain the fallback version bytecode file corresponding to the rollback version from the blockchain according to the operation and maintenance message, and store the fallback version A bytecode file is updated to the node corresponding to the message queue.
在其中一个实施例中,所述方法还包括:在预设的回退进程被触发的情况下,根据所述回退进程获取回退版本号,从所述区块链上获取与所述回退版本对应的回退版字节码文件,并将所述回退版字节码文件更新至与所述消息队列对应的所述节点。In one of the embodiments, the method further includes: when a preset rollback process is triggered, obtaining a rollback version number according to the rollback process, and obtaining and matching the rollback version number from the blockchain. A fallback version bytecode file corresponding to the fallback version is updated, and the fallback version bytecode file is updated to the node corresponding to the message queue.
在其中一个实施例中,将所述字节码文件更新至与所述消息队列对应的所述节点之后,所述方法还包括:In one of the embodiments, after updating the bytecode file to the node corresponding to the message queue, the method further includes:
通过热加载器完成所述字节码文件的加载。The loading of the bytecode file is completed by a hot loader.
在其中一个实施例中,所述推送运维消息至所述区块链上各个节点的消息队列包括:In one embodiment, the pushing the operation and maintenance message to the message queue of each node on the blockchain includes:
通过预言机推送所述运维消息至所述消息队列;Push the operation and maintenance message to the message queue through the oracle;
在所述运维消息推送失败的情况下,通过所述预言机补发所述运维消息,直至所述运维消息推送成功。In the case that the operation and maintenance message fails to be pushed, the operation and maintenance message is reissued through the oracle machine until the operation and maintenance message is pushed successfully.
在其中一个实施例中,所述根据运维请求更新区块链上的链上配置文件,并推送运维消息至所述区块链上各个节点的消息队列包括:In one embodiment, updating the on-chain configuration file on the blockchain according to the operation and maintenance request, and pushing the operation and maintenance message to the message queue of each node on the blockchain includes:
根据所述运维请求更新所述区块链上的链上配置文件,并根据所述链上配置文件确定与所述运维请求对应的执行节点;Update the on-chain configuration file on the blockchain according to the operation and maintenance request, and determine the execution node corresponding to the operation and maintenance request according to the on-chain configuration file;
推送所述运维消息至所述执行节点的消息队列。Push the operation and maintenance message to the message queue of the execution node.
第二方面,本申请实施例还提供一种基于区块链的运维系统,所述系统包括运维系统接入方和区块链平台,所述运维系统接入方以节点的方式接入所述区块链平台并在所述区块链平台上部署有智能合约,所述运维系统接入方有各自的消息队列:In the second aspect, the embodiments of the present application further provide a blockchain-based operation and maintenance system, the system includes an operation and maintenance system access party and a blockchain platform, and the operation and maintenance system access party is connected in a node manner Enter the blockchain platform and deploy smart contracts on the blockchain platform, and the operation and maintenance system access parties have their own message queues:
所述智能合约用于根据所述运维系统接入方的运维请求更新区块链上的链上配置文件,并推送运维消息至所述区块链上各个节点的消息队列,在所述运维消息被成功推送至所述消息队列的情况下,将所述推送运维消息至所述区块链上各个节点的消息队列以交易形式记录在所述区块链上,其中,所述链上配置文件与所述运维请求对应,所述运维消息与所述运维请求对应;The smart contract is used to update the on-chain configuration file on the blockchain according to the operation and maintenance request of the access party of the operation and maintenance system, and push the operation and maintenance message to the message queue of each node on the blockchain. In the case that the operation and maintenance message is successfully pushed to the message queue, the operation and maintenance message pushed to the message queue of each node on the blockchain is recorded on the blockchain in the form of a transaction, wherein the The on-chain configuration file corresponds to the operation and maintenance request, and the operation and maintenance message corresponds to the operation and maintenance request;
所述运维系统接入方从所述消息队列中获取所述运维消息,并根据所述运维消息在所述节点上执行与所述运维消息对应的运维操作。The operation and maintenance system access party obtains the operation and maintenance message from the message queue, and performs the operation and maintenance operation corresponding to the operation and maintenance message on the node according to the operation and maintenance message.
在其中一个实施例中,所述智能合约包括数据处理模块和消息推送模块:In one embodiment, the smart contract includes a data processing module and a message push module:
所述数据处理模块用于根据所述运维系统接入方的运维请求更新区块链上的字节码文件以及运维记录;The data processing module is used to update the bytecode file and the operation and maintenance record on the blockchain according to the operation and maintenance request of the operation and maintenance system access party;
所述消息推送模块用于推送所述运维消息至所述消息队列,其中,所述运维消息包括所述运维记录。The message pushing module is configured to push the operation and maintenance message to the message queue, wherein the operation and maintenance message includes the operation and maintenance record.
第三方面,本申请实施例提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述基于区块链的运维方法。In a third aspect, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and running on the processor, the processor implementing the above-mentioned region-based program when executing the computer program The operation and maintenance method of the blockchain.
第四方面,本申请实施例还提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述基于区块链的运维方法。In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned blockchain-based operation and maintenance method is implemented.
上述基于区块链的运维方法、系统、计算机设备和存储介质,根据运维请求更新区块链上的链上配置文件,并推送运维消息至区块链上各个节点的消息队列,在运维消息被成功推送至消息队列的情况下,将推送操作以交易形式记录在区块链上;从消息队列中获取 运维消息,并根据运维消息在节点上执行与运维消息对应的运维操作,通过区块链节点间共识,实现了一次运维操作同时对多个系统生效,并实现了整个流程的信用背书,保证运维版本的一致性和安全性。The above blockchain-based operation and maintenance method, system, computer equipment and storage medium update the on-chain configuration file on the blockchain according to the operation and maintenance request, and push the operation and maintenance message to the message queue of each node on the blockchain. When the operation and maintenance message is successfully pushed to the message queue, the push operation is recorded on the blockchain as a transaction; the operation and maintenance message is obtained from the message queue, and the operation and maintenance message corresponding to the operation and maintenance message is executed on the node according to the operation and maintenance message. The operation and maintenance operation, through the consensus among the blockchain nodes, realizes that one operation and maintenance operation takes effect on multiple systems at the same time, and realizes the credit endorsement of the whole process to ensure the consistency and security of the operation and maintenance version.
附图说明Description of drawings
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described herein are used to provide further understanding of the present application and constitute a part of the present application. The schematic embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation of the present application. In the attached image:
图1是根据本申请实施例中基于区块链的运维方法的应用场景图;1 is an application scenario diagram of a blockchain-based operation and maintenance method according to an embodiment of the present application;
图2是根据本申请实施例的基于区块链的运维方法的流程图;2 is a flowchart of a blockchain-based operation and maintenance method according to an embodiment of the present application;
图3是根据本申请实施例的基于区块链的运维方法中运维记录的处理流程图;Fig. 3 is a processing flow chart of operation and maintenance records in the blockchain-based operation and maintenance method according to an embodiment of the present application;
图4是根据本申请实施例的基于区块链的运维系统的结构示意图;4 is a schematic structural diagram of a blockchain-based operation and maintenance system according to an embodiment of the present application;
图5是根据本申请可选实施例中基于区块链的运维系统的架构示意图;5 is a schematic diagram of the architecture of a blockchain-based operation and maintenance system according to an optional embodiment of the present application;
图6是根据本申请可选实施例中基于区块链的运维方法的流程图;6 is a flowchart of a blockchain-based operation and maintenance method according to an optional embodiment of the present application;
图7是根据本申请实施例中基于区块链的运维计算机设备的结构示意图。FIG. 7 is a schematic structural diagram of a blockchain-based operation and maintenance computer device according to an embodiment of the present application.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行描述和说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。基于本申请提供的实施例,本领域普通技术人员在没有作出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.
显而易见地,下面描述中的附图仅仅是本申请的一些示例或实施例,对于本领域的普通技术人员而言,在不付出创造性劳动的前提下,还可以根据这些附图将本申请应用于其他类似情景。此外,还可以理解的是,虽然这种开发过程中所作出的努力可能是复杂并且冗长的,然而对于与本申请公开的内容相关的本领域的普通技术人员而言,在本申请揭露的技术内容的基础上进行的一些设计,制造或者生产等变更只是常规的技术手段,不应当理解为本申请公开的内容不充分。Obviously, the accompanying drawings in the following description are only some examples or embodiments of the present application. For those of ordinary skill in the art, the present application can also be applied to the present application according to these drawings without any creative effort. other similar situations. In addition, it will also be appreciated that while such development efforts may be complex and lengthy, for those of ordinary skill in the art to which the present disclosure pertains, the techniques disclosed in this application Some changes in design, manufacture or production based on the content are only conventional technical means, and it should not be understood that the content disclosed in this application is not sufficient.
在本申请中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域普通技术人员显式地和隐式地理解的是,本申请所描述的实施例在不冲突的情况下,可以与其它实施例相结合。Reference in this application to an "embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor a separate or alternative embodiment that is mutually exclusive of other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
除非另作定义,本申请所涉及的技术术语或者科学术语应当为本申请所属技术领域内具有一般技能的人士所理解的通常意义。本申请所涉及的“一”、“一个”、“一种”、“该”等类似词语并不表示数量限制,可表示单数或复数。本申请所涉及的术语“包括”、“包含”、“具有”以及它们任何变形,意图在于覆盖不排他的包含;例如包含了一系列步骤或模块(单元)的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可以还包括没有列出的步骤或单元,或可以还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。本申请所涉及的“连接”、“相连”、“耦接”等类似的词语并非限定于物理的或者机械的连接,而是可以包括电气的连接,不管是直接的还是间接的。本申请所涉及的“多个”是指两个或两个以上。“和/或”描述关联对象的关联关系,表示可以存在三种关系,例如,“A和/或B”可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。本申请所涉及的术语“第一”、“第二”、“第三”等仅仅是区别类似的对象,不代表针对对象的特定排序。Unless otherwise defined, the technical or scientific terms involved in this application shall have the usual meanings understood by those with ordinary skill in the technical field to which this application belongs. Words such as "a", "an", "an", "the" and the like mentioned in this application do not denote a quantitative limitation, and may denote the singular or the plural. The terms "comprising", "comprising", "having" and any of their variants referred to in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product or process comprising a series of steps or modules (units) The apparatus is not limited to the steps or units listed, but may further include steps or units not listed, or may further include other steps or units inherent to the process, method, product or apparatus. Words like "connected," "connected," "coupled," and the like referred to in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "plurality" referred to in this application refers to two or more. "And/or" describes the association relationship between associated objects, indicating that there can be three kinds of relationships. For example, "A and/or B" can mean that A exists alone, A and B exist at the same time, and B exists alone. The character "/" generally indicates that the associated objects are an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only to distinguish similar objects, and do not represent a specific order for the objects.
区块链为分布式数据库,参与区块链行为的各个节点存储的数据经过共识保持数据一致性。为便于理解本申请文件存储系统中的区块链网络,先对本申请采用的区块链技术进行举例说明。在一些实施例中,电子设备运行该区块链技术以成为该区块链网络的节点,该区块链平台基础架构包括区块链的展现层、应用层、服务层,以及区块链核心支撑模块。The blockchain is a distributed database, and the data stored by each node participating in the blockchain behavior maintains data consistency through consensus. In order to facilitate the understanding of the blockchain network in the file storage system of this application, the blockchain technology adopted in this application will be illustrated first. In some embodiments, the electronic device runs the blockchain technology to become a node of the blockchain network, and the blockchain platform infrastructure includes a blockchain presentation layer, an application layer, a service layer, and a blockchain core support module.
其中,展现层用于将系统功能进行展示,进而实现用户交互,各个文件主体可通过系统客户端登录相应展现层显示的界面访问应用层并以获取信息资源,包括注册界面、操作执行界面、查询界面、应用管理界面、管理员界面等。应用层用于展示区块链网络的具体功能,是文件存储的重要环节,按功能的不同可划分为用户管理、权限控制、目录管理等。服务层用于通过分布式服务器对应用相关功能进行有效的整合和管理,例如用户注册、用户身份管理、加解密服务、分布式账本服务、智能合约服务、数据管理服务等。区块链核心支撑模块包括数据层、网络层、共识层和合约层。其中,数据层用于封装底层数据区块以及相关的数据加密和时间戳等技术。网络层封装了区块链网络系统的P2P组网方式、消息传播协议和数据验证机制等要素,使各节点地位对等且以扁平式拓扑结构相互连通和交互,拥有分布式、自治性、开放可自由进出等特性。区块链网络中每一个节点都能参与区块数据的校验和记账过程,仅当区块数据通过全网大部分节点验证后,才能记入区块链。区块链这种去中心化设计保证文件数据不可篡改、不可伪造。共识层,封装了在决策权高度分散的拓扑网络中快速完成共识的方法,以参与区块链网络的共识机制。合约层,封装有数据访问策略的合约代码,合约代码中的条件被触发时,自动执行相应交易,同时可通过合约内容规定相应的访问条件对相应的数据进行访问等。Among them, the presentation layer is used to display system functions, and then realize user interaction. Each file subject can log in to the interface displayed by the corresponding presentation layer through the system client to access the application layer and obtain information resources, including registration interface, operation execution interface, query interface, application management interface, administrator interface, etc. The application layer is used to display the specific functions of the blockchain network and is an important part of file storage. It can be divided into user management, permission control, and directory management according to different functions. The service layer is used to effectively integrate and manage application-related functions through distributed servers, such as user registration, user identity management, encryption and decryption services, distributed ledger services, smart contract services, and data management services. The core support modules of the blockchain include data layer, network layer, consensus layer and contract layer. Among them, the data layer is used to encapsulate the underlying data blocks and related technologies such as data encryption and time stamping. The network layer encapsulates the P2P networking mode, message dissemination protocol and data verification mechanism of the blockchain network system, so that each node has equal status and is connected and interacted with each other in a flat topology, with distributed, autonomous, open Features such as free entry and exit. Every node in the blockchain network can participate in the verification and accounting process of the block data. Only when the block data is verified by most of the nodes in the entire network can it be recorded in the blockchain. The decentralized design of blockchain ensures that file data cannot be tampered with or forged. The consensus layer encapsulates a method to quickly complete consensus in a topology network with highly decentralized decision-making power to participate in the consensus mechanism of the blockchain network. The contract layer encapsulates the contract code of the data access policy. When the conditions in the contract code are triggered, the corresponding transaction is automatically executed, and the corresponding data can be accessed through the corresponding access conditions specified in the contract content.
图1是根据本申请实施例中基于区块链的运维方法的应用场景图,本申请提供的基于区块链的运维方法,可以应用于如图1所示的应用环境中。区块链网络10包括运维请求方节点12、第一节点14和第二节点16,第一节点14、第二节点16和运维请求方节点12均为统一运维系统的接入方。根据区块链的数据一致性特点,区块链网络10上的所有节点共享运维系统所有源代码数据。运维请求方节点12具有向区块链网络10上传、编辑、增删源代码数据等操作权限。区块链网络10根据运维请求方节点12的运维请求更新区块链上的链上配置文件,并分别推送运维消息至区块链上运维请求方节点12、第一节点14和第二节点16的消息队列,在运维消息被成功推送至消息队列的情况下,将推送操作以交易形式记录在区块链网络10上;区块链网络10的各个节点从消息队列中获取运维消息,并根据运维消息在节点上执行与运维消息对应的运维操作。上述运维请求方节点12、第一节点14和第二节点16具体可以为任意电子设备,例如服务器、手机、计算机、平板电脑等。可以理解的是,上述运维请求方节点12、第一节点14和第二节点16之间可相互通信。运维请求方节点可包括文件节点,第一节点可包括用户节点,第二节点可包括记账节点。另外,上述节点的区分均是根据通过该节点登录的身份信息确定的,在一些实施例中,上述区块链为区块私有链或区块联盟链,故事先在区块链平台上完成身份注册,上述节点的相应主体都需要事先在区块链平台上完成注册,并获取相应的公钥和私钥,确定其身份可信后,允许开展上述文件存储的相关业务。FIG. 1 is an application scenario diagram of the blockchain-based operation and maintenance method according to an embodiment of the present application. The blockchain-based operation and maintenance method provided by the present application can be applied to the application environment shown in FIG. 1 . The blockchain network 10 includes an operation and maintenance requester node 12, a first node 14 and a second node 16, and the first node 14, the second node 16 and the operation and maintenance requester node 12 are all access parties of the unified operation and maintenance system. According to the data consistency characteristics of the blockchain, all nodes on the blockchain network 10 share all source code data of the operation and maintenance system. The operation and maintenance requester node 12 has operation authority such as uploading, editing, adding or deleting source code data to the blockchain network 10 . The blockchain network 10 updates the on-chain configuration file on the blockchain according to the operation and maintenance request of the operation and maintenance requester node 12, and pushes the operation and maintenance messages to the operation and maintenance requester node 12, the first node 14 and the operation and maintenance requester node 12 on the blockchain respectively. The message queue of the second node 16 records the push operation on the blockchain network 10 in the form of a transaction when the operation and maintenance message is successfully pushed to the message queue; each node of the blockchain network 10 obtains from the message queue Operation and maintenance messages, and perform operation and maintenance operations corresponding to the operation and maintenance messages on the node according to the operation and maintenance messages. The above-mentioned operation and maintenance requester node 12 , the first node 14 and the second node 16 may specifically be any electronic device, such as a server, a mobile phone, a computer, a tablet computer, and the like. It can be understood that, the above-mentioned operation and maintenance requester node 12, the first node 14 and the second node 16 can communicate with each other. The operation and maintenance requester node may include a file node, the first node may include a user node, and the second node may include an accounting node. In addition, the distinction between the above nodes is determined according to the identity information logged in through the node. In some embodiments, the above blockchain is a private blockchain or a consortium blockchain, and the story is first completed on the blockchain platform. For registration, the corresponding subjects of the above nodes need to complete the registration on the blockchain platform in advance, and obtain the corresponding public and private keys.
在一个实施例中,图2是根据本申请实施例的基于区块链的运维方法的流程图,提供了一种基于区块链的运维方法,以该方法应用于图1中的区块链网络10为例进行说明,包括以下步骤:In one embodiment, FIG. 2 is a flowchart of a blockchain-based operation and maintenance method according to an embodiment of the present application, which provides a blockchain-based operation and maintenance method, which is applied to the area in FIG. 1 . The blockchain network 10 is used as an example to illustrate, including the following steps:
步骤S210:根据运维请求更新区块链上的链上配置文件,并推送运维消息至区块链上各个节点的消息队列。统一运维系统所有接入方以节点的方式接入区块链网络,所有节点拥有该统一运维系统所有源代码数据。可选地,源代码数据在初始化时由脚本调用智能合约写入合约账本。此外,各个节点方需搭建自己的消息队列服务,节点作为消息生产者推送消息至消息队列,统一运维服务接入方作为消息消费方订阅消息队列。智能合约作为执行区块链上操作的应用程序,在接收到外部运维请求的情况下,根据运维请求中的更新或者修改内容,对区块链上的链上配置文件进行更新,并且根据运维请求的内容生成运维消息,将运维消息推送至统一运维系统的各个接入方的消息队列中。上述统一运维系统的各个接入方可以是同一个系统的各个终端,也可以是应用于同一个运维管理逻辑但物理隔离的不同系统的接入方。Step S210: Update the on-chain configuration file on the blockchain according to the operation and maintenance request, and push the operation and maintenance message to the message queue of each node on the blockchain. All access parties of the unified operation and maintenance system access the blockchain network in the form of nodes, and all nodes have all the source code data of the unified operation and maintenance system. Optionally, the source code data is written into the contract ledger by the script calling the smart contract during initialization. In addition, each node needs to build its own message queue service. The node acts as a message producer to push messages to the message queue, and the unified operation and maintenance service access party acts as a message consumer to subscribe to the message queue. As an application that performs operations on the blockchain, the smart contract updates the on-chain configuration file on the blockchain according to the update or modification in the operation and maintenance request when it receives an external operation and maintenance request. The content of the operation and maintenance request generates an operation and maintenance message, and pushes the operation and maintenance message to the message queue of each access party of the unified operation and maintenance system. Each access party of the above unified operation and maintenance system may be each terminal of the same system, or may be access parties of different systems that are applied to the same operation and maintenance management logic but are physically isolated.
步骤S220:在运维消息被成功推送至消息队列的情况下,将所述推送运维消息至所述 区块链上各个节点的消息队列以交易形式记录在区块链上。在确定运维消息被成功发送至各个节点的消息队列后,进行链上交易的共识和落盘,写入区块链账本,确保每个节点消息队列服务都完成了消息的落盘,利用智能合约和区块链共识机制对运维过程进行信用背书。可选地,在运维消息未被成功发送的情况下,进行交易回滚。Step S220: In the case that the operation and maintenance message is successfully pushed to the message queue, record the operation and maintenance message to the message queue of each node on the blockchain in transaction form on the blockchain. After confirming that the operation and maintenance message has been successfully sent to the message queue of each node, the consensus and placement of on-chain transactions are carried out, and written into the blockchain ledger to ensure that the message queue service of each node has completed the placement of the message. The contract and blockchain consensus mechanism carry out credit endorsement for the operation and maintenance process. Optionally, if the operation and maintenance message is not successfully sent, the transaction is rolled back.
步骤S230:从消息队列中获取运维消息,并根据所述运维消息在节点上执行与运维消息对应的运维操作。各个运维系统接入方节点订阅了消息队列中的消息,在接收到消息的情况下,从消息队列中获取运维消息,并根据运维消息中指示的运维操作执行操作。例如,运维请求需要链上所有的运维系统接入方统一关机,则区块链发一个关机指令,接入端会收到指示停机的运维消息,可选地,在与该运维请求对应的配置信息是管理员级别的情况下,所有接入区块链的客户端就会将系统下线停机。Step S230: Obtain the operation and maintenance message from the message queue, and perform the operation and maintenance operation corresponding to the operation and maintenance message on the node according to the operation and maintenance message. Each operation and maintenance system access node subscribes to the messages in the message queue, obtains the operation and maintenance message from the message queue when receiving the message, and executes the operation according to the operation and maintenance operation indicated in the operation and maintenance message. For example, if the operation and maintenance request requires the unified shutdown of all the operation and maintenance system access parties on the chain, the blockchain sends a shutdown command, and the access end will receive the operation and maintenance message indicating the shutdown. When the configuration information corresponding to the request is at the administrator level, all clients accessing the blockchain will shut down the system.
通过步骤S210至步骤S230,基于区块链平台的特点,结合消息队列实现多个系统的统一运维管理,由于区块链网络中的系统时间对于各个节点是统一的,交易落盘时间对于各个节点也是一致的,提高了运维系统的时间一致性;同时利用智能合约和区块链共识机制对运维过程进行信用背书,提高了运维过程中的安全性和可靠性。Through steps S210 to S230, based on the characteristics of the blockchain platform, combined with the message queue to achieve unified operation and maintenance management of multiple systems, since the system time in the blockchain network is unified for each node, the transaction placement time is for each node. The nodes are also consistent, which improves the time consistency of the operation and maintenance system; at the same time, the smart contract and blockchain consensus mechanism are used to endorse the operation and maintenance process, which improves the security and reliability of the operation and maintenance process.
在一个实施例中,在运维请求为版本更新的情况下,区块链平台根据运维请求更新区块链上的链上配置文件,并接收上传的更新的字节码文件保存至区块链上,各个运维系统接入方节点从消息队列中获取运维消息,根据运维消息从区块链上获取更新后的字节码文件,并用更新后的字节码文件替换节点上原有的字节码文件,将更新后的字节码文件进行加载,即可完成更新。In one embodiment, when the operation and maintenance request is a version update, the blockchain platform updates the on-chain configuration file on the blockchain according to the operation and maintenance request, and receives the uploaded updated bytecode file and saves it to the block On the chain, each operation and maintenance system access node obtains the operation and maintenance message from the message queue, obtains the updated bytecode file from the blockchain according to the operation and maintenance message, and replaces the original on the node with the updated bytecode file. The updated bytecode file is loaded to complete the update.
在一个实施例中,在运维请求为版本回退的情况下,由于区块链会保存所有历史上链的文件及数据,因此只需要获取需要回退的字节码版本号,节点可以从区块链上获取到与该版本对应的低版本的字节码文件,并用该低版本的字节码文件替换该节点上的高版本字节码文件,加载低版本的字节码文件即可实现版本的回退。可选地,上述版本回退不一定是回退至现有版本的上一个版本,而可以是任何历史版本。In one embodiment, when the operation and maintenance request is a version rollback, since the blockchain will save all files and data on the chain in history, it only needs to obtain the bytecode version number that needs to be rolled back, and the node can download Obtain the bytecode file of the lower version corresponding to the version on the blockchain, replace the bytecode file of the higher version on the node with the bytecode file of the lower version, and load the bytecode file of the lower version. Implement version fallback. Optionally, the above version rollback is not necessarily a rollback to the previous version of the existing version, but may be any historical version.
在一个实施例中,运维系统接入方节点也可以根据自身的需求进行降级。例如,在运维系统接入方有预设的回退进程,该进程指示在更新过程中更新失败的情况下,该节点自动回退至指定版本。则在回退进程被触发的情况下,该节点会根据回退进程中预设的回退版本号,从区块链上获取与该回退版本号对应的字节码,更新回退版本的字节码至该节点并进行加载,从而实现接入方节点的自发的版本回退。In an embodiment, the access node of the operation and maintenance system can also be downgraded according to its own needs. For example, the access side of the operation and maintenance system has a preset rollback process, and the process indicates that if the update fails during the update process, the node automatically rolls back to the specified version. When the rollback process is triggered, the node will obtain the bytecode corresponding to the rollback version number from the blockchain according to the rollback version number preset in the rollback process, and update the rollback version. The bytecode is loaded to this node, so as to realize the spontaneous version fallback of the access node.
在一个实施例中,根据运维请求更新区块链上的链上配置文件,并根据链上配置文件确定与运维请求对应的执行节点;推送运维消息至执行节点的消息队列。在本实施例中, 可以通过运维请求在配置文件中指定进行运维操作的执行节点。如果配置信息的指令是版本更新,同时并不是所有接入方都会更新,则配置信息中指示的接入方才会更新,其他节点则不需要更新。更新的过程中需要从区块链中获取更新的。本实施例中提供的方式使得运维的灵活性更高。In one embodiment, the on-chain configuration file on the blockchain is updated according to the operation and maintenance request, and the execution node corresponding to the operation and maintenance request is determined according to the on-chain configuration file; the operation and maintenance message is pushed to the message queue of the execution node. In this embodiment, an execution node that performs an operation and maintenance operation may be specified in a configuration file through an operation and maintenance request. If the instruction of the configuration information is a version update, and not all access parties will be updated at the same time, only the access parties indicated in the configuration information will be updated, and other nodes do not need to be updated. In the process of updating, the update needs to be obtained from the blockchain. The manner provided in this embodiment makes the operation and maintenance more flexible.
在一个实施例中,在区块链上还包括运维记录的情况下,图3是根据本申请实施例的基于区块链的运维方法中运维记录的处理流程图,如图3所示,基于区块链的运维方法包括以下步骤:In one embodiment, in the case where the blockchain also includes operation and maintenance records, FIG. 3 is a flowchart of the processing of operation and maintenance records in the blockchain-based operation and maintenance method according to an embodiment of the present application, as shown in FIG. 3 . As shown, the blockchain-based operation and maintenance method includes the following steps:
步骤S310:根据运维请求更新区块链上的链上配置文件以及运维记录,推送运维消息至区块链上各个节点的消息队列。区块链上存储有统一运维系统所有源代码数据之外,还存储有针对该源代码数据的运维记录。上述运维记录中可以记录每次运维操作所对应的操作对象、操作内容等。智能合约在接收到外部运维请求的情况下,根据运维请求中的更新或者修改内容,对区块链上存储的链上配置文件进行更新的同时,维护对应的运维记录。此外,推送至各个节点的消息队列中的运维消息中也包括与该运维消息对应的运维记录。Step S310: Update the on-chain configuration file and the operation and maintenance record on the blockchain according to the operation and maintenance request, and push the operation and maintenance message to the message queue of each node on the blockchain. In addition to all the source code data of the unified operation and maintenance system, the blockchain also stores the operation and maintenance records for the source code data. The operation object, operation content, etc. corresponding to each operation and maintenance operation may be recorded in the above operation and maintenance record. When the smart contract receives an external operation and maintenance request, it updates the on-chain configuration file stored on the blockchain according to the update or modification content in the operation and maintenance request, while maintaining the corresponding operation and maintenance record. In addition, the operation and maintenance message pushed to the message queue of each node also includes the operation and maintenance record corresponding to the operation and maintenance message.
步骤S320:在运维消息被成功推送至消息队列的情况下,将推送操作以交易形式记录在区块链上。如前述,运维消息被推送至各个节点的消息队列,在确定运维消息被成功发送至各个节点的消息队列后,进行链上交易的共识和落盘,写入区块链账本。Step S320: In the case that the operation and maintenance message is successfully pushed to the message queue, record the push operation on the blockchain in the form of a transaction. As mentioned above, the operation and maintenance message is pushed to the message queue of each node. After confirming that the operation and maintenance message has been successfully sent to the message queue of each node, the consensus and placement of on-chain transactions are carried out and written into the blockchain ledger.
步骤S330:从消息队列中获取运维消息,并根据运维消息中的运维记录在节点上执行与运维消息对应的运维操作。Step S330: Obtain the operation and maintenance message from the message queue, and perform the operation and maintenance operation corresponding to the operation and maintenance message on the node according to the operation and maintenance record in the operation and maintenance message.
步骤S310至步骤S330中,区块链上不仅存储了源代码数据还存储了运维记录,就区块链平台而言,可以更好地管理和跟踪运维的过程,提高运维的安全性;就运维系统接入方而言,在运维操作比较频繁或者复杂的情况下,可以根据运维消息中的运维记录,准确地从区块链上获取到更新内容,防止更新版本的混淆,进一步提高了运维的一致性和安全性。In steps S310 to S330, not only source code data but also operation and maintenance records are stored on the blockchain. As far as the blockchain platform is concerned, the process of operation and maintenance can be better managed and tracked, and the security of operation and maintenance can be improved. ; As far as the access party of the operation and maintenance system is concerned, in the case of frequent or complex operation and maintenance operations, the updated content can be accurately obtained from the blockchain according to the operation and maintenance records in the operation and maintenance message, so as to prevent the update of the updated version. Obfuscation further improves the consistency and security of operation and maintenance.
在一个实施例中,运维记录包括标识符、系统类型和运维策略。其中,标识符是唯一的,用于指示该条运维记录唯一对应的运维操作,系统类型指示该运维操作对应的系统类型,运维策略是可定制化的。例如,该运维操作为紧急的漏洞修复则执行自动拉取更新;该运维操作为常规更新,则由系统管理员决定是否执行。智能合约中运维策略在区块链平台搭建之初就进行初始化,各应用服务器即统一运维服务接入方的运维策略根据区块链的上运维策略进行可定制化的配置。上述运维记录中所包括的内容,都能提高运维过程的准确度和灵活性。In one embodiment, the operation and maintenance record includes an identifier, a system type, and an operation and maintenance policy. The identifier is unique and is used to indicate the operation and maintenance operation uniquely corresponding to the operation and maintenance record, the system type indicates the system type corresponding to the operation and maintenance operation, and the operation and maintenance strategy can be customized. For example, if the operation and maintenance operation is an urgent bug fix, an automatic pull update is performed; if the operation and maintenance operation is a regular update, the system administrator decides whether to perform it. The operation and maintenance strategy in the smart contract is initialized at the beginning of the construction of the blockchain platform, and the operation and maintenance strategy of each application server, that is, the unified operation and maintenance service access party, can be customized according to the operation and maintenance strategy of the blockchain. The contents included in the above operation and maintenance records can improve the accuracy and flexibility of the operation and maintenance process.
在一个实施例中,智能合约通过预言机推送运维消息至各个节点的消息队列。预言机 的功能就是将外界信息写入到区块链内,完成区块链与现实世界的数据互通。它允许确定的智能合约对不确定的外部世界做出反应,是智能合约与外部进行数据交互的途径,也是区块链与现实世界进行数据交互的接口。智能合约运行在沙箱环境中,不直接与外界数据交互,消息推送过程利用预言机与外界交互,在确定消息成功发送至节点消息队列后,进行链上交易的共识和落盘,写入区块链账本。此外,在运维消息推送失败的情况下,通过预言机补发运维消息,直至运维消息推送成功。在本实施例中,通过预言机进行运维消息推送状态的获取,能更好地保证运维消息被发送至各个节点的消息队列中,从而更好地保证运维过程在各个节点被执行,提高了运维的一致性。并且消息推送过程利用预言机与外界交互的过程中,如果有一个节点的消息队列生产消息失败,预言机补发失败的消息,其目的为确保每个节点消息队列服务都完成了消息的落盘,从而使得运维系统的各个接入方都能完成该运维操作。In one embodiment, the smart contract pushes operation and maintenance messages to the message queues of each node through the oracle machine. The function of the oracle machine is to write external information into the blockchain to complete the data exchange between the blockchain and the real world. It allows certain smart contracts to respond to the uncertain external world, and is the way for smart contracts to interact with the outside world, and it is also the interface between the blockchain and the real world. The smart contract runs in the sandbox environment and does not directly interact with external data. The message push process uses the oracle to interact with the outside world. After confirming that the message is successfully sent to the node message queue, the consensus and placement of the on-chain transaction are carried out, and written to the area. Blockchain ledger. In addition, if the operation and maintenance message fails to be pushed, the operation and maintenance message will be re-sent through the oracle machine until the operation and maintenance message is pushed successfully. In this embodiment, the operation and maintenance message push status is obtained through the oracle machine, which can better ensure that the operation and maintenance message is sent to the message queue of each node, so as to better ensure that the operation and maintenance process is executed on each node. Improve the consistency of operation and maintenance. And the message push process uses the oracle machine to interact with the outside world. If the message queue of a node fails to produce messages, the oracle machine re-sends the failed message. The purpose is to ensure that the message queue service of each node has completed the message placement. , so that each access party of the operation and maintenance system can complete the operation and maintenance operation.
在一个实施例中,在节点获取到需要更新的字节码版本或者回退的字节码版本之后,通过热加载器完成字节码文件的加载。代码的热加载器是指可以在不重启服务的情况下让更改的代码生效,热加载器可以显著的提升开发以及调试的效率。通过热加载技术实现了系统不停机维护,系统只需要拉取最新的字节码并替换其运行容器内的字节码文件,利用代码热加载器加载到运行环境即可完成维护升级过程。In one embodiment, after the node obtains the bytecode version that needs to be updated or the rolled-back bytecode version, the loading of the bytecode file is completed by the hot loader. The hot loader of the code means that the changed code can take effect without restarting the service. The hot loader can significantly improve the efficiency of development and debugging. The system realizes non-stop maintenance through hot loading technology. The system only needs to pull the latest bytecode and replace the bytecode file in its running container, and use the code hot loader to load it into the running environment to complete the maintenance and upgrade process.
在一个实施例中,图4是根据本申请实施的基于区块链的运维系统的结构示意图,如图4所示,提供了一种基于区块链的运维系统40,该系统40包括运维系统接入方42和区块链平台44,运维系统接入方42以节点的方式接入区块链平台44并在区块链平台44上部署有智能合约,所述运维系统接入方有各自的消息队列46;In one embodiment, FIG. 4 is a schematic structural diagram of a blockchain-based operation and maintenance system implemented according to the present application. As shown in FIG. 4 , a blockchain-based operation and maintenance system 40 is provided, and the system 40 includes The operation and maintenance system access party 42 and the blockchain platform 44. The operation and maintenance system access party 42 accesses the blockchain platform 44 in the form of a node and deploys a smart contract on the blockchain platform 44. The operation and maintenance system The access party has its own message queue 46;
智能合约用于根据运维系统接入方42的运维请求更新区块链上的链上配置文件,并推送运维消息至消息队列46,在运维消息被成功推送至消息队列46的情况下,将推送操作以交易形式记录在区块链上,其中,链上配置文件与运维请求对应,运维消息与运维请求对应;The smart contract is used to update the on-chain configuration file on the blockchain according to the operation and maintenance request of the operation and maintenance system access party 42 , and push the operation and maintenance message to the message queue 46 , in the case that the operation and maintenance message is successfully pushed to the message queue 46 Next, the push operation is recorded on the blockchain in the form of a transaction, wherein the configuration file on the chain corresponds to the operation and maintenance request, and the operation and maintenance message corresponds to the operation and maintenance request;
运维系统接入方42从消息队列46中获取运维消息,并根据运维消息在节点上执行与运维消息对应的运维操作。The operation and maintenance system access party 42 obtains the operation and maintenance message from the message queue 46, and performs the operation and maintenance operation corresponding to the operation and maintenance message on the node according to the operation and maintenance message.
在一个实施例中,智能合约包括数据处理模块和消息推送模块:数据处理模块用于根据运维系统接入方42的运维请求更新区块链上的链上配置文件以及运维记录;消息推送模块用于推送运维消息至消息队列46,其中,运维消息包括运维记录。In one embodiment, the smart contract includes a data processing module and a message push module: the data processing module is used to update the on-chain configuration file and the operation and maintenance record on the blockchain according to the operation and maintenance request of the operation and maintenance system access party 42; the message The push module is used to push the operation and maintenance message to the message queue 46, wherein the operation and maintenance message includes the operation and maintenance record.
需要说明的是,图4中仅示出了基于区块链的运维系统中包括三个运维系统接入方、三个消息队列和三个区块链平台上的节点的情况,在实际应用中,参与方可以比三个更多 或者更少。并且在一些实施例中,该系统可以不包括运维系统接入方42,仅用于区块链节点的运维。运维系统接入方42可以是各种形式的第三方运维工具、运维平台或者运维系统等。基于区块链的运维系统的具体限定可以参见上文中对于基于区块链的运维方法的限定,在此不再赘述。上述基于区块链的运维系统中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。It should be noted that Figure 4 only shows the situation that the blockchain-based operation and maintenance system includes three operation and maintenance system access parties, three message queues, and three nodes on the blockchain platform. In an application, there may be more or less than three parties. And in some embodiments, the system may not include the operation and maintenance system access party 42, and is only used for the operation and maintenance of blockchain nodes. The operation and maintenance system access party 42 may be various forms of third-party operation and maintenance tools, operation and maintenance platforms, or operation and maintenance systems. For the specific definition of the operation and maintenance system based on the blockchain, please refer to the definition of the operation and maintenance method based on the blockchain above, which will not be repeated here. Each module in the above-mentioned blockchain-based operation and maintenance system can be implemented in whole or in part by software, hardware and combinations thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
上述基于区块链的运维系统,根据运维请求更新区块链上的链上配置文件,并推送运维消息至区块链上各个节点的消息队列,其中,链上配置文件与运维请求对应,运维消息与所述运维请求对应;在运维消息被成功推送至消息队列的情况下,将推送操作以交易形式记录在所述区块链上;从消息队列中获取运维消息,并根据运维消息更新节点上与运维消息对应的节点配置文件,通过区块链节点间共识,实现了一次运维操作同时对多个系统生效,并实现了整个流程的信用背书,保证运维版本的一致性和安全性。The above blockchain-based operation and maintenance system updates the on-chain configuration file on the blockchain according to the operation and maintenance request, and pushes the operation and maintenance message to the message queue of each node on the blockchain, wherein the on-chain configuration file and the operation and maintenance The operation and maintenance message corresponds to the request, and the operation and maintenance message corresponds to the operation and maintenance request; when the operation and maintenance message is successfully pushed to the message queue, the push operation is recorded on the blockchain in the form of a transaction; the operation and maintenance message is obtained from the message queue. message, and update the node configuration file corresponding to the operation and maintenance message on the node according to the operation and maintenance message. Through the consensus among the blockchain nodes, one operation and maintenance operation can take effect on multiple systems at the same time, and the credit endorsement of the whole process is realized. Ensure the consistency and security of the operation and maintenance version.
下面通过可选实施例对本申请实施例进行描述和说明。图5是根据本申请可选实施例中基于区块链的运维系统的架构示意图,如图5所示,底层区块链平台需搭建多个节点,统一运维系统所有接入方以节点的方式接入。所有节点上拥有应用系统所有源代码数据。源代码数据在初始化时由脚本调用智能合约写入合约账本。节点方需搭建自己的消息队列服务,节点作为消息生产者推送消息至消息队列,统一运维服务接入方作为消息消费方订阅消息队列。智能合约作为执行区块链上操作的应用程序,在设计上分为两个模块。包括数据处理和消息推送模块。数据处理模块接收处理外部的运维请求和运维所需的代码字节码文件。具体为数据处理模块根据外部请求对链上源代码文件即字节码文件进行更新,并维护对应的运维记录,运维记录包括唯一标识,系统类型,运维策略。消息推送模块监听数据处理模块的行为,根据数据处理模块新增的运维记录进行运维消息推送。智能合约运行在沙箱环境中,不直接与外界数据交互,消息推送过程利用预言机与外界交互,在确定消息成功发送至节点消息队列后,进行链上交易的共识和落盘,写入区块链账本,否则交易回滚。如果有一个节点生产消息失败,预言机补发失败消息,最终确保每个节点消息队列服务都完成了消息的落盘。接入方通过统一运维订阅服务消费其消息队列中消息,根据运维消息中的系统类型和运维策略拉取链上最新代码字节码文件,并更新运行容器内的代码字节码文件,利用热加载器完成字节码文件的热加载,以达到运维的最终目的。运维策略是可定制化的,若为紧急漏洞修补bugfix,则执行自动拉取更新,若为常规更新,则由系统管理员决定是否执行。智能合约中运维策略在区块链平台搭建之初就进行初始化。各 应用服务器即统一运维服务接入方的运维策略根据区块链的上运维策略进行可定制化的配置。The embodiments of the present application are described and illustrated below by using optional embodiments. Fig. 5 is a schematic diagram of the architecture of a blockchain-based operation and maintenance system according to an optional embodiment of the present application. As shown in Fig. 5, the underlying blockchain platform needs to build multiple nodes, and all access parties of the unified operation and maintenance system use nodes as nodes. way to access. All the nodes have all the source code data of the application system. The source code data is written into the contract ledger by the script calling the smart contract during initialization. The node side needs to build its own message queue service. The node acts as a message producer to push messages to the message queue, and the unified operation and maintenance service access party acts as a message consumer to subscribe to the message queue. As an application that performs operations on the blockchain, smart contracts are divided into two modules in design. Including data processing and message push modules. The data processing module receives and processes external operation and maintenance requests and code bytecode files required for operation and maintenance. Specifically, the data processing module updates the source code file, that is, the bytecode file, on the chain according to the external request, and maintains the corresponding operation and maintenance records. The operation and maintenance records include unique identifiers, system types, and operation and maintenance strategies. The message push module monitors the behavior of the data processing module, and pushes the operation and maintenance messages according to the newly added operation and maintenance records of the data processing module. The smart contract runs in the sandbox environment and does not directly interact with external data. The message push process uses the oracle to interact with the outside world. After confirming that the message is successfully sent to the node message queue, the consensus and placement of the on-chain transaction are carried out, and written to the area. Blockchain ledger, otherwise the transaction is rolled back. If a node fails to produce a message, the oracle machine reissues the failed message, and finally ensures that the message queue service of each node completes the message placement. The access party consumes the messages in its message queue through the unified operation and maintenance subscription service, pulls the latest code bytecode file on the chain according to the system type and operation and maintenance strategy in the operation and maintenance message, and updates the code bytecode file in the running container , and use the hot loader to complete the hot loading of bytecode files to achieve the ultimate goal of operation and maintenance. The operation and maintenance strategy can be customized. If it is an emergency vulnerability patching bugfix, an automatic pull update is performed. If it is a regular update, the system administrator decides whether to perform it. The operation and maintenance strategy in the smart contract is initialized at the beginning of the construction of the blockchain platform. The operation and maintenance strategy of each application server, that is, the unified operation and maintenance service access party, can be customized according to the operation and maintenance strategy of the blockchain.
基于以上的架构,图6是根据本申请可选实施例中基于区块链的运维方法的流程图,如图6所示,基于区块链的运维流程包括以下步骤:Based on the above architecture, FIG. 6 is a flowchart of a blockchain-based operation and maintenance method according to an optional embodiment of the present application. As shown in FIG. 6 , the blockchain-based operation and maintenance process includes the following steps:
步骤S610:智能合约获取统一运维请求。由区块链平台外部发起统一的运维请求。Step S610: The smart contract obtains a unified operation and maintenance request. A unified operation and maintenance request is initiated from outside the blockchain platform.
步骤S620:智能合约执行数据处理逻辑。更新链上源代码字节码文件,并维护运维记录。Step S620: The smart contract executes data processing logic. Update on-chain source code bytecode files and maintain operation and maintenance records.
步骤S630:智能合约通过预言机发布运维消息至消息队列。智能合约完成数据处理后通过预言机向各节点所在服务器对应的消息队列发布运维消息。Step S630: The smart contract publishes the operation and maintenance message to the message queue through the oracle machine. After the smart contract completes data processing, it publishes operation and maintenance messages to the message queue corresponding to the server where each node is located through the oracle machine.
步骤S640:判断运维消息是否发布成功。Step S640: Determine whether the operation and maintenance message is successfully published.
步骤S650:在运维消息发布失败的情况下,进行运维操作回滚。Step S650 : in the case that the publishing of the operation and maintenance message fails, the operation and maintenance operation is rolled back.
步骤S660:在运维消息发布成功的情况下,进行节点共识,交易落盘。预言机在确定节点对应消息队列收到消息后,各节点进行共识,同步交易数据,完成交易落盘。Step S660: In the case that the operation and maintenance message is published successfully, a node consensus is performed, and the transaction is placed. After the oracle machine determines that the node corresponding to the message queue receives the message, each node reaches a consensus, synchronizes the transaction data, and completes the transaction.
步骤S670:接入方从消息队列消费消息。节点接入方即统一运维服务接入方消费消息,拉取链上最新的字节码文件。Step S670: the access party consumes the message from the message queue. The node access party, that is, the unified operation and maintenance service access party, consumes messages and pulls the latest bytecode files on the chain.
步骤S680:应用系统容器更新字节码文件并执行热加载。应用系统容器用链上获取到的最新字节码文件替换系统运行容器内现有的字节码文件,利用热加载器进行字节码文件的热加载,最终完成整个运维过程。Step S680: The application system container updates the bytecode file and performs hot loading. The application system container replaces the existing bytecode file in the system running container with the latest bytecode file obtained on the chain, and uses the hot loader to hot load the bytecode file, and finally completes the entire operation and maintenance process.
上述可选实施例中的基于区块链的运维方法,实现了对多个系统进行统一的运维管理,多个系统物理隔离,通过区块链节点间共识,实现了一次运维操作同时对多个系统生效,并基于此实现了整个流程的信用背书,保证运维版本的一致性,同时对历史更新可追溯易还原。通过该项技术实现了系统不停机维护,系统只需要拉取最新的字节码并替换其运行容器内的字节码文件,利用代码热加载器加载到运行环境即可完成维护升级过程。基于区块链平台的特点,结合消息队列以及代码文件热加载技术实现多个系统的统一运维管理,利用智能合约和区块链共识机制对运维过程进行信用背书,最终实现基于区块链的统一运维方案。The blockchain-based operation and maintenance method in the above-mentioned optional embodiment realizes unified operation and maintenance management of multiple systems, and physical isolation of multiple systems. It is effective for multiple systems, and based on this, the credit endorsement of the entire process is realized to ensure the consistency of operation and maintenance versions, and at the same time, historical updates can be traced back and easily restored. Through this technology, the system can be maintained without downtime. The system only needs to pull the latest bytecode and replace the bytecode file in its running container, and use the code hot loader to load it into the running environment to complete the maintenance and upgrade process. Based on the characteristics of the blockchain platform, combined with message queue and code file hot loading technology to achieve unified operation and maintenance management of multiple systems, use smart contracts and blockchain consensus mechanism to endorse the operation and maintenance process, and finally realize the blockchain-based unified operation and maintenance plan.
需要说明的是,上述可选实施例主要是针对外部应用系统的运维,但是本申请所提供的方法并不限于上述可选实施例中的外部应用系统运维场景中,例如,代码热加载器可以反向指向区块链节点,从而实现区块链节点的进行自更新。在区块链节点的分布式网络中,由于企业机构相互之间隔离,在互相协作的过程中,不断地有新的接入方,新的业务接入,因此本方案也可以提供给区块链节点应对新业务需求的自更新。此外,本申请所提供的方 法也可以与其他有运维需求的系统相结合,在不脱离本申请构思的前提下做出的方案变形和改进,都属于本申请的保护范围。It should be noted that the above optional embodiments are mainly aimed at the operation and maintenance of external application systems, but the method provided in this application is not limited to the operation and maintenance scenarios of external application systems in the above optional embodiments, for example, code hot loading The controller can point to the blockchain node in the reverse direction, so as to realize the self-update of the blockchain node. In the distributed network of blockchain nodes, since enterprises and institutions are isolated from each other, in the process of mutual cooperation, there are constantly new access parties and new business accesses, so this solution can also be provided to the blockchain Chain nodes respond to self-update of new business requirements. In addition, the method provided by this application can also be combined with other systems with operation and maintenance requirements, and the modification and improvement of the scheme made under the premise of not departing from the concept of this application all belong to the protection scope of this application.
应该理解的是,虽然图2至图6中的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2至图6中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the steps in the flowcharts in FIGS. 2 to 6 are sequentially displayed in accordance with the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, the execution of these steps is not strictly limited to the order, and these steps may be performed in other orders. Moreover, at least a part of the steps in FIG. 2 to FIG. 6 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed and completed at the same time, but may be executed at different times. These sub-steps or stages may be executed at different times. The order of execution of the stages is also not necessarily sequential, but may be performed alternately or alternately with other steps or sub-steps of other steps or at least a portion of a stage.
在一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,图7是根据本申请实施例中基于区块链的运维计算机设备的结构示意图,如图7所示,其内部结构图可以如图7所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种基于区块链的运维方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。In one embodiment, a computer device is provided, and the computer device can be a terminal. FIG. 7 is a schematic structural diagram of a blockchain-based operation and maintenance computer device according to an embodiment of the present application. As shown in FIG. 7 , its internal The structure diagram can be shown in Figure 7. The computer equipment includes a processor, memory, a network interface, a display screen, and an input device connected by a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium, an internal memory. The nonvolatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the execution of the operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement a blockchain-based operation and maintenance method. The display screen of the computer equipment may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment may be a touch layer covered on the display screen, or a button, a trackball or a touchpad set on the shell of the computer equipment , or an external keyboard, trackpad, or mouse.
本领域技术人员可以理解,图7中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in FIG. 7 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied. Include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
在一个实施例中,提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行计算机程序时实现上述基于区块链的运维方法。In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor implements the above blockchain-based operation and maintenance method when the computer program is executed .
上述基于区块链的运维计算机设备,根据运维请求更新区块链上的链上配置文件,并推送运维消息至区块链上各个节点的消息队列,其中,链上配置文件与运维请求对应,运维消息与所述运维请求对应;在运维消息被成功推送至消息队列的情况下,将推送操作以交易形式记录在所述区块链上;从消息队列中获取运维消息,并根据运维消息在节点上执行与运维消息对应的运维操作,通过区块链节点间共识,实现了一次运维操作同时对多个系统生效,并实现了整个流程的信用背书,保证运维版本的一致性和安全性。The above-mentioned blockchain-based operation and maintenance computer equipment updates the on-chain configuration file on the blockchain according to the operation and maintenance request, and pushes the operation and maintenance message to the message queue of each node on the blockchain. corresponding to the maintenance request, and the operation and maintenance message corresponds to the operation and maintenance request; when the operation and maintenance message is successfully pushed to the message queue, the push operation is recorded on the blockchain in the form of a transaction; the operation and maintenance message is obtained from the message queue. maintenance message, and execute the operation and maintenance operation corresponding to the operation and maintenance message on the node according to the operation and maintenance message. Through the consensus among the blockchain nodes, one operation and maintenance operation can take effect on multiple systems at the same time, and the credit of the whole process is realized. Endorsement to ensure the consistency and security of the operation and maintenance version.
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述基于区块链的运维方法。In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the foregoing blockchain-based operation and maintenance method is implemented.
上述基于区块链的运维计算机可读存储介质,根据运维请求更新区块链上的链上配置文件,并推送运维消息至区块链上各个节点的消息队列,其中,链上配置文件与运维请求对应,运维消息与所述运维请求对应;在运维消息被成功推送至消息队列的情况下,将推送操作以交易形式记录在所述区块链上;从消息队列中获取运维消息,并根据所述运维消息在所述节点上执行与所述运维消息对应的运维操作,通过区块链节点间共识,实现了一次运维操作同时对多个系统生效,并实现了整个流程的信用背书,保证运维版本的一致性和安全性。The above-mentioned blockchain-based operation and maintenance computer-readable storage medium updates the on-chain configuration file on the blockchain according to the operation and maintenance request, and pushes the operation and maintenance message to the message queue of each node on the blockchain, wherein the on-chain configuration The file corresponds to the operation and maintenance request, and the operation and maintenance message corresponds to the operation and maintenance request; if the operation and maintenance message is successfully pushed to the message queue, the push operation is recorded on the blockchain in the form of a transaction; Obtain the operation and maintenance message from the blockchain, and execute the operation and maintenance operation corresponding to the operation and maintenance message on the node according to the operation and maintenance message. It takes effect and realizes the credit endorsement of the whole process to ensure the consistency and security of the operation and maintenance version.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage In the medium, when the computer program is executed, it may include the processes of the above-mentioned method embodiments. Wherein, any reference to memory, storage, database or other medium used in the various embodiments provided in this application may include non-volatile and/or volatile memory. Nonvolatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Road (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined arbitrarily. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features It is considered to be the range described in this specification.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only represent several embodiments of the present application, and the descriptions thereof are specific and detailed, but should not be construed as a limitation on the scope of the invention patent. It should be pointed out that for those skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the scope of protection of the patent of the present application shall be subject to the appended claims.

Claims (13)

  1. 一种基于区块链的运维方法,其特征在于,所述方法包括:A blockchain-based operation and maintenance method, characterized in that the method includes:
    根据运维请求更新区块链上的链上配置文件,并推送运维消息至所述区块链上各个节点的消息队列,其中,所述链上配置文件与所述运维请求对应,所述运维消息与所述运维请求对应;Update the on-chain configuration file on the blockchain according to the operation and maintenance request, and push the operation and maintenance message to the message queue of each node on the blockchain, wherein the on-chain configuration file corresponds to the operation and maintenance request, so The operation and maintenance message corresponds to the operation and maintenance request;
    在所述运维消息被成功推送至所述消息队列的情况下,将所述推送运维消息至所述区块链上各个节点的消息队列以交易形式记录在所述区块链上;In the case that the operation and maintenance message is successfully pushed to the message queue, record the push operation and maintenance message to the message queue of each node on the blockchain in the form of a transaction on the blockchain;
    从所述消息队列中获取所述运维消息,并根据所述运维消息在所述节点上执行与所述运维消息对应的运维操作。The operation and maintenance message is acquired from the message queue, and an operation and maintenance operation corresponding to the operation and maintenance message is performed on the node according to the operation and maintenance message.
  2. 根据权利要求1所述的方法,其中,所述方法还包括:The method of claim 1, wherein the method further comprises:
    根据所述运维请求更新所述区块链上的链上配置文件以及运维记录,推送所述运维消息至所述区块链上各个节点的消息队列,其中,所述运维消息包括所述运维记录;Update the on-chain configuration file and the operation and maintenance record on the blockchain according to the operation and maintenance request, and push the operation and maintenance message to the message queue of each node on the blockchain, wherein the operation and maintenance message includes the operation and maintenance records;
    从所述消息队列中获取所述运维消息,并根据所述运维消息中的所述运维记录在所述节点上执行与所述运维消息对应的运维操作。The operation and maintenance message is acquired from the message queue, and an operation and maintenance operation corresponding to the operation and maintenance message is performed on the node according to the operation and maintenance record in the operation and maintenance message.
  3. 根据权利要求2所述的方法,其中,所述运维记录包括标识符、系统类型和运维策略。The method of claim 2, wherein the operation and maintenance record includes an identifier, a system type, and an operation and maintenance policy.
  4. 根据权利要求1所述的方法,其中,在所述运维请求为版本更新的情况下,所述方法还包括:The method according to claim 1, wherein, when the operation and maintenance request is a version update, the method further comprises:
    根据所述运维请求更新所述区块链上的链上配置文件,并上传字节码文件至所述区块链上,推送所述运维消息至所述区块链各个上节点的消息队列,其中,所述字节码文件与所述运维请求对应;Update the on-chain configuration file on the blockchain according to the operation and maintenance request, upload the bytecode file to the blockchain, and push the operation and maintenance message to the messages of each node on the blockchain a queue, wherein the bytecode file corresponds to the operation and maintenance request;
    在所述运维消息被成功推送至所述消息队列的情况下,将所述推送所述运维消息至所述区块链上各个节点的消息队列以交易形式记录在所述区块链上;In the case that the operation and maintenance message is successfully pushed to the message queue, record the message queue that pushes the operation and maintenance message to each node on the blockchain in the form of a transaction on the blockchain ;
    从所述消息队列中获取所述运维消息,根据所述运维消息从所述区块链上获取所述字节码文件,并将所述字节码文件更新至所述节点。Obtain the operation and maintenance message from the message queue, obtain the bytecode file from the blockchain according to the operation and maintenance message, and update the bytecode file to the node.
  5. 根据权利要求4所述的方法,其中,在所述运维请求为版本回退的情况下,所述方法还包括:The method according to claim 4, wherein, when the operation and maintenance request is a version rollback, the method further comprises:
    获取所述运维请求的回退版本号,推送所述运维消息至所述区块链上各个节点的消息队列,其中,所述区块链中存储了与所述字节码文件的对应的版本号;Obtain the rollback version number of the operation and maintenance request, and push the operation and maintenance message to the message queue of each node on the blockchain, where the corresponding bytecode file is stored in the blockchain version number;
    从所述消息队列中获取所述运维消息,根据所述运维消息从所述区块链上获取与所述 回退版本对应的回退版字节码文件,并将所述回退版字节码文件更新至与所述消息队列对应的所述节点。Obtain the operation and maintenance message from the message queue, obtain the fallback version bytecode file corresponding to the rollback version from the blockchain according to the operation and maintenance message, and store the fallback version A bytecode file is updated to the node corresponding to the message queue.
  6. 根据权利要求4所述的方法,其中,所述方法还包括:The method of claim 4, wherein the method further comprises:
    在预设的回退进程被触发的情况下,根据所述回退进程获取回退版本号,从所述区块链上获取与所述回退版本对应的回退版字节码文件,并将所述回退版字节码文件更新至与所述消息队列对应的所述节点。When the preset rollback process is triggered, the rollback version number is obtained according to the rollback process, the rollback version bytecode file corresponding to the rollback version is obtained from the blockchain, and The fallback version bytecode file is updated to the node corresponding to the message queue.
  7. 根据权利要求4所述的方法,其中,将所述字节码文件更新至与所述消息队列对应的所述节点之后,所述方法还包括:The method according to claim 4, wherein after updating the bytecode file to the node corresponding to the message queue, the method further comprises:
    通过热加载器完成所述字节码文件的加载。The loading of the bytecode file is completed by a hot loader.
  8. 根据权利要求1所述的方法,其中,所述推送运维消息至所述区块链上各个节点的消息队列包括:The method according to claim 1, wherein the pushing the operation and maintenance message to the message queue of each node on the blockchain comprises:
    通过预言机推送所述运维消息至所述消息队列;Push the operation and maintenance message to the message queue through the oracle;
    在所述运维消息推送失败的情况下,通过所述预言机补发所述运维消息,直至所述运维消息推送成功。In the case that the operation and maintenance message fails to be pushed, the operation and maintenance message is reissued through the oracle machine until the operation and maintenance message is pushed successfully.
  9. 根据权利要求1所述的方法,其中,所述根据运维请求更新区块链上的链上配置文件,并推送运维消息至所述区块链上各个节点的消息队列包括:The method according to claim 1, wherein the updating the on-chain configuration file on the blockchain according to the operation and maintenance request, and pushing the operation and maintenance message to the message queue of each node on the blockchain comprises:
    根据所述运维请求更新所述区块链上的链上配置文件,并根据所述链上配置文件确定与所述运维请求对应的执行节点;Update the on-chain configuration file on the blockchain according to the operation and maintenance request, and determine the execution node corresponding to the operation and maintenance request according to the on-chain configuration file;
    推送所述运维消息至所述执行节点的消息队列。Push the operation and maintenance message to the message queue of the execution node.
  10. 一种基于区块链的运维系统,其特征在于,所述系统包括运维系统接入方和区块链平台,所述运维系统接入方以节点的方式接入所述区块链平台并在所述区块链平台上部署有智能合约,所述运维系统接入方有各自的消息队列:A blockchain-based operation and maintenance system, characterized in that the system includes an operation and maintenance system access party and a blockchain platform, and the operation and maintenance system access party accesses the blockchain in the form of a node platform and deploy smart contracts on the blockchain platform, and the operation and maintenance system access parties have their own message queues:
    所述智能合约用于根据所述运维系统接入方的运维请求更新区块链上的链上配置文件,并推送运维消息至所述区块链上各个节点的消息队列,在所述运维消息被成功推送至所述消息队列的情况下,将所述推送运维消息至所述区块链上各个节点的消息队列以交易形式记录在所述区块链上,其中,所述链上配置文件与所述运维请求对应,所述运维消息与所述运维请求对应;The smart contract is used to update the on-chain configuration file on the blockchain according to the operation and maintenance request of the access party of the operation and maintenance system, and push the operation and maintenance message to the message queue of each node on the blockchain, where In the case that the operation and maintenance message is successfully pushed to the message queue, the operation and maintenance message pushed to the message queue of each node on the blockchain is recorded on the blockchain in the form of a transaction, wherein the The on-chain configuration file corresponds to the operation and maintenance request, and the operation and maintenance message corresponds to the operation and maintenance request;
    所述运维系统接入方从所述消息队列中获取所述运维消息,并根据所述运维消息在所述节点上执行与所述运维消息对应的运维操作。The operation and maintenance system access party obtains the operation and maintenance message from the message queue, and performs the operation and maintenance operation corresponding to the operation and maintenance message on the node according to the operation and maintenance message.
  11. 根据权利要求10所述的系统,其中,所述智能合约包括数据处理模块和消息推送模块:The system according to claim 10, wherein the smart contract comprises a data processing module and a message push module:
    所述数据处理模块用于根据所述运维系统接入方的运维请求更新区块链上的字节码文件以及运维记录;The data processing module is configured to update the bytecode file and the operation and maintenance record on the blockchain according to the operation and maintenance request of the operation and maintenance system access party;
    所述消息推送模块用于推送所述运维消息至所述消息队列,其中,所述运维消息包括所述运维记录。The message push module is configured to push the operation and maintenance message to the message queue, wherein the operation and maintenance message includes the operation and maintenance record.
  12. 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至9中任一项所述方法的步骤。A computer device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, when the processor executes the computer program, any one of claims 1 to 9 is implemented the steps of the method.
  13. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至9中任一项所述的方法的步骤。A computer-readable storage medium on which a computer program is stored, characterized in that, when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
PCT/CN2021/078571 2020-10-15 2021-03-02 Blockchain-based operation and maintenance method and system, computer device and storage medium WO2022077846A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011101503.XA CN111930443B (en) 2020-10-15 2020-10-15 Operation and maintenance method, system, computer equipment and storage medium based on block chain
CN202011101503.X 2020-10-15

Publications (1)

Publication Number Publication Date
WO2022077846A1 true WO2022077846A1 (en) 2022-04-21

Family

ID=73334452

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/078571 WO2022077846A1 (en) 2020-10-15 2021-03-02 Blockchain-based operation and maintenance method and system, computer device and storage medium

Country Status (2)

Country Link
CN (1) CN111930443B (en)
WO (1) WO2022077846A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116402496A (en) * 2023-06-08 2023-07-07 山东诚卓信息技术有限公司 Visual maintenance and control method and system for IT (information technology) assets
CN117270936A (en) * 2023-10-10 2023-12-22 武汉碧涯科技有限公司 Cloud platform operation and maintenance method and system

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111930443B (en) * 2020-10-15 2020-12-18 杭州云链趣链数字科技有限公司 Operation and maintenance method, system, computer equipment and storage medium based on block chain
CN112733182A (en) * 2020-12-22 2021-04-30 航天信息股份有限公司 Method and system for accessing intranet private data by block chain node point
CN112632192A (en) * 2020-12-31 2021-04-09 杭州趣链科技有限公司 Node maintenance method and device, computer equipment and medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109542865A (en) * 2018-12-03 2019-03-29 郑州云海信息技术有限公司 Distributed cluster system configuration file synchronous method, device, system and medium
US20190354614A1 (en) * 2018-05-15 2019-11-21 International Business Machines Corporation Configuration drift prevention across multiple systems using blockchain
CN110659430A (en) * 2019-08-23 2020-01-07 上海共链信息科技有限公司 Block chain browsing method supporting multi-block chain network
CN111488616A (en) * 2020-04-08 2020-08-04 北京瑞策科技有限公司 Method and device for realizing preplan machine of service data block chain
CN111726304A (en) * 2020-06-19 2020-09-29 中国工商银行股份有限公司 Information processing method, information processing apparatus, computer system, and medium
CN111930443A (en) * 2020-10-15 2020-11-13 杭州云链趣链数字科技有限公司 Operation and maintenance method, system, computer equipment and storage medium based on block chain

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109450664B (en) * 2018-10-09 2022-07-12 北京医拍智能科技有限公司 Data cooperative processing method and device based on block chain P2P network
CN110175032B (en) * 2019-01-17 2023-01-06 杭州趣链科技有限公司 High-availability block chain open platform and application release method
CN110609755A (en) * 2019-08-02 2019-12-24 平安科技(深圳)有限公司 Message processing method, device, equipment and medium for cross-block chain node
CN110659142A (en) * 2019-08-02 2020-01-07 平安科技(深圳)有限公司 Message queue processing method and device, electronic equipment and storage medium
CN110708371A (en) * 2019-09-27 2020-01-17 支付宝(杭州)信息技术有限公司 Data processing method, device and system based on block chain and electronic equipment
CN111461879A (en) * 2020-03-11 2020-07-28 中关村科技软件股份有限公司 Block chain-based government affair service processing system and method
CN111770130B (en) * 2020-05-08 2022-08-05 贵阳信息技术研究院(中科院软件所贵阳分部) Method for efficient collaborative multiplexing of software and hardware resources in block chain distributed networking

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190354614A1 (en) * 2018-05-15 2019-11-21 International Business Machines Corporation Configuration drift prevention across multiple systems using blockchain
CN109542865A (en) * 2018-12-03 2019-03-29 郑州云海信息技术有限公司 Distributed cluster system configuration file synchronous method, device, system and medium
CN110659430A (en) * 2019-08-23 2020-01-07 上海共链信息科技有限公司 Block chain browsing method supporting multi-block chain network
CN111488616A (en) * 2020-04-08 2020-08-04 北京瑞策科技有限公司 Method and device for realizing preplan machine of service data block chain
CN111726304A (en) * 2020-06-19 2020-09-29 中国工商银行股份有限公司 Information processing method, information processing apparatus, computer system, and medium
CN111930443A (en) * 2020-10-15 2020-11-13 杭州云链趣链数字科技有限公司 Operation and maintenance method, system, computer equipment and storage medium based on block chain

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116402496A (en) * 2023-06-08 2023-07-07 山东诚卓信息技术有限公司 Visual maintenance and control method and system for IT (information technology) assets
CN116402496B (en) * 2023-06-08 2023-08-22 山东诚卓信息技术有限公司 Visual maintenance and control method and system for IT (information technology) assets
CN117270936A (en) * 2023-10-10 2023-12-22 武汉碧涯科技有限公司 Cloud platform operation and maintenance method and system
CN117270936B (en) * 2023-10-10 2024-03-19 武汉碧涯科技有限公司 Cloud platform operation and maintenance method and system

Also Published As

Publication number Publication date
CN111930443A (en) 2020-11-13
CN111930443B (en) 2020-12-18

Similar Documents

Publication Publication Date Title
WO2022077846A1 (en) Blockchain-based operation and maintenance method and system, computer device and storage medium
US10764142B2 (en) Clustered application management with a blockchain
US10687210B2 (en) Switching mobile service provider using blockchain
US11323530B2 (en) Proxy agents and proxy ledgers on a blockchain
US10754989B2 (en) Runtime self-correction for blockchain ledgers
US11018852B2 (en) Blockchain trust anchor
US20200252202A1 (en) Cross-chain validation
US11769156B2 (en) Automated data projection for smart contract groups on a blockchain
US20200052884A1 (en) Parallel transaction validation and block generation in a blockchain
US20190372772A1 (en) Blockchain implementing delta storage
US10997150B2 (en) Configuration drift prevention across multiple systems using blockchain
JP7228322B2 (en) Auto-commit transaction management in blockchain networks
US20220382746A1 (en) Blockchain notification board storing blockchain resources
US10922097B2 (en) Collaborative model execution
US20190288995A1 (en) Autonomous secrets management for a managed service identity
WO2019028992A1 (en) Multi-module version dependency relationship construction method, device, server and storage medium
US10691790B2 (en) Autonomous secrets management for a temporary shared access signature service
US11689616B2 (en) Optimization of delivery of blocks
US10965457B2 (en) Autonomous cross-scope secrets management
US20190286812A1 (en) Autonomous secrets renewal and distribution
WO2020207194A1 (en) Blockchain-based iot device changing method and apparatus
US20200021602A1 (en) Trace-based transaction validation and commitment
US20210297242A1 (en) Method, device, and apparatus for processing distributed data, and medium
US20200374340A1 (en) Optimization of delivery of blocks
US11044104B2 (en) Data certification as a service powered by permissioned blockchain network

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21878903

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21878903

Country of ref document: EP

Kind code of ref document: A1