TW202016807A - Event prediction method and device and electronic equipment - Google Patents

Event prediction method and device and electronic equipment Download PDF

Info

Publication number
TW202016807A
TW202016807A TW108109325A TW108109325A TW202016807A TW 202016807 A TW202016807 A TW 202016807A TW 108109325 A TW108109325 A TW 108109325A TW 108109325 A TW108109325 A TW 108109325A TW 202016807 A TW202016807 A TW 202016807A
Authority
TW
Taiwan
Prior art keywords
block
result
participant
blockchain
prediction
Prior art date
Application number
TW108109325A
Other languages
Chinese (zh)
Inventor
張文彬
馬寶利
劉正
宋旭陽
崔嘉輝
Original Assignee
香港商阿里巴巴集團服務有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 香港商阿里巴巴集團服務有限公司 filed Critical 香港商阿里巴巴集團服務有限公司
Publication of TW202016807A publication Critical patent/TW202016807A/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • 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

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Marketing (AREA)
  • Development Economics (AREA)
  • Human Resources & Organizations (AREA)
  • General Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Tourism & Hospitality (AREA)
  • Quality & Reliability (AREA)
  • Operations Research (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Game Theory and Decision Science (AREA)
  • Technology Law (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

One or more embodiments of the present specification provide an event prediction method and apparatus, and an electronic device, which are applied to a blockchain node. The method comprises the following steps: obtaining a prediction result determined by a participant for a specified event; Calling smart contracts, wherein the smart contract is used for releasing the prediction result to a first block of a block chain; determining an actual result of the specified event based on the block content of a second block in the block chain, so as to determine a prediction condition of the participant to the specified event according to a comparison result of the prediction result and the actual result; Wherein the block height of the second block is greater than the block height of the first block.

Description

事件預測方法及裝置、電子設備Event prediction method and device, electronic equipment

本說明書一個或多個實施例涉及區塊鏈技術領域,尤其涉及一種事件預測方法及裝置、電子設備。One or more embodiments of this specification relate to the field of blockchain technology, and in particular, to an event prediction method and device, and electronic equipment.

對於尚未完成的事件,往往需要等待該事件完成後,才能夠準確獲知該事件的結果。但是,一些場景下希望提前獲知事件的結果,比如基於該事件的結果來提前採取應對措施,再比如基於該事件的結果確定是否需要對關聯事件的處理方案進行調整等。 在相關技術中,可以通過多種方式對事件進行結果預測,比如根據歷史資料的預測分析,再比如通過樣本訓練出的預測模型進行預測分析等。由於使用的預測資料、採用的預測方式、所處的預測環境等存在差異,使得不同參與方在參與到針對同一事件的結果預測時,往往得到的預測結果也不盡相同,甚至存在較大偏差。For an event that has not been completed, it is often necessary to wait for the event to complete before it can accurately know the result of the event. However, in some scenarios, it is desirable to know the result of the event in advance, such as taking countermeasures in advance based on the result of the event, and then determining whether to adjust the processing scheme of the related event based on the result of the event. In the related art, the results of events can be predicted in various ways, such as predictive analysis based on historical data, and then predictive analysis based on a prediction model trained from samples. Due to the differences in the forecasting data used, the forecasting methods used, and the forecasting environment, etc., when different participants participate in the forecasting of the results of the same event, they often get different forecasting results, and even have large deviations. .

有鑑於此,本說明書一個或多個實施例提供一種事件預測方法及裝置、電子設備。 為實現上述目的,本說明書一個或多個實施例提供技術方案如下: 根據本說明書一個或多個實施例的第一方面,提出了一種事件預測方法,應用於區塊鏈節點;該方法包括: 獲取參與方針對指定事件確定的預測結果; 調用智慧型合約,該智慧型合約被用於將該預測結果發佈至區塊鏈的第一區塊,並基於區塊鏈中的第二區塊的區塊內容確定該指定事件的實際結果,以根據該預測結果與該實際結果的比較結果確定該參與方對該指定事件的預測情況;其中,該第二區塊的區塊高度大於該第一區塊的區塊高度。 根據本說明書一個或多個實施例的第二方面,提出了一種事件預測裝置,應用於區塊鏈節點;該裝置包括: 第一獲取單元,獲取參與方針對指定事件確定的預測結果; 調用單元,調用智慧型合約,該智慧型合約被用於將該預測結果發佈至區塊鏈的第一區塊,並基於區塊鏈中的第二區塊的區塊內容確定該指定事件的實際結果,以根據該預測結果與該實際結果的比較結果確定該參與方對該指定事件的預測情況;其中,該第二區塊的區塊高度大於該第一區塊的區塊高度。 根據本說明書一個或多個實施例的第三方面,提出了一種電子設備,包括: 處理器; 用於儲存處理器可執行指令的記憶體; 其中,該處理器通過運行該可執行指令以實現如上述實施例中任一所述的事件預測方法。In view of this, one or more embodiments of this specification provide an event prediction method and apparatus, and electronic equipment. To achieve the above purpose, one or more embodiments of this specification provide technical solutions as follows: According to a first aspect of one or more embodiments of this specification, an event prediction method is proposed, which is applied to blockchain nodes; the method includes: Obtain the prediction result determined by the participant for the specified event Invoke a smart contract, which is used to publish the prediction result to the first block of the blockchain, and determine the actual result of the specified event based on the block content of the second block in the blockchain, The prediction of the participant on the specified event is determined according to the comparison between the prediction result and the actual result; wherein the block height of the second block is greater than the block height of the first block. According to a second aspect of one or more embodiments of this specification, an event prediction device is proposed, which is applied to a blockchain node; the device includes: The first obtaining unit obtains the prediction result determined by the participant for the specified event; The calling unit invokes a smart contract, which is used to publish the prediction result to the first block of the blockchain and determine the specified event based on the block content of the second block in the blockchain The actual result is used to determine the participant's prediction of the specified event according to the comparison between the prediction result and the actual result; wherein the block height of the second block is greater than the block height of the first block. According to a third aspect of one or more embodiments of this specification, an electronic device is provided, including: processor; Memory for storing processor executable instructions; Wherein, the processor executes the executable instruction to implement the event prediction method as described in any one of the above embodiments.

這裡將詳細地對示例性實施例進行說明,其示例表示在圖式中。下面的描述涉及圖式時,除非另有表示,不同圖式中的相同數字表示相同或相似的要素。以下示例性實施例中所描述的實施方式並不代表與本說明書一個或多個實施例相一致的所有實施方式。相反,它們僅是與如所附申請專利範圍中所詳述的、本說明書一個或多個實施例的一些方面相一致的裝置和方法的例子。 需要說明的是:在其他實施例中並不一定按照本說明書示出和描述的順序來執行相應方法的步驟。在一些其他實施例中,其方法所包括的步驟可以比本說明書所描述的更多或更少。此外,本說明書中所描述的單個步驟,在其他實施例中可能被分解為多個步驟進行描述;而本說明書中所描述的多個步驟,在其他實施例中也可能被合併為單個步驟進行描述。 圖1是一示例性實施例提供的一種事件預測方法的流程圖。如圖1所示,該方法應用於區塊鏈節點,可以包括以下步驟: 步驟102,獲取參與方針對指定事件確定的預測結果。 在一實施例中,預測結果可以由參與方輸入,比如可以向參與方提供輸入介面,使得參與方可以基於該輸入介面而輸入預測結果,再比如可以採集參與方的輸入語音,從輸入語音中識別出參與方希望輸入的預測結果。其中,當參與方輸入預測結果時,應當確保該預測結果滿足預設格式,比如該預測結果可以為指定長度的字元串或其他格式,本說明書並不對此進行限制。 在一實施例中,區塊鏈節點可以在參與方的請求下,調用預設的用於生成預測結果的智慧型合約,使得該智慧型合約可以通過預定義的隨機演算法而自動生成預測結果。當然,參與方可以對智慧型合約自動生成的內容進行查看,從而將該內容確認為預測結果;或者,指示智慧型合約重新生成新的內容,直至參與方對生成的內容予以確認。 在一實施例中,一個或多個參與方可以對同一事件進行預測,使得區塊鏈上可以存在分別對應於各個參與方的預測結果;其中,每一參與方可以存在對應的唯一標識,使得每一參與方發佈的預測結果可以與其唯一標識進行關聯,以便於對區塊鏈上發佈的各個預測結果進行有效區分。 在一實施例中,指定事件為被指明確定需要進行結果預測的任意事件,比如某一路口的交通狀況、某一地區的水稻收成、某一海域的颱風形成時間等,本說明書並不對此進行限制。 步驟104,調用智慧型合約,該智慧型合約被用於將該預測結果發佈至區塊鏈的第一區塊,並基於區塊鏈中的第二區塊的區塊內容確定該指定事件的實際結果,以根據該預測結果與該實際結果的比較結果確定該參與方對該指定事件的預測情況;其中,該第二區塊的區塊高度大於該第一區塊的區塊高度。 在一實施例中,可以在區塊鏈的客戶端上創建交易(transfer),從而通過該交易將參與方輸入的預測結果發佈至區塊鏈上,成為區塊鏈的分布式資料庫中的一筆資料。 需要指出的是:區塊鏈中的交易,存在狹義的交易以及廣義的交易之分。狹義的交易是指用戶向區塊鏈發佈的一筆價值轉移;例如,在傳統的比特幣區塊鏈網路中,交易可以是用戶在區塊鏈中發起的一筆轉帳。而廣義的交易是指用戶向區塊鏈發佈的一筆具有業務意圖的業務資料;例如,運營方可以基於實際的業務需求搭建一個聯盟鏈,依託於聯盟鏈部署一些與價值轉移無關的其它類型的在線業務(比如,事件預測、租房業務、車輛調度業務、保險理賠業務、信用服務、醫療服務等),而在這類聯盟鏈中,交易可以是用戶在聯盟鏈中發佈的一筆具有業務意圖的業務消息或者業務請求。本說明書中的交易,應當傾向於理解為廣義上的交易。 在一實施例中,由於區塊鏈採用分布式資料庫,使得發佈至區塊鏈上的預測結果無法被竄改,可以確保預測結果真實、可靠。 在一實施例中,當預測結果被發佈至區塊鏈中的第一區塊,而實際結果來自區塊高度大於第一區塊的第二區塊時,基於區塊鏈中各個區塊之間的鏈式關係,使得預測結果的加入可以增加實際結果的不確定性,可以極大地降低不法分子操控實際結果的可能性。 在一實施例中,該智慧型合約用於在區塊鏈中產生第三區塊後,確定該實際結果;其中,該第三區塊的區塊高度大於該第二區塊,且高度差為預設數值。換言之,智慧型合約雖然基於第二區塊的區塊內容來確定實際結果,但是產生該第二區塊後並不立即確定實際結果,而是等待預設數量個區塊之後,才確定該實際結果,保證了第二區塊的安全性,使得攻擊者必須連續攻擊第二區塊與第三區塊之間的所有區塊,使得攻擊成本極高,可以極大地降低不法分子操控實際結果的可能性。 在一實施例中,區塊鏈節點可以獲取該參與方確定的與該預測結果相關聯的隨機性內容;其中,該智慧型合約還用於將該隨機性內容發佈至該第一區塊;或者,該智慧型合約還用於將該隨機性內容發佈至區塊鏈的第四區塊,且該第二區塊的區塊高度大於該第四區塊的區塊高度。通過增加隨機性內容,可以進一步強化對實際結果的隨機化影響,從而進一步降低不法分子操控實際結果的可能性。 在一實施例中,該實際結果還與區塊鏈中的一個或多個其他區塊的區塊內容相關,使得不法分子即便具備區塊攻擊能力,也必須分別攻擊第二區塊和該其他區塊才能夠達成目的,造成了極高的攻擊成本,可以極大地降低不法分子操控實際結果的可能性。 在一實施例中,上述的一個或多個其他區塊可以包括:包含至少一條針對該指定事件的預測結果的區塊,這樣可以使得所有預測結果均可以影響到實際結果,可以增加實際結果的不確定性。 在一實施例中,該智慧型合約用於通過下述公式對該第二區塊和m個其他區塊的區塊內容進行處理,以確定出該實際結果: H’1=H(Hn, Hm), H’i=H(H’(i-1), H(m-i+1)),其中1<i≤m; 其中,H為預設的哈希函數,Hn為與該第二區塊的區塊內容相關的哈希值,Hi為與第i個其他區塊的區塊內容相關的哈希值,該實際結果為H’m。 在一實施例中,在通過上述公式進行計算的過程中,m個其他區塊之間可以按照預設順序進行依次排列,形成第1個其他區塊、……、第m個其他區塊,比如該預設順序可以包括區塊高度從小至大的順序,本說明書並不對此進行限制。 在一實施例中,智慧型合約還可以用於:將H’m的字元數量壓縮為預設數量。比如,當哈希函數H生成的哈希值為256位、預設數量為8位時,可以將該256位的H’m壓縮為8位字元串,以作為本說明書中的實際結果。換言之,由於預先定義了實際結果的格式為“8位字元串”,因而需要按照該格式來生成實際結果;類似地,參與方所確定的預測結果也應當符合該“8位字元串”的格式。 在一實施例中,區塊鏈節點可以根據該參與方對該指定事件的預測情況,將第一資產憑證分配至該參與方。例如,區塊鏈節點可以調用用於分配資產憑證的智慧型合約,使得該智慧型合約運行後可以根據參與方的預測情況和針對資產憑證的分配規則,自動將第一資產憑證分配至參與方。由於智慧型合約上的處理邏輯為公開內容,並且整個處理過程由智慧型合約自動完成、不存在人工干預,使得無論是對預測結果和實際結果的比較還是對第一資產憑證的分配,都能夠確保客觀、公正。 在一實施例中,當預測結果與實際結果相匹配時,表明提供該預測結果的參與方對於上述指定事件的結果預測具有一定的準確度。那麼,通過向參與方分配第一資產憑證,可以控制各個參與方對於資產憑證的持有量,從而在一定程度上對於各個參與方實現標記作用:持有資產憑證越多的參與方對於事件結果的預測能力越強,因而在後續的事件預測過程中,能夠據此快速篩選出預測能力強的參與方,以從這些參與方處獲得可能相對更加準確的預測結果。 在一實施例中,第一資產憑證可以包括區塊鏈智慧型資產憑證。智慧型資產憑證用於表徵一定的權益,以實現對參與方準確預測上述指定事件的激勵,有助於該參與方繼續參與對後續事件的預測,從而實現良性循環。比如參與方在區塊鏈上實施預設操作時,譬如該預設操作可以包括發佈交易、發起共識(例如基於PBFT實用拜占庭容錯演算法而發起)等,可以通過向各個區塊鏈節點分配一定量的智慧型資產憑證,以促使該預設操作能夠儘快順利完成。再比如參與方可以通過在區塊鏈上扮演錨點(anchor)角色的區塊鏈節點,將持有的智慧型資產憑證兌換為等價的鏈外權益憑證。 在一實施例中,第一資產憑證可以包括鏈外權益憑證。鏈外權益憑證用於表徵一定的權益,以實現對參與方準確預測上述指定事件的激勵,有助於該參與方繼續參與對後續事件的預測,從而實現良性循環。比如參與方在區塊鏈上實施預設操作時,譬如該預設操作可以包括發佈交易、發起共識(例如基於PBFT實用拜占庭容錯演算法而發起)等,可以將鏈外權益憑證兌換為區塊鏈內等價的智慧型資產憑證、並通過向各個區塊鏈節點分配一定量的智慧型資產憑證,以促使該預設操作能夠儘快順利完成。其中,鏈外權益憑證可以包括用於表徵任意類型的鏈外權益的憑證,譬如在會員系統內的會員積分、在交易平台上的優惠券、兌換券、抵價券等,本說明書並不對此進行限制。 在一實施例中,該指定事件包括一個或多個子事件,該預測結果用於對該一個或多個子事件進行結果預測。例如,當預測結果、實際結果均為預設長度的字元串時,該字元串可以被劃分為若干組,每組包含一個或多個字元串、對應於上述的一個子事件。其中,該智慧型合約被用於在該預測結果對該一個或多個子事件的結果預測均正確的情況下,將該第一資產憑證分配至該參與方。換言之,當預測結果對指定事件的結果預測完全正確時,該預測結果被智慧型合約判定為匹配於該指定事件的實際結果;例如,當預測結果和實際結果均為“02-05-12-15-23-26”時,該指定事件包含6個子事件,可以判定為預測結果對指定事件的結果預測完全正確。 在一實施例中,該指定事件包括多個子事件;當該第一資產憑證被分配至該參與方時,該第一資產憑證所表徵的權益大小正相關於被該預測結果準確預測的子事件在該多個子事件中的占比。例如,當預測結果與實際結果完全相同時,即被該預測結果準確預測的子事件在該多個子事件中的占比為100%,第一資產憑證所表徵的權益大小可以為預設的最大值;當預測結果與實際結果完全不相同時,即被該預測結果準確預測的子事件在該多個子事件中的占比為0%,第一資產憑證所表徵的權益大小可以為預設的最小值(0或其他預設值)。例如,當預測結果和實際結果均為“02-05-12-15-23-26”時,可以判定被該預測結果準確預測的子事件在該多個子事件中的占比為100%;當預測結果為“02-06-13-15-20-26”、實際結果為“02-05-12-15-23-26”時,該指定事件包含6個子事件,可以判定被該預測結果準確預測的子事件在該多個子事件中的占比為50%。 在一實施例中,第一資產憑證所表徵的權益大小可以採用線性變化,例如占比為30%時,權益大小為預設最大值的30%,又例如占比為80%時,權益大小為預設最大值的80%等。在另一實施例中,第一資產憑證所表徵的權益大小可以採用非線性變化,例如占比為30%時,權益大小為預設最大值的10%,再例如占比為80%時,權益大小為預設最大值的50%,又例如占比為95%時,權益大小為預設最大值的80%等。 在一實施例中,該指定事件包括多個子事件,當預測結果與實際結果並非完全一致時,不論被該預測結果準確預測的子事件在該多個子事件中的占比為何,均可以判定為兩者不匹配,從而不向參與方分配資產憑證。 在一實施例中,區塊鏈節點可以確定該參與方持有的第二資產憑證被凍結,以作為用於擔保該預測結果的有效性的擔保憑證;其中,該智慧型合約用於在該預測結果不匹配於該實際結果的情況下解除該參與方對該擔保憑證的持有關係。通過將參與方持有的第二資產憑證凍結為擔保憑證,使得該擔保憑證被用於對參與方提供的預測結果進行擔保,可以對參與方設置一定的參與門檻,避免隨意參與而影響對上述指定事件的準確預測。 在一實施例中,當第二資產憑證表徵的權益越大時,表明參與方對自身提供的預測結果越自信,那麼當預測結果與實際結果相匹配時,在一定程度上表明參與方確實具備極強的預測能力,因而通過將該第一資產憑證所表徵的權益大小設定為與該第二資產憑證表徵的權益大小呈正相關,可以對相應的參與方的預測能力進行更為準確地標記,以及對相應參與方進行更大程度的激勵。 在一實施例中,即便參與方並未凍結形成擔保憑證,仍然可以參與對指定事件的結果預測,並在預測結果與實際結果相匹配的情況下獲得上述的第一資產憑證。在另一實施例中,當參與方並未凍結形成擔保憑證時,參與方輸入的預測結果被判定為無效,使其無法真正參與到對指定事件的結果預測;或者,在預測結果與實際結果相匹配的情況下,雖然可以向該參與方分配第一資產憑證,但是該第一資產憑證無法表徵任何權益相當於未分配任何資產憑證,使得該參與方的參與無意義。 圖2是一示例性實施例提供的一種預測事件結果的示意圖。如圖2所示,假定用戶A希望參與針對事件B的結果預測,該用戶A可以通過安裝有客戶端的手機21輸入預測結果。該預測結果可以由用戶A通過任意方式獲得,比如由用戶A通過圖2中未示出的伺服器對歷史資料進行大數據分析得到,又比如由用戶A根據自身經驗而得到,本說明書並不對此進行限制。類似地,用戶A還可以通過手機21輸入其他與預測相關的資訊。 設備22被配置為區塊鏈中的一個區塊鏈節點,該設備22可以接收手機21發送的預測結果;基於手機21運行的客戶端上的已登入帳號,該預測結果可以被確定為來自用戶A。當然,手機21也可以將上述的預測結果等資訊發送至區塊鏈中的其他區塊鏈節點,這些區塊鏈節點的處理過程與設備22類似,可以參考本說明書中對於設備22的相關描述。而其他用戶也可以對事件B進行結果預測,並通過自身使用的手機或其他電子設備將預測結果等資訊發送至設備22或其他區塊鏈節點處,這些用戶的處理過程與用戶A類似,可以參考本說明書中對於用戶A的相關描述。 設備22可以在區塊鏈中對用戶A輸入的預測結果等資訊進行共識,使得該預測結果等資訊在通過共識後被發佈至區塊鏈,以記錄至區塊鏈的分布式資料庫中,即“上鏈”。本說明書並不限定採用的共識演算法的類型;例如,當設備22所處的區塊鏈為聯盟鏈或公有鏈時,該設備22可以基於諸如PBFT(Practical Byzantine Fault Tolerance,實用拜占庭容錯)演算法向其他區塊鏈節點發起共識,並在通過共識後將該預測結果發佈至區塊鏈,使其被記錄至區塊鏈的分布式資料庫中;再例如,當設備22所處的區塊鏈為公有鏈時,該設備22可以與其他區塊鏈節點基於POW(Proof of Work,工作量證明)演算法、POS(Proof of Stake,股權證明)演算法或其他演算法競爭記帳權,並由獲得記帳權的區塊鏈節點向相應區塊內記入交易資料,而當包含用戶A輸入的預測結果等資訊的交易被記入時,該預測結果等資訊可以被記錄至區塊鏈的分布式資料庫中。 為了確定用戶A輸入的預測結果與實際結果是否相匹配,尤其是為了避免在處理過程中涉及到人為干預、確保準確度和有效性,可以預先在區塊鏈上創建智慧型合約,該智慧型合約中定義有用於確定預測結果與實際結果之間的匹配情況的功能邏輯,設備22可以通過調用該智慧型合約,使得該智慧型合約通過其功能邏輯自動實施下述操作:將預測結果等資訊發佈至區塊鏈上,確定事件B的實際結果,對預測結果與實際結果進行比較,分配資產憑證等。 在一實施例中,智慧型合約可以由區塊鏈上的交易或其他智慧型合約進行調用,以觸發其自動實施相關功能邏輯,譬如上述用於確定預測結果與實際結果之間的匹配情況的功能邏輯等。設備22可以通過在區塊鏈中發佈交易或調用其他智慧型合約,以實現對上述智慧型合約的調用;或者,可以由其他區塊鏈節點對上述智慧型合約進行調用,本說明書並不對此進行限制。在被調用後,上述的智慧型合約可以在設備22上運行,以自動實施上述的功能邏輯。 為了便於理解,下面結合彩券投注場景,對圖2所示實施例中提及的智慧型合約所實施的功能邏輯進行詳細描述。其中,圖3是一示例性實施例提供的一種智慧型合約實施的功能邏輯的流程圖。如圖3所示,該功能邏輯可以包括以下步驟: 步驟302,智慧型合約確定已提交的投注交易。 在一實施例中,手機21可以向用戶A提供彩券投注介面,使得用戶A可以通過該彩券投注介面選擇投注號碼,並由被選中的投注號碼組合形成用戶A投注的彩券號碼,即投注號碼。 在一實施例中,用戶A可以在彩券投注介面中設定投注金額。用戶A可以針對同一投注號碼支付一注或多注資金(每注資金的金額為預設的單注金額),以作為該投注號碼對應的投注金額。 在一實施例中,手機21可以為用戶A的投注行為生成一隨機數,該隨機數可以用於增加最終的開獎結果的隨機性,降低開獎結果被操控的可能性,提升彩券的公平性和公正性。針對用戶A的投注行為,手機21可以自動生成上述的隨機數,該過程可以對用戶A不可見;或者,彩券投注介面可以提供一隨機數生成選項,使得用戶A可以手動觸發生成該隨機數,並且可以向用戶A出示該隨機數;或者,用戶A可以手動輸入一隨機數,本說明書並不對此進行限制。 在一實施例中,在完成對上述投注號碼、投注金額和隨機數等的設定後,手機21可以創建相應的投注交易,並利用用戶A的私鑰對該投注交易進行簽名後,將該投注交易提交至區塊鏈中,使得區塊鏈節點可以針對該投注交易調用智慧型合約,而該智慧型合約可以基於如圖3所示的功能邏輯完成後續的處理過程。 步驟304,智慧型合約驗證交易合法性。 在一實施例中,智慧型合約可以針對投注交易的合法性進行驗證,比如簽名是否符合要求、投注號碼是否符合預設格式、用戶A的區塊鏈帳戶是否足夠支付該投注金額等。當通過驗證後,可以轉入步驟306,否則智慧型合約可以忽略當前的投注交易。 步驟306,智慧型合約觸發轉移投注資金。 在一實施例中,智慧型合約可以從用戶A的區塊鏈帳戶向預設的彩券帳戶進行投注資金的轉移,且轉移金額為上述的投注金額。不論用戶A對應的投注號碼是否中獎,被轉移的投注資金都不會返還給用戶A,這些投注資金被作為用戶A對彩券開獎過程的參與條件。 步驟308,智慧型合約在區塊鏈帳本中記錄投注資訊和資金轉移資訊。 在一實施例中,區塊鏈中的各個區塊鏈節點處分別維護有內容統一的區塊鏈帳本,智慧型合約可以將投注交易中記錄的投注資訊(如投注人、投注號碼、投注金額、投注時間戳等)和步驟306中轉移投注資金所產生的資金轉移資訊在區塊鏈中進行發佈,以記錄至區塊鏈帳本中。 步驟310,智慧型合約確定區塊鏈中是否已產生高度為N的區塊;若已產生,則轉入步驟312。 步驟312,智慧型合約確定區塊鏈中是否已產生高度為N+M的區塊;若已產生,則轉入步驟314。 在一實施例中,N和M均為預定義的任意正整數。對於N而言,應當確保該高度N大於其他參與本次彩券開獎的投注號碼所在的區塊鏈節點;比如用戶A的投注號碼(包含於上述的投注資訊中)可以位於區塊鏈中高度為K的區塊中,且應當確保N>K。換言之,對於所處區塊的高度大於N的投注號碼,都應當認為在本次彩券開獎過程中無效。當然,並非所有區塊高度小於N的區塊中,包含的投注號碼都有效,因而可以對能夠參與本次彩券開獎的區塊高度進行限定,比如對於高度屬於[T0,T1]、其中T0<N<T1的區塊,其中包含的投注號碼被認為可以參與本次彩券開獎,而其他高度過大或過小的區塊均無法參與。 其中,M可以為預定義的任意正整數;當然,可以針對M的取值進行限制,比如限制為T1<N<N+M<T2。基於下述步驟314中對開獎結果的計算過程,可以獲知開獎結果可以與高度為N~N+M的區塊均相關,使得不法分子需要連續攻擊N~N+M的所有區塊,才有可能操控開獎結果,從而造成極大的攻擊成本,使得開獎結果被操控的可能性極低,有助於保證開獎結果的公平有效。 步驟314,智慧型合約計算開獎結果。 在一實施例中,智慧型合約可以分別確定出高度為N的區塊,以及區塊鏈中包含與本次彩券開獎相關的投注號碼(比如投注號碼所在區塊的高度屬於[T0,T1]這一範圍)的m個區塊,並分別獲取這些區塊的哈希值(哈希值與對應區塊的區塊內容相關),比如:高度為N的區塊對應於哈希值Hn,而m個區塊對應的哈希值分別為H1~Hm(譬如可以按照區塊高度從小至大的順序進行排列)。進一步的,智慧型合約可以按照下述公式進行計算: H’1=H(Hn, Hm), H’i=H(H’(i-1), H(m-i+1)),其中1<i≤m; 其中,H為預設的哈希函數,H(Hn, Hm)表示通過該哈希函數H對Hn和Hm進行哈希運算、得到相應的哈希值為H’1;類似地,H(H’(i-1), H(m-i+1))表示通過該哈希函數H對H’(i-1)和H(m-i+1)進行哈希運算、得到相應的哈希值為H’i。最終,可以計算得到計算結果為H’m。 在一實施例中,計算結果H’m的字元長度可能大於實際所需的長度,因而智慧型合約可以通過預定義的壓縮函數C對該計算結果H’m進行壓縮,得到最終的開獎結果為C(H’m)。例如,該壓縮函數C可以用於選取H’m開頭、結尾或中間位置處的若干字元,當然本說明書並不對此進行限制。 步驟316,智慧型合約在區塊鏈帳本中記錄開獎結果。 在一實施例中,與步驟308相類似的,智慧型合約可以在區塊鏈中對開獎結果進行發佈,使得開獎結果被記錄至區塊鏈節點維護的區塊鏈帳本中。 步驟318,智慧型合約根據投注資訊和開獎結果,確定中獎用戶和獎金。 在一實施例中,智慧型合約可以從區塊鏈帳本中分別讀取各個用戶對應的投注資訊,並將其與開獎結果進行比較,以確定各個用戶的中獎情況。例如,智慧型合約可以讀取用戶A對應的投注資訊,該投注資訊中包含用戶A設定的投注號碼,那麼根據該投注號碼與作為開獎結果的字元串之間的匹配情況,以及預定義的中獎規則,智慧型合約可以確定該用戶A是否中獎;如果用戶A被確認為中獎,那麼智慧型合約可以根據中獎等級對應的單注獎金、用戶A為投注號碼支付的投注金額等,確定用戶A能夠獲得的獎金金額。 步驟320,智慧型合約發放獎金。 在一實施例中,以用戶A為例,智慧型合約可以按照確定的獎金金額,自動從預定義的獎金發放帳戶向用戶A的區塊鏈帳戶進行轉帳,完成獎金發放操作;類似地,智慧型合約可以自動完成所有獎金發放操作。由於獎金發放過程由智慧型合約自動完成,不僅能夠簡化用戶操作、提升發放效率,而且具有極高的安全性。 圖4是一示例性實施例提供的一種設備的示意結構圖。請參考圖4,在硬體層面,該設備包括處理器402、內部匯流排404、網路介面406、內部記憶體408以及非揮發性記憶體410,當然還可能包括其他業務所需要的硬體。處理器402從非揮發性記憶體410中讀取對應的電腦程式到內部記憶體408中然後運行,在邏輯層面上形成事件預測裝置。當然,除了軟體實現方式之外,本說明書一個或多個實施例並不排除其他實現方式,比如邏輯元件抑或軟硬體結合的方式等等,也就是說以下處理流程的執行主體並不限定於各個邏輯單元,也可以是硬體或邏輯元件。 請參考圖5,在軟體實施方式中,該事件預測裝置應用於區塊鏈節點;該裝置可以包括: 第一獲取單元51,獲取參與方針對指定事件確定的預測結果; 調用單元52,調用智慧型合約,該智慧型合約被用於將該預測結果發佈至區塊鏈的第一區塊,並基於區塊鏈中的第二區塊的區塊內容確定該指定事件的實際結果,以根據該預測結果與該實際結果的比較結果確定該參與方對該指定事件的預測情況;其中,該第二區塊的區塊高度大於該第一區塊的區塊高度。 可選的,該智慧型合約用於在區塊鏈中產生第三區塊後,確定該實際結果;其中,該第三區塊的區塊高度大於該第二區塊,且高度差為預設數值。 可選的,還包括: 第二獲取單元53,獲取該參與方確定的與該預測結果相關聯的隨機性內容; 其中,該智慧型合約還用於將該隨機性內容發佈至該第一區塊;或者,該智慧型合約還用於將該隨機性內容發佈至區塊鏈的第四區塊,且該第二區塊的區塊高度大於該第四區塊的區塊高度。 可選的,該實際結果還與區塊鏈中的一個或多個其他區塊的區塊內容相關。 可選的,該一個或多個其他區塊包括:包含至少一條針對該指定事件的預測結果的區塊。 可選的,該智慧型合約用於通過下述公式對該第二區塊和m個其他區塊的區塊內容進行處理,以確定出該實際結果: H’1=H(Hn, Hm), H’i=H(H’(i-1), H(m-i+1)),其中1<i≤m; 其中,H為預設的哈希函數,Hn為與該第二區塊的區塊內容相關的哈希值,Hi為與第i個其他區塊的區塊內容相關的哈希值,該實際結果為H’m。 可選的,該智慧型合約還用於:將H’m的字元數量壓縮為預設數量。 可選的,該預測結果由該參與方輸入,或者由用於生成預測結果的智慧型合約通過預定義的隨機演算法而自動生成。 可選的,還包括: 分配單元54,根據該參與方對該指定事件的預測情況,將第一資產憑證分配至該參與方。 可選的,該第一資產憑證包括:區塊鏈智慧型資產憑證或者鏈外權益憑證。 可選的,還包括: 確定單元55,確定該參與方持有的第二資產憑證被凍結,以作為用於擔保該預測結果的有效性的擔保憑證; 其中,該智慧型合約用於在該預測結果不匹配於該實際結果的情況下解除該參與方對該擔保憑證的持有關係。 可選的,該第一資產憑證所表徵的權益大小與該第二資產憑證表徵的權益大小呈正相關。 上述實施例闡明的系統、裝置、模組或單元,具體可以由電腦晶片或實體實現,或者由具有某種功能的產品來實現。一種典型的實現設備為電腦,電腦的具體形式可以是個人電腦、筆記型電腦、蜂巢式電話、相機電話、智慧型電話、個人數位助理、媒體播放器、導航設備、電子郵件收發設備、遊戲控制台、平板電腦、可穿戴設備或者這些設備中的任意幾種設備的組合。 在一個典型的配置中,電腦包括一個或多個處理器(CPU)、輸入/輸出介面、網路介面和內部記憶體。 內部記憶體可能包括電腦可讀介質中的非永久性記憶體,隨機存取記憶體(RAM)和/或非揮發性內部記憶體等形式,如唯讀記憶體(ROM)或快閃記憶體(flash RAM)。內部記憶體是電腦可讀介質的示例。 電腦可讀介質包括永久性和非永久性、可移動和非可移動媒體可以由任何方法或技術來實現資訊儲存。資訊可以是電腦可讀指令、資料結構、程式的模組或其他資料。電腦的儲存介質的例子包括,但不限於相變內部記憶體(PRAM)、靜態隨機存取記憶體(SRAM)、動態隨機存取記憶體(DRAM)、其他類型的隨機存取記憶體(RAM)、唯讀記憶體(ROM)、電可抹除可編程唯讀記憶體(EEPROM)、快閃記憶體或其他內部記憶體技術、唯讀光碟唯讀記憶體(CD-ROM)、數位多功能光碟(DVD)或其他光學儲存、磁盒式磁帶、磁碟儲存、量子記憶體、基於石墨烯的儲存介質或其他磁性儲存設備或任何其他非傳輸介質,可用於儲存可以被計算設備存取的資訊。按照本文中的界定,電腦可讀介質不包括暫存電腦可讀媒體(transitory media),如調變的資料信號和載波。 還需要說明的是,術語“包括”、“包含”或者其任何其他變體意在涵蓋非排他性的包含,從而使得包括一系列要素的過程、方法、商品或者設備不僅包括那些要素,而且還包括沒有明確列出的其他要素,或者是還包括為這種過程、方法、商品或者設備所固有的要素。在沒有更多限制的情況下,由語句“包括一個……”限定的要素,並不排除在包括所述要素的過程、方法、商品或者設備中還存在另外的相同要素。 上述對本說明書特定實施例進行了描述。其它實施例在所附申請專利範圍的範圍內。在一些情況下,在申請專利範圍中記載的動作或步驟可以按照不同於實施例中的順序來執行並且仍然可以實現期望的結果。另外,在圖式中描繪的過程不一定要求示出的特定順序或者連續順序才能實現期望的結果。在某些實施方式中,多任務處理和並行處理也是可以的或者可能是有利的。 在本說明書一個或多個實施例使用的術語是僅僅出於描述特定實施例的目的,而非旨在限制本說明書一個或多個實施例。在本說明書一個或多個實施例和所附申請專利範圍中所使用的單數形式的“一種”、“所述”和“該”也旨在包括多數形式,除非上下文清楚地表示其他含義。還應當理解,本文中使用的術語“和/或”是指並包含一個或多個相關聯的列出項目的任何或所有可能組合。 應當理解,儘管在本說明書一個或多個實施例可能採用術語第一、第二、第三等來描述各種資訊,但這些資訊不應限於這些術語。這些術語僅用來將同一類型的資訊彼此區分開。例如,在不脫離本說明書一個或多個實施例範圍的情況下,第一資訊也可以被稱為第二資訊,類似地,第二資訊也可以被稱為第一資訊。取決於語境,如在此所使用的詞語“如果”可以被解釋成為“在……時”或“當……時”或“回應於確定”。 以上所述僅為本說明書一個或多個實施例的較佳實施例而已,並不用以限制本說明書一個或多個實施例,凡在本說明書一個或多個實施例的精神和原則之內,所做的任何修改、等同替換、改進等,均應包含在本說明書一個或多個實施例保護的範圍之內。Exemplary embodiments will be described in detail here, examples of which are shown in the drawings. When the following description refers to drawings, unless otherwise indicated, the same numerals in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Rather, they are merely examples of devices and methods that are consistent with some aspects of one or more embodiments of this specification, as detailed in the appended patent application. It should be noted that in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the method may include more or fewer steps than described in this specification. In addition, the single step described in this specification may be decomposed into multiple steps for description in other embodiments; and the multiple steps described in this specification may also be combined into a single step in other embodiments. description. FIG. 1 is a flowchart of an event prediction method provided by an exemplary embodiment. As shown in Figure 1, this method is applied to blockchain nodes and can include the following steps: Step 102: Obtain the prediction result determined by the participant for the specified event. In an embodiment, the prediction result can be input by the participant, for example, an input interface can be provided to the participant, so that the participant can input the prediction result based on the input interface, and for example, the input voice of the participant can be collected from the input voice Identify the prediction results that the participant wishes to input. Among them, when the participant enters the prediction result, it should ensure that the prediction result meets a preset format, for example, the prediction result can be a character string of a specified length or other formats, which is not limited in this specification. In an embodiment, a blockchain node can call a preset smart contract for generating prediction results at the request of a participant, so that the smart contract can automatically generate prediction results through a predefined random algorithm . Of course, the participant can view the content automatically generated by the smart contract to confirm the content as a prediction result; or, instruct the smart contract to regenerate new content until the participant confirms the generated content. In an embodiment, one or more participants can predict the same event, so that there can be prediction results corresponding to each participant on the blockchain; wherein, each participant can have a corresponding unique identifier, so that The prediction results issued by each participant can be associated with its unique identifier, so as to effectively distinguish the prediction results released on the blockchain. In one embodiment, the designated event is any event that is indicated to determine the need to predict the outcome, such as the traffic condition of a certain intersection, the rice harvest in a certain area, the time of typhoon formation in a certain sea area, etc. limit. In step 104, a smart contract is invoked. The smart contract is used to publish the prediction result to the first block of the blockchain, and determine the specified event based on the block content of the second block in the blockchain The actual result is used to determine the participant's prediction of the specified event according to the comparison between the prediction result and the actual result; wherein the block height of the second block is greater than the block height of the first block. In one embodiment, a transaction can be created on the client of the blockchain, so that the predicted results input by the participants can be published to the blockchain through the transaction, becoming a distributed database in the blockchain A piece of information. It should be pointed out that there are transactions in the narrow sense and transactions in the broad sense in the blockchain. A narrowly defined transaction refers to a value transfer issued by the user to the blockchain; for example, in the traditional Bitcoin blockchain network, the transaction can be a transfer initiated by the user in the blockchain. The generalized transaction refers to a piece of business data released by the user to the blockchain with business intent; for example, the operator can build an alliance chain based on actual business needs, relying on the alliance chain to deploy some other types of irrelevant value transfer Online business (for example, event forecasting, rental business, vehicle scheduling business, insurance claims business, credit service, medical service, etc.), and in this type of alliance chain, the transaction can be a sum of business intent issued by the user in the alliance chain Business message or business request. The transactions in this manual should tend to be understood as transactions in a broad sense. In one embodiment, because the blockchain uses a distributed database, the prediction results published on the blockchain cannot be tampered with, which can ensure that the prediction results are true and reliable. In one embodiment, when the prediction result is released to the first block in the blockchain, and the actual result comes from the second block with a block height greater than the first block, based on the The chain relationship between them makes the addition of prediction results increase the uncertainty of actual results, and can greatly reduce the possibility that criminals manipulate the actual results. In one embodiment, the smart contract is used to determine the actual result after generating the third block in the blockchain; wherein the block height of the third block is greater than the second block, and the height difference It is the preset value. In other words, although the smart contract determines the actual result based on the content of the second block, the actual result is not determined immediately after the second block is generated, but the actual number is determined after waiting for a preset number of blocks As a result, the security of the second block is guaranteed, so that the attacker must continuously attack all the blocks between the second block and the third block, making the attack cost extremely high, which can greatly reduce the actual results of manipulation by the criminals possibility. In an embodiment, the blockchain node can obtain the random content determined by the participant associated with the prediction result; wherein, the smart contract is also used to publish the random content to the first block; Alternatively, the smart contract is also used to publish the random content to the fourth block of the blockchain, and the block height of the second block is greater than the block height of the fourth block. By increasing the content of randomness, the effect of randomization on the actual results can be further strengthened, thereby further reducing the possibility that criminals manipulate the actual results. In an embodiment, the actual result is also related to the block content of one or more other blocks in the blockchain, so that even if the criminal has the ability to block attack, he must attack the second block and the other block separately. Only blocks can achieve their goals, resulting in extremely high attack costs, which can greatly reduce the possibility of criminals manipulating the actual results. In an embodiment, the one or more other blocks described above may include: a block containing at least one prediction result for the specified event, so that all prediction results can affect the actual results, and the actual results can be increased. Uncertainty. In an embodiment, the smart contract is used to process the block content of the second block and m other blocks by the following formula to determine the actual result: H’1=H(Hn, Hm), H’i=H(H’(i-1), H(m-i+1)), where 1<i≤m; Where H is a preset hash function, Hn is a hash value related to the block content of the second block, Hi is a hash value related to the block content of the i-th other block, the actual The result is H'm. In an embodiment, during the calculation by the above formula, m other blocks may be sequentially arranged in a preset order to form the first other block, ..., the mth other block, For example, the preset order may include the order of the block height from small to large, which is not limited in this specification. In one embodiment, the smart contract can also be used to: compress the number of H’m characters to a preset number. For example, when the hash value generated by the hash function H is 256 bits and the preset number is 8 bits, the 256-bit H’m can be compressed into an 8-bit character string as the actual result in this specification. In other words, since the format of the actual result is defined as "8-bit character string" in advance, the actual result needs to be generated according to this format; similarly, the prediction result determined by the participant should also conform to the "8-bit character string" Format. In an embodiment, the blockchain node may allocate the first asset certificate to the participant according to the participant's prediction of the specified event. For example, a blockchain node can call a smart contract for distributing asset certificates, so that after the smart contract runs, it can automatically allocate the first asset certificate to the participants according to the participant's prediction and allocation rules for the asset certificate . Since the processing logic on the smart contract is public content, and the entire process is automatically completed by the smart contract, there is no manual intervention, so that whether it is the comparison of the predicted results and the actual results or the distribution of the first asset certificate, Ensure objectivity and fairness. In an embodiment, when the prediction result matches the actual result, it indicates that the party providing the prediction result has a certain accuracy in the prediction of the result of the specified event. Then, by assigning the first asset voucher to the participants, the amount of asset vouchers held by each participant can be controlled, so as to achieve a mark for each participant to a certain extent: the more participants holding asset vouchers, the event results The stronger the forecasting ability of, so in the subsequent event prediction process, it is possible to quickly screen out the participants with strong prediction ability to obtain relatively more accurate prediction results from these participants. In an embodiment, the first asset certificate may include a blockchain smart asset certificate. The smart asset certificate is used to characterize certain rights and interests to achieve the incentive for the participant to accurately predict the above-mentioned designated events, which helps the participant to continue to participate in the prediction of subsequent events, thereby achieving a virtuous circle. For example, when a participant implements a preset operation on the blockchain, for example, the preset operation may include publishing a transaction, initiating consensus (for example, initiated based on the PBFT practical Byzantine fault-tolerant algorithm), etc., by assigning a certain amount to each blockchain node Amount of smart asset certificates to enable the preset operation to be completed as quickly as possible. For another example, the participant can exchange the held smart asset certificate into an equivalent off-chain equity certificate through a blockchain node that plays an anchor role on the blockchain. In an embodiment, the first asset certificate may include an off-chain equity certificate. The off-chain equity certificate is used to characterize certain rights and interests, so as to realize the incentive for the participant to accurately predict the above-mentioned designated events, which helps the participant continue to participate in the prediction of subsequent events, thereby achieving a virtuous circle. For example, when the participant implements a preset operation on the blockchain, for example, the preset operation may include issuing a transaction, initiating consensus (for example, based on the PBFT practical Byzantine fault-tolerant algorithm), etc., and can convert the off-chain equity certificate into a block Equivalent smart asset certificates in the chain, and by assigning a certain amount of smart asset certificates to each blockchain node, this preset operation can be successfully completed as soon as possible. Among them, the off-chain equity certificate may include a certificate used to characterize any type of off-chain equity, such as member points in the member system, coupons on the trading platform, exchange coupons, coupons, etc. Limit it. In an embodiment, the specified event includes one or more sub-events, and the prediction result is used to predict the result of the one or more sub-events. For example, when both the predicted result and the actual result are character strings of a preset length, the character string may be divided into several groups, each group containing one or more character strings, corresponding to the above one sub-event. Wherein, the smart contract is used to allocate the first asset certificate to the participant if the prediction result is correct for the prediction of the result of the one or more sub-events. In other words, when the prediction result predicts the result of the specified event completely, the prediction result is determined by the smart contract to match the actual result of the specified event; for example, when both the predicted result and the actual result are "02-05-12- When 15-23-26", the specified event contains 6 sub-events, and it can be determined that the prediction result predicts the result of the specified event completely correctly. In one embodiment, the designated event includes multiple sub-events; when the first asset voucher is allocated to the participant, the size of the equity represented by the first asset voucher is positively related to the sub-event accurately predicted by the prediction result Proportion in the multiple sub-events. For example, when the prediction result is exactly the same as the actual result, that is, the proportion of sub-events accurately predicted by the prediction result in the plurality of sub-events is 100%, the size of the equity represented by the first asset certificate may be the preset maximum Value; when the prediction result is completely different from the actual result, that is, the proportion of sub-events accurately predicted by the prediction result in the plurality of sub-events is 0%, the size of the equity represented by the first asset certificate can be the preset The minimum value (0 or other preset value). For example, when both the prediction result and the actual result are "02-05-12-15-23-26", it can be determined that the proportion of sub-events accurately predicted by the prediction result in the plurality of sub-events is 100%; When the prediction result is "02-06-13-15-20-26" and the actual result is "02-05-12-15-23-26", the specified event contains 6 sub-events, and it can be determined that the prediction result is accurate The predicted sub-events account for 50% of the multiple sub-events. In an embodiment, the size of the equity represented by the first asset certificate may adopt a linear change, for example, when the proportion is 30%, the equity size is 30% of the preset maximum value, and for example, when the proportion is 80%, the equity size It is 80% of the preset maximum, etc. In another embodiment, the size of the equity represented by the first asset certificate may adopt a non-linear change, for example, when the ratio is 30%, the equity size is 10% of the preset maximum value, and for example, when the ratio is 80%, The equity size is 50% of the preset maximum value. For example, when the proportion is 95%, the equity size is 80% of the preset maximum value. In an embodiment, the designated event includes multiple sub-events. When the predicted result is not completely consistent with the actual result, no matter what the proportion of the sub-event accurately predicted by the predicted result in the multiple sub-events, it can be determined as The two do not match, so asset certificates are not distributed to the participants. In an embodiment, the blockchain node may determine that the second asset certificate held by the participant is frozen as a guarantee certificate for guaranteeing the validity of the prediction result; wherein, the smart contract is used in the If the predicted result does not match the actual result, the participant shall be released from holding the guarantee certificate. By freezing the second asset certificate held by the participant as a guarantee certificate, the guarantee certificate is used to guarantee the prediction results provided by the participant, and a certain threshold for participation can be set for the participant to avoid random participation and affect the above Specify accurate predictions of events. In an embodiment, when the equity represented by the second asset certificate is larger, it indicates that the participant is more confident in the prediction result provided by himself, then when the prediction result matches the actual result, it indicates to a certain extent that the participant really has Very strong predictive ability, so by setting the size of the equity represented by the first asset certificate to be positively correlated with the size of the equity represented by the second asset certificate, the prediction ability of the corresponding participants can be marked more accurately, And to provide a greater degree of incentives to the corresponding parties. In an embodiment, even if the participant does not freeze the formation of the guarantee certificate, he can still participate in the prediction of the result of the specified event and obtain the above-mentioned first asset certificate if the predicted result matches the actual result. In another embodiment, when the participant does not freeze to form the guarantee certificate, the prediction result entered by the participant is judged to be invalid, making it impossible to really participate in the prediction of the result of the specified event; or, between the prediction result and the actual result In the case of matching, although the first asset voucher can be allocated to the participant, the first asset voucher cannot represent any equity equivalent to no asset voucher being allocated, making the participation of the participant meaningless. FIG. 2 is a schematic diagram of a predicted event result provided by an exemplary embodiment. As shown in FIG. 2, assuming that user A wishes to participate in the prediction of the result for event B, the user A can input the prediction result through the mobile phone 21 with the client installed. This prediction result can be obtained by user A in any way, for example, user A performs big data analysis on historical data through a server not shown in FIG. 2, or for example, user A obtains it based on his own experience. This is restricted. Similarly, user A can also input other information related to the prediction through the mobile phone 21. The device 22 is configured as a blockchain node in the blockchain, and the device 22 can receive the prediction result sent by the mobile phone 21; based on the logged-in account on the client running the mobile phone 21, the prediction result can be determined as coming from the user A. Of course, the mobile phone 21 can also send the above prediction results and other information to other blockchain nodes in the blockchain. The processing process of these blockchain nodes is similar to that of the device 22. Please refer to the relevant description of the device 22 in this specification . Other users can also predict the results of Event B, and send the prediction results and other information to the device 22 or other blockchain nodes through their own mobile phones or other electronic devices. The processing process of these users is similar to that of User A. Refer to the relevant description of User A in this manual. Device 22 can agree on the prediction results and other information entered by user A in the blockchain, so that the prediction results and other information are released to the blockchain after passing the consensus to be recorded in the distributed database of the blockchain. That is "winding". This specification does not limit the type of consensus algorithm used; for example, when the blockchain where the device 22 is located is a consortium chain or a public chain, the device 22 may be based on calculations such as PBFT (Practical Byzantine Fault Tolerance). Law initiates consensus to other blockchain nodes, and publishes the prediction results to the blockchain after passing the consensus, so that it is recorded in the distributed database of the blockchain; for another example, when the device 22 is located in the area When the blockchain is a public chain, the device 22 can compete with other blockchain nodes based on the POW (Proof of Work, Proof of Work) algorithm, POS (Proof of Stake, Proof of Stake) algorithm, or other algorithms. The blockchain node that obtains the accounting right records transaction data into the corresponding block, and when the transaction containing the prediction result and other information entered by user A is recorded, the prediction result and other information can be recorded to the distribution of the blockchain Database. In order to determine whether the predicted result entered by User A matches the actual result, especially in order to avoid human intervention in the process and ensure accuracy and effectiveness, a smart contract can be created on the blockchain in advance. The contract defines functional logic for determining the match between the predicted result and the actual result. The device 22 can call the smart contract to make the smart contract automatically implement the following operations through its functional logic: the prediction result and other information Publish to the blockchain, determine the actual results of Event B, compare the predicted results with the actual results, allocate asset certificates, etc. In an embodiment, a smart contract can be invoked by a transaction on the blockchain or other smart contracts to trigger its automatic implementation of related functional logic, such as the above-mentioned method for determining the matching between the predicted result and the actual result Functional logic, etc. Device 22 can implement the above smart contract by issuing transactions or calling other smart contracts in the blockchain; or, other blockchain nodes can call the above smart contract, which is not covered in this specification. Limit it. After being called, the above-mentioned smart contract can be run on the device 22 to automatically implement the above-mentioned function logic. For ease of understanding, the functional logic implemented by the smart contract mentioned in the embodiment shown in FIG. 2 will be described in detail below in conjunction with the lottery ticket betting scenario. Among them, FIG. 3 is a flowchart of a functional logic implemented by a smart contract provided by an exemplary embodiment. As shown in FIG. 3, the functional logic may include the following steps: Step 302, the smart contract determines the submitted betting transaction. In an embodiment, the mobile phone 21 may provide a user with a lottery ticket betting interface, so that the user A can select a betting number through the lottery ticket betting interface, and the selected betting number combination forms a lottery ticket number for user A to bet, that is, a betting number . In one embodiment, user A can set the bet amount in the lottery betting interface. User A can pay one or more bets on the same betting number (the amount of each bet is the preset single bet amount) as the betting amount corresponding to the betting number. In an embodiment, the mobile phone 21 can generate a random number for the betting behavior of the user A, which can be used to increase the randomness of the final lottery result, reduce the possibility of manipulation of the lottery result, improve the fairness of the lottery and Impartiality. For the betting behavior of user A, the mobile phone 21 can automatically generate the above random number, which can be invisible to user A; or, the lottery ticket betting interface can provide a random number generation option so that user A can manually trigger the generation of the random number. And the random number can be presented to the user A; alternatively, the user A can manually input a random number, which is not limited in this specification. In one embodiment, after completing the setting of the above betting number, betting amount, random number, etc., the mobile phone 21 can create a corresponding betting transaction and sign the betting transaction using the private key of the user A, then the bet The transaction is submitted to the blockchain, so that the blockchain node can call a smart contract for the betting transaction, and the smart contract can complete the subsequent processing based on the functional logic shown in FIG. 3. Step 304, the smart contract verifies the legality of the transaction. In an embodiment, the smart contract can verify the legality of the betting transaction, such as whether the signature meets the requirements, whether the betting number conforms to the preset format, and whether the user A's blockchain account is sufficient to pay the bet amount. When the verification is passed, it can be transferred to step 306, otherwise the smart contract can ignore the current betting transaction. Step 306, the smart contract triggers the transfer of betting funds. In an embodiment, the smart contract may transfer betting funds from the user A's blockchain account to the preset lottery account, and the transfer amount is the aforementioned betting amount. Regardless of whether the betting number corresponding to user A wins, the transferred betting funds will not be returned to user A. These betting funds are used as the conditions for user A to participate in the lottery draw process. Step 308, the smart contract records betting information and fund transfer information in the blockchain ledger. In an embodiment, each blockchain node in the blockchain maintains a unified blockchain ledger, and the smart contract can record the betting information (such as bettor, bet number, bet) recorded in the betting transaction. Amount, bet timestamp, etc.) and the funds transfer information generated by transferring betting funds in step 306 are published in the blockchain to be recorded in the blockchain ledger. Step 310, the smart contract determines whether a block with a height of N has been generated in the blockchain; if it has been generated, it proceeds to step 312. In step 312, the smart contract determines whether a block with a height of N+M has been generated in the blockchain; if it has been generated, it proceeds to step 314. In an embodiment, both N and M are predefined positive integers. For N, you should ensure that the height N is greater than the blockchain node where other betting numbers participating in the lottery draw are located; for example, user A's betting number (contained in the above betting information) can be located in the blockchain with a height of In the block of K, it should be ensured that N>K. In other words, all bet numbers whose block height is greater than N should be considered invalid during the lottery draw process. Of course, not all blocks whose height is less than N contain valid betting numbers, so the height of the blocks that can participate in the lottery draw can be limited. For example, the height belongs to [T0, T1], where T0< The block with N<T1, which contains the betting number is considered to be able to participate in the lottery draw, while other blocks that are too large or too small cannot participate. Among them, M can be any predefined positive integer; of course, the value of M can be limited, for example, the limit is T1<N<N+M<T2. Based on the calculation process of the lottery result in the following step 314, it can be known that the lottery result can be related to the blocks with a height of N~N+M, so that the criminals need to continuously attack all blocks of N~N+M. It is possible to manipulate the lottery results, resulting in a huge attack cost, making the possibility of manipulation of the lottery results extremely low, which helps ensure the fairness and effectiveness of the lottery results. Step 314, the smart contract calculates the lottery result. In one embodiment, the smart contract can separately determine the block with a height of N, and the block chain contains the betting number related to the lottery draw (for example, the height of the block where the betting number is located belongs to [T0, T1] M blocks of this range) and obtain the hash values of these blocks (the hash value is related to the content of the corresponding block), for example: a block with a height of N corresponds to the hash value Hn, The hash values corresponding to the m blocks are H1~Hm (for example, they can be arranged in the order of block height from small to large). Further, the smart contract can be calculated according to the following formula: H’1=H(Hn, Hm), H’i=H(H’(i-1), H(m-i+1)), where 1<i≤m; Among them, H is a preset hash function, H(Hn, Hm) means that Hn and Hm are hashed by the hash function H, and the corresponding hash value is H'1; similarly, H(H '(i-1), H(m-i+1)) means that H'(i-1) and H(m-i+1) are hashed by the hash function H to obtain the corresponding hash The value is H'i. Finally, the calculation result can be calculated as H'm. In an embodiment, the character length of the calculation result H'm may be greater than the actual required length, so the smart contract can compress the calculation result H'm through a predefined compression function C to obtain the final lottery result It is C(H'm). For example, the compression function C can be used to select several characters at the beginning, end, or middle position of H’m, of course, this specification does not limit this. Step 316, the smart contract records the lottery result in the blockchain ledger. In an embodiment, similar to step 308, the smart contract can publish the lottery result in the blockchain, so that the lottery result is recorded in the blockchain ledger maintained by the blockchain node. In step 318, the smart contract determines the winning user and the bonus based on the betting information and the draw result. In one embodiment, the smart contract can read the betting information corresponding to each user from the blockchain ledger and compare it with the draw result to determine the winning situation of each user. For example, the smart contract can read the betting information corresponding to user A, and the betting information contains the betting number set by user A, then according to the match between the betting number and the character string as the result of the draw, and the predefined Winning rules, the smart contract can determine whether the user A wins; if the user A is confirmed as a winning, then the smart contract can determine the user A based on the single bet bonus corresponding to the winning level, the bet amount paid by the user A for the bet number, etc. The amount of bonuses that can be obtained. Step 320: The smart contract awards bonuses. In one embodiment, taking user A as an example, the smart contract can automatically transfer funds from the predefined bonus payment account to user A's blockchain account according to the determined bonus amount to complete the bonus payment operation; similarly, smart Type contract can automatically complete all bonus distribution operations. Since the bonus distribution process is automatically completed by smart contracts, it not only simplifies user operations and improves the efficiency of distribution, but also has extremely high security. FIG. 4 is a schematic structural diagram of a device provided by an exemplary embodiment. Please refer to FIG. 4. At the hardware level, the device includes a processor 402, an internal bus 404, a network interface 406, an internal memory 408, and a non-volatile memory 410. Of course, it may include hardware required by other businesses. . The processor 402 reads the corresponding computer program from the non-volatile memory 410 into the internal memory 408 and then runs it to form an event prediction device at a logical level. Of course, in addition to the software implementation, one or more embodiments of this specification does not exclude other implementations, such as logic elements or a combination of hardware and software, etc., that is to say, the execution body of the following processing flow is not limited to Each logic unit can also be a hardware or logic element. Please refer to FIG. 5, in the software implementation, the event prediction device is applied to the blockchain node; the device may include: The first obtaining unit 51 obtains the prediction result determined by the participant for the specified event; The calling unit 52 invokes a smart contract, which is used to publish the prediction result to the first block of the blockchain and determine the specified event based on the block content of the second block in the blockchain The actual result of is to determine the participant's prediction of the specified event according to the comparison between the prediction result and the actual result; wherein the block height of the second block is greater than the block height of the first block. Optionally, the smart contract is used to determine the actual result after generating the third block in the blockchain; wherein, the block height of the third block is greater than the second block, and the height difference is Set the value. Optional, also includes: The second obtaining unit 53 obtains the random content determined by the participant and associated with the prediction result; Among them, the smart contract is also used to publish the random content to the first block; or, the smart contract is also used to publish the random content to the fourth block of the blockchain, and the first The block height of the second block is greater than the block height of the fourth block. Optionally, the actual result is also related to the block content of one or more other blocks in the blockchain. Optionally, the one or more other blocks include: a block containing at least one prediction result for the specified event. Optionally, the smart contract is used to process the block content of the second block and m other blocks by the following formula to determine the actual result: H’1=H(Hn, Hm), H’i=H(H’(i-1), H(m-i+1)), where 1<i≤m; Where H is a preset hash function, Hn is a hash value related to the block content of the second block, Hi is a hash value related to the block content of the i-th other block, the actual The result is H'm. Optionally, the smart contract is also used to: compress the number of H’m characters to a preset number. Optionally, the prediction result is input by the participant, or is automatically generated by a smart contract used to generate the prediction result through a predefined random algorithm. Optional, also includes: The allocation unit 54 distributes the first asset voucher to the participant according to the participant's prediction of the specified event. Optionally, the first asset certificate includes: a blockchain smart asset certificate or an off-chain equity certificate. Optional, also includes: The determining unit 55 determines that the second asset certificate held by the participant is frozen as a guarantee certificate for guaranteeing the validity of the prediction result; Among them, the smart contract is used to release the participant's holding relationship to the guarantee certificate if the predicted result does not match the actual result. Optionally, the size of the equity represented by the first asset certificate is positively related to the size of the equity represented by the second asset certificate. The system, device, module or unit explained in the above embodiments may be implemented by a computer chip or entity, or by a product with a certain function. A typical implementation device is a computer, and the specific form of the computer may be a personal computer, a notebook computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email sending and receiving device, and a game control Desk, tablet, wearable device, or any combination of these devices. In a typical configuration, the computer includes one or more processors (CPUs), input/output interfaces, network interfaces, and internal memory. Internal memory may include non-permanent memory, random access memory (RAM) and/or non-volatile internal memory in computer-readable media, such as read-only memory (ROM) or flash memory (flash RAM). The internal memory is an example of a computer-readable medium. Computer-readable media, including permanent and non-permanent, removable and non-removable media, can store information by any method or technology. The information can be computer readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change internal memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), and other types of random access memory (RAM ), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other internal memory technology, read-only disc read-only memory (CD-ROM), multiple digits Functional Disc (DVD) or other optical storage, magnetic tape cassette, magnetic disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media, can be used for storage and can be accessed by computing devices Information. As defined in this article, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves. It should also be noted that the terms "include", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device that includes a series of elements includes not only those elements, but also includes Other elements not explicitly listed, or include elements inherent to this process, method, commodity, or equipment. Without more restrictions, the element defined by the sentence "include one..." does not exclude that there are other identical elements in the process, method, commodity, or equipment that includes the element. The foregoing describes specific embodiments of the present specification. Other embodiments are within the scope of the attached patent application. In some cases, the actions or steps described in the scope of the patent application may be performed in a different order than in the embodiment and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require the particular order shown or sequential order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous. The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only, and is not intended to limit one or more embodiments of this specification. The singular forms "a", "said" and "the" used in the scope of one or more embodiments of the present specification and the appended patent applications are also intended to include most forms unless the context clearly indicates other meanings. It should also be understood that the term "and/or" as used herein refers to and includes any or all possible combinations of one or more associated listed items. It should be understood that although one or more embodiments in this specification may use the terms first, second, third, etc. to describe various information, the information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information. Depending on the context, the word "if" as used herein can be interpreted as "when" or "when..." or "responsive to certainty". The above are only preferred embodiments of one or more embodiments of this specification, and are not intended to limit one or more embodiments of this specification. Anything within the spirit and principle of one or more embodiments of this specification, Any modifications, equivalent replacements, improvements, etc., should be included within the scope of protection of one or more embodiments of this specification.

102、104:步驟 21:手機 22:設備 302~320:步驟 402:處理器 404:內部匯流排 406:網路介面 408:內部記憶體 410:非揮發性記憶體 51:第一獲取單元 52:調用單元 53:第二獲取單元 54:分配單元 55:確定單元102, 104: steps 21: mobile phone 22: Equipment 302~320: steps 402: processor 404: Internal bus 406: Web interface 408: Internal memory 410: Non-volatile memory 51: First acquisition unit 52: call unit 53: Second acquisition unit 54: Distribution unit 55: Determine the unit

圖1是一示例性實施例提供的一種事件預測方法的流程圖。 圖2是一示例性實施例提供的一種預測事件結果的示意圖。 圖3是一示例性實施例提供的一種智慧型合約實施的功能邏輯的流程圖。 圖4是一示例性實施例提供的一種設備的結構示意圖。 圖5是一示例性實施例提供的一種事件預測裝置的方塊圖。FIG. 1 is a flowchart of an event prediction method provided by an exemplary embodiment. FIG. 2 is a schematic diagram of a predicted event result provided by an exemplary embodiment. FIG. 3 is a flowchart of functional logic implemented by a smart contract provided by an exemplary embodiment. 4 is a schematic structural diagram of an apparatus provided by an exemplary embodiment. FIG. 5 is a block diagram of an event prediction apparatus provided by an exemplary embodiment.

Claims (25)

一種事件預測方法,應用於區塊鏈節點;該方法包括: 獲取參與方針對指定事件確定的預測結果; 調用智慧型合約,該智慧型合約被用於將該預測結果發佈至區塊鏈的第一區塊,並基於區塊鏈中的第二區塊的區塊內容確定該指定事件的實際結果,以根據該預測結果與該實際結果的比較結果確定該參與方對該指定事件的預測情況;其中,該第二區塊的區塊高度大於該第一區塊的區塊高度。An event prediction method applied to blockchain nodes; the method includes: Obtain the prediction result determined by the participant for the specified event Invoke a smart contract, which is used to publish the prediction result to the first block of the blockchain, and determine the actual result of the specified event based on the block content of the second block in the blockchain, The prediction of the participant on the specified event is determined according to the comparison between the prediction result and the actual result; wherein the block height of the second block is greater than the block height of the first block. 根據請求項1所述的方法,該智慧型合約用於在區塊鏈中產生第三區塊後,確定該實際結果;其中,該第三區塊的區塊高度大於該第二區塊,且高度差為預設數值。According to the method described in claim 1, the smart contract is used to determine the actual result after generating the third block in the blockchain; wherein the block height of the third block is greater than the second block, And the height difference is the preset value. 根據請求項1所述的方法,還包括: 獲取該參與方確定的與該預測結果相關聯的隨機性內容; 其中,該智慧型合約還用於將該隨機性內容發佈至該第一區塊;或者,該智慧型合約還用於將該隨機性內容發佈至區塊鏈的第四區塊,且該第二區塊的區塊高度大於該第四區塊的區塊高度。The method according to claim 1, further comprising: Obtain the random content determined by the participant and associated with the prediction result; Among them, the smart contract is also used to publish the random content to the first block; or, the smart contract is also used to publish the random content to the fourth block of the blockchain, and the first The block height of the second block is greater than the block height of the fourth block. 根據請求項1所述的方法,該實際結果還與區塊鏈中的一個或多個其他區塊的區塊內容相關。According to the method described in claim 1, the actual result is also related to the block content of one or more other blocks in the blockchain. 根據請求項4所述的方法,該一個或多個其他區塊包括:包含至少一條針對該指定事件的預測結果的區塊。According to the method of claim 4, the one or more other blocks include: a block containing at least one prediction result for the specified event. 根據請求項4所述的方法,該智慧型合約用於通過下述公式對該第二區塊和m個其他區塊的區塊內容進行處理,以確定出該實際結果: H’1=H(Hn, Hm), H’i=H(H’(i-1), H(m-i+1)),其中1<i≤m; 其中,H為預設的哈希函數,Hn為與該第二區塊的區塊內容相關的哈希值,Hi為與第i個其他區塊的區塊內容相關的哈希值,該實際結果為H’m。According to the method described in claim 4, the smart contract is used to process the content of the second block and m other blocks by the following formula to determine the actual result: H’1=H(Hn, Hm), H’i=H(H’(i-1), H(m-i+1)), where 1<i≤m; Where H is a preset hash function, Hn is a hash value related to the block content of the second block, Hi is a hash value related to the block content of the i-th other block, the actual The result is H'm. 根據請求項6所述的方法,該智慧型合約還用於:將H’m的字元數量壓縮為預設數量。According to the method described in claim 6, the smart contract is also used to: compress the number of H’m characters to a preset number. 根據請求項1所述的方法,該預測結果由該參與方輸入,或者由用於生成預測結果的智慧型合約通過預定義的隨機演算法而自動生成。According to the method described in claim 1, the prediction result is input by the participant, or is automatically generated by a smart contract used to generate the prediction result through a predefined random algorithm. 根據請求項1所述的方法,還包括: 根據該參與方對該指定事件的預測情況,將第一資產憑證分配至該參與方。The method according to claim 1, further comprising: According to the participant's prediction of the specified event, the first asset certificate is distributed to the participant. 根據請求項9所述的方法,該第一資產憑證包括:區塊鏈智慧型資產憑證或者鏈外權益憑證。According to the method described in claim 9, the first asset certificate includes: a blockchain smart asset certificate or an off-chain equity certificate. 根據請求項9所述的方法,還包括: 確定該參與方持有的第二資產憑證被凍結,以作為用於擔保該預測結果的有效性的擔保憑證; 其中,該智慧型合約用於在該預測結果不匹配於該實際結果的情況下解除該參與方對該擔保憑證的持有關係。The method according to claim 9, further comprising: Confirm that the second asset certificate held by the participant is frozen as a guarantee certificate for guaranteeing the validity of the predicted result; Among them, the smart contract is used to release the participant's holding relationship to the guarantee certificate if the predicted result does not match the actual result. 根據請求項11所述的方法,該第一資產憑證所表徵的權益大小與該第二資產憑證表徵的權益大小呈正相關。According to the method of claim 11, the size of the equity represented by the first asset certificate is positively related to the size of the equity represented by the second asset certificate. 一種事件預測裝置,應用於區塊鏈節點;該裝置包括: 第一獲取單元,獲取參與方針對指定事件確定的預測結果; 調用單元,調用智慧型合約,該智慧型合約被用於將該預測結果發佈至區塊鏈的第一區塊,並基於區塊鏈中的第二區塊的區塊內容確定該指定事件的實際結果,以根據該預測結果與該實際結果的比較結果確定該參與方對該指定事件的預測情況;其中,該第二區塊的區塊高度大於該第一區塊的區塊高度。An event prediction device applied to blockchain nodes; the device includes: The first obtaining unit obtains the prediction result determined by the participant for the specified event; The calling unit invokes a smart contract, which is used to publish the prediction result to the first block of the blockchain and determine the specified event based on the block content of the second block in the blockchain The actual result is used to determine the participant's prediction of the specified event according to the comparison between the prediction result and the actual result; wherein the block height of the second block is greater than the block height of the first block. 根據請求項13所述的裝置,該智慧型合約用於在區塊鏈中產生第三區塊後,確定該實際結果;其中,該第三區塊的區塊高度大於該第二區塊,且高度差為預設數值。According to the device described in claim 13, the smart contract is used to determine the actual result after generating the third block in the blockchain; wherein the block height of the third block is greater than the second block, And the height difference is the preset value. 根據請求項13所述的裝置,還包括: 第二獲取單元,獲取該參與方確定的與該預測結果相關聯的隨機性內容; 其中,該智慧型合約還用於將該隨機性內容發佈至該第一區塊;或者,該智慧型合約還用於將該隨機性內容發佈至區塊鏈的第四區塊,且該第二區塊的區塊高度大於該第四區塊的區塊高度。The device according to claim 13, further comprising: The second obtaining unit obtains the random content determined by the participant and associated with the prediction result; Among them, the smart contract is also used to publish the random content to the first block; or, the smart contract is also used to publish the random content to the fourth block of the blockchain, and the first The block height of the second block is greater than the block height of the fourth block. 根據請求項13所述的裝置,該實際結果還與區塊鏈中的一個或多個其他區塊的區塊內容相關。According to the device of claim 13, the actual result is also related to the block content of one or more other blocks in the blockchain. 根據請求項16所述的裝置,該一個或多個其他區塊包括:包含至少一條針對該指定事件的預測結果的區塊。The device according to claim 16, the one or more other blocks include: a block containing at least one prediction result for the specified event. 根據請求項16所述的裝置,該智慧型合約用於通過下述公式對該第二區塊和m個其他區塊的區塊內容進行處理,以確定出該實際結果: H’1=H(Hn, Hm), H’i=H(H’(i-1), H(m-i+1)),其中1<i≤m; 其中,H為預設的哈希函數,Hn為與該第二區塊的區塊內容相關的哈希值,Hi為與第i個其他區塊的區塊內容相關的哈希值,該實際結果為H’m。According to the device described in claim 16, the smart contract is used to process the content of the second block and m other blocks by the following formula to determine the actual result: H’1=H(Hn, Hm), H’i=H(H’(i-1), H(m-i+1)), where 1<i≤m; Where H is a preset hash function, Hn is a hash value related to the block content of the second block, Hi is a hash value related to the block content of the i-th other block, the actual The result is H'm. 根據請求項18所述的裝置,該智慧型合約還用於:將H’m的字元數量壓縮為預設數量。According to the device described in claim 18, the smart contract is also used to compress the number of characters of H’m to a preset number. 根據請求項13所述的裝置,該預測結果由該參與方輸入,或者由用於生成預測結果的智慧型合約通過預定義的隨機演算法而自動生成。According to the apparatus of claim 13, the prediction result is input by the participant, or is automatically generated by a smart contract used to generate the prediction result through a predefined random algorithm. 根據請求項13所述的裝置,還包括: 分配單元,根據該參與方對該指定事件的預測情況,將第一資產憑證分配至該參與方。The device according to claim 13, further comprising: The allocation unit distributes the first asset voucher to the participant based on the participant's prediction of the specified event. 根據請求項21所述的裝置,該第一資產憑證包括:區塊鏈智慧型資產憑證或者鏈外權益憑證。According to the device of claim 21, the first asset certificate includes: a blockchain smart asset certificate or an off-chain equity certificate. 根據請求項21所述的裝置,還包括: 確定單元,確定該參與方持有的第二資產憑證被凍結,以作為用於擔保該預測結果的有效性的擔保憑證; 其中,該智慧型合約用於在該預測結果不匹配於該實際結果的情況下解除該參與方對該擔保憑證的持有關係。The device according to claim 21, further comprising: The determination unit determines that the second asset certificate held by the participant is frozen as a guarantee certificate for guaranteeing the validity of the prediction result; Among them, the smart contract is used to release the participant's holding relationship to the guarantee certificate if the predicted result does not match the actual result. 根據請求項23所述的裝置,該第一資產憑證所表徵的權益大小與該第二資產憑證表徵的權益大小呈正相關。According to the device of claim 23, the size of the equity represented by the first asset certificate is positively related to the size of the equity represented by the second asset certificate. 一種電子設備,包括: 處理器; 用於儲存處理器可執行指令的記憶體; 其中,該處理器通過運行該可執行指令以實現如請求項1~12項中任一項所述的方法。An electronic device, including: processor; Memory for storing processor executable instructions; Wherein, the processor executes the executable instruction to implement the method described in any one of the request items 1 to 12.
TW108109325A 2018-10-25 2019-03-19 Event prediction method and device and electronic equipment TW202016807A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811249436.9A CN109598365A (en) 2018-10-25 2018-10-25 Event prediction method and device, electronic equipment
CN201811249436.9 2018-10-25

Publications (1)

Publication Number Publication Date
TW202016807A true TW202016807A (en) 2020-05-01

Family

ID=65958236

Family Applications (1)

Application Number Title Priority Date Filing Date
TW108109325A TW202016807A (en) 2018-10-25 2019-03-19 Event prediction method and device and electronic equipment

Country Status (3)

Country Link
CN (1) CN109598365A (en)
TW (1) TW202016807A (en)
WO (1) WO2020082869A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109598365A (en) * 2018-10-25 2019-04-09 阿里巴巴集团控股有限公司 Event prediction method and device, electronic equipment
CN110633983A (en) * 2019-09-05 2019-12-31 腾讯科技(深圳)有限公司 Target event execution method and device based on block chain
CN110990490B (en) * 2019-12-19 2023-09-01 京东科技信息技术有限公司 Method, device, equipment and medium for checking in blockchain network

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008040635A (en) * 2006-08-03 2008-02-21 Chugoku Electric Power Co Inc:The Congestion prediction system
US20150046337A1 (en) * 2013-08-06 2015-02-12 Chin-hao Hu Offline virtual currency transaction
CN107038638A (en) * 2017-02-24 2017-08-11 杭州象链网络技术有限公司 A kind of equity registration transaction system construction method based on alliance's chain
CN108038954A (en) * 2017-12-01 2018-05-15 中国联合网络通信集团有限公司 Transaction operation method and digging ore deposit node based on block chain
CN108447014A (en) * 2018-03-19 2018-08-24 成都零光量子科技有限公司 A kind of block chain lottery industry method and system
CN108681950A (en) * 2018-06-11 2018-10-19 国网江苏省电力有限公司南通供电分公司 Power distribution network demand response transaction settlement method based on block chain technology
CN109598365A (en) * 2018-10-25 2019-04-09 阿里巴巴集团控股有限公司 Event prediction method and device, electronic equipment

Also Published As

Publication number Publication date
CN109598365A (en) 2019-04-09
WO2020082869A1 (en) 2020-04-30

Similar Documents

Publication Publication Date Title
US11669811B2 (en) Blockchain-based digital token utilization
WO2020019798A1 (en) Rights and interests distribution method and device and electronic device
WO2020082883A1 (en) Object selection method and device and electronic device
CN109242675B (en) Asset publishing method and device based on block chain and electronic equipment
US11107321B2 (en) Distributed ledger based gaming system
WO2020155789A1 (en) Blockchain-based certificate storage method and apparatus
TWI718472B (en) Event prediction method and device, electronic equipment
WO2020146955A1 (en) A method for generating random numbers in blockchain smart contracts
KR20200091882A (en) Incremental digital asset collateral wallet
WO2019127532A1 (en) Blockchain-based crowdfunding information processing method and device, storage medium and electronic device
US20200193764A1 (en) Instant games based on distributed ledger
WO2020082869A1 (en) Event prediction method and apparatus and electronic device
CN109117994B (en) Event prediction method and device and electronic equipment
WO2020220742A1 (en) Method and device for anchoring data on a block chain at a given time, and electronic device
US20200175588A1 (en) Blockchain-based payment
CN112801649B (en) Flow statistical system, method and device based on block chain
TW202008227A (en) Event prediction method and apparatus, and electronic device
TWI699728B (en) Block publishing method and device, and electronic equipment
CN112015822B (en) Block chain data deleting method and device
CN115456772A (en) Intelligent contract creating method and device
US20220123947A1 (en) A Method for Generating Random Numbers in Blockchain Smart Contracts
TWI706341B (en) Event prediction method and device, electronic equipment
CN113626881A (en) Object evaluation method and device, electronic equipment and storage medium
Husbands The Temporality of Determinacy I: Philosophy of Non-Physical Sciences
CN117522551A (en) Blockchain transaction management method, device, equipment, storage medium and program product