CN105589973A - Efficient blacklist search method - Google Patents

Efficient blacklist search method Download PDF

Info

Publication number
CN105589973A
CN105589973A CN201610029766.1A CN201610029766A CN105589973A CN 105589973 A CN105589973 A CN 105589973A CN 201610029766 A CN201610029766 A CN 201610029766A CN 105589973 A CN105589973 A CN 105589973A
Authority
CN
China
Prior art keywords
character
blacklist
row
coupling
list
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
Application number
CN201610029766.1A
Other languages
Chinese (zh)
Inventor
魏伟
陈祥献
商茎正
陈小勇
虞华锋
冯国平
程露露
谢爱文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Weirong Electronic Co Ltd
Original Assignee
Zhejiang Weirong Electronic Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Weirong Electronic Co Ltd filed Critical Zhejiang Weirong Electronic Co Ltd
Priority to CN201610029766.1A priority Critical patent/CN105589973A/en
Publication of CN105589973A publication Critical patent/CN105589973A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/90335Query processing
    • G06F16/90344Query processing by using string matching techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (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 an efficient blacklist search method. According to the method, blacklists are ranked firstly; then a lowest matching position and a highest matching position are respectively taken for a common character and a wildcard (*) by using a bisection method; once the matched lowest or highest position is found, recursion is performed till the final line is searched; all matched blacklists are input if a matched character is found, if not, the blacklist is not searched. According to the method, searching and matching efficiencies are greatly improved, and inquiring time is reduced.

Description

A kind of efficient black list searching method
Technical field
The invention belongs to information security field, relate in particular to a kind of efficient black list searching method.
Background technology
Each RMB has hat font size, and serial number is the unique number of a piece of paper coin, prefixNumber is made up of numeral and capitalization, and length is ten.
Hat font size blacklist is divided into the serial number of counterfeit money feature, steals the serial number of robbing coin, or otherThe serial number that need to screen and tackle. A currency counting and detecting machine, the cashes such as cleaning-sorting machine or ATM are establishedStandby storage inside can be stored the above blacklist of hundreds of thousands, and this class cash equipment, has CIS image scanningModule, the picture of scanning can identify the serial number of RMB by embedded software, obtain being preced with font sizeAfter code, plug-in is searched for the blacklist record of storage, finds that there is the record of coupling, just tackles alsoMake prompting. The speed of cash device enumerates bank note is generally 900 to 1500 per minute, with 1500Open maximum value calculation, process the time of every bank note and only have 66 milliseconds to 40 milliseconds, can leave prefix forTime of number search and interception just still less, is generally no more than 8 milliseconds, and cash equipment performance is the poorestBe category-A paper money counter, be generally the CPU of 500MHZ left and right, this searching algorithm to blacklist proposesVery high request. Blacklist is divided into not with asterisk wildcard (*) with the blacklist of asterisk wildcard (*), logicalJoin symbol and indicate that this position is Any Digit and letter. Blacklist example is as follows:
FR11010951 Robber robs coin
HD29****** Counterfeit money
HD26****** Counterfeit money
CX20087777 Robber robs
DC6896**** Robber robs coin
CT16075898 Counterfeit money
TW762***** Other
Existing hat font size blacklist searching method is the whole blacklist list of traversal, coupling character, ifThere is completely one of coupling just to record, continue coupling character, to the last a blacklist. ExistingBlacklist searching method is compared often, and query time is of a specified duration.
Summary of the invention
The object of the invention is to for the deficiencies in the prior art, a kind of efficient black list searcher is providedMethod. When it is applied in the search of hat font size blacklist, applicable to low CPU equipment, blacklist row simultaneouslyTable can be supported asterisk wildcard, and blacklist quantity can support that more than 500,000 search time is much smaller than permission5 milliseconds of times, can be applied on the smaller equipment of this cpu resource of category-A paper money counter.
For addressing the above problem, technical solution of the present invention is as follows: a kind of efficient black list searching method, and shouldMethod comprises the steps:
(1) number to be matched of input.
(2) obtain initial blacklist list; Described blacklist is made up of common character, or by common wordSymbol and asterisk wildcard composition; Described common character is letter or number; Described asterisk wildcard is special with * or otherCharacter representation, represents the corresponding letter or number arbitrarily in this position.
(3) the initial blacklist list of step 2 being obtained is carried out ascending order or falls according to the ASII value of characterOrder sequence, obtains the blacklist list that sorts.
(4) arrange and search sequence blacklist list first row.
(5) extreme lower position of searching the common character of coupling in sequence blacklist list the 1st row.
(6) in sequence blacklist list the 1st row, search the highest character that mates common character.
(7) extreme lower position of searching coupling asterisk wildcard (*) in sequence blacklist list the 1st row.
(8) extreme higher position of searching coupling asterisk wildcard (*) in sequence blacklist list the 1st row.
(9) recurrence execution step 5 to 8, as long as wherein find coupling, searches the black name of sequence just arrangeThe row of single-row table number increase progressively 1, to the last row.
(10) find coupling character at last row of sequence blacklist list, the black of coupling is describedList, exports this blacklist, otherwise explanation is without the blacklist of coupling.
Further, the method for searching extreme lower position coupling character in sequence blacklist row, specific as follows:
Input number to be matched, original position start=0 is set, end position end=blacklist list numberAmount-1.
Blacklist list has sequenced order, now searches rear certain the row coupling character of sequence, according to dichotomy, getsMid place, centre position character, mid=(original position start+ end position end)/2.
If centre position character ASII value is less than the number correspondence position character to be matched of input, establishPut original position start=mid+1, end invariant position, continues circulation searching.
If centre position character ASII value is greater than the number correspondence position character to be matched of input, establishPut original position end=mid-1, start invariant position, continues circulation searching.
If centre position character ASII value equals the number correspondence position character to be matched of input, andLast position, centre position character ASII value is not equal to the number correspondence position character to be matched of input,Find extreme lower position, output extreme lower position; Otherwise end position end=mid-1 is set, start positionPut constant, continue circulation searching.
Further, the maximum character comparison number of times M computing formula of the method is as follows:
M=log(2)(N)×L×4
Wherein N is blacklist list quantity, and L is blacklist length, and 4 is maximum 4 times of each row employingDichotomy calculates coupling character position.
Further, described blacklist is RMB hat font size blacklist, and length is 10.
The invention has the beneficial effects as follows: the present invention proposes a kind of high efficiency method of blacklist search coupling, logicalCross the ASII value of blacklist is sorted, adopt dichotomy to search for respectively coupling blacklist first row generalLogical character and asterisk wildcard, search rear recursive search next column, and dichotomy and recursive search minimize characterNumber of times relatively, has greatly improved the efficiency that search is mated, and reduces query time.
Brief description of the drawings
Fig. 1 is efficient black list searching method main flow chart of the present invention;
Fig. 2 need look for extreme lower position to mate the method for common character.
Detailed description of the invention
Below in conjunction with drawings and Examples, technical solution of the present invention is described in further details, below implementsExample does not form limitation of the invention.
General thought of the present invention is by first blacklist list being sorted, and can adopt two points after sequenceMethod is got respectively minimum matched position and the highest matched position to common character and asterisk wildcard (*), once energyFind the minimum or extreme higher position of coupling to carry out recurrence, until search last row, if coupling is justExport all coupling blacklists; Otherwise illustrate and do not search blacklist.
As an example of the search of RMB hat font size blacklist example, method of the present invention is further elaborated below.
As shown in Figure 1, the inventive method comprises the following steps:
(1) a RMB serial number to be matched of input.
(2) obtain initial blacklist list; Described blacklist is made up of common character, or by common wordSymbol and asterisk wildcard composition; Described common character is letter or number; Described asterisk wildcard represents with *, representativeThe corresponding letter or number arbitrarily in this position.
(3) the initial blacklist list of step (2) being obtained is carried out ascending order according to the ASII value of characterSequence, obtains the blacklist list that sorts, as in the table below:
Sequence number Blacklist list (ascending order)
1 AA03679868
2 AB........
3 AC........
4 A*........
5 A*........
6 B.........
... ..........
100001 M.........
100002 M.........
... ..........
101001 *.........
101002 *.........
101003 *.........
(4) arrange and search sequence blacklist list first row.
(5) extreme lower position of searching the common character of coupling in sequence blacklist list the 1st row.
(6) in sequence blacklist list the 1st row, search the highest character that mates common character.
(7) extreme lower position of searching coupling asterisk wildcard (*) in sequence blacklist list the 1st row.
(8) extreme higher position of searching coupling asterisk wildcard (*) in sequence blacklist list the 1st row.
(9) recurrence execution step 5 to 8, as long as wherein find coupling, searches the black name of sequence just arrangeThe row of single-row table number increase progressively 1, to the last row.
(10) find coupling character at last row of sequence blacklist list, the black of coupling is describedList, exports this blacklist, otherwise explanation is without the blacklist of coupling.
It is the comparison of character that maximum CPU of blacklist searching method consume. Taking blacklist list 100,000 asExample, high specific is to number of times M=log (2) (100000) × 10 × 4 ≈ 680 times; With blacklist list one1000000 is example, and high specific is to number of times M=log (2) (1000000) × 10 × 4 ≈ 1360 times.
Fig. 2 shows the method that has proposed the extreme lower position of searching the common character of coupling, comprises the following steps:
(1) input needs the serial number of comparison, original position start=0 is set, end position end=Blacklist list quantity-1.
(2) blacklist list has sequenced order, now searches rear certain the row coupling character of sequence, according to two pointsMethod, gets centre position (mid=(original position start+ end position end)/2) character.
(3) if described intermediate character ASII value is less than described serial number correspondence position character,Original position start=mid+1 is set, and end invariant position, continues circulation searching.
(4) if described intermediate character ASII value is greater than described serial number correspondence position character,Original position end=mid-1 is set, and start invariant position, continues circulation searching.
(5) if described intermediate character ASII value equals described serial number correspondence position character,And last position, described centre position character ASII value is not equal to described serial number correspondence position wordSymbol, finds extreme lower position, output extreme lower position; Otherwise end position end=mid-1 is set, startInvariant position, continues circulation searching.
Above embodiment, only in order to technical scheme of the present invention to be described but not be limited, is not deviating fromIn the situation of spirit of the present invention and essence thereof, those of ordinary skill in the art are when making according to the present inventionVarious corresponding changes and distortion, but these corresponding changes and distortion all should belong to the appended power of the present inventionThe protection domain that profit requires.

Claims (4)

1. an efficient black list searching method, is characterized in that, the method comprises the steps:
(1) number to be matched of input.
(2) obtain initial blacklist list; Described blacklist is made up of common character, or by common wordSymbol and asterisk wildcard composition; Described common character is letter or number; Described asterisk wildcard is special with * or otherCharacter representation, represents the corresponding letter or number arbitrarily in this position.
(3) the initial blacklist list of step 2 being obtained is carried out ascending order or falls according to the ASII value of characterOrder sequence, obtains the blacklist list that sorts.
(4) arrange and search sequence blacklist list first row.
(5) extreme lower position of searching the common character of coupling in sequence blacklist list the 1st row.
(6) in sequence blacklist list the 1st row, search the highest character that mates common character.
(7) extreme lower position of searching coupling asterisk wildcard (*) in sequence blacklist list the 1st row.
(8) extreme higher position of searching coupling asterisk wildcard (*) in sequence blacklist list the 1st row.
(9) recurrence execution step 5 to 8, as long as wherein find coupling, searches the black name of sequence just arrangeThe row of single-row table number increase progressively 1, to the last row.
(10) find coupling character at last row of sequence blacklist list, the black of coupling is describedList, exports this blacklist, otherwise explanation is without the blacklist of coupling.
2. a kind of efficient black list searching method according to claim 1, is characterized in that, in sequenceIn blacklist row, search the method for the extreme lower position of the common character of coupling, specific as follows:
Input number to be matched, original position start=0 is set, end position end=blacklist list numberAmount-1.
Blacklist list has sequenced order, now searches rear certain the row coupling character of sequence, according to dichotomy, getsMid place, centre position character, mid=(original position start+ end position end)/2.
If centre position character ASII value is less than the number correspondence position character to be matched of input, establishPut original position start=mid+1, end invariant position, continues circulation searching.
If centre position character ASII value is greater than the number correspondence position character to be matched of input, establishPut original position end=mid-1, start invariant position, continues circulation searching.
If centre position character ASII value equals the number correspondence position character to be matched of input, andLast position, centre position character ASII value is not equal to the number correspondence position character to be matched of input,Find extreme lower position, output extreme lower position; Otherwise end position end=mid-1 is set, start positionPut constant, continue circulation searching.
In sequence blacklist row, search the extreme higher position of the common character of coupling method, search coupling wildcardThe method of the extreme lower position of symbol (*) is all the same with the method for searching the extreme lower position of mating asterisk wildcard (*).
3. a kind of efficient black list searching method according to claim 1, is characterised in that, the methodMaximum character comparison number of times M computing formula is as follows:
M=log(2)(N)×L×4
Wherein N is blacklist list quantity, and L is blacklist length, and 4 is maximum 4 times of each row employingDichotomy calculates coupling character position.
4. a kind of efficient black list searching method according to claim 1, is characterised in that, described black nameSingle is RMB hat font size blacklist, and length is 10.
CN201610029766.1A 2016-01-17 2016-01-17 Efficient blacklist search method Pending CN105589973A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610029766.1A CN105589973A (en) 2016-01-17 2016-01-17 Efficient blacklist search method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610029766.1A CN105589973A (en) 2016-01-17 2016-01-17 Efficient blacklist search method

Publications (1)

Publication Number Publication Date
CN105589973A true CN105589973A (en) 2016-05-18

Family

ID=55929552

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610029766.1A Pending CN105589973A (en) 2016-01-17 2016-01-17 Efficient blacklist search method

Country Status (1)

Country Link
CN (1) CN105589973A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106407299A (en) * 2016-08-31 2017-02-15 东方通信股份有限公司 Banknote crown word number blacklist data storage and retrieval methods supporting wildcard characters
CN115589590A (en) * 2022-10-27 2023-01-10 上海创蓝云智信息科技股份有限公司 System, method, electronic equipment and storage medium for efficiently filtering short message blacklist

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070239752A1 (en) * 2006-04-11 2007-10-11 Beitman Bruce A Fuzzy alphanumeric search apparatus and method
CN101110077A (en) * 2007-08-24 2008-01-23 新诺亚舟科技(深圳)有限公司 Method for implementing associated searching on handhold learning terminal
CN101197967A (en) * 2007-12-27 2008-06-11 上海全景数字技术有限公司 Digital television information searching method
CN101876989A (en) * 2009-12-07 2010-11-03 公安部交通管理科学研究所 High-speed matching method of mass blacklists containing wildcards
CN101986672A (en) * 2010-11-08 2011-03-16 中兴通讯股份有限公司 Message processing method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070239752A1 (en) * 2006-04-11 2007-10-11 Beitman Bruce A Fuzzy alphanumeric search apparatus and method
CN101110077A (en) * 2007-08-24 2008-01-23 新诺亚舟科技(深圳)有限公司 Method for implementing associated searching on handhold learning terminal
CN101197967A (en) * 2007-12-27 2008-06-11 上海全景数字技术有限公司 Digital television information searching method
CN101876989A (en) * 2009-12-07 2010-11-03 公安部交通管理科学研究所 High-speed matching method of mass blacklists containing wildcards
CN101986672A (en) * 2010-11-08 2011-03-16 中兴通讯股份有限公司 Message processing method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106407299A (en) * 2016-08-31 2017-02-15 东方通信股份有限公司 Banknote crown word number blacklist data storage and retrieval methods supporting wildcard characters
CN115589590A (en) * 2022-10-27 2023-01-10 上海创蓝云智信息科技股份有限公司 System, method, electronic equipment and storage medium for efficiently filtering short message blacklist

Similar Documents

Publication Publication Date Title
CN102801709B (en) Phishing website identification system and method
CN102750379B (en) Fast character string matching method based on filtering type
WO2010135082A1 (en) Localized weak bit assignment
CN102880650A (en) Data matching method and device
CN103324886B (en) A kind of extracting method of fingerprint database in network intrusion detection and system
CN105335402A (en) Search method, index data generation method and device on the basis of static Cache
CN102867049A (en) Chinese PINYIN quick word segmentation method based on word search tree
Su et al. A New RFID Anti‐collision Algorithm Based on the Q‐Ary Search Scheme
CN105024987A (en) Web service log monitoring method and apparatus
CN105335481A (en) Large scale character string text suffix index building method and device
CN105589973A (en) Efficient blacklist search method
CN104317946A (en) Multi-key image-based image content retrieval method
CN107180079A (en) The image search method of index is combined with Hash based on convolutional neural networks and tree
CN101515286A (en) Image matching method based on image feature multi-level filtration
CN102314464A (en) Lyrics searching method and lyrics searching engine
CN112887343B (en) Management system and management method for network big data
US11429819B2 (en) Packer classification apparatus and method using PE section information
CN103186772A (en) Face recognition system and method based on cluster framework
CN101261645B (en) Method and apparatus for obtaining multiple layer information
CN102521357A (en) System and method for achieving accurate matching of texts by automaton
CN116467685A (en) Embedding and extracting method for reversible database watermark
CN114429355A (en) Method, device, medium and equipment for generating identification characteristics of abnormal registration event
CN114841256A (en) DGA domain name classification method based on multi-dimensional feature fusion
CN106250440A (en) Document management method and device
CN104731784A (en) Method, system and mobile terminal for visual search

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20160518