CN108153488A - Data increase method and device certainly - Google Patents

Data increase method and device certainly Download PDF

Info

Publication number
CN108153488A
CN108153488A CN201711332696.8A CN201711332696A CN108153488A CN 108153488 A CN108153488 A CN 108153488A CN 201711332696 A CN201711332696 A CN 201711332696A CN 108153488 A CN108153488 A CN 108153488A
Authority
CN
China
Prior art keywords
increment
memory
key assignments
data
operator
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.)
Granted
Application number
CN201711332696.8A
Other languages
Chinese (zh)
Other versions
CN108153488B (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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201711332696.8A priority Critical patent/CN108153488B/en
Publication of CN108153488A publication Critical patent/CN108153488A/en
Application granted granted Critical
Publication of CN108153488B publication Critical patent/CN108153488B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Increase method and device certainly the disclosure is directed to a kind of data.This method includes:When detecting increment operator, recorded according to the corresponding write operation in daily record with reference to key assignments and reference increment of increment operator, it is corresponding with reference to key assignments and with reference to increment and the operation mark of increment operator that operation note includes increment operator;Memory is updated according to operation note so that data corresponding with reference key assignments include increment identifier and with reference to increment in memory after update;The initial data of the corresponding memory block storage of key assignments is referred to when the information of memory storage is written disk according to preset time period, in reading disk, is added in initial data and obtains increasing data certainly with reference to increment, and the memory block of data write-in disk will be increased certainly.In the technical solution, realized in a manner that key assignments distributed memory system performs modification operational order to the increment operator with reference to key assignments, improve execution efficiency of the system to increment operator.

Description

Data increase method and device certainly
Technical field
This disclosure relates to technical field of data processing more particularly to a kind of data increase method and device certainly.
Background technology
In the relevant technologies, key assignments (key-value) storage system set in terminal is provided from increasing interface (increment), increment operator can be performed by any one memory block to terminal from interface is increased using this, as in any one The data stored in counterfoil perform the operation plus increment.The process that terminal is currently running is performing memory block and should increase certainly During operation, which needs to perform read operation to the memory block first, that is, it is in the block to read out the memory Data, and obtain new data plus increment for the data, then perform write operation to the memory block, will the new data write Enter the memory block.It can thus be appreciated that using should need to perform reading successively and write two operations from when increasing interface execution increment operator, because This increment operator it is less efficient.
Invention content
To overcome the problems in correlation technique, a kind of data of embodiment of the present disclosure offer increase method and device certainly.Institute It is as follows to state technical solution:
According to the aspect of the embodiment of the present disclosure, a kind of data are provided from increasing method, including:
When detecting increment operator, write in daily record according to the corresponding reference key assignments of the increment operator and with reference to increment Enter operation note, it is corresponding with reference to key assignments and with reference to increment and the increasing certainly that the operation note includes the increment operator The operation mark of operation;
Memory is updated according to the operation note so that data corresponding with the reference key assignments in the memory after update Including increment identifier and described with reference to increment, the memory has recorded multiple key assignments and number corresponding with the multiple key assignments According to;
When the information of the memory storage is written disk according to preset time period, if detecting described in the memory Include the increment identifier with reference to the corresponding data of key assignments, read described in the disk with reference to the corresponding memory block storage of key assignments Initial data, obtained in the initial data plus described with reference to increment from increasing data, and will be described from increasing data write-in The memory block of the disk.
The technical scheme provided by this disclosed embodiment can include the following benefits:Using key assignments distributed storage system The mode that system performs modification operational order is realized to the increment operator with reference to key assignments, i.e., by the daily record in the storage system and interior Deposit the increment operator realized to reference to key assignments, it is only necessary to which, by the daily record with reference to increment write-in storage system, storage system is It can be completed according to the rule that preset processing modification operates subsequently to, from increasing process, improving system to being grasped from increasing with reference to key assignments The execution efficiency of work.
In one embodiment, it is described according to the operation note update memory so that after update in the memory with institute It states and includes with reference to the corresponding data of key assignments including increment identifier and the increment that refers to:
Obtain the operation mark of the operation note;
If the operation mark indicates the operation note, corresponding operation is increment operator, according to the operation note more New memory so that data corresponding with the reference key assignments include increment identifier and the increment in the memory after update.
In one embodiment, it is described according to the operation note update memory so that after update in the memory with institute It states and includes with reference to the corresponding data of key assignments including increment identifier and the increment that refers to:
If current in the memory do not store the reference key assignments and the corresponding data of the reference key assignments, according to the behaviour Note down added in the memory it is described with reference to key assignments and with described with reference to the corresponding data of key assignments, it is described to refer to key assignments Corresponding data include the increment identifier and it is described refer to increment.
In one embodiment, the method further includes:
If the memory is currently stored the reference key value and the corresponding data of the reference key assignments, determine in described Deposit whether the currently stored corresponding data of the reference key assignments include the increment identifier;
If the currently stored corresponding data of the reference key assignments of the memory include the increment identifier, obtain in described Deposit the currently stored history increment included with reference to the corresponding data of key assignments;
The increment that refers to included on the history increment plus the operation note obtains sigma delta;
The described of the memory storage refers to key-value pair after the increment identifier and the sigma delta are stored as update The data answered.
In one embodiment, the method further includes:
If the currently stored corresponding data of the reference key assignments of the memory is refer to key-value pair described in the disk The initial data of memory block storage answered, the increment that refers to included in the initial data plus the operation note obtain To increasing data certainly so that refer to the corresponding data of key assignments after update described in the memory as the increasing data certainly.
According to the second aspect of the embodiment of the present disclosure, a kind of data are provided and are put from being installed in addition with, including:
Journal module, for when detecting increment operator, key assignments and reference to be referred to according to the increment operator is corresponding Increment write operation in daily record records, and it is corresponding with reference to key assignments and with reference to increasing that the operation note includes the increment operator The operation mark of amount and the increment operator;
Memory modules, for according to the operation note update memory so that after update in the memory with the reference The corresponding data of key assignments include increment identifier and described with reference to increment, the memory have recorded multiple key assignments and with it is the multiple The corresponding data of key assignments;
Disk module, for when the information of the memory storage is written disk according to preset time period, if detecting Include the increment identifier with reference to the corresponding data of key assignments described in the memory, read and key-value pair is referred to described in the disk The initial data of memory block storage answered is obtained with reference to increment from increasing data, and by institute in the initial data plus described It states from the memory block for increasing the data write-in disk.
In one embodiment, the memory modules include:
First acquisition submodule, for obtaining the operation mark of the operation note;
First update submodule, if indicating that the corresponding operation of the operation note is to increase behaviour certainly for the operation mark Make, memory is updated according to the operation note so that data corresponding with the reference key assignments include in the memory after update Increment identifier and the increment.
In one embodiment, the memory modules include:
Submodule is added, if described with reference to key assignments and described corresponding with reference to key assignments for not stored currently in the memory Data, added in the memory according to the operation note it is described with reference to key assignments and with described with reference to the corresponding number of key assignments According to described to include the increment identifier with reference to the corresponding data of key assignments and described refer to increment.
In one embodiment, the memory modules further include:
Determination sub-module, if for the memory it is currently stored have the reference key value and it is described with reference to key assignments it is corresponding Data, determine whether the currently stored corresponding data of the reference key assignments of the memory include the increment identifier;
Second acquisition submodule, if including for the currently stored corresponding data of the reference key assignments of the memory described Increment identifier obtains the currently stored history increment included with reference to the corresponding data of key assignments of the memory;
Summation module is tired out for adding the increment that refers to that the operation note includes on the history increment Count increment;
Second update submodule is deposited for the increment identifier and the sigma delta to be stored as the memory after updating The corresponding data of the reference key assignments of storage.
In one embodiment, the memory modules further include:
Third updates submodule, if being the magnetic for the currently stored corresponding data of the reference key assignments of the memory With reference to the initial data of the corresponding memory block storage of key assignments described in disk, the operation note packet is added in the initial data What is included described obtains with reference to increment from increasing data so that described in the memory with reference to the corresponding data of key assignments is described after update From increasing data.
According to the third aspect of the embodiment of the present disclosure, a kind of data are provided and are put from being installed in addition with, including:
Processor;
For storing the memory of processor-executable instruction;
Wherein, the processor is configured as:
When detecting increment operator, write in daily record according to the corresponding reference key assignments of the increment operator and with reference to increment Enter operation note, it is corresponding with reference to key assignments and with reference to increment and the increasing certainly that the operation note includes the increment operator The operation mark of operation;
Memory is updated according to the operation note so that data corresponding with the reference key assignments in the memory after update Including increment identifier and described with reference to increment, the memory has recorded multiple key assignments and number corresponding with the multiple key assignments According to;
When the information of the memory storage is written disk according to preset time period, if detecting described in the memory Include the increment identifier with reference to the corresponding data of key assignments, read described in the disk with reference to the corresponding memory block storage of key assignments Initial data, obtained in the initial data plus described with reference to increment from increasing data, and will be described from increasing data write-in The memory block of the disk.
According to the fourth aspect of the embodiment of the present disclosure, a kind of computer readable storage medium is provided, is stored thereon with calculating Machine instructs, when which is executed by processor the step of realization first aspect any embodiment the method.
It should be understood that above general description and following detailed description are only exemplary and explanatory, not The disclosure can be limited.
Description of the drawings
Attached drawing herein is incorporated into specification and forms the part of this specification, shows the implementation for meeting the disclosure Example, and for explaining the principle of the disclosure together with specification.
Fig. 1 is the flow chart from increasing method according to the data shown in an exemplary embodiment.
Fig. 2 a are to be installed in addition with the structure diagram put certainly according to the data shown in an exemplary embodiment.
Fig. 2 b are to be installed in addition with the structure diagram put certainly according to the data shown in an exemplary embodiment.
Fig. 2 c are to be installed in addition with the structure diagram put certainly according to the data shown in an exemplary embodiment.
Fig. 2 d are to be installed in addition with the structure diagram put certainly according to the data shown in an exemplary embodiment.
Fig. 2 e are to be installed in addition with the structure diagram put certainly according to the data shown in an exemplary embodiment.
Fig. 3 is to be installed in addition with the structure diagram put certainly according to the data shown in an exemplary embodiment.
Specific embodiment
Here exemplary embodiment will be illustrated in detail, example is illustrated in the accompanying drawings.Following description is related to During attached drawing, unless otherwise indicated, the same numbers in different attached drawings represent the same or similar element.Following exemplary embodiment Described in embodiment do not represent all embodiments consistent with the disclosure.On the contrary, they be only with it is such as appended The example of the consistent device and method of some aspects be described in detail in claims, the disclosure.
The technical solution that the embodiment of the present disclosure provides is related to terminal, and the terminal can be to be provided with key assignments distributed storage The terminal of system.In the relevant technologies, if the currently running process of terminal (hereinafter referred to as current length of run) instruction to reference to key assignments into Row increment operator, then the key assignments distributed memory system (hereinafter referred to as storage system) that terminal is set are needed first to the reference key It is worth corresponding memory block and performs read operation, that is, reads out memory data in the block, and add for the data and obtained with reference to increment New data, then to the memory block perform write operation, will the new data memory block is written.It follows that storage system System, the pending readings such as current process needs and the times for writing two operations, can when performing the increment operator with reference to key assignments It continues to run with, leads to the less efficient of the increment operator.In the technical scheme provided by this disclosed embodiment, it is distributed using key assignments The mode that formula storage system performs modification operational order is realized to the increment operator with reference to key assignments, i.e., by the storage system Daily record and memory are realized to the increment operator with reference to key assignments, it is only necessary to by the daily record with reference to increment write-in storage system, be deposited Storage system can be completed according to the rule of preset processing modification operation subsequently to, from increasing process, improving system with reference to key assignments To the execution efficiency of increment operator.
Fig. 1 is from the flow chart for increasing method according to a kind of data shown in an exemplary embodiment, and this method is applied to set The terminal of key assignments distributed memory system is equipped with, as shown in Figure 1, the data include the following steps 101 to step from increasing method 103:
In a step 101, when detecting increment operator, exist according to the corresponding reference key assignments of increment operator and with reference to increment Write operation records in daily record, and it is corresponding with reference to key assignments and with reference to increment and increment operator that operation note includes increment operator Operation mark.
Exemplary, the storage system set in terminal, can be in day in the increment operator for detecting current process instruction The operation note of the increment operator is written in will (log), which includes the Action number of the increment operator, should be from increasing behaviour Make corresponding with reference to key assignments and with reference to increment and the operation mark of the increment operator.
In a step 102, memory is updated according to operation note so that data corresponding with reference key assignments in memory after update Including increment identifier and with reference to increment.
Exemplary, the memory (memory) of the storage system has recorded multiple key assignments and number corresponding with multiple key assignments According to.The memory of the storage system can be updated according to the operation note in daily record, i.e., memory can be according to the behaviour in daily record Note down including key assignments and the data update memory in the corresponding data of the key assignments that store.Optionally, interior presence detects When new operation note being written in daily record, the operation mark that the operation note includes can be obtained first, according to the operation mark Determine update mode, then obtain key assignments and data corresponding with the key assignments that the operation note includes, the key assignments and with the key It is worth corresponding data to partner key-value pair, and then the data that memory can be included according to the update mode using the key-value pair are more The corresponding data of the key assignments included with the key-value pair that is stored in new memory.For example, it is assumed that the operation note that the memory is got Operation mark for modified logo, then memory can determine update mode as modification, and memory may be used in operation note at this time The corresponding data of the key assignments included with the key-value pair that is stored in the data modification memory that key-value pair includes.Or, it is assumed that this is interior The operation mark for depositing the operation note got is identified to delete, then memory can determine update mode to delete, at this time the behaviour Middle key-value pair of noting down does not include data, and memory can delete the corresponding number of the key assignments included with the key-value pair stored in memory According to.
It is exemplary, increment identifier can be preset, is updated convenient for memory according to the operation note of increment operator, example Such as increment identifier can be "+".Specifically, after the operation note of daily record write-in increment operator, memory can obtain first Take the operation mark of the operation note, however, it is determined that the operation mark indicates that the corresponding operation of the operation note is increment operator, i.e., Memory determines update mode as autoincrement mode according to the operation mark, then memory can obtain the reference key that the operation note includes It is worth and with reference to increment, then adds increment identifier with reference to increment for this and form an incremental data combination, then using the increment The corresponding data of the key assignments included with the key-value pair that stores in data combination update memory.
Optionally, the key-value pair included with the key-value pair stored in memory is using incremental data combination update memory During the data answered, it is possible that not storing the situation for referring to the corresponding data of key assignments in memory, memory can basis at this time The reference key assignments that the operation note includes add in memory this with reference to key assignments and with this with reference to the corresponding data of key assignments, this adds It is the renewal process to memory to add process, this stored in the memory after update includes increment mark with reference to the corresponding data of key assignments Know and with reference to increment.
Alternatively, the key-value pair included with the key-value pair stored in memory is using incremental data combination update memory should Data when, be stored in the memory with reference to key assignments and this with reference to the corresponding data of key assignments, memory can be first at this time It determines whether stored this includes increment identifier with reference to the corresponding data of key assignments, is corresponded to if the memory is currently stored with reference to key assignments Data include increment identifier, illustrate in preset time period current process repeatedly to this with reference to the corresponding memory block of key assignments carry out from Increase operation, and the memory it is currently stored with reference to the corresponding data of key assignments in the preset time period, and should before current time With reference to the history increment of key assignments, memory can obtain the history increment at this time, then remember on the history increment plus the operation It records the reference increment included and obtains sigma delta, memory storage after updating then is stored as according to increment identifier and the sigma delta The corresponding data of reference key assignments.The sigma delta can be used as next time corresponding with reference to key assignments to this in the preset time period Memory block carries out history increment during increment operator.
In step 103, when the information of memory storage is written disk according to preset time period, if detecting in memory Include increment identifier with reference to the corresponding data of key assignments, the initial data of the corresponding memory block storage of key assignments referred in reading disk, It adds in initial data and is obtained with reference to increment from increasing data, and will be from the memory block for increasing data write-in disk.
Exemplary, every preset time period disk can be written in the information stored in memory by storage system, optionally, deposited Storage system can be every preset time period according to newer data generate snapshot document in the preset time period in memory (checkpoint), disk is written into data newer in the preset time period by generating the snapshot document.Since daily record is Each operation is numbered, and in order to save the memory space of daily record, storage system can record this when generating snapshot document Then the Action number for the last one operation note that daily record is written in preset time period indicates that journal file abandons Action number Operation note before the Action number of the last one operation note.
Exemplary, if the memory refreshing crosses this with reference to the corresponding data of key assignments in preset time period, storage system is in life During into snapshot document, can detect stored in memory this with reference to the corresponding data of key assignments whether include increment identifier, if this is interior The corresponding data of reference key assignments for depositing middle storage include increment identifier, illustrate what memory carried out this with reference to the corresponding data of key assignments Update is to realize the increment operator for referring to the corresponding memory block of key assignments, and storage system can when generating snapshot document at this time With this in reading disk with reference to the initial data of the corresponding memory block storage of key assignments, then plus in memory in the initial data It obtains, from data are increased, and the memory block of disk will be written from increasing data, realizing interior to this with reference to the corresponding increment that refers to of key assignments The increment operator of counterfoil.
If process carried out multiple increment operator to this with reference to the corresponding memory block of key assignments in preset time period, in memory For this of storage with reference to the sigma delta that the corresponding data of key assignments are the multiple increment operator, storage system can also be in reading disk The initial data stored with reference to the corresponding memory block of key assignments, then corresponds in the initial data plus in memory with reference to key assignments Sigma delta obtain from increasing data, and will be realized from the memory block for increasing data write-in disk to the memory block from increasing behaviour Make.It follows that the multiple increment operator with reference to key assignments can be completed by a read-write operation in preset time period, into one Step improves the efficiency of increment operator.
In the technical scheme provided by this disclosed embodiment, modification operational order is performed using key assignments distributed memory system Mode realize to the increment operator with reference to key assignments, i.e., realized by the daily record in the storage system and memory to reference to key assignments Increment operator, it is only necessary to which, by the daily record with reference to increment write-in storage system, storage system can be repaiied according to preset processing The rule for changing operation is completed subsequently to, from increasing process, improving execution efficiency of the system to increment operator with reference to key assignments.
In one embodiment, it is interior in the presence of when being updated, it is also possible to the currently stored corresponding number of reference key assignments occur It is interior at this time to exist using incremental data group according to the situation for this in disk with reference to the initial data of the corresponding memory block storage of key assignments When closing the corresponding data of the key assignments included with the key-value pair that stores in update memory, the behaviour can be added in the initial data Note down including reference increment obtain from data are increased, that is, the corresponding data of reference key assignments stored in the memory after updating is are somebody's turn to do From increasing data.Storage system detects that the corresponding data of reference key assignments stored in the memory are not wrapped when generating snapshot document Increment identifier is included, therefore directly can generate snapshot document according to the corresponding data of the reference key assignments stored in memory, i.e., directly By this in the corresponding data write-in disk of the reference key assignments stored in the memory with reference to the corresponding memory block of key assignments, realize to reference The increment operator of the corresponding memory block of key assignments.
In practical application, if the situation that terminal machine of delaying occurs or powers off temporarily, terminal can be from the snapshot being newly generated Currently stored operation note recovery is delayed the information stored in memory before machine or power-off in file and daily record.
For example, it is assumed that when there is delaying machine in terminal, storage system according to the snapshot document being newly generated determine to delay machine when it is interior Storage with reference to the corresponding data of key assignments is with reference to increment or sigma delta with this, and after terminal recovery, storage system is It can restore this in memory according to the reference increment or sigma delta recorded in snapshot document with reference to the corresponding data of key assignments, and then make Obtaining terminal can restore according to the operation note recorded in the data and daily record restored in memory to the state before machine of not delaying.Terminal After recovery, current process can continue to run with, in order to ensure that the data in disk are consistent with the data in memory, storage system New snapshot document being generated according to the data in memory after recovery, disk is written into the data in memory.
In the technical scheme provided by this disclosed embodiment, modification operational order is performed using key assignments distributed memory system Mode realize to the increment operator with reference to key assignments, still can be according to being newly generated when the machine of delaying or power-off occurs in system The operation note recorded in snapshot document and daily record restores terminal to the state before do not delay machine or power-off, realizes delaying for terminal Machine restores.
Following is embodiment of the present disclosure, can be used for performing embodiments of the present disclosure.
Fig. 2 a be according to a kind of data shown in an exemplary embodiment from be installed in addition with put 20 structure diagram, the device 20 It can be implemented in combination with by software, hardware or both as some or all of of electronic equipment.As shown in Figure 2 a, the number According to be installed in addition with certainly put 20 include journal module 201, memory modules 202 and disk module 203.
Wherein, journal module 201, for when detecting increment operator, according to the corresponding reference key of the increment operator Value and write operation records in daily record with reference to increment, the operation note include the increment operator it is corresponding with reference to key assignments and With reference to increment and the operation mark of the increment operator.
Memory modules 202, for according to the operation note update memory so that after update in the memory with the ginseng Examine the corresponding data of key assignments and include increment identifier and described with reference to increment, the memory have recorded multiple key assignments and with it is described more The corresponding data of a key assignments.
Disk module 203, for when the information of the memory storage is written disk according to preset time period, if detection Include the increment identifier to the corresponding data of key assignments are referred to described in the memory, read and key assignments is referred to described in the disk The initial data of corresponding memory block storage is obtained with reference to increment from increasing data, and will in the initial data plus described The memory block that the disk is written from increasing data.
In one embodiment, as shown in Figure 2 b, the memory modules 202 include the first acquisition submodule 2021 and first Update submodule 2022.
Wherein, the first acquisition submodule 2021, for obtaining the operation mark of the operation note.
First update submodule 2022, if indicating that the corresponding operation of the operation note is to increase certainly for the operation mark Operation updates memory according to the operation note so that data packet corresponding with the reference key assignments in the memory after update Include increment identifier and the increment.
In one embodiment, as shown in Figure 2 c, the memory modules 202 include addition submodule 2023.The addition Submodule 2023, if not storing the reference key assignments and the corresponding data of the reference key assignments, root for current in the memory Added in the memory according to the operation note it is described with reference to key assignments and with described with reference to the corresponding data of key assignments, it is described Include the increment identifier with reference to the corresponding data of key assignments and described with reference to increment.
In one embodiment, as shown in Figure 2 d, the memory modules 202 further include determination sub-module 2024, and second obtains Submodule 2025 is taken, summation module 2026 and second updates submodule 2027.
Wherein it is determined that submodule 2024, if having the reference key value and the reference for the memory to be currently stored The corresponding data of key assignments, determine whether the currently stored corresponding data of the reference key assignments of the memory include the increment mark Know.
Second acquisition submodule 2025, if including for the currently stored corresponding data of the reference key assignments of the memory The increment identifier obtains the currently stored history increment included with reference to the corresponding data of key assignments of the memory.
Summation module 2026 obtains for adding the increment that refers to that the operation note includes on the history increment To sigma delta.
Second update submodule 2027, it is described interior after updating for the increment identifier and the sigma delta to be stored as The corresponding data of the reference key assignments of storage.
In one embodiment, as shown in Figure 2 e, the memory modules 202 further include third update submodule 2028.Institute Third update submodule 2028 is stated, if being the disk for the currently stored corresponding data of the reference key assignments of the memory Described in reference to the storage of key assignments corresponding memory block initial data, include in the initial data plus the operation note Described obtained with reference to increment from increasing data so that after update described in the memory with reference to the corresponding data of key assignments for it is described from Increase data.
A kind of data of embodiment of the disclosure offer are installed in addition with certainly puts, and key assignments distributed memory system is operated using modification is performed The mode of instruction is realized to the increment operator with reference to key assignments, i.e., is realized by the daily record in the storage system and memory to reference key The increment operator of value, it is only necessary to which, by the daily record with reference to increment write-in storage system, storage system can be according to preset place The rule of reason modification operation is completed subsequently to, from increasing process, improving execution efficiency of the system to increment operator with reference to key assignments.
A kind of data of embodiment of the present disclosure offer are installed in addition with certainly puts, including:
Processor;
For storing the memory of processor-executable instruction;
Wherein, processor is configured as:
When detecting increment operator, write in daily record according to the corresponding reference key assignments of the increment operator and with reference to increment Enter operation note, it is corresponding with reference to key assignments and with reference to increment and the increasing certainly that the operation note includes the increment operator The operation mark of operation;
Memory is updated according to the operation note so that data corresponding with the reference key assignments in the memory after update Including increment identifier and described with reference to increment, the memory has recorded multiple key assignments and number corresponding with the multiple key assignments According to;
When the information of the memory storage is written disk according to preset time period, if detecting described in the memory Include the increment identifier with reference to the corresponding data of key assignments, read described in the disk with reference to the corresponding memory block storage of key assignments Initial data, obtained in the initial data plus described with reference to increment from increasing data, and will be described from increasing data write-in The memory block of the disk.
In one embodiment, above-mentioned processor is also configured to:Obtain the operation mark of the operation note;If institute It states operation mark and indicates that the corresponding operation of the operation note is increment operator, memory is updated according to the operation note so that Data corresponding with the reference key assignments include increment identifier and the increment in the memory after update.
In one embodiment, above-mentioned processor is also configured to:If the reference is not currently stored in the memory Key assignments and described with reference to the corresponding data of key assignments, added in the memory according to the operation note it is described with reference to key assignments, with And data corresponding with the reference key assignments, it is described to include the increment identifier and the reference increasing with reference to the corresponding data of key assignments Amount.
In one embodiment, above-mentioned processor is also configured to:If the memory is currently stored the reference key Whether value and the corresponding data of the reference key assignments determine the currently stored corresponding data of the reference key assignments of the memory Including the increment identifier;If the currently stored corresponding data of the reference key assignments of the memory include the increment identifier, Obtain the currently stored history increment included with reference to the corresponding data of key assignments of the memory;Add on the history increment The increment that refers to that the upper operation note includes obtains sigma delta;The increment identifier and the sigma delta are stored For the described with reference to the corresponding data of key assignments of memory storage described after update.
In one embodiment, above-mentioned processor is also configured to:If the currently stored reference key of the memory It is worth initial data of the corresponding data to refer to the corresponding memory block storage of key assignments described in the disk, in the initial data The upper increment that refers to included plus the operation note is obtained from increasing data so that is referred to described in the memory after update The corresponding data of key assignments are to be described from increasing data.
A kind of data of embodiment of the disclosure offer are installed in addition with certainly puts, and key assignments distributed memory system is operated using modification is performed The mode of instruction is realized to the increment operator with reference to key assignments, i.e., is realized by the daily record in the storage system and memory to reference key The increment operator of value, it is only necessary to which, by the daily record with reference to increment write-in storage system, storage system can be according to preset place The rule of reason modification operation is completed subsequently to, from increasing process, improving execution efficiency of the system to increment operator with reference to key assignments.
About the device in above-described embodiment, wherein modules perform the concrete mode of operation in related this method Embodiment in be described in detail, explanation will be not set forth in detail herein.
Fig. 3 be according to shown in an exemplary embodiment it is a kind of for data from be installed in addition with put 30 structure diagram, the device 30 are suitable for terminal device.For example, device 30 can be mobile phone, and computer, digital broadcast terminal, messaging devices, Game console, tablet device, Medical Devices, body-building equipment, personal digital assistant etc..
Device 30 can include following one or more components:Processing component 302, memory 304, power supply module 306 are more Media component 308, audio component 310, the interface 312 of input/output (I/O), sensor module 314 and communication component 316。
The integrated operation of 302 usual control device 30 of processing component, such as with display, call, data communication, camera Operation and record operate associated operation.Processing component 302 can carry out execute instruction including one or more processors 320, To perform all or part of the steps of the methods described above.In addition, processing component 302 can include one or more modules, it is convenient for Interaction between processing component 302 and other assemblies.For example, processing component 302 can include multi-media module, to facilitate more matchmakers Interaction between body component 308 and processing component 302.
Memory 304 is configured as storing various types of data to support the operation in device 30.These data are shown Example includes the instruction of any application program or method for being operated on device 30, contact data, and telephone book data disappears Breath, picture, video etc..Memory 304 can be by any kind of volatibility or non-volatile memory device or their group It closes and realizes, such as static RAM (SRAM), electrically erasable programmable read-only memory (EEPROM) is erasable to compile Journey read-only memory (EPROM), programmable read only memory (PROM), read-only memory (ROM), magnetic memory, flash Device, disk or CD.
Power supply module 306 provides electric power for the various assemblies of device 30.Power supply module 306 can include power management system System, one or more power supplys and other generate, manage and distribute electric power associated component with for device 30.
Multimedia component 308 is included in the screen of one output interface of offer between described device 30 and user.One In a little embodiments, screen can include liquid crystal display (LCD) and touch panel (TP).If screen includes touch panel, screen Curtain may be implemented as touch screen, to receive input signal from the user.Touch panel includes one or more touch sensings Device is to sense the gesture on touch, slide, and touch panel.The touch sensor can not only sense touch or sliding action Boundary, but also detect duration and pressure associated with the touch or slide operation.In some embodiments, more matchmakers Body component 308 includes a front camera and/or rear camera.When device 30 is in operation mode, such as screening-mode or During video mode, front camera and/or rear camera can receive external multi-medium data.Each front camera and Rear camera can be a fixed optical lens system or have focusing and optical zoom capabilities.
Audio component 310 is configured as output and/or input audio signal.For example, audio component 310 includes a Mike Wind (MIC), when device 30 is in operation mode, during such as call model, logging mode and speech recognition mode, microphone is configured To receive external audio signal.The received audio signal can be further stored in memory 304 or via communication component 316 send.In some embodiments, audio component 310 further includes a loud speaker, for exports audio signal.
I/O interfaces 312 provide interface between processing component 302 and peripheral interface module, and above-mentioned peripheral interface module can To be keyboard, click wheel, button etc..These buttons may include but be not limited to:Home button, volume button, start button and lock Determine button.
Sensor module 314 includes one or more sensors, for providing the status assessment of various aspects for device 30. For example, sensor module 314 can detect opening/closed state of device 30, the relative positioning of component, such as the component For the display and keypad of device 30, sensor module 314 can be with the position of 30 1 components of detection device 30 or device Change, the existence or non-existence that user contacts with device 30,30 orientation of device or acceleration/deceleration and the temperature change of device 30. Sensor module 314 can include proximity sensor, be configured to detect object nearby without any physical contact Presence.Sensor module 314 can also include optical sensor, such as CMOS or ccd image sensor, in imaging applications It uses.In some embodiments, which can also include acceleration transducer, gyro sensor, magnetic sensing Device, pressure sensor or temperature sensor.
Communication component 316 is configured to facilitate the communication of wired or wireless way between device 30 and other equipment.Device 30 can access the wireless network based on communication standard, such as WiFi, 2G or 3G or combination thereof.In an exemplary implementation In example, communication component 316 receives broadcast singal or broadcast related information from external broadcasting management system via broadcast channel. In one exemplary embodiment, the communication component 316 further includes near-field communication (NFC) module, to promote short range communication.Example Such as, NFC module can be based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra wide band (UWB) technology, Bluetooth (BT) technology and other technologies are realized.
In the exemplary embodiment, device 30 can be believed by one or more application application-specific integrated circuit (ASIC), number Number processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic building bricks are realized, for performing above-mentioned data from increasing method.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instructing, example are additionally provided Such as include the memory 304 of instruction, above-metioned instruction can be performed to complete above-mentioned data from the side of increasing by the processor 320 of device 30 Method.For example, the non-transitorycomputer readable storage medium can be ROM, random access memory (RAM), CD-ROM, magnetic Band, floppy disk and optical data storage devices etc..
A kind of non-transitorycomputer readable storage medium, when the instruction in the storage medium is by the processor of device 30 During execution so that device 30 is able to carry out above-mentioned data from increasing method, the method includes:
When detecting increment operator, write in daily record according to the corresponding reference key assignments of the increment operator and with reference to increment Enter operation note, it is corresponding with reference to key assignments and with reference to increment and the increasing certainly that the operation note includes the increment operator The operation mark of operation;
Memory is updated according to the operation note so that data corresponding with the reference key assignments in the memory after update Including increment identifier and described with reference to increment, the memory has recorded multiple key assignments and number corresponding with the multiple key assignments According to;
When the information of the memory storage is written disk according to preset time period, if detecting described in the memory Include the increment identifier with reference to the corresponding data of key assignments, read described in the disk with reference to the corresponding memory block storage of key assignments Initial data, obtained in the initial data plus described with reference to increment from increasing data, and will be described from increasing data write-in The memory block of the disk.
In one embodiment, it is described according to the operation note update memory so that after update in the memory with institute It states and includes with reference to the corresponding data of key assignments including increment identifier and the increment that refers to:Obtain the operation mark of the operation note Know;If the operation mark indicates the operation note, corresponding operation is increment operator, according in operation note update It deposits so that data corresponding with the reference key assignments include increment identifier and the increment in the memory after update.
In one embodiment, it is described according to the operation note update memory so that after update in the memory with institute It states and includes with reference to the corresponding data of key assignments including increment identifier and the increment that refers to:If it is not stored currently in the memory described With reference to key assignments and the corresponding data of the reference key assignments, the reference key is added in the memory according to the operation note Value and with described with reference to the corresponding data of key assignments, it is described to include the increment identifier and described with reference to the corresponding data of key assignments With reference to increment.
In one embodiment, the method further includes:If the memory is currently stored the reference key value and institute It states with reference to the corresponding data of key assignments, it is described to determine whether the currently stored corresponding data of the reference key assignments of the memory include Increment identifier;If currently stored described of the memory includes the increment identifier with reference to the corresponding data of key assignments, described in acquisition The currently stored history increment included with reference to the corresponding data of key assignments of memory;The behaviour is added on the history increment Note down including described obtain sigma delta with reference to increment;After the increment identifier and the sigma delta are stored as update The corresponding data of the reference key assignments of the memory storage.
In one embodiment, the method further includes:If the currently stored reference key assignments of the memory is corresponding Data is, with reference to the initial data of the corresponding memory block storage of key assignments, add institute described in the disk in the initial data It states the increment that refers to that operation note includes to obtain from increasing data so that correspond to reference to key assignments described in the memory after update Data to be described from increasing data.
Those skilled in the art will readily occur to the disclosure its after considering specification and putting into practice disclosure disclosed herein Its embodiment.This application is intended to cover any variations, uses, or adaptations of the disclosure, these modifications, purposes or Person's adaptive change follows the general principle of the disclosure and including the undocumented common knowledge in the art of the disclosure Or conventional techniques.Description and embodiments are considered only as illustratively, and the true scope and spirit of the disclosure are by following Claim is pointed out.
It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and And various modifications and changes may be made without departing from the scope thereof.The scope of the present disclosure is only limited by appended claim.

Claims (12)

1. a kind of data increase method certainly, which is characterized in that including:
When detecting increment operator, behaviour is written in daily record according to the corresponding reference key assignments of the increment operator and with reference to increment It notes down, it is corresponding with reference to key assignments and with reference to increment and the increment operator that the operation note includes the increment operator Operation mark;
Memory is updated according to the operation note so that data corresponding with the reference key assignments include in the memory after update Increment identifier and described with reference to increment, the memory has recorded multiple key assignments and data corresponding with the multiple key assignments;
When the information of the memory storage is written disk according to preset time period, referred to described in the memory if detecting The corresponding data of key assignments include the increment identifier, read described in the disk with reference to the original of the corresponding memory block storage of key assignments Beginning data obtain increasing data certainly in the initial data plus the increment that refers to, and will be described in the data write-in of increasing certainly The memory block of disk.
2. according to the method described in claim 1, it is characterized in that, described update memory according to the operation note so that more Data corresponding with the reference key assignments include increment identifier in the memory after new and the increment that refers to includes:
Obtain the operation mark of the operation note;
If the operation mark indicates the operation note, corresponding operation is increment operator, according in operation note update It deposits so that data corresponding with the reference key assignments include increment identifier and the increment in the memory after update.
3. according to the method described in claim 1, it is characterized in that, described update memory according to the operation note so that more Data corresponding with the reference key assignments include increment identifier in the memory after new and the increment that refers to includes:
If current in the memory do not store the reference key assignments and the corresponding data of the reference key assignments, remembered according to the operation Record added in the memory it is described with reference to key assignments and with described with reference to the corresponding data of key assignments, it is described to be corresponded to reference to key assignments Data include the increment identifier and it is described refer to increment.
4. according to the method described in claim 3, it is characterized in that, the method further includes:
If the memory is currently stored the reference key value and the corresponding data of the reference key assignments, determine that the memory is worked as Whether the described of preceding storage includes the increment identifier with reference to the corresponding data of key assignments;
If the currently stored corresponding data of the reference key assignments of the memory include the increment identifier, obtain the memory and work as The history increment included with reference to the corresponding data of key assignments of preceding storage;
The increment that refers to included on the history increment plus the operation note obtains sigma delta;
The reference key assignments that the increment identifier and the sigma delta are stored as to the memory storage after updating is corresponding Data.
5. according to the method described in claim 4, it is characterized in that, the method further includes:
If the currently stored corresponding data of the reference key assignments of the memory are corresponding with reference to key assignments described in the disk The initial data of memory block storage, the increment that refers to included in the initial data plus the operation note obtain certainly Increase data so that increase data certainly to be described with reference to the corresponding data of key assignments described in the memory after update.
6. a kind of data are installed in addition with and put certainly, which is characterized in that including:
Journal module, for when detecting increment operator, key assignments to be referred to and with reference to increment according to the increment operator is corresponding Write operation records in daily record, and it is corresponding with reference to key assignments and with reference to increment that the operation note includes the increment operator, with And the operation mark of the increment operator;
Memory modules, for updating memory according to the operation note so that refer to key assignments with described in the memory after update Corresponding data include increment identifier and described with reference to increment, the memory have recorded multiple key assignments and with the multiple key assignments Corresponding data;
Disk module, for when the information of the memory storage is written disk according to preset time period, if detecting described Include the increment identifier with reference to the corresponding data of key assignments described in memory, read corresponding with reference to key assignments described in the disk The initial data that memory block stores adds the increment that refers in the initial data and obtains from increasing data, and by described in certainly Increase the memory block that the disk is written in data.
7. device according to claim 6, which is characterized in that the memory modules include:
First acquisition submodule, for obtaining the operation mark of the operation note;
First update submodule is operated if indicating that the operation note is corresponding for the operation mark as increment operator, root Memory is updated according to the operation note so that data corresponding with the reference key assignments include increment mark in the memory after update Know and the increment.
8. device according to claim 6, which is characterized in that the memory modules include:
Submodule is added, if not storing the reference key assignments and the corresponding number of the reference key assignments for current in the memory According to, added in the memory according to the operation note it is described with reference to key assignments and with described with reference to the corresponding data of key assignments, It is described to include the increment identifier with reference to the corresponding data of key assignments and described refer to increment.
9. device according to claim 8, which is characterized in that the memory modules further include:
Determination sub-module, if having the reference key value and the corresponding number of the reference key assignments for the memory to be currently stored According to determining whether currently stored described of the memory includes the increment identifier with reference to the corresponding data of key assignments;
Second acquisition submodule, if including the increment for the currently stored corresponding data of the reference key assignments of the memory Mark, obtains the currently stored history increment included with reference to the corresponding data of key assignments of the memory;
Summation module obtains accumulative increasing for adding the increment that refers to that the operation note includes on the history increment Amount;
Second update submodule, for the increment identifier and the sigma delta to be stored as the memory storage after updating It is described to refer to the corresponding data of key assignments.
10. device according to claim 9, which is characterized in that the memory modules further include:
Third updates submodule, if for the currently stored corresponding data of the reference key assignments of the memory in the disk The initial data stored with reference to the corresponding memory block of key assignments, includes in the initial data plus the operation note It is described to be obtained with reference to increment from increasing data so as to refer to the corresponding data of key assignments after update described in the memory to be described from increasing Data.
11. a kind of data are installed in addition with and put certainly, which is characterized in that including:
Processor;
For storing the memory of processor-executable instruction;
Wherein, the processor is configured as:
When detecting increment operator, behaviour is written in daily record according to the corresponding reference key assignments of the increment operator and with reference to increment It notes down, it is corresponding with reference to key assignments and with reference to increment and the increment operator that the operation note includes the increment operator Operation mark;
Memory is updated according to the operation note so that data corresponding with the reference key assignments include in the memory after update Increment identifier and described with reference to increment, the memory has recorded multiple key assignments and data corresponding with the multiple key assignments;
When the information of the memory storage is written disk according to preset time period, referred to described in the memory if detecting The corresponding data of key assignments include the increment identifier, read described in the disk with reference to the original of the corresponding memory block storage of key assignments Beginning data obtain increasing data certainly in the initial data plus the increment that refers to, and will be described in the data write-in of increasing certainly The memory block of disk.
12. a kind of computer readable storage medium, is stored thereon with computer instruction, which is characterized in that the instruction is by processor The step of claim 1 to 5 any one claim the method is realized during execution.
CN201711332696.8A 2017-12-13 2017-12-13 Data self-adding method and device Active CN108153488B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711332696.8A CN108153488B (en) 2017-12-13 2017-12-13 Data self-adding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711332696.8A CN108153488B (en) 2017-12-13 2017-12-13 Data self-adding method and device

Publications (2)

Publication Number Publication Date
CN108153488A true CN108153488A (en) 2018-06-12
CN108153488B CN108153488B (en) 2021-05-04

Family

ID=62467128

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711332696.8A Active CN108153488B (en) 2017-12-13 2017-12-13 Data self-adding method and device

Country Status (1)

Country Link
CN (1) CN108153488B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111309673A (en) * 2020-02-12 2020-06-19 普信恒业科技发展(北京)有限公司 Snapshot data generation method and device of incremental data
CN112035066A (en) * 2020-09-02 2020-12-04 中国银行股份有限公司 Method and device for calculating log retention time
CN113032349A (en) * 2019-12-25 2021-06-25 阿里巴巴集团控股有限公司 Data storage method and device, electronic equipment and computer readable medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102129435A (en) * 2010-01-13 2011-07-20 中国移动通信集团公司 Data storage service control method and system
CN103823634A (en) * 2012-11-16 2014-05-28 腾讯科技(深圳)有限公司 Data processing method and system supporting non-random write mode
US9235613B2 (en) * 2010-12-17 2016-01-12 Amazon Technologies, Inc. Flexible partitioning of data
CN106886375A (en) * 2017-03-27 2017-06-23 百度在线网络技术(北京)有限公司 The method and apparatus of data storage

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102129435A (en) * 2010-01-13 2011-07-20 中国移动通信集团公司 Data storage service control method and system
US9235613B2 (en) * 2010-12-17 2016-01-12 Amazon Technologies, Inc. Flexible partitioning of data
CN103823634A (en) * 2012-11-16 2014-05-28 腾讯科技(深圳)有限公司 Data processing method and system supporting non-random write mode
CN106886375A (en) * 2017-03-27 2017-06-23 百度在线网络技术(北京)有限公司 The method and apparatus of data storage

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113032349A (en) * 2019-12-25 2021-06-25 阿里巴巴集团控股有限公司 Data storage method and device, electronic equipment and computer readable medium
CN111309673A (en) * 2020-02-12 2020-06-19 普信恒业科技发展(北京)有限公司 Snapshot data generation method and device of incremental data
CN112035066A (en) * 2020-09-02 2020-12-04 中国银行股份有限公司 Method and device for calculating log retention time

Also Published As

Publication number Publication date
CN108153488B (en) 2021-05-04

Similar Documents

Publication Publication Date Title
CN104219388B (en) Sound control method and device
CN104951335B (en) The processing method and processing device of application program installation kit
CN104536783B (en) Headspace method to set up and device
CN109117874A (en) Operation behavior prediction technique and device
CN107423063A (en) Multiwindow processing method, device and equipment
CN106066770A (en) Memory space management and device
CN108153488A (en) Data increase method and device certainly
CN106528113A (en) File compiling method and apparatus
CN106021072A (en) Information display method and device
CN106774802A (en) The reminding method of terminal power, device and terminal
CN106921797A (en) Information prompting method and device
CN109558229A (en) Browser control method and device
CN106650569B (en) Fingerprint input method and device
CN105677215A (en) Application control method and apparatus
CN105607979A (en) Network interconnection control method and device
CN107577810A (en) Method for writing data, device and computer-readable recording medium
CN107977127A (en) Update the method, apparatus and terminal of the page
CN107239236A (en) Method for writing data and device
CN106919302A (en) The method of controlling operation thereof and device of mobile terminal
CN106775240A (en) The triggering method of application program, device and terminal
CN106201611A (en) Run the method and device of application
CN106293717A (en) The processing method of the setting of terminal, device and terminal
CN105657199A (en) Method and device for establishing talking connection and switching equipment
CN107948876A (en) Control the method, apparatus and medium of sound-box device
CN107193530A (en) A kind of method and apparatus for generating random number

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant