TWI521349B - Data writing method of mobile electronic device - Google Patents
Data writing method of mobile electronic device Download PDFInfo
- Publication number
- TWI521349B TWI521349B TW104104120A TW104104120A TWI521349B TW I521349 B TWI521349 B TW I521349B TW 104104120 A TW104104120 A TW 104104120A TW 104104120 A TW104104120 A TW 104104120A TW I521349 B TWI521349 B TW I521349B
- Authority
- TW
- Taiwan
- Prior art keywords
- buffer memory
- electronic device
- portable electronic
- memory
- data
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims description 23
- 239000000872 buffer Substances 0.000 claims description 82
- 230000005540 biological transmission Effects 0.000 description 4
- 230000035484 reaction time Effects 0.000 description 2
- 239000007853 buffer solution Substances 0.000 description 1
- 230000003139 buffering effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Landscapes
- Telephone Function (AREA)
Description
本發明有關於一種資料寫入方法,特別是指一種提升攜帶式電子裝置寫入資料速度之方法。 The invention relates to a data writing method, in particular to a method for improving the speed of writing data of a portable electronic device.
現今許多的攜帶式電子裝置如智慧型手機及平版電腦等,皆可透過內建的一儲存單元,例如安全數位卡(Secure Digital Memory Card,SD card)及/或嵌入式多媒體卡(Embedded Multi Media Card,eMMC)等,以增加攜帶式電子裝置所能提供的儲存空間容量。 Many portable electronic devices, such as smart phones and lithographic computers, can be accessed through a built-in storage unit, such as a Secure Digital Memory Card (SD card) and/or an embedded multimedia card (Embedded Multi Media). Card, eMMC), etc., to increase the storage space capacity that portable electronic devices can provide.
當攜帶式電子裝置在存取外部電子裝置如電腦或另一攜帶式電子裝置等的資料至儲存單元時,該攜帶式電子裝置必須連接外部電子裝置直到資料完整儲存完畢後才能與外部電子裝置中斷連接。習知的攜帶式電子裝置與外部電子裝置之間的存取速度,取決於儲存單元本身的寫入頻寬及反應時間,而目前習用儲存單元的寫入頻寬仍相對較小,因此無法實現高速存取。 When the portable electronic device accesses data of an external electronic device such as a computer or another portable electronic device to the storage unit, the portable electronic device must be connected to the external electronic device until the data is completely stored before being interrupted with the external electronic device. connection. The access speed between the conventional portable electronic device and the external electronic device depends on the writing bandwidth and the reaction time of the storage unit itself, and the write bandwidth of the conventional storage unit is still relatively small, so it cannot be realized. High speed access.
在等待資料的傳輸過程中,使用者須維持攜帶式電子裝置與外部電子裝置的連接狀態,否則兩者便無法進行資料傳輸。因此,使用者須等待資料傳輸完成後,才能解除攜帶式電子裝置與外部電子裝置的連接 狀態,進而造成使用者浪費時間在進行等待。 While waiting for the transmission of data, the user must maintain the connection state of the portable electronic device and the external electronic device, otherwise the two cannot perform data transmission. Therefore, the user has to wait for the data transmission to be completed before releasing the connection between the portable electronic device and the external electronic device. The state, which causes the user to waste time waiting.
本發明之主要目的在於提供一種攜帶式電子裝置資料寫入方法,其係改善習知攜帶式電子裝置連接一低傳輸速度的儲存單元,導致當攜帶式電子裝置在存取外部電子裝置的資料至儲存單元時,攜帶式電子裝置需花費較長的存取時間,才能將外部電子裝置的資料完整寫入儲存單元的缺失。 The main purpose of the present invention is to provide a method for writing data of a portable electronic device, which is to improve a conventional portable electronic device connected to a storage unit with a low transmission speed, thereby causing the portable electronic device to access the data of the external electronic device to When the storage unit is stored, the portable electronic device takes a long access time to completely write the data of the external electronic device to the missing storage unit.
為了達成前揭目的,本發明提供一種具有一系統記憶體與一儲存單元的攜帶式電子裝置所適用的資料寫入方法,包含有以下步驟:a)該攜帶式電子裝置執行一應用程式介面並接收一外部資料的輸入請求;b)該應用程式介面啟用一緩衝記憶體後,該外部資料儲存至緩衝記憶體;以及c)該應用程式介面呼叫一緩衝系統程式讀取該緩衝記憶體,並將該儲存於緩衝記憶體的外部資料寫入儲存單元。 In order to achieve the foregoing, the present invention provides a data writing method applicable to a portable electronic device having a system memory and a storage unit, comprising the following steps: a) the portable electronic device executes an application interface and Receiving an external data input request; b) the application interface enables a buffer memory, the external data is stored in the buffer memory; and c) the application interface calls a buffer system program to read the buffer memory, and The external data stored in the buffer memory is written to the storage unit.
藉此,本發明係透過先將外部資料寫入攜帶式電子裝置的緩衝記憶體,再透過應用程式介面呼叫緩衝系統程式將儲存於緩衝記憶體的外部資料寫入儲存單元,進而縮短攜帶式電子裝置存取外部資料的時間。 Therefore, the present invention shortens the portable electronic device by first writing external data into the buffer memory of the portable electronic device, and then writing the external data stored in the buffer memory to the storage unit through the application interface call buffer system program. The time the device accessed external data.
S10~S17、S20~S25、S30~S34‧‧‧步驟 S10~S17, S20~S25, S30~S34‧‧‧ steps
第1圖係本發明所提供較佳實施例的流程圖;以及第2圖係本發明所提供較佳實施例中建立緩衝記憶體的流程圖。 1 is a flow chart of a preferred embodiment of the present invention; and FIG. 2 is a flow chart showing the construction of a buffer memory in the preferred embodiment of the present invention.
第3圖係本發明呼叫緩衝系統程式的流程圖。 Figure 3 is a flow chart of the call buffer system program of the present invention.
為了詳細說明本發明之技術特徵所在,茲舉以下之較佳實施例並配合圖式說明如後,其中:請參閱第1圖,其係本發明所提供一較佳實施例之攜帶式電子裝置資料寫入方法,該攜帶式電子裝置具有一系統記憶體與一儲存單元,該儲存單元為安全數位卡(Secure Digital Memory Card,SD card)、嵌入式多媒體卡(Embedded Multi Media Card,eMMC)或其他格式的儲存媒體,以擴充攜帶式電子裝置的儲存容量。該攜帶式電子裝置資料寫入方法主要包含有下列步驟:首先執行步驟S10,該攜帶式電子裝置執行一應用程式介面並接收一外部資料的輸入請求,隨後進入步驟S11判斷攜帶式電子裝置是否具有緩衝記憶體的步驟。當應用程式介面判斷攜帶式電子裝置不具有緩衝記憶體時,則執行步驟S20從系統記憶體設定該緩衝記憶體,再設定該緩衝記憶體的儲存臨界值,而後執行步驟S12。反之,直接執行步驟S12判斷是否啟用緩衝記憶體。在本實施例中,緩衝記憶體於步驟S11與步驟S12是預設為存在且啟用的,因此在正常的情形下將會進入步驟S13使外部資料儲存至緩衝記憶體。有一種例外的情形是當緩衝記憶體已經停止(即步驟S15)再重新回到步驟S12時,則不啟用緩衝記憶體,讓外部資料直接寫入儲存單元(即步驟S30)。 For a detailed description of the technical features of the present invention, the following preferred embodiments are described with reference to the following drawings, wherein: FIG. 1 is a portable electronic device according to a preferred embodiment of the present invention. A data writing method, the portable electronic device has a system memory and a storage unit, and the storage unit is a Secure Digital Memory Card (SD card), an Embedded Multi Media Card (eMMC), or Storage media in other formats to expand the storage capacity of portable electronic devices. The portable electronic device data writing method mainly includes the following steps: First, step S10 is executed, the portable electronic device executes an application interface and receives an input request of an external data, and then proceeds to step S11 to determine whether the portable electronic device has The step of buffering the memory. When the application interface determines that the portable electronic device does not have the buffer memory, the step S20 is executed to set the buffer memory from the system memory, set the storage threshold of the buffer memory, and then execute step S12. Otherwise, step S12 is directly executed to determine whether the buffer memory is enabled. In this embodiment, the buffer memory is preset to be present and enabled in steps S11 and S12, so in the normal case, the process proceeds to step S13 to store the external data to the buffer memory. An exception to this is when the buffer memory has been stopped (i.e., step S15) and then returned to step S12, the buffer memory is not enabled, and the external data is directly written to the storage unit (ie, step S30).
執行步驟S13之後接續進入步驟S14,應用程式介面判斷緩衝記憶體是否已被外部資料填滿,當外部資料開始寫入緩衝記憶體時,應用程式介面開始判斷緩衝記憶體是否已被外部資料填滿,當判斷結果為是,即停用緩衝記憶體存取外部資料(即步驟S15)並執行下一步驟S17;若緩 衝記憶體仍未被外部資料填滿,應用程式介面進一步判斷緩衝記憶體的使用容量是否大於儲存臨界值(即步驟S16),當緩衝記憶體裝置的使用容量大於儲存臨界值時執行下一步驟S17;反之,則回到步驟S13。 After executing step S13, the process proceeds to step S14, and the application interface determines whether the buffer memory has been filled with external data. When the external data starts to be written into the buffer memory, the application interface starts to determine whether the buffer memory has been filled with external data. When the judgment result is yes, the buffer memory is disabled to access the external data (ie, step S15) and the next step S17 is performed; The buffer memory is still not filled by the external data, and the application interface further determines whether the buffer memory usage capacity is greater than the storage threshold (ie, step S16), and performs the next step when the buffer memory device usage capacity is greater than the storage threshold. S17; otherwise, return to step S13.
其中,步驟S16在本實施例中是將儲存臨界值設定為緩衝記憶體整體容量的70%,表示當緩衝記憶體的使用容量達到70%時,應用程式介面即呼叫緩衝系統程式,使緩衝系統程式開始將儲存於緩衝記憶體中的外部資料寫入儲存單元(即步驟S17),進而使緩衝記憶體的使用容量低於70%,便可再儲存外部資料至緩衝記憶體中。一般而言,當系統記憶體的容量達到上限時,系統記憶體存取資料存取的速度會降低,緩衝記憶體亦有如此的問題。因此,若緩衝記憶體的使用容量過大時,如緩衝記憶體的使用容量已達99%,該緩衝記憶體存取外部資料的速度即會變慢。故此步驟S16得以提升外部資料存入緩衝記憶體的順暢度。 In the embodiment, the storage threshold is set to 70% of the overall capacity of the buffer memory, and the application interface is a call buffer system program, so that the buffer system is used when the buffer memory usage capacity reaches 70%. The program starts to write the external data stored in the buffer memory to the storage unit (ie, step S17), so that the buffer memory usage capacity is less than 70%, and the external data can be stored in the buffer memory. In general, when the capacity of the system memory reaches the upper limit, the access speed of the system memory access data is lowered, and the buffer memory has such a problem. Therefore, if the buffer memory usage capacity is too large, such as the buffer memory usage capacity has reached 99%, the buffer memory accesses the external data at a slower speed. Therefore, step S16 can improve the smoothness of the external data stored in the buffer memory.
於步驟S17,該應用程式介面呼叫(Trigger)一緩衝系統程式。請參閱第3圖,緩衝系統程式在接收一觸發信號(Trigger Signal)之後(即步驟S31),接著判斷緩衝記憶體是否為空白(即步驟S32),當判斷緩衝記憶體並非空白時就會讀取儲存於該緩衝記憶體的外部資料(即步驟S33),並將該外部資料寫入儲存單元(即步驟S34);當判斷緩衝記憶體為空白時就回到步驟S31等待觸發信號。請回到第1圖,當緩衝系統程式於步驟S17完成作業之後,隨即回到步驟S12判斷是否啟用緩衝記憶體,此時,若已通過步驟S15停止緩衝記憶體,則不啟用緩衝記憶體,讓外部資料直接寫入儲存單元(即步驟S30)。另一種情況是,已通過步驟S16、S17再回到步驟S12時,則維持啟用緩衝記憶體,繼續將外部資料儲存至緩衝記憶體。 In step S17, the application interface (Trigger) is a buffer system program. Referring to FIG. 3, after receiving a trigger signal (Trigger Signal) (ie, step S31), the buffer system program determines whether the buffer memory is blank (ie, step S32), and reads when the buffer memory is not blank. The external data stored in the buffer memory is taken (ie, step S33), and the external data is written into the storage unit (ie, step S34); when it is determined that the buffer memory is blank, the process returns to step S31 to wait for the trigger signal. Returning to FIG. 1 , after the buffer system program completes the job in step S17, it returns to step S12 to determine whether to enable the buffer memory. At this time, if the buffer memory has been stopped by step S15, the buffer memory is not enabled. The external data is directly written to the storage unit (ie, step S30). In another case, when the process returns to step S12 through steps S16 and S17, the buffer memory is maintained and the external data is continuously stored in the buffer memory.
從上述步驟說明可得知,當攜帶式電子裝置連接外部電子裝置以進行外部資料存取時,該攜帶式電子裝置於接收一外部資料輸入請求後先透過應用程式介面啟用緩衝記憶體,再將外部資料儲存於緩衝記憶體,最後應用程式介面呼叫緩衝系統程式,藉由緩衝系統程式將儲存於緩衝記憶體的外部資料寫入儲存單元。 It can be seen from the above description that when the portable electronic device is connected to the external electronic device for external data access, the portable electronic device first enables the buffer memory through the application interface after receiving an external data input request, and then The external data is stored in the buffer memory, and finally the application interface call buffer system program writes the external data stored in the buffer memory to the storage unit by the buffer system program.
由於緩衝記憶體是系統記憶體所設定出的儲存空間,具有比儲存單元更高的寫入頻寬。因此,攜帶式電子裝置是將外部資料儲存至緩衝記憶體,而不是直接將外部資料寫入儲存單元,所以不會受限於儲存單元的寫入頻寬及反應時間,進而改善習知攜帶式電子裝置存取外部電子裝置的外部資料時有等待時間過長的缺失,故本發明能提升外部資料寫入攜帶式電子裝置的速度。 Since the buffer memory is a storage space set by the system memory, it has a higher write bandwidth than the storage unit. Therefore, the portable electronic device stores the external data to the buffer memory instead of directly writing the external data to the storage unit, so it is not limited by the write bandwidth and reaction time of the storage unit, thereby improving the conventional portable type. When the electronic device accesses the external data of the external electronic device, there is a lack of waiting time, so the present invention can increase the speed at which the external data is written into the portable electronic device.
藉此,當外部資料完整的寫入攜帶式電子裝置的緩衝記憶體之後,該攜帶式電子裝置便能中斷與外部電子裝置的連接;攜帶式電子裝置依舊能透過緩衝系統程式持續將該些儲存於緩衝記憶體的外部資訊寫入儲存單元,藉以達到縮短攜帶式電子裝置與外部電子裝置的連接時間。 Therefore, after the external data is completely written into the buffer memory of the portable electronic device, the portable electronic device can interrupt the connection with the external electronic device; the portable electronic device can continue to store the data through the buffer system program. The external information of the buffer memory is written into the storage unit, so as to shorten the connection time between the portable electronic device and the external electronic device.
值得一提的是,該攜帶式電子裝置的緩衝記憶體可為固定式或非固定式,其中固定式的緩衝記憶體係事先從系統記憶體設定一固定的儲存容量無法變動。而非固定式的緩衝記憶體則可以配合欲儲存的外部資料大小而彈性變動其儲存容量大小。請參閱第2圖,其係攜帶式電子裝置使用非固定式的緩衝記憶體的建立流程圖(即第1圖中步驟S20的具體步驟),其執行步驟為:攜帶式電子裝置取得一外部資料大小數據及一系統記憶體容 量數據(步驟S21)並判斷系統記憶體容量是否大於外部資料的大小(步驟S22),當系統記憶體容量數據大於外部資料大小數據,從系統記憶體設定一容量與外部資料大小數據相同的緩衝記憶體(步驟S23);當系統記憶體容量數據小於外部資料大小數據,即從系統記憶體設定一具有與系統記憶體相同容量的緩衝記憶體(步驟S24)。最後執行步驟S25以設定緩衝記憶體的儲存臨界值。 It is worth mentioning that the buffer memory of the portable electronic device can be fixed or non-fixed, wherein the fixed buffer memory system cannot be changed by setting a fixed storage capacity from the system memory. Instead of a fixed buffer memory, the storage capacity can be flexibly changed according to the size of the external data to be stored. Please refer to FIG. 2 , which is a flow chart of establishing a non-stationary buffer memory for a portable electronic device (ie, a specific step of step S20 in FIG. 1 ), and the execution step is: the portable electronic device obtains an external data. Size data and a system memory The quantity data (step S21) determines whether the system memory capacity is larger than the size of the external data (step S22), and when the system memory volume data is larger than the external data size data, sets a buffer of the same capacity as the external data size data from the system memory. The memory (step S23); when the system memory capacity data is smaller than the external data size data, a buffer memory having the same capacity as the system memory is set from the system memory (step S24). Finally, step S25 is performed to set the storage threshold of the buffer memory.
綜上所述,本發明所提供之攜帶式電子裝置資料寫入方法,係藉由先將外部資料儲存至攜帶式電子裝置當中具有較大寫入頻寬的緩衝記憶體,以縮短攜帶式電子裝置與外部電子裝置的連接時間,並藉由緩衝系統程式在攜帶式電子裝置與外部電子裝置中斷後,繼續執行將緩衝記憶體中的外部資料寫入儲存單元。如此一來,可有效縮短使用者等待外部資料從外部電子裝置傳輸至攜帶式電子裝置的時間。 In summary, the method for writing data of the portable electronic device provided by the present invention shortens the portable electronic device by first storing external data to a buffer memory having a large writing bandwidth among the portable electronic devices. The connection time between the device and the external electronic device is resumed by the buffer system program after the portable electronic device and the external electronic device are interrupted, and the external data in the buffer memory is continuously written into the storage unit. In this way, the time for the user to wait for external data to be transmitted from the external electronic device to the portable electronic device can be effectively shortened.
S10~S17、S20、S30~S34‧‧‧步驟 S10~S17, S20, S30~S34‧‧‧ steps
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW104104120A TWI521349B (en) | 2015-02-06 | 2015-02-06 | Data writing method of mobile electronic device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW104104120A TWI521349B (en) | 2015-02-06 | 2015-02-06 | Data writing method of mobile electronic device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| TWI521349B true TWI521349B (en) | 2016-02-11 |
| TW201629778A TW201629778A (en) | 2016-08-16 |
Family
ID=55810343
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| TW104104120A TWI521349B (en) | 2015-02-06 | 2015-02-06 | Data writing method of mobile electronic device |
Country Status (1)
| Country | Link |
|---|---|
| TW (1) | TWI521349B (en) |
-
2015
- 2015-02-06 TW TW104104120A patent/TWI521349B/en active
Also Published As
| Publication number | Publication date |
|---|---|
| TW201629778A (en) | 2016-08-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| TWI715248B (en) | Apparatus and method and computer program product for executing host input-output commands | |
| TWI719654B (en) | Apparatus and method and computer program product for handling flash physical-resource sets | |
| US20170199814A1 (en) | Non-volatile random access system memory with dram program caching | |
| KR100708128B1 (en) | Nand flash memory control device and method | |
| TWI710905B (en) | Data storage device and method for loading logical-to-physical mapping table | |
| KR102517685B1 (en) | Memory block recovery method and device | |
| CN102598141A (en) | Memory operation suspension for reducing read latency in memory arrays | |
| KR102106261B1 (en) | Method of operating memory controller and methods for devices having same | |
| CN111399750B (en) | Flash memory data writing method and computer readable storage medium | |
| JP2012079320A (en) | Hardware dynamic cache power management | |
| US20160062659A1 (en) | Virtual memory module | |
| JP2017033501A (en) | Storage device and control method | |
| US20190026226A1 (en) | Methods and apparatus to manage intermittently connectable storage media | |
| US9239742B2 (en) | Embedded systems and methods for threads and buffer management thereof | |
| WO2017222739A1 (en) | Selective flash memory compression/decompression using a storage usage collar | |
| KR20190033122A (en) | Storage device communicating with host according to multicast communication protocol and communication method of host | |
| CN103713882A (en) | Method and device for swapping data in memory | |
| CN104115230A (en) | Efficient PCMS refresh mechanism background | |
| CN107291399A (en) | A kind of rear end storage method based on SPDK, apparatus and system | |
| TW201327185A (en) | Memory storage device and memory controller and data writing method thereof | |
| CN104281545B (en) | A kind of method for reading data and equipment | |
| CN104834478A (en) | Data writing and reading method based on heterogeneous hybrid storage device | |
| CN114610654B (en) | A solid-state storage device and a method for writing data thereto | |
| CN114168495B (en) | Enhanced read-ahead capabilities of storage devices | |
| TWI521349B (en) | Data writing method of mobile electronic device |