TW202320528A - Service processing method and device based on alliance chain system - Google Patents

Service processing method and device based on alliance chain system Download PDF

Info

Publication number
TW202320528A
TW202320528A TW111135464A TW111135464A TW202320528A TW 202320528 A TW202320528 A TW 202320528A TW 111135464 A TW111135464 A TW 111135464A TW 111135464 A TW111135464 A TW 111135464A TW 202320528 A TW202320528 A TW 202320528A
Authority
TW
Taiwan
Prior art keywords
node
business
function
transaction
chain system
Prior art date
Application number
TW111135464A
Other languages
Chinese (zh)
Other versions
TWI808890B (en
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 TW202320528A publication Critical patent/TW202320528A/en
Application granted granted Critical
Publication of TWI808890B publication Critical patent/TWI808890B/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3006Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine
    • G06F11/324Display of status information
    • G06F11/327Alarm or error message display
    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Abstract

The embodiment of the invention provides a service processing method and device based on an alliance chain system. The alliance chain system comprises a plurality of nodes, wherein each node is provided with a service system, each service system provides a plurality of service functions, each service function is provided through a set number of nodes, and each node communicates based on a consensus mechanism. The method comprises the steps of when a first node determines that a service function to be executed in a transaction is a first transaction function which can be provided by the first node, processing the transaction based on the first transaction function to obtain a processing result, and enabling the processing result to be consensus to each node; and when the second node determines that the service function to be executed in the transaction is a second transaction function which can be provided by the second node based on the processing result, processing the transaction based on the second transaction function to obtain a processing result, and enabling the processing result to be consensus to each node until the processing result of the last transaction function in the transaction is consensus to each node. The method is used for reducing the working pressure of the functional module and improving the service processing efficiency.

Description

一種基於聯盟鏈系統的業務處理方法及裝置A business processing method and device based on alliance chain system

本發明屬於網路技術領域,尤其關於一種基於聯盟鏈系統的業務處理方法及裝置。The invention belongs to the field of network technology, and in particular relates to a business processing method and device based on an alliance chain system.

區塊鏈技術具有天然的去中心化特徵,通過共識演算法能夠實現各網路節點間的互通互信。區塊鏈中的聯盟鏈是由若干節點合作維護的一條區塊鏈,外界的節點想要加入聯盟需要獲得聯盟鏈中節點的許可。在具有大量節點的網路中,節點之間是不信任的,網路連接也變得不可預測,共識協定變得愈發重要。容錯協定能夠給網路提供強大的安全性,保證了網路的活躍度。Blockchain technology has the natural characteristics of decentralization, and the mutual communication and mutual trust between network nodes can be realized through the consensus algorithm. The consortium chain in the blockchain is a blockchain maintained by several nodes. External nodes who want to join the consortium need to obtain the permission of the nodes in the consortium chain. In a network with a large number of nodes, where there is no trust between nodes and network connections become unpredictable, consensus protocols become increasingly important. The fault-tolerant protocol can provide strong security for the network and ensure the liveliness of the network.

目前,現有技術的聯盟鏈中運行的業務系統中各功能模組互相通信完成業務處理,最終通過共識演算法共識業務處理結果,保證業務處理結果的一致性和準確性。但該種方式,需要功能模組間通信協作完成業務處理,增加功能模組工作壓力,降低業務處理效率。At present, each functional module in the business system running in the consortium chain of the existing technology communicates with each other to complete the business processing, and finally uses the consensus algorithm to consensus the business processing results to ensure the consistency and accuracy of the business processing results. However, this method requires communication and cooperation between functional modules to complete business processing, which increases the working pressure of functional modules and reduces business processing efficiency.

因此,現在亟需一種基於聯盟鏈系統的業務處理方法及裝置,用於降低功能模組工作壓力,提高業務處理效率。Therefore, there is an urgent need for a business processing method and device based on an alliance chain system to reduce the working pressure of functional modules and improve business processing efficiency.

本發明實施例提供一種基於聯盟鏈系統的業務處理方法及裝置,用於降低功能模組工作壓力,提高業務處理效率。Embodiments of the present invention provide a business processing method and device based on an alliance chain system, which are used to reduce the working pressure of functional modules and improve business processing efficiency.

第一方面,本發明實施例提供一種基於聯盟鏈系統的業務處理方法,該聯盟鏈系統中包含多個節點,任一節點上均設置有業務系統,該業務系統提供多個業務功能,每個業務功能分別通過設定數量的節點提供,各節點基於共識機制通信,該方法包括: 針對任一交易,該聯盟鏈系統中的第一節點在確定該交易待執行的業務功能為自身可提供的第一業務功能時,基於該第一業務功能處理該交易,得到第一處理結果,並基於共識機制將該第一處理結果共識到該聯盟鏈系統中的各節點; 該聯盟鏈系統中的第二節點基於該第一處理結果,確定該交易待執行的業務功能為自身可提供的第二業務功能時,基於該第二業務功能處理該交易,得到第二處理結果,並基於共識機制將該第二處理結果共識到該聯盟鏈系統中的各節點,直至該交易中的最後一個業務功能的處理結果共識到該聯盟鏈系統中的各節點。 In the first aspect, the embodiment of the present invention provides a business processing method based on the consortium chain system. The consortium chain system includes multiple nodes, and any node is equipped with a business system that provides multiple business functions. Each Business functions are provided by a set number of nodes, and each node communicates based on a consensus mechanism. The method includes: For any transaction, when the first node in the consortium chain system determines that the business function to be executed by the transaction is the first business function it can provide, it processes the transaction based on the first business function and obtains the first processing result, And based on the consensus mechanism, the first processing result is consensused to each node in the alliance chain system; When the second node in the consortium chain system determines that the business function to be executed by the transaction is the second business function it can provide based on the first processing result, it processes the transaction based on the second business function and obtains the second processing result , and consensus the second processing result to each node in the consortium chain system based on the consensus mechanism, until the processing result of the last business function in the transaction is consensus to each node in the consortium chain system.

上述方法中,在聯盟鏈的各節點中設置業務系統,並針對業務系統中的每個業務功能設置對應的預設數量的節點提供該業務功能,各節點接收交易後,使得各節點通過共識機制即時通信,根據業務功能中的交易功能對交易進行處理,共識處理結果,使得提供下一順序交易功能的節點基於該處理結果,進行下一順序業務功能的處理。相比於現有技術中通過業務功能模組之間互相通信,可以大大降低通信耗時和業務功能模組的資源佔用。In the above method, a business system is set up in each node of the consortium chain, and a preset number of nodes corresponding to each business function in the business system are set to provide the business function. After each node receives the transaction, each node passes the consensus mechanism In instant messaging, the transaction is processed according to the transaction function in the business function, and the processing result is agreed, so that the node providing the next transaction function can process the next business function based on the processing result. Compared with the prior art of communicating with each other through the business function modules, the communication time consumption and the resource occupation of the business function modules can be greatly reduced.

可選的,該聯盟鏈系統中各節點可提供的業務功能通過如下方式確定,包括: 針對待分配的業務功能中優先順序最高的業務功能,該聯盟鏈系統基於共識機制確定各節點的節點資源資訊中資源空閒最多的第三節點,並設置該第三節點用於提供該待分配的業務功能中優先順序最高的業務功能,直至該待分配的業務功能均分配完畢。 Optionally, the business functions that can be provided by each node in the consortium chain system are determined by the following methods, including: For the business function with the highest priority among the business functions to be allocated, the alliance chain system determines the third node with the most free resources in the node resource information of each node based on the consensus mechanism, and sets the third node to provide the to-be-allocated The business function with the highest priority among the business functions, until the business functions to be allocated are all allocated.

上述方法中,在各節點中安裝聯盟鏈的業務系統後,各節點根據自身節點資源資訊爭奪業務功能和/或交易功能,按照節點資源資訊中資源空閒最多的節點提供優先順序最高的業務功能和/或交易功能。如此,可以保證優先順序高(重要性或資源需求多)的業務功能可以有充足的資源,盡最大可能保證聯盟鏈的業務處理系統的正常運行。In the above method, after the business system of the consortium chain is installed in each node, each node competes for business functions and/or transaction functions according to its own node resource information, and provides the highest priority business function and/or transaction function according to the node with the most idle resources in the node resource information. /or transaction functions. In this way, it can be ensured that business functions with high priority (high importance or resource demand) can have sufficient resources, and the normal operation of the business processing system of the alliance chain can be guaranteed as much as possible.

可選的,該聯盟鏈系統基於共識機制確定各節點的節點資源資訊中資源空閒最多的第三節點,包括: 針對任一節點,該聯盟鏈系統根據該節點中各項資源的權重、各項資源的資源使用情況及各項資源的性能資訊,確定該節點的資源空閒狀況; 該聯盟鏈系統基於共識機制中將資源空閒狀況中資源空閒最多的節點,確定為第三節點。 Optionally, the alliance chain system determines the third node with the most idle resources in the node resource information of each node based on the consensus mechanism, including: For any node, the alliance chain system determines the resource idle status of the node according to the weight of each resource in the node, the resource usage of each resource and the performance information of each resource; The alliance chain system determines the node with the most idle resources in the resource idle state as the third node based on the consensus mechanism.

上述方法中,共識機制中共識的各節點的資源空閒情況,包括:節點中各項資源對應的權重、各項資源的資源使用情況、各項資源的性能資訊和節點提供業務功能的資源佔用情況等各資源項的相關資料。便於根據節點的資源空閒情況確定節點可使用的資源,進而獲取資源空閒最多的節點,均衡業務功能的節點資源。In the above method, the resource idleness of each node in the consensus mechanism includes: the weight corresponding to each resource in the node, the resource usage of each resource, the performance information of each resource, and the resource occupation of the node providing business functions and other relevant information on resource items. It is convenient to determine the available resources of the node according to the resource idleness of the node, and then obtain the node with the most idle resources, and balance the node resources of the business function.

可選的,該多個業務功能中包含監控功能,該方法還包括: 該聯盟鏈系統中的第四節點基於自身可提供的監控功能,監控該各節點;若確定存在異常的節點,則產生告警。 Optionally, the multiple business functions include a monitoring function, and the method also includes: The fourth node in the consortium chain system monitors each node based on the monitoring function it can provide; if it is determined that there is an abnormal node, an alarm is generated.

上述方法中,對節點進行監控,若節點異常,則產生告警。提高運維效率,保證業務處理正常進行。In the above method, the nodes are monitored, and if the node is abnormal, an alarm is generated. Improve operation and maintenance efficiency and ensure normal business processing.

可選的,確定存在異常的節點之後,還包括: 該聯盟鏈系統中的第四節點將存在異常的節點進行隔離; 該聯盟鏈系統中的第四節點確定該聯盟鏈中具有該異常的節點所提供的業務功能的節點數量是否滿足設定要求; 該聯盟鏈系統中的第四節點若確定不滿足該設定要求時,在該聯盟鏈系統中觸發資源替代請求; 該聯盟鏈系統基於共識機制從該各節點中確定出用於替代該第四節點的第五節點。 Optionally, after determining the abnormal node, it also includes: The fourth node in the consortium chain system isolates abnormal nodes; The fourth node in the consortium chain system determines whether the number of nodes in the consortium chain that have the business functions provided by the abnormal node meets the set requirements; If the fourth node in the consortium chain system determines that the set requirements are not met, a resource replacement request is triggered in the consortium chain system; The consortium chain system determines a fifth node to replace the fourth node from the nodes based on a consensus mechanism.

上述方法中,聯盟鏈基於各節點的共識機制,設置業務功能對應設定數量的節點,基於該設定數量的節點提供業務功能,使得業務功能的設定數量節點中的節點故障後,其它節點動態爭搶接替該故障節點提供的業務功能,能保證業務功能始終基於該設定數量的節點提供。相比於現有技術中,為了保證業務系統在聯盟鏈中正常運行,工作人員預先為業務系統中的各功能模組分別設置對應的節點,使得每個功能模組有足夠的節點提供。若出現節點故障,該故障節點提供的功能很有可能受到影響,嚴重時影響業務系統運行。本發明可以在節點發生故障時,根據節點資源資訊,使得資源最充裕的節點立即接替該故障節點的業務功能,保證在故障節點修復時,該故障節點的業務功能擁有足夠的資源,進一步保證業務系統穩定性。也因此,相比於現有技術中人工確定故障節點並修復後,將修復後的節點或新的節點配置為提供該功能的週期長,影響業務系統運行來說,本發明動態調整業務功能節點資源的方式,使得業務系統對故障節點無感,提高業務處理的準確性。In the above method, based on the consensus mechanism of each node, the alliance chain sets the business function corresponding to the set number of nodes, based on the set number of nodes to provide business functions, so that after the node failure of the set number of business function nodes, other nodes will dynamically compete Replacing the service function provided by the failed node can ensure that the service function is always provided based on the set number of nodes. Compared with the existing technology, in order to ensure the normal operation of the business system in the alliance chain, the staff set up corresponding nodes for each functional module in the business system in advance, so that each functional module has enough nodes to provide. If a node fails, the functions provided by the failed node are likely to be affected, and in severe cases, the operation of the business system will be affected. The present invention can make the node with the most abundant resources immediately take over the business function of the faulty node according to the node resource information when a fault occurs, so as to ensure that the business function of the faulty node has sufficient resources when the faulty node is repaired, further ensuring business System stability. Therefore, compared to the prior art where faulty nodes are manually determined and repaired, the repaired nodes or new nodes are configured to provide the function for a long period, which affects the operation of the business system, the present invention dynamically adjusts the business function node resources This method makes the business system insensitive to faulty nodes and improves the accuracy of business processing.

可選的,具有監控功能的節點在該聯盟鏈系統中發送的第一指令與具有交易功能的節點在該聯盟鏈系統中發送的第二指令的優先順序不同,該第一指令的優先順序高於該第二指令的優先順序。Optionally, the priority order of the first instruction sent by the node with the monitoring function in the consortium chain system is different from that of the second instruction sent by the node with the transaction function in the consortium chain system, and the priority order of the first instruction is high on the priority order of the second instruction.

上述方法中,具有監控功能的節點在聯盟鏈系統中發送的第一指令優先順序高於具有交易功能的節點在聯盟鏈系統中發送的第二指令的優先順序。如此,若具有監控功能的節點確定具有交易功能的節點出現故障,則可以使得具有交易功能的節點在接收到第一指令時,優先執行第一指令,防止故障節點仍然執行第二指令執行交易處理導致的交易處理異常,保證交易處理的準確性。In the above method, the priority of the first instruction sent by the node with the monitoring function in the consortium chain system is higher than the priority of the second instruction sent by the node with the transaction function in the consortium chain system. In this way, if the node with the monitoring function determines that the node with the transaction function has failed, it can make the node with the transaction function preferentially execute the first instruction when receiving the first instruction, preventing the faulty node from still executing the second instruction to perform transaction processing The resulting abnormal transaction processing ensures the accuracy of transaction processing.

第二方面,本發明實施例提供一種基於聯盟鏈系統,該聯盟鏈系統中包含多個節點,任一節點上均設置有業務系統,該業務系統提供多個業務功能,每個業務功能分別通過設定數量的節點提供,各節點基於共識機制通信;其中,該聯盟鏈系統中具有交易功能的節點,用於在確定交易待執行的業務功能為自身可提供的交易功能時,處理該交易,得到處理結果,並基於共識機制將該處理結果共識到該聯盟鏈中的各節點;直至該交易中的最後一個交易功能的處理結果共識到該聯盟鏈中的各節點。In the second aspect, the embodiment of the present invention provides a consortium chain-based system. The consortium chain system includes multiple nodes, and any node is equipped with a business system. The business system provides multiple business functions, and each business function is passed through Provided by a set number of nodes, each node communicates based on a consensus mechanism; among them, nodes with transaction functions in the consortium chain system are used to process the transaction when it is determined that the business function to be executed by itself is a transaction function that can be provided by itself, and get Process the result, and consensus the processing result to each node in the alliance chain based on the consensus mechanism; until the processing result of the last transaction function in the transaction is consensus to each node in the alliance chain.

上述系統,設置為聯盟鏈系統中具有交易功能的節點,在確定交易待執行的業務功能為自身可提供的交易功能時,處理該交易,得到處理結果,並基於共識機制將該處理結果共識到聯盟鏈中的各節點。如此,相比於現有技術中聯盟鏈系統基於系統中各功能模組之間直接通信來說,本發明可以通過共識機制共識功能模組和節點之間的資訊,提高了資訊傳送速率,節省了功能模組通信資源。The above system is set as a node with a transaction function in the alliance chain system. When it is determined that the business function to be executed by the transaction is the transaction function that it can provide, it processes the transaction, obtains the processing result, and consensuses the processing result to the Each node in the alliance chain. In this way, compared with the direct communication between the functional modules in the alliance chain system in the prior art, the present invention can consensus the information between the functional modules and nodes through the consensus mechanism, improve the information transmission rate, and save Function module communication resources.

可選的,還包括:該聯盟鏈系統中具有監控功能的節點,用於監控該聯盟鏈系統中的各節點,並在確定存在異常的節點時,產生告警。Optionally, it also includes: a node with a monitoring function in the consortium chain system, which is used to monitor each node in the consortium chain system, and generate an alarm when an abnormal node is determined.

上述系統,設置具有監控功能的節點監控聯盟鏈系統中的各節點,在節點異常時,產生告警。如此,提高運維效率,保證交易業務正常處理。In the above system, a node with monitoring function is set to monitor each node in the alliance chain system, and an alarm is generated when the node is abnormal. In this way, the efficiency of operation and maintenance is improved, and the normal processing of transaction business is guaranteed.

可選的,該具有監控功能的節點,用於存在異常的節點進行隔離;並在確定該聯盟鏈系統中具有該異常的節點所提供的業務功能的節點數量不滿足設定要求時,在該聯盟鏈中觸發資源替代請求;該資源替代請求用於從該聯盟鏈系統的各節點中確定出用於替代該異常的節點的節點。Optionally, the node with monitoring function is used to isolate abnormal nodes; A resource substitution request is triggered in the chain; the resource substitution request is used to determine a node to replace the abnormal node from among the nodes of the consortium chain system.

上述系統,具有監控功能的節點,在存在異常的節點時,對異常的節點進行隔離。如此,保證交易業務處理的準確性。在確定聯盟鏈系統中具有該異常的節點所提供的業務功能的節點數量不滿足設定要求時,在聯盟鏈中觸發資源替代請求,從聯盟鏈系統的各節點中確定出用於替代該異常的節點的節點。如此,保證有充足的節點數量提供該業務功能,則保證交易業務處理的可靠性和效率。In the above system, the nodes with the monitoring function isolate the abnormal nodes when there are abnormal nodes. In this way, the accuracy of transaction business processing is guaranteed. When it is determined that the number of nodes with the business functions provided by the abnormal node in the consortium chain system does not meet the set requirements, a resource replacement request is triggered in the consortium chain, and the node used to replace the exception is determined from each node in the consortium chain system. node's node. In this way, ensuring a sufficient number of nodes to provide this business function will ensure the reliability and efficiency of transaction business processing.

可選的,具有監控功能的節點在該聯盟鏈中發送的第一指令與具有交易功能的節點在該聯盟鏈中發送的第二指令的優先順序不同,該第一指令的優先順序高於該第二指令的優先順序。Optionally, the priority order of the first instruction sent by the node with the monitoring function in the consortium chain is different from that of the second instruction sent by the node with the transaction function in the consortium chain, and the priority order of the first instruction is higher than that of the consortium chain. The priority order of the second directive.

上述系統,將具有監控功能的節點的指令優先順序設置為高於具有交易功能的節點的指令優先順序。有效防止發生異常節點仍然進行交易業務處理導致的業務處理錯誤的現象,提高業務處理可靠性。In the above system, the priority order of instructions of nodes with a monitoring function is set higher than that of nodes with a transaction function. Effectively prevent the phenomenon of business processing errors caused by abnormal nodes still processing transaction business, and improve the reliability of business processing.

第三方面,本發明實施例提供一種基於聯盟鏈系統的業務處理裝置,該聯盟鏈系統中包含多個節點,任一節點上均設置有業務系統,該業務系統提供多個業務功能,每個業務功能分別通過設定數量的節點提供,各節點基於共識機制通信,該裝置包括: 確定模組,用於針對任一交易,在確定該交易待執行的業務功能為自身可提供的第一交易功能時,通過處理模組基於該第一交易功能處理該交易,得到第一處理結果,並基於共識機制將該第一處理結果共識到該聯盟鏈系統中的各節點; 該確定模組,用於基於該第一處理結果,確定該交易待執行的業務功能為自身可提供的第二交易功能時,通過該處理模組基於該第二交易功能處理該交易,得到第二處理結果,並基於共識機制將該第二處理結果共識到該聯盟鏈系統中的各節點,直至該交易中的最後一個交易功能的處理結果共識到該聯盟鏈系統中的各節點。 In the third aspect, the embodiment of the present invention provides a business processing device based on the consortium chain system. The consortium chain system includes multiple nodes, and any node is equipped with a business system. The business system provides multiple business functions. Each Business functions are provided by a set number of nodes, and each node communicates based on a consensus mechanism. The device includes: The determination module is used to process the transaction based on the first transaction function through the processing module to obtain the first processing result when it is determined that the business function to be executed by the transaction is the first transaction function that can be provided by itself for any transaction , and based on the consensus mechanism, the first processing result is consensused to each node in the alliance chain system; The determination module is used to determine that the business function to be executed in the transaction is the second transaction function that it can provide based on the first processing result, and process the transaction based on the second transaction function through the processing module to obtain the second transaction function. 2. Process the result, and consensus the second processing result to each node in the alliance chain system based on the consensus mechanism, until the processing result of the last transaction function in the transaction is consensus to each node in the alliance chain system.

第四方面,本發明實施例還提供一種計算設備,包括:記憶體,用於存儲程式;處理器,用於調用該記憶體中存儲的程式,按照獲得的程式執行如第一方面的各種可能的設計中所述之方法。In the fourth aspect, the embodiment of the present invention also provides a computing device, including: a memory for storing programs; a processor for invoking the programs stored in the memory, and executing various possibilities as described in the first aspect according to the obtained programs. The method described in the design of .

第五方面,本發明實施例還提供一種電腦可讀非揮發性存儲介質,包括電腦可讀程式,當電腦讀取並執行該電腦可讀程式時,使得電腦執行如第一方面的各種可能的設計中所述之方法。In the fifth aspect, the embodiment of the present invention also provides a computer-readable non-volatile storage medium, including a computer-readable program. When the computer reads and executes the computer-readable program, the computer executes various possible programs as described in the first aspect. method described in the design.

本發明的這些實現方式或其他實現方式在以下實施例的描述中會更加簡明易懂。These implementation manners or other implementation manners of the present invention will be more concise and understandable in the description of the following embodiments.

為利 貴審查委員了解本發明之技術特徵、內容與優點及其所能達到之功效,茲將本發明配合附圖及附件,並以實施例之表達形式詳細說明如下,而其中所使用之圖式,其主旨僅為示意及輔助說明書之用,未必為本發明實施後之真實比例與精準配置,故不應就所附之圖式的比例與配置關係解讀、侷限本發明於實際實施上的申請範圍,合先敘明。In order for Ligui examiners to understand the technical characteristics, content and advantages of the present invention and the effects it can achieve, the present invention is hereby combined with the accompanying drawings and appendices, and is described in detail in the form of embodiments as follows, and the drawings used therein , the purpose of which is only for illustration and auxiliary instructions, and not necessarily the true proportion and precise configuration of the present invention after implementation, so it should not be interpreted based on the proportion and configuration relationship of the attached drawings, and limit the application of the present invention in actual implementation The scope is described first.

在本發明的描述中,需要理解的是,術語「中心」、「橫向」、「上」、「下」、「左」、「右」、「頂」、「底」、「內」、「外」等指示的方位或位置關係為基於圖式所示的方位或位置關係,僅是為了便於描述本發明和簡化描述,而不是指示或暗示所指的裝置或元件必須具有特定的方位、以特定的方位構造和操作,因此不能理解為對本發明的限制。In describing the present invention, it is to be understood that the terms "center", "lateral", "upper", "lower", "left", "right", "top", "bottom", "inner", " The orientations or positional relationships indicated in the drawings are based on the orientations or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the referred device or element must have a specific orientation, Specific orientation configurations and operations, therefore, are not to be construed as limitations on the invention.

圖1為本發明實施例提供的一種基於聯盟鏈系統的架構示意圖,其中,節點101及其資料庫1、節點102及其資料庫2、節點103及其資料庫3,可以是參與該聯盟鏈系統的相同或不同機構、組織等的對應服務節點。這裡的節點101及其資料庫1、節點102及其資料庫2、節點103及其資料庫3只是一種示例,並不對聯盟鏈系統中的節點數量做限制。針對聯盟鏈系統中每個機構、組織的服務節點可以不止一個,參與該聯盟鏈系統的機構、組織數量也不做限制。用戶端104可以為節點101的用戶端104,用戶端104可以用於獲取基於聯盟鏈系統的業務系統中的資料,或對基於聯盟鏈系統的業務系統發起業務處理請求等。管理用戶端105可以為通過節點101對聯盟鏈系統的業務系統做相應管理操作的管理用戶端105,如,資料配置變更、系統發佈變更等。這裡每個機構的服務節點都可以存在用戶端104和/或管理用戶端105,根據需要設置,這裡具體不做限定。Fig. 1 is a schematic diagram of an architecture based on a consortium chain system provided by an embodiment of the present invention, wherein, a node 101 and its database 1, a node 102 and its database 2, a node 103 and its database 3, may participate in the consortium chain Corresponding service nodes of the same or different institutions, organizations, etc. of the system. Here, node 101 and its database 1, node 102 and its database 2, node 103 and its database 3 are just examples, and there is no limit to the number of nodes in the consortium chain system. There can be more than one service node for each institution and organization in the alliance chain system, and there is no limit to the number of institutions and organizations participating in the alliance chain system. The client 104 can be the client 104 of the node 101, and the client 104 can be used to obtain information in the business system based on the consortium chain system, or initiate a business processing request to the business system based on the consortium chain system. The management client 105 can be a management client 105 that performs corresponding management operations on the business system of the consortium chain system through the node 101, such as data configuration changes, system release changes, etc. Here, the service node of each institution may have a client terminal 104 and/or a management client terminal 105, which are set according to needs, and are not specifically limited here.

該聯盟鏈系統中的各節點均設置有業務系統,各節點中不同的節點可以提供業務系統的相同或不同的業務功能,每個業務功能分別通過設定數量的節點提供。如,當前聯盟鏈系統中有20個節點,業務系統中設置有識別功能通過10個節點提供,資料配置功能通過3個節點提供,識別功能的優先順序高於資料配置功能的優先順序。則該20個節點在業務系統安裝運行後,先根據節點自身資源資訊爭奪識別功能(資源空閒最多的節點優先爭奪到識別功能,即,當前20個節點中資源空閒量為前10的節點提供識別功能)。當成功爭奪到該識別功能的節點達到10個後,20個節點繼續爭奪資料配置功能(優選的,這裡針對每個業務功能或交易功能都是全量節點根據節點資源資訊爭奪,爭奪的依據為節點資源空閒情況。如此,可以保證業務功能/交易功能的運行速度。爭奪的依據也可以為節點根據節點資源資訊和該節點的業務功能或交易功能。如,爭奪與節點提供的業務功能或交易功能不同的業務功能或交易功能,這裡可以根據業務功能和交易功能等具體需要設置,此處不做限制),以使得資料配置功能通過3個節點提供。將最後剩餘的沒有提供業務功能的節點存放在資源備用池中。當提供業務功能的節點出現異常後,該節點外的其它節點爭奪該異常的節點提供的業務功能。如此,在正常情況下的業務處理過程中,識別功能總是通過10個節點提供,資料配置功能總是通過3個節點提供,很好的保證了業務功能運行所需的資源,進一步保證業務系統的運行速率和業務處理的準確性。Each node in the alliance chain system is equipped with a business system, and different nodes in each node can provide the same or different business functions of the business system, and each business function is provided by a set number of nodes. For example, there are 20 nodes in the current consortium chain system, the business system is set to provide the identification function through 10 nodes, and the data configuration function is provided through 3 nodes, and the priority of the identification function is higher than that of the data configuration function. After the 20 nodes are installed and running in the business system, they first compete for the identification function according to the node's own resource information (the node with the most idle resources will first compete for the identification function, that is, among the current 20 nodes, the nodes with the top 10 idle resources provide identification. Function). When the number of nodes successfully competing for the identification function reaches 10, 20 nodes continue to compete for the data configuration function (preferably, for each business function or transaction function here, the full amount of nodes competes based on node resource information, and the basis for the competition is node Resource idle situation. In this way, the running speed of business functions/transaction functions can be guaranteed. The basis for contention can also be based on node resource information and the node’s business functions or transaction functions. For example, to compete for business functions or transaction functions provided by nodes Different business functions or transaction functions can be set according to the specific needs of business functions and transaction functions, and there is no limit here), so that the data configuration function is provided through 3 nodes. Store the last remaining nodes that do not provide business functions in the resource backup pool. When a node providing a service function is abnormal, other nodes outside the node compete for the service function provided by the abnormal node. In this way, in the normal business processing process, the identification function is always provided by 10 nodes, and the data configuration function is always provided by 3 nodes, which guarantees the resources required for the operation of business functions and further ensures the business system The speed of operation and the accuracy of business processing.

在一種示例中,每個機構可以通過該機構的多個服務節點提供業務系統中的所有業務功能。如,業務系統中若包含兩個業務功能,該機構由節點101和節點102運行業務系統,則可以為節點101提供一種業務功能,節點102提供另一種業務功能。即,聯盟鏈系統中一個機構的服務節點也可以完全提供業務系統的所有功能。或者,在又一種示例中,也可以為通過聯盟鏈系統中的所有參與者(機構、組織等)的服務節點提供業務系統中的所有業務功能。如,業務系統中若包含兩個業務功能,機構1的節點101和機構2的節點102運行業務系統,可以為節點101提供一種業務功能,節點102提供另一種業務功能。即,聯盟鏈系統中全部或部分機構的服務節點可以完全提供業務系統的所有功能。這裡對提供業務功能的節點來源(節點來源,可以為節點所屬的機構)可以不做限制。In an example, each organization can provide all business functions in the business system through multiple service nodes of the organization. For example, if the business system contains two business functions, and the organization runs the business system by node 101 and node 102, then node 101 can be provided with one business function, and node 102 can be provided with another business function. That is, the service node of an organization in the consortium chain system can also fully provide all the functions of the business system. Or, in yet another example, all business functions in the business system can also be provided for service nodes passing through all participants (institutions, organizations, etc.) in the alliance chain system. For example, if the business system includes two business functions, and the node 101 of organization 1 and the node 102 of organization 2 run the business system, node 101 can provide one kind of business function, and node 102 can provide another kind of business function. That is, the service nodes of all or some organizations in the consortium chain system can fully provide all the functions of the business system. Here, there is no restriction on the source of the node that provides business functions (the source of the node, which can be the organization to which the node belongs).

該聯盟鏈系統中的各節點均設置有業務系統,各節點通過共識機制進行通信。如,節點101和節點102通過共識機制共識處理交易獲取的處理結果。即,在一種示例中,若節點101提供的生成交易功能的優先順序高於節點102提供的生效交易功能,節點101和節點102獲取到交易後,節點101確定交易待執行的業務功能為自身可提供的生成交易功能時,處理該交易,得到處理結果,並基於共識機制將該處理結果共識到節點102中;節點102確定交易待執行的業務功能為自身可提供的生效交易功能時,基於節點101共識的處理結果處理該交易,得到處理結果。若還有節點103提供優先順序低於生效交易功能的發佈交易功能,則可以在確定交易待執行的業務功能為自身可提供的發佈交易功能時,基於節點102共識的處理結果處理該交易,得到處理結果。Each node in the alliance chain system is equipped with a business system, and each node communicates through a consensus mechanism. For example, the node 101 and the node 102 agree to process the processing result acquired by the transaction through a consensus mechanism. That is, in one example, if the transaction generation function provided by node 101 has a higher priority than the effective transaction function provided by node 102, after nodes 101 and 102 obtain the transaction, node 101 determines that the business function to be executed by the transaction is itself When the generated transaction function is provided, the transaction is processed, the processing result is obtained, and the processing result is consensused to the node 102 based on the consensus mechanism; when the node 102 determines that the business function to be executed by the transaction is an effective transaction function that it can provide, The processing result of the 101 consensus processes the transaction and obtains the processing result. If there is still a node 103 that provides a publishing transaction function with a lower priority than the effective transaction function, when it is determined that the business function to be executed by the transaction is a publishing transaction function that can be provided by itself, the transaction can be processed based on the processing results of the consensus of the node 102, and the obtained process result.

另外,聯盟鏈系統中還可以包含具有監控功能的節點,監控該聯盟鏈系統中的各節點,並在確定存在異常的節點時,產生告警。還可以在存在異常的節點時,對該異常的節點進行隔離;並在確定聯盟鏈系統中具有異常的節點所提供的業務功能的節點數量不滿足設定要求時(如,在上述示例中,提供識別功能的10個節點中,一個節點發生異常,使得提供該識別功能的節點只有9個,不滿足識別功能需要10個節點提供的設定要求),在該聯盟鏈中觸發資源替代請求;從聯盟鏈系統的各節點中確定出用於替代異常的節點的節點(在上一示例中,從剩餘的10個節點中(包括資源備用池中的節點和提供資料配置功能的3個節點)確定出用於替代該異常的節點的節點)。其中,在該聯盟鏈系統中具有監控功能的節點提供監控功能且不用於爭奪監控功能以外的業務功能,具有監控功能的節點發送的第一指令優先順序高於具有交易功能的節點發送的第二指令的優先順序。如此,保證監控節點可以及時將異常的節點隔離,保證業務系統運行的可靠性和準確性。In addition, the consortium chain system can also include nodes with monitoring functions, monitor each node in the consortium chain system, and generate an alarm when an abnormal node is determined. It is also possible to isolate the abnormal nodes when there are abnormal nodes; Among the 10 nodes of the identification function, one node is abnormal, so that only 9 nodes provide the identification function, which does not meet the setting requirements provided by 10 nodes for the identification function), a resource replacement request is triggered in the alliance chain; from the alliance Among the nodes in the chain system, the node used to replace the abnormal node is determined (in the previous example, it is determined from the remaining 10 nodes (including the nodes in the resource backup pool and the 3 nodes that provide data configuration functions) node to replace the exception's node). Among them, in the alliance chain system, nodes with monitoring functions provide monitoring functions and are not used to compete for business functions other than monitoring functions. The first instruction sent by nodes with monitoring functions has a higher priority than the second instruction sent by nodes with transaction functions. Order of precedence for directives. In this way, it is ensured that the monitoring nodes can isolate abnormal nodes in time to ensure the reliability and accuracy of the operation of the business system.

基於上述聯盟鏈系統架構,本發明實施例提供的一種基於聯盟鏈系統的業務系統的架構示意圖,如圖2所示,基於聯盟鏈系統的業務系統可以實現識別功能、資料配置功能、業務處理功能、監控功能,相應的,該業務系統中可以包含識別功能模組、資料配置功能模組、業務處理功能模組、監控功能模組。其中,識別功能用於識別處理交易所需的業務功能和節點提供的業務功能,資料配置功能用於提供業務處理相關參數,業務處理功能用於處理交易,監控功能用於監控聯盟鏈中交易處理過程和各處理節點的運行狀態。這裡的業務系統只是一種示例,並不對業務系統提供的業務功能做限制。如,業務系統還可以提供節點授權功能(如,對聯盟鏈系統中的新增節點或修復後的異常節點等授權加入聯盟鏈系統和業務系統等)等。業務處理功能中還可以分為資料收集功能、資料生成功能、資料生效功能、資料發佈功能等。在一種示例中,上述聯盟鏈系統中的機構、組織可以是同地域或不同地域的,如,可以是相同國家的,也可以是不同國家的。Based on the above alliance chain system architecture, the embodiment of the present invention provides a schematic diagram of the architecture of a business system based on the alliance chain system, as shown in Figure 2, the business system based on the alliance chain system can realize identification functions, data configuration functions, and business processing functions 1. Monitoring function. Correspondingly, the business system may include an identification function module, a data configuration function module, a business processing function module, and a monitoring function module. Among them, the identification function is used to identify the business functions required to process transactions and the business functions provided by nodes, the data configuration function is used to provide business processing related parameters, the business processing function is used to process transactions, and the monitoring function is used to monitor transaction processing in the alliance chain Process and running status of each processing node. The business system here is just an example, and does not limit the business functions provided by the business system. For example, the business system can also provide node authorization functions (for example, authorize new nodes in the alliance chain system or abnormal nodes after repair to join the alliance chain system and business system, etc.). Business processing functions can also be divided into data collection functions, data generation functions, data validation functions, and data release functions. In one example, the institutions and organizations in the above alliance chain system may be in the same region or in different regions, for example, they may be in the same country or in different countries.

基於上述聯盟鏈系統架構和基於聯盟鏈系統的業務系統的架構,本發明實施例提供的一種基於聯盟鏈系統的業務處理方法的流程示意圖,該聯盟鏈系統中包含多個節點,任一節點上均設置有業務系統,該業務系統提供多個業務功能,每個業務功能分別通過設定數量的節點提供,各節點基於共識機制通信,如圖3所示,該方法包括: 步驟301、針對任一交易,該聯盟鏈系統中的第一節點在確定該交易待執行的業務功能為自身可提供的第一交易功能時,基於該第一交易功能處理該交易,得到第一處理結果,並基於共識機制將該第一處理結果共識到該聯盟鏈系統中的各節點; 此處,需要說明的是業務功能中可以包含一個或多個交易功能。每個交易功能也可以通過設定數量的節點處理。 Based on the above alliance chain system architecture and the architecture of the business system based on the alliance chain system, the embodiment of the present invention provides a schematic flow diagram of a business processing method based on the alliance chain system. The alliance chain system includes multiple nodes. Both are equipped with a business system, the business system provides multiple business functions, each business function is provided by a set number of nodes, each node communicates based on a consensus mechanism, as shown in Figure 3, the method includes: Step 301. For any transaction, when the first node in the consortium chain system determines that the business function to be executed by the transaction is the first transaction function it can provide, it processes the transaction based on the first transaction function and obtains the first Processing results, and consensus on the first processing results to each node in the alliance chain system based on the consensus mechanism; Here, it should be noted that one or more transaction functions may be contained in a business function. Each transaction function can also be processed by a set number of nodes.

步驟302、該聯盟鏈系統中的第二節點基於該第一處理結果,確定該交易待執行的業務功能為自身可提供的第二交易功能時,基於該第二交易功能處理該交易,得到第二處理結果,並基於共識機制將該第二處理結果共識到該聯盟鏈系統中的各節點,直至該交易中的最後一個交易功能的處理結果共識到該聯盟鏈系統中的各節點。Step 302, when the second node in the consortium chain system determines that the business function to be executed by the transaction is the second transaction function that it can provide based on the first processing result, it processes the transaction based on the second transaction function, and obtains the second transaction function. 2. Process the result, and consensus the second processing result to each node in the alliance chain system based on the consensus mechanism, until the processing result of the last transaction function in the transaction is consensus to each node in the alliance chain system.

上述方法中,在聯盟鏈的各節點中設置業務系統,並針對業務系統中的每個業務功能設置對應的預設數量的節點提供該業務功能,各節點接收交易後,使得各節點通過共識機制即時通信,根據業務功能中的交易功能對交易進行處理,共識處理結果,使得提供下一順序交易功能的節點基於該處理結果,進行下一順序業務功能的處理。相比於現有技術中通過業務功能模組之間互相通信,可以大大降低通信耗時和業務功能模組的資源佔用。In the above method, a business system is set up in each node of the consortium chain, and a preset number of nodes corresponding to each business function in the business system are set to provide the business function. After each node receives the transaction, each node passes the consensus mechanism In instant messaging, the transaction is processed according to the transaction function in the business function, and the processing result is agreed, so that the node providing the next transaction function can process the next business function based on the processing result. Compared with the prior art of communicating with each other through the business function modules, the communication time consumption and the resource occupation of the business function modules can be greatly reduced.

本發明實施例提供的一種基於聯盟鏈系統的業務處理方法,該聯盟鏈系統中各節點可提供的業務功能通過如下方式確定,包括:針對待分配的業務功能中優先順序最高的業務功能,該聯盟鏈系統基於共識機制確定各節點的節點資源資訊中資源空閒最多的第三節點,並設置該第三節點用於提供該待分配的業務功能中優先順序最高的業務功能,直至該待分配的業務功能均分配完畢。An embodiment of the present invention provides a business processing method based on a consortium chain system. The business functions that can be provided by each node in the consortium chain system are determined in the following manner, including: for the business function with the highest priority among the business functions to be allocated, the The alliance chain system determines the third node with the most free resources in the node resource information of each node based on the consensus mechanism, and sets the third node to provide the business function with the highest priority among the business functions to be allocated until the Business functions are all assigned.

在一種示例中,業務系統中可以實現識別功能、資料配置功能、業務處理功能、監控功能,業務功能的優先順序排序為:識別功能的優先順序>資料配置功能的優先順序>業務處理功能的優先順序>監控功能的優先順序,該業務系統中配置有識別功能對應節點數量為3個、資料配置功能對應節點數量為2個、業務處理功能對應節點數量為10個、監控功能對應節點數量為5個。In one example, the identification function, data configuration function, business processing function, and monitoring function can be implemented in the business system, and the priority order of the business functions is: the priority of the identification function > the priority of the data configuration function > the priority of the business processing function Sequence>Priority of monitoring function, the business system is configured with 3 nodes corresponding to the identification function, 2 nodes corresponding to the data configuration function, 10 nodes corresponding to the business processing function, and 5 nodes corresponding to the monitoring function indivual.

現在在聯盟鏈系統中的25個節點中安裝並運行該業務系統,25個節點首先根據節點自身的節點資源資訊爭奪識別功能。首先,25個節點中資源空閒最多的節點爭奪到識別功能,繼之,當前提供該識別功能節點之外的24個節點中資源空閒最多的節點爭奪到識別功能,直到識別功能達到設定的節點數量要求-3個節點提供該識別功能。Now install and run the business system in the 25 nodes in the consortium chain system, and the 25 nodes first compete for the identification function according to the node resource information of the node itself. First, the node with the most free resources among the 25 nodes competes for the recognition function, and then, the node with the most free resources among the 24 nodes currently providing the recognition function competes for the recognition function until the recognition function reaches the set number of nodes Requirement - 3 nodes to provide this recognition function.

之後,25個節點首先根據節點自身的節點資源資訊爭奪資料配置功能,25個節點中資源空閒最多的節點爭奪到資料配置功能。繼之,當前提供該資料配置功能節點之外的24個節點中資源空閒最多的節點爭奪到資料配置功能,直到資料配置功能達到設定的節點數量要求-2個節點提供該識別功能。Afterwards, the 25 nodes compete for the data configuration function based on their own node resource information, and the node with the most free resources among the 25 nodes competes for the data configuration function. Then, among the 24 nodes currently providing the data configuration function, the node with the most idle resources competes for the data configuration function until the data configuration function reaches the set number of nodes—2 nodes provide the identification function.

之後,25個節點首先根據節點自身的節點資源資訊爭奪業務處理功能,25個節點中資源空閒最多的節點爭奪到業務處理功能。繼之,當前提供該資料配置功能節點之外的24個節點中資源空閒最多的節點爭奪到業務處理功能,直到業務處理功能達到設定的節點數量要求-10個節點提供該業務處理功能。Afterwards, the 25 nodes first compete for the service processing function according to the node resource information of the node itself, and the node with the most idle resources among the 25 nodes competes for the service processing function. Then, among the 24 nodes currently providing the data configuration function, the node with the most idle resources competes for the business processing function until the business processing function reaches the set number of nodes—10 nodes provide the business processing function.

之後,25個節點首先根據節點自身的節點資源資訊爭奪監控功能,25個節點中資源空閒最多的節點爭奪到監控功能。繼之,當前提供該監控功能節點之外的24個節點中資源空閒最多的節點爭奪到監控功能,直到監控功能達到設定的節點數量要求-5個節點提供該監控功能。這裡需要說明的是,可以通過人工設置或通過其他程式等方式確定固定節點提供監控功能。即,具有監控功能的節點不參與爭奪業務功能的流程中。如此,保證這些固定節點提供監控功能的穩定可追溯性等,便於工作人員運維處理。另外,由上述示例可知,一個節點可以同時提供一個或多個業務功能,具體根據節點的節點資源資訊確定,還可以根據節點當前提供的業務功能資源充足情況確定該節點是否可以爭奪到另一個業務功能,即,爭奪當前待提供的業務功能的依據是節點的資源空閒最多、該節點提供的業務功能的資源最充足。Afterwards, the 25 nodes compete for the monitoring function based on their own node resource information, and the node with the most idle resources among the 25 nodes competes for the monitoring function. Then, among the 24 nodes currently providing the monitoring function, the node with the most idle resources competes for the monitoring function until the monitoring function reaches the set number of nodes—5 nodes provide the monitoring function. It should be noted here that the fixed node can be determined to provide the monitoring function through manual setting or through other programs. That is, nodes with monitoring functions do not participate in the process of competing for business functions. In this way, the stability and traceability of monitoring functions provided by these fixed nodes are guaranteed, which is convenient for staff to operate and maintain. In addition, from the above example, it can be known that a node can provide one or more business functions at the same time, which is determined according to the node resource information of the node, and whether the node can compete for another business can also be determined according to the sufficiency of the business function resources currently provided by the node function, that is, the basis for competing for the service function to be provided currently is that the resource of the node is the most idle and the resource of the service function provided by the node is the most sufficient.

這裡爭奪當前待提供的業務功能的依據可以有兩個因素:節點資源空閒情況、該節點提供的業務功能的資源是否充足情況。依據節點的這兩個因素爭奪業務功能的方法可以根據需要具體設置。如,節點的資源空閒最多,但是該節點提供的業務功能的資源(可以為提供該業務功能的各節點的空閒資源總量)低於資源充足閾值,則該節點不能爭奪另一業務功能。節點的資源空閒最多,該節點提供的業務功能的資源(可以為提供該業務功能的各節點的空閒資源總量)高於資源充足閾值,則該節點可以爭奪另一業務功能。Here, there may be two factors for competing for the service function to be provided currently: idleness of node resources, and whether the resource of the service function provided by the node is sufficient. The method of competing for service functions based on these two factors of nodes can be specifically set as required. For example, a node has the most free resources, but the resource of the service function provided by the node (which may be the total idle resources of each node providing the service function) is lower than the sufficient resource threshold, then the node cannot compete for another service function. The node has the most idle resources, and the resource of the service function provided by the node (which can be the total idle resources of each node providing the service function) is higher than the resource adequacy threshold, then the node can compete for another service function.

本發明實施例提供的一種基於聯盟鏈系統的業務處理方法,該聯盟鏈系統基於共識機制確定各節點的節點資源資訊中資源空閒最多的第三節點,包括: 針對任一節點,該聯盟鏈系統根據該節點中各項資源的權重、各項資源的資源使用情況及各項資源的性能資訊,確定該節點的資源空閒狀況; 該聯盟鏈系統基於共識機制中將資源空閒狀況中資源空閒最多的節點,確定為第三節點。 An embodiment of the present invention provides a business processing method based on a consortium chain system. The consortium chain system determines the third node with the most free resources in the node resource information of each node based on a consensus mechanism, including: For any node, the alliance chain system determines the resource idle status of the node according to the weight of each resource in the node, the resource usage of each resource and the performance information of each resource; The alliance chain system determines the node with the most idle resources in the resource idle state as the third node based on the consensus mechanism.

在一種示例中,節點資源資訊中的資源使用情況包括記憶體剩餘量、各種進程剩餘數等,資源性能資訊包括:伺服器記憶體總量、伺服器型號、伺服器生產年限等等。將對節點提供業務功能影響較大和/或應用較多的資源項設置較大權重,使得節點中各項資源的權重、根據各項資源的資源使用情況及各項資源的性能資訊計算的資源空閒情況最符合表徵節點提供業務功能的能力。In one example, the resource usage in the node resource information includes remaining memory, remaining numbers of various processes, etc., and the resource performance information includes: total server memory, server model, server production year, and so on. A larger weight will be set for the resource items that have a greater impact on the business functions provided by the node and/or have more applications, so that the weight of each resource in the node, the resource idleness calculated according to the resource usage of each resource and the performance information of each resource The situation is most consistent with the ability to characterize a node's ability to provide business functions.

本發明實施例提供的一種基於聯盟鏈系統的業務處理方法,該多個業務功能中包含監控功能,該方法還包括:該聯盟鏈系統中的第四節點基於自身可提供的監控功能,監控該各節點;若確定存在異常的節點,則產生告警。也就是說,第四節點為具有監控功能的監控節點,該監控節點用於監控聯盟鏈系統中的各節點的業務處理情況和自身運行情況,若該節點出現特定的業務處理異常(如,交易處理等待時間超過設定閾值等)或運行故障(如,雲閘道識別到該節點不能與其它節點通過共識機制通信等),針對該異常的節點產生告警,還可以將該異常的節點隔離(可以通過關閉該異常的節點的相應埠等實現隔離該異常的節點),還可以在該異常的節點修復後,將該節點放入資源備用池。In the business processing method based on the consortium chain system provided by the embodiment of the present invention, the multiple business functions include a monitoring function, and the method further includes: the fourth node in the consortium chain system monitors the Each node; if it is determined that there is an abnormal node, an alarm will be generated. That is to say, the fourth node is a monitoring node with monitoring function. The monitoring node is used to monitor the business processing status of each node in the consortium chain system and its own operation status. If the node has a specific business processing exception (such as transaction Processing waiting time exceeds the set threshold, etc.) or operation failure (for example, the cloud gateway recognizes that the node cannot communicate with other nodes through the consensus mechanism, etc.), and generates an alarm for the abnormal node, and can also isolate the abnormal node (you can The abnormal node can be isolated by closing the corresponding port of the abnormal node, etc.), and after the abnormal node is repaired, the node can be put into the resource backup pool.

本發明實施例提供的一種基於聯盟鏈系統的業務處理方法,確定存在異常的節點之後,還包括: 該聯盟鏈系統中的第四節點將存在異常的節點進行隔離; 該聯盟鏈系統中的第四節點確定該聯盟鏈中具有該異常的節點所提供的業務功能的節點數量是否滿足設定要求; 該聯盟鏈系統中的第四節點若確定不滿足該設定要求時,在該聯盟鏈系統中觸發資源替代請求; 該聯盟鏈系統基於共識機制從該各節點中確定出用於替代該第四節點的第五節點。也就是說,聯盟鏈系統中的監控節點將異常的節點隔離後,還需要確定該異常的節點提供的業務功能是否滿足節點數量的設定要求,若是不滿足,需要出發資源替代請求,從聯盟鏈系統中確定出第五節點,提供該業務功能,使得該業務功能的節點數量滿足設定要求。這裡需要說明的是,監控節點將異常的節點隔離後,可以通過共識機制確定是否進行該異常的節點的業務功能爭奪,以及通過共識機制確定第五節點,這裡資源替代請求是節點共識機制共識到的一種說法。 A business processing method based on the consortium chain system provided by the embodiment of the present invention, after determining the abnormal node, further includes: The fourth node in the consortium chain system isolates abnormal nodes; The fourth node in the consortium chain system determines whether the number of nodes in the consortium chain that have the business functions provided by the abnormal node meets the set requirements; If the fourth node in the consortium chain system determines that the set requirements are not met, a resource replacement request is triggered in the consortium chain system; The consortium chain system determines a fifth node to replace the fourth node from the nodes based on a consensus mechanism. That is to say, after the monitoring node in the alliance chain system isolates the abnormal node, it needs to determine whether the business function provided by the abnormal node meets the set requirements of the number of nodes. If not, it needs to initiate a resource replacement request, from the alliance chain The fifth node is determined in the system to provide the service function, so that the number of nodes of the service function meets the set requirements. What needs to be explained here is that after the monitoring node isolates the abnormal node, it can determine whether to compete for the business function of the abnormal node through the consensus mechanism, and determine the fifth node through the consensus mechanism. Here, the resource replacement request is reached by the node consensus mechanism. a statement of.

本發明實施例提供的一種基於聯盟鏈系統的業務處理方法,具有監控功能的節點在該聯盟鏈系統中發送的第一指令與具有交易功能的節點在該聯盟鏈系統中發送的第二指令的優先順序不同,該第一指令的優先順序高於該第二指令的優先順序。也就是說,聯盟鏈系統上各節點的通訊使用至少兩套指令集。指令集A-第二指令集為節點間資訊交互指令集,報文頭部可以為以“000A”開頭。指令集B-第一指令集為監控功能模組發出的干預指令,報文頭部可以為以“000B”開頭。當監控節點發現聯盟鏈系統上出現異常或需要人工干預等任何場景時,通過專用干預指令集向聯盟鏈系統發出的干預指令-第一指令。指令集A的消息將在各節點排隊處理。當收到歸屬於指令集B的指令時,節點將優先處理,無需排隊。每個節點為指令集B的資訊處理設置專門的執行緒池併發處理,保證共識干預機制和業務處理互不干擾。另外,為避免指令集B被篡改或偽造,干預指令集發出者將自己的簽名資訊植入指令集B的報文頭,將發起的時間資訊放入報文體。節點接收到指令集B的指令後先對報文的發出者身份的合法性,通過核驗的指令集B指令才會被真正遵照執行。In the business processing method based on the alliance chain system provided by the embodiment of the present invention, the difference between the first instruction sent by the node with the monitoring function in the alliance chain system and the second instruction sent by the node with the transaction function in the alliance chain system The priorities are different, and the priority of the first instruction is higher than that of the second instruction. That is to say, the communication of each node on the consortium chain system uses at least two sets of instructions. Instruction set A—the second instruction set is an instruction set for information interaction between nodes, and the header of the message may start with "000A". Instruction set B—the first instruction set is the intervention instruction issued by the monitoring function module, and the header of the message may start with "000B". When the monitoring node finds that there is an abnormality on the alliance chain system or any scene that requires manual intervention, it will issue an intervention instruction to the alliance chain system through a dedicated intervention instruction set - the first instruction. Messages of instruction set A will be queued and processed at each node. When receiving an instruction belonging to instruction set B, the node will give priority to processing without queuing. Each node sets up a dedicated execution thread pool for concurrent processing of information processing of instruction set B to ensure that the consensus intervention mechanism and business processing do not interfere with each other. In addition, in order to prevent instruction set B from being tampered with or forged, the sender of the intervening instruction set embeds his own signature information into the message header of instruction set B, and puts the time information of the initiation into the message body. After the node receives the instructions of the instruction set B, it first checks the validity of the identity of the sender of the message, and the instructions of the instruction set B that pass the verification will be truly followed and executed.

基於上述方法流程,本發明實施例提供的一種基於聯盟鏈系統的業務處理方法流程,如圖4所示,包括: 步驟401、在業務系統中設置相關配置資料。 Based on the above method flow, the embodiment of the present invention provides a business processing method flow based on the alliance chain system, as shown in Figure 4, including: Step 401, setting relevant configuration data in the business system.

此處,相關配置資料可以為業務系統中各業務功能的節點數量、不同國家的匯率資料、設定時間內的最高交易量、一筆交易的最大交易金額等等。Here, the relevant configuration data can be the number of nodes of each business function in the business system, exchange rate data of different countries, the highest transaction volume within a set time, the maximum transaction amount of a transaction, and so on.

此處,也可以針對一些業務功能中的多個交易功能設置交易功能對應的提供該交易功能的節點數量。Here, the number of nodes that provide the transaction function corresponding to the transaction function can also be set for multiple transaction functions in some business functions.

步驟402、將該業務系統安裝在節點中,並運行。Step 402, install the service system in the node and run it.

此處,節點為聯盟鏈系統中的各節點。Here, the nodes are the nodes in the consortium chain system.

步驟403、運行該業務系統的各節點爭奪節點提供的業務功能。Step 403, each node running the business system competes for the business function provided by the node.

此處,監控功能可以是設置的固定節點提供的。Here, the monitoring function may be provided by a set fixed node.

步驟404、各節點獲取交易請求。Step 404, each node obtains the transaction request.

此處,各節點可以通過共識機制獲取交易請求。在一種示例中,業務系統獲取用戶端提交的存款交易請求(例如,該存款交易請求中的資訊包括將一定數值的第一幣種存儲為第二幣種)。則節點中的資料配置功能得到第一幣種和第二幣種的匯率,可以根據資料生成功能根據該存款交易請求中的第一幣種和第二幣種的匯率進行轉換得到第二幣種的數值。並由資料生效功能將對應該第二幣種的數值的交易資料生效。由資料發佈功能將設定時間段內的各交易資料發佈。這裡,相比於現有技術中通過各功能模組之間通信完成資料的收集、生成、生效和發佈,本發明通過共識機制完成資料的收集、生成、生效和發佈,加快業務處理速度。Here, each node can obtain the transaction request through the consensus mechanism. In an example, the business system obtains a deposit transaction request submitted by a user terminal (for example, the information in the deposit transaction request includes storing a certain value of the first currency as the second currency). Then the data configuration function in the node obtains the exchange rate between the first currency and the second currency, which can be converted according to the exchange rate of the first currency and the second currency in the deposit transaction request according to the data generation function to obtain the second currency value. And the transaction data corresponding to the value of the second currency will be validated by the data validation function. The transaction data within the set time period will be released by the data release function. Here, compared with the collection, generation, validation and release of data through communication between functional modules in the prior art, the present invention completes the collection, generation, validation and release of data through a consensus mechanism to speed up business processing.

步驟405、各節點中提供識別功能的節點識別處理該交易請求需要的業務功能/業務功能中的交易功能。通過共識機制共識處理該交易請求需要的業務功能/業務功能中的交易功能到各節點。Step 405, among the nodes, the node that provides the identification function identifies the business function/transaction function among the business functions needed to process the transaction request. Through the consensus mechanism, the business functions required to process the transaction request/the transaction functions in the business functions are sent to each node.

如,在上述示例中,處理該交易請求需要的業務功能包括:資料配置功能和業務處理功能,業務處理功能中包括資料生成功能、資料生效功能和資料發佈功能等交易功能。For example, in the above example, the business functions required to process the transaction request include: data configuration function and business processing function, and the business processing function includes transaction functions such as data generation function, data validation function and data release function.

步驟406、各節點中提供第一業務功能的節點確定自身提供該第一業務功能,各節點中提供該第一業務功能中第一交易功能的節點確定自身提供該第一交易功能,通過該第一交易功能對交易請求進行處理,或根據處理結果對交易請求進行處理獲取處理結果。將該第一交易功能獲取的處理結果通過共識機制共識到各節點。Step 406: Among the nodes, the node that provides the first business function determines that it provides the first business function, and among the nodes that provides the first transaction function in the first business function, it determines that it provides the first transaction function. A transaction function processes the transaction request, or processes the transaction request according to the processing result to obtain the processing result. The processing result obtained by the first transaction function is consensused to each node through a consensus mechanism.

此處,第一業務功能為:在處理該交易請求需要的多個業務功能中,未對該交易請求提供過的業務功能中排序最前的業務功能。Here, the first business function is: among the multiple business functions required to process the transaction request, the business function that is ranked first among the business functions that have not been provided for the transaction request.

第一交易功能為:第一業務功能的處理該交易請求需要的多個交易功能中,未對該交易請求提供過的交易功能中排序最前的交易功能。The first transaction function is: among the plurality of transaction functions required by the first business function for processing the transaction request, the transaction function that has not been provided for the transaction request is the transaction function that ranks first.

其中,該第一交易功能根據處理結果對交易請求進行處理獲取處理結果對應的流程前提為:提供第一交易功能的節點獲取到在前的業務功能處理後獲取的處理結果,則基於該處理結果對交易請求進行處理。Wherein, the first transaction function processes the transaction request according to the processing result and obtains the processing result. Process transaction requests.

步驟407、各節點中提供該第一業務功能中第二交易功能的節點確定自身提供該第二交易功能,通過該第二交易功能,根據處理結果對交易請求進行處理獲取處理結果。將該第二交易功能獲取的處理結果通過共識機制共識到各節點。Step 407, among the nodes, the node that provides the second transaction function in the first business function determines that it provides the second transaction function, and processes the transaction request according to the processing result to obtain the processing result through the second transaction function. The processing results obtained by the second transaction function are consensused to each node through a consensus mechanism.

此處,第二交易功能為在第一交易功能之後進行處理的交易功能。Here, the second transaction function is a transaction function processed after the first transaction function.

步驟408、各節點中提供第二業務功能的節點確定自身提供該第二業務功能,各節點中提供該第二業務功能中第一交易功能的節點確定自身提供該第一交易功能,通過該第一交易功能對交易請求進行處理,或根據處理結果對交易請求進行處理獲取處理結果。將該第一交易功能獲取的處理結果通過共識機制共識到各節點。Step 408: Among the nodes, the node that provides the second business function determines that it provides the second business function, and among the nodes that provide the first transaction function in the second business function, it determines that it provides the first transaction function. A transaction function processes the transaction request, or processes the transaction request according to the processing result to obtain the processing result. The processing result obtained by the first transaction function is consensused to each node through a consensus mechanism.

此處,第二業務功能為在第一業務功能之後進行處理的業務功能。Here, the second business function is a business function that is processed after the first business function.

第一交易功能為:第二業務功能的處理該交易請求需要的多個交易功能中,未對該交易請求提供過的交易功能中排序最前的交易功能。The first transaction function is: among the plurality of transaction functions required by the second business function for processing the transaction request, the transaction function that has not been provided for the transaction request is the transaction function that ranks the highest.

其中,該第一交易功能根據處理結果對交易請求進行處理獲取處理結果對應的流程前提為:提供第一交易功能的節點獲取到在前的業務功能處理後獲取的處理結果,則基於該處理結果對交易請求進行處理。Wherein, the first transaction function processes the transaction request according to the processing result and obtains the processing result. Process transaction requests.

步驟409、各節點中提供該第二業務功能中第二交易功能的節點確定自身提供該第二交易功能,通過該第二交易功能,根據處理結果對交易請求進行處理獲取處理結果。將該第二交易功能獲取的處理結果通過共識機制共識到各節點。Step 409 , among the nodes, the node that provides the second transaction function in the second business function determines that it provides the second transaction function, and processes the transaction request according to the processing result to obtain the processing result through the second transaction function. The processing results obtained by the second transaction function are consensused to each node through a consensus mechanism.

此處,第二交易功能為在第一交易功能之後進行處理的交易功能。Here, the second transaction function is a transaction function processed after the first transaction function.

步驟410、直至處理該交易請求需要的多個業務功能均完成處理,獲取最後的處理結果。Step 410, until the multiple business functions required to process the transaction request are all processed, and the final processing result is obtained.

此處,在上述示例中,該最後的處理結果可以是在第二幣種對應的帳戶中完成存款。Here, in the above example, the final processing result may be that the deposit is completed in the account corresponding to the second currency.

步驟411、監控節點確定提供某一業務功能的節點發生異常,產生告警。Step 411, the monitoring node determines that a node providing a certain service function is abnormal, and generates an alarm.

步驟412、監控節點將該發生異常的節點隔離。Step 412, the monitoring node isolates the abnormal node.

步驟413、各節點根據節點資源資訊,基於共識機制對該業務功能進行爭奪,確定提供該業務功能的節點。Step 413, each node competes for the service function based on the node resource information based on the consensus mechanism, and determines the node that provides the service function.

步驟414、監控節點確定新增節點或修復後的該異常的節點,將該節點放入資源備用池。Step 414, the monitoring node determines the newly added node or the abnormal node after repair, and puts the node into the resource backup pool.

這裡需要說明的是。上述方法流程並不唯一,如,步驟411至步驟414的任一步驟或多個步驟可以在步驟404至步驟409的任一步驟前後執行。另外,交易也可以是業務系統自身運行產生的,則無需執行步驟404。步驟401可以在該流程步驟中的任一步驟前後執行。步驟402和步驟403可以只在業務系統更新等需要重新安裝的流程中執行。其中,步驟406至步驟409的方法流程只是一種示例,具體根據處理該交易請求所需的業務功能數量和業務功能中交易功能的數量確定。因此,上述方法流程不對基於聯盟鏈系統的業務處理方法做限制,可以根據具體需要調整。What needs to be explained here is. The above-mentioned method flow is not unique, for example, any step or multiple steps from step 411 to step 414 may be performed before and after any step from step 404 to step 409 . In addition, the transaction may also be generated by the operation of the business system itself, so step 404 does not need to be performed. Step 401 may be performed before or after any step in the process steps. Step 402 and step 403 may only be performed in processes requiring reinstallation such as business system update. Wherein, the method flow from step 406 to step 409 is just an example, which is specifically determined according to the number of business functions required to process the transaction request and the number of transaction functions in the business functions. Therefore, the above method flow does not limit the business processing method based on the consortium chain system, and can be adjusted according to specific needs.

基於相同的思路,本發明實施例提供了一種基於聯盟鏈系統的業務處理裝置,該聯盟鏈系統中包含多個節點,任一節點上均設置有業務系統,該業務系統提供多個業務功能,每個業務功能分別通過設定數量的節點提供,各節點基於共識機制通信,如圖5所示,包括: 確定模組501,用於針對任一交易,在確定該交易待執行的業務功能為自身可提供的第一交易功能時,通過處理模組502基於該第一交易功能處理該交易,得到第一處理結果,並基於共識機制將該第一處理結果共識到該聯盟鏈系統中的各節點; 該確定模組501,用於基於該第一處理結果,確定該交易待執行的業務功能為自身可提供的第二交易功能時,通過該處理模組502基於該第二交易功能處理該交易,得到第二處理結果,並基於共識機制將該第二處理結果共識到該聯盟鏈系統中的各節點,直至該交易中的最後一個交易功能的處理結果共識到該聯盟鏈系統中的各節點。 Based on the same idea, the embodiment of the present invention provides a business processing device based on the consortium chain system. The consortium chain system includes multiple nodes, and any node is equipped with a business system that provides multiple business functions. Each business function is provided by a set number of nodes, and each node communicates based on a consensus mechanism, as shown in Figure 5, including: The determination module 501 is used to process the transaction based on the first transaction function through the processing module 502 when it is determined that the business function to be executed by the transaction is the first transaction function that can be provided by itself, and obtain the first transaction function. Processing results, and consensus on the first processing results to each node in the alliance chain system based on the consensus mechanism; The determining module 501 is configured to determine, based on the first processing result, that the business function to be executed in the transaction is a second transaction function that can be provided by itself, and process the transaction based on the second transaction function through the processing module 502, Obtain the second processing result, and consensus the second processing result to each node in the alliance chain system based on the consensus mechanism, until the processing result of the last transaction function in the transaction is consensus to each node in the alliance chain system.

可選的,該確定模組501具體用於,針對待分配的業務功能中優先順序最高的業務功能,通過該處理模組502基於共識機制確定各節點的節點資源資訊中資源空閒最多的第三節點,並設置該第三節點用於提供該待分配的業務功能中優先順序最高的業務功能,直至該待分配的業務功能均分配完畢。Optionally, the determination module 501 is specifically used to determine, through the processing module 502, the third node with the most free resources in the node resource information of each node based on the consensus mechanism for the business function with the highest priority among the business functions to be allocated. node, and set the third node to provide the service function with the highest priority among the service functions to be allocated until the service functions to be allocated are all allocated.

可選的,該處理模組502具體用於,針對任一節點,該聯盟鏈系統根據該節點中各項資源的權重、各項資源的資源使用情況及各項資源的性能資訊,確定該節點的資源空閒狀況;該確定模組501具體用於,基於共識機制中將資源空閒狀況中資源空閒最多的節點,確定為第三節點。Optionally, the processing module 502 is specifically used to determine, for any node, the alliance chain system according to the weight of each resource in the node, the resource usage of each resource and the performance information of each resource to determine the The resource idle status; the determination module 501 is specifically used to determine the node with the most idle resources in the resource idle status based on the consensus mechanism as the third node.

可選的,該處理模組502還用於,基於自身可提供的監控功能,監控該各節點;若確定存在異常的節點,則產生告警。Optionally, the processing module 502 is also configured to monitor the nodes based on the monitoring functions it can provide; if it is determined that there is an abnormal node, an alarm is generated.

可選的,該處理模組502具體用於,將存在異常的節點進行隔離;該確定模組501具體用於,確定該聯盟鏈中具有該異常的節點所提供的業務功能的節點數量是否滿足設定要求;該確定模組501具體用於,若確定不滿足該設定要求時,通過該處理模組502在該聯盟鏈系統中觸發資源替代請求;該確定模組501具體用於,基於共識機制從該各節點中確定出用於替代該第四節點的第五節點。Optionally, the processing module 502 is specifically used to isolate abnormal nodes; the determination module 501 is specifically used to determine whether the number of nodes with the business functions provided by the abnormal node in the consortium chain satisfies Setting requirements; the determining module 501 is specifically used for triggering a resource replacement request in the consortium chain system through the processing module 502 if it is determined that the setting requirements are not met; the determining module 501 is specifically used for, based on a consensus mechanism A fifth node for replacing the fourth node is determined from the nodes.

可選的,具有監控功能的節點在該聯盟鏈系統中發送的第一指令與具有交易功能的節點在該聯盟鏈系統中發送的第二指令的優先順序不同,該第一指令的優先順序高於該第二指令的優先順序。Optionally, the priority order of the first instruction sent by the node with the monitoring function in the consortium chain system is different from that of the second instruction sent by the node with the transaction function in the consortium chain system, and the priority order of the first instruction is high on the priority order of the second instruction.

本領域內的具通常知識者應明白,本發明的實施例可提供為方法、系統、或電腦程式產品。因此,本發明可採用完全硬體實施例、完全軟體實施例、或結合軟體和硬體方面的實施例的形式。而且,本發明可採用在一個或多個其中包含有電腦可用程式碼的電腦可用存儲介質(包括但不限於磁碟記憶體、CD-ROM、光學記憶體等)上實施的電腦程式產品的形式。Those skilled in the art should understand that the embodiments of the present invention may be provided as methods, systems, or computer program products. Accordingly, the present invention can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) having computer-usable program code embodied therein .

本發明是參照根據本發明的方法、設備(系統)、和電腦程式產品的流程圖和/或方框圖來描述的。應理解可由電腦程式指令實現流程圖和/或方框圖中的每一流程和/或方框、以及流程圖和/或方框圖中的流程和/或方框的結合。可提供這些電腦程式指令到通用電腦、專用電腦、嵌入式處理機或其他可程式設計資料處理設備的處理器以產生一個機器,使得通過電腦或其他可程式設計資料處理設備的處理器執行的指令產生用於實現在流程圖一個流程或多個流程和/或方框圖一個方框或多個方框中指定的功能的裝置。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the invention. It should be understood that each process and/or block in the flowchart and/or block diagram, and a combination of processes and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing equipment to produce a machine so that the instructions executed by the processor of the computer or other programmable data processing equipment Produce means for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

這些電腦程式指令也可存儲在能引導電腦或其他可程式設計資料處理設備以特定方式工作的電腦可讀記憶體中,使得存儲在該電腦可讀記憶體中的指令產生包括指令裝置的製造品,該指令裝置實現在流程圖一個流程或多個流程和/或方框圖一個方框或多個方框中指定的功能。These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, such that the instructions stored in the computer readable memory produce an article of manufacture including the instruction means , the instruction device implements the functions specified in one or more procedures of the flow chart and/or one or more blocks of the block diagram.

這些電腦程式指令也可裝載到電腦或其他可程式設計資料處理設備上,使得在電腦或其他可程式設計設備上執行一系列操作步驟以產生電腦實現的處理,從而在電腦或其他可程式設計設備上執行的指令提供用於實現在流程圖一個流程或多個流程和/或方框圖一個方框或多個方框中指定的功能的步驟。These computer program instructions may also be loaded into a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce computer-implemented The instructions executed above provide steps for implementing the functions specified in the procedure or procedures of the flowchart and/or the block or blocks of the block diagram.

以上僅為本發明之較佳實施例,並非用來限定本發明之實施範圍,如果不脫離本發明之精神和範圍,對本發明進行修改或者等同替換,均應涵蓋在本發明申請專利範圍的保護範圍當中。The above are only preferred embodiments of the present invention, and are not used to limit the implementation scope of the present invention. If the present invention is modified or equivalently replaced without departing from the spirit and scope of the present invention, it shall be covered by the protection of the patent scope of the present invention. in the range.

101:節點 102:節點 103:節點 104:用戶端 105:管理用戶端 501:確定模組 502:處理模組 301-302:步驟 401-414:步驟 101: node 102: node 103: node 104: client 105: Manage client 501: Determine the module 502: processing module 301-302: Steps 401-414: Steps

圖1為本發明實施例提供的一種基於聯盟鏈系統的架構示意圖; 圖2為本發明實施例提供的一種基於聯盟鏈系統的業務系統的架構示意圖; 圖3為本發明實施例提供的一種基於聯盟鏈系統的業務處理方法的流程示意圖; 圖4為本發明實施例提供的一種基於聯盟鏈系統的業務處理方法的流程示意圖; 圖5為本發明實施例提供的一種基於聯盟鏈系統的業務處理裝置示意圖。 Figure 1 is a schematic diagram of an architecture based on an alliance chain system provided by an embodiment of the present invention; FIG. 2 is a schematic diagram of the architecture of a business system based on an alliance chain system provided by an embodiment of the present invention; FIG. 3 is a schematic flow diagram of a business processing method based on an alliance chain system provided by an embodiment of the present invention; FIG. 4 is a schematic flow diagram of a business processing method based on an alliance chain system provided by an embodiment of the present invention; Fig. 5 is a schematic diagram of a business processing device based on an alliance chain system provided by an embodiment of the present invention.

301-302:步驟 301-302: Steps

Claims (13)

一種基於聯盟鏈系統的業務處理方法,其特徵在於,該聯盟鏈系統中包含多個節點,任一節點上均設置有業務系統,該業務系統提供多個業務功能,每個業務功能分別通過設定數量的節點提供,各節點基於共識機制通信,該方法包括: 針對任一交易,該聯盟鏈系統中的第一節點在確定該交易待執行的業務功能為自身可提供的第一交易功能時,基於該第一交易功能處理該交易,得到第一處理結果,並基於共識機制將該第一處理結果共識到該聯盟鏈系統中的各節點; 該聯盟鏈系統中的第二節點基於該第一處理結果,確定該交易待執行的業務功能為自身可提供的第二交易功能時,基於該第二交易功能處理該交易,得到第二處理結果,並基於共識機制將該第二處理結果共識到該聯盟鏈系統中的各節點,直至該交易中的最後一個交易功能的處理結果共識到該聯盟鏈系統中的各節點。 A business processing method based on a consortium chain system, characterized in that the consortium chain system includes a plurality of nodes, any node is provided with a business system, and the business system provides multiple business functions, and each business function is set by setting The number of nodes is provided, and each node communicates based on a consensus mechanism. The method includes: For any transaction, when the first node in the alliance chain system determines that the business function to be executed by the transaction is the first transaction function it can provide, it processes the transaction based on the first transaction function and obtains the first processing result, And based on the consensus mechanism, the first processing result is consensused to each node in the alliance chain system; When the second node in the consortium chain system determines that the business function to be executed by the transaction is the second transaction function that it can provide based on the first processing result, it processes the transaction based on the second transaction function and obtains the second processing result , and consensus the second processing result to each node in the alliance chain system based on the consensus mechanism, until the processing result of the last transaction function in the transaction is consensus to each node in the alliance chain system. 如請求項1所述之基於聯盟鏈系統的業務處理方法,其特徵在於,該聯盟鏈系統中各節點可提供的業務功能通過如下方式確定,包括: 針對待分配的業務功能中優先順序最高的業務功能,該聯盟鏈系統基於共識機制確定各節點的節點資源資訊中資源空閒最多的第三節點,並設置該第三節點用於提供該待分配的業務功能中優先順序最高的業務功能,直至該待分配的業務功能均分配完畢。 The business processing method based on the consortium chain system as described in claim 1 is characterized in that the business functions that can be provided by each node in the consortium chain system are determined by the following methods, including: For the business function with the highest priority among the business functions to be allocated, the alliance chain system determines the third node with the most free resources in the node resource information of each node based on the consensus mechanism, and sets the third node to provide the to-be-allocated The business function with the highest priority among the business functions, until the business functions to be allocated are all allocated. 如請求項2所述之基於聯盟鏈系統的業務處理方法,其特徵在於,該聯盟鏈系統基於共識機制確定各節點的節點資源資訊中資源空閒最多的第三節點,包括: 針對任一節點,該聯盟鏈系統根據該節點中各項資源的權重、各項資源的資源使用情況及各項資源的性能資訊,確定該節點的資源空閒狀況; 該聯盟鏈系統基於共識機制中將資源空閒狀況中資源空閒最多的節點,確定為第三節點。 The business processing method based on the consortium chain system as described in claim 2 is characterized in that the consortium chain system determines the third node with the most free resources in the node resource information of each node based on the consensus mechanism, including: For any node, the alliance chain system determines the resource idle status of the node according to the weight of each resource in the node, the resource usage of each resource and the performance information of each resource; The alliance chain system determines the node with the most idle resources in the resource idle state as the third node based on the consensus mechanism. 如請求項1所述之基於聯盟鏈系統的業務處理方法,其特徵在於,該多個業務功能中包含監控功能,該方法還包括: 該聯盟鏈系統中的第四節點基於自身可提供的監控功能,監控該各節點;若確定存在異常的節點,則產生告警。 The business processing method based on the consortium chain system as described in claim 1, wherein the multiple business functions include monitoring functions, and the method also includes: The fourth node in the consortium chain system monitors each node based on the monitoring function it can provide; if it is determined that there is an abnormal node, an alarm is generated. 如請求項4所述之基於聯盟鏈系統的業務處理方法,其特徵在於,確定存在異常的節點之後,還包括: 該聯盟鏈系統中的第四節點將存在異常的節點進行隔離; 該聯盟鏈系統中的第四節點確定該聯盟鏈中具有該異常的節點所提供的業務功能的節點數量是否滿足設定要求; 該聯盟鏈系統中的第四節點若確定不滿足該設定要求時,在該聯盟鏈系統中觸發資源替代請求; 該聯盟鏈系統基於共識機制從該各節點中確定出用於替代該第四節點的第五節點。 The business processing method based on the consortium chain system as described in claim 4, is characterized in that after determining the abnormal node, it also includes: The fourth node in the consortium chain system isolates abnormal nodes; The fourth node in the consortium chain system determines whether the number of nodes in the consortium chain that have the business functions provided by the abnormal node meets the set requirements; If the fourth node in the consortium chain system determines that the set requirements are not met, a resource replacement request is triggered in the consortium chain system; The consortium chain system determines a fifth node to replace the fourth node from the nodes based on a consensus mechanism. 如請求項4所述之基於聯盟鏈系統的業務處理方法,其特徵在於,具有監控功能的節點在該聯盟鏈系統中發送的第一指令與具有交易功能的節點在該聯盟鏈系統中發送的第二指令的優先順序不同,該第一指令的優先順序高於該第二指令的優先順序。The business processing method based on the consortium chain system as described in claim 4, is characterized in that the first instruction sent by the node with monitoring function in the consortium chain system is the same as the first instruction sent by the node with transaction function in the consortium chain system The priority order of the second instruction is different, and the priority order of the first instruction is higher than the priority order of the second instruction. 一種聯盟鏈系統,其特徵在於,該聯盟鏈系統中包含多個節點,任一節點上均設置有業務系統,該業務系統提供多個業務功能,每個業務功能分別通過設定數量的節點提供,各節點基於共識機制通信;其中, 該聯盟鏈系統中具有交易功能的節點,用於在確定交易待執行的業務功能為自身可提供的交易功能時,處理該交易,得到處理結果,並基於共識機制將該處理結果共識到該聯盟鏈中的各節點;直至該交易中的最後一個交易功能的處理結果共識到該聯盟鏈中的各節點。 A consortium chain system, characterized in that the consortium chain system includes multiple nodes, any node is provided with a business system, the business system provides multiple business functions, and each business function is provided by a set number of nodes, Each node communicates based on a consensus mechanism; among them, The node with the transaction function in the alliance chain system is used to process the transaction when it is determined that the business function to be executed is the transaction function that it can provide, and obtain the processing result, and consensus the processing result to the alliance based on the consensus mechanism Each node in the chain; until the processing result of the last transaction function in the transaction is consensus to each node in the alliance chain. 如請求項7所述之聯盟鏈系統,其特徵在於,還包括: 該聯盟鏈系統中具有監控功能的節點,用於監控該聯盟鏈系統中的各節點,並在確定存在異常的節點時,產生告警。 The alliance chain system as described in claim 7 is characterized in that it also includes: The nodes with monitoring function in the consortium chain system are used to monitor each node in the consortium chain system, and generate an alarm when an abnormal node is determined. 如請求項8所述之聯盟鏈系統,其特徵在於,該具有監控功能的節點,用於存在異常的節點進行隔離;並在確定該聯盟鏈系統中具有該異常的節點所提供的業務功能的節點數量不滿足設定要求時,在該聯盟鏈中觸發資源替代請求;該資源替代請求用於從該聯盟鏈系統的各節點中確定出用於替代該異常的節點的節點。The alliance chain system as described in claim item 8 is characterized in that the node with monitoring function is used to isolate the abnormal node; and after determining the business function provided by the abnormal node in the alliance chain system When the number of nodes does not meet the set requirements, a resource replacement request is triggered in the consortium chain; the resource replacement request is used to determine a node to replace the abnormal node from among the nodes in the consortium chain system. 如請求項8所述之聯盟鏈系統,其特徵在於,具有監控功能的節點在該聯盟鏈中發送的第一指令與具有交易功能的節點在該聯盟鏈中發送的第二指令的優先順序不同,該第一指令的優先順序高於該第二指令的優先順序。The alliance chain system as described in claim item 8 is characterized in that the priority order of the first instruction sent by the node with monitoring function in the alliance chain is different from that of the second instruction sent by the node with transaction function in the alliance chain , the priority of the first instruction is higher than the priority of the second instruction. 一種基於聯盟鏈系統的業務處理裝置,其特徵在於,該聯盟鏈系統中包含多個節點,任一節點上均設置有業務系統,該業務系統提供多個業務功能,每個業務功能分別通過設定數量的節點提供,各節點基於共識機制通信,該裝置包括: 確定模組,用於針對任一交易,在確定該交易待執行的業務功能為自身可提供的第一交易功能時,通過處理模組基於該第一交易功能處理該交易,得到第一處理結果,並基於共識機制將該第一處理結果共識到該聯盟鏈系統中的各節點; 該確定模組,用於基於該第一處理結果,確定該交易待執行的業務功能為自身可提供的第二交易功能時,通過該處理模組基於該第二交易功能處理該交易,得到第二處理結果,並基於共識機制將該第二處理結果共識到該聯盟鏈系統中的各節點,直至該交易中的最後一個交易功能的處理結果共識到該聯盟鏈系統中的各節點。 A business processing device based on a consortium chain system, characterized in that the consortium chain system includes a plurality of nodes, any node is provided with a business system, and the business system provides multiple business functions, and each business function is set by setting The number of nodes is provided, and each node communicates based on a consensus mechanism. The device includes: The determination module is used to process the transaction based on the first transaction function through the processing module to obtain the first processing result when it is determined that the business function to be executed by the transaction is the first transaction function that can be provided by itself for any transaction , and based on the consensus mechanism, the first processing result is consensused to each node in the alliance chain system; The determination module is used to determine that the business function to be executed in the transaction is the second transaction function that it can provide based on the first processing result, and process the transaction based on the second transaction function through the processing module to obtain the second transaction function. 2. Process the result, and consensus the second processing result to each node in the alliance chain system based on the consensus mechanism, until the processing result of the last transaction function in the transaction is consensus to each node in the alliance chain system. 一種電腦可讀存儲介質,其特徵在於,該電腦可讀存儲介質存儲有程式,當該程式在電腦上運行時,使得電腦實現執行如請求項1至6中任一項所述之基於聯盟鏈系統的業務處理方法。A computer-readable storage medium, characterized in that the computer-readable storage medium stores a program, and when the program is run on the computer, the computer can implement the consortium chain-based Systematic business processing methods. 一種電腦設備,其特徵在於,包括: 記憶體,用於存儲電腦程式; 處理器,用於調用該記憶體中存儲的電腦程式,按照獲得的程式執行如請求項1至6中任一項所述之基於聯盟鏈系統的業務處理方法。 A computer device, characterized in that it includes: memory, used to store computer programs; The processor is used to call the computer program stored in the memory, and execute the business processing method based on the consortium chain system as described in any one of claims 1 to 6 according to the obtained program.
TW111135464A 2021-11-09 2022-09-20 A business processing method and device based on alliance chain system TWI808890B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111317419.6 2021-11-09
CN202111317419.6A CN114090376A (en) 2021-11-09 2021-11-09 Service processing method and device based on alliance chain system

Publications (2)

Publication Number Publication Date
TW202320528A true TW202320528A (en) 2023-05-16
TWI808890B TWI808890B (en) 2023-07-11

Family

ID=80299402

Family Applications (1)

Application Number Title Priority Date Filing Date
TW111135464A TWI808890B (en) 2021-11-09 2022-09-20 A business processing method and device based on alliance chain system

Country Status (3)

Country Link
CN (1) CN114090376A (en)
TW (1) TWI808890B (en)
WO (1) WO2023082798A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114090376A (en) * 2021-11-09 2022-02-25 中国银联股份有限公司 Service processing method and device based on alliance chain system
CN117591303B (en) * 2024-01-18 2024-05-07 腾讯科技(深圳)有限公司 Business processing method based on block chain, block chain system, medium and equipment

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190251199A1 (en) * 2018-02-14 2019-08-15 Ivan Klianev Transactions Across Blockchain Networks
SG11202103877SA (en) * 2018-10-19 2021-05-28 Digital Asset Switzerland Gmbh Privacy preserving validation and commit architecture
CN109981405B (en) * 2019-03-20 2021-04-23 上海和数软件有限公司 Node management method, node management device and computer-readable storage medium
CN110990182B (en) * 2019-12-03 2021-06-11 腾讯科技(深圳)有限公司 Transaction processing method, device, equipment and storage medium
CN112073269B (en) * 2020-09-14 2021-09-28 腾讯科技(深圳)有限公司 Block chain network testing method, device, server and storage medium
CN112769943A (en) * 2021-01-15 2021-05-07 河北蜂之巢互联网技术有限公司 Service processing method and device
CN113064764B (en) * 2021-04-19 2023-10-27 支付宝(杭州)信息技术有限公司 Method and apparatus for executing blocks in a blockchain system
CN113098982B (en) * 2021-06-02 2021-08-10 支付宝(杭州)信息技术有限公司 Block chain message transmission method and device
CN114090376A (en) * 2021-11-09 2022-02-25 中国银联股份有限公司 Service processing method and device based on alliance chain system

Also Published As

Publication number Publication date
TWI808890B (en) 2023-07-11
CN114090376A (en) 2022-02-25
WO2023082798A1 (en) 2023-05-19

Similar Documents

Publication Publication Date Title
TWI808890B (en) A business processing method and device based on alliance chain system
US11538003B2 (en) Sharded permissioned distributed ledgers
US11336465B2 (en) Sending cross-chain authenticatable messages
US11356282B2 (en) Sending cross-chain authenticatable messages
WO2020211579A1 (en) Processing method, device and system for distributed bulk processing system
US10832241B2 (en) Transaction reservation for block space on a blockchain
US11971877B2 (en) Method, apparatus, device, and storage medium for proposal message processing for blockchain
US11251966B2 (en) Sending cross-chain authenticatable messages
CN102346460B (en) Transaction-based service control system and method
CN109800160B (en) Cluster server fault testing method and related device in machine learning system
CN110838065A (en) Transaction data processing method and device
CN110569251A (en) Data processing method, related equipment and computer readable storage medium
CN104168333A (en) Working method of PROXZONE service platform
EP3306866B1 (en) Message processing method, device and system
CN111835790B (en) Risk identification method, device and system
CN111708627A (en) Task scheduling method and device based on distributed scheduling framework
WO2020024615A1 (en) Consensus process recovery method and related nodes
WO2020224100A1 (en) Blockchain configuration file processing apparatus, system, and method, and storage medium
CN109739640A (en) A kind of container resource management system based on Shen prestige framework
CN110908812A (en) Business data processing method and device, readable storage medium and computer equipment
CN111324425B (en) Data access method, device, equipment and storage medium
CN114422155B (en) Proposal consensus execution method, block chain system, device and storage medium
WO2022134809A1 (en) Model training processing method and apparatus, computer device, and medium
CN114780214A (en) Task processing method, device, system and equipment
US20230259930A1 (en) Cross-chain transaction processing method and apparatus, electronic device, and storage medium