CN105306569B - One kind being based on the data download method of Flash (flash memory) - Google Patents

One kind being based on the data download method of Flash (flash memory) Download PDF

Info

Publication number
CN105306569B
CN105306569B CN201510701036.7A CN201510701036A CN105306569B CN 105306569 B CN105306569 B CN 105306569B CN 201510701036 A CN201510701036 A CN 201510701036A CN 105306569 B CN105306569 B CN 105306569B
Authority
CN
China
Prior art keywords
data
block
storage areas
page
information
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201510701036.7A
Other languages
Chinese (zh)
Other versions
CN105306569A (en
Inventor
温长会
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Redstone Sunshine (beijing) Polytron Technologies Inc
Original Assignee
Redstone Sunshine (beijing) Polytron Technologies Inc
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 Redstone Sunshine (beijing) Polytron Technologies Inc filed Critical Redstone Sunshine (beijing) Polytron Technologies Inc
Priority to CN201510701036.7A priority Critical patent/CN105306569B/en
Publication of CN105306569A publication Critical patent/CN105306569A/en
Application granted granted Critical
Publication of CN105306569B publication Critical patent/CN105306569B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1847File system types specifically adapted to static storage, e.g. adapted to flash memory or SSD

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present invention relates to a kind of data download methods being based on Flash (flash memory), it is characterised in that:A Flash wherein Block are information recording area, remaining 1~Block of Block N is data storage areas, and Block points of information recording area are multiple Page, and every Page records the data information of a Block in data storage areas successively;The method for down loading includes the steps that following sequence:S1, data breakpoint is judged whether so that whether the data information of the Block of the corresponding data storage areas of the information of each Page is identical, such as there is data breakpoint, it then abandons using the data of the Block of the data storage areas as data breakpoint, and calculate the sum of the valid data of other Block of data storage areas before the Block, using aforementioned valid data and as downloading start point request server data;To save time and the network flow of data download.

Description

One kind being based on the data download method of Flash (flash memory)
Technical field
It is specifically a kind of to be based on non-file system the present invention relates to a kind of data download method being based on Flash (flash memory) Flash memory and can realize the data download method of breakpoint transmission.
Background technology
Breakpoint transmission refers to that the data downloaded are stored in a manner of file, if interrupted in downloading process, is led to Then the length of downloading data after the file downloaded can calculate downloads unfinished portion since break-point section Point;Take this to save the time and network flow that data are downloaded.
Flash (flash memory) (remains to keep stored data letter by the non-volatile of its long-life under power blackout situation Breath) become the memory often selected in people's daily life, work.However flash memory is unintelligent device, can not be based on file Mode realize breakpoint transmission.Therefore it once occurring power down during the data download process, then needs to re-download.
In addition, the current intelligent wearable device risen needs often to download file or upgrading data packet from network, However also have considerable part using Flash as memory in these intelligent wearable devices, therefore also do not support file system, It can only be directly write in Flash when downloading data, once powering down or off in downloading process, then without fine mechanism record The case where through downloading data, it also cannot achieve breakpoint transmission.
Invention content
The technical problem to be solved in the present invention is to provide a kind of flash memory based on non-file system and can realize that breakpoint is continuous The data download method of biography.
The technical problem to be solved in the present invention can be realized by technical solution below:One kind (is dodged based on Flash Deposit) data download method, it is characterised in that:A Flash wherein Block (block) are information recording area, remaining Block L~Block N are data storage areas, and Block points of information recording area are multiple Page (page), and every Page is recorded successively The data information of a Block in data storage areas;The method for down loading includes the steps that following sequence:
S1, the information that Page in the Block in information record region is successively read since 0 are (practical to be deposited for corresponding data The data information of the Block in storage area domain) and the corresponding data storage areas of the Page Block data information, judge each Whether the data information of the Block of the corresponding data storage areas of information of Page is identical;As all identical, then for for the first time Download or there are data breakpoint but download data it is all effective, execute S2.1;Such as there is difference, then the data storage area The Block in domain is data breakpoint, executes S2.2;
S2.1, from server request data, and execute S3;
S2.2, it abandons using the data of the Block of the data storage areas as data breakpoint, and before calculating the Block Data storage areas other Block valid data sum, using aforementioned valid data and as download start point request clothes Business device data, and the Page by record as the Block data informations of data breakpoint is recorded as in vain;Then S3 is executed;
S3, the data of download are written in the Block in data storage areas, it is full then judges whether corresponding Block writes; If not, continuing to execute S2.1;If so, by it is current oneself write the data information of full Block and be written in information recording area and record In the Page of the Block data informations, and execute S4;
S4, judge whether to have received to complete all data;If not, S2.1 is continued to execute, if so, executing S5;
S5, end.
The present invention provides data download method, the characteristic based on the Flash for not supporting file system:The erasing of Flash is read It is that unit carries out rather than byte to take with Block (block), includes multiple Page (page) in a Block, it is typical such as 32,64 or 128 Page etc.;The write-in of Flash is then as unit of Page, also non-byte, and the data of storage byte are according to type in a Page Number difference and different, typical such as 512,1024 or 2048 bytes;And for the same Page, only allow write-in one It is secondary, if need to be written again, need to wipe the Block where the Page;This method for down loading chooses Flash wherein one Block (block) is information recording area, remaining 1~Block of Block N is data storage areas, information recording area Block points are multiple Page (page), and every Page records the data information of a Block in data storage areas successively.If Occur power off, restart etc. in downloading process to interrupt situation, it includes two kinds below to lead to the possibility of data failure:One is in Some " Block " in storage data field domain is currently written into when disconnected, then this data may be invalid;When another kind is interruption Some " Page " that information recording area is written, then the record information of this " Page " is then invalid.This method is under traditional It carries to increase during storing and the data information of each Block for having write full data storage areas is written to interblock Step in the corresponding Page in domain, to mark these data informations as data breakpoint;It is first when Flash connection networks First judge the data information being written in each Page of information recording area and corresponding data storage areas successively since 0 Block data information it is whether identical, it is such as all identical, then judge to download for the first time or there are data breakpoint but download Data are all effective, such as the data information that wherein data information of a Block is recorded with corresponding Page of data storage areas Difference then judges the Block for the breakpoint of data, and with the significant figure of data storage areas other Block before the Block According to and as breakpoint download newly downloaded starting point, to save the time cut out under data and network flow.
A plurality of types of information can be used in the data information of the Block of data storage areas, a reality as the present invention Mode is applied, the data information of the Block of the data storage areas includes its check value:Check value is mainly having for data information Data are imitated, can be obtained by brief algorithm, it is efficiently convenient.
Since the check value of Block need to be calculated by its valid data length, to be further simplified relevant meter Calculation process, on the basis of the above, the present invention can make improvement below, the data information of the Block of the data storage areas Further include its valid data length.
On the basis of the above, downloading data is stored according to the data that are sequentially written in for downloading priority in step S3 of the present invention It is not write in full Block near preceding according to Block 1 to Block N sequences in region.
On the basis of the above, the present invention can also be improved further:The data of the Block of the data storage areas Information further include file to be downloaded total length and current Block residing for file to be downloaded position;Under provided in this embodiment The storage of sanction method data without storing successively according to original data, i.e., storage order can be random, compared with only with current The check value of Block uses the check value of Block and valid data length to have as the embodiment of breakpoint information simultaneously Higher flexibility.
Flash of the present invention is Nor Flash or Nand Flash.
Description of the drawings
Fig. 1 be the present invention Flash information recording area in each Page it is corresponding with each Block of data storage areas Relation principle figure;
Fig. 2 is the flow chart of flash memory Coutinuous store data;
Fig. 3 is the flow chart of the judgement flash memory storage breakpoint of the present invention.
Specific implementation mode
Embodiment 1
A kind of data download method being based on Flash (flash memory) provided by the invention, Flash be Nor Flash or Nand Flash, and the characteristics of being based on Flash (erasing of Flash, to read with Block (block) be that unit carries out rather than byte, one Include multiple Page (page), typical such as 32,64 or 128 Page in a Block:The write-in of Flash is then single with Page Position, also non-byte, the data of storage byte are different and different according to model in a Page, typical such as 512,1024 or 2048 bytes etc.), it is information recording area to pre-set a Flash wherein Block (block), remaining 1~BlockN of Block is Block points of data storage areas, information recording area are multiple Page (page), and every Page records data storage areas successively In a Block check value and valid data length, as shown in Figure 1.
When Flash Connection Service devices, this method for down loading executes the step mule of following sequence:
S1, as shown in figure 3, be successively read since 0 information record Page in the Block in region information (it is practical for pair The check value of the Block for the data storage areas answered) and the corresponding data storage areas of the Page Block valid data it is long Degree, and calculates the check value of the Block, judge the data of the corresponding Block of the information of corresponding Page check value whether It is identical;If all it is identical, then for download for the first time or there are data breakpoint but download data it is all effective, execute S2.1; Such as there is difference, then the Block of the data storage areas is data breakpoint, executes S2.2;
S2.1, from server request data, and execute S3;
S2.2, it abandons using the data of the Block of the data storage areas as data breakpoint, and before calculating the Block Data storage areas other Block valid data sum, using aforementioned valid data and as download start point request clothes Business device data, and the Page by record as the Block data informations of data breakpoint is recorded as in vain;Then S3 is executed;
S3, it will not be write completely near preceding according to Block1 to BlockN sequences in the data write-in data storage areas of download Block in, it is full then to judge whether corresponding Block writes;If not, continuing to execute S2.1;If so, calculate currently write it is full The check value of Block, and the check value of the Block and valid data length are written to record in information recording area should In the Page of Block check values, and S4 is executed, as shown in Figure 2;
S4, judge whether to have received to complete all data;If not, S2.1 is continued to execute, if so, executing S5;
S5, end.
This method for down loading is write using the check value and valid data length of the Block of data storage areas as breakpoint information Enter into the Block of information recording area in corresponding Page.If being currently written into some of storage data field domain when power-off " Block ", then this data may be invalid, some " Page " of information recording area, then the record information of this " Page " Then invalid, the situations of two kinds of above-mentioned data failures can be by judging the data of the corresponding Block of the information of corresponding Page Check value it is whether identical come Flash Connection Service devices when be for the first time download or breakpoint download, finally realize breakpoint transmission, with Save the time and network flow that data are downloaded.
Embodiment 2
Another data download method for being based on Flash (flash memory) provided by the invention, the difference with embodiment 1 exist In:Every Page of Block (block) as information recording area records the verification of a Block in data storage areas successively Value, valid data length, file to be downloaded total length and the Block residing for file to be downloaded position.
When Flash Connection Service devices, under this step of sanction method execution following sequence:
S1, the information that Page in the Block in information record region is successively read since 0 are (practical to be deposited for corresponding data The check value of the Block in storage area domain) and the corresponding data storage areas of the Page Block valid data length, and calculate The check value for going out the Block judges whether the check value of the data of the corresponding Block of the information of corresponding Page is identical;As entirely Portion is identical, then for download for the first time or there are data breakpoint but download data it is all effective, execute S2.1;As existed not Together, then the Block of the data storage areas is data breakpoint, executes S2.2;
S2.1, from server request data, and execute S3;
S2.2, it abandons using the data of the Block of the data storage areas as data breakpoint, and before calculating the Block Data storage areas other Block valid data sum, using aforementioned valid data and as download start point request clothes Business device data, and the Page by record as the Block data informations of data breakpoint is recorded as in vain;Then S3 is executed;
S3, it will not be write in full Block in the data write-in data storage areas of download, then judge that corresponding Block is It is no to write completely;If not, continuing to execute S2.1;If so, calculate it is current oneself write the check value of full Block, and by the verification of the Block Value, valid data length, file to be downloaded total length and the Block residing for file to be downloaded position be written to information record In the Page for recording the Block check values in region, and execute S4;
S4, judge whether to have received to complete all data;If not, S2.1 is continued to execute, if so, executing S5;
S5, end.
The increased total length for downloading file of the present embodiment and the residing positions for downloading file current Block are, it can be achieved that more Thread is downloaded, and per thread is responsible for downloading one section of file, for example thread 1 is responsible for downloading from 0~1024, and thread 2 is responsible for download 1025~2048, thread 3 is responsible for downloading after 2048.It first downloads and completes first to be written, for example thread 2 first downloads one piece of completion First block is written in (such as from 1024~1536), and marks the initial position of this block, size, check value, file Overall length;Thread 1, which is downloaded, to be completed, from 0~512, to be also written and mark;And so on;If power-off occurs, these record letters are traversed Breath, you can the case where knowing all files once downloaded continues the part separated time journey of missing to download and complete.This reality Applying example makes the storage for the data downloaded without being stored successively according to original data, i.e., storage order can be random, compared with implementation Example 1 is only with the check value of current Block or simultaneously using the check value of Block and valid data length as breakpoint information Embodiment have higher flexibility.

Claims (4)

1. one kind being based on the data download method of Flash (flash memory), it is characterised in that:A Flash wherein Block (block) are Information recording area, remaining Block1~BlockN are data storage areas, and Block points of information recording area are multiple Page (page), every Page record the data information of a Block in data storage areas successively;The data storage areas The data information of Block includes its check value and its valid data length, which includes the steps that following sequence:
S1, the information data storage area corresponding with the Page that Page in the Block in information record region is successively read since 0 The data information of the Block in domain judges that the data information of the Block of the corresponding data storage areas of the information of each Page is It is no identical;If all it is identical, then for download for the first time or there are data breakpoint but download data it is all effective, execute S2.1;Such as there is difference, then the Block of the data storage areas is data breakpoint, executes S2.2;S2.1, it is asked from server Data, and execute S3;S2.2, it abandons using the data of the Block of the data storage areas as data breakpoint, and calculating should The sum of the valid data of other Block of the data storage areas before Block, using aforementioned valid data and as downloading Point request server data, and the Page by record as the Block data informations of data breakpoint is recorded as in vain;Then it executes S3;S3, the data of download are written in the Block in data storage areas, it is full then judges whether corresponding Block writes;If not, Continue to execute S2.1:If so, by it is current oneself write full Block data information be written to record in information recording area should In the Page of Block data informations, and execute S4;S4, judge whether that oneself completes all data through receiving:If not, continuing to execute S2.1, if so, executing S5;S5, end.
2. data download method according to claim 1, it is characterised in that:Downloading data is according to download priority in the S3 Be sequentially written in data storage areas to sort according to Block1 to BlockN and do not write in full Block near preceding.
3. data download method according to claim 1, it is characterised in that:The number of the Block of the data storage areas It is believed that breath further include file to be downloaded total length and current Block residing for file to be downloaded position.
4. according to claims 1 to 3 any one of them data download method, it is characterised in that:The Flash is NorFlash Or NandFlash.
CN201510701036.7A 2015-10-20 2015-10-20 One kind being based on the data download method of Flash (flash memory) Active CN105306569B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510701036.7A CN105306569B (en) 2015-10-20 2015-10-20 One kind being based on the data download method of Flash (flash memory)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510701036.7A CN105306569B (en) 2015-10-20 2015-10-20 One kind being based on the data download method of Flash (flash memory)

Publications (2)

Publication Number Publication Date
CN105306569A CN105306569A (en) 2016-02-03
CN105306569B true CN105306569B (en) 2018-07-17

Family

ID=55203312

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510701036.7A Active CN105306569B (en) 2015-10-20 2015-10-20 One kind being based on the data download method of Flash (flash memory)

Country Status (1)

Country Link
CN (1) CN105306569B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5832493A (en) * 1997-04-24 1998-11-03 Trimble Navigation Limited Flash file management system
CN102543193A (en) * 2011-12-31 2012-07-04 深圳创维数字技术股份有限公司 Flash memory recording method as well as recording equipment and system
CN103577121A (en) * 2013-11-05 2014-02-12 中船重工(武汉)凌久电子有限责任公司 High-reliability linear file access method based on nand flash
CN104391804A (en) * 2014-10-28 2015-03-04 陕西千山航空电子有限责任公司 Storage method for NAND FLASH data

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI439859B (en) * 2009-11-30 2014-06-01 Silicon Motion Inc Data storage system and data management method thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5832493A (en) * 1997-04-24 1998-11-03 Trimble Navigation Limited Flash file management system
CN102543193A (en) * 2011-12-31 2012-07-04 深圳创维数字技术股份有限公司 Flash memory recording method as well as recording equipment and system
CN103577121A (en) * 2013-11-05 2014-02-12 中船重工(武汉)凌久电子有限责任公司 High-reliability linear file access method based on nand flash
CN104391804A (en) * 2014-10-28 2015-03-04 陕西千山航空电子有限责任公司 Storage method for NAND FLASH data

Also Published As

Publication number Publication date
CN105306569A (en) 2016-02-03

Similar Documents

Publication Publication Date Title
CN111124277B (en) Deep learning data set caching method, system, terminal and storage medium
CN106339222B (en) A kind of service implementing method and device
CN107329741A (en) A kind of software distribution upgrade method and device based on fingerprint recognition
US20170206079A1 (en) Method and Device for Upgrading Software
CN110011788A (en) A kind of data processing method based on block chain, system and relevant device
CN112000355B (en) Method and device for firmware upgrading and household appliance
CN105187564B (en) A kind of method of mobile phone terminal document breakpoint transmission
CN109739933A (en) Memory space method for releasing, device, terminal and computer readable storage medium
CN104750620B (en) A kind of internal memory migration method and device
CN109271098A (en) A kind of data migration method and device
CN109992219A (en) Distributed storage method, device, equipment and computer readable storage medium
CN107153571A (en) A kind of dispositions method and device of virtual management node
CN109005226A (en) The acquisition methods of sensing data, acquisition system and relevant apparatus in server
CN107678918A (en) The OSD heartbeat mechanisms method to set up and device of a kind of distributed file system
CN101930375A (en) Self-adaptive program data updating method of memory space in single user optical network unit
CN109697109A (en) A kind of method, system, device and the storage medium of Division identification conflict virtual machine
CN103327036B (en) The identification method of internet browsing equipment and Cookie server
CN106203179B (en) A kind of completeness check system and method for pair of file
CN108958891A (en) A kind of virutal machine memory distribution method, device and terminal
CN111008181A (en) Method, system, terminal and storage medium for switching storage strategies of distributed file system
CN110069386A (en) A kind of operation terminal data processing method, operation terminal, system and medium
CN105306569B (en) One kind being based on the data download method of Flash (flash memory)
CN109165712A (en) Distributed generation method, device and computer storage medium by stages number
CN109213701A (en) Control method, system, equipment and the storage medium of the peripheral hardware of shared I O board
CN108650306A (en) A kind of game video caching method, device and computer storage media

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 100000 Beijing City, Haidian District Huayuan Road Xiaoguan Street No. 120 B District three floor of Executive Hotel Wansheng

Applicant after: Redstone sunshine (Beijing) Polytron Technologies Inc

Address before: 100000 Beijing City, Haidian District Huayuan Road Xiaoguan Street No. 120 B District three floor of Executive Hotel Wansheng

Applicant before: REDSTONE SUNSHINE (BEIJING) TECHNOLOGY CO., LTD.

COR Change of bibliographic data
GR01 Patent grant
GR01 Patent grant