[go: up one dir, main page]

TWI402747B - Method for combining data and electronic apparatus and computer program product using the method thereof - Google Patents

Method for combining data and electronic apparatus and computer program product using the method thereof Download PDF

Info

Publication number
TWI402747B
TWI402747B TW98105015A TW98105015A TWI402747B TW I402747 B TWI402747 B TW I402747B TW 98105015 A TW98105015 A TW 98105015A TW 98105015 A TW98105015 A TW 98105015A TW I402747 B TWI402747 B TW I402747B
Authority
TW
Taiwan
Prior art keywords
data
storage space
merging
materials
storage
Prior art date
Application number
TW98105015A
Other languages
Chinese (zh)
Other versions
TW201032128A (en
Inventor
Szu Hwa Peng
Original Assignee
E Ten Information Sys Co Ltd
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 E Ten Information Sys Co Ltd filed Critical E Ten Information Sys Co Ltd
Priority to TW98105015A priority Critical patent/TWI402747B/en
Publication of TW201032128A publication Critical patent/TW201032128A/en
Application granted granted Critical
Publication of TWI402747B publication Critical patent/TWI402747B/en

Links

Landscapes

  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Description

合併資料的方法及其電子裝置與電腦程式產品Method for merging data and electronic device and computer program product thereof

本發明是有關於一種合併資料的方法,且特別是有關於一種結合時間因素的合併資料方法。The present invention relates to a method of merging data, and in particular to a method of merging data in combination with time factors.

隨著科技的日新月異,投資人要掌握股市資訊已不再侷限於藉由收聽收音機或是觀看有線頻道。目前市面上出現了各式各樣的股票機,其不僅攜帶方便,並且操作簡單以及功能日趨多樣化,據此許多投資人紛紛改用股票機,以隨時掌握股市資訊。透過股票機,投資人即可隨身、隨地、隨時的查看最新的即時股市交易資訊。With the rapid development of technology, investors have to grasp the stock market information is no longer limited to listening to the radio or watching cable channels. At present, a variety of stock machines appear on the market, which are not only easy to carry, but also simple to operate and increasingly diversified functions. According to this, many investors have switched to stock machines to keep abreast of stock market information. Through the stock machine, investors can view the latest real-time stock market trading information with them, anytime, anywhere.

然而,可攜式的股票機受限於體積與成本,因而一般股票機的記憶體容量非常有限。據此,倘若當日的交易量過大,將容易導致記憶體耗盡。However, the portable stock machine is limited by volume and cost, so the memory capacity of a general stock machine is very limited. According to this, if the trading volume of the day is too large, it will easily lead to the exhaustion of memory.

本發明提供一種合併資料的方法及其電子裝置,讓資料的合併均勻分布在預設時間範圍內。The invention provides a method for merging data and an electronic device thereof, so that the merging of the data is evenly distributed within a preset time range.

本發明提出一種電子裝置,其包括儲存模組、接收模組以及運算模組。儲存模組中具有預設的儲存空間。接收模組是在預設的時間範圍內接收來自於遠端的伺服器所傳輸的複數筆資料。運算模組則將上述預設的時間範圍劃分為多個時間檢查點,並於每一個時間檢查點監測儲存模組的儲存空間的使用狀況。當運算模組偵測到儲存空間的使用狀況達到一個預設條件時,將時間檢查點及下一次時間檢查點之間所接收的資料依據預設的合併規則進行處理後,再將經過處理之後的這些資料更新至儲存模組。The invention provides an electronic device, which comprises a storage module, a receiving module and an arithmetic module. The storage module has a preset storage space. The receiving module receives the plurality of data transmitted by the server from the remote end within a preset time range. The computing module divides the preset time range into multiple time check points, and monitors the storage space usage of the storage module at each time check point. When the computing module detects that the usage status of the storage space reaches a preset condition, the data received between the time check point and the next time check point is processed according to a preset merge rule, and then processed. These data are updated to the storage module.

在本發明之一實施例中,電子裝置更包括一暫存空間。暫存空間是用來暫時儲存接收模組所接收的資料,以使運算模組將這些資料更新至儲存模組內。In an embodiment of the invention, the electronic device further includes a temporary storage space. The temporary storage space is used for temporarily storing the data received by the receiving module, so that the computing module updates the data into the storage module.

在本發明之一實施例中,上述運算模組更包括當時間範圍的經過百分比小於或等於儲存空間的使用百分比時,依據一合併規則,增加這些資料欲進行合併的一數量,而以此數量為合併的單位,合併這些資料。並且,當時間範圍的經過百分比大於儲存空間的使用百分比時,依據上述合併規則,減少這些資料欲進行合併的數量,而以此數量為合併的單位,合併這些資料。In an embodiment of the present invention, the operation module further includes: when the percentage of passage of the time range is less than or equal to the usage percentage of the storage space, increasing the quantity to be merged according to a merge rule, and the quantity is Combine these materials for the combined units. Moreover, when the percentage of passage of the time range is greater than the percentage of use of the storage space, according to the above-mentioned merger rule, the number of the materials to be merged is reduced, and the quantity is merged, and the data is combined.

從另一觀點來看,本發明提出一種合併資料的方法,係應用於一電子裝置。而電子裝置具有預設的儲存空間的儲存模組,並在預設的時間範圍內接收來自於遠端的伺服器所傳輸的複數筆資料。上述方法首先將時間範圍劃分為多個時間檢查點。接著,於每一個時間檢查點監測儲存模組的儲存空間的使用狀況。當儲存空間的使用狀況達到預設條件時,將此時的時間檢查點及下一次時間檢查點之間所接收的資料依據預設的合併規則進行處理後,再將經過處理之後的資料更新至儲存模組。From another point of view, the present invention proposes a method of merging data applied to an electronic device. The electronic device has a storage module with a preset storage space, and receives a plurality of pieces of data transmitted by the server from the remote end within a preset time range. The above method first divides the time range into multiple time checkpoints. Then, the usage status of the storage space of the storage module is monitored at each time checkpoint. When the usage status of the storage space reaches the preset condition, the data received between the time check point and the next time check point at this time is processed according to the preset merge rule, and then the processed data is updated to Storage module.

在本發明之一實施例中,合併資料的方法更包括提供一個暫存空間,以暫時儲存所接收的資料,之後再將這些資料更新至儲存模組內。In an embodiment of the present invention, the method for merging data further includes providing a temporary storage space for temporarily storing the received data, and then updating the data to the storage module.

在本發明之一實施例中,上述預設條件是依據儲存空間的使用百分比以及時間範圍的經過百分比所建立。In an embodiment of the invention, the preset condition is established according to the percentage of use of the storage space and the percentage of the time range.

在本發明之一實施例中,上述依據合併規則進行處理的步驟,包括當時間範圍的經過百分比小於或等於儲存空間的使用百分比時,依據合併規則,增加這些資料欲進行合併的一數量,而以此數量為合併的單位,合併這些資料。另外,當時間範圍的經過百分比大於儲存空間的使用百分比時,依據合併規則,減少上述資料欲進行合併的一數量,而以此數量為合併的單位,合併這些資料。此外,當時間範圍的經過百分比小於或等於儲存空間的使用百分比時,更可依據合併規則,決定上述資料欲進行合併的優先順序,以依據優先順序合併這些資料。In an embodiment of the present invention, the step of processing according to the merging rule includes: when the percentage of passage of the time range is less than or equal to the percentage of use of the storage space, increasing the quantity to be merged according to the merging rule, and Combine these materials with the quantity as the unit of consolidation. In addition, when the percentage of passage of the time range is greater than the percentage of use of the storage space, according to the merger rule, the amount of the above-mentioned data to be merged is reduced, and the quantity is merged, and the data is combined. In addition, when the percentage of passage of the time range is less than or equal to the percentage of use of the storage space, the priority order of the above materials to be merged may be determined according to the merger rule to merge the materials according to the priority order.

在本發明之一實施例中,上述將經過處理之後的資料更新至儲存模組的步驟,更可調整儲存模組的儲存格式,以儲存這些資料。而儲存格式例如為2位元組、4位元組、8位元組或16位元組。In an embodiment of the present invention, the step of updating the processed data to the storage module may further adjust the storage format of the storage module to store the data. The storage format is, for example, 2 bytes, 4 bytes, 8 bytes, or 16 bytes.

另外,本發明提出一種合併資料的方法,係應用於一電子裝置。此電子裝置係連接於遠端的股市即時交易資訊伺服器,在電子裝置中具有預設儲存空間的儲存模組,以在預設的交易時間範圍內接收來自於股市即時交易資訊伺服器所傳輸的複數筆即時交易資料。上述方法首先將交易時間範圍劃分為多個時間檢查點。接著,於到達每一個時間檢查點時執行監測儲存模組的儲存空間的使用狀況。當儲存空間的使用狀況達到預設條件時,將此時的時間檢查點及下一次時間檢查點之間所接收的即時交易資料依據預設的合併規則進行處理後,再將經過處理之後的即時交易資料更新至儲存模組。In addition, the present invention provides a method of merging data applied to an electronic device. The electronic device is connected to the remote stock market real-time transaction information server, and the storage module having the preset storage space in the electronic device is configured to receive the information transmitted from the stock market real-time transaction information server within a preset transaction time range. Multiple instant transaction data. The above method first divides the trading time range into multiple time checkpoints. Then, the usage status of the storage space of the monitoring storage module is executed when each time check point is reached. When the usage status of the storage space reaches the preset condition, the real-time transaction data received between the time check point and the next time check point at this time is processed according to the preset merge rule, and then the processed instant is processed. The transaction data is updated to the storage module.

本發明另提供一種電腦程式產品,其係用以執行上述合併資料的方法,此電腦程式產品基本上是由多數個程式碼片段所組成,並且這些程式碼片段在載入電子裝置中並執行之後,即可完成上述合併資料的方法。The present invention further provides a computer program product for performing the above method of merging data. The computer program product is basically composed of a plurality of code segments, and the code segments are loaded into an electronic device and executed. , the method of merging the above materials can be completed.

綜上所述,本發明加入時間因素來判斷儲存模組的使用狀況,據此來決定是否合併自遠端伺服器所接收的資料。如此一來,資料的合併將不會集中於預設時間範圍的後半段,而能夠均勻分布在預設時間範圍內,以讓使用者不易察覺。In summary, the present invention adds time factors to determine the usage status of the storage module, and accordingly determines whether to merge the data received from the remote server. In this way, the combination of the data will not be concentrated in the second half of the preset time range, but can be evenly distributed within the preset time range, so that the user is not easy to detect.

為讓本發明之上述特徵和優點能更明顯易懂,下文特舉較佳實施例,並配合所附圖式,作詳細說明如下。The above described features and advantages of the present invention will be more apparent from the following description.

為了使本發明之內容更為明瞭,以下特舉實施例作為本發明確實能夠據以實施的範例。In order to clarify the content of the present invention, the following specific examples are given as examples in which the present invention can be implemented.

圖1是依照本發明一實施例之電子裝置的方塊圖。請參照圖1,電子裝置100包括接收模組110、暫存空間120、儲存模組130以及運算模組140。在本實施例中,運算模組140是用以將接收模組110所接收的複數筆資料儲存至儲存模組130中。1 is a block diagram of an electronic device in accordance with an embodiment of the present invention. Referring to FIG. 1 , the electronic device 100 includes a receiving module 110 , a temporary storage space 120 , a storage module 130 , and an operation module 140 . In the embodiment, the computing module 140 is configured to store the plurality of data received by the receiving module 110 into the storage module 130.

詳細地說,接收模組110會在預設的時間範圍(例如,每天的9:00至16:00)內,經由有線或無線的方式接收來自於遠端的伺服器(未繪示)所傳輸的複數筆資料。暫存空間120是用來暫時儲存接收模組110所接收的資料,以使運算模組140將這些資料更新至儲存模組130內,其中暫存空間120亦可直接由儲存模組130內劃分一部分的儲存空間所構成。儲存模組130(例如為記憶體)具有預設的儲存空間,以儲存接收模組110所接收的資料。In detail, the receiving module 110 receives a server (not shown) from a remote end via a wired or wireless manner within a preset time range (eg, 9:00 to 16:00 every day). Multiple data transmitted. The temporary storage space 120 is used to temporarily store the data received by the receiving module 110, so that the computing module 140 updates the data to the storage module 130. The temporary storage space 120 can also be directly divided by the storage module 130. Part of the storage space is formed. The storage module 130 (for example, a memory) has a preset storage space for storing the data received by the receiving module 110.

另外,運算模組140會將預設的時間範圍劃分為多個時間檢查點,並於每一個時間檢查點監測儲存模組130的儲存空間的使用狀況。當儲存模組130的儲存空間的使用狀況達到預設條件時,運算模組140會將此時的時間檢查點及下一次時間檢查點之間所接收的資料依據預設的合併規則進行處理後,再將經過處理之後的資料更新至儲存模組130。In addition, the computing module 140 divides the preset time range into a plurality of time check points, and monitors the usage status of the storage space of the storage module 130 at each time check point. When the usage status of the storage space of the storage module 130 reaches a preset condition, the operation module 140 processes the data received between the time check point and the next time check point according to a preset merge rule. And processing the processed data to the storage module 130.

舉例來說,運算模組140可將9:00至16:00劃分為41個時間檢查點,而運算模組140便自早上9:00開始每隔10分鐘便檢查儲存空間的使用狀況,以決定是否依據預設的合併規則將暫存空間120中的資料合併再儲存至儲存模組130。也就是說,運算模組140會在時間到達9:10、9:20、……、15:40、15:50時,檢查儲存空間的使用狀況。For example, the operation module 140 can divide the time from 9:00 to 16:00 into 41 time check points, and the operation module 140 checks the usage of the storage space every 10 minutes from 9:00 in the morning to It is determined whether the data in the temporary storage space 120 is merged and stored in the storage module 130 according to a preset merge rule. That is to say, the operation module 140 checks the usage status of the storage space when the time reaches 9:10, 9:20, ..., 15:40, and 15:50.

相對於前述的電子裝置100,本發明亦提供對應的合併資料的方法,以下則搭配上述電子裝置100中的各個元件,再舉一實施例詳細說明之。圖2是依照本發明一實施例之合併資料的方法流程圖。請同時參照圖1及圖2,首先,在步驟S210中,運算模組140將預設的時間範圍劃分為多個時間檢查點。Compared with the foregoing electronic device 100, the present invention also provides a corresponding method for merging data, and the following is a detailed description of each component in the electronic device 100. 2 is a flow chart of a method of merging materials in accordance with an embodiment of the present invention. Referring to FIG. 1 and FIG. 2 simultaneously, first, in step S210, the operation module 140 divides the preset time range into a plurality of time check points.

接著,如步驟S220所示,運算模組140便可於每一個時間檢查點監測儲存模組130的儲存空間的使用狀況(例如,儲存空間的使用百分比)。換言之,運算模組140可在每經過一段時間便檢查儲存模組130的儲存空間目前的使用狀況。在此,上述時間檢查點兩兩相隔的時間長可以相同,亦可視情況為不同。此外,時間檢查點的設置可以為預設所定義,亦可由使用者自行定義。Then, as shown in step S220, the operation module 140 can monitor the usage status of the storage space of the storage module 130 (for example, the percentage of use of the storage space) at each time checkpoint. In other words, the computing module 140 can check the current usage status of the storage space of the storage module 130 every time period. Here, the time lengths of the above-mentioned time check points may be the same, and may be different depending on the situation. In addition, the time checkpoint settings can be defined by default or by the user.

接著,在步驟S230中,當儲存空間的使用狀況達到預設條件時,運算模組140會將此時的時間檢查點及下一次時間檢查點之間所接收的資料依據預設的合併規則進行處理後,再將經過處理之後的資料更新至儲存模組130。Next, in step S230, when the usage status of the storage space reaches a preset condition, the operation module 140 performs the data received between the time check point and the next time check point at this time according to a preset merge rule. After processing, the processed data is updated to the storage module 130.

舉例來說,當運算模組140於早上10:00監測到儲存空間的使用百分比達到預設條件時,運算模組140會將10:00至10:10之間接收模組110所接收的資料(此時所接收的資料將暫時儲存於暫存空間120中)合併,例如將兩筆資料合併為一筆資料。之後,運算模組140再將合併後的資料儲存至儲存模組130中。For example, when the computing module 140 monitors that the usage percentage of the storage space reaches a preset condition at 10:00 in the morning, the computing module 140 receives the data received by the module 110 between 10:00 and 10:10. (At this time, the received data will be temporarily stored in the temporary storage space 120) merged, for example, two pieces of data are combined into one piece of data. Afterwards, the computing module 140 stores the merged data in the storage module 130.

以下再舉一例詳細說明資料合併的合併規則。圖3是依照本發明另一實施例之合併資料的方法流程圖。請同時參照圖1及圖3,首先,在步驟S305中,運算模組140將預設的時間範圍劃分為多個時間檢查點。據此,如步驟S310所示,運算模組140便可於每一個時間檢查點監測儲存模組130的儲存空間的使用狀況。The following is another example of a merger rule that details the merger of data. 3 is a flow chart of a method of merging materials in accordance with another embodiment of the present invention. Referring to FIG. 1 and FIG. 3 simultaneously, first, in step S305, the operation module 140 divides the preset time range into a plurality of time check points. Accordingly, as shown in step S310, the computing module 140 can monitor the usage status of the storage space of the storage module 130 at each time checkpoint.

接著,在步驟S315中,運算模組140會判斷時間範圍的經過百分比是否小於或等於儲存空間的使用百分比。當運算模組140判斷時間範圍的經過百分比小於或等於儲存空間的使用百分比時,如步驟S320所示,運算模組140會依據合併規則,增加欲進行合併的數量。例如,以等差方式來增加合併的數量,即2筆、3筆、4筆等。Next, in step S315, the operation module 140 determines whether the percentage of the passage of the time range is less than or equal to the percentage of use of the storage space. When the computing module 140 determines that the percentage of the time range is less than or equal to the usage percentage of the storage space, as shown in step S320, the computing module 140 increases the number of combinations to be merged according to the merge rule. For example, the number of mergers is increased by the difference method, that is, 2 strokes, 3 strokes, 4 strokes, and the like.

之後,在步驟S325中,運算模組140以上述所增加的數量為合併單位,合併所接收的資料。進一步地說,當達到合併條件(即,時間範圍的經過百分比小於或等於儲存空間的使用百分比)之後,接收模組110所接收的資料將先暫時存放於暫存空間120。當暫存空間120所存放之資料的數量滿足合併規則中的數量時,運算模組140再將這些資料取出以進行合併。之後,運算模組再將合併後的資料儲存至儲存模組130。Thereafter, in step S325, the operation module 140 merges the received data by using the increased number as a unit of combination. Further, after the merging condition is reached (ie, the percentage of the time range is less than or equal to the usage percentage of the storage space), the data received by the receiving module 110 is temporarily stored in the temporary storage space 120. When the quantity of data stored in the temporary storage space 120 satisfies the quantity in the merge rule, the operation module 140 then extracts the data for merging. Afterwards, the computing module stores the merged data to the storage module 130.

舉例來說,在接收模組110開始自遠端伺服器接收資料時,運算模組110可直接將接收到的資料儲存至儲存模組130中。當到達合併條件時,運算模組140便會將欲合併的資料數量加1,而將2筆資料合併為1筆資料。此時,運算模組140會先將接收模組110所接收的資料暫時存放至暫存空間120,待暫存空間120中存有2筆資料時,便將此兩筆資料取出進行合併。之後,運算模組再將合併後的資料儲存至儲存模組130。而當欲合併的資料數量設定增加為3筆時,運算模組140會在暫存空間120存有3筆資料時,再將此3筆資料取出進行合併,以此類推。For example, when the receiving module 110 starts receiving data from the remote server, the computing module 110 can directly store the received data into the storage module 130. When the merge condition is reached, the operation module 140 adds 1 to the amount of data to be merged, and combines 2 data into one data. At this time, the computing module 140 temporarily stores the data received by the receiving module 110 into the temporary storage space 120. When two data are stored in the temporary storage space 120, the two data are taken out and combined. Afterwards, the computing module stores the merged data to the storage module 130. When the number of data to be merged is increased to three, the computing module 140 will extract and merge the three data in the temporary storage space 120, and so on.

在步驟S325中,包含有另一種實施方式,當達到合併條件(即,時間範圍的經過百分比小於或等於儲存空間的使用百分比)之後,接收模組110所接收的欲合併的資料將先暫時及直接合併存放於暫存空間120。當暫存空間120所存放及已合併之資料的數量滿足合併規則中的數量時,運算模組140再將這些資料再將合併後的資料儲存至儲存模組130。In step S325, another embodiment is included. After the merge condition is reached (ie, the percentage of the time range is less than or equal to the usage percentage of the storage space), the data to be combined received by the receiving module 110 will be temporarily The direct merge is stored in the temporary storage space 120. When the quantity of the data stored in the temporary storage space 120 and the merged data meets the quantity in the merge rule, the operation module 140 stores the merged data in the storage module 130.

舉例來說,運算模組140會先將接收模組110所接收的待合併的第1筆資料暫時存放至暫存空間120,待接收模組110接收到待合併的第2筆資料時,即直接與暫存空間120中的第1筆資料進行合併,例如以加總方式執行資料的合併。之後,運算模組140再將合併後的資料儲存至儲存模組130,並同時將暫存空間120內部原儲存的資料刪除及資料的數量歸零。同理,當欲合併的資料數量設定增加為3筆時,運算模組140於接收到欲合併的第1筆資料時會先暫時儲存於暫存空間120;續當接收到欲合併的第2筆資料時,即將第2筆資料直接與儲存空間120內的第1筆資料進行合併;最後,當接收到欲合併的第3筆資料時,則同樣地將第3筆資料直接與儲存空間120內的第1筆與第2筆已合併的資料再以前述相同的手段進行合併,運算模組140再將合併後的資料儲存至儲存模組130,並同時將暫存空間120內部原儲存的資料刪除及資料的數量歸零,以此類推。For example, the computing module 140 first temporarily stores the first data to be merged received by the receiving module 110 into the temporary storage space 120, and when the receiving module 110 receives the second data to be merged, The first data in the temporary storage space 120 is directly merged, for example, the aggregation of the data is performed in a cumulative manner. Then, the computing module 140 stores the merged data in the storage module 130, and simultaneously deletes the original data stored in the temporary storage space 120 and zeros the amount of the data. Similarly, when the number of data to be merged is increased to three, the computing module 140 temporarily stores the first data to be merged in the temporary storage space 120; and continues to receive the second to be merged. In the case of pen data, the second data is directly merged with the first data in the storage space 120; finally, when the third data to be merged is received, the third data is directly directly connected to the storage space 120. The first and second merged data are merged in the same manner as described above, and the computing module 140 stores the merged data in the storage module 130 and simultaneously stores the internal storage space 120. Data deletion and the amount of data are zeroed, and so on.

而在本實施例中,運算模組140可調整儲存模組130的儲存格式,以儲存這些資料。而儲存格式例如為2位元組(短格式)、4位元組(中格式)、8位元組(長格式)或16位元組(特長格式)。例如,短格式裡的一個位元是用來記錄兩筆資料的差值。而中格式用來記錄兩筆資料之差值則可為16位元。而長格式則可利用32位元來記錄。據此,當儲存格式越大,所能夠存放值便越大。In the embodiment, the computing module 140 can adjust the storage format of the storage module 130 to store the data. The storage format is, for example, 2-byte (short format), 4-byte (medium format), 8-byte (long format), or 16-byte (long format). For example, a bit in a short format is used to record the difference between two pieces of data. The difference between the two formats used to record two pieces of data can be 16 bits. The long format can be recorded using 32 bits. Accordingly, the larger the storage format, the larger the value that can be stored.

值得一提的是,在本實施例中,當時間範圍的經過百分比小於或等於儲存空間的使用百分比時,運算模組140更可依據合併規則,決定這些資料欲進行合併的優先順序,而依據此一優先順序,合併所接收的資料。並且在合併效果不佳時(例如時間範圍的經過百分比依舊小於或等於儲存空間的使用百分比),運算模組140則將再次採用多筆資料合併的機制。It is to be noted that, in this embodiment, when the percentage of the time range is less than or equal to the usage percentage of the storage space, the operation module 140 may further determine the priority order of the data to be merged according to the merge rule, and This prioritization merges the received data. And when the merge effect is not good (for example, the percentage of the time range is still less than or equal to the usage percentage of the storage space), the operation module 140 will again adopt a multi-data merge mechanism.

舉例來說,假設接收模組110接收商品A、商品B與商品C的資料,運算模組140便可根據上述商品預先設定的優先順序(或者可由使用者自行設定),來合併所接收的資料。假設預先設定的優先順序為商品A>商品B>商品C。當運算模組140判斷已到達合併條件時,便將商品A的資料以2筆為單位進行合併。之後,若在後續的時間檢查點仍舊是符合合併條件時,依據優先順序,將商品A、商品B的資料以2筆為單位進行合併。倘若商品A、商品B與商品C中的資料皆分別以2筆為單位進行合併,而在下一次的時間檢查點仍舊是符合合併條件時,便將商品A的資料以3筆為單位進行合併。For example, if the receiving module 110 receives the data of the product A, the product B, and the product C, the computing module 140 may merge the received data according to the priority order preset by the product (or may be set by the user). . It is assumed that the priority order set in advance is item A> item B> item C. When the operation module 140 determines that the merge condition has been reached, the data of the item A is merged in units of two. After that, if the checkpoint is still in compliance with the merge condition at the subsequent time, the materials of the commodity A and the commodity B are combined in units of 2 in accordance with the priority order. If the materials in commodity A, commodity B, and commodity C are combined in two units, and the next time checkpoint is still eligible for the merger, the data of commodity A is combined in three units.

回到步驟S315,當時間範圍的經過百分比大於儲存空間使用的百分比時,如步驟S330所示,運算模組140將先判斷目前所接收的資料是否已開始進行合併。若尚未開始進行合併,則如步驟S345所示,運算模組140直接將接收模組110所接收的資料儲存至儲存模組130。Going back to step S315, when the percentage of passage of the time range is greater than the percentage of storage space usage, as shown in step S330, the operation module 140 first determines whether the currently received data has begun to merge. If the merging has not been started, the computing module 140 directly stores the data received by the receiving module 110 to the storage module 130 as shown in step S345.

倘若運算模組140已經開始進行資料的合併時,如步驟S335所示,運算模組140會依據合併規則來減少欲進行合併的數量。例如,以等差方式來減少合併的數量,即3筆、2筆、1筆等。之後,在步驟S340中,運算模組140以上述所減少的數量為合併單位,合併所接收的資料,以將合併後之資料儲存至儲存模組130。If the computing module 140 has started to merge the data, as shown in step S335, the computing module 140 reduces the number of combinations to be merged according to the merge rule. For example, the number of merges is reduced by an equal difference, that is, 3 strokes, 2 strokes, 1 stroke, and the like. Then, in step S340, the computing module 140 merges the received data with the reduced number as a unit of consolidation to store the merged data to the storage module 130.

同樣地,當運算模組140已經開始進行資料的合併時,運算模組140亦可依據合併規則,決定這些資料減少欲進行合併的優先順序,並依據此一優先順序,合併所接收的資料。Similarly, when the computing module 140 has begun to merge data, the computing module 140 may also determine, according to the merge rule, that the data reduces the priority order to be merged, and merge the received data according to the priority order.

換言之,當下一次時間檢查點未達到合併條件時,則表示儲存模組130目前的儲存空間可以容納較之前多的資料。因此,運算模組140便可將合併的數量減少。例如先前為將3筆資料合併為1筆資料,此時便減少為將2筆資料合併為1筆資料。In other words, when the next time checkpoint does not reach the merge condition, it indicates that the current storage space of the storage module 130 can accommodate more data than before. Therefore, the computing module 140 can reduce the number of merges. For example, in order to merge 3 pieces of data into 1 piece of data, it is reduced to combine 2 pieces of data into 1 piece of data.

最後,如步驟S350所示,運算模組140檢查目前的時間檢查點是否為最後一個時間檢查點。若已到達最後一個時間檢查點,則結束合併資料的流程。若尚未到達最後一個時間檢查點,則返回重複執行步驟S310直到最後一個時間檢查點。Finally, as shown in step S350, the operation module 140 checks if the current time checkpoint is the last time checkpoint. If the last time checkpoint has been reached, the process of merging the data ends. If the last time checkpoint has not been reached, then return to step S310 until the last time checkpoint.

值得注意的是,在本實施例中,儲存在儲存模組130中已合併的資料,將不會再有所變動,所變動者為目前的時間檢查點至下一次時間檢查點之間儲存在暫存空間120的資料。以時間檢查點9:10至時間檢查點9:20而言,在9:10~9:20之間,運算模組140會將接收模組110接收到的資料暫時存放在暫存空間120,待暫存空間120中的資料之數量達到合併之數量時再取出進行合併。It should be noted that, in this embodiment, the data stored in the storage module 130 will not be changed any more, and the changed one is stored between the current time check point and the next time check point. The data of the temporary storage space 120. The time interval 9:10 to the time check point 9:20, between 9:10 and 9:20, the computing module 140 temporarily stores the data received by the receiving module 110 in the temporary storage space 120. When the quantity of the data in the temporary storage space 120 reaches the combined quantity, it is taken out and merged.

本發明更可應用於單向股票機中,以股票機而言,固定一個開收盤時間(也就是上述預設的時間範圍),而在股市開盤至收盤的交易時間範圍內盡量把有限的記憶體(即儲存模組130)做最佳的運用。The invention can be further applied to a one-way stock machine, in the case of a stock machine, fixing an opening and closing time (that is, the above-mentioned preset time range), and trying to limit the memory within the trading time range from the opening to the closing of the stock market. The body (ie, the storage module 130) is optimally used.

以下即以股票機為例,再舉一實施例說明用以設定資料儲存規則的方法。圖4是依照本發明一實施例之設定資料儲存規則的方法流程圖。請同時參照圖1及圖4,在本實施例中,電子裝置100為一股票機,其連接至遠端的股市即時交易資訊伺服器(未繪示),並藉由接收模組110在預設的交易時間範圍內接收來自於股市即時交易資訊伺服器所傳輸的複數筆即時交易資料。In the following, the stock machine is taken as an example, and another embodiment is used to describe a method for setting a data storage rule. 4 is a flow chart of a method for setting a data storage rule according to an embodiment of the invention. Referring to FIG. 1 and FIG. 4 simultaneously, in the embodiment, the electronic device 100 is a stock machine connected to a remote stock market real-time transaction information server (not shown), and is pre-processed by the receiving module 110. Receives multiple real-time transaction data transmitted from the stock market real-time trading information server within the trading time range.

首先,在步驟S405中,運算模組140將預設的交易時間範圍劃分為多個時間檢查點。據此,如步驟S410所示,運算模組140便可於每一個時間檢查點時,檢查儲存模組130的儲存空間的使用狀況。以開盤時間為9:00,收盤時間為16:00為例,將9:00~16:00劃分為41個時間檢查點,也就是每隔10分鐘檢查一次。First, in step S405, the operation module 140 divides the preset transaction time range into a plurality of time check points. Accordingly, as shown in step S410, the computing module 140 can check the usage status of the storage space of the storage module 130 at each time checkpoint. Take the opening time of 9:00 and the closing time of 16:00 as an example. The 9:00~16:00 will be divided into 41 time checkpoints, that is, every 10 minutes.

接著,在步驟S415中,運算模組140會判斷儲存空間的使用百分比是否大於時間範圍的經過百分比。例如,在早上9:10,依據所經過的交易時間佔交易時間範圍的百分比(即1/42),與儲存模組130的已使用的儲存空間佔全部的儲存空間的百分比來判斷是否需要將即時交易資料合併。Next, in step S415, the operation module 140 determines whether the percentage of use of the storage space is greater than the percentage of the time range. For example, at 9:10 in the morning, depending on the transaction time elapsed as a percentage of the transaction time range (ie, 1/42), it is determined whether the used storage space of the storage module 130 accounts for the percentage of the total storage space. Real-time transaction data is merged.

當運算模組140判斷儲存空間的使用百分比大於時間範圍的經過百分比時,如步驟S420所示,運算模組140將依據商品內容所預先設定的一優先順序,逐漸增加一預合併的商品內容的範圍。而當可合併的範圍皆已成立時,如步驟S425所示,運算模組140將增加即時交易資料欲合併之筆數。When the computing module 140 determines that the usage percentage of the storage space is greater than the percentage of the time range, as shown in step S420, the computing module 140 gradually adds a pre-consolidated product content according to a priority order preset by the product content. range. When the range of merging is established, as shown in step S425, the operation module 140 increases the number of real-time transaction data to be merged.

上述優先順序例如是股市交易中各項商品的總量或成交筆數,或者此商品是否為非漲跌停股或非自選股等資料內容。舉例來說,圖5是依照本發明一實施例之合併資料的優先順序的示意圖。請參照圖5,在本實施例中可將優先順序由大至小設定為:不進行合併、成交量小於設定比率進行合併、成交筆數小於設定比率進行合併、非漲跌停股票進行合併、非自選股進行合併等資料內容。當上述合併範圍皆成立時,再調整合併筆數為三筆併一筆、調整合併筆數四筆併一筆等直到合併筆數到達所設定的上限值為止。並且亦可選擇設定自選股永遠不合併。The above priority order is, for example, the total amount of goods or the number of transactions in the stock market transaction, or whether the commodity is non-renewed or non-selected stocks and the like. For example, FIG. 5 is a schematic diagram of a prioritization of merged materials in accordance with an embodiment of the present invention. Referring to FIG. 5, in this embodiment, the priority order may be set from large to small: no merge, volume is less than the set ratio, merge, the number of transactions is less than the set ratio, and the non-ups and downs are merged. Non-self-selected stocks are combined and other information. When the above combination range is established, the number of combined pens is adjusted to three strokes and one stroke, and the number of merged pens is adjusted to be four strokes until the combined number reaches the set upper limit value. And you can also choose to set the stocks to never merge.

也就是說,運算模組140會先依據優先順序來判斷哪些商品的即時交易資料(例如成交明細)需要先進行合併。例如,根據自選股/非自選股以及冷/熱門股來判斷是否需要合併成交明細。上述冷/熱門股以成交量或成交筆數佔整體市場交易量的百分比(例如門欄值設為0.1%)的多寡及是否漲跌停,當作判斷依據。而若當所有可進行合併之商品皆已進行合併之後記憶體空間仍不足時,則進行多筆成交合併。That is to say, the computing module 140 first determines, according to the priority order, which items of real-time transaction data (such as transaction details) need to be merged first. For example, based on the self-selected stocks/non-selected stocks and cold/hot stocks, it is judged whether or not the transaction details need to be merged. The above-mentioned cold/hot stocks are used as a basis for judging whether the volume of transactions or the number of transactions accounted for a percentage of the total market transaction volume (for example, the threshold value is set to 0.1%). If the memory space is still insufficient after all the items that can be merged have been merged, then multiple transactions are merged.

另外,在本實施例中,更可設定各商品的即時交易資料合併數量的上限值(例如,最多一次可合併達15筆),據以控制即時交易資料被破壞的程度。In addition, in the embodiment, the upper limit value of the combined quantity of the real-time transaction data of each commodity can be set (for example, up to 15 times can be combined at a time), thereby controlling the degree to which the real-time transaction data is destroyed.

回到步驟S415,當儲存空間使用的百分比不大於時間範圍的經過百分比時,如步驟S430所示,運算模組140將先判斷目前所接收的即時交易資料是否已開始進行合併,若已經開始進行資料合併,如步驟S435所示,則減少所增加的合併資料的筆數。之後,在步驟S440中,當可合併筆數達到一下限值時,依照商品設定的優先順序,減少合併範圍。若尚未開始進行合併,則進行到下一步驟S450,判斷是否已達最後一個時間檢查點,若已到達最後一個時間檢查點,則結束設定資料儲存規則的流程。若尚未到達最後一個時間檢查點,則返回重複執行步驟S415直到最後一個時間檢查點。Going back to step S415, when the percentage of the storage space usage is not greater than the percentage of the time range, as shown in step S430, the operation module 140 first determines whether the currently received real-time transaction data has begun to be merged, if it has already started. The data is merged, as shown in step S435, the number of added consolidated data is reduced. Thereafter, in step S440, when the number of combinable pens reaches the lower limit value, the merge range is reduced in accordance with the priority order set by the merchandise. If the merging has not yet started, proceed to the next step S450 to determine whether the last time checkpoint has been reached, and if the last time checkpoint has been reached, the flow of setting the data storage rule is ended. If the last time checkpoint has not been reached, then return to step S415 until the last time checkpoint.

以圖5而言,當可合併筆數已調整為兩筆合併為一筆時,接著便依據“非自選股”來減少合併範圍。In the case of Figure 5, when the number of combinable pens has been adjusted to two pens combined into one, then the non-self-selected shares are used to reduce the scope of the merger.

在經由上述步驟S415~S440的判斷之後,在步驟S445中,運算模組140便可開始設定資料儲存規則,以依據上述儲存規則來儲存接收模組110所接收的即時交易資料。After the determination in the above steps S415 to S440, in step S445, the operation module 140 can start setting the data storage rule to store the real-time transaction data received by the receiving module 110 according to the storage rule.

最後,如步驟S450所示,運算模組140檢查目前的時間檢查點是否為最後一個時間檢查點。若已到達最後一個時間檢查點,則結束合併即時交易資料的流程。若尚未到達最後一個時間檢查點,則返回重複執行步驟S410直到最後一個時間檢查點。Finally, as shown in step S450, the operation module 140 checks if the current time checkpoint is the last time checkpoint. If the last time checkpoint has been reached, the process of merging the instant transaction data is ended. If the last time checkpoint has not been reached, then return to step S410 until the last time checkpoint.

簡單來說,步驟S415~S450是用以在接收資料的過程中,持續對儲存空間的使用狀況進行檢查,並即時改變及設定資料的儲存規則。據此,便可在接收資料的過程中,根據步驟S415~S450所設定的資料儲存規則來檢查所接收資料中是否有屬於合併範圍內的商品,並且依據資料儲存規則來儲存資料。Briefly, steps S415~S450 are used to continuously check the usage status of the storage space during the process of receiving data, and change and set the storage rules of the data in real time. According to this, in the process of receiving the data, according to the data storage rules set in steps S415 to S450, it is checked whether the received data belongs to the goods in the scope of the combination, and the data is stored according to the data storage rule.

以下再舉一實施例來說明儲存資料的詳細步驟。圖6是依照本發明一實施例之儲存資料的方法流程圖。請同時參照圖1及圖6,在步驟S605中,透過運算模組140來檢查接收模組110所接收的即時交易資料是否屬於步驟S445中的資料儲存規則內所預設的合併範圍內的商品。在本實施例中,即時交易資料為商品明細。An additional embodiment will be described below to illustrate the detailed steps of storing data. 6 is a flow chart of a method of storing data in accordance with an embodiment of the present invention. Referring to FIG. 1 and FIG. 6 simultaneously, in step S605, the operation module 140 is used to check whether the real-time transaction data received by the receiving module 110 belongs to the product in the consolidation scope preset in the data storage rule in step S445. . In this embodiment, the real-time transaction data is a product detail.

當商品明細是屬於合併範圍內的商品時,如步驟S610所示,運算模組140將商品明細暫時存放於暫存空間120中。接著,在步驟S615中,運算模組140檢查暫存空間120中的商品明細所累計的筆數是否與資料儲存規則所設定的合併筆數相同。若相同,則如步驟S620所示,運算模組140將商品明細合併之後,再寫入至儲存模組130。若暫存空間120中的商品明細所累計的筆數尚未符合合併筆數時,則待商品明細所累計的筆數符合合併筆數再進行合併動作。When the product details are products belonging to the merged range, the calculation module 140 temporarily stores the product details in the temporary storage space 120 as shown in step S610. Next, in step S615, the operation module 140 checks whether the number of items accumulated in the item details in the temporary storage space 120 is the same as the number of combined items set by the data storage rule. If they are the same, as shown in step S620, the computing module 140 merges the product details and then writes them to the storage module 130. If the number of pens accumulated in the product details in the temporary storage space 120 has not yet met the number of merged pens, the number of pens accumulated in the product details is in accordance with the number of combined pens and then merged.

在本實施例中,運算模組140在將商品明細合併之後,便直接寫入至儲存模組。然而,在其他實施例中,運算模組140亦可先直接將商品明細合併存放於暫存空間120中,若暫存空間120中的商品明細所累計的筆數已符合合併筆數時,運算模組140再將合併後的商品明細寫入至儲存模組130。In this embodiment, the computing module 140 directly writes the product details to the storage module. However, in other embodiments, the operation module 140 may directly store the product details in the temporary storage space 120. If the number of products accumulated in the temporary storage space 120 has been consistent with the number of combined items, the operation is performed. The module 140 then writes the merged product details to the storage module 130.

返回步驟S605,當商品明細不屬於合併範圍內的商品時,如步驟S625所示,運算模組140直接將商品明細寫入至儲存模組130中。Returning to step S605, when the product details do not belong to the product in the merged range, the operation module 140 directly writes the product details into the storage module 130 as shown in step S625.

舉例來說,圖7A~圖7E是依照本發明一實施例之股市商品明細資料的合併示意圖。請參照圖7A~圖7E,在本實施例中以一個商品之成交明細為例,並假設將每兩筆即時交易資料的成交明細中的「單量」內容合併成1筆。For example, FIG. 7A to FIG. 7E are schematic diagrams showing a combination of stock market commodity details according to an embodiment of the present invention. Referring to FIG. 7A to FIG. 7E , in this embodiment, the transaction details of one commodity are taken as an example, and it is assumed that the “single amount” content in the transaction details of each of the two instant transaction materials is merged into one.

圖7A為未合併前之成交明細。圖7B~圖7E為兩筆成交明細中的「單量」內容合併為一筆的實施態樣。當時間經過至13:02時,表示暫存空間120中已存在13:00與13:02兩筆成交明細。因此,便可將13:00與13:02兩筆成交明細合併,寫入至儲存模組130。在另一個實施例中,當時間經過至13:00時,13:00的這1筆成交明細會先暫存至暫存空間120中,續當時間經過至13:02時,13:02這1筆成交明細將直接與暫存空間120中13:00的這1筆成交明細進行合併後,寫入至儲存模組130。Figure 7A is a breakdown of the transaction before the merger. Figures 7B to 7E show the implementation of the "single amount" of the two transaction details into one. When the time passes to 13:02, it indicates that there are two transaction details of 13:00 and 13:02 in the temporary storage space 120. Therefore, the two transaction details of 13:00 and 13:02 can be combined and written to the storage module 130. In another embodiment, when the time passes until 13:00, the 1 transaction details of 13:00 are temporarily stored in the temporary storage space 120, and the time is passed until 13:02, 13:02. One transaction detail will be directly merged with the one transaction detail of 13:00 in the temporary storage space 120, and then written to the storage module 130.

由於合併是屬於破壞性的壓縮,合併的方式亦因資料特性而有不同選擇,可依據使用這所重視之內容來決定合併的內容。例如,以時間、買進、賣出、成交、單量而言,除單量外,合併時僅記錄最後一筆的時間、買進、賣出、成交,而將單量加總。如圖7B的13:02所示之成交明細,13:00的單量2加上13:02的單量28而獲得總量為30。Since the merger is a destructive compression, the way of the merger is also different depending on the characteristics of the data. The content of the merger can be determined based on the content of the application. For example, in terms of time, buy, sell, trade, and quantity, except for the single amount, only the last time, buy, sell, and trade are recorded in the merger, and the total amount is added. As shown in Fig. 7B, the transaction details shown at 13:02, the single quantity 2 at 13:00 plus the single quantity 28 of 13:02 gives a total amount of 30.

接著,在圖7B中,當時間經過至13:05時,暫存空間120中僅存在13:05的成交明細。此時,圖7B的13:02的成交明細已儲存至儲存模組130中。之後,在圖7C中,當時間經過至13:06時,便可將圖7A所示之13:05與13:06兩筆成交明細合併為圖7C之13:06的成交明細,即13:06的總量為3加上9。Next, in FIG. 7B, when the time passes to 13:05, there is only a transaction detail of 13:05 in the temporary storage space 120. At this time, the transaction details of 13:02 of FIG. 7B have been stored in the storage module 130. Then, in FIG. 7C, when the time passes to 13:06, the transaction details of 13:05 and 13:06 shown in FIG. 7A can be merged into the transaction details of 13:06 of FIG. 7C, that is, 13: The total amount of 06 is 3 plus 9.

在圖7D中,當時間經過至13:07時,暫存空間120中僅存在13:07的成交明細。此時,圖7D的13:02與13:06兩筆的成交明細已儲存至儲存模組130中。之後,在圖7E中,當時間經過至13:08時,便可將圖7A所示之13:07與13:08兩筆成交明細合併為圖7E之13:08的成交明細,即13:06的總量為6加上146。In FIG. 7D, when the time passes to 13:07, there is only a transaction detail of 13:07 in the temporary storage space 120. At this time, the transaction details of 13:02 and 13:06 of FIG. 7D have been stored in the storage module 130. Then, in FIG. 7E, when the time passes to 13:08, the two transaction details of 13:07 and 13:08 shown in FIG. 7A can be merged into the transaction details of 13:08 of FIG. 7E, that is, 13: The total amount of 06 is 6 plus 146.

以此類推,當暫存空間120中存在兩筆資料時,便可進行合併之動作。或直接與暫存空間120中已存在的上1筆資料進行合併。By analogy, when there are two pieces of data in the temporary storage space 120, the merge action can be performed. Or merge directly with the previous data that already exists in the temporary storage space 120.

另外,上述合併資料的方法可藉由一電腦程式產品來執行之。此電腦程式產品基本上是由多數個程式碼片段所組成,並且這些程式碼片段在載入電子裝置中並執行之後,即可完成上述合併資料的方法。In addition, the above method of merging data can be performed by a computer program product. The computer program product basically consists of a plurality of code segments, and after the code segments are loaded into the electronic device and executed, the method for combining the data can be completed.

綜上所述,在上述實施例中,加入時間因素來作為資料合併的判斷依據,以避免單就儲存模組來判斷而使得資料合併集中在後半段,讓使用者不易察覺資料的合併。以股市即時交易而言,隨著每日交易成交量的不同,有熱絡也有可能交易平淡,藉由上述實施例便可在有限儲存模組的環境下,並於時間檢查點到達前,仍保持能夠揭露相當的資訊。並且,在交易量大時,不會讓儲存模組之儲存空間迅速耗盡。In summary, in the above embodiment, the time factor is added as the basis for judging the data merge, so as to avoid the single storage module to judge and make the data merge in the second half, so that the user is not easy to perceive the merge of the data. In the case of real-time stock trading, as the daily trading volume is different, there may be a dull trading with the hot network. The above embodiment can be used in the environment of limited storage modules and before the time checkpoint arrives. Keep being able to expose considerable information. Moreover, when the transaction volume is large, the storage space of the storage module will not be exhausted.

雖然本發明已以較佳實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明之精神和範圍內,當可作些許之更動與潤飾,因此本發明之保護範圍當視後附之申請專利範圍所界定者為準。Although the present invention has been disclosed in the above preferred embodiments, it is not intended to limit the invention, and any one of ordinary skill in the art can make some modifications and refinements without departing from the spirit and scope of the invention. Therefore, the scope of the invention is defined by the scope of the appended claims.

100...電子裝置100. . . Electronic device

110...接收模組110. . . Receiving module

120...暫存空間120. . . Scratch space

130...儲存模組130. . . Storage module

140...運算模組140. . . Computing module

S210~S230...本發明一實施例之合併資料的方法各步驟S210~S230. . . Method for merging data according to an embodiment of the present invention

S305~S350...本發明另一實施例之合併資料的方法各步驟S305~S350. . . Method for combining data in another embodiment of the present invention

S405~S450...本發明一實施例之設定資料儲存規則的方法各步驟S405~S450. . . Method for setting data storage rule according to an embodiment of the present invention

S605~S625...本發明一實施例之儲存資料的方法各步驟S605~S625. . . Method for storing data according to an embodiment of the present invention

圖1是依照本發明一實施例之電子裝置的方塊圖。1 is a block diagram of an electronic device in accordance with an embodiment of the present invention.

圖2是依照本發明一實施例之合併資料的方法流程圖。2 is a flow chart of a method of merging materials in accordance with an embodiment of the present invention.

圖3是依照本發明另一實施例之合併資料的方法流程圖。3 is a flow chart of a method of merging materials in accordance with another embodiment of the present invention.

圖4是依照本發明一實施例之設定資料儲存規則的流程圖。4 is a flow chart of setting data storage rules in accordance with an embodiment of the present invention.

圖5是依照本發明一實施例之合併資料的優先順序的示意圖。Figure 5 is a schematic illustration of the prioritization of merged material in accordance with an embodiment of the present invention.

圖6是依照本發明一實施例之儲存資料的方法流程圖。6 is a flow chart of a method of storing data in accordance with an embodiment of the present invention.

圖7A~圖7E是依照本發明一實施例之股市商品明細的合併示意圖。7A-7E are schematic diagrams showing a combination of stock market commodity details in accordance with an embodiment of the present invention.

S210~S230...本發明一實施例之合併資料的方法各步驟S210~S230. . . Method for merging data according to an embodiment of the present invention

Claims (34)

一種合併資料的方法,係應用於一電子裝置,該電子裝置具有一預設的儲存空間的儲存模組,並在一預設的時間範圍內接收來自於一遠端的伺服器所傳輸的複數筆資料,該方法包括有下列步驟:將該時間範圍劃分為多個時間檢查點;於每一個時間檢查點監測該儲存模組的儲存空間的使用狀況;以及當該儲存空間的使用狀況達到一預設條件時,將該時間檢查點及下一次時間檢查點之間所接收的該些資料依據一預設的合併規則進行處理後,再將經過處理之後的該些資料更新至該儲存模組。 A method for merging data is applied to an electronic device having a storage module of a predetermined storage space and receiving a plurality of packets transmitted from a remote server within a preset time range The method includes the following steps: dividing the time range into a plurality of time check points; monitoring the use condition of the storage space of the storage module at each time check point; and when the use condition of the storage space reaches one When the preset condition is met, the data received between the time check point and the next time check point is processed according to a preset merge rule, and then the processed data is updated to the storage module. . 如申請專利範圍第1項所述之合併資料的方法,更包括:提供一暫存空間,以暫時儲存所接收的該些資料後,再將該些資料更新至該儲存模組內。 The method for merging the data as described in claim 1 further includes: providing a temporary storage space for temporarily storing the received data and updating the data to the storage module. 如申請專利範圍第1項所述之合併資料的方法,其中該預設條件是依據判斷該儲存空間的使用百分比以及該時間範圍的經過百分比所建立。 The method for merging materials according to claim 1, wherein the preset condition is established according to determining a percentage of use of the storage space and a percentage of the time range. 如申請專利範圍第3項所述之合併資料的方法,其中當該儲存空間的使用狀況達到該預設條件時,將該時間檢查點及下一次時間檢查點之間所接收的該些資料依據該合併規則進行處理的步驟,包括:當判斷該時間範圍的經過百分比小於或等於該儲存空 間的使用百分比時,依據該合併規則,增加該些資料欲進行合併的一數量,而以該數量為合併的單位,合併該些資料。 The method for merging materials according to claim 3, wherein when the usage status of the storage space reaches the preset condition, the data received between the time check point and the next time check point is based on The step of processing the merge rule includes: when determining that the percentage of the time range is less than or equal to the storage space In the case of the percentage of use, according to the merger rule, the quantity to be merged is added, and the quantity is merged, and the data is combined. 如申請專利範圍第3項所述之合併資料的方法,其中當該儲存空間的使用狀況達到該預設條件時,將該時間檢查點及下一次時間檢查點之間所接收的該些資料依據該合併規則進行處理的步驟,包括:當判斷該時間範圍的經過百分比大於該儲存空間的使用百分比時,依據該合併規則,減少該些資料欲進行合併的一數量,而以該數量為合併的單位,合併該些資料。 The method for merging materials according to claim 3, wherein when the usage status of the storage space reaches the preset condition, the data received between the time check point and the next time check point is based on The step of processing the merging rule includes: when determining that the percentage of the time range is greater than the usage percentage of the storage space, according to the merging rule, reducing a quantity of the data to be merged, and combining the quantity Unit, merge the information. 如申請專利範圍第3項所述之合併資料的方法,其中當判斷該時間範圍的經過百分比大於該儲存空間的使用百分比時,更包括有下列步驟:判斷是否已進行該些資料的合併;及若判斷已經開始進行該些資料的合併時,依據合併規則,減少該些資料欲進行合併的一數量,而以該數量為合併的單位,合併該些資料。 The method for merging materials according to claim 3, wherein when it is determined that the percentage of passage of the time range is greater than the percentage of use of the storage space, the method further comprises the steps of: determining whether the merging of the materials has been performed; If it is judged that the merging of the materials has been started, according to the merging rule, the amount of the data to be merged is reduced, and the data is merged by the number of the merging units. 如申請專利範圍第6項所述之合併資料的方法,其中更包括有下列步驟:若判斷未開始進行該些資料的合併時,直接儲存所接收的該些資料,並將該些資料更新至該儲存模組。 The method for merging materials according to claim 6 of the patent scope further includes the following steps: if it is judged that the merging of the materials is not started, the received materials are directly stored, and the materials are updated to The storage module. 如申請專利範圍第3項所述之合併資料的方法,其中當該儲存空間的使用狀況達到該預設條件時,將該時間檢查點及下一次時間檢查點之間所接收的該些資料依據該 合併規則進行處理的步驟,包括:當該時間範圍的經過百分比小於或等於該儲存空間的使用百分比時,依據該合併規則,決定該些資料欲進行合併的一優先順序,而依據該優先順序,合併該些資料。 The method for merging materials according to claim 3, wherein when the usage status of the storage space reaches the preset condition, the data received between the time check point and the next time check point is based on The The step of processing the merge rule includes: when the percentage of the time range is less than or equal to the usage percentage of the storage space, determining, according to the merge rule, a priority order for the data to be merged, and according to the priority order, Combine the information. 如申請專利範圍第1項所述之合併資料的方法,其中將經過處理之後的該些資料更新至該儲存模組的步驟,更包括:調整該儲存模組的一儲存格式,以儲存該些資料。 The method for merging the data according to the first aspect of the patent application, wherein the step of updating the processed data to the storage module further comprises: adjusting a storage format of the storage module to store the data. 如申請專利範圍第9項所述之合併資料的方法,其中該儲存格式包括2位元組、4位元組、8位元組以及16位元組其中之一。 The method for merging materials according to claim 9, wherein the storage format comprises one of a 2-byte, a 4-byte, an 8-bit, and a 16-bit. 一種合併資料的方法,係應用於一電子裝置,該電子裝置係連接於一遠端的股市即時交易資訊伺服器,該電子裝置具有一預設的儲存空間的儲存模組,以在一預設的交易時間範圍內接收來自於該股市即時交易資訊伺服器所傳輸的複數筆即時交易資料,該方法包括有下列步驟:將該交易時間範圍劃分為多個時間檢查點;於到達每一個時間檢查點時執行監測該儲存模組的儲存空間的使用狀況;及當該儲存空間的使用狀況達到一預設條件時,將該時間檢查點及下一次時間檢查點之間所接收的該些即時交易資料依據一預設的合併規則進行處理後,再將經過處理之後的該些即時交易資料更新至該儲存模組。 A method for merging data is applied to an electronic device connected to a remote stock market real-time transaction information server, the electronic device having a preset storage space storage module for a preset Receiving a plurality of real-time transaction data transmitted from the stock market real-time transaction information server within the trading time range, the method comprising the steps of: dividing the transaction time range into a plurality of time check points; checking at each time of arrival Performing to monitor the usage status of the storage space of the storage module when the point is used; and when the usage status of the storage space reaches a preset condition, the instant transactions received between the time check point and the next time check point After the data is processed according to a preset merge rule, the processed real-time transaction data is updated to the storage module. 如申請專利範圍第11項所述之合併資料的方法, 更包括:提供一暫存空間,以暫時儲存所接收的該些資料後,再將該些資料更新至該儲存模組內。 For example, the method of combining the materials mentioned in the scope of patent application 11 The method further includes: providing a temporary storage space for temporarily storing the received data, and then updating the data to the storage module. 如申請專利範圍第11項所述之合併資料的方法,其中該預設條件是依據該儲存空間的使用百分比以及該交易時間範圍的經過百分比所建立。 The method for merging materials according to claim 11, wherein the preset condition is established according to a percentage of use of the storage space and a percentage of the transaction time range. 如申請專利範圍第13項所述之合併資料的方法,其中當該儲存空間的使用狀況達到該預設條件時,將該時間檢查點及下一次時間檢查點之間所接收的該些即時交易資料依據該合併規則進行處理的步驟,包括:當判斷該時間範圍的經過百分比小於或等於該儲存空間的使用百分比時,依據該合併規則,增加該些即時交易資料欲進行合併的一數量,而以該數量為合併的單位,合併該些即時交易資料。 The method for merging materials according to claim 13 , wherein when the usage status of the storage space reaches the preset condition, the instant transactions received between the time check point and the next time check point are The step of processing the data according to the merging rule comprises: when determining that the percentage of the time range is less than or equal to the usage percentage of the storage space, according to the merging rule, increasing the quantity of the real-time transaction data to be merged, and Combine the instant transaction data with the quantity as the unit of consolidation. 如申請專利範圍第13項所述之合併資料的方法,其中當該儲存空間的使用狀況達到該預設條件時,將該時間檢查點及下一次時間檢查點之間所接收的該些即時交易資料依據該合併規則進行處理的步驟,包括:當判斷該時間範圍的經過百分比大於該儲存空間的使用百分比時,依據該合併規則,減少該些即時交易資料欲進行合併的一數量,而以該數量為合併的單位,合併該些即時交易資料。 The method for merging materials according to claim 13 , wherein when the usage status of the storage space reaches the preset condition, the instant transactions received between the time check point and the next time check point are The step of processing the data according to the merging rule includes: when determining that the percentage of the time range is greater than the usage percentage of the storage space, according to the merging rule, reducing the quantity of the real-time transaction data to be merged, and The quantity is the combined unit, and the real-time transaction data is merged. 如申請專利範圍第13項所述之合併資料的方法,其中當判斷該時間範圍的經過百分比大於該儲存空間的使 用百分比時,更包括有下列步驟:判斷是否已進行該些資料的合併;及若判斷已經開始進行該些資料的合併時,依據合併規則,減少該些資料欲進行合併的一數量,而以該數量為合併的單位,合併該些資料。 The method for merging materials according to claim 13 wherein the percentage of passage of the time range is greater than the storage space. When the percentage is used, the following steps are further included: judging whether the merging of the materials has been performed; and if it is judged that the merging of the materials has been started, according to the merging rules, reducing the amount of the data to be merged, The quantity is the combined unit and the information is combined. 如申請專利範圍第16項所述之合併資料的方法,其中更包括有下列步驟:若判斷未開始進行該些資料的合併時,直接儲存所接收的該些資料,並將該些資料更新至該儲存模組。 The method for merging materials according to claim 16 further includes the following steps: if it is judged that the merging of the materials is not started, the received materials are directly stored, and the materials are updated to The storage module. 如申請專利範圍第13項所述之合併資料的方法,其中當該儲存空間的使用狀況達到該預設條件時,將該時間檢查點及下一次時間檢查點之間所接收的該些即時交易資料依據該合併規則進行處理的步驟,包括:當該時間範圍的經過百分比小於或等於該儲存空間的使用百分比時,依據該合併規則,決定該些即時交易資料欲進行合併的一優先順序,而依據該優先順序,合併該些即時交易資料。 The method for merging materials according to claim 13 , wherein when the usage status of the storage space reaches the preset condition, the instant transactions received between the time check point and the next time check point are The step of processing the data according to the merging rule includes: when the percentage of the time range is less than or equal to the usage percentage of the storage space, determining a priority order of the real-time transaction materials to be merged according to the merging rule, and According to the priority order, the instant transaction materials are combined. 如申請專利範圍第11項所述之合併資料的方法,其中將經過處理之後的該些即時交易資料更新至該儲存模組的步驟,更包括:調整該儲存模組的一儲存格式,以儲存該些即時交易資料。 The method for merging the data according to claim 11 , wherein the step of updating the processed real-time transaction data to the storage module further comprises: adjusting a storage format of the storage module to store These instant transaction materials. 如申請專利範圍第19項所述之合併資料的方法,其中該儲存格式包括2位元組、4位元組、8位元組以及 16位元組其中之一。 A method for merging materials as described in claim 19, wherein the storage format comprises 2 bytes, 4 bytes, 8 bytes, and One of the 16-bits. 一種電腦程式產品,當電腦載入該電腦程式並執行後,可完成申請專利範圍第1項或第20項所述合併資料的方法。 A computer program product that, when loaded into a computer program and executed, can complete the method of applying for the combined data described in item 1 or item 20 of the patent scope. 一種電子裝置,包括:一儲存模組,具有一預設的儲存空間;一接收模組,在一預設的時間範圍內接收來自於一遠端的伺服器所傳輸的複數筆資料;以及一運算模組,將該時間範圍劃分為多個時間檢查點,並於每一個時間檢查點監測該儲存模組的儲存空間的使用狀況,當該儲存空間的使用狀況達到一預設條件時,將該時間檢查點及下一次時間檢查點之間所接收的該些資料依據一預設的合併規則進行處理後,再將經過處理之後的該些資料更新至該儲存模組。 An electronic device comprising: a storage module having a predetermined storage space; a receiving module receiving a plurality of data transmitted from a remote server within a predetermined time range; and a The operation module divides the time range into a plurality of time check points, and monitors the usage status of the storage space of the storage module at each time check point. When the usage condition of the storage space reaches a preset condition, The data received between the time checkpoint and the next time checkpoint is processed according to a preset merge rule, and then the processed data is updated to the storage module. 如申請專利範圍第22項所述之電子裝置,更包括:一暫存空間,暫時儲存該接收模組所接收的該些資料,以使該運算模組將該些資料更新至該儲存模組內。 The electronic device of claim 22, further comprising: a temporary storage space for temporarily storing the data received by the receiving module, so that the computing module updates the data to the storage module Inside. 如申請專利範圍第22項所述之電子裝置,其中該運算模組更包括當該時間範圍的經過百分比小於或等於該儲存空間的使用百分比時,依據該合併規則,增加該些資料欲進行合併的一數量,而以該數量為合併的單位,合併該些資料,並且當該時間範圍的經過百分比大於該儲存空間的使用百分比時,依據該合併規則,減少該些資料欲進行合併的該數量,而以該數量為合併的單位,合併該些資 料。 The electronic device of claim 22, wherein the computing module further comprises: when the percentage of the time range is less than or equal to the usage percentage of the storage space, adding the data to be merged according to the combining rule a quantity, wherein the quantity is a unit of consolidation, the materials are combined, and when the percentage of passage of the time range is greater than the percentage of use of the storage space, the quantity to be merged is reduced according to the merger rule And the amount is the combined unit, and the funds are combined. material. 如申請專利範圍第22項所述之電子裝置,其中該運算模組更包括當該時間範圍的經過百分比小於或等於該儲存空間的使用百分比時,依據該合併規則,決定該些資料欲進行合併的一優先順序,而依據該優先順序,合併該些資料。 The electronic device of claim 22, wherein the computing module further comprises: when the percentage of the time range is less than or equal to the percentage of use of the storage space, determining the data to be merged according to the combining rule a priority order, and according to the priority order, merge the materials. 一種設定資料儲存規則的方法,係應用於一電子裝置,該電子裝置具有一預設的儲存空間的儲存模組,並在一預設的時間範圍內接收來自於一遠端的伺服器所傳輸的複數筆資料,該方法包括有下列步驟:將該時間範圍劃分為多個時間檢查點,以於每一個時間檢查點監測該儲存模組的儲存空間的使用狀況;當該儲存空間的使用百分比大於該時間範圍的經過百分比時,增加該些資料內容欲進行合併的一範圍,並在該範圍已到達一上限值時,增加該些資料欲進行合併的一數量;以及依據上述欲進行合併的該範圍與該數量,設定一資料儲存規則。 A method for setting a data storage rule is applied to an electronic device having a storage module of a predetermined storage space and receiving a transmission from a remote server within a preset time range. The plurality of data includes the following steps: dividing the time range into a plurality of time check points to monitor the usage of the storage space of the storage module at each time check point; when the storage space is used When the percentage of the time range is greater than the percentage of the time range, the range of the data content to be merged is increased, and when the range has reached an upper limit value, the quantity to be merged is increased; and the combination is performed according to the foregoing The range and the number, set a data storage rule. 如申請專利範圍第26項所述之設定資料儲存規則的方法,其中更包括有依據該些資料內容所設定的一優先順序,並依據該優先順序決定該些資料內容欲進行合併的該範圍。 The method for setting a data storage rule according to claim 26, further comprising a priority order set according to the content of the data, and determining the range of the data content to be merged according to the priority order. 如申請專利範圍第26項所述之設定資料儲存規則的方法,其中當該儲存空間的使用百分比小於等於該時間範圍的經過百分比時,更包括有下列步驟: 判斷是否已進行該些資料的合併;及若判斷已經開始進行該些資料的合併時,依據合併規則,減少該些資料欲進行合併的該數量,並更新該資料儲存規則。 The method for setting a data storage rule according to claim 26, wherein when the percentage of use of the storage space is less than or equal to the percentage of the time range, the following steps are further included: Determining whether the merging of the materials has been performed; and if it is determined that the merging of the materials has begun, according to the merging rules, the number of the materials to be merged is reduced, and the data storage rules are updated. 如申請專利範圍第27項所述之設定資料儲存規則的方法,更包括有下列步驟:當可合併的該數量已到達一下限值時,依據該優先順序,減少該些資料欲進行合併的該範圍,並更新該資料儲存規則。 The method for setting a data storage rule according to claim 27 of the patent application further includes the following steps: when the quantity that can be merged has reached a lower limit, according to the priority order, reducing the data to be merged Scope and update the data storage rules. 如申請專利範圍第27項所述之設定資料儲存規則的方法,其中更包括有下列步驟:若判斷未開始進行該些資料的合併時,檢查目前的該時間檢查點是否為最後一個時間檢查點,若檢查結果為是,則繼續至下一個時間檢查點監測該儲存模組的儲存空間的使用狀況。 The method for setting a data storage rule according to claim 27, further comprising the following steps: if it is determined that the combination of the materials is not started, checking whether the current time check point is the last time check point If the result of the check is yes, proceed to the next time checkpoint to monitor the usage of the storage space of the storage module. 一種儲存資料的方法,係應用於一電子裝置,該電子裝置具有一預設的儲存空間的儲存模組,並在一預設的時間範圍內接收來自於一遠端的伺服器所傳輸的複數筆資料,以及用於暫存該等資料的一暫存空間,該方法包括有下列步驟:檢查每一該些資料是否符合於一預設的資料儲存規則所規定的合併範圍內的資料;當每一該些資料符合該範圍時,將每一該些資料暫存於該暫存空間;檢查該暫存空間中所累計的該些資料的筆數是否與 該資料儲存規則所設定的合併筆數相同;以及若相同,則將該些資料依據該資料儲存規則進行合併,並寫入至該儲存模組中。 A method for storing data is applied to an electronic device having a storage module of a predetermined storage space and receiving a plurality of packets transmitted from a remote server within a predetermined time range. Pen data, and a temporary storage space for temporarily storing the data, the method comprising the steps of: checking whether each of the materials meets the data within the scope of the consolidation specified by a predetermined data storage rule; When each of the materials meets the range, each of the data is temporarily stored in the temporary storage space; and whether the number of the accumulated data in the temporary storage space is checked is The data storage rule sets the same number of merged pens; and if they are the same, the data is merged according to the data storage rule and written into the storage module. 如申請專利範圍第31項所述之儲存資料的方法,其中更包括有下列步驟:當檢查每一該些資料不符合於該資料儲存規則所規定的合併範圍內的資料時,則直接將該些資料寫入至該儲存模組中。 For example, the method for storing data as described in claim 31 of the patent application further includes the following steps: when checking that each of the materials does not meet the data within the scope specified in the data storage rule, Some data is written to the storage module. 一種儲存資料的方法,係應用於一電子裝置,該電子裝置具有一預設的儲存空間的儲存模組,並在一預設的時間範圍內接收來自於一遠端的伺服器所傳輸的複數筆資料,以及用於暫存該等資料的一暫存空間,該方法包括有下列步驟:檢查每一該些資料是否符合於一預設的資料儲存規則所規定的合併範圍內的資料;當每一該些資料符合該範圍時,將每一該些資料直接合併及暫存於該暫存空間中;檢查該暫存空間中所累計的該些資料的筆數是否與該資料儲存規則所設定的合併筆數相同;以及若相同,則將該些資料寫入至該儲存模組中。 A method for storing data is applied to an electronic device having a storage module of a predetermined storage space and receiving a plurality of packets transmitted from a remote server within a predetermined time range. Pen data, and a temporary storage space for temporarily storing the data, the method comprising the steps of: checking whether each of the materials meets the data within the scope of the consolidation specified by a predetermined data storage rule; When each of the materials meets the scope, each of the materials is directly merged and temporarily stored in the temporary storage space; and whether the number of the accumulated data in the temporary storage space is related to the data storage rule The number of combined pens is the same; and if they are the same, the data is written to the storage module. 如申請專利範圍第33項所述之儲存資料的方法,其中更包括有下列步驟:當檢查每一該些資料不符合於該資料儲存規則所規定的合併範圍內的資料時,則直接將該些資料寫入至該儲存模組中。 The method for storing data as described in claim 33, further comprising the steps of: when examining each of the materials that do not comply with the scope of the scope specified in the data storage rule, directly Some data is written to the storage module.
TW98105015A 2009-02-17 2009-02-17 Method for combining data and electronic apparatus and computer program product using the method thereof TWI402747B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW98105015A TWI402747B (en) 2009-02-17 2009-02-17 Method for combining data and electronic apparatus and computer program product using the method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW98105015A TWI402747B (en) 2009-02-17 2009-02-17 Method for combining data and electronic apparatus and computer program product using the method thereof

Publications (2)

Publication Number Publication Date
TW201032128A TW201032128A (en) 2010-09-01
TWI402747B true TWI402747B (en) 2013-07-21

Family

ID=44854788

Family Applications (1)

Application Number Title Priority Date Filing Date
TW98105015A TWI402747B (en) 2009-02-17 2009-02-17 Method for combining data and electronic apparatus and computer program product using the method thereof

Country Status (1)

Country Link
TW (1) TWI402747B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW573250B (en) * 2001-07-27 2004-01-21 Matsushita Electric Ind Co Ltd Flash memory system and method of merge of storage data
TW200604927A (en) * 2004-07-30 2006-02-01 Mediatek Inc Method and apparatus for data recording with pseudo-merge
US7487303B2 (en) * 2005-02-04 2009-02-03 Samsung Electronics Co., Ltd. Flash memory device and associated data merge method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW573250B (en) * 2001-07-27 2004-01-21 Matsushita Electric Ind Co Ltd Flash memory system and method of merge of storage data
TW200604927A (en) * 2004-07-30 2006-02-01 Mediatek Inc Method and apparatus for data recording with pseudo-merge
US7487303B2 (en) * 2005-02-04 2009-02-03 Samsung Electronics Co., Ltd. Flash memory device and associated data merge method

Also Published As

Publication number Publication date
TW201032128A (en) 2010-09-01

Similar Documents

Publication Publication Date Title
US20140215170A1 (en) Block Compression in a Key/Value Store
CN105117351B (en) To the method and device of buffering write data
CN105373369A (en) Asynchronous caching method, server and system
CN108153783A (en) A kind of method and apparatus of data buffer storage
CN113129150A (en) Transaction data processing method and device, terminal device and readable storage medium
WO2024124843A1 (en) Data processing method and apparatus, and device and readable storage medium
CN110175833B (en) Computer device, method, system and medium for binding bank card information
CN106372008A (en) Data caching method and device
US20150212744A1 (en) Method and system of eviction stage population of a flash memory cache of a multilayer cache system
CN116841973A (en) Intelligent data compression method and system for embedded databases
CN102722456B (en) Flash memory device and data writing method thereof
CN111915340B (en) Method, device, equipment and storage medium for identifying merchant type
CN105701645A (en) Material management method and device
CN102508839B (en) Data processing device and data processing method
TWI402747B (en) Method for combining data and electronic apparatus and computer program product using the method thereof
CN111126619A (en) Machine learning method and device
CN104375871B (en) A kind of method and apparatus based on the start of eMMC acceleration systems
CN113836157A (en) Method and device for acquiring incremental data of database
CN108073709B (en) Data recording operation method, device, equipment and storage medium
US7984045B2 (en) Scalable data extraction from data stores
WO2019001333A1 (en) Application interface display method, apparatus and electronic device
CN113626483B (en) Front-end caching method, system, equipment and storage medium for filling forms
CN115114332A (en) Database query method, device and equipment and readable storage medium
CN106502775A (en) The method and system of DSP algorithm is dispatched in a kind of timesharing
CN110825783A (en) Data sampling method, device, equipment and storage medium

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees