CN105354311B - It is a kind of based on the data key values of file system of embedded device to storage method - Google Patents
It is a kind of based on the data key values of file system of embedded device to storage method Download PDFInfo
- Publication number
- CN105354311B CN105354311B CN201510760517.5A CN201510760517A CN105354311B CN 105354311 B CN105354311 B CN 105354311B CN 201510760517 A CN201510760517 A CN 201510760517A CN 105354311 B CN105354311 B CN 105354311B
- Authority
- CN
- China
- Prior art keywords
- data
- key
- value pair
- storage
- comparisons
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/172—Caching, prefetching or hoarding of files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/13—File access structures, e.g. distributed indices
Abstract
The present invention relates to it is a kind of based on the data key values of file system of embedded device to storage method, this method includes:According to the data attribute of data, multiple key-value pairs are defined, defined each key-value pair can describe the storage characteristics of individual data;All key-value pairs are integrated, establish the key-value pair table of comparisons;When needing to store or obtaining data, the key-value pair table of comparisons is traversed according to the data attribute of the data, finds out the key-value pair for being suitble to the data;Data are packaged and parsed according to the attribute of key-value pair;The data for being stored in or obtaining hereof after key-value pair encapsulation.Data object is corresponded with key-value pair, and key-value pair can correspond to the data object of individual data type, can also correspond to the data object of multiple data type set, is used more flexibly, and also enhance the independence of data;Data need not consider position and the sequence of data object storage in batch or storage one by one, enhance the scalability in terms of device data storage.
Description
Technical field
The present invention relates to embedded device technical field of data administration, especially a kind of to be based on file system of embedded device
Data key values to storage method.
Background technology
The introducing of file system has lot of advantages relative to the storage method of direct operation memory, it causes data to deposit
Method for storing is more flexible, and the independence of data and program is more preferable, also simplifies the work of maintenance, this causes file system in insertion
It is widely used in formula equipment, in the Data Storage Solution especially more than middleweight.
When storing data using file system, general way is that data directly are stored file in a manner of 16 systems
In the middle, such method is mainly used in the data object that some data volumes are larger in embedded device, and the purpose done so is main
It is that the change of access data can be made simple, faster, but there is also some problems:(1)Because data are all the lattice of 16 systems
Formula stores, and is not easy to data and checks, the maintenance of equipment can increase;(2)If data storage object includes multiple and different numbers
According to the data of type, and each data storage or read operation sequence are rambling, then are all usually to entire
Data storage object is operated, and is implemented and is more troublesome, and this reduces data storage, the flexibilities read;(3)Newly
When increasing data object, in order to not influence the definition of other data, either data object being stored in same storage file
Or it stores, generally can only all be realized by the way of additional, but also exist and other existing data objects are had an impact
Possibility;In addition, for the identical data of structure in same file multiple stored situation, realized using additional mode
Get up then more difficult, this largely reduces the scalability of functions of the equipments.
Also a kind of way is that the character string combinations of data group into title and numerical value are stored in file, and such way is main
Be for some configuration datas and supplemental characteristic in embedded device, mainly in view of the frequency of maintenance of such data compared with
Height, data volume are also relatively small;During using such method, typically without the table of comparisons for establishing data attribute and title, application layer
Programming personnel directly defines the title and data format of data according to some rules and custom, completes the storage of data, such
Method is convenient for plant maintenance, but in the processing data object that some data class are various, data volume is larger, by very big
Limitation.
Invention content
The purpose of the present invention is to provide a kind of scalability for the flexibility and equipment that can enhance date storage method,
And data is made to be more convenient for safeguarding, implement also it is relatively simple based on the data key values of file system of embedded device to depositing
Method for storing.
To achieve the above object, present invention employs following technical schemes:It is a kind of based on file system of embedded device
Data key values are to storage method, the step of this method includes following order:
(1)According to the data attribute of data, multiple key-value pairs are defined, defined each key-value pair can describe single number
According to storage characteristics;
(2)All key-value pairs are integrated, establish the key-value pair table of comparisons;
(3)When needing to store or obtaining data, the key-value pair table of comparisons is traversed according to the data attribute of the data, is found out
It is suitble to the key-value pair of the data;
(4)Data are packaged and parsed according to the attribute of key-value pair;
(5)The data for being stored in or obtaining hereof after key-value pair encapsulation.
The data attribute includes the purposes and form of data, when the purposes of data refers to that programming personnel defines the data
For the virtual concept of its function of the description of its imparting, the Formats User of data represents the content of the data, is a data class
The data acquisition system of the data of type or some data types composition.
The attribute of the key-value pair include for show key-value pair in the key-value pair table of comparisons serial number of position, for retouching
State the title of data use and the form for describing data content.
The step(2)It is middle establish the key-value pair table of comparisons method be:First, a sequence is established, form is identical
Key-value pair is placed on the same area of sequence;Secondly, according to byte length shared by form by short and long sequence to all areas into
Row arrangement, for the equal region of total length, as the byte long as shared by first data type in short and long sequence comparison format
Degree, if still equal, continues more next data type, until the last one data type;Again, according to key-value pair title
Arrange the key-value pair of same format, the entitled character string of key-value pair, according to position of the character in ASCII character table from low to high
Sequence arranges the initial character of character string, the character of more next position if identical, until last of character string
A character;Finally, the key-value pair table of comparisons is established according to the key-value pair sequence after arrangement.
The step(4)The method of encapsulation and the parsing of middle data is:The title of key-value pair and form are considered as and post mark
The blank document of label, the file for storing data are considered as a cubbyhole;When data store, the content record of data is marked to corresponding
In the blank document of label, cubbyhole is then placed in realize the storage of data, operation, that is, data encapsulation of this record;Conversely,
The reading of data, which is considered as on cubbyhole, to be found corresponding document according to label and makes a copy of imparting by the content of paper trail
The process of data, this operation made a copy of i.e. data parse.
As shown from the above technical solution, advantages of the present invention is as follows:First, data object is corresponded with key-value pair, key
Value can also correspond to the data object of multiple data type set, use to that can correspond to the data object of individual data type
Get up more flexibly, and also enhance the independence of data;Second, because the data object to be stored is encapsulated as by key-value pair
It is relatively independent data block to be stored, therefore data need not consider the position of data object storage in batch or storage one by one
It puts with sequentially, enhancing the scalability in terms of device data storage;Third, for data after encapsulation, maintenance personnel can be light
Loose ground reads the content of data, enhances the maintainability of equipment.
Description of the drawings
Fig. 1 is flow chart of the method for the present invention;
Fig. 2 is the schematic diagram that data Data completes encapsulation and storage in the present invention.
Specific embodiment
As shown in Figure 1, it is a kind of based on the data key values of file system of embedded device to storage method, under this method includes
The step of row sequence:(1)According to the data attribute of data, multiple key-value pairs are defined, defined each key-value pair can describe
The storage characteristics of individual data;(2)All key-value pairs are integrated, establish the key-value pair table of comparisons;(3)When needs store or obtain
During data, the key-value pair table of comparisons is traversed according to the data attribute of the data, finds out the key-value pair for being suitble to the data;(4)According to key
The attribute of value pair is packaged and parses to data;(5)The data for being stored in or obtaining hereof after key-value pair encapsulation, because
The value of data has been bound with key-value pair in file, and what is stored in file is all after some have already passed through key-value pair encapsulation
Data block, therefore when data store, without considering that it is stored in the sequence of file and position, so that storage method is more
Flexibly.
The data attribute includes the purposes and form of data, when the purposes of data refers to that programming personnel defines the data
For the virtual concept of its function of the description of its imparting, the Formats User of data represents the content of the data, is a data class
The data acquisition system of the data of type or some data types composition.When the data volume of data object is larger, when data content is more, root
It can be considered as a data object according to application scenarios, several functionally the same or similar data pair can also be divided into again
As.Step(1)Key to realize the present invention is first analyzed the Various types of data object of the embedded device, according to number
According to the purposes and form of object, the data object of least unit is partitioned into, then defines suitable key-value pair.For example, one
For describing the data object Time of time, data hour, minute and second of 3 character type are included, is represented successively small
When, minute and second, Time can be regarded as a data object, a key-value pair is defined and be corresponding to it, three keys can also be defined
Be worth to correspond to respectively it includes 3 character type datas, when definition will see that the data object is in the embedded device function
No indivisible, the key-value pair defined in this way can also have higher independence.
The attribute of the key-value pair include for show key-value pair in the key-value pair table of comparisons serial number of position, for retouching
State the title of data use and the form for describing data content.The step(2)The middle method for establishing the key-value pair table of comparisons
For:First, a sequence is established, the identical key-value pair of form is placed on to the same area of sequence;Secondly, according to word shared by form
Section length arranges all areas by short and long sequence, for the equal region of total length, by by short and long sequence
Byte length shared by first data type in comparison format, if still equal, continues more next data type, until last
One data type;Again, the key-value pair of same format is arranged according to key-value pair title, the entitled character string of key-value pair is pressed
The initial character of character string is arranged according to sequence of positions of the character in ASCII character table from low to high, if identical relatively under
The character of one position, until the last character of character string;Finally, key-value pair is established according to the key-value pair sequence after arrangement
The table of comparisons.When needing newly to add in some key-value pairs, the position of insertion is found in the table of comparisons according to queueing discipline, is held very much
It easily realizes, good sequence is but also the key-value pair table of comparisons is more readily maintained.Ordering rule can be not limited to character string initial
Sequence etc..Well-regulated arrangement can enhance the maintainability of the table of comparisons, while be also to improve step(4)The key of search efficiency.
The step(4)The method of encapsulation and the parsing of middle data is:The title of key-value pair and form are considered as and post mark
The blank document of label, the file for storing data are considered as a cubbyhole;When data store, the content record of data is marked to corresponding
In the blank document of label, cubbyhole is then placed in realize the storage of data, operation, that is, data encapsulation of this record;Conversely,
The reading of data, which is considered as on cubbyhole, to be found corresponding document according to label and makes a copy of imparting by the content of paper trail
The process of data, this operation made a copy of i.e. data parse.Such packaging method so that the independence of data is more preferable, realizes
Come also relatively simple.
It, will be according to step shown in FIG. 1 when there is data to perform storage(3)、(4)、(5)It performs.Data are found first
Storage file traverses the key-value pair table of comparisons according to the attribute of the data, finds out the key-value pair for being suitble to this data, the method for traversal according to
Rely in step(2)The method of sequence is finally completed encapsulation to data according to the attribute of key-value pair and is deposited with parsing and completing data
Storage.
The present invention core concept be:Any change and remarks are not carried out to the attribute of data, establish the key-value pair table of comparisons
For recording the attribute of all data, data are packaged according to key-value pair is relatively independent, there is this encapsulation so that
Data storage file is easier to be understood, and has this independence, just there is better autgmentability, data object is being inserted
Enter, create, deleting when sequence of operations, it is possible to break away from data structure change, data volume size, data content complexity etc.
Limiting factor.
As shown in Fig. 2, Fig. 2 describes the process that data realize encapsulation and storage, the realization of whole process is built upon number
Under the premise of being successfully defined in the key-value pair table of comparisons according to the corresponding key-value pairs of Data, whole process concrete methods of realizing
For:
(1)The key-value pair table of comparisons(2-2)It is made of multiple key-value pairs, wherein containing data Data(2-1)It is corresponding
Key-value pair KEY_X(2-3).First according to the key-value pair table of comparisons established, the corresponding key-value pair KEY_X of data is found, this
The ordering rule that a process follows when being established with the key-value pair table of comparisons is related, if the table of comparisons is successively according to key assignments in sequence
To form and name order arrange, that lookup method is to find the form region of key-value pair first, then traverse the area
The key-value pair in domain determines the position of key-value pair according to key-value pair title;
(2)The title according to defined in KEY_X(Name_X)And form(Format_X)To realize the envelope to data Data
Dress.Such as example is mentioned above, data object Time, it is assumed that it is exactly data Data, then can define the name of key-value pair
Referred to as character string " Time ", form are character string " HH:MM:SS ", wherein HH, MM, SS represent the data cell of Time successively
Hour, minute and second, if its numerical value of these three data cells is followed successively by if 20,15,26, then can be by number
According to content character string " Time=20 are encapsulated as 20 points of time data Time of 15 minutes and 26 seconds:15:26 " are stored.Obviously, this
The method of sample encapsulation is highly susceptible to realizing, and the data after encapsulation are more conducive to safeguard.
(3)Data storage file(2-5)By the data after the encapsulation of batch(2-4)Composition;Data phase after encapsulation
When in data block independent one by one, when carrying out data storage, any position in file can be stored in any order.
In conclusion the data object of the present invention is corresponded with key-value pair, key-value pair can correspond to individual data type
Data object, the data objects of multiple data type set can also be corresponded to, used more flexibly, and also enhance
The independence of data;Because the data object to be stored is encapsulated as relatively being independent data block and be stored by key-value pair, therefore
Data need not consider position and the sequence of data object storage in batch or storage one by one, enhance device data storage side
The scalability in face;For data after encapsulation, maintenance personnel can easily read the content of data, and enhance equipment can
Maintainability.
Claims (4)
1. it is a kind of based on the data key values of file system of embedded device to storage method, this method includes the step of following order
Suddenly:
(1)According to the data attribute of data, multiple key-value pairs are defined, defined each key-value pair can describe individual data
Storage characteristics;
(2)All key-value pairs are integrated, establish the key-value pair table of comparisons;
(3)When needing to store or obtaining data, the key-value pair table of comparisons is traversed according to the data attribute of the data, is found out suitable
The key-value pair of the data;
(4)Data are packaged and parsed according to the attribute of key-value pair;
(5)The data for being stored in or obtaining hereof after key-value pair encapsulation;
The step(2)It is middle establish the key-value pair table of comparisons method be:First, a sequence is established, by the identical key assignments of form
To being placed on the same area of sequence;Secondly, all areas are arranged by short and long sequence according to byte length shared by form
Row, for the equal region of total length, as the byte length as shared by first data type in short and long sequence comparison format, if
It is still equal, then continue more next data type, until the last one data type;Again, it is arranged according to key-value pair title
The key-value pair of same format, the entitled character string of key-value pair, according to sequence of positions of the character in ASCII character table from low to high
The initial character of character string is arranged, the character of more next position if identical, until the last character of character string
Symbol;Finally, the key-value pair table of comparisons is established according to the key-value pair sequence after arrangement.
2. it is according to claim 1 based on the data key values of file system of embedded device to storage method, feature exists
In:The data attribute includes the purposes and form of data, and the purposes of data refers to when programming personnel defines the data be it
The virtual concept of its function of the description of imparting, the Formats User of data represents the content of the data, is a data type
The data acquisition system of data or some data types composition.
3. it is according to claim 1 based on the data key values of file system of embedded device to storage method, feature exists
In:The attribute of the key-value pair include for show key-value pair in the key-value pair table of comparisons serial number of position, for describing number
According to the title of purposes and the form for describing data content.
4. it is according to claim 1 based on the data key values of file system of embedded device to storage method, feature exists
In:The step(4)The method of encapsulation and the parsing of middle data is:The title of key-value pair and form are considered as to the sky of label
Text of an annotated book shelves, the file for storing data are considered as a cubbyhole;When data store, by the sky of the content record of data to corresponding label
In text of an annotated book shelves, cubbyhole is then placed in realize the storage of data, operation, that is, data encapsulation of this record;Conversely, data
Reading, which is considered as on cubbyhole, to be found corresponding document according to label and makes a copy of imparting data by the content of paper trail
Process, this operation made a copy of i.e. data parse.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510760517.5A CN105354311B (en) | 2015-11-10 | 2015-11-10 | It is a kind of based on the data key values of file system of embedded device to storage method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510760517.5A CN105354311B (en) | 2015-11-10 | 2015-11-10 | It is a kind of based on the data key values of file system of embedded device to storage method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105354311A CN105354311A (en) | 2016-02-24 |
CN105354311B true CN105354311B (en) | 2018-06-19 |
Family
ID=55330283
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510760517.5A Active CN105354311B (en) | 2015-11-10 | 2015-11-10 | It is a kind of based on the data key values of file system of embedded device to storage method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105354311B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110851136A (en) * | 2019-09-18 | 2020-02-28 | 平安科技(深圳)有限公司 | Data acquisition method and device, electronic equipment and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101770291A (en) * | 2009-04-30 | 2010-07-07 | 广东国笔科技股份有限公司 | Semantic analysis data hashing storage and analysis methods for input system |
CN104238963A (en) * | 2014-09-30 | 2014-12-24 | 华为技术有限公司 | Data storage method, device and system |
CN104331453A (en) * | 2014-10-30 | 2015-02-04 | 北京思特奇信息技术股份有限公司 | Distributed file system and constructing method thereof |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9489445B2 (en) * | 2013-03-13 | 2016-11-08 | Nice Systems Ltd. | System and method for distributed categorization |
-
2015
- 2015-11-10 CN CN201510760517.5A patent/CN105354311B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101770291A (en) * | 2009-04-30 | 2010-07-07 | 广东国笔科技股份有限公司 | Semantic analysis data hashing storage and analysis methods for input system |
CN104238963A (en) * | 2014-09-30 | 2014-12-24 | 华为技术有限公司 | Data storage method, device and system |
CN104331453A (en) * | 2014-10-30 | 2015-02-04 | 北京思特奇信息技术股份有限公司 | Distributed file system and constructing method thereof |
Also Published As
Publication number | Publication date |
---|---|
CN105354311A (en) | 2016-02-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103593440B (en) | The reading/writing method and device of journal file | |
CN108563796A (en) | Data compressing method, device and the electronic equipment of block chain | |
CN102867071A (en) | Management method for massive network management historical data | |
CN103988212A (en) | Methods and systems for routing in state machine | |
WO2002003190A8 (en) | System for linking data cells through permutation | |
JP2005302038A (en) | Method and system for renaming consecutive key in b-tree | |
CN104331278A (en) | Instruction filtering method and device for specifications of ARINC661 | |
CN106503214A (en) | A kind of complex rule matching process based on Redis memory databases | |
CN107577697A (en) | A kind of data processing method, device and equipment | |
CN107818114A (en) | A kind of data processing method, device and database | |
CN106503008A (en) | File memory method and device and file polling method and apparatus | |
CN110019111A (en) | Data processing method, device, storage medium and processor | |
CN104408128B (en) | A kind of reading optimization method indexed based on B+ trees asynchronous refresh | |
CN106844288A (en) | A kind of random string generation method and device | |
CN107103035A (en) | This earth's surface data-updating method and device | |
CN106033438A (en) | Public sentiment data storage method and server | |
CN101944121B (en) | Generating method of finite state automaton, keyword matching method and devices and equipment | |
CN105354311B (en) | It is a kind of based on the data key values of file system of embedded device to storage method | |
CN107609011A (en) | The maintaining method and device of a kind of data-base recording | |
CN110020272A (en) | Caching method, device and computer storage medium | |
Icking et al. | Priority search trees in secondary memory | |
CN107291832A (en) | A kind of date storage method based on list storage structure | |
CN105408893B (en) | A kind of data processing and wiring method and relevant apparatus | |
CN102591958A (en) | Matching method and matching device of deterministic finite automation based on ternary content addressable memory (TCAM) | |
CN106777290A (en) | A kind of method and device for deriving data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |