CN110069529A - Process of aggregation method and device - Google Patents
Process of aggregation method and device Download PDFInfo
- Publication number
- CN110069529A CN110069529A CN201710919176.0A CN201710919176A CN110069529A CN 110069529 A CN110069529 A CN 110069529A CN 201710919176 A CN201710919176 A CN 201710919176A CN 110069529 A CN110069529 A CN 110069529A
- Authority
- CN
- China
- Prior art keywords
- identification
- group
- combined
- deleted
- union
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
- G06F16/24553—Query execution of query operations
- G06F16/24558—Binary matching operations
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a kind of process of aggregation method and devices, the first corresponding relationship of first kind identification element, element to be deleted and set can be obtained, at least one first element group is obtained according to the first corresponding relationship, each the first element group: choosing N-1 first kind identification element from the first element group, determine the corresponding set of first kind identification element chosen, the corresponding element to be deleted of first kind identification element each in the first element group is deleted from determining set, obtains processed set.Contradiction element present in set can be caused the element to be deleted for merging mistake to delete by the present invention, avoid because the set of the mistake carried out there are interfering element to be deleted merges, improve the accuracy and validity of set amalgamation result.
Description
Technical field
The present invention relates to technical field of data processing more particularly to a kind of process of aggregation method and devices.
Background technique
In data processing field, such as database field, often need to ask intersection of sets collection or union.
When needing to carry out information merging, it is also necessary to be merged to the set for having intersection.Such as: believed by user several
Ceasing in the set of composition has the set of intersection to merge, to find the relationship between each user.Such as: there are three set, collection
Closing A is (name 1, identification card number 1, cell-phone number 1, university 1);Set B is (name 2, identification card number 2, cell-phone number 1, primary school 1);
Set C is (name 3, identification card number 3, cell-phone number 2, primary school 1, university 1).In the prior art, due to set A, set B, set C
There is the element as intersection each other, therefore they can be merged.But present inventor studies discovery: being not institute
It can be carried out set when some elements are as intersection to merge.Such as the set A in the example above and set B, although the two
Gathering has element as intersection: cell-phone number 1, but the cell-phone number of different two users of identification card number is usually different
, therefore even if there are identical cell-phone numbers 1 in set A and set B, but the two set should not also be merged.
Summary of the invention
In view of the above problems, it proposes on the present invention overcomes the above problem or at least be partially solved in order to provide one kind
The process of aggregation method and device of problem is stated, scheme is as follows:
A kind of process of aggregation method, comprising:
Obtain multiple set to be processed, wherein the multiple set includes first kind identification element and to be deleted
Element contains up to the first kind identification element in any set;
According to element in the multiple set and the attaching relation of set determine the first kind identification element, it is described to
Delete the first corresponding relationship of element and set;
At least one first element group is obtained according to first corresponding relationship, wherein in any first element group
It include at least two first kind identification elements, the first kind identification element in the same first element group
It is different and be corresponding with the identical element to be deleted;
Each the first element group: the N-1 first kind identification elements are chosen from the first element group,
The corresponding set of the first kind identification element chosen is determined, from will be each first in the first element group in determining set
The corresponding element to be deleted of class identification element is deleted, and obtains processed set, wherein N is first in the first element group
The quantity of category characterizing element.
Optionally, further includes:
The set and the processed set that do not carry out element deletion to be deleted in multiple set to be processed is true
It is set to set to be combined;
The set to be combined is determined according to the attaching relation of element in the set to be combined and the set to be combined
Second corresponding relationship of middle element and the set identification of the set to be combined;
At least one second element group is obtained according to second corresponding relationship, wherein each in same second element group
The corresponding set identification of element is all the same and the corresponding set identification at least two of each element;
An element is chosen from each second element group as element to be processed, to each element to be processed: by this
The corresponding set of the corresponding set identification of element to be processed merges, and obtains union;
The corresponding relationship for establishing each union and set identification merges the identical union of corresponding set identification;
The quantity of the entire set obtained after being merged according to the identical union of corresponding set identification is determined as defeated
The set of result out.
It is optional: described that at least one second element group is obtained according to second corresponding relationship, wherein same second yuan
The corresponding set identification of each element in plain group is all the same and the corresponding set identification at least two of each element, comprising:
The quantity of the corresponding set identification of element is determined according to second corresponding relationship;
When the element is corresponding at least two set identifications, one is set by the corresponding each set identification of the element
Set identification group, and identified for the set identification group setting group;
The identical each element of corresponding group of mark is determined as one by the corresponding relationship for establishing the element Yu described group of mark
A second element group.
It is optional: the corresponding relationship for establishing each union and set identification, comprising:
To each union: choosing the smallest set identification from the set identification respectively gathered for merging into the union, build
Found the corresponding relationship of the union Yu the smallest set identification.
It is optional: the attaching relation according to element in the set to be combined and the set to be combined determine it is described to
Merge in set after the second corresponding relationship of element and the set identification of the set to be combined, the method also includes:
The quantity for obtaining the corresponding set identification of each element, by comprising the quantity of the corresponding set identification of each element be
1 set is determined as exporting one of result.
It is optional: it is described merged according to the identical union of corresponding set identification after the obtained quantity of entire set
It is determined as the set of output result, comprising:
Whether the collective number in result after judgement this time merging is greater than 1, if it is, by this result after merging
In set be determined as set to be combined, return to the returning according to element in the set to be combined and the set to be combined
Category relationship determines the step of the second corresponding relationship of element and the set identification of the set to be combined in the set to be combined;
Otherwise, by this merge after obtained set be determined as exporting one of result, by the output of each output result.
A kind of collection processing device, comprising: set obtaining unit to be processed, the first corresponding relationship determination unit, first yuan
Element group obtaining unit and element delete unit,
The set obtaining unit to be processed, for obtaining multiple set to be processed, wherein the multiple set is wrapped
First kind identification element and element to be deleted are included, the first kind identification element is contained up in any set;
The first corresponding relationship determination unit, for true according to element in the multiple set and the attaching relation of set
First corresponding relationship of the fixed first kind identification element, the element to be deleted and set;
The first element group obtaining unit, for obtaining at least one first element according to first corresponding relationship
Group, wherein it include at least two first kind identification elements in any first element group, same first yuan
The first kind identification element in plain group is different and is corresponding with the identical element to be deleted;
The element deletes unit, for each the first element group: N-1 are chosen from the first element group
The first kind identification element determines the corresponding set of the first kind identification element chosen, from determining set
The corresponding element to be deleted of first kind identification element each in the first element group is deleted, processed set is obtained, wherein
N is the quantity of first kind labeled element in the first element group.
Optionally, further includes: set determination unit to be combined, the second corresponding relationship determination unit, second element group obtain
Unit, set combining unit, union combining unit and set output unit,
The set determination unit to be combined is deleted for will not carry out element to be deleted in multiple set to be processed
The set and the processed set removed are determined as set to be combined;
The second corresponding relationship determination unit, for according to element in the set to be combined and the set to be combined
Attaching relation determine the second corresponding relationship of the set identification of element and the set to be combined in the set to be combined;
The second element group obtaining unit, for obtaining at least one second element according to second corresponding relationship
Group, wherein the corresponding set identification of each element in same second element group is all the same and the corresponding set identification of each element extremely
It is less two;
The set combining unit, for choosing an element from each second element group as element to be processed,
To each element to be processed: the corresponding set of the corresponding set identification of the element to be processed being merged, union is obtained;
The union combining unit, for establishing the corresponding relationship of each union and set identification, by corresponding set identification
Identical union merges;
The set output unit, the whole for being obtained after being merged according to the identical union of corresponding set identification
The quantity of set is determined as the set of output result.
A kind of storage medium, the storage medium include the program of storage, wherein in described program operation described in control
Equipment where storage medium executes above-mentioned any process of aggregation method.
A kind of processor, the processor is for running program, wherein described program executes above-mentioned any when running
Process of aggregation method.
By above-mentioned technical proposal, a kind of process of aggregation method and device provided by the invention can obtain the first category
First corresponding relationship of the property known element, element to be deleted and set, obtains at least one first element according to the first corresponding relationship
Group, each the first element group: choosing N-1 first kind identification element from the first element group, determine and choose
The corresponding set of first kind identification element, from determining set by each first kind identification element in the first element group
Corresponding element to be deleted is deleted, and processed set is obtained.The present invention can cause contradiction element present in set
The element to be deleted for merging mistake is deleted, and the set because of the mistake carried out there are interfering element to be deleted is avoided
Merge, improves the accuracy and validity of set amalgamation result.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention,
And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can
It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field
Technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to the present invention
Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 shows a kind of flow chart of process of aggregation method provided in an embodiment of the present invention;
Fig. 2 shows the flow charts of another process of aggregation method provided in an embodiment of the present invention;
Fig. 3 shows a kind of structural schematic diagram of collection processing device provided in an embodiment of the present invention.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
It is fully disclosed to those skilled in the art.
As shown in Figure 1, a kind of process of aggregation method provided in an embodiment of the present invention, may include:
S100, multiple set to be processed are obtained, wherein the multiple set include first kind identification element and to
Element is deleted, contains up to the first kind identification element in any set;
It in other embodiments of the present invention, can also be to be processed to each after acquiring multiple set of processing
Set carries out element duplicate removal processing, and identical element is avoided to occur in a set.
Wherein, first kind identification element can for can the element gathered where it of unique identification, such as certain user information structure
At set in the user identification card number.It is understood that include in set can unique identification gather where it
Element may not only have one kind, and in this case, the present invention can choose one such conduct first kind identification element,
Such as: identification card number and finger-print code, when both elements all can unique identification set where it when, the present invention can choose body
Part card number or finger-print code are as first kind identification element.Under normal circumstances, element to be deleted and first kind identification element
Between can have following relationship: when the first kind labeled element in N number of set is different, in this N number of set to
Deletion element is also answered different.But due to set in error in data a possibility that, it is therefore desirable to the present invention is handled, by portion
Element point to be deleted is deleted, to prevent from subsequent carrying out bringing misleading when set merges.In practical applications, technical staff can root
According to the above-mentioned explanation to first kind identification element and element to be deleted, set is set by adding corresponding mark for element
In element respectively as first kind identification element and element to be deleted.
S200, determined according to element in the multiple set and the attaching relation of set the first kind identification element,
First corresponding relationship of the element to be deleted and set;
Wherein, the corresponding relationship can be described according to element in the multiple set and set by data to embodiment
Attaching relation determine the first corresponding relationship of the first kind identification element, the element to be deleted and set, can have
Body includes:
Unique set identification is respectively set for each set to be processed, generates comprising set identification and set
First data pair;
To the multiple set, the second data comprising the first kind identification element and the element to be deleted are generated
It is right;
By first data to, to being combined, obtained with second data include first data to and second
The third data pair of data pair.
Wherein, the data in the present invention are to can be pair pairs.Set expression can be used in set, and set identification can make
It is indicated with setid, element expression can be used in element, and sign expression, member to be deleted can be used in first kind labeled element
Equivocal expression can be used in element.First data to can be used pair to (setid, set) indicate;Second data are to can
With use pair to (sign, equivocal) indicate, third data to can be used pair to ((sign, equivocal),
(setid, set)) it indicates.
Wherein, pair is defined on header file to being stay in place form in C++<utility>in, one is provided comprising 2
The structural body template of data member.It is understood that the set of each pair centering is the set comprising element, rather than set name
Word.
S300, at least one first element group is obtained according to first corresponding relationship, wherein any first element
It include at least two first kind identification elements in group, the first kind identification in the same first element group
Element is different and is corresponding with the identical element to be deleted;
Such as: set A is (name 1, identification card number 1, cell-phone number 1, university 1);Set B be (name 2, identification card number 2,
Cell-phone number 1, primary school 1);Set C is (name 3, identification card number 3, cell-phone number 2, primary school 1, university 1).Respectively set A, B, C is set
Setting set identification is 001,002,003.Wherein, since a university or a primary school can be corresponding with multiple identification card numbers and hand
Machine number, and a cell-phone number should not correspond to multiple identification card numbers under normal circumstances, therefore identification card number is determined as by the present invention
Cell-phone number is determined as element to be deleted by a kind of identification element.
Pass through pair pairs of step S200 available following three:
Pair is to ((identification card number 1, cell-phone number 1), (001, (name 1, identification card number 1, cell-phone number 1, university 1)));
Pair is to ((identification card number 2, cell-phone number 1), (002, (name 2, identification card number 2, cell-phone number 1, primary school 1)));
Pair to ((identification card number 3, cell-phone number 2), (and 003, (name 3, identification card number 3, cell-phone number 2, primary school 1, university
1)))。
Above-mentioned pair is obtained to being grouped with cell-phone number:
Pair to ((cell-phone number 1, (identification card number 1, identification card number 2)), ((001, (name 1, identification card number 1, cell-phone number
1, university 1)), (002, (name 2, identification card number 2, cell-phone number 1, primary school 1))));
Pair to ((cell-phone number 2, identification card number 3), (and 003, (name 3, identification card number 3, cell-phone number 2, primary school 1, university
1)))。
From above-mentioned pair pairs it is found that corresponding two different first kind identification elements of element cell-phone number 1 to be deleted: identity card
Number 1, identification card number 2, and identification card number 1, identification card number 2 corresponds to cell-phone number 1, thus step S300 can by identification card number 1,
Identification card number 2 is determined as the element in the first element group.
S400, each the first element group: N-1 first kind identifications are chosen from the first element group
Element determines the corresponding set of the first kind identification element chosen, from will be in the first element group in determining set
The corresponding element to be deleted of each first kind identification element is deleted, and obtains processed set, wherein N is the first element group
The quantity of middle first kind labeled element.
Still illustrated using the example above: due to including identification card number 1 and body in the first element group determining in the example above
Part card number 2 two first kind labeled elements, therefore N=2, choose 1 first kind labeled element from the first element group,
Such as choose identification card number 1.It is determining with selection be identification card number 1 it is corresponding collect be combined into set A, by identification card number 1 from set A
Cell-phone number 1 corresponding with identification card number 2 is deleted, and obtains processed set: (name 1, identification card number 1, university 1).
A kind of process of aggregation method provided in an embodiment of the present invention, can obtain first kind identification element, member to be deleted
First corresponding relationship of element and set, obtains at least one first element group according to the first corresponding relationship, each described the
One element group: choosing N-1 first kind identification element from the first element group, determines the first kind identification element chosen
Corresponding set, from determining set by the corresponding element to be deleted of first kind identification element each in the first element group
It deletes, obtains processed set.Contradiction element present in set can be caused the member to be deleted for merging mistake by the present invention
Element is deleted, and is avoided because the set of the mistake carried out there are interfering element to be deleted merges, is improved set and close
And the accuracy and validity of result.
As shown in Fig. 2, another kind process of aggregation method provided in an embodiment of the present invention, on the basis of method shown in Fig. 1, also
May include:
S500, by do not carried out in multiple set to be processed element deletion to be deleted set and the processed collection
Conjunction is determined as set to be combined;
Still it is illustrated using the citing in embodiment illustrated in fig. 1, it is available processed by method shown in Fig. 1
Set: (name 1, identification card number 1, university 1) and the set B and set C for not carrying out element deletion to be deleted, set B are (name
2, identification card number 2, cell-phone number 1, primary school 1);Set C is (name 3, identification card number 3, cell-phone number 2, primary school 1, university 1).Step
These three set can be determined as set to be combined by S500.
S600, determined according to the attaching relation of element in the set to be combined and the set to be combined it is described to be combined
Second corresponding relationship of element and the set identification of the set to be combined in set;
Wherein, step S600 can be specifically included:
Unique set identification is respectively set for each set to be combined, generates the 4th comprising set identification and set
Data pair;
The element of the 4th data centering set is unfolded, generates the 5th data pair including element and the 4th data pair.
Since the 5th data centering includes the corresponding relationship between element, set, set identification, the present invention can
With obtained from the 5th data pair element and set identification the second corresponding relationship namely the element and set identification second
Corresponding relationship is present in the 5th data centering.
Wherein, after step S600, this method can also include:
The quantity for obtaining the corresponding set identification of each element, by comprising the quantity of the corresponding set identification of each element be
1 set is determined as exporting one of result.
S700, at least one second element group is obtained according to second corresponding relationship, wherein in same second element group
The corresponding set identification of each element is all the same and the corresponding set identification at least two of each element;
Wherein, step S700 can be specifically included:
The quantity of the corresponding set identification of element is determined according to second corresponding relationship;
When the element is corresponding at least two set identifications, one is set by the corresponding each set identification of the element
Set identification group, and identified for the set identification group setting group;
The identical each element of corresponding group of mark is determined as one by the corresponding relationship for establishing the element Yu described group of mark
A second element group.
Specifically, it is described when the element is corresponding at least two set identifications, the corresponding each set of the element is marked
Knowledge is set as a set identification group, and identifies for the set identification group setting group, may include:
The corresponding set identification of 5th data centering element is arranged, the corresponding set identification list of element is obtained,
Generate the 6th data pair for preserving the corresponding relationship of element and set identification list;
To each set identification list: when having at least two set identifications in the set identification list, by the set
Set identification in identification list is determined as a set identification group, and a group is arranged for each set identification group and identifies.
Wherein, the corresponding relationship for establishing each union and set identification may include:
To each union: choosing the smallest set identification from the set identification respectively gathered for merging into the union, build
Found the corresponding relationship of the union Yu the smallest set identification.
S800, an element is chosen from each second element group as element to be processed, to each element to be processed:
The corresponding set of the corresponding set identification of the element to be processed is merged, union is obtained;
Wherein, set identification corresponding to each element in same second element group is at least two and identical, therefore same
Each element in one second element group is the shared element of the corresponding set of set identification corresponding to it.Carrying out set conjunction
And when, the present invention need to only choose any one element in second element group, by its corresponding set identification it is corresponding gather into
Row merges, and avoids and is repeatedly merged to same set, reduces data processing amount.
The quantity for obtaining the corresponding set identification of each element, by comprising the quantity of the corresponding set identification of each element be
1 set is determined as exporting one of result.
S900, the corresponding relationship for establishing each union and set identification close the identical union of corresponding set identification
And;
S1000, the quantity of the entire set obtained after being merged according to the identical union of corresponding set identification are determining
Set as output result.
Wherein, step S1000 can be specifically included:
Whether the collective number in result after judgement this time merging is greater than 1, if it is, by this result after merging
In set be determined as set to be combined, return to the step S600;Otherwise, by this merge after obtained set be determined as it is defeated
One of result out exports each output result.
Corresponding with a kind of process of aggregation method that the embodiments of the present invention provide, the present invention also provides a kind of set
Processing unit.
As shown in figure 3, a kind of collection processing device provided in an embodiment of the present invention, may include: that set to be processed obtains
Unit 100, the first corresponding relationship determination unit 200, the first element group obtaining unit 300 and element delete unit 400,
The set obtaining unit 100 to be processed, for obtaining multiple set to be processed, wherein the multiple set
Include first kind identification element and element to be deleted, the first kind identification member is contained up in any set
Element;
The first corresponding relationship determination unit 200, for being closed according to the ownership of element and set in the multiple set
System determines the first corresponding relationship of the first kind identification element, the element to be deleted and set;
The first element group obtaining unit 300, for obtaining at least one first yuan according to first corresponding relationship
Plain group, wherein it include at least two first kind identification elements in any first element group, same first
The first kind identification element in element group is different and is corresponding with the identical element to be deleted;
The element deletes unit 400, for each the first element group: choosing N- from the first element group
1 first kind identification element determines the corresponding set of the first kind identification element chosen, from determining set
It is middle to delete the corresponding element to be deleted of first kind identification element each in the first element group, processed set is obtained,
In, N is the quantity of first kind labeled element in the first element group.
Optionally, Fig. 3 shown device can also include: set determination unit to be combined, the second corresponding relationship determination unit,
Second element group obtaining unit, set combining unit, union combining unit and set output unit,
The set determination unit to be combined is deleted for will not carry out element to be deleted in multiple set to be processed
The set and the processed set removed are determined as set to be combined;
The second corresponding relationship determination unit, for according to element in the set to be combined and the set to be combined
Attaching relation determine the second corresponding relationship of the set identification of element and the set to be combined in the set to be combined;
The second element group obtaining unit, for obtaining at least one second element according to second corresponding relationship
Group, wherein the corresponding set identification of each element in same second element group is all the same and the corresponding set identification of each element extremely
It is less two;
The set combining unit, for choosing an element from each second element group as element to be processed,
To each element to be processed: the corresponding set of the corresponding set identification of the element to be processed being merged, union is obtained;
The union combining unit, for establishing the corresponding relationship of each union and set identification, by corresponding set identification
Identical union merges;
The set output unit, the whole for being obtained after being merged according to the identical union of corresponding set identification
The quantity of set is determined as the set of output result.
Optionally, the set output unit, can be specifically used for:
Whether the collective number in result after judgement this time merging is greater than 1, if it is, by this result after merging
In set be determined as set to be combined, trigger the second corresponding relationship determination unit;Otherwise, by this merge after obtain
Set is determined as exporting one of result, and each output result is exported.
Optionally, the second element group obtaining unit may include: quantity acquisition subelement, group mark setting son list
Member and element group determine subelement,
The quantity obtains subelement, for determining the number of the corresponding set identification of element according to second corresponding relationship
Amount;
Subelement is arranged in described group of mark, for when the element is corresponding at least two set identifications, by the element
Corresponding each set identification is set as a set identification group, and identifies for the set identification group setting group;
The element group determines subelement, will be corresponding for establishing the corresponding relationship of the element Yu described group of mark
Group identifies identical each element and is determined as a second element group.
Optionally, the union combining unit, can be specifically used for:
To each union: choosing the smallest set identification from the set identification respectively gathered for merging into the union, build
The corresponding relationship for founding the union Yu the smallest set identification merges the identical union of corresponding set identification.
Wherein, collection processing device provided in an embodiment of the present invention can also include: quantity obtaining unit, for second
Corresponding relationship determination unit according to the attaching relation of element in the set to be combined and the set to be combined determine it is described to
Merge in set after the second corresponding relationship of element and the set identification of the set to be combined, obtains the corresponding collection of each element
The quantity for closing mark, by comprising the quantity of the corresponding set identification of each element be that 1 set is determined as exporting one of result.
The collection processing device includes processor and memory, and above-mentioned set obtaining unit to be processed, first corresponding are closed
It is that determination unit, the first element group obtaining unit and element deletion unit etc. are used as program unit storage in memory, by
Processor executes above procedure unit stored in memory to realize corresponding function.
Include kernel in processor, is gone in memory to transfer corresponding program unit by kernel.Kernel can be set one
Or more, process of aggregation is carried out by adjusting kernel parameter.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/
Or the forms such as Nonvolatile memory, if read-only memory (ROM) or flash memory (flash RAM), memory include that at least one is deposited
Store up chip.
The embodiment of the invention provides a kind of storage mediums, are stored thereon with program, real when which is executed by processor
The existing process of aggregation method.
The embodiment of the invention provides a kind of processor, the processor is for running program, wherein described program operation
Process of aggregation method described in Shi Zhihang.
The embodiment of the invention provides a kind of equipment, equipment include processor, memory and storage on a memory and can
The program run on a processor, processor perform the steps of when executing program
Obtain multiple set to be processed, wherein the multiple set includes first kind identification element and to be deleted
Element contains up to the first kind identification element in any set;
According to element in the multiple set and the attaching relation of set determine the first kind identification element, it is described to
Delete the first corresponding relationship of element and set;
At least one first element group is obtained according to first corresponding relationship, wherein in any first element group
It include at least two first kind identification elements, the first kind identification element in the same first element group
It is different and be corresponding with the identical element to be deleted;
Each the first element group: the N-1 first kind identification elements are chosen from the first element group,
The corresponding set of the first kind identification element chosen is determined, from will be each first in the first element group in determining set
The corresponding element to be deleted of class identification element is deleted, and obtains processed set, wherein N is first in the first element group
The quantity of category characterizing element.
Optionally, it can also be performed the steps of when processor executes program
The set and the processed set that do not carry out element deletion to be deleted in multiple set to be processed is true
It is set to set to be combined;
The set to be combined is determined according to the attaching relation of element in the set to be combined and the set to be combined
Second corresponding relationship of middle element and the set identification of the set to be combined;
At least one second element group is obtained according to second corresponding relationship, wherein each in same second element group
The corresponding set identification of element is all the same and the corresponding set identification at least two of each element;
An element is chosen from each second element group as element to be processed, to each element to be processed: by this
The corresponding set of the corresponding set identification of element to be processed merges, and obtains union;
The corresponding relationship for establishing each union and set identification merges the identical union of corresponding set identification;
The quantity of the entire set obtained after being merged according to the identical union of corresponding set identification is determined as defeated
The set of result out.
Optionally, described that at least one second element group is obtained according to second corresponding relationship, wherein same second yuan
The corresponding set identification of each element in plain group is all the same and the corresponding set identification at least two of each element, comprising:
The quantity of the corresponding set identification of element is determined according to second corresponding relationship;
When the element is corresponding at least two set identifications, one is set by the corresponding each set identification of the element
Set identification group, and identified for the set identification group setting group;
The identical each element of corresponding group of mark is determined as one by the corresponding relationship for establishing the element Yu described group of mark
A second element group.
Optionally, the corresponding relationship for establishing each union and set identification, comprising:
To each union: choosing the smallest set identification from the set identification respectively gathered for merging into the union, build
Found the corresponding relationship of the union Yu the smallest set identification.
It optionally, can also be according to element in the set to be combined and the collection to be combined when processor executes program
The attaching relation of conjunction determines the second corresponding relationship of element and the set identification of the set to be combined in the set to be combined
Later, it performs the steps of
The quantity for obtaining the corresponding set identification of each element, by comprising the quantity of the corresponding set identification of each element be
1 set is determined as exporting one of result.
Optionally, it is described merged according to the identical union of corresponding set identification after the obtained quantity of entire set
It is determined as the set of output result, comprising:
Whether the collective number in result after judgement this time merging is greater than 1, if it is, by this result after merging
In set be determined as set to be combined, return to the returning according to element in the set to be combined and the set to be combined
Category relationship determines the step of the second corresponding relationship of element and the set identification of the set to be combined in the set to be combined;
Otherwise, by this merge after obtained set be determined as exporting one of result, by the output of each output result.
Equipment herein can be server, PC, PAD, mobile phone etc..
Present invention also provides a kind of computer program products, when executing on data processing equipment, are adapted for carrying out just
The program of beginningization there are as below methods step:
Obtain multiple set to be processed, wherein the multiple set includes first kind identification element and to be deleted
Element contains up to the first kind identification element in any set;
According to element in the multiple set and the attaching relation of set determine the first kind identification element, it is described to
Delete the first corresponding relationship of element and set;
At least one first element group is obtained according to first corresponding relationship, wherein in any first element group
It include at least two first kind identification elements, the first kind identification element in the same first element group
It is different and be corresponding with the identical element to be deleted;
Each the first element group: the N-1 first kind identification elements are chosen from the first element group,
The corresponding set of the first kind identification element chosen is determined, from will be each first in the first element group in determining set
The corresponding element to be deleted of class identification element is deleted, and obtains processed set, wherein N is first in the first element group
The quantity of category characterizing element.
Optionally, it is further adapted for executing the program of initialization there are as below methods step:
The set and the processed set that do not carry out element deletion to be deleted in multiple set to be processed is true
It is set to set to be combined;
The set to be combined is determined according to the attaching relation of element in the set to be combined and the set to be combined
Second corresponding relationship of middle element and the set identification of the set to be combined;
At least one second element group is obtained according to second corresponding relationship, wherein each in same second element group
The corresponding set identification of element is all the same and the corresponding set identification at least two of each element;
An element is chosen from each second element group as element to be processed, to each element to be processed: by this
The corresponding set of the corresponding set identification of element to be processed merges, and obtains union;
The corresponding relationship for establishing each union and set identification merges the identical union of corresponding set identification;
The quantity of the entire set obtained after being merged according to the identical union of corresponding set identification is determined as defeated
The set of result out.
Optionally, described that at least one second element group is obtained according to second corresponding relationship, wherein same second yuan
The corresponding set identification of each element in plain group is all the same and the corresponding set identification at least two of each element, comprising:
The quantity of the corresponding set identification of element is determined according to second corresponding relationship;
When the element is corresponding at least two set identifications, one is set by the corresponding each set identification of the element
Set identification group, and identified for the set identification group setting group;
The identical each element of corresponding group of mark is determined as one by the corresponding relationship for establishing the element Yu described group of mark
A second element group.
Optionally, the corresponding relationship for establishing each union and set identification, comprising:
To each union: choosing the smallest set identification from the set identification respectively gathered for merging into the union, build
Found the corresponding relationship of the union Yu the smallest set identification.
Optionally, it is further adapted for executing the program of initialization there are as below methods step:
The collection to be combined is being determined according to the attaching relation of element in the set to be combined and the set to be combined
In conjunction after the second corresponding relationship of element and the set identification of the set to be combined, the corresponding set identification of each element is obtained
Quantity, by comprising the quantity of the corresponding set identification of each element be that 1 set is determined as exporting one of result.
Optionally, it is described merged according to the identical union of corresponding set identification after the obtained quantity of entire set
It is determined as the set of output result, comprising:
Whether the collective number in result after judgement this time merging is greater than 1, if it is, by this result after merging
In set be determined as set to be combined, return to the returning according to element in the set to be combined and the set to be combined
Category relationship determines the step of the second corresponding relationship of element and the set identification of the set to be combined in the set to be combined;
Otherwise, by this merge after obtained set be determined as exporting one of result, by the output of each output result.
It should be understood by those skilled in the art that, embodiments herein can provide as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the application
Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the application, which can be used in one or more,
The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces
The form of product.
The application is referring to method, the process of equipment (system) and computer program product according to the embodiment of the present application
Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions
The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs
Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real
The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
In a typical configuration, calculating equipment includes one or more processors (CPU), input/output interface, net
Network interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/
Or the forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable Jie
The example of matter.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM),
Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices
Or any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, it calculates
Machine readable medium does not include temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability
It include so that the process, method, commodity or the equipment that include a series of elements not only include those elements, but also to wrap
Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including element
There is also other identical elements in process, method, commodity or equipment.
It will be understood by those skilled in the art that embodiments herein can provide as method, system or computer program product.
Therefore, complete hardware embodiment, complete software embodiment or embodiment combining software and hardware aspects can be used in the application
Form.It is deposited moreover, the application can be used to can be used in the computer that one or more wherein includes computer usable program code
The shape for the computer program product implemented on storage media (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
Formula.
The above is only embodiments herein, are not intended to limit this application.To those skilled in the art,
Various changes and changes are possible in this application.It is all within the spirit and principles of the present application made by any modification, equivalent replacement,
Improve etc., it should be included within the scope of the claims of this application.
Claims (10)
1. a kind of process of aggregation method characterized by comprising
Obtain multiple set to be processed, wherein it is the multiple set include first kind identification element and element to be deleted,
The first kind identification element is contained up in any set;
The first kind identification element, described to be deleted is determined according to element in the multiple set and the attaching relation of set
First corresponding relationship of element and set;
At least one first element group is obtained according to first corresponding relationship, wherein is wrapped in any first element group
At least two first kind identification elements are included, the first kind identification element in the same first element group is different
And it is corresponding with the identical element to be deleted;
Each the first element group: choosing the N-1 first kind identification elements from the first element group, determine
Choose the corresponding set of the first kind identification element, from determining set by each first category in the first element group
The corresponding element to be deleted of the property known element is deleted, and obtains processed set, wherein N is the first category in the first element group
The quantity of characterizing element.
2. the method according to claim 1, wherein further include:
The set for not carrying out element deletion to be deleted in multiple set to be processed and the processed set are determined as
Set to be combined;
It is determined according to the attaching relation of element in the set to be combined and the set to be combined first in the set to be combined
Plain the second corresponding relationship with the set identification of the set to be combined;
At least one second element group is obtained according to second corresponding relationship, wherein each element in same second element group
Corresponding set identification is all the same and the corresponding set identification at least two of each element;
An element is chosen from each second element group as element to be processed, to each element to be processed: this is waited locating
The corresponding set of the corresponding set identification of reason element merges, and obtains union;
The corresponding relationship for establishing each union and set identification merges the identical union of corresponding set identification;
The quantity of the entire set obtained after being merged according to the identical union of corresponding set identification is determined as output knot
The set of fruit.
3. according to the method described in claim 2, it is characterized by: described obtain at least one according to second corresponding relationship
Second element group, wherein the corresponding set identification of each element in same second element group is all the same and the corresponding collection of each element
Close mark at least two, comprising:
The quantity of the corresponding set identification of element is determined according to second corresponding relationship;
When the element is corresponding at least two set identifications, a set is set by the corresponding each set identification of the element
Mark group, and identified for the set identification group setting group;
The identical each element of corresponding group of mark is determined as one by the corresponding relationship for establishing the element Yu described group of mark
Was Used group.
4. according to the method described in claim 3, it is characterized by: the corresponding relationship for establishing each union and set identification,
Include:
To each union: choosing the smallest set identification from the set identification respectively gathered for merging into the union, establishing should
The corresponding relationship of union and the smallest set identification.
5. according to the method described in claim 2, it is characterized by: according to element in the set to be combined with described wait close
And the attaching relation gathered determines the second corresponding of element and the set identification of the set to be combined in the set to be combined
After relationship, the method also includes:
The quantity for obtaining the corresponding set identification of each element, by comprising the quantity of the corresponding set identification of each element be 1
Set is determined as exporting one of result.
6. the method according to any one of claim 2 to 5, it is characterised in that: described according to corresponding set identification phase
The quantity for the entire set that same union obtains after merging is determined as the set of output result, comprising:
Whether the collective number in result after judgement this time merging is greater than 1, if it is, by this result after merging
Set is determined as set to be combined, returns described according to the ownership of element in the set to be combined and the set to be combined pass
System determines the step of the second corresponding relationship of element and the set identification of the set to be combined in the set to be combined;It is no
Then, by this merge after obtained set be determined as exporting one of result, by the output of each output result.
7. a kind of collection processing device characterized by comprising set obtaining unit to be processed, the first corresponding relationship determine single
Member, the first element group obtaining unit and element delete unit,
The set obtaining unit to be processed, for obtaining multiple set to be processed, wherein the multiple set includes the
A kind of identification element and element to be deleted contain up to the first kind identification element in any set;
The first corresponding relationship determination unit, for determining institute according to element in the multiple set and the attaching relation of set
State the first corresponding relationship of first kind identification element, the element to be deleted and set;
The first element group obtaining unit, for obtaining at least one first element group according to first corresponding relationship,
In, it include at least two first kind identification elements, the same first element group in any first element group
In the first kind identification element it is different and be corresponding with the identical element to be deleted;
The element deletes unit, for each the first element group: choosing described in N-1 from the first element group
First kind identification element determines the corresponding set of the first kind identification element chosen, should from determining set
The corresponding element to be deleted of each first kind identification element is deleted in first element group, obtains processed set, wherein N is
The quantity of first kind labeled element in the first element group.
8. device according to claim 7, which is characterized in that further include: set determination unit to be combined, second corresponding are closed
It is determination unit, second element group obtaining unit, gathers combining unit, union combining unit and set output unit,
The set determination unit to be combined, for will not carry out element deletion to be deleted in multiple set to be processed
Set is determined as set to be combined with the processed set;
The second corresponding relationship determination unit, for returning according to element in the set to be combined and the set to be combined
Category relationship determines the second corresponding relationship of element and the set identification of the set to be combined in the set to be combined;
The second element group obtaining unit, for obtaining at least one second element group according to second corresponding relationship,
In, the corresponding set identification of each element in same second element group is all the same and the corresponding set identification of each element is at least two
It is a;
The set combining unit, for choosing an element from each second element group as element to be processed, to every
A element to be processed: the corresponding set of the corresponding set identification of the element to be processed is merged, union is obtained;
The union combining unit is identical by corresponding set identification for establishing the corresponding relationship of each union and set identification
Union merge;
The set output unit, the entire set for being obtained after being merged according to the identical union of corresponding set identification
Quantity be determined as output result set.
9. a kind of storage medium, which is characterized in that the storage medium includes the program of storage, wherein run in described program
When the equipment that controls where the storage medium execute such as process of aggregation method described in any one of claims 1 to 6.
10. a kind of processor, which is characterized in that the processor is for running program, wherein executed such as when described program is run
Process of aggregation method described in any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710919176.0A CN110069529A (en) | 2017-09-30 | 2017-09-30 | Process of aggregation method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710919176.0A CN110069529A (en) | 2017-09-30 | 2017-09-30 | Process of aggregation method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110069529A true CN110069529A (en) | 2019-07-30 |
Family
ID=67364370
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710919176.0A Pending CN110069529A (en) | 2017-09-30 | 2017-09-30 | Process of aggregation method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110069529A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112232639A (en) * | 2020-09-22 | 2021-01-15 | 支付宝(杭州)信息技术有限公司 | Statistical method and device and electronic equipment |
-
2017
- 2017-09-30 CN CN201710919176.0A patent/CN110069529A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112232639A (en) * | 2020-09-22 | 2021-01-15 | 支付宝(杭州)信息技术有限公司 | Statistical method and device and electronic equipment |
CN112232639B (en) * | 2020-09-22 | 2023-06-30 | 支付宝(杭州)信息技术有限公司 | Statistical method, statistical device and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108932257A (en) | The querying method and device of multi-dimensional data | |
CN108008936A (en) | A kind of data processing method, device and electronic equipment | |
CN110457182A (en) | A kind of load balancing cluster example operating index monitoring system | |
CN109284115A (en) | A kind of method and device generating tracker script | |
CN106294530B (en) | The method and system of rule match | |
CN110019385A (en) | The querying method and device of parameter | |
CN110069529A (en) | Process of aggregation method and device | |
CN108460038A (en) | Rule matching method and its equipment | |
CN109582476A (en) | Data processing method, apparatus and system | |
CN110245978A (en) | Policy evaluation, policy selection method and device in tactful group | |
CN106570029A (en) | Data processing method and data processing system of distributed relation type database | |
CN109558432A (en) | Data processing method and device | |
CN110019449A (en) | There are the merging method and device of intersection set | |
CN110069453A (en) | Operation/maintenance data treating method and apparatus | |
CN106294700A (en) | The storage of a kind of daily record and read method and device | |
CN105740274B (en) | User account lookup method and device based on non-directed graph | |
CN113055209B (en) | Arranging method and device for edge calculation | |
CN110147404A (en) | Data processing method and device | |
CN110020274A (en) | Page returning method and device under browser environment are applied in mixing | |
CN110019196A (en) | Data processing method and device | |
CN110020351A (en) | Click thermodynamic chart method for detecting abnormality and device | |
CN106407345A (en) | Method and apparatus for updating dirty data | |
CN108076450A (en) | A kind of method and device for identifying same user | |
CN108984573A (en) | There are the merging method and device of intersection set | |
CN108694045A (en) | A kind of data processing method and device |
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 | ||
CB02 | Change of applicant information |
Address after: 100080 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing Applicant after: Beijing Guoshuang Technology Co.,Ltd. Address before: 100086 Beijing city Haidian District Shuangyushu Area No. 76 Zhichun Road cuigongfandian 8 layer A Applicant before: Beijing Guoshuang Technology Co.,Ltd. |
|
CB02 | Change of applicant information | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190730 |
|
RJ01 | Rejection of invention patent application after publication |