CN107515867A - The generation method and device that data storage, querying method and the device and a kind of rowKey of a kind of NoSQL databases combine entirely - Google Patents

The generation method and device that data storage, querying method and the device and a kind of rowKey of a kind of NoSQL databases combine entirely Download PDF

Info

Publication number
CN107515867A
CN107515867A CN201610425195.3A CN201610425195A CN107515867A CN 107515867 A CN107515867 A CN 107515867A CN 201610425195 A CN201610425195 A CN 201610425195A CN 107515867 A CN107515867 A CN 107515867A
Authority
CN
China
Prior art keywords
rowkey
field
new
setting quantity
generation
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
CN201610425195.3A
Other languages
Chinese (zh)
Other versions
CN107515867B (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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201610425195.3A priority Critical patent/CN107515867B/en
Publication of CN107515867A publication Critical patent/CN107515867A/en
Application granted granted Critical
Publication of CN107515867B publication Critical patent/CN107515867B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures

Abstract

The application provides a kind of date storage method of NoSQL databases, including:Obtain setting quantity field includes at least one rowKey for not repeating rowKey combination and a field to be added entirely;Successively to each rowKey in the full combinations of rowKey of the setting quantity field, the step of adding field is performed, including:The field to be added is added after the rowKey, generates a new rowKey;If the number of the field in the rowKey meets the condition of setting, the field to be added is added before the rowKey and removes last field in the rowKey, generates a new rowKey;The data corresponding to each new rowKey of generation are obtained, and by the data storage in a line that the new rowKey is corresponded in the NoSQL databases.The application also provides a kind of querying method of NoSQL databases and a kind of generation method of multi-field rowKey full combination.The application can solve the problems, such as that prior art query time efficiency is low and can not accomplish that directly generate rowKey combines optimal solution entirely.

Description

Data storage, querying method and the device and one kind of a kind of NoSQL databases The generation method and device that rowKey is combined entirely
Technical field
The application is related to Computer Database data storage and data query technical field, and in particular to a kind of NoSQL numbers According to the data storage in storehouse, querying method and device.The application further relates to generation method and the device that a kind of rowKey is combined entirely.
Background technology
In the monitoring scene of large-scale distributed system, user is frequently necessary to query monitor data and its history number According to.On the one hand, because the data volume of monitoring data is huge, monitoring data is typically all stored in NoSQL databases;The opposing party Face, because monitoring data can be generally described by multiple dimensions, the field combination form of querying condition during inquiry Can be very more.Which increase database purchase monitoring data and establish its complexity indexed.
For the demand of the query monitor data of quick response user, most of technical scheme is all used and traded space for time Mode.Depending on storing the difference of initial data number in database, the mode for implementing to trade space for time can be divided into Two classes:One kind is that a initial data is stored in NoSQL databases, and bigger concordance list is established to record for initial data The filter condition and the rowKey values of corresponding initial data that its different field is combined into;When user is inquired about, from concordance list The rowKey values of the condition of satisfaction are got, the inquiry of specific initial data is carried out further according to rowKey values;Another kind of is in NoSQL Store more parts of initial data in database, the filter condition that initial data is combined into according to its different field is generated or inquired about RowKey corresponding to directly;When user is inquired about, corresponding original is directly obtained according to the rowKey for generating or inquiring Beginning data.
Which kind of mode more than no matter using, it is required for calculating and generates multiple field rowKey all combination sides Method.Being commonly used to generate the method that this multi-field rowKey combines entirely by industry at present is exactly:Direct circulation enumerates each word Whether section appears in querying condition to generate the common 2^N-1 of full combination of N number of field, then every kind of combination is generated Corresponding all arrangement modes, duplicate removal finally is carried out to the inclusion relation of formation sequence again, so as to obtain the rowKey of optimal solution Full combination.
First shortcoming of the method for the general generation multi-field rowKey of industry full combination is exactly short time consumption at present Longer, the time complexity for generating the full combination of N number of field is O (2^N), needs to generate accordingly for all sequences Fully intermeshing mode is averagely at least also required to O ((N/2)!), because optimal solution has, C (N, Ceil (N/2)) is individual during duplicate removal, so traversal Time best situation stills need O (C (N, Ceil (N/2)));If the fully intermeshing for directly generating N number of field is also required to O (N!), So the time complexity of this general full composite sequence method of generation can be much larger than O (2^N) * (C (N, Ceil (N/2))).
Second shortcoming of the method for the general generation multi-field rowKey of industry full combination, and most serious are asked Topic, is due to more all being done according to prefix for duplicate removal, so the result typically retained is all the sequence that length is N, because The effect of this this duplicate removal can not ensure that the sequence of generation is optimal solution.Because only number it is identical be it is far from being enough, will also Guarantee the identical of form, otherwise field dynamic increase and reduce when, regenerated new sequence be with it is old Sequence is incompatible, can cause the old data of no newer field can not inquire again.
The content of the invention
The application provides data storage, querying method and the device of a kind of NoSQL databases and a kind of multi-field The generation method and device of rowKey full combination are low and can not accomplish straight to solve prior art query time efficiency Deliver a child into the problem of rowKey combines optimal solution entirely.
The application provides a kind of date storage method of NoSQL databases, including:
Complete combine of at least one rowKey for not repeating rowKey that include that acquisition sets quantity field waits to add with one The field added;The rowKey, including:The combination of the unduplicated setting quantity field of at least more than one;
Successively to each rowKey in the full combinations of rowKey of the setting quantity field, addition field is performed Step;The step of addition field, including:Add the field to be added after the rowKey, generate one it is new rowKey;If the number of the field in the rowKey meets the condition of setting, wait to add plus described before the rowKey The field that adds simultaneously removes last field in the rowKey, generates a new rowKey;
The data corresponding to each new rowKey of generation are obtained, and by the data storage in the NoSQL A line of the new rowKey is corresponded in database.
Optionally, if the number of the field in the rowKey meets the condition of setting, including:
If the half that the number of the field in the rowKey is not less than one more than the setting quantity is rounded up to Integer.
Optionally, each in being combined entirely to the rowKey for setting quantity field successively described in performing RowKey, after performing the step of adding field, perform following step:
Gather each new rowKey of generation, generate the full combinations of rowKey of a field more than the setting quantity.
Optionally, methods described, including:
Obtain according to the specified field setting quantity field that repetitive sequence does not arrange;
One new rowKey is generated with the 1st field in the setting quantity field, 1 field of generation RowKey is combined entirely;
The data corresponding to the new rowKey of generation are obtained, and by the data storage in the NoSQL databases Middle correspondence new rowKey a line;
Successively using the 2nd in the field of the setting quantity to the setting quantity field as field to be added, The date storage method of NoSQL databases described in usage right requirement 3, to store the number corresponding to each new rowKey Combined entirely according to 2 rowKey to the setting quantity field of generation.The application provides a kind of data of NoSQL databases Storage device, including:
Acquisition rowKey is combined entirely and field unit, for obtaining not repeated including at least one for setting quantity field RowKey rowKey is combined entirely and a field to be added;The rowKey, including:At least more than one unduplicated The combination of the setting quantity field;
New rowKey units are generated, for successively to each in the full combinations of rowKey of the setting quantity field Individual rowKey, perform the step of adding field;The step of addition field, including:Treated after the rowKey plus described The field of addition, generate a new rowKey;If the number of the field in the rowKey meets the condition of setting, in institute State before rowKey plus the field to be added and remove last field in the rowKey, generate one it is new rowKey;
Data cell corresponding to rowKey is stored, for obtaining the data corresponding to each new rowKey of generation, And by the data storage in a line that the new rowKey is corresponded in the NoSQL databases.
Optionally, if the number of the field in the rowKey meets the condition of setting, including:
If the half that the number of the field in the rowKey is not less than one more than the setting quantity is rounded up to Integer.
Optionally, after the new rowKey units of the generation are triggered, following units are triggered:
The full assembled units of rowKey are generated, for gathering each new rowKey of generation, are generated than the setting quantity The rowKey of more fields is combined entirely.
Optionally, described device, including:
Field unit is obtained, is set for obtaining according to the specified field setting quantity field that repetitive sequence does not arrange Quantity;
The full assembled units of rowKey of 1 field are generated, for being given birth to the 1st field in the setting quantity field The rowKey new into one, the rowKey of 1 field of generation are combined entirely;
The full data splitting units of rowKey of 1 field are stored, for obtaining the number corresponding to the new rowKey of generation According to, and by the data storage in a line that the new rowKey is corresponded in the NoSQL databases;
Storage 2 is to the full data splitting units of rowKey for setting quantity field, for successively with the setting quantity Field in the 2nd require the NoSQL numbers described in 3 as field to be added, usage right to the setting quantity field According to the date storage method in storehouse, to store the data and the extremely setting quantity of generation 2 corresponding to each new rowKey The rowKey of individual field is combined entirely.
The application provides a kind of data storage electronic equipment of NoSQL databases, including:
Display;
Processor;
Memory, the program of the data storage for storing NoSQL databases, described program are read by the processor During execution, following operation is performed:Obtain setting quantity field includes at least one complete group of rowKey for not repeating rowKey Close and a field to be added;The rowKey, including:The unduplicated setting quantity field of at least more than one Combination;Successively to each rowKey in the full combinations of rowKey of the setting quantity field, addition field is performed Step;The step of addition field, including:Add the field to be added after the rowKey, generate one it is new rowKey;If the number of the field in the rowKey meets the condition of setting, wait to add plus described before the rowKey The field that adds simultaneously removes last field in the rowKey, generates a new rowKey;Obtain each of generation Data corresponding to new rowKey, and the data storage is described new in being corresponded in the NoSQL databases RowKey a line.
The application provides a kind of data query method of NoSQL databases, is built applied to described date storage method Vertical NoSQL databases, it is characterised in that including:
Field to be checked is combined according to querying condition, forms inquiry field;
RowKey corresponding to inquiring about field according to the inquiry Field Inquiry;
According to the rowKey inquired, the data corresponding to the rowKey inquired are obtained in the NoSQL databases.
The application provides a kind of data query arrangement of NoSQL databases, is built applied to described data storage device Vertical NoSQL databases, it is characterised in that including:
Inquiry field unit is formed, for combining field to be checked according to querying condition, forms inquiry field;
RowKey units are inquired about, for the rowKey corresponding to the inquiry field according to the inquiry Field Inquiry;
Database data unit is inquired about, for according to the rowKey inquired, inquiry to be obtained in the NoSQL databases The data corresponding to rowKey arrived.
The application provides the generation method that a kind of rowKey is combined entirely, including:
Complete combine of at least one rowKey for not repeating rowKey that include that acquisition sets quantity field waits to add with one The field added;The rowKey, including:The combination of the unduplicated setting quantity field of at least more than one;
Successively to each rowKey in the full combinations of rowKey of the setting quantity field, addition field is performed Step;The step of addition field, including:Add the field to be added after the rowKey, generate one it is new rowKey;If the number of the field in the rowKey meets the condition of setting, wait to add plus described before the rowKey The field that adds simultaneously removes last field in the rowKey, generates a new rowKey;
Gather each new rowKey of generation, generate the full combinations of rowKey of a field more than the setting quantity.
Optionally, if the number of the field in the rowKey meets the condition of setting, including:
If the half that the number of the field in the rowKey is not less than one more than the setting quantity is rounded up to Integer.
Optionally, methods described, including:
Obtain according to the specified field setting quantity field that repetitive sequence does not arrange;
One new rowKey is generated with the 1st field in the setting quantity field, 1 field of generation RowKey is combined entirely;
Quantity field is set as field to be added using the 2nd in the setting quantity field to the successively, The generation method that rowKey described in usage right requirement 10 is combined entirely, with 2 rowKey to setting quantity field of generation Full combination.
The application also provides the generating means that a kind of rowKey is combined entirely, including:
Acquisition rowKey is combined entirely and field unit, for obtaining not repeated including at least one for setting quantity field RowKey rowKey is combined entirely and a field to be added;The rowKey, including:At least more than one unduplicated The combination of the setting quantity field;
New rowKey units are generated, for successively to each in the full combinations of rowKey of the setting quantity field Individual rowKey, perform the step of adding field;The step of addition field, including:Treated after the rowKey plus described The field of addition, generate a new rowKey;If the number of the field in the rowKey meets the condition of setting, in institute State before rowKey plus the field to be added and remove last field in the rowKey, generate one it is new rowKey;
The full assembled units of rowKey are generated, for gathering each new rowKey of generation, are generated than the setting quantity The rowKey of more fields is combined entirely.
Optionally, if the number of the field in the rowKey meets the condition of setting, including:
If the half that the number of the field in the rowKey is not less than one more than the setting quantity is rounded up to Integer.
Optionally, methods described, including:
Field unit is obtained, for obtaining according to the specified field setting quantity field that repetitive sequence does not arrange;
The full assembled units of rowKey of 1 field are generated, for being given birth to the 1st field in the setting quantity field The rowKey new into one, the rowKey of 1 field of generation are combined entirely;
Generation 2 is to the full assembled units of rowKey for setting quantity field, for successively with the setting quantity The 2nd in individual field requires the rowKey described in 10 to setting quantity field as field to be added, usage right The generation method combined entirely, combined entirely with 2 rowKey to setting quantity field of generation.
The application also provides the generation electronic equipment that a kind of rowKey is combined entirely, including:
Display;
Processor;
Memory, the program for the generation combined entirely for storing rowKey, described program are held by processor reading During row, following operation is performed:At least one rowKey for not repeating rowKey that includes for obtaining setting quantity field is combined entirely With a field to be added;The rowKey, including:The unduplicated setting quantity field of at least more than one Combination;Successively to each rowKey in the full combinations of rowKey of the setting quantity field, the step for adding field is performed Suddenly;The step of addition field, including:Add the field to be added after the rowKey, generate one it is new rowKey;If the number of the field in the rowKey meets the condition of setting, wait to add plus described before the rowKey The field that adds simultaneously removes last field in the rowKey, generates a new rowKey;Set generates each new RowKey, generate than it is described setting quantity more than a field the full combinations of rowKey.
Compared with prior art, the application has advantages below:
The time efficiency of the technical scheme data storage and query of the application is higher.The application can make setting quantity Combination dynamically comes out the rowKey of field according to flow from the full combination producings of rowKey than setting the few field of quantity entirely, The method combined entirely better than existing generation multi-field rowKey in time efficiency;And the application can directly generate rowKey Full combination optimal solution, it is not necessary to which the duplicate removal for carrying out existing method consumption system resource again judges link.Thus carrying out NoSQL numbers According to storehouse data storage and query when, more preferable query time efficiency can be obtained.
With good autgmentability when the application carries out data storage in NoSQL databases.The technical scheme of the application In the case of field is increased, it can will directly increase number corresponding to the new rowKey of field on the basis of the former data storage According to storage is extended, the storage and inquiry of the data before not extending are not influenceed.
The present processes can obtain the method do not established concordance list, NoSQL data queries are carried out using redundant storage The data storage and query scheme that middle data storage number is minimum, autgmentability is best;And the application reduces existing method Data storage complexity, belong to the method that utilization space changes the time and carries out top optimization to space again.
Brief description of the drawings
Fig. 1 is a kind of date storage method embodiment flow chart for NoSQL databases that the application first embodiment provides;
Fig. 2 is that a kind of date storage method embodiment field for NoSQL databases that the application first embodiment provides expands The schematic diagram of exhibition process first;
Fig. 3 is that a kind of date storage method embodiment field for NoSQL databases that the application first embodiment provides expands The schematic diagram of exhibition process second;
Fig. 4 is a kind of date storage method embodiment flow chart for NoSQL databases that the application second embodiment provides;
Fig. 5 is a kind of data storage device embodiment schematic diagram for NoSQL databases that the application 3rd embodiment provides;
Fig. 6 is a kind of data storage device embodiment schematic diagram for NoSQL databases that the application fourth embodiment provides;
Fig. 7 is that a kind of data storage electronic equipment for NoSQL databases that the embodiment of the application the 5th provides is implemented to illustrate It is intended to;
Fig. 8 is a kind of data query embodiment of the method flow chart for NoSQL databases that the application sixth embodiment provides;
Fig. 9 is a kind of data query arrangement embodiment schematic diagram for NoSQL databases that the embodiment of the application the 7th provides;
Figure 10 is the generation method embodiment flow chart that a kind of rowKey that the embodiment of the application the 8th provides is combined entirely;
Figure 11 is the generation method embodiment flow chart that another rowKey that the embodiment of the application the 9th provides is combined entirely;
Figure 12 is the generating means embodiment schematic diagram that a kind of rowKey that the embodiment of the application the tenth provides is combined entirely;
Figure 13 is the generating means embodiment schematic diagram that a kind of rowKey that the embodiment of the application the 11st provides is combined entirely;
Figure 14 is that the generation electronic equipment that a kind of rowKey that the embodiment of the application the 12nd provides is combined entirely is implemented to illustrate It is intended to.
Embodiment
Many details are elaborated in the following description in order to fully understand the application.But the application can be with Much it is different from other manner described here to implement, those skilled in the art can be in the situation without prejudice to the application intension Under do similar popularization, therefore the application is not limited by following public specific implementation.
This application provides a kind of date storage method, device and the electronic equipment of NoSQL databases, a kind of NoSQL numbers Set according to the data query method and apparatus in storehouse, and a kind of generation method, device and the electronics of multi-field rowKey full combination It is standby.The application, which belongs to without using concordance list, in NoSQL databases, to be stored more parts of data, directly stores and look into by rowKey Ask the technical scheme of data.The specific embodiment of the application is described in detail with reference to accompanying drawing in turn below.
Fig. 1 is refer to, it is that a kind of date storage method for NoSQL databases that the application first embodiment provides is implemented Example flow chart.The storage method of the present embodiment is a recursive method, is to be based in database stored completion multiword The corresponding data of the full combinations of the rowKey of section, corresponding data are combined entirely to the rowKey for increasing by 1 field and stored. Specifically, the date storage method of the NoSQL databases, including:
Step S101:Obtain setting quantity field include it is at least one not repeat rowKey rowKey full combination with One field to be added;The rowKey, including:The group of the unduplicated setting quantity field of at least more than one Close.
Field is the field used in NoSQL databases, and rowKey is the above-mentioned field used in NoSQL databases Combination, rowKey full combination be each rowKey set.In specific embodiment below, no longer this is repeated.
The rowKey for obtaining setting quantity field is combined entirely, that is, is obtained as each combined by setting quantity field RowKey set;1 field to be added is obtained, that is, obtains and prepares each combined by the setting quantity field The field added on rowKey.
For example, in the present embodiment, by taking 3 fields as an example, it is respectively in tandem in order:Cluster cluster, it is main Machine host, and Adapter Name netName.The rowKey for obtaining 3 fields combines as acquisition cluster $ host $ netName entirely, This 3 rowKey of host $ netName, netName $ cluster;1 field to be added is obtained, as obtains time time This field.Wherein, symbol represents sequence separates symbol.
Step S103:Successively to each rowKey in the full combinations of rowKey of the setting quantity field, perform The step of adding field;The step of addition field, including:The field to be added is added after the rowKey, it is raw The rowKey new into one;If the number of the field in the rowKey meets the condition of setting, add before the rowKey The upper field to be added simultaneously removes last field in the rowKey, generates a new rowKey.
Each rowKey in being combined entirely to the rowKey for setting quantity field one by one in order, perform addition field The step of;The step of addition field, it is specifically:Add after last field in the rowKey being the combination of field The upper field to be added, the combination of one new field of generation is new rowKey;If field in the rowKey Number meets the condition of setting, then the field to be added is added before the first character section of the rowKey and removes institute Last described field in rowKey is stated, the combination of one new field of generation is new rowKey.
If the number of the field in the rowKey meets the condition of setting, including:If the word in the rowKey The number of section is not less than the integer being rounded up to of the half of one more than the setting quantity.
If the number of the field in the rowKey is not less than the upward house of the half of one more than the setting quantity The integer entered, i.e., the number of the field in described rowKey are not less than the Ceiling of the half of one more than the setting quantity The function of round numbers, then plus described in the field to be added and removal before the first character section of the rowKey Last described field in rowKey, the combination of one new field of generation is new rowKey.
In this step, set quantity field rowKey combine entirely how many rowKey then successively circulate execution add Add the step how many times of field, generate 1 or 2 new rowKey every time.For example, in the present embodiment, 3 fields Combination has 3 rowKey, i.e. cluster $ host $ netName, host $ netName, netName $ cluster to rowKey entirely, Then it is cluster $ host $ netName first against first rowKey when it is field time to add a new rowKey The step of performing addition field, adds time after cluster $ host $ netName, and one new rowKey of generation is cluster$host$netName$time;The number of the field in first rowKey, i.e., 3 are judged again, if not less than than institute State the integer being rounded up to of more one half of setting quantity, i.e. 3+1=4 half is that 2 integers being rounded up to still are 2, Now the number 3 of the field in a rowKey is not less than 2, then adds before first character section cluster $ host $ netName Upper time simultaneously removes last described field netName, and one new rowKey of generation is time $ cluster $ host;It After carry out to the i.e. host netName of second rowKey perform addition field the step of, added after host netName Time, one new rowKey of generation is host $ netName $ time;The number of the field in second rowKey is judged again, I.e. 2, if not less than the integer being rounded up to of the half of one more than the setting quantity, i.e. 2+1=3 half is 1.5 The integer being rounded up to is 2, and now the number of the field in second rowKey is not less than and imposed a condition, then second rowKey That is last field for adding field to be added before host netName and removing in second rowKey is netName, It is time $ host to generate a new rowKey;Two other new rowKey can be obtained by repeating this process, i.e., NetName $ cluster $ time and time $ netName.So, the step 3 time addition 1 of addition field is performed in circulation successively Individual field time, 6 new rowKey, i.e. cluster $ host $ netName $ time, host $ netName $ can be obtained Time, netName $ cluster $ time, time $ cluster $ host, time $ host, and time $ netName.
This step in fact also creates the full combinations of rowKey of a field more than setting quantity, can select to be collected Symphysis into each new rowKey come generate than setting quantity more than a field the full combinations of rowKey, you can select step:
Step S104:Gather each new rowKey of generation, generate field more than the setting quantity RowKey is combined entirely.
The key problem of the application is how to generate all storages and inquires about field rowKey sequence, i.e. rowKey is complete Combination.The feasibility of the rowKey method new to generation used in this application illustrates below.
Unify several used terms below herein first:
Full combination:The combination of multiple fields, it is unrelated with the sequencing of appearance.
Fully intermeshing:The arrangement mode of multiple fields, with the priority of appearance it is suitable with it is relevant.
a^b:Represent a b powers.
C(m,n):Represent the sequence number that n element is arbitrarily taken in m.
Ceil(n):Represent the value that n rounds up.
O(n):The expression formula exponent number of time or space complexity is represented as n.
N!:Represent N factorial.
Assuming that it is N number of to need the field for being used as querying condition to have at present, they are ranked up according to lexcographical order, at this In set for the purpose of simplifying the description sequence after field as X1,X2…XN, and save it in array S [N], wherein array index Scope is 0<=n<N.Then problem just can specifically be described as how generating X1,X2…XNThe number of the full composite sequence of this N number of element Group C [N].It is considered that each sequence has two kinds of selections in C [N-1], a kind of is that X is added behind each element of sequenceN Element, it is exactly to add X foremost in current sequence to also have a kind ofNElement simultaneously removes last element, therefore the problem can be with Intuitively described by the schematic diagram of a binary tree, wherein left subtree represents adds X in frontNElement, right subtree represent Add XNElement simultaneously removes last element.
As shown in Figure 2, it can be seen that n-th layer is addition field X in Fig. 2NCorresponding full composite sequence scope, all sequences Length all in Ceil (N/2)~N closed interval, according to length it is whether identical enter corresponding circle in.See that figure is got the bid The part of redundancy is noted, when adding field XN (now N is odd number) in their corresponding flow charts, the sequence in C [N-1] is less than Ceil (N/2) abandoned situation.All fields are satisfied by when above-mentioned N ∈ [Isosorbide-5-Nitrae] can be verified by the method enumerated The combination of the querying condition of composition.
Prove the property 1 of the application method below:As N=2k, sequence length is k+i (0<=i<K) position K-i-1 field can find the sequence using it as prefix in the position that length is k+i+1 before all sequences.Work as N=2k+1 When, sequence length is k+i (0<=i<=k) position all sequences before k-i field can be in the position that length is k+i+1 Put the sequence found using it as prefix.
From the 2nd layer of above-mentioned Fig. 2, it can be seen that, preceding 0 element for the set that length is 1 is empty, it is not necessary to compare, can be with It is the prefix of all sequences during length is 2 to think it.The 3rd layer in the diagram can see, before length is 1 set 1 element is X3, it be length be 2 in sequence X3X1Prefix;Preceding 0 element for the set that length is 2 is empty, it is not necessary to Compare, it is also assumed that it be length be 3 in all sequences prefix.The 4th layer in the diagram can see, and length is Preceding 1 element of 2 set is all X4;There is X in the set that length is 34X1X2For sequence using it as prefix, length is preceding the 0 of 3 Individual field can find the sequence using it as prefix in the sequence that length is 4, be satisfied by property 1.
As shown in figure 3, as N=2k, it is assumed that it meets property 1, then length is k+i (0 in 2k+1<i<=k) position With X2k+1Length is k+i+1 (0 in the sequence and 2k+1 of beginning<i<=k) position with X2k+1The contrast discovery of beginning, k+i positions 2~k+i fields be inherited from the position that length in 2k is k+i, 2~k+i+1 fields of k+i+1 positions are inherited from 2k long The position for k+i+1 is spent, the part inherited by hypothesis has k-i-1 length to meet prefix relation, along with foremost X2k+1It can obtain with X2k+1The part of beginning meets property 1.Similarly, with X2k+1It is long from 2k when as ending Spend has k-i length to meet prefix relation for succession at k+i-1, therefore with X2k+1Also meet property 1 when as ending.Consider Border condition, the k location of 2k+1 layers are only inherited from the k location of 2k layers, can ibid obtain with X2k+1The part of beginning is to meet Property 1, i.e., be all prefix in the preceding k field that k location length is k, is so this part is wholly redundant, corresponding to it Yl moiety in figure, i.e., the part abandoned by 2k+1 layers due to length issue;The 2k+1 positions of 2k+1 layers are only inherited from 2k layers 2k positions, it can ibid obtain with X2k+1The part of ending meets property 1.N=2k+1 can be to sum up obtained as N=2k When meet property 1.It can also similarly prove when N=2k+1 meets property 1, can prove also to meet property during N=2k+2 1.Because having been verified that N=2, feasibility when 3,4, then set up from Data induction method, property 1.
Assuming that the combined sequence C [n] generated according to the application method is feasible, i.e. C [n] meets the group of all fields Conjunction is possible, then is all adding X foremost to all sequences in C [n]N+1It can obtain with XN+1The part A of beginning, and in order Row backmost add XN+1With XN+1The part B of ending, they together constitute candidate sequence combination, then are i for field number (1<=i<=N+1) combination, when i field does not include XN+1When, its all combination may be with by the C of part B [n] prefix bag Contain, i.e., included by part B;When i field includes XN+1When, then it should be possible to combine comprising other i-1 fields, this Just met by all combinations that 2~i positions of part A are i-1 field before C [n].Therefore candidate sequence can be obtained Combination can cover all combinations, be feasible.When N+1 is even number, candidate sequence combination is exactly this paper generation methods Obtained combination;When N+1 is odd number, it is that completely redundant (refer to Fig. 2, Fig. 3 that N/2 data can be found by property 1 The redundancy section of middle mark), thus candidate sequence combination exclude redundancy sequence be this paper the obtained group of generating mode Close.C [N-1] can to sum up be obtained and cover all combinations;Because having been verified that N=2,3 feasibility, by mathematical induction Method can release the application method in N>It is after=4 and feasible.
Because C (n) is a function for having extreme value, extreme value, i.e. maximum, therefore C [N] are taken in n=Ceil (N/2)>=C (N, Ceil (N/2)).Ibid, it can prove that the length of n-th layer is i (Ceil (N/2) by mathematical induction<=i<N sequence) Number is C (N, i)-C (N, i+1).Therefore it is C (N, Ceil (N/2)) by the cumulative number that can obtain C [N], i.e. C [N] is no May be small again, what the application method obtained is optimal solution.And it is easy to release the worst time efficiency again smaller than N*C (N, Ceil (N/2))。
Step S105:Obtain generation each new rowKey corresponding to data, and by the data storage in A line of the new rowKey is corresponded in the NoSQL databases.
To each the new rowKey generated in step S103, the data corresponding to it are obtained, and each is new Data storage corresponding to rowKey is in a line that each new rowKey is corresponded in the NoSQL databases.
Then it is cluster $ host $ by this 6 rowKey for example, in the present embodiment, generating 6 new rowKey NetName $ time, host $ netName $ time, netName $ cluster $ time, time $ cluster $ host, time $ Host, and data corresponding to time $ netName are stored respectively in a line that its rowKey is corresponded in the NoSQL databases.
The operation of data storage can be carried out after step S103 is fully finished, and can also be carried out simultaneously with S103, raw The rowKey new into one is the data for the new rowKey for storing a corresponding generation.
Fig. 4 is refer to, it is that a kind of date storage method for NoSQL databases that the application second embodiment provides is implemented Example flow chart.The present embodiment is suitable for having several fields but any of these corresponding fields being stored not NoSQL databases The situation of data.Methods described, including:
Step S201:Obtain according to the specified field setting quantity field that repetitive sequence does not arrange.
Repetitive sequence can not be that dictionary field positive sequence, dictionary field backward or other fields are unduplicated to the field of setting Order in tandem.
Obtain certain field setting quantity field that repetitive sequence does not arrange.For example, in the present embodiment, obtain in order 4 fields of arrangement:Cluster cluster, main frame host, Adapter Name netName, and time time.
Step S203:One new rowKey is generated with the 1st field in the setting quantity field, generates 1 The rowKey of field is combined entirely.
One new rowKey is formed with the first character section in the field of acquisition, i.e., new rowKey is first character Section, the rowKey of 1 field of regeneration are combined entirely;Only 1 rowKey among now the rowKey of 1 field is combined entirely, i.e., First character section.
For example, in the present embodiment, with first character section cluster cluster, a new rowKey, i.e. cluster are generated, The rowKey of 1 field of regeneration is combined entirely, and it includes cluster.
Step S205:The data corresponding to the new rowKey of generation are obtained, and by the data storage in described A line of the new rowKey is corresponded in NoSQL databases.
Obtain the data corresponding to the new rowKey of generation, and the data storage corresponding to by the new rowKey of generation In a line that the new rowKey is corresponded in the NoSQL databases.
For example, in the present embodiment, as obtain the data corresponding to cluster and be stored in the NoSQL numbers According to a line that this rowKey of cluster is corresponded in storehouse.
Step S207:Successively using the 2nd in the field of the setting quantity to the setting quantity field as waiting to add The field added, using the date storage method of the NoSQL databases described in first embodiment, to store each new rowKey Corresponding 2 rowKey to the setting quantity field of data and generation are combined entirely.
In order one by one using the 2nd of the field of acquisition to the setting quantity field as field to be added successively, Using the date storage method of the NoSQL databases, i.e. step S101, S103, S104 and S105, generate each new RowKey, obtain the data corresponding to each new rowKey, will obtain data storage corresponding to each new rowKey in Corresponding each new rowKey each row, and 2 rowKey to setting quantity field of generation are combined entirely.
For example, in the present embodiment, based on the rowKey of 1 field full combination, successively using main frame host, Adapter Name NetName and time time uses the date storage method of the NoSQL databases, i.e. step as field to be added S101 to S105, generate 2 new rowKey of 2 fields:Cluster $ host, host;3 of 3 fields new rowKey:Cluster $ host $ netName, host $ netName, netName $ cluster;6 of 4 fields new rowKey:Cluster $ host $ netName $ time, host $ netName $ time, netName $ cluster $ time, time $ Cluster $ host, time $ host, and time $ netName;By the data storage corresponding to this 11 new rowKey in institute State each row of corresponding 11 new rowKey in NoSQL databases;And generate 2 rowKey to 4 fields and combine entirely.
Fig. 5 is refer to, it is that a kind of data storage device for NoSQL databases that the application 3rd embodiment provides is implemented Illustrate and be intended to.Because device embodiment is substantially similar to embodiment of the method, so describing fairly simple, related part is referring to side The part explanation of method embodiment.Device embodiment described below is only schematical.The data of the NoSQL databases Storage device, including:
Obtain rowKey full combination and field unit 301, for obtain setting quantity field including it is at least one not The rowKey for repeating rowKey is combined and a field to be added entirely;The rowKey, including:At least more than one is not weighed The combination of the multiple setting quantity field;
New rowKey units 303 are generated, for successively in the full combinations of rowKey of the setting quantity field Each rowKey, perform the step of adding field;The step of addition field, including:Institute is added after the rowKey Field to be added is stated, generates a new rowKey;If the number of the field in the rowKey meets the condition of setting, The field to be added is added before the rowKey and removes last field in the rowKey, generates one newly RowKey;
Data cell 305 corresponding to rowKey is stored, for obtaining the number corresponding to each new rowKey of generation According to, and by the data storage in a line that the new rowKey is corresponded in the NoSQL databases.
After the new rowKey units of the generation are triggered, the generation full assembled units 306 of rowKey, institute can also be triggered The generation full assembled units 306 of rowKey are stated, for gathering each new rowKey of generation, generation setting quantity field RowKey is combined entirely
Fig. 6 is refer to, it is that a kind of data storage device for NoSQL databases that the application fourth embodiment provides is implemented Illustrate and be intended to.Because device embodiment is substantially similar to embodiment of the method, so describing fairly simple, related part is referring to side The part explanation of method embodiment.Device embodiment described below is only schematical.The data of the NoSQL databases Storage device, including:
Field unit 401 is obtained, for obtaining according to the specified field setting quantity field that repetitive sequence does not arrange;
The full assembled units 403 of rowKey of 1 field are generated, for the 1st word in the setting quantity field Mono- new rowKey of Duan Shengcheng, the rowKey of 1 field of generation are combined entirely;
The full data splitting units 405 of rowKey of 1 field are stored, for obtaining corresponding to the new rowKey of generation Data, and by the data storage in a line that the new rowKey is corresponded in the NoSQL databases;
Storage 2 is to the full data splitting units 407 of rowKey for setting quantity field, for successively with the setting number The 2nd in the field of amount to setting quantity field as field to be added, the NoSQL described in triggering 3rd embodiment The data storage device of database, store the data corresponding to each new rowKey, and the extremely setting number of generation 2 The rowKey of amount field is combined entirely.
Fig. 7 is refer to, it is a kind of data storage electronic equipment for NoSQL databases that the embodiment of the application the 5th provides Embodiment schematic diagram.Because electronic equipment embodiment is substantially similar to embodiment of the method, so describe fairly simple, correlation Place illustrates referring to the part of embodiment of the method.Electronic equipment embodiment described below is only schematical.The NoSQL The data storage electronic equipment of database, including:Display 501, processor 503, memory 505;
The memory 505, the program of the data storage for storing NoSQL databases, described program is by the place When managing device reading execution, following operation is performed:Obtain setting quantity field does not repeat rowKey's including at least one RowKey is combined entirely and a field to be added;The rowKey, including:The unduplicated setting of at least more than one The combination of quantity field;Successively to each rowKey in the full combinations of rowKey of the setting quantity field, perform The step of adding field;The step of addition field, including:The field to be added is added after the rowKey, it is raw The rowKey new into one;If the number of the field in the rowKey meets the condition of setting, add before the rowKey The upper field to be added simultaneously removes last field in the rowKey, generates a new rowKey;Obtain life Into each new rowKey corresponding to data, and by the data storage in corresponding to institute in the NoSQL databases State new rowKey a line.
Fig. 8 is refer to, it is that a kind of data query method for NoSQL databases that the application sixth embodiment provides is implemented Example flow chart.The date storage method of the querying method of the present embodiment and the NoSQL databases supports the use, and is to described The inquiry for the data that the date storage method of NoSQL databases is stored.The data query method of the NoSQL databases, bag Include:
S601:Field to be checked is combined according to querying condition, forms inquiry field.
According to querying condition, different fields is selected, and combines these fields and forms inquiry field.
For example, in the present embodiment, before inquiry Adapter Name netName is prefix and cluster cluster and main frame host is Data corresponding to all rowKey sewed, that is, form inquiry field netName and cluster host.
S602:RowKey corresponding to inquiring about field according to the inquiry Field Inquiry.
Can be with retrieval and inquisition to the qualified corresponding rowKey for inquiring about field according to inquiry field.Inquiring about field can be with Form a complete rowKey to be inquired about, only a rowKey part can also be inquired about.
For example, in the present embodiment, inquiring the rowKey that cluster is prefix has 2, is respectively:netName$ Cluster and netName $ cluster $ time;Inquiring the rowKey that cluster $ host are prefix has 3, is respectively: Cluster $ host, cluster $ host $ netName and cluster $ host $ netName $ time.
S603:According to the rowKey inquired, obtained in the NoSQL databases corresponding to the rowKey inquired Data.
According to the rowKey inquired, directly retrieved in the NoSQL databases and obtain what is inquired Data corresponding to rowKey.
It is directly 2 rowKeys of the inquiry using netName as prefix for example, in the present embodiment:netName$ Cluster and netName $ cluster $ time corresponding data in database, and directly inquiry is with cluster $ host For 3 rowKey of prefix:Cluster $ host, cluster $ host $ netName and cluster $ host $ netName $ Time corresponding data in database.
Fig. 9 is refer to, it is that a kind of data query arrangement for NoSQL databases that the embodiment of the application the 7th provides is implemented Illustrate and be intended to.The data storage device of the inquiry unit of the present embodiment and the NoSQL databases supports the use, and is to described The inquiry for the data that the data storage device of NoSQL databases is stored.Implement because device embodiment is substantially similar to method Example, so describing fairly simple, the relevent part can refer to the partial explaination of embodiments of method.Device described below is implemented Example is only schematical.Specifically, the data query arrangement of the NoSQL databases, including:
Inquiry field unit 701 is formed, for combining field to be checked according to querying condition, forms inquiry field;
RowKey units 703 are inquired about, for the rowKey corresponding to the inquiry field according to the inquiry Field Inquiry;
Database data unit 705 is inquired about, for according to the rowKey inquired, being obtained in the NoSQL databases The data corresponding to rowKey inquired.
Figure 10 is refer to, it is the generation method embodiment that a kind of rowKey that the embodiment of the application the 8th provides is combined entirely Flow chart.The generation method of the present embodiment is a recursive method, is combined entirely based on the rowKey that multi-field be present, The rowKey that generation increases it 1 field is combined entirely.Specifically, the generation method that the rowKey is combined entirely, including:
Step S801:Obtain setting quantity field include it is at least one not repeat rowKey rowKey full combination with One field to be added;The rowKey, including:The group of the unduplicated setting quantity field of at least more than one Close.
The rowKey for obtaining setting quantity field is combined entirely, that is, is obtained as each combined by setting quantity field Individual rowKey set;1 field to be added is obtained, that is, obtains and prepares each combined by the setting quantity field The field added on rowKey.
For example, in the present embodiment, the rowKey for obtaining 3 fields combines as acquisition cluster $ host $ entirely This 3 rowKey of netName, host $ netName, netName $ cluster;1 field to be added is obtained, is as obtained This field of time time.
Step S803:Successively to each rowKey in the full combinations of rowKey of the setting quantity field, perform The step of adding field;The step of addition field, including:The field to be added is added after the rowKey, it is raw The rowKey new into one;If the number of the field in the rowKey meets the condition of setting, add before the rowKey The upper field to be added simultaneously removes last field in the rowKey, generates a new rowKey.
Each rowKey in being combined entirely to the rowKey for setting quantity field one by one in order, perform addition field The step of;The step of addition field, it is specifically:Add after last field in the rowKey being the combination of field The upper field to be added, the combination of one new field of generation is new rowKey;If more than or equal to than setting quantity The number for the field that the smallest positive integral of the half of more one is more than or equal in the rowKey, then the rowKey's The field to be added is added before first character section and removes last described field in the rowKey, generation one The combination of individual new field is new rowKey.
If the number of the field in the rowKey meets the condition of setting, including:If the word in the rowKey The number of section is not less than the integer being rounded up to of the half of one more than the setting quantity.
If the number of the field in the rowKey is not less than the upward house of the half of one more than the setting quantity The integer entered, i.e., the number of the field in described rowKey are not less than the Ceiling of the half of one more than the setting quantity The function of round numbers, then plus described in the field to be added and removal before the first character section of the rowKey Last described field in rowKey, the combination of one new field of generation is new rowKey.
In this step, set quantity field rowKey combine entirely how many rowKey then successively circulate execution add Add the step how many times of field, generate 1 or 2 new rowKey every time.Detailed adding procedure refer to first embodiment. For example, in the present embodiment, combination has 3 rowKey to the rowKey of 3 fields entirely, then circulation performs the step of addition field successively Rapid 3 additions time time, obtains 6 new rowKey, i.e. cluster $ host $ netName $ time, host $ netName $ Time, netName $ cluster $ time, time $ cluster $ host, time $ host, and time $ netName.
Deposited with the method addition field generation rowKey of this step feasibility in the data of the NoSQL databases It is described in detail, will not be repeated here in method for storing embodiment.
Step S805:Gather each new rowKey of generation, the rowKey for generating a field more than setting quantity is complete Combination.
Gather each new rowKey of step S803 generations, then the rowKey of generation field more than setting quantity is complete Combination
For example, in the present embodiment, the 6 new rowKey, i.e. cluster $ host $ of the S803 generations of set step NetName $ time, host $ netName $ time, netName $ cluster $ time, time $ cluster $ host, time $ Host, and time $ netName, that is, the rowKey for generating 4 fields are combined entirely.
Figure 11 is refer to, it is that the generation method that another rowKey that the embodiment of the application the 9th provides is combined entirely is implemented Example flow chart.The generation method that the rowKey is combined entirely, including:
Step S901:Obtain the field setting quantity field that repetitive sequence does not arrange according to setting.
Repetitive sequence can not be that dictionary field positive sequence, dictionary field backward or other fields are unduplicated to the field of setting Order in tandem.
Obtain certain field setting quantity field that repetitive sequence does not arrange.For example, in the present embodiment, obtain in order 4 fields of arrangement:Cluster cluster, main frame host, Adapter Name netName, and time time.
Step S903:One new rowKey is generated with the 1st field in the setting quantity field, generates 1 The rowKey of field is combined entirely.
One new rowKey is formed with the first character section in the field of acquisition, i.e., new rowKey is first character Section, the rowKey of 1 field of regeneration are combined entirely;Only 1 rowKey among now the rowKey of 1 field is combined entirely, i.e., First character section.
For example, in the present embodiment, with first character section cluster cluster, a new rowKey, i.e. cluster are generated, The rowKey of 1 field of regeneration is combined entirely, and it includes cluster.
Step S905:Quantity field is set as waiting to add using the 2nd in the setting quantity field to the successively The field added, the generation method combined entirely using the rowKey, 2 complete group of rowKey to setting quantity field of generation Close.
In order one by one using the 2nd of the field of acquisition to the setting quantity field as field to be added successively, The generation method combined entirely using rowKey described in the 8th embodiment, i.e. step S801 to S805, generate each new rowKey; Gather each new rowKey of generation, 2 rowKey to setting quantity field of generation are combined entirely.
For example, in the present embodiment, based on the rowKey of 1 field full combination, successively using main frame host, Adapter Name NetName and time time uses the date storage method of the NoSQL databases, i.e. step as field to be added S801 to S805, gather 2 new rowKey of 2 fields:Cluster $ host, host, the rowKey for generating 2 fields are complete Combination;Gather 3 new rowKey of 3 fields:Cluster $ host $ netName, host $ netName, netName $ Cluster, the rowKey of 3 fields of generation are combined entirely;Gather 6 new rowKey of 4 fields:cluster$host$ NetName $ time, host $ netName $ time, netName $ cluster $ time, time $ cluster $ host, time $ Host, and time $ netName, the rowKey of 4 fields of generation are combined entirely.
Figure 12 is refer to, it is the generating means embodiment that a kind of rowKey that the embodiment of the application the tenth provides is combined entirely Schematic diagram.Because device embodiment is substantially similar to embodiment of the method, so describing fairly simple, related part is referring to method The part explanation of embodiment.Device embodiment described below is only schematical.The generation that the rowKey is combined entirely Device, including:
Obtain rowKey full combination and field unit 1001, for obtain setting quantity field including it is at least one not The rowKey for repeating rowKey is combined and a field to be added entirely;The rowKey, including:At least more than one is not weighed The combination of the multiple setting quantity field;
New rowKey units 1003 are generated, with for successively in the full combinations of rowKey of the setting quantity field Each rowKey, perform addition field the step of;The step of addition field, including:Added after the rowKey The field to be added, generate a new rowKey;If the number of the field in the rowKey meets the condition of setting, The field to be added is then added before the rowKey and removes last field in the rowKey, generates one New rowKey;
The full assembled units 1005 of rowKey are generated, for gathering each new rowKey of generation, are generated than the setting The rowKey of the more fields of quantity is combined entirely.
Figure 13 is refer to, it is that the generating means that a kind of rowKey that the embodiment of the application the 11st provides is combined entirely are implemented Illustrate and be intended to.Because device embodiment is substantially similar to embodiment of the method, so describing fairly simple, related part is referring to side The part explanation of method embodiment.Device embodiment described below is only schematical.The life that the rowKey is combined entirely Into device, including:
Field unit 1101 is obtained, for obtaining according to the specified field setting quantity word that repetitive sequence does not arrange Section;
The full assembled units 1103 of rowKey of 1 field are generated, for the 1st word in the setting quantity field Mono- new rowKey of Duan Shengcheng, the rowKey of 1 field of generation are combined entirely;
Generation 2 is to the full assembled units 1105 of rowKey for setting quantity field, for successively with the setting quantity The 2nd in individual field to setting quantity field as field to be added, the life combined entirely using described rowKey Into method, combined entirely with 2 rowKey to setting quantity field of generation.
Figure 14 is refer to, it is the generation electronic equipment that a kind of rowKey that the embodiment of the application the 12nd provides is combined entirely Embodiment schematic diagram.Because device embodiment is substantially similar to embodiment of the method, so describing fairly simple, related part is joined See the part explanation of embodiment of the method.Electronic equipment embodiment described below is only schematical.The rowKey is complete The generation electronic equipment of combination, including:Display 1201, processor 1203, memory 1205;
The memory 1205, the program for the generation combined entirely for storing rowKey, described program is by the processing When device reads execution, following operation is performed:Obtain setting quantity field does not repeat rowKey's including at least one RowKey is combined entirely and a field to be added;The rowKey, including:The unduplicated setting of at least more than one The combination of quantity field;Successively to each rowKey in the full combinations of rowKey of the setting quantity field, perform The step of adding field;The step of addition field, including:The field to be added is added after the rowKey, it is raw The rowKey new into one;If the number of the field in the rowKey meets the condition of setting, add before the rowKey The upper field to be added simultaneously removes last field in the rowKey, generates a new rowKey;Collect symphysis Into each new rowKey, generate than it is described setting quantity more than a field the full combinations of rowKey.
Although the application is disclosed as above with preferred embodiment, it is not for limiting the application, any this area skill Art personnel are not being departed from spirit and scope, can make possible variation and modification, therefore the guarantor of the application Shield scope should be defined by the scope that the application claim is defined.
In a typical configuration, computing device includes one or more processors (CPU), input/output interface, net Network interface and internal memory.
Internal memory may include computer-readable medium in volatile memory, random access memory (RAM) and/or The forms such as Nonvolatile memory, such as read-only storage (ROM) or flash memory (flash RAM).Internal memory is computer-readable medium Example.
1st, computer-readable medium can be by any side including permanent and non-permanent, removable and non-removable media Method or technology realize that information stores.Information can be computer-readable instruction, data structure, the module of program or other numbers According to.The example of the storage medium of computer includes, but are not limited to phase transition internal memory (PRAM), static RAM (SRAM), dynamic random access memory (DRAM), other kinds of random access memory (RAM), read-only storage (ROM), Electrically Erasable Read Only Memory (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc are read-only Memory (CD-ROM), digital versatile disc (DVD) or other optical storages, magnetic cassette tape, tape magnetic rigid disk storage or Other magnetic storage apparatus or any other non-transmission medium, the information that can be accessed by a computing device available for storage.According to Herein defines, and computer-readable medium does not include non-temporary computer readable media (transitory media), such as modulates Data-signal and carrier wave.
2nd, it will be understood by those skilled in the art that embodiments herein can be provided as method, system or computer program production Product.Therefore, the application can use the embodiment in terms of complete hardware embodiment, complete software embodiment or combination software and hardware Form.Moreover, the application can use the computer for wherein including computer usable program code in one or more can use The computer program product that storage medium is implemented on (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.) Form.

Claims (18)

  1. A kind of 1. date storage method of NoSQL databases, it is characterised in that including:
    Obtain setting quantity field include at least one rowKey for not repeating rowKey full combination and one it is to be added Field;The rowKey, including:The combination of the unduplicated setting quantity field of at least more than one;
    Successively to each rowKey in the full combinations of rowKey of the setting quantity field, the step for adding field is performed Suddenly;The step of addition field, including:Add the field to be added after the rowKey, generate one it is new rowKey;If the number of the field in the rowKey meets the condition of setting, wait to add plus described before the rowKey The field that adds simultaneously removes last field in the rowKey, generates a new rowKey;
    The data corresponding to each new rowKey of generation are obtained, and by the data storage in the NoSQL data A line of the new rowKey is corresponded in storehouse.
  2. 2. the date storage method of NoSQL databases according to claim 1, it is characterised in that if described The number of field in rowKey meets the condition of setting, including:
    If the number of the field in the rowKey be not less than than it is described setting quantity more than one half be rounded up to it is whole Number.
  3. 3. the date storage method of NoSQL databases according to claim 2, it is characterised in that perform described in successively To each rowKey in the full combinations of rowKey of the setting quantity field, after performing the step of adding field, hold Row following step:
    Gather each new rowKey of generation, generate the full combinations of rowKey of a field more than the setting quantity.
  4. 4. the date storage method of NoSQL databases according to claim 3, it is characterised in that methods described, including:
    Obtain according to the specified field setting quantity field that repetitive sequence does not arrange;
    One new rowKey is generated with the 1st field in the setting quantity field, the rowKey for generating 1 field is complete Combination;
    The data corresponding to the new rowKey of generation are obtained, and by the data storage in right in the NoSQL databases Answer a line of the new rowKey;
    Used successively using the 2nd in the field of the setting quantity to setting quantity field as field to be added The date storage method of NoSQL databases described in claim 3, with store data corresponding to each new rowKey and 2 rowKey to the setting quantity field of generation are combined entirely.
  5. A kind of 5. data storage device of NoSQL databases, it is characterised in that including:
    Acquisition rowKey is combined entirely and field unit, for obtaining not repeated including at least one for setting quantity field RowKey rowKey is combined entirely and a field to be added;The rowKey, including:At least more than one unduplicated The combination of the setting quantity field;
    New rowKey units are generated, for successively to each in the full combinations of rowKey of the setting quantity field RowKey, perform the step of adding field;The step of addition field, including:Wait to add plus described after the rowKey The field added, generate a new rowKey;If the number of the field in the rowKey meets the condition of setting, described Plus the field to be added and remove last field in the rowKey before rowKey, generate one it is new rowKey;
    Data cell corresponding to rowKey is stored, for obtaining the data corresponding to each new rowKey of generation, and will The data storage is in a line that the new rowKey is corresponded in the NoSQL databases.
  6. 6. the data storage device of NoSQL databases according to claim 5, it is characterised in that if described The number of field in rowKey meets the condition of setting, including:
    If the number of the field in the rowKey be not less than than it is described setting quantity more than one half be rounded up to it is whole Number.
  7. 7. the data storage device of NoSQL databases according to claim 6, it is characterised in that triggering the generation After new rowKey units, following units are triggered:
    The full assembled units of rowKey are generated, for gathering each new rowKey of generation, are generated one more than the setting quantity The rowKey of individual field is combined entirely.
  8. 8. the data storage device of NoSQL databases according to claim 7, it is characterised in that described device, including:
    Field unit is obtained, number is set according to the specified field setting quantity field that repetitive sequence does not arrange for obtaining Amount;
    The full assembled units of rowKey of 1 field are generated, for the 1st field generation one in the setting quantity field Individual new rowKey, the rowKey of 1 field of generation are combined entirely;
    The full data splitting units of rowKey of 1 field are stored, for obtaining the data corresponding to the new rowKey of generation, and By the data storage in a line that the new rowKey is corresponded in the NoSQL databases;
    Storage 2 is to the full data splitting units of rowKey for setting quantity field, for successively with the word of the setting quantity The 2nd in section requires the NoSQL databases described in 3 to setting quantity field as field to be added, usage right Date storage method, to store data corresponding to each new rowKey and generation 2 to the setting quantity words The rowKey of section is combined entirely.
  9. 9. a kind of data storage electronic equipment of NoSQL databases, it is characterised in that the electronic equipment includes:
    Display;
    Processor;
    Memory, the program of the data storage for storing NoSQL databases, described program are reading execution by the processor When, perform following operation:Obtain setting quantity field include it is at least one not repeat rowKey rowKey full combination with One field to be added;The rowKey, including:The group of the unduplicated setting quantity field of at least more than one Close;Successively to each rowKey in the full combinations of rowKey of the setting quantity field, the step of adding field is performed; The step of addition field, including:Add the field to be added after the rowKey, generate one it is new rowKey;If the number of the field in the rowKey meets the condition of setting, wait to add plus described before the rowKey The field that adds simultaneously removes last field in the rowKey, generates a new rowKey;Obtain each of generation Data corresponding to new rowKey, and the data storage is described new in being corresponded in the NoSQL databases RowKey a line.
  10. A kind of 10. data query method of NoSQL databases, applied to date storage method institute according to claim 4 The NoSQL databases of foundation, it is characterised in that including:
    Field to be checked is combined according to querying condition, forms inquiry field;
    RowKey corresponding to inquiring about field according to the inquiry Field Inquiry;
    According to the rowKey inquired, the data corresponding to the rowKey inquired are obtained in the NoSQL databases.
  11. A kind of 11. data query arrangement of NoSQL databases, applied to data storage device institute according to claim 8 The NoSQL databases of foundation, it is characterised in that including:
    Inquiry field unit is formed, for combining field to be checked according to querying condition, forms inquiry field;
    RowKey units are inquired about, for the rowKey corresponding to the inquiry field according to the inquiry Field Inquiry;
    Database data unit is inquired about, for according to the rowKey inquired, obtaining what is inquired in the NoSQL databases Data corresponding to rowKey.
  12. A kind of 12. generation method that rowKey is combined entirely, it is characterised in that including:
    Obtain setting quantity field include at least one rowKey for not repeating rowKey full combination and one it is to be added Field;The rowKey, including:The combination of the unduplicated setting quantity field of at least more than one;
    Successively to each rowKey in the full combinations of rowKey of the setting quantity field, the step for adding field is performed Suddenly;The step of addition field, including:Add the field to be added after the rowKey, generate one it is new rowKey;If the number of the field in the rowKey meets the condition of setting, wait to add plus described before the rowKey The field that adds simultaneously removes last field in the rowKey, generates a new rowKey;
    Gather each new rowKey of generation, generate the full combinations of rowKey of a field more than the setting quantity.
  13. 13. the generation method that rowKey according to claim 12 is combined entirely, it is characterised in that if the rowKey In field number meet setting condition, including:
    If the number of the field in the rowKey be not less than than it is described setting quantity more than one half be rounded up to it is whole Number.
  14. 14. the generation method that rowKey according to claim 13 is combined entirely, it is characterised in that methods described, including:
    Obtain according to the specified field setting quantity field that repetitive sequence does not arrange;
    One new rowKey is generated with the 1st field in the setting quantity field, the rowKey for generating 1 field is complete Combination;
    Used successively using the 2nd in the setting quantity field to setting quantity field as field to be added The generation method that rowKey described in claim 10 is combined entirely, with 2 complete group of rowKey to setting quantity field of generation Close.
  15. A kind of 15. generating means that rowKey is combined entirely, it is characterised in that including:
    Acquisition rowKey is combined entirely and field unit, for obtaining not repeated including at least one for setting quantity field RowKey rowKey is combined entirely and a field to be added;The rowKey, including:At least more than one unduplicated The combination of the setting quantity field;
    New rowKey units are generated, for successively to each in the full combinations of rowKey of the setting quantity field RowKey, perform the step of adding field;The step of addition field, including:Wait to add plus described after the rowKey The field added, generate a new rowKey;If the number of the field in the rowKey meets the condition of setting, described Plus the field to be added and remove last field in the rowKey before rowKey, generate one it is new rowKey;
    The full assembled units of rowKey are generated, for gathering each new rowKey of generation, are generated one more than the setting quantity The rowKey of individual field is combined entirely.
  16. 16. the generating means that rowKey according to claim 15 is combined entirely, it is characterised in that if the rowKey In field number meet setting condition, including:
    If the number of the field in the rowKey be not less than than it is described setting quantity more than one half be rounded up to it is whole Number.
  17. 17. the generating means that rowKey according to claim 16 is combined entirely, it is characterised in that methods described, including:
    Field unit is obtained, for obtaining according to the specified field setting quantity field that repetitive sequence does not arrange;
    The full assembled units of rowKey of 1 field are generated, for the 1st field generation one in the setting quantity field Individual new rowKey, the rowKey of 1 field of generation are combined entirely;
    Generation 2 is to the full assembled units of rowKey for setting quantity field, for successively with the setting quantity word The 2nd in section requires complete group of rowKey described in 10 to setting quantity field as field to be added, usage right The generation method of conjunction, combined entirely with 2 rowKey to setting quantity field of generation.
  18. 18. the generation electronic equipment that a kind of rowKey is combined entirely, it is characterised in that the electronic equipment includes:
    Display;
    Processor;
    Memory, the program for the generation combined entirely for storing rowKey, described program by the processor read perform when, Perform following operation:Obtain setting quantity field includes the full combinations of at least one rowKey for not repeating rowKey and one Field to be added;The rowKey, including:The combination of the unduplicated setting quantity field of at least more than one; Successively to each rowKey in the full combinations of rowKey of the setting quantity field, the step of adding field is performed;Institute The step of stating addition field, including:The field to be added is added after the rowKey, generates a new rowKey; If the number of the field in the rowKey meets the condition of setting, the field to be added is added before the rowKey And last field in the rowKey is removed, generate a new rowKey;Gather each new rowKey of generation, Generate the full combinations of rowKey of a field more than the setting quantity.
CN201610425195.3A 2016-06-15 2016-06-15 Data storage and query method and device of NoSQL database and generation method and device of rowKey full combination Active CN107515867B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610425195.3A CN107515867B (en) 2016-06-15 2016-06-15 Data storage and query method and device of NoSQL database and generation method and device of rowKey full combination

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610425195.3A CN107515867B (en) 2016-06-15 2016-06-15 Data storage and query method and device of NoSQL database and generation method and device of rowKey full combination

Publications (2)

Publication Number Publication Date
CN107515867A true CN107515867A (en) 2017-12-26
CN107515867B CN107515867B (en) 2021-06-29

Family

ID=60720047

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610425195.3A Active CN107515867B (en) 2016-06-15 2016-06-15 Data storage and query method and device of NoSQL database and generation method and device of rowKey full combination

Country Status (1)

Country Link
CN (1) CN107515867B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113821533A (en) * 2021-09-30 2021-12-21 北京鲸鹳科技有限公司 Data query method, device, equipment and storage medium
CN116561374A (en) * 2023-07-11 2023-08-08 腾讯科技(深圳)有限公司 Resource determination method, device, equipment and medium based on semi-structured storage

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102999526A (en) * 2011-09-16 2013-03-27 阿里巴巴集团控股有限公司 Splitting and inquiring method and system of database relational table
CN103488704A (en) * 2013-09-06 2014-01-01 乐视致新电子科技(天津)有限公司 Method and device for storing data
CN104102710A (en) * 2014-07-15 2014-10-15 浪潮(北京)电子信息产业有限公司 Massive data query method
CN104252536A (en) * 2014-09-16 2014-12-31 福建新大陆软件工程有限公司 Hbase-based internet log data inquiring method and device
CN104317966A (en) * 2014-11-18 2015-01-28 国家电网公司 Dynamic indexing method applied to quick combined querying of big electric power data
CN104915450A (en) * 2015-07-01 2015-09-16 武汉大学 HBase-based big data storage and retrieval method and system
US20150317345A1 (en) * 2012-11-27 2015-11-05 Nokia Solutions And Networks Oy Multiple fields parallel query method and corresponding storage organization
CN105354297A (en) * 2015-11-03 2016-02-24 浪潮(北京)电子信息产业有限公司 Method and system for storing data in database
CN105426437A (en) * 2015-11-05 2016-03-23 西安翔迅科技有限责任公司 HBase-based storage method of intelligent transportation field checkpost data
CN105488231A (en) * 2016-01-22 2016-04-13 杭州电子科技大学 Self-adaption table dimension division based big data processing method

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102999526A (en) * 2011-09-16 2013-03-27 阿里巴巴集团控股有限公司 Splitting and inquiring method and system of database relational table
US20150317345A1 (en) * 2012-11-27 2015-11-05 Nokia Solutions And Networks Oy Multiple fields parallel query method and corresponding storage organization
CN103488704A (en) * 2013-09-06 2014-01-01 乐视致新电子科技(天津)有限公司 Method and device for storing data
CN104102710A (en) * 2014-07-15 2014-10-15 浪潮(北京)电子信息产业有限公司 Massive data query method
CN104252536A (en) * 2014-09-16 2014-12-31 福建新大陆软件工程有限公司 Hbase-based internet log data inquiring method and device
CN104317966A (en) * 2014-11-18 2015-01-28 国家电网公司 Dynamic indexing method applied to quick combined querying of big electric power data
CN104915450A (en) * 2015-07-01 2015-09-16 武汉大学 HBase-based big data storage and retrieval method and system
CN105354297A (en) * 2015-11-03 2016-02-24 浪潮(北京)电子信息产业有限公司 Method and system for storing data in database
CN105426437A (en) * 2015-11-05 2016-03-23 西安翔迅科技有限责任公司 HBase-based storage method of intelligent transportation field checkpost data
CN105488231A (en) * 2016-01-22 2016-04-13 杭州电子科技大学 Self-adaption table dimension division based big data processing method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
廖辰瀚等: "基于HBase的互联网电视运营分析架构和模型设计", 《新疆农垦科技》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113821533A (en) * 2021-09-30 2021-12-21 北京鲸鹳科技有限公司 Data query method, device, equipment and storage medium
CN113821533B (en) * 2021-09-30 2023-09-08 北京鲸鹳科技有限公司 Method, device, equipment and storage medium for data query
CN116561374A (en) * 2023-07-11 2023-08-08 腾讯科技(深圳)有限公司 Resource determination method, device, equipment and medium based on semi-structured storage
CN116561374B (en) * 2023-07-11 2024-02-23 腾讯科技(深圳)有限公司 Resource determination method, device, equipment and medium based on semi-structured storage

Also Published As

Publication number Publication date
CN107515867B (en) 2021-06-29

Similar Documents

Publication Publication Date Title
CN102521411B (en) Formula and formula data processing device and formula and formula data processing method
CN107003935A (en) Optimize database duplicate removal
CN104021123B (en) method and system for data migration
CN107608773A (en) task concurrent processing method, device and computing device
CN112052404B (en) Group discovery method, system, equipment and medium of multi-source heterogeneous relation network
JP2015118609A (en) Method for searching tree using instruction for performing operation on data in predetermined multiple bit widths, computer for searching tree using instruction, and computer program therefor
CN106294745A (en) Big data cleaning method and device
CN112667860A (en) Sub-graph matching method, device, equipment and storage medium
Tseng Mining frequent itemsets in large databases: The hierarchical partitioning approach
Huang et al. R-HBase: A multi-dimensional indexing framework for cloud computing environment
CN107515867A (en) The generation method and device that data storage, querying method and the device and a kind of rowKey of a kind of NoSQL databases combine entirely
CN110716950A (en) Method, device and equipment for establishing aperture system and computer storage medium
CN101635001A (en) Method and apparatus for extracting information from a database
CN108897858A (en) The appraisal procedure and device, electronic equipment of distributed type assemblies index fragment
CN110263104A (en) JSON character string processing method and device
CN109597807A (en) Number storehouse list processing method and apparatus
CN114168581A (en) Data cleaning method and device, computer equipment and storage medium
CN111259062B (en) Method and device capable of guaranteeing sequence of statement result set of full-table query of distributed database
CN114519071A (en) Generation method, matching method, system, device and medium of rule matching model
Shou-Qiang et al. Research and design of hybrid collaborative filtering algorithm scalability reform based on genetic algorithm optimization
CN111191057A (en) User-defined retrieval method and device, electronic equipment and storage medium thereof
CN110837508A (en) Method, device and equipment for establishing aperture system and computer storage medium
Li et al. A resilient index graph for querying large biological scientific data
Xu et al. Effective community search on large attributed bipartite graphs
CN113032428B (en) Method for realizing power grid simulation efficiency by optimizing database technology

Legal Events

Date Code Title Description
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