TWI722343B - Computer and central processing unit for mining of virtual currencies - Google Patents
Computer and central processing unit for mining of virtual currencies Download PDFInfo
- Publication number
- TWI722343B TWI722343B TW107143550A TW107143550A TWI722343B TW I722343 B TWI722343 B TW I722343B TW 107143550 A TW107143550 A TW 107143550A TW 107143550 A TW107143550 A TW 107143550A TW I722343 B TWI722343 B TW I722343B
- Authority
- TW
- Taiwan
- Prior art keywords
- logic circuit
- calculation logic
- auxiliary calculation
- computer
- mining
- Prior art date
Links
Images
Abstract
Description
本發明係關於計算機結構,特別係關於虛擬貨幣挖礦的計算機結構。 The present invention relates to a computer structure, and particularly relates to a computer structure of virtual currency mining.
比特幣與乙太幣之類的虛擬貨幣在近年內已經進入到現代人的生活當中,利用區塊鏈的共享的公共分類記帳方式達到交易。以比特幣為例,所有的交易會在用戶之間公布,並且在一段時間內由網路中通過挖礦的程式開始進行確認。而挖礦是一種分散式的共識系統,用於確認交易並且將交易加入區塊鏈之中。挖礦能夠確保區塊鏈的時間順序、保護網路的中立性,並且讓不同的電腦就系統的狀態取得共識。 Virtual currencies such as Bitcoin and Ethereum have entered the lives of modern people in recent years, using the shared public ledger accounting method of the blockchain to achieve transactions. Taking Bitcoin as an example, all transactions will be announced between users and confirmed by mining programs on the network within a period of time. Mining is a decentralized consensus system used to confirm transactions and add them to the blockchain. Mining can ensure the time sequence of the blockchain, protect the neutrality of the network, and allow different computers to reach a consensus on the state of the system.
挖礦故意被設計成非常耗費計算資源,以便確保挖礦者每天所找到的區塊是穩定的。各個區塊必須包含工作量証明,而工作量証明會在其他節點接收到區塊時,被其他節點進行驗證。而挖礦的主要目的,就是確保交易的歷史無法被任何單一節點進行修改。透過下載與驗證區塊鏈,節點能夠達到交易歷史事件順序的共識。挖礦同時也用於增加系統內的虛擬貨幣。當有任何新增的虛擬貨幣時,挖礦者會得到交易費作為分紅。上述這兩者能夠以分散的情況來發送新的虛擬貨幣,也能夠激勵人們為系統提供安全。 Mining is deliberately designed to consume computational resources very much in order to ensure that the blocks found by miners every day are stable. Each block must contain a proof of work, and the proof of work will be verified by other nodes when they receive the block. The main purpose of mining is to ensure that the transaction history cannot be modified by any single node. By downloading and verifying the blockchain, nodes can reach a consensus on the sequence of transaction history events. Mining is also used to increase the virtual currency in the system. When there is any new virtual currency, miners will get transaction fees as dividends. The above two can send new virtual currency in a decentralized situation, and can also motivate people to provide security for the system.
由於挖礦相當耗費計算資源,挖礦計算機的計算資源從通用的中央處理器,轉向繪圖用的圖形處理器。除此之外,還有特別為某一種虛擬貨幣的挖礦程式設計的現場可程式化邏輯閘陣列(FPGA)與特定應用積體電路(ASIC)。這些做法都是提高單一挖礦計算機針對單一虛擬貨幣的挖礦資源。 As mining consumes computing resources, the computing resources of mining computers have shifted from a general-purpose central processing unit to a graphics processor for drawing. In addition, there are field programmable logic gate arrays (FPGA) and application-specific integrated circuits (ASIC) specially designed for a certain type of virtual currency mining program. These methods are to improve the mining resources of a single mining computer for a single virtual currency.
然而,對於某些虛擬貨幣而言,由於新區塊的產出有限,競爭者眾,導致挖礦所得利益日漸減少。如果挖礦計算機只針對某一種虛擬貨幣進行挖礦,可能會不符合經濟效應。如果挖礦計算機能夠同時針對兩種或更多的虛擬貨幣同時進行挖礦,可以減少購置成本,增加挖礦的收入。 However, for some virtual currencies, due to the limited output of new blocks and a large number of competitors, the benefits of mining are gradually decreasing. If the mining computer only mines for a certain type of virtual currency, it may not conform to the economic effect. If the mining computer can simultaneously mine two or more virtual currencies at the same time, it can reduce purchase costs and increase mining revenue.
根據本發明一實施例,提供一種用於多種虛擬貨幣挖礦的計算機,包含:一網路介面,用於連接網路上的一第一伺服器與一第二伺服器;一第一輔助計算邏輯電路,用於執行第一挖礦演算法;一第二輔助計算邏輯電路,用於執行第二挖礦演算法;以及一中央處理器。該中央處理器包含:一第一通信介面,用於連接該第一輔助計算邏輯電路;一第二通信介面,用於連接該第二輔助計算邏輯電路;一網路通信埠,用於連接該網路介面;以及連接至上述的第一通信介面、第二通信介面與網路通信埠的一計算核心。該計算核心用於:通過該網路通信埠分別自該第一伺服器與該第二伺服器取得該第一挖礦演算法與該第二挖礦演算法的第一輸入數據與第二輸入數據;利用該第一輔助計算邏輯電路根據該第一輸入數據執行該第一挖礦演算法;以及利用該第二輔助計算邏輯電路根據該第二輸入數據執行該第二挖礦演算法。其中,該第一輔助計算邏輯電路與該中央處 理器安裝於同一電路板,該第一輔助計算邏輯電路在所分配的該第一挖礦演算法完成時,向該計算核心提出一中斷信號。 According to an embodiment of the present invention, a computer for multiple virtual currency mining is provided, including: a network interface for connecting a first server and a second server on the network; and a first auxiliary calculation logic The circuit is used to execute the first mining algorithm; a second auxiliary calculation logic circuit is used to execute the second mining algorithm; and a central processing unit. The central processing unit includes: a first communication interface for connecting to the first auxiliary calculation logic circuit; a second communication interface for connecting to the second auxiliary calculation logic circuit; and a network communication port for connecting to the A network interface; and a computing core connected to the above-mentioned first communication interface, second communication interface and network communication port. The computing core is used to obtain the first input data and the second input of the first mining algorithm and the second mining algorithm from the first server and the second server through the network communication port. Data; using the first auxiliary calculation logic circuit to execute the first mining algorithm according to the first input data; and using the second auxiliary calculation logic circuit to execute the second mining algorithm according to the second input data. Wherein, the first auxiliary calculation logic circuit and the central office The processor is installed on the same circuit board, and the first auxiliary calculation logic circuit sends an interrupt signal to the calculation core when the allocated first mining algorithm is completed.
在該實施例中,為了連接該第一輔助計算邏輯電路或該第二輔助計算邏輯電路,該第一通信介面或第二通信介面包含下列硬體介面其中之一:複數個通用輸出入埠(GPIO);序列傳輸形式的周邊介面;平行傳輸形式的周邊介面;通用非同步收發傳輸器(UART);以及序列周邊介面(SPI)。 In this embodiment, in order to connect the first auxiliary calculation logic circuit or the second auxiliary calculation logic circuit, the first communication interface or the second communication interface includes one of the following hardware interfaces: a plurality of general-purpose I/O ports ( GPIO); Peripheral interface in the form of serial transmission; Peripheral interface in the form of parallel transmission; Universal Asynchronous Transceiver (UART); and Serial Peripheral Interface (SPI).
在該實施例中,為了使用不同介面的該第一輔助計算邏輯電路與該第二輔助計算邏輯電路,其中該第一通信介面與該第二通信介面包含不同的硬體介面。 In this embodiment, in order to use the first auxiliary calculation logic circuit and the second auxiliary calculation logic circuit of different interfaces, the first communication interface and the second communication interface include different hardware interfaces.
在該實施例中,為了縮短兩者之間的實體距離以便增加抗干擾的能力,其中該第一輔助計算邏輯電路係為一獨立封裝,該中央處理器與該第一輔助計算邏輯電路係安裝於同一片電路板。 In this embodiment, in order to shorten the physical distance between the two to increase the anti-interference ability, the first auxiliary calculation logic circuit is an independent package, and the central processing unit and the first auxiliary calculation logic circuit are installed On the same circuit board.
在該實施例中,為了更進一步縮短兩者之間的實體距離以便增加抗干擾的能力,並且減少系統廠商組裝的問題,其中該中央處理器與該第一輔助計算邏輯電路分別位於不同晶片上,但屬於同一封裝。 In this embodiment, in order to further shorten the physical distance between the two so as to increase the anti-interference ability and reduce the assembly problems of the system manufacturer, the central processing unit and the first auxiliary computing logic circuit are respectively located on different chips , But belong to the same package.
在該實施例中,為了向計算核心提出硬體中斷信號,該中斷信號係由該第一輔助計算邏輯電路透過包含複數個通用輸出入埠的第一通信介面的至少一個埠向該計算核心提出。 In this embodiment, in order to send a hardware interrupt signal to the computing core, the interrupt signal is sent to the computing core by the first auxiliary computing logic circuit through at least one port of the first communication interface including a plurality of universal I/O ports. .
在該實施例中,為了向計算核心提出中斷信號,該中斷信號至少包含下列其中之一:硬體中斷信號;和透過該複數個通用輸出入埠所傳輸的軟體通訊協定中所規定的一軟體中斷信號。 In this embodiment, in order to present an interrupt signal to the computing core, the interrupt signal includes at least one of the following: a hardware interrupt signal; and a software specified in the software communication protocol transmitted through the plurality of general-purpose I/O ports Interrupt signal.
在該實施例中,為了增加計算的空間密度,該中央處理器與該第二輔助計算邏輯電路分別位於不同的電路板。 In this embodiment, in order to increase the spatial density of calculation, the central processing unit and the second auxiliary calculation logic circuit are respectively located on different circuit boards.
根據本發明,提供如上述各個實施例的中央處理器。 According to the present invention, a central processing unit as in the above-mentioned various embodiments is provided.
根據本發明所提供的計算機與中央處理器,可以讓計算機能夠同時針對兩種或更多個虛擬貨幣同時進行挖礦,進而減少購置成本,增加挖礦的收入。 According to the computer and the central processing unit provided by the present invention, the computer can simultaneously mine two or more virtual currencies at the same time, thereby reducing the purchase cost and increasing the mining income.
100‧‧‧計算機 100‧‧‧Computer
110‧‧‧中央處理器 110‧‧‧Central Processing Unit
111‧‧‧計算核心 111‧‧‧Compute Core
112‧‧‧第一通信介面 112‧‧‧First communication interface
113‧‧‧第二通信介面 113‧‧‧Second communication interface
114‧‧‧記憶體控制器 114‧‧‧Memory Controller
115‧‧‧網路通信埠 115‧‧‧Network communication port
120‧‧‧第一輔助計算邏輯電路 120‧‧‧The first auxiliary calculation logic circuit
130‧‧‧第二輔助計算邏輯電路 130‧‧‧Second auxiliary calculation logic circuit
140‧‧‧記憶體晶片 140‧‧‧Memory chip
150‧‧‧網路介面 150‧‧‧Network Interface
200‧‧‧計算方法 200‧‧‧Calculation method
210~260‧‧‧步驟 210~260‧‧‧Step
300‧‧‧計算方法 300‧‧‧Calculation method
310~390‧‧‧步驟 310~390‧‧‧Step
圖1為根據本發明一實施例的一計算機的一方塊示意圖。 FIG. 1 is a block diagram of a computer according to an embodiment of the invention.
圖2為根據本發明一實施例的一計算方法的一流程示意圖。 FIG. 2 is a schematic flowchart of a calculation method according to an embodiment of the present invention.
圖3為根據本發明另一實施例的一計算方法的一流程示意圖。 FIG. 3 is a schematic flowchart of a calculation method according to another embodiment of the present invention.
本發明將詳細描述一些實施例如下。然而,除了所揭露的實施例外,本發明亦可以廣泛地運用在其他的實施例施行。本發明的範圍並不受該些實施例的限定,乃以其後的申請專利範圍為準。而為提供更清楚的描述及使熟悉該項技藝者能理解本發明的發明內容,圖示內各部分並沒有依照其相對的尺寸而繪圖,某些尺寸與其他相關尺度的比例會被突顯而顯得誇張,且不相關的細節部分亦未完全繪出,以求圖示的簡潔。此外,本發明的各流程圖所示的各個步驟當中,可以插入其他與本發明無關的其他步驟。除非有因果依存關係,本發明也不限定各個步驟的執行順序。 Some embodiments of the present invention will be described in detail as follows. However, in addition to the disclosed embodiments, the present invention can also be widely used in other embodiments. The scope of the present invention is not limited by these embodiments, but the scope of subsequent patent applications shall prevail. In order to provide a clearer description and enable those familiar with the art to understand the content of the present invention, the various parts in the figure are not drawn according to their relative dimensions, and the ratios of certain dimensions to other relevant dimensions will be highlighted. It seems exaggerated, and the irrelevant details are not completely drawn in order to keep the diagram concise. In addition, among the steps shown in the flowcharts of the present invention, other steps that are not related to the present invention can be inserted. Unless there is a causal dependence, the present invention does not limit the execution order of each step.
請參考圖1所示,其為根據本發明一實施例的一計算機100的一方塊示意圖。該計算機100包含一中央處理器110、一或多個第一輔助計
算邏輯電路120、一或多個第二輔助計算邏輯電路130、一或多個記憶體晶片140以及一網路介面150。
Please refer to FIG. 1, which is a block diagram of a
在一實施例中,該第一輔助計算邏輯電路120可以是特別適用於計算第一種挖礦演算法的邏輯電路,該第二輔助計算邏輯電路130可以是特別適用於計算第二種挖礦演算法的邏輯電路。在另一實施例中,該第一輔助計算邏輯電路120可以是通用型的輔助計算邏輯電路,經由軟體或韌體將其設定為適用於計算第一種挖礦演算法。同樣地,該第二輔助計算邏輯電路130也可以是通用型的輔助計算邏輯電路,經由軟體或韌體將其設定為適用於計算第二種挖礦演算法。第一種挖礦演算法係對應至第一種虛擬貨幣,而第二種挖礦演算法係對應至第二種虛擬貨幣。
In an embodiment, the first auxiliary
該第一輔助計算邏輯電路120或該第二輔助計算邏輯電路130可以是現場可程式化邏輯閘陣列(FPGA),也可以是特定應用積體電路(ASIC)。其可以具有內部的狀態機(state-machine),以及程式計數(program counter)和相關的暫存器,用於在接收挖礦輸入數據之後,自主執行第一種或第二種挖礦演算法,並且得到相應於挖礦輸入數據的結果。
The first auxiliary
該網路介面150用於連接外界的伺服器。該網路介面150可以是符合工業標準的有線或無線介面,例如IEEE 802.3、IEEE 802.11、3GPP 3G/4G/5G UTRAN、Bluetooth、USB、Wireless USB、Zigbee等。該網路介面150可以透過網路連接到各虛擬貨幣所對應的節點,以便取得挖礦輸入數據。該中央處理器110可以包含一網路通信埠115以連接該網路介面150。
The
該記憶體晶片140可以包含動態記憶體(DRAM)與可程式化抹除唯讀記憶體(EEPROM)。動態記憶體係用作中央處理器110的系統記憶
體,用於支援中央處理器110執行作業系統與應用程式。可程式化抹除唯讀記憶體用於儲存上述的作業系統與應用程式,以及其他設定。
The
該中央處理器110可以包含一或多個計算核心111(core),用於執行上述的作業系統與應用程式。本發明並不限定該計算核心111所支援的指令集形式,其可以是精簡指令集計算機(RISC),也可以是複雜指令集計算機(CISC)。前者包含了安謀公司的ARM指令集,而後者包含了英代爾公司的x86與x64指令集。該中央處理器110可以包含了各層級的快取記憶體,舉例來說,可以包含L1快取、L2快取與L3快取,本發明並不限定快取記憶體的形式與層級。
The
該計算核心111可以用於執行第三種挖礦演算法,其對應至第三種虛擬貨幣。除此之外,該計算核心111也可以用於執行第一種挖礦演算法與/或第二種挖礦演算法。在一實施例中,當該中央處理器110包含多個計算核心111時,可以令每一個計算核心111執行不同的挖礦演算法。在另一實施例中,當該中央處理器110只包含一個計算核心111時,也可以令唯一的計算核心111以分時多工的方式執行不同的挖礦演算法。
The
該中央處理器110)包含一第一通信介面112,用於連接該一或多個第一輔助計算邏輯電路120。該中央處理器110包含一第二通信介面113,用於連接該一或多個第二輔助計算邏輯電路130。由於挖礦演算法是需要大量計算資源但不需要大量輸出入數據的演算法,該第一通信介面112與該第二通信介面113可以是低速的連接介面。舉例來說,它們的傳輸率可以是每秒數百萬赫茲(MHz)或更低,即能支援各種挖礦演算法。
The central processing unit 110) includes a
在本發明當中,該第一通信介面112與該第二通信介面113
可以是多個通用輸出入埠(GPIO)所組成的介面,也可以是序列傳輸形式的周邊介面,還可以是各式平行傳輸形式的周邊介面或匯流排,如DB-25。其包含了通用非同步收發傳輸器(UART),例如RS-232、RS-422、RS-423、RS-449、RS-485等,其還可以包含序列周邊介面(SPI)匯流排。
In the present invention, the
在一實施例中,當該第二通信介面113為序列周邊介面匯流排的主控端(master)時,複數個第二輔助計算邏輯電路130可以同時連接到同一個匯流排,作為複數個被控端(slave)。該主控端可以透過多個選擇訊號(Slave Selected)來選擇多個被控端當中的其中一個。
In one embodiment, when the
第一通信介面112與第二通信介面113可以是相同形式的介面,也可以是不同形式的介面。前述的第一通信介面112與第二通信介面113指的是硬體層級的標準介面。在硬體層級的標準介面之上,該計算核心111與該第一輔助計算邏輯電路120可以透過專屬的軟體通訊協定溝通。所謂的專屬的軟體通訊協定,係該計算核心111與該第一輔助計算邏輯電路120之間的溝通協定。該軟體通訊協定可以包含但不限於下列功能:傳送第一挖礦演算法所需的輸入數據;接收第一挖礦演所法計算所得的輸出數據;啟動第一挖礦演算法的運算;關閉第一挖礦演算法的運算;以及查詢該第一輔助計算邏輯電路120是否已經完成第一挖礦演算法的運算。
The
在某些形式的通信介面112上,計算核心111在啟動該第一輔助計算邏輯電路120的第一挖礦演算法的運算之後,必須定期查詢該第一輔助計算邏輯電路120是否完成運算。當運算尚未完成時,計算核心111必須在下一詢問週期再次查詢。換言之,計算核心111會浪費寶貴的時間在查詢上。當運算完成之後,但計算核心111尚未查詢之前,該第一輔助計算邏輯
電路120的計算資源即閒置不動,無法進行下一輪的第一挖礦演算法的運算。例如,當使用前述的通用非同步收發傳輸器或序列周邊介面作為第一通信介面112時,就必須採用定期查詢的機制。
On some forms of
在另外一些形式的通信介面112上,該第一輔助計算邏輯電路120可以透過硬體的一或多個連接埠向計算核心發出中斷(interrupt)請求,以便表示該第一輔助計算邏輯電路120的運算已經完成,或是其他需要向計算核心111報告的事項。該中斷請求可以是單純的硬體中斷,例如透過通用輸出入埠的至少一個埠來發出中斷,也可以透過兩個以上的埠來發出中斷。該中斷請求也可以是較為複雜的軟硬體中斷。例如該第一輔助計算邏輯電路120先發出硬體中斷通知計算核心,再藉由計算核心111與該第一輔助計算邏輯電路120之間的軟體通訊協定,計算核心111得知運算已經完成,可以自該第一輔助計算邏輯電路120接收輸出數據,並且準備進行下一輪的運算。當使用中斷請求來通知計算核心111時,可以減省前述定期查詢所閒置的時間。
On some other forms of
中斷信號可以具有優先順序。當該計算機100具有多個第一輔助計算邏輯電路120與/或第二輔助計算邏輯電路130時,可以為這些第一輔助計算邏輯電路120與/或第二輔助計算邏輯電路130設定不同優先順序的中斷請求。當計算核心111正在處理較低優先度的中斷請求時,可以被具有較高優先度的中斷請求所打斷。當計算核心111正在處理較高優先度的中斷請求時,不能被具有較低優先度或是相同優先度的中斷請求所打斷。在一實施例中,第一輔助計算邏輯電路120的中斷請求優先順序要高於第二輔助計算邏輯電路130或者相反。在一實施例中,所有的第一輔助計算邏輯電路
120的中斷請求優先順序均相同。在另一實施例中,所有的第二輔助計算邏輯電路130的中斷請求優先順序均相同。
The interrupt signal can have a priority order. When the
由於第一通信介面112可能受到計算機100本身或周遭各種信號的干擾,因此如果能夠縮短第一通信介面112的線路長度,可以更有效地抗干擾。在一實施例中,一或多個該第一輔助計算邏輯電路120可以與該中央處理器110安裝在同一電路基板上,以便縮短第一通信介面112的線路長度,增進抗干擾的能力。在另一實施例中,一或多個該第一輔助計算邏輯電路120可以實作在一晶片上,與該中央處理器110的另一晶片封裝在同一封裝體內。兩者可以透過同一電路基板進行線路的分配與連接。
Since the
在一實施例中,第一通信介面112還可以同時包含前述的通用非同步收發傳輸器或序列周邊介面,以及用於提出硬體中斷信號的一連接線路,藉以實施前述的軟硬體中斷。在另一實施例中,該第二通信介面113與該第二輔助計算邏輯電路也可以適用於前述第一通信介面112的實施例。
In an embodiment, the
在一實施例中,為了實現高密度計算,多個第二輔助計算邏輯電路130可以安裝在與中央處理器110不同的另一電路板上。每一片運算子板可以包含多個輔助計算邏輯電路130,而該計算機100可以包含多片運算子版。如此一來,可以在小空間內,盡可能放入越多的第二輔助計算邏輯電路130,以便節省空間資源。
In an embodiment, in order to achieve high-density calculations, the plurality of second auxiliary
中央處理器110可以包含一記憶體控制器114,用於連接前述的一或多個記憶體晶片140。這兩者可以遵循現有的工業標準介面,例如JEDEC固態技術協會所定義的雙倍資料率同步動態隨機存取記憶體(DDR
SDRAM)的規格。由於挖礦演算法可能需要大量的記憶體資源,執行一或多種挖礦演算法的計算核心111可以利用多顆記憶體晶片140來支援一或多種挖礦演算法的計算。當所計算的挖礦演算法的種類越多,記憶體晶片140的數量也就需要越多。或者是當計算核心111的數量愈多,可同時執行的挖礦演算法的數量越多。
The
由於受限於記憶體介面的電氣規格,當記憶體控制器114與記憶體晶片140的實體距離越短時,越不會造成訊號的扭曲。多條訊號之間的傳輸距離也不會相差太大而需要降低傳輸時脈來補償差異。而且抗干擾的能力也比較好。因此,在一實施例中,前述的一或多個記憶體晶片140與該中央處理器110雖然屬於不同封裝體,但可以安裝在同一電路基板上,以便增進傳輸頻寬。在另一實施例中,分屬不同封裝的該中央處理器110與第一輔助計算邏輯電路120和記憶體晶片140均安裝在同一電路基板上。在更一實施例中,該中央處理器110與第一輔助計算邏輯電路120和記憶體晶片140均安裝在同一電路基板,且封裝在同一封裝體內。
Due to the electrical specifications of the memory interface, when the physical distance between the
請參考圖2所示,其為根據本發明一實施例的一多種虛擬貨幣挖礦的計算方法200的一流程示意圖。該計算方法200可以由一應用程式實現,由圖1所示的至少一個計算核心111負責執行該應用程式。此外,該應用程式也可以是多執行緒(multi-threaded)的應用程式。亦即可以有多重指令計數器(program counter),可以同時在多個計算核心111或以分時多工的方式在一個計算核心111執行。除非有特別說明,否則本發明並不限定各個步驟的執行順序。
Please refer to FIG. 2, which is a schematic flowchart of a
步驟210:通過該網路通信埠分別自該第一伺服器與該第二 伺服器取得該第一挖礦演算法與該第二挖礦演算法的第一輸入數據與第二輸入數據。 Step 210: Separately from the first server and the second server through the network communication port The server obtains first input data and second input data of the first mining algorithm and the second mining algorithm.
可選的步驟215:通過該網路通信埠自該第三伺服器取得該第三挖礦演算法的第三輸入數據。 Optional step 215: Obtain the third input data of the third mining algorithm from the third server through the network communication port.
步驟220:利用該第一輔助計算邏輯電路根據該第一輸入數據執行該第一挖礦演算法。 Step 220: Use the first auxiliary calculation logic circuit to execute the first mining algorithm according to the first input data.
步驟230:利用該第二輔助計算邏輯電路根據該第二輸入數據執行該第二挖礦演算法。 Step 230: Use the second auxiliary calculation logic circuit to execute the second mining algorithm according to the second input data.
可選的步驟240:計算核心根據該第三輸入數據執行該第三挖礦演算法,以得到相應的該第三輸出數據。 Optional step 240: the computing core executes the third mining algorithm according to the third input data to obtain the corresponding third output data.
步驟250:接受由該第一輔助計算邏輯電路所發出的一中斷信號。該步驟250還可以包含自該第一輔助計算邏輯電路接收相應於第一輸入數據的第一輸出數據。
Step 250: Accept an interrupt signal sent by the first auxiliary calculation logic circuit. The
步驟260:定期詢問由該第二輔助計算邏輯電路是否已經完成該第二挖礦演算法的工作。若已完成,步驟260還可以包含自該第二輔助計算邏輯電路接收相應於第二輸入數據的第二輸出數據。
Step 260: Periodically inquire whether the second auxiliary calculation logic circuit has completed the work of the second mining algorithm. If completed,
請參考圖3所示,其為根據本發明一實施例的一多種虛擬貨幣挖礦的計算方法300的一流程示意圖。該計算方法300可以由一應用程式實現,由圖1所示的至少一個計算核心111負責執行該應用程式。此外,該應用程式也可以是多執行緒(multi-threaded)的應用程式。亦即可以有多重指令計數器(program counter),可以同時在多個計算核心111或以分時多工的方式在一個計算核心111執行。除非有特別說明,否則本發明並不限定各個步
驟的執行順序。
Please refer to FIG. 3, which is a schematic flowchart of a
在一實施例中,該計算方法300可以由三個執行緒來進行,分別負責步驟310、320與330的子流程。在另一實施例中,該計算方法300可以由三個應用程式來進行,分別負責步驟310、320與330的子流程,而由作業系統負責對這三個應用程式進行排程。
In an embodiment, the
步驟310:通過該網路通信埠自該第一伺服器取得該第一挖礦演算法的第一輸入數據。 Step 310: Obtain the first input data of the first mining algorithm from the first server through the network communication port.
步驟320:通過該網路通信埠自該第二伺服器取得該第二挖礦演算法的第二輸入數據。 Step 320: Obtain the second input data of the second mining algorithm from the second server through the network communication port.
可選的步驟330:通過該網路通信埠自該第三伺服器取得該第三挖礦演算法的第三輸入數據。 Optional step 330: Obtain the third input data of the third mining algorithm from the third server through the network communication port.
步驟340:利用該第一輔助計算邏輯電路根據該第一輸入數據執行該第一挖礦演算法。 Step 340: Use the first auxiliary calculation logic circuit to execute the first mining algorithm according to the first input data.
步驟350:接受由該第一輔助計算邏輯電路所發出的一中斷信號。該步驟350還可以包含自該第一輔助計算邏輯電路接收相應於第一輸入數據的第一輸出數據。接著,流程回到步驟310,繼續下載下一輪的第一輸入數據。
Step 350: Accept an interrupt signal sent by the first auxiliary calculation logic circuit. The
步驟360:詢問由該第二輔助計算邏輯電路是否已經完成該第二挖礦演算法的工作。當尚未完成時,流程繼續到步驟370。當工作已經完成時,流程繼續到步驟380。 Step 360: Inquire whether the second auxiliary calculation logic circuit has completed the work of the second mining algorithm. When it has not been completed, the flow continues to step 370. When the work has been completed, the flow continues to step 380.
步驟370:等待一段時間,接著流程再回到步驟360。 Step 370: Wait for a period of time, and then the process returns to step 360.
步驟380:自該第二輔助計算邏輯電路接收相應於第二輸入 數據的第二輸出數據。接著,流程回到步驟320,繼續下載下一輪的第二輸入數據。 Step 380: Receive from the second auxiliary calculation logic circuit corresponding to the second input The second output data of the data. Then, the process returns to step 320 to continue to download the second input data of the next round.
可選的步驟390:計算核心根據該第三輸入數據執行該第三挖礦演算法,以得到相應的該第三輸出數據。接著,流程回到步驟330,繼續下載下一輪的第三輸入數據。 Optional step 390: the computing core executes the third mining algorithm according to the third input data to obtain the corresponding third output data. Then, the process returns to step 330 to continue to download the third input data of the next round.
在圖2與圖3的實施例的變化形式當中,可以一次下載多筆輸入數據以便提供給多輪的挖礦演算法進行運算工作,而不需要只下載一筆輸入數據進行工作。此外,下載步驟也可以和演算法運算工作步驟同時執行,亦即在上一輪演算法運算工作尚未完成時,就可以提前下載輸入數據。 In the variation of the embodiment of FIG. 2 and FIG. 3, it is possible to download multiple pieces of input data at a time so as to provide multiple rounds of mining algorithms for calculation work, instead of downloading only one piece of input data for work. In addition, the downloading step can also be executed at the same time as the algorithmic operation step, that is, the input data can be downloaded in advance when the previous round of algorithmic operation is not completed.
根據本發明一實施例,提供一種用於多種虛擬貨幣挖礦的計算機,包含:一網路介面,用於連接網路上的一第一伺服器與一第二伺服器;一第一輔助計算邏輯電路,用於執行第一挖礦演算法;一第二輔助計算邏輯電路,用於執行第二挖礦演算法;以及一中央處理器。該中央處理器包含:一第一通信介面,用於連接該第一輔助計算邏輯電路;一第二通信介面,用於連接該第二輔助計算邏輯電路;一網路通信埠,用於連接該網路介面;以及連接至上述的第一通信介面、第二通信介面與網路通信埠的一計算核心。該計算核心用於:通過該網路通信埠分別自該第一伺服器與該第二伺服器取得該第一挖礦演算法與該第二挖礦演算法的第一輸入數據與第二輸入數據;利用該第一輔助計算邏輯電路根據該第一輸入數據執行該第一挖礦演算法;以及利用該第二輔助計算邏輯電路根據該第二輸入數據執行該第二挖礦演算法。其中,該第一輔助計算邏輯電路與該中央處理器安裝於同一電路板,該第一輔助計算邏輯電路在所分配的該第一挖礦 演算法完成時,向該計算核心提出一中斷信號。 According to an embodiment of the present invention, a computer for multiple virtual currency mining is provided, including: a network interface for connecting a first server and a second server on the network; and a first auxiliary calculation logic The circuit is used to execute the first mining algorithm; a second auxiliary calculation logic circuit is used to execute the second mining algorithm; and a central processing unit. The central processing unit includes: a first communication interface for connecting to the first auxiliary calculation logic circuit; a second communication interface for connecting to the second auxiliary calculation logic circuit; and a network communication port for connecting to the A network interface; and a computing core connected to the above-mentioned first communication interface, second communication interface and network communication port. The computing core is used to obtain the first input data and the second input of the first mining algorithm and the second mining algorithm from the first server and the second server through the network communication port. Data; using the first auxiliary calculation logic circuit to execute the first mining algorithm according to the first input data; and using the second auxiliary calculation logic circuit to execute the second mining algorithm according to the second input data. Wherein, the first auxiliary calculation logic circuit and the central processing unit are installed on the same circuit board, and the first auxiliary calculation logic circuit is assigned to the first mining When the algorithm is completed, an interrupt signal is presented to the computing core.
在該實施例中,為了連接該第一輔助計算邏輯電路或該第二輔助計算邏輯電路,該第一通信介面或第二通信介面包含下列硬體介面其中之一:複數個通用輸出入埠(GPIO);序列傳輸形式的周邊介面;平行傳輸形式的周邊介面;通用非同步收發傳輸器(UART);以及序列周邊介面(SPI)。 In this embodiment, in order to connect the first auxiliary calculation logic circuit or the second auxiliary calculation logic circuit, the first communication interface or the second communication interface includes one of the following hardware interfaces: a plurality of general-purpose I/O ports ( GPIO); Peripheral interface in the form of serial transmission; Peripheral interface in the form of parallel transmission; Universal Asynchronous Transceiver (UART); and Serial Peripheral Interface (SPI).
在該實施例中,為了使用不同介面的該第一輔助計算邏輯電路與該第二輔助計算邏輯電路,其中該第一通信介面與該第二通信介面包含不同的硬體介面。 In this embodiment, in order to use the first auxiliary calculation logic circuit and the second auxiliary calculation logic circuit of different interfaces, the first communication interface and the second communication interface include different hardware interfaces.
在該實施例中,為了縮短兩者之間的實體距離以便增加抗干擾的能力,其中該第一輔助計算邏輯電路係為一獨立封裝,該中央處理器與該第一輔助計算邏輯電路係安裝於同一片電路板。 In this embodiment, in order to shorten the physical distance between the two to increase the anti-interference ability, the first auxiliary calculation logic circuit is an independent package, and the central processing unit and the first auxiliary calculation logic circuit are installed On the same circuit board.
在該實施例中,為了更進一步縮短兩者之間的實體距離以便增加抗干擾的能力,並且減少系統廠商組裝的問題,其中該中央處理器與該第一輔助計算邏輯電路分別位於不同晶片上,但屬於同一封裝。 In this embodiment, in order to further shorten the physical distance between the two so as to increase the anti-interference ability and reduce the assembly problems of the system manufacturer, the central processing unit and the first auxiliary computing logic circuit are respectively located on different chips , But belong to the same package.
在該實施例中,為了向計算核心提出硬體中斷信號,該中斷信號係由該第一輔助計算邏輯電路透過包含複數個通用輸出入埠的第一通信介面的至少一個埠向該計算核心提出。 In this embodiment, in order to send a hardware interrupt signal to the computing core, the interrupt signal is sent to the computing core by the first auxiliary computing logic circuit through at least one port of the first communication interface including a plurality of universal I/O ports. .
在該實施例中,為了向計算核心提出中斷信號,該中斷信號至少包含下列其中之一:硬體中斷信號;和透過該複數個通用輸出入埠所傳輸的軟體通訊協定中所規定的一軟體中斷信號。 In this embodiment, in order to present an interrupt signal to the computing core, the interrupt signal includes at least one of the following: a hardware interrupt signal; and a software specified in the software communication protocol transmitted through the plurality of general-purpose I/O ports Interrupt signal.
在該實施例中,為了增加計算的空間密度,該中央處理器與 該第二輔助計算邏輯電路分別位於不同的電路板。 In this embodiment, in order to increase the spatial density of calculations, the central processing unit and The second auxiliary calculation logic circuits are respectively located on different circuit boards.
根據本發明,提供如上述各個實施例的中央處理器。 According to the present invention, a central processing unit as in the above-mentioned various embodiments is provided.
根據本發明所提供的計算機與中央處理器,可以讓計算機能夠同時針對兩種或更多個虛擬貨幣同時進行挖礦,進而減少購置成本,增加挖礦的收入。 According to the computer and the central processing unit provided by the present invention, the computer can simultaneously mine two or more virtual currencies at the same time, thereby reducing the purchase cost and increasing the mining income.
100‧‧‧計算機 100‧‧‧Computer
110‧‧‧中央處理器 110‧‧‧Central Processing Unit
111‧‧‧計算核心 111‧‧‧Compute Core
112‧‧‧第一通信介面 112‧‧‧First communication interface
113‧‧‧第二通信介面 113‧‧‧Second communication interface
114‧‧‧記憶體控制器 114‧‧‧Memory Controller
115‧‧‧網路通信埠 115‧‧‧Network communication port
120‧‧‧第一輔助計算邏輯電路 120‧‧‧The first auxiliary calculation logic circuit
130‧‧‧第二輔助計算邏輯電路 130‧‧‧Second auxiliary calculation logic circuit
140‧‧‧記憶體晶片 140‧‧‧Memory chip
150‧‧‧網路介面 150‧‧‧Network Interface
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW107143550A TWI722343B (en) | 2018-12-03 | 2018-12-03 | Computer and central processing unit for mining of virtual currencies |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW107143550A TWI722343B (en) | 2018-12-03 | 2018-12-03 | Computer and central processing unit for mining of virtual currencies |
Publications (2)
Publication Number | Publication Date |
---|---|
TW202023251A TW202023251A (en) | 2020-06-16 |
TWI722343B true TWI722343B (en) | 2021-03-21 |
Family
ID=72175984
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW107143550A TWI722343B (en) | 2018-12-03 | 2018-12-03 | Computer and central processing unit for mining of virtual currencies |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI722343B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170249606A1 (en) * | 2014-09-10 | 2017-08-31 | Robert Parviz PIROOZ | System and method for electronic currency mining |
KR20180040955A (en) * | 2016-10-13 | 2018-04-23 | 엘지전자 주식회사 | Mobile terminal and method for controlling the same |
-
2018
- 2018-12-03 TW TW107143550A patent/TWI722343B/en active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170249606A1 (en) * | 2014-09-10 | 2017-08-31 | Robert Parviz PIROOZ | System and method for electronic currency mining |
KR20180040955A (en) * | 2016-10-13 | 2018-04-23 | 엘지전자 주식회사 | Mobile terminal and method for controlling the same |
Also Published As
Publication number | Publication date |
---|---|
TW202023251A (en) | 2020-06-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102567109B (en) | Interrupt distribution scheme | |
EP2801912B1 (en) | Message-based memory access device and access method thereof | |
TWI420293B (en) | Method, system, and apparatus for coordinated link power management | |
US20120079155A1 (en) | Interleaved Memory Access from Multiple Requesters | |
US8225064B2 (en) | Storage region allocation system, storage region allocation method, and control apparatus | |
CA2950154A1 (en) | Systems and methods of managing processor device power consumption | |
US4926319A (en) | Integrated circuit timer with multiple channels and dedicated service processor | |
KR20040012964A (en) | System and method for controlling bus arbitration during cache memory burst cycles | |
CN112199173B (en) | Data processing method for dual-core CPU real-time operating system | |
US5129078A (en) | Dedicated service processor with inter-channel communication features | |
US8754681B2 (en) | Multi-part clock management | |
US11232060B2 (en) | Method, apparatus and system for power supply policy exchange on a bus | |
CN109564562B (en) | Big data operation acceleration system and chip | |
US20070260791A1 (en) | Data processing device | |
TWI722343B (en) | Computer and central processing unit for mining of virtual currencies | |
KR20160045860A (en) | Emi mitigation on high-speed lanes using false stall | |
KR101672357B1 (en) | Performing frequency coordination in a multiprocessor system based on response timing optimization | |
WO2019120294A1 (en) | Data-processing apparatus, data transmission method, and computing system thereof | |
CN111427836B (en) | Heterogeneous multi-core processor for bus resource configuration adjustment | |
CN209784995U (en) | Big data operation acceleration system and chip | |
KR20130011805A (en) | Simulation apparatus and simulation method thereof | |
US5548774A (en) | Microcomputer system providing time management enabling control and acquisition of data indicative of condition changes occurring at high speed | |
JP5561374B2 (en) | Information processing system | |
CN112740193A (en) | Method for accelerating system execution operation of big data operation | |
Kim et al. | A cost-effective latency-aware memory bus for symmetric multiprocessor systems |