CN110347886A - Distributed set membership element lookup method - Google Patents
Distributed set membership element lookup method Download PDFInfo
- Publication number
- CN110347886A CN110347886A CN201910543604.3A CN201910543604A CN110347886A CN 110347886 A CN110347886 A CN 110347886A CN 201910543604 A CN201910543604 A CN 201910543604A CN 110347886 A CN110347886 A CN 110347886A
- Authority
- CN
- China
- Prior art keywords
- value
- father
- set membership
- elements
- subset
- 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
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/90—Details of database functions independent of the retrieved data types
- G06F16/901—Indexing; Data structures therefor; Storage structures
- G06F16/9027—Trees
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/903—Querying
- G06F16/90335—Query processing
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computational Linguistics (AREA)
- Multi Processors (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a kind of distributed set membership element lookup methods comprising the steps of: establishes distributed caching redis;Element set is split into multiple subset of elements merging and is sent to different computers;Computer calculates each of received subset of elements conjunction father's element of element and element father's element corresponding with its is stored in distributed caching redis;It is found out in the subset of elements conjunction received from it by distributed caching redis and meets set membership element of a function;Summarize the lookup result comprehensive descision of multiple computers.Element set is split into multiple subset of elements conjunctions and is sent to different computer disposals by the distributed set membership element lookup method of offer, the operation result of multiple computers is stored using distributed caching redis, further according to the characteristic of the key-value mapping of distributed caching redis, the time for searching the element for meeting set membership in element set is substantially reduced.
Description
Technical field
The present invention relates to a kind of distributed set membership element lookup methods.
Background technique
In an element set, such as element set { A, B, C }, the element in the element set meet f (A)=
B, and f (B)=C, it is believed that, each element in the element set is all satisfied set membership function f (x), elements A, B, C
Meet set membership.Wherein, elements A is father's element of element B, and element B is the daughter element of elements A, and element B is the father of Elements C
Grade, Elements C is the sub- grade of element B.And father's element of elements A is not contained in element set, and our elements As are referred to as root,
And the daughter element of Elements C is not contained in element set, that one Elements C is exactly child node.
In practical applications, it is often necessary to which whether each element verified in an element set meets set membership, existing
Method be to be made the following judgment to each element: verify each element daughter element or father's element whether there is in element set
In conjunction, if the father's element or daughter element of the element are present in the element set, which meets set membership.
Existing method is required to the verifying of each of element set element the element is substituted into set membership letter
Operation obtains its daughter element in number f (x), and remaining element in the daughter element and element set is compared to judge residue
It whether include the element equal with daughter element in element.
Specifically, for element set { A, B, C }, if it is desired to verify whether the element in the element set meets father
Subrelation function f (x) is then needed by following steps:
Verify elements A: whether verifying f (A) is equal to whether B and f (A) is equal to B, at most needs cycle calculations twice, tests
Demonstrate,prove element B: whether verifying f (B) is equal to whether A and f (B) is equal to C, at most needs cycle calculations twice, verifies Elements C: testing
It demonstrate,proves f (C) and whether is equal to whether A and f (C) is equal to B, at most need cycle calculations twice, may determine that member by above step
Whether plain A, element B and Elements C meet set membership function f (x), verify the element set that an element number is 3, the worst
A possibility that be to carry out 6 comparisons to search operation, when element number is n, it is the worst a possibility that be that need to carry out n (n-1) secondary
Operation is searched in comparison, it is assumed that the element number in element set is larger, the operand sharp increase, greatly expends computer
Computing resource, meanwhile, it calculates time-consuming very long.
Summary of the invention
To solve the deficiencies in the prior art, the present invention provides a kind of distributed set memberships that can solve the above problem
Element lookup method.
In order to achieve the above objectives, the present invention adopts the following technical scheme that:
A kind of distribution set membership element lookup method meets a certain father and son pass for finding out from an element set
It is element of a function comprising the steps of:
Establish distributed caching redis;
The element set is split into multiple subset of elements merging, subset of elements conjunction is sent to different calculating
Machine;
Each computer calculates father's element of element described in each of received described subset of elements conjunction;
Element father's element corresponding with its is stored in the distributed caching redis by each computer;
The subset of elements that each computer is received from it by the distributed caching redis is found out completely in closing
The element of the foot set membership function;
Summarize and meets the set membership function in element set described in the lookup result comprehensive descision of multiple computers
The element.
Further, the element set multiple subset of elements are divided into close.
Further, each computer calculates the father of element described in each of received described subset of elements conjunction
Element method particularly includes:
The inverse function of the set membership function is calculated as set membership against letter by the set membership function
Number;
The element is substituted into the set membership inverse function obtained by calculation and is acquired corresponding to the element
Father's element.
Further, element father's element corresponding with its is stored in the distributed caching by each computer
Redis's method particularly includes:
Using the element as key value and using the corresponding father's element of the element as value value, by the element
With father's element composition key-value distributed caching redis described to deposit.
Further, each computer is closed by the subset of elements that the distributed caching redis is received from it
In find out the element for meeting the set membership function method particularly includes:
The element is obtained into its corresponding value value as key value from the distributed caching redis;
It is corresponding that the value value that will acquire as new key value obtains its from the distributed caching redis
Value value.
Further, when the value value that will acquire can from the distributed caching redis as new key value
When getting its corresponding value value, father's element of the element is included in the element set.
Further, when the value value that will acquire can not from the distributed caching redis as new key value
When getting its corresponding value value, father's element of the element is not included in the element set.
Further, the lookup result of multiple computers will be summarized and comprehensive descision show that its daughter element or father's element exist
The element extraction in the element set, which comes out, forms set membership element set.
Further, the lookup result comprehensive descision for summarizing multiple computers is shown that its daughter element and father's element are not deposited
It is that the element extraction in the element set comes out and forms set membership element set.
The invention has the beneficial effects that the distributed set membership element lookup method provided, an element set is torn open
It is divided into multiple subset of elements conjunctions and is sent to different computer progress distributed arithmetics, meanwhile, it is deposited using distributed caching redis
The operation result for storing up multiple computers is substantially reduced further according to the characteristic of the key-value mapping of distributed caching redis
Search the time for meeting the element of set membership in element set.
Detailed description of the invention
Fig. 1 is the flow chart of distributed set membership element lookup method of the invention.
Specific embodiment
Specific introduce is made to the present invention below in conjunction with the drawings and specific embodiments.
It is as shown in Figure 1 a kind of flow chart of distributed set membership element lookup method of the invention, distribution father
Subrelation element lookup method is wrapped for finding out the element for meeting a certain set membership function f (x) from an element set
Containing following steps: S1: establishing distributed caching redis.S2: element set is split into multiple subset of elements and is merged first sub-prime
Set is sent to different computers.S3: each computer calculates each of received subset of elements conjunction element
Father's element.S4: element father's element corresponding with its is stored in distributed caching redis by each computer.S5: each computer
The subset of elements received from it by distributed caching redis finds out the element for meeting set membership function f (x) in closing.
S6: summarize the element for meeting set membership function f (x) in the lookup result comprehensive descision element set of multiple computers.
For S1: establishing distributed caching redis.
Firstly the need of the quantity of the element in the element set searched as needed, establishing one can satisfy storage demand
Distributed caching redis.
For S2: element set being split into multiple subset of elements merging, subset of elements conjunction is sent to different calculating
Machine.
The element set that will require look up splits into multiple subclass.Preferably element set is split in a manner of dividing equally
It closes, method particularly includes: obtain the number of the element in element set, the quantity that the subset of elements that splits as needed closes is by element
Element in set is divided equally, it is to be understood that the number of the element in element set is different surely to be closed by subset of elements
Quantity divide exactly, divide equally at this time be meant that each subset of elements close in the difference of number of element be no more than 1.Citing and
Speech, it is assumed that the quantity of the element in element set is 1002, and it is 100 that the subset of elements for needing to split, which closes quantity, then after splitting
The quantity of element in subset of elements conjunction is 101,100,100,100,100,100,100,100,100,101, and so on.It tears open
After the completion of point, each subset of elements is closed and is sent to different computer progress distributed arithmetics.
For S3: each computer calculates father's element of each of received subset of elements conjunction element.
Specifically, each computer calculates the tool of each of received subset of elements conjunction father's element of element
Body method are as follows: the inverse function of set membership function f (x) is calculated as set membership against letter by set membership function f (x)
Number f (x)-1, element is substituted into set membership inverse function f (x) obtained by calculation-1In acquire father's element corresponding to element.
For S4: element father's element corresponding with its is stored in distributed caching redis by each computer.
Specifically, using element as key value and using the corresponding father's element of element as value value, by element and father's member
Element composition key-value is to deposit distributed caching redis.Pass through put (key, value) method for element and father's element group
At key-value to deposit distributed caching redis to be used for subsequent lookup.
For S5: being found out in the subset of elements conjunction that each computer is received from it by distributed caching redis full
The element of sufficient set membership function f (x).
Specifically, each of the subset of elements conjunction for needing to verify element is carried out following verifying by each computer:
It includes that elements A obtains in distributed caching redis by taking elements A as an example using elements A as key value that the subset of elements, which will be set, and closed
Its corresponding value, i.e., by get (x) method, by elements A substitute into get (x) with from distributed caching redis to elements A
It carries out operation to search to obtain the corresponding value value of the elements A, the value value that will acquire passes through get as new key value again
(x) method obtains its corresponding value value from distributed caching redis.Assuming that the value value that will acquire is as new
Key value gets its corresponding value value by get (x) method from distributed caching redis, indicates that the subset of elements closes
In father's element of elements A be present in element set, i.e., elements A meets set membership.Conversely, as the value that will acquire
When value can not get its corresponding value value by get (x) method as new key value from distributed caching redis,
Then indicate that father's element of the elements A in subset of elements conjunction is not present in element set, it is to be understood that the father of elements A
Element, which is not present in element set that elements A can not be immediately arrived at, is unsatisfactory for set membership because elements A it could also be possible that
Root, only when after all verification steps judgement obtain father's element that elements A is not the other elements in element set
When then indicate that elements A is unsatisfactory for set membership, conversely, if elements A is father's element of the other elements in element set, element
A also meets set membership.
It is possible and imperfect that each computer closes the element searched to received subset of elements, it is assumed that meter
Subset of elements received by calculation machine 1, which closes in 1, has an elements A for root, but the daughter element B of the elements A is in 2 institute of computer
The subset of elements that receives closes in 2, since the calculating of each computer is independent from each other, computer 1 to subset of elements close 1 into
When row searches verifying, due to that can not learn the lookup result of computer 2, the judging result of computer 1 thinks that elements A is unsatisfactory for father
Subrelation, this is obviously disagreed with actual conditions.
For S6: summarizing in the lookup result comprehensive descision element set of multiple computers and meet set membership function f (x)
Element.
In step s 5, after each computer carries out lookup verifying to the conjunction of received subset of elements, it is also necessary to will be every
The lookup result of a computer is summarized, and carries out comprehensive descision further according to the long and is converged to obtain all meeting set membership
Element.The case where according to above-mentioned hypothesis, due to finally summarizing the lookup verification result of each computer, although calculating
Machine 1 shows the elements A both without father's element or without daughter element to the lookup verification result of elements A, but computer 2 is to subset of elements
The lookup verification result for closing 2 shows that father's element of element B is elements A, therefore combines the lookup verification result of multiple computers
It, can be to avoid the error result for excluding elements A after carrying out comprehensive descision.
Set membership element lookup method through the invention, it is assumed that element set includes n element, in each element generation
Enter set membership inverse function f (x)-1In father's element is calculated, and this mapping relations are stored in distributed caching redis
In, then the step of needing operation is 2n, and when having arrived lookup, each element only needs to carry out from distributed caching redis
Get (x) method is searched twice, then searching number is 2n, total calculation step is 4n, simultaneously as using distributed fortune
It calculates, the time of final operation will be greatly reduced in diameter again.Compared with the worst possible calculation step n (n-1) in the prior art is secondary,
The reduction highly significant of the operand of set membership element lookup method of the invention.
It is understood that divide to element set and the subset of elements conjunction after division being sent to different meters
Calculation machine can also generate some operations, but when the number in element set is very big, divide element set and send first sub-prime
The operand of set almost can be ignored compared with entire calculating process.
Optionally, the lookup result of multiple computers will be summarized and comprehensive descision show that its daughter element or father's element exist
Element extraction in element set, which comes out, forms set membership element set.The lookup result for summarizing multiple computers is comprehensive
Judgement show that its daughter element and father's element are not present in the element extraction in element set and come out composition set membership element set
It closes.
The basic principles, main features and advantages of the invention have been shown and described above.The technical staff of the industry should
Understand, the above embodiments do not limit the invention in any form, all obtained by the way of equivalent substitution or equivalent transformation
Technical solution is fallen within the scope of protection of the present invention.
Claims (9)
1. a kind of distribution set membership element lookup method, meets a certain set membership for finding out from an element set
Element of a function, which is characterized in that comprise the steps of:
Establish distributed caching redis;
The element set is split into multiple subset of elements merging, subset of elements conjunction is sent to different computers;
Each computer calculates father's element of element described in each of received described subset of elements conjunction;
Element father's element corresponding with its is stored in the distributed caching redis by each computer;
It is found out in the subset of elements conjunction that each computer is received from it by the distributed caching redis and meets institute
State the element of set membership function;
Summarize and meets the described of the set membership function in element set described in the lookup result comprehensive descision of multiple computers
Element.
2. distribution set membership element lookup method according to claim 1, which is characterized in that
The element set is divided into multiple subset of elements to close.
3. distribution set membership element lookup method according to claim 1, which is characterized in that
Each computer calculates the specific side of father's element of element described in each of received described subset of elements conjunction
Method are as follows:
The inverse function of the set membership function is calculated as set membership inverse function by the set membership function;
The element is substituted into the set membership inverse function obtained by calculation described in acquiring corresponding to the element
Father's element.
4. distribution set membership element lookup method according to claim 1, which is characterized in that
Element father's element corresponding with its is stored in the specific method of the distributed caching redis by each computer
Are as follows:
Using the element as key value and using the corresponding father's element of the element as value value, by the element and institute
State father's element composition key-value distributed caching redis described to deposit.
5. distribution set membership element lookup method according to claim 1, which is characterized in that
It is found out in the subset of elements conjunction that each computer is received from it by the distributed caching redis and meets institute
State the element of set membership function method particularly includes:
The element is obtained into its corresponding value value as key value from the distributed caching redis;
The value value that will acquire obtains its corresponding value value as new key value from the distributed caching redis.
6. distribution set membership element lookup method according to claim 5, which is characterized in that
When as new key value can to get its from the distributed caching redis corresponding for the value value that will acquire
When value value, father's element of the element is included in the element set.
7. distribution set membership element lookup method according to claim 6, which is characterized in that
When as new key value can not to get its from the distributed caching redis corresponding for the value value that will acquire
When value value, father's element of the element is not included in the element set.
8. distribution set membership element lookup method according to claim 7, which is characterized in that
The lookup result of multiple computers will be summarized and comprehensive descision show that its daughter element or father's element are present in the element set
The element extraction in conjunction, which comes out, forms set membership element set.
9. distribution set membership element lookup method according to claim 8, which is characterized in that
The lookup result comprehensive descision for summarizing multiple computers is shown that its daughter element and father's element are not present in the element
The element extraction in set, which comes out, forms set membership element set.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910543604.3A CN110347886B (en) | 2019-06-21 | 2019-06-21 | Distributed parent-child relationship element searching method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910543604.3A CN110347886B (en) | 2019-06-21 | 2019-06-21 | Distributed parent-child relationship element searching method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110347886A true CN110347886A (en) | 2019-10-18 |
CN110347886B CN110347886B (en) | 2022-03-25 |
Family
ID=68182680
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910543604.3A Active CN110347886B (en) | 2019-06-21 | 2019-06-21 | Distributed parent-child relationship element searching method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110347886B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110351079A (en) * | 2019-07-09 | 2019-10-18 | 政采云有限公司 | Tripartite's decryption method based on set membership verifying |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110246460A1 (en) * | 2010-03-31 | 2011-10-06 | Cloudera, Inc. | Collecting and aggregating datasets for analysis |
CN104156380A (en) * | 2014-03-04 | 2014-11-19 | 深圳信息职业技术学院 | Distributed memory Hash indexing method and system |
CN104834751A (en) * | 2015-05-28 | 2015-08-12 | 成都艺辰德迅科技有限公司 | Data analysis method based on Internet of things |
CN104834557A (en) * | 2015-05-18 | 2015-08-12 | 成都博元科技有限公司 | Data analysis method based on Hadoop |
CN109726252A (en) * | 2018-12-29 | 2019-05-07 | 税友软件集团股份有限公司 | A kind of data managing method and relevant apparatus of distributed data collection |
-
2019
- 2019-06-21 CN CN201910543604.3A patent/CN110347886B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110246460A1 (en) * | 2010-03-31 | 2011-10-06 | Cloudera, Inc. | Collecting and aggregating datasets for analysis |
CN104156380A (en) * | 2014-03-04 | 2014-11-19 | 深圳信息职业技术学院 | Distributed memory Hash indexing method and system |
CN104834557A (en) * | 2015-05-18 | 2015-08-12 | 成都博元科技有限公司 | Data analysis method based on Hadoop |
CN104834751A (en) * | 2015-05-28 | 2015-08-12 | 成都艺辰德迅科技有限公司 | Data analysis method based on Internet of things |
CN109726252A (en) * | 2018-12-29 | 2019-05-07 | 税友软件集团股份有限公司 | A kind of data managing method and relevant apparatus of distributed data collection |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110351079A (en) * | 2019-07-09 | 2019-10-18 | 政采云有限公司 | Tripartite's decryption method based on set membership verifying |
CN110351079B (en) * | 2019-07-09 | 2022-03-01 | 政采云有限公司 | Three-party decryption method based on parent-child relationship verification |
Also Published As
Publication number | Publication date |
---|---|
CN110347886B (en) | 2022-03-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Popovic et al. | A multi-objective algorithm for distribution networks restoration | |
CN103870659B (en) | A kind of fault of numerical control machine tool analyzes method | |
Liu et al. | Diagnosability of fuzzy discrete-event systems: A fuzzy approach | |
Bar-Hillel et al. | Spike sorting: Bayesian clustering of non-stationary data | |
CN103678583B (en) | The method and system that structural data compares | |
WO2021139317A1 (en) | Data feature enhancement method and apparatus for corpus data, computer device, and storage medium | |
CN105912844A (en) | Method and device for evaluating gas supply reliability of natural gas pipeline network | |
CN106021062A (en) | A relevant failure prediction method and system | |
CN105825045B (en) | Phased mission systems can repair spare parts demand Forecasting Methodology | |
CN110347886A (en) | Distributed set membership element lookup method | |
CN115329669A (en) | Power system transient stability evaluation method based on deep Bayes active learning | |
Zhong et al. | Robust fault detection of Markovian jump systems | |
CN105406462A (en) | PMU configuration method based on system topology model | |
Li et al. | A Region-Based Approach for the Operational Reliability Evaluation of Power Systems with Renewable Energy Integration | |
CN109634979A (en) | Data-updating method and device | |
CN108829987A (en) | A kind of data driven type probability evaluation method of failure | |
CN108459920A (en) | A kind of identification of test data outlier and modification method | |
CN107908557B (en) | Embedded software credible attribute modeling and verifying method | |
Zhang et al. | Predicting for MTBF failure data series of software reliability by genetic programming algorithm | |
CN103106323B (en) | Obtain method and the device of the structure descriptor of figure | |
Aichernig et al. | Fault-based test case generation for component connectors | |
CN110347681A (en) | Set membership element lookup method | |
CN114386510A (en) | Method and system for identifying measurement errors of power system | |
CN110110436B (en) | Intelligent pipe distribution method based on BIM technology | |
Stadler et al. | An inter-area oscillation based approach for coherency identification in power systems |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |