CN109996232A - Method, apparatus, equipment and the medium of authentication message legitimacy identification - Google Patents

Method, apparatus, equipment and the medium of authentication message legitimacy identification Download PDF

Info

Publication number
CN109996232A
CN109996232A CN201711494742.4A CN201711494742A CN109996232A CN 109996232 A CN109996232 A CN 109996232A CN 201711494742 A CN201711494742 A CN 201711494742A CN 109996232 A CN109996232 A CN 109996232A
Authority
CN
China
Prior art keywords
authentication message
template
character
characteristic information
string
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
CN201711494742.4A
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.)
China Mobile Communications Group Co Ltd
China Mobile Group Liaoning Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Group Liaoning 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 China Mobile Communications Group Co Ltd, China Mobile Group Liaoning Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201711494742.4A priority Critical patent/CN109996232A/en
Publication of CN109996232A publication Critical patent/CN109996232A/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/30Network architectures or network communication protocols for network security for supporting lawful interception, monitoring or retaining of communications or communication related information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/12Detection or prevention of fraud
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/12Messaging; Mailboxes; Announcements
    • H04W4/14Short messaging services, e.g. short message services [SMS] or unstructured supplementary service data [USSD]

Abstract

The embodiment of the invention discloses method, apparatus, equipment and the media of a kind of identification of authentication message legitimacy, should be this method comprises: searching to authentication message sending port;The characteristic information of each template under the port is extracted and preserved;According to the characteristic information of each template, determine with to the corresponding template of authentication message;Match cognization is carried out with corresponding template to authentication message, if match cognization success, legal to authentication message;It is illegal to authentication message if match cognization is unsuccessful.For the embodiment of the present invention by extracting the characteristic information of template and using memorandum thought, the matching times for reaching template are few, improve the effect of match cognization algorithm performance.

Description

Method, apparatus, equipment and the medium of authentication message legitimacy identification
Technical field
A kind of identified the present invention relates to data service technical field more particularly to authentication message legitimacy method, apparatus, Equipment and medium.
Background technique
The rapid development of today's society internet communication, point-to-point note business are increasingly cut down, but with mobile mutual The rapid development of networking is just flourishing like the mushrooms after rain as using the essential industry message of link, such as: verifying Code, member's notice, payment prompting, logistic track, electric business platform, ticket information etc., it has also become essential in internet+system A part, but the problem of also bring many industry port classes at the same time and risk, it is short such as to send promotion class wantonly There are over range to send situation etc. for letter, port, causes greatly to perplex to user, therefore carries out the development of industry message and control Tradeoff, becomes and pays close attention to one of subject under discussion instantly.
The transmission content of port has a medelling mostly, thus can by way of configuration template come management port, when When the transmission content of port is not consistent with the template of configuration, it can be prevented to issue, by templating management, can more effectively controlled Class refuse messages in port processed.
Complete template types identification, asterisk wildcard template types is supported to identify two ways the identification of short message content:
Identified using complete template types: short message content need to be completely the same with enrollment content.
Identified using asterisk wildcard template types: short message content is in completely the same at template content plaintext in plain text, short Letter content other parts need to meet the asterisk wildcard rule of template corresponding position setting,? number representing any character includes Chinese character, number Word and English character,!Number English character and number are represented, No. # represents Chinese character.Rule is bracketed with [] number, citing: [2-4#] Represent 2 to 4 Chinese characters;[6!] represent 6 English or number;[3? ] represent 3 any characters.Such as: message template are as follows: respect [2-4#], you are good: your cell-phone number [11!] Modify password success, identifying code is [4-6!], it is understood that!Short message content are as follows: Distinguished Mr. Wang, you are good: your 13800000000 Modify password of cell-phone number success, identifying code is ABCD, it is understood that!More than Can be with successful match, if successful match, short message is identified as release status;It is on the contrary then be identified as interception state.
The storage organization of port template uses the form of " prefix trees+chained list ", as shown in Figure 1, the major key of tree is port, Node is chained list, Template Information all under the same port is stored inside chained list, to all differences sent to the port Type short message carries out state recognition, as soon as every new registration template, is inserted into gauge outfit for the template.
When treating authentication message state and being identified, the way of prior art are as follows: searched in tree construction first This waits for the sending port of authentication message, locks corresponding template chained list.Then since the chained list gauge outfit, each section is successively traversed Point, as soon as node is often accessed, the template and short message content that this node is saved carry out match cognization, if matching returns to knot Fruit is failure, then carries out traversal next node, equally operated, until matching is returned the result as success or traversed to chained list Until tail portion.
Whenever needing authentication message arrival, need matched template number excessive.Due to the mould of same port configuration Plate uses storage of linked list, therefore when needing authentication message and sending over, which template can not be learnt use to the message Differentiated, needed message content and be stored in each of chained list template progress match cognization one by one, if correct mould Plate has been stored in the last one position of chained list, if the length of chained list is N, then needing to be traversed for entire chained list could be to the message Content is correctly differentiated, the load of program is virtually increased.
The advantages of core identification algorithm of the prior art is matched using traditional canonical, is done so is simple, intuitive, core Recognizer performance it is lower.But the time complexity of traditional canonical matching algorithm is index rank, in this way, template length, Under message content length and the increased situation of wildcard quantity, the time-consuming of index level algorithm can be with these factor exponentially grades Increase, be unable to satisfy the practical performance requirement in the operation of existing net, real-time is poor.
Need matched template number excessive in conclusion the prior art exists, program charge is larger, recognizer performance It is lower, the poor problem of real-time.
Summary of the invention
The embodiment of the invention provides method, apparatus, equipment and the media of a kind of identification of authentication message legitimacy, for solving Certainly in the prior art to need matched template number excessive, program charge is larger, and recognizer performance is lower, and real-time is poor The problem of.
In a first aspect, the embodiment of the invention provides a kind of authentication message legitimacies to know method for distinguishing, method includes:
It searches to authentication message sending port;
The characteristic information of each template under the port is extracted and preserved;
According to the characteristic information of each template, determine with to the corresponding template of authentication message;
Match cognization is carried out with corresponding template to authentication message, if match cognization success, legal to authentication message; It is illegal to authentication message if match cognization is unsuccessful.
Second aspect, the embodiment of the invention provides a kind of device of authentication message legitimacy identification, device includes:
Searching module, for searching to authentication message sending port;
Extraction module, for the characteristic information of each template under the port to be extracted and preserved;
Determination module, for the characteristic information according to each template, determine with to the corresponding template of authentication message;
Match cognization module, for carrying out match cognization with corresponding template to authentication message, if match cognization success, It is then legal to authentication message;It is illegal to authentication message if match cognization is unsuccessful.
The embodiment of the invention provides a kind of equipment of authentication message legitimacy identification, comprising: at least one processor, extremely A few memory and computer program instructions stored in memory, when computer program instructions are executed by processor Realize the method such as first aspect in above embodiment.
Fourth aspect, the embodiment of the invention provides a kind of computer readable storage mediums, are stored thereon with computer journey The method such as first aspect in above embodiment is realized in sequence instruction when computer program instructions are executed by processor.
Method, apparatus, equipment and the medium of authentication message legitimacy identification provided in an embodiment of the present invention, have following product Pole effect;
(1) present invention is quickly navigated to by the exclusive characteristic information of each template of extraction to the corresponding mould of authentication message Plate reduces matching times, and then reduces the load of program.
(2) present invention is recorded the location status having stepped through before, by utilizing memorandum thought in next time When traversing same state, corresponding result out can be corresponded to directly from memorandum and is directly returned, the traversal of new state is carried out. From the perspective of entire search tree, this algorithm greatly reduces the traversal to the branches and leaves of search tree, improves algorithm performance.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, will make below to required in the embodiment of the present invention Attached drawing is briefly described, for those of ordinary skill in the art, without creative efforts, also Other drawings may be obtained according to these drawings without any creative labor.
Fig. 1 shows the storage organization of template in the prior art;
Fig. 2 shows the flow charts that a kind of authentication message legitimacy of one embodiment of the invention knows method for distinguishing;
Fig. 3 shows the linear slide extraction algorithm schematic diagram of one embodiment of the invention;
Fig. 4 shows a kind of schematic device of authentication message legitimacy identification of one embodiment of the invention;
Fig. 5 shows the algorithm and traditional algorithm performance comparison figure of one embodiment of the invention;
Fig. 6 shows the hardware configuration signal of the equipment of the authentication message legitimacy identification of one embodiment of the invention offer Figure;
Fig. 7 (a) has gone out the partial schematic diagram of the character string fast search algorithm search of one embodiment of the invention;
Fig. 7 (b) has gone out the partial schematic diagram of the character string fast search algorithm search of one embodiment of the invention;
Fig. 7 (c) has gone out the partial schematic diagram of the character string fast search algorithm search of one embodiment of the invention;
Fig. 7 (d) has gone out the partial schematic diagram of the character string fast search algorithm search of one embodiment of the invention;
Fig. 7 (e) has gone out the partial schematic diagram of the character string fast search algorithm search of one embodiment of the invention;
Fig. 7 (f) has gone out the partial schematic diagram of the character string fast search algorithm search of one embodiment of the invention;
Fig. 8 (a) has gone out the part signal of the schematic diagram of the pattern string search based on auxiliary flow table of one embodiment of the invention Figure;
Fig. 8 (b) has gone out the part signal of the schematic diagram of the pattern string search based on auxiliary flow table of one embodiment of the invention Figure;
Fig. 8 (c) has gone out the part signal of the schematic diagram of the pattern string search based on auxiliary flow table of one embodiment of the invention Figure;
Fig. 8 (d) has gone out the part signal of the schematic diagram of the pattern string search based on auxiliary flow table of one embodiment of the invention Figure;
Fig. 9 shows the schematic diagram of each position element characterization of flow table help of one embodiment of the invention;
The part searched for by taking short message content string and template content string as an example that Figure 10 (a) shows one embodiment of the invention shows It is intended to;
The part searched for by taking short message content string and template content string as an example that Figure 10 (b) shows one embodiment of the invention shows It is intended to;
The part searched for by taking short message content string and template content string as an example that Figure 10 (c) shows one embodiment of the invention shows It is intended to;
The part searched for by taking short message content string and template content string as an example that Figure 10 (d) shows one embodiment of the invention shows It is intended to.
Specific embodiment
The feature and exemplary embodiment of various aspects of the invention is described more fully below, in order to make mesh of the invention , technical solution and advantage be more clearly understood, with reference to the accompanying drawings and embodiments, the present invention is further retouched in detail It states.It should be understood that specific embodiment described herein is only configured to explain the present invention, it is not configured as limiting the present invention. To those skilled in the art, the present invention can be real in the case where not needing some details in these details It applies.Below the description of embodiment is used for the purpose of better understanding the present invention to provide by showing example of the invention.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence " including ... ", it is not excluded that including There is also other identical elements in the process, method, article or equipment of the element.
In the prior art, complete template types identification, asterisk wildcard template types identification two are supported to the identification of short message content Kind mode: one, identified using complete template types: short message content need to be completely the same with enrollment content;Two, using logical Identified with symbol template types: short message content is in completely the same, short message content other parts at template content plaintext in plain text Need to meet the asterisk wildcard rule of template corresponding position setting.
The identification of existing short message legitimacy there are the problem of have: 1) whenever needing authentication message and arriving, need matched mould Plate number is excessive, and needing to be traversed for entire chained list could correctly be differentiated that program charge is larger to the message content;2) existing The core identification algorithm of technology is matched using traditional canonical, but traditional canonical matching algorithm, long in template length, message content Under degree and the increased situation of wildcard quantity, real-time is poor.
Invention utilizes memorandum thought by extracting the exclusive characteristic information of each template, solves in the prior art Need matched template number excessive, program charge is larger, and recognizer performance is lower, the poor problem of real-time.
Fig. 2 shows the flow charts that a kind of authentication message legitimacy of one embodiment of the invention knows method for distinguishing, comprising:
S110: it searches to authentication message sending port.
S120: the characteristic information of each template under the port is extracted and preserved;
S130: according to the characteristic information of each template, determine with to the corresponding template of authentication message;
S140: carrying out match cognization with corresponding template to authentication message, if match cognization success, to authentication message It is legal;It is illegal to authentication message if match cognization is unsuccessful.
In some embodiments, to authentication message can be short message, identifying code, member notice, payment remind, logistics with Track, electric business platform and ticket information, characteristic information are the longest Chinese character string to authentication message.
In step s 110, specifically, searching in tree construction to authentication message sending port, the transmission content of port is big There is medelling, therefore can be by way of configuration template come management port, when the transmission content of port and the mould of configuration more When plate is not consistent, it can be prevented to issue, it, can more effective control port class refuse messages by templating management.
In the step s 120, the characteristic information of each template under the port is extracted and preserved, specifically: use linear slide The longest Chinese character string of each template under the port is extracted and preserved in scanning algorithm.
Before carrying out main matching task, the longest Chinese character string of each template is first extracted and is stored by we, and and they Respective template establishes index relative.All templates that this algorithm is used to configure each port carry out the pumping of longest Chinese character string It takes.Fig. 3 shows the linear slide extraction algorithm schematic diagram of one embodiment of the invention, and algorithm principle combination Fig. 3 is illustrated
As shown in figure 3, using two pointers left and right, the two when extracting longest Chinese character string in the template string of source A linear slide window is formed, which is determined by the length of the continuous characters string occurred in template string.Firstly, using one A global variable max saves the length of the longest Chinese character string in the template string, is initialized as zero, is constantly updated to max; Reuse global variable pos and save the first place for Chinese character string occur every time and set, same initial value be zero, pos with max more Newly.When original state, left and right pointer is directed to template string initial character, and then, the trend of left and right pointer is determined Plan by following several situations,
1. if left pointer keeps original position, and right pointer slides to the right the character that right pointer is directed toward is Chinese character;
If calculating right-left and compared with max 2. the character that right pointer is directed toward is not chinese character, if Right-left is then assigned to max, and left is assigned to pos by left-right > max, is finally assigned to right left;
3. entire algorithmic procedure terminates when right slides into the last character of template string.
At this point, max has saved the length of longest Chinese character string, and pos then saves the starting position of longest Chinese character string, Need to only make primary copy can extract longest Chinese character string.
Entire algorithmic procedure is analyzed it is found that left and right pointer never retracts in entire extraction process, when When right pointer is directed toward the end of template string, extraction process terminates.Therefore the time complexity of the algorithm is O (M), wherein M is Template string length, is the complexity of a linear session, and does not need any secondary data structure.That is: this algorithm only need to be to mould Plate string traverses the characteristic information that can once extract the template, and compared with traditional extraction algorithm, this linear slide, which extracts, to be calculated Method speed improves a magnitude.It is tested through existing net, in the case where template string length is 135 byte, traditional extraction algorithm is mentioned Taking one needs time-consuming 0.0538s, and this linear slide extraction algorithm only needs 0.0005698s.
In step S130, according to the characteristic information of each template, determine with to the corresponding template of authentication message, specially Determined using the character string fast search algorithm based on pattern string information auxiliary flow table according to the characteristic information of each template With to the corresponding template of authentication message.
The purpose for designing this algorithm is the longest Chinese character string of the quickly search pattern in authentication message, so as to quick The message of finding out should matched template.
The character string fast search algorithm based on pattern string information auxiliary flow table that the present invention designs, core concept are as follows: In subject string before search pattern string, first generate a Zhang Liubiao, this table in preservation mode string some prefixes and suffix it is auxiliary Supplementary information, it is assumed that in search process, the preceding equal successful match of i character of pattern string, when i+1 character match fails, this The character string fast search algorithm of invention design can speed up search speed, shown in principle such as Fig. 7 (a).
Firstly, the first of the first character of source string BBC ABCDAB ABCDABCDABDE and pattern string ABCDABD A character, is compared.Because B and A is mismatched, pattern string moves back one, as shown in Fig. 7 (b).
Because B and A is mismatched, pattern string is past again to be moved back, as shown in Fig. 7 (c).
Like this, until character string has a character, until identical as the first character of pattern string, such as Fig. 7 (d) institute Show.
Then compare the character late of character string and pattern string or identical, until source string has a character, with Until the corresponding character of pattern string is not identical, as shown in Fig. 7 (e).
When space and D are mismatched, the algorithm of the fast search based on auxiliary flow table tries to have searched for using this Information, that is, be based on this pattern string ABCDABD, it is assumed that generated what a auxiliary flow table (auxiliary flow table generation behind be situated between Continue) it is as follows, as shown in Fig. 7 (f):
When space character and character D mismatch, by searching for generated auxiliary flow table, the last one matching character Help value in the corresponding flow table of B is 2, and the digit moved backward is calculated according to following formula:
Value in the corresponding auxiliary flow table of matched number of characters-mismatch character position of mobile digit=
Because front has matched 6 characters, and the value in the corresponding auxiliary flow table of character position of existing mismatch is 2, therefore: 6- 2 are equal to 4, so pattern string is moved backward 4, are then matched again.As shown in Fig. 8 (a):
Because space character and character C are mismatched, pattern string will also continue past move back.At this moment, matched number of characters is 2 (AB), auxiliary flow table respective value is 0.So pattern string is then moved back 2, such as by mobile digit=2- 0, result 2 Shown in Fig. 8 (b).
Because space character and character A are mismatched, continue to move back one, as shown in Fig. 8 (c).
Successive appraximation, until discovery character C and character D mismatch.Then, mobile digit=6-2, continues pattern string backward It is 4 mobile, as shown in Fig. 8 (d).
Successive appraximation, until last position of pattern string, discovery exact matching, then entire search process terminates.
The method for generating pattern string auxiliary flow table is described below, generating process is as follows:
Firstly, defining two concepts: the prefix and suffix of character string here.Prefix refers to: remove last character with Outside, whole beginning combinations of a character string;Suffix refers to: removing other than first character, whole tail portions of a character string Combination.
Assuming that pattern string model is ABCDABD, when generating pattern string auxiliary flow table, an auxiliary flow table is initialized first Help [M], wherein M-mode string length.By taking help [i] as an example, the meaning of each position element characterization of flow table help are as follows: help [i] is indicated, in the case that the substring of pattern string is ended up with model [i], the prefix of substring model [0 ... i] is identical as suffix Extreme length.It is as shown in Figure 9:
1) prefix of A and suffix are all empty, and the length of all identical elements is 0;
2) prefix of AB is [A], and suffix is [B], and the length of identical element is 0;
3) prefix of ABC is [A, AB], and suffix is [BC, C], the length 0 of identical element;
4) prefix of ABCD is [A, AB, ABC], and suffix is [BCD, CD, D], and the length of identical element is 0;
5) prefix of ABCDA is [A, AB, ABC, ABCD], and suffix is [BCDA, CDA, DA, A], and identical element A is long Degree is 1;
6) prefix of ABCDAB is [A, AB, ABC, ABCD, ABCDA], and suffix is [BCDAB, CDAB, DAB, AB, B], phase It is AB, length 2 with element;
7) prefix of ABCDABD be [A, AB, ABC, ABCD, ABCDA, ABCDAB], suffix be [BCDABD, CDABD, DABD, ABD, BD, D], the length of identical element is 0.
After generating auxiliary flow table, search process can be accelerated using this auxiliary flow table, specific accelerated method It has been described in detail in front, which is not described herein again.
It after tested, is in the case that 150 mode string length are 10 in subject string length, simple algorithm average operating time is 0.237s, the fast search algorithm average operating time that the present invention uses are 0.02454s.
In step S140, match cognization is carried out with corresponding template to authentication message, if match cognization success, to Authentication message is legal;It is illegal to authentication message if match cognization is unsuccessful.Specially to authentication message and corresponding template Carry out match cognization, comprising: memorandum formula scanning algorithm is used, carries out match cognization with corresponding template to authentication message, it is standby Forget record formula scanning algorithm to include: generation and initialize memorandum;During match cognization, corresponding template character is wildcard Symbol then enters recurrent state and is calculated, and in the result deposit memorandum of recurrent state, is based on memorandum storage result, completes Match cognization to authentication message and corresponding template.
Traditional template fuzzy matching algorithm is to enumerate search, and advantage is simple, intuitive, but long with short message content in template It spends in longer situation, algorithm can encounter very big bottleneck in aspect of performance, in order to avoid this problem, accelerate the algorithm speed of service, The present invention devises a kind of new memorandum formula scanning algorithm, the algorithm core concept are as follows:
Firstly, generating a memorandum before not matched really and initializing, then start to match.It is matching In the process, if in current template not being asterisk wildcard, compare whether correspond to character in message string equal with template current character, if It is equal, then current character is skipped, continues to match next character;If current template character is asterisk wildcard, entering part recurrence shape State is calculated, and at the end of this layer of recursive calculation, the result of this recurrent state is stored in memorandum, in this way, under again It is secondary that calculated state can be directly taken out before this from memorandum when encountering identical state, thus to recursive tree into The a large amount of beta prunings of row, greatly improve algorithm performance, can be by the original index rank time complexity O (M of algorithmN) dimensionality reduction is to multinomial Rank O (N2).Wherein, N is short message content length, and M is the maximum magnitude of asterisk wildcard, it can thus be seen that long in short message content Under degree and asterisk wildcard quantity and the increased situation of range, improved algorithm has extremely significant performance advantage such as Fig. 5 institute Show, Fig. 5 shows one embodiment of the invention and prior art performance comparison figure.Concrete methods of realizing are as follows:
Initialize a structure of container, the state crossed to save all recursive calculations, every time enter recursive calculation it Before, first searched in this container this state whether before this recursive calculation go out as a result, if having had as a result, directly tying this Fruit is back to one layer of recursive function stack, if not calculating, then carries out recursive calculation.Therefore, from the start and ending of search, Each element in this container has only traversed once, so that it may return to matching result.
Illustrate the accelerator of algorithm: assuming that existing following short message content and template, short message content character string Content are as follows: AXYZABCE;Template content character string model are as follows: A [1-2!][1- 2!]ABCD.Firstly, to recurrence above-mentioned State carries out one and gives a definition, and recurrent state here refers to: when short message content character string is started with i and template content character string With the matching result that j is when starting.Such as: when content strings content is opened with the 5th character beginning and template string with the 14th character Head when being matched as a result, at this point, recurrent state just is defined as: result [5] [14], as shown in Figure 10 (a).
By taking this short message content string and template content string as an example:
Firstly, first character is to successful match when corresponding to, template string and short message content string move backward a position at this time It sets, state result [2] [2] is converted by state result [1] [1], at this point, asterisk wildcard [1-2 occurs in template string!], then According to asterisk wildcard matching rule, can take herein content strings a character or two characters and template next position into Row matching, firstly, first asterisk wildcard part of the character X and template string that skip content strings carry out the meter of recurrent state It calculates, that is, is matched, found in template string, and encounter asterisk wildcard [1-2!], then one in content strings is skipped again Character Y, second asterisk wildcard part for skipping template string are matched, and matching status (recurrent state) at this time is, by content String content is started with Z to be matched with template string with A beginning, as shown in Figure 10 (b):
It can be seen that, hence it is evident that be unmatched, at this point, we with the memorandum that has been generated in advance record this pass Return state with template string with the 14th character as a result, namely starts content strings with the 4th character beginning when being matched, It as a result is mismatch.That is: result [4] [14]=mismatch is recorded.Followed by backtracking, in first wildcard bit of template Place is set, a character X of content strings is still skipped, but at second asterisk wildcard of template string, by skip content strings two A character YZ is matched, it may be assumed that content strings started to match with template string with A beginning with A, as shown in Figure 10 (c):
When being matched at second arrow, discovery character E and character D mismatch, at this point, this state is write memorandum again In, it may be assumed that record result [5] [14]=mismatch.Next, continuing backtracking scanning, at this point, at second of template string The all situations of the 1-2 character configured at asterisk wildcard, mismatch, so will be in first asterisk wildcard position of template Place, skips 2 character XY of content strings, skips a character Z at second asterisk wildcard position and matched, it may be assumed that by content strings Start to be matched with A with template string with A beginning, as shown in Figure 10 (d):
This state with a upper matching status be it is identical, according to the aforementioned definition to recurrent state, this state are as follows: Result [5] [14], and it is aforementioned we be computed this state, and be stored in our memorandum, at this point, we It can no longer be calculated completely, directly using the state outcome recorded in memorandum, and then enter next time faster Match, the effective matching length for promoting content strings and template string.That is, immediately entering the calculating of [6] [14] result.
Fig. 5 shows the algorithm and traditional algorithm performance comparison figure of one embodiment of the invention, is scanned using this memorandum formula Algorithm carries out the match cognization of short message content and template, and after tested, the algorithm and traditional algorithm performance map are as shown in Figure 5.
When needing authentication message and sending over, it will can quickly orient the corresponding template of this message and match.? On the basis of this, matched calculating speed between template and short message is accelerated using foregoing description memorandum formula scanning algorithm, reaches fast Speed identifies the purpose that message content should let pass or intercept.In this way, optimization performance, program operation speed are significantly mentioned It rises, existing network environment core8 core machine, dominant frequency 2.4GHZ, memory 32GB, single thread.After tested, the place of original scheme message identification Reason ability is 1500~1700/second;Message identifying processing ability of the invention is 9000~12000/second.Using voluntarily The memorandum formula scanning algorithm of design, by original exponential other time complexity algorithm dimensionality reduction to multinomial rank, through surveying Examination, the more original algorithm of performance improve 6~8 times.
The present invention proposes: by the way that the longest Chinese character string in each template is numbered, establishing longest Chinese character string-number- The corresponding relationship of template searches for the longest of each template using the character string fast search algorithm of pattern string information auxiliary flow table Chinese character string, direct index corresponding templates, realization and the match cognization to authentication message content, and memorandum thought is utilized, When traversing the location status having stepped through recorded in memorandum, matching result is directly returned.
Longest Chinese character string of the present invention by each template of search, direct index corresponding templates, quick lock in template are reduced Useless matching times, and when carrying out the matching of template and message content, it, will be original using memorandum formula scanning algorithm Exponential other time complexity algorithm dimensionality reduction accelerates matching efficiency to multinomial rank.
Fig. 6 shows the hardware structural diagram of the equipment of authentication message legitimacy identification provided in an embodiment of the present invention.
The equipment of authentication message legitimacy identification may include processor 401 and be stored with depositing for computer program instructions Reservoir 402.
Specifically, above-mentioned processor 401 may include central processing unit (CPU) or specific integrated circuit (Application Specific Integrated Circuit, ASIC), or may be configured to implement implementation of the present invention One or more integrated circuits of example.
Memory 402 may include the mass storage for data or instruction.For example it rather than limits, memory 402 may include hard disk drive (Hard Disk Drive, HDD), floppy disk drive, flash memory, CD, magneto-optic disk, tape or logical With the combination of universal serial bus (Universal Serial Bus, USB) driver or two or more the above.? In suitable situation, memory 402 may include the medium of removable or non-removable (or fixed).In a suitable case, it deposits Reservoir 402 can be inside or outside data processing equipment.In a particular embodiment, memory 402 is that nonvolatile solid state is deposited Reservoir.In a particular embodiment, memory 402 includes read-only memory (ROM).In a suitable case, which can be ROM, programming ROM (PROM), erasable PROM (EPROM), electric erasable PROM (EEPROM), the electricity of masked edit program can change Write the combination of ROM (EAROM) or flash memory or two or more the above.
Processor 401 is by reading and executing the computer program instructions stored in memory 402, to realize above-mentioned implementation Any one authentication message legitimacy in example knows method for distinguishing.
In one example, the equipment of authentication message legitimacy identification may also include communication interface 403 and bus 410.Its In, as shown in fig. 6, processor 401, memory 402, communication interface 403 are connected by bus 410 and complete mutual lead to Letter.
Communication interface 403 is mainly used for realizing in the embodiment of the present invention between each module, device, unit and/or equipment Communication.
Bus 410 includes hardware, software or both, and the component for the equipment that authentication message legitimacy identifies is coupled to each other Together.For example it rather than limits, bus may include accelerated graphics port (AGP) or other graphics bus, enhancing industrial standard Framework (EISA) bus, front side bus (FSB), super transmission (HT) interconnection, Industry Standard Architecture (ISA) bus, infinite bandwidth are mutual Company, low pin count (LPC) bus, memory bus, micro- channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, Serial Advanced Technology Attachment (SATA) bus, Video Electronics Standards Association part (VLB) The combination of bus or other suitable buses or two or more the above.In a suitable case, bus 410 can wrap Include one or more buses.Although specific bus has been described and illustrated in the embodiment of the present invention, the present invention considers any suitable Bus or interconnection.
In addition, knowing method for distinguishing in conjunction with the authentication message legitimacy in above-described embodiment, the embodiment of the present invention can provide one Computer readable storage medium is planted to realize.Computer program instructions are stored on the computer readable storage medium;The calculating Machine program instruction realizes that any one authentication message legitimacy in above-described embodiment knows method for distinguishing when being executed by processor.
It should be clear that the invention is not limited to specific configuration described above and shown in figure and processing. For brevity, it is omitted here the detailed description to known method.In the above-described embodiments, several tools have been described and illustrated The step of body, is as example.But method process of the invention is not limited to described and illustrated specific steps, this field Technical staff can be variously modified, modification and addition after understanding spirit of the invention, or suitable between changing the step Sequence.
Functional block shown in structures described above block diagram can be implemented as hardware, software, firmware or their group It closes.When realizing in hardware, it may, for example, be electronic circuit, specific integrated circuit (ASIC), firmware appropriate, insert Part, function card etc..When being realized with software mode, element of the invention is used to execute program or the generation of required task Code section.Perhaps code segment can store in machine readable media program or the data-signal by carrying in carrier wave is passing Defeated medium or communication links are sent." machine readable media " may include any medium for capableing of storage or transmission information. The example of machine readable media includes electronic circuit, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), soft Disk, CD-ROM, CD, hard disk, fiber medium, radio frequency (RF) link, etc..Code segment can be via such as internet, inline The computer network of net etc. is downloaded.
It should also be noted that, the exemplary embodiment referred in the present invention, is retouched based on a series of step or device State certain methods or system.But the present invention is not limited to the sequence of above-mentioned steps, that is to say, that can be according in embodiment The sequence referred to executes step, may also be distinct from that the sequence in embodiment or several steps are performed simultaneously.
The above description is merely a specific embodiment, it is apparent to those skilled in the art that, For convenience of description and succinctly, the system, module of foregoing description and the specific work process of unit can refer to preceding method Corresponding process in embodiment, details are not described herein.It should be understood that scope of protection of the present invention is not limited thereto, it is any to be familiar with Those skilled in the art in the technical scope disclosed by the present invention, can readily occur in various equivalent modifications or substitutions, These modifications or substitutions should be covered by the protection scope of the present invention.

Claims (13)

1. a kind of know method for distinguishing to authentication message legitimacy, which is characterized in that the described method includes:
It searches to authentication message sending port;
The characteristic information of each template under the port is extracted and preserved;
According to the characteristic information of each template, determine with to the corresponding template of authentication message;
Match cognization is carried out with corresponding template to authentication message, if match cognization success, legal to authentication message;If Match cognization is unsuccessful, illegal to authentication message.
2. the method according to claim 1, wherein the feature that each template under the port is extracted and preserved Information, comprising:
The characteristic information of each template under the port is extracted and preserved using linear slide scanning algorithm.
3. according to the method described in claim 2, it is characterized in that, the linear slide scanning algorithm includes:
Choose at least two pointer variables;
By the linear slide of at least two pointers, characteristic information is obtained.
4. the method according to claim 1, wherein the characteristic information according to each template, determine with To the corresponding template of authentication message, comprising:
Using the character string fast search algorithm based on pattern string information auxiliary flow table, according to the characteristic information of each template, Determine with to the corresponding template of authentication message.
5. according to the method described in claim 4, it is characterized in that, the character string of pattern string information auxiliary flow table is quickly searched Rope algorithm includes:
It generates pattern string information and assists flow table;
The characteristic information that each template is searched in authentication message, when to the preceding i character of authentication message and the preceding i of characteristic information The success of a character match, last character assist flow table based on pattern string information, make to authentication message most when it fails to match The last character successful match of the latter character and characteristic information.
6. according to the method described in claim 5, it is characterized in that, pattern string information auxiliary flow table includes pattern string prefix Auxiliary information and pattern string suffix auxiliary information.
7. method according to claim 1 to 6, which is characterized in that the characteristic information is longest Chinese character string.
8. the method according to claim 1, wherein described carry out matching knowledge with corresponding template to authentication message Not, comprising:
Using memorandum formula scanning algorithm, match cognization is carried out with corresponding template to authentication message.
9. according to the method described in claim 8, it is characterized in that, the memorandum formula scanning algorithm, to authentication message with it is right The template answered carries out match cognization, comprising:
It generates and initializes memorandum;
During match cognization, corresponding template character is asterisk wildcard, then enters recurrent state and calculated, recurrent state As a result it is stored in memorandum, is based on memorandum storage result, complete the match cognization to authentication message and corresponding template.
10. to authentication message including: short message, identifying code, member the method according to claim 1, wherein described Notice, payment prompting, logistic track, electric business platform and ticket information.
11. a kind of device to the identification of authentication message legitimacy, which is characterized in that described device includes:
Searching module, for searching to authentication message sending port;
Extraction module, for the characteristic information of each template under the port to be extracted and preserved;
Determination module, for the characteristic information according to each template, determine with to the corresponding template of authentication message;
Match cognization module, for carrying out match cognization with corresponding template to authentication message, if match cognization success, to Authentication message is legal;It is illegal to authentication message if match cognization is unsuccessful.
12. it is a kind of to authentication message legitimacy identification equipment characterized by comprising at least one processor, at least one The computer program instructions of memory and storage in the memory, when the computer program instructions are by the processor Such as claim 1-10 described in any item methods are realized when execution.
13. a kind of computer readable storage medium, is stored thereon with computer program instructions, which is characterized in that when the calculating Such as method of any of claims 1-10 is realized when machine program instruction is executed by processor.
CN201711494742.4A 2017-12-31 2017-12-31 Method, apparatus, equipment and the medium of authentication message legitimacy identification Pending CN109996232A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711494742.4A CN109996232A (en) 2017-12-31 2017-12-31 Method, apparatus, equipment and the medium of authentication message legitimacy identification

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711494742.4A CN109996232A (en) 2017-12-31 2017-12-31 Method, apparatus, equipment and the medium of authentication message legitimacy identification

Publications (1)

Publication Number Publication Date
CN109996232A true CN109996232A (en) 2019-07-09

Family

ID=67110833

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711494742.4A Pending CN109996232A (en) 2017-12-31 2017-12-31 Method, apparatus, equipment and the medium of authentication message legitimacy identification

Country Status (1)

Country Link
CN (1) CN109996232A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113316153A (en) * 2020-04-02 2021-08-27 阿里巴巴集团控股有限公司 Short message inspection method, device and system

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106470405A (en) * 2015-08-18 2017-03-01 中兴通讯股份有限公司 SMS interception method and device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106470405A (en) * 2015-08-18 2017-03-01 中兴通讯股份有限公司 SMS interception method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
别玉玉 等: "贝叶斯垃圾邮件过滤算法的改进与实现", 《微计算机信息》 *
阮一峰: "字符串匹配的KMP算法", 《阮一峰的网络日志》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113316153A (en) * 2020-04-02 2021-08-27 阿里巴巴集团控股有限公司 Short message inspection method, device and system
CN113316153B (en) * 2020-04-02 2024-03-26 阿里巴巴集团控股有限公司 Short message inspection method, device and system

Similar Documents

Publication Publication Date Title
CN108038183B (en) Structured entity recording method, device, server and storage medium
CN111506599B (en) Industrial control equipment identification method and system based on rule matching and deep learning
US20070075878A1 (en) Memory circuit for aho-corasick type character recognition automaton and method of storing data in such a circuit
Park et al. Graph transplant: Node saliency-guided graph mixup with local structure preservation
CN108985934B (en) Block chain modification method and device
CN108090198A (en) Chart database creates and data load method, equipment and medium
EP3358474B1 (en) Route search method, device and apparatus, and non-volatile computer storage medium
CN108170759A (en) Method, apparatus, computer equipment and the storage medium of tip-offs about environmental issues processing
CN110779539B (en) Driving path correction method, device, equipment and storage medium
CN104298736A (en) Method and device for aggregating and connecting data as well as database system
CN113946546B (en) Abnormality detection method, computer storage medium, and program product
CN109753517A (en) A kind of method, apparatus, computer storage medium and the terminal of information inquiry
CN108229481A (en) Screen content analysis method, device, computing device and storage medium
CN105446705A (en) Method and device used for determining configuration file feature
CN110515896A (en) Model resource management method, model file production method, device and system
CN110727740B (en) Correlation analysis method and device, computer equipment and readable medium
CN110221960A (en) Generate method and device, the computer equipment, storage medium of test case
CN109871891A (en) A kind of object identification method, device and storage medium
CN104598473B (en) A kind of information processing method and electronic equipment
CN109996232A (en) Method, apparatus, equipment and the medium of authentication message legitimacy identification
CN116032741A (en) Equipment identification method and device, electronic equipment and computer storage medium
CN110796060B (en) High-speed driving route determining method, device, equipment and storage medium
US7860712B2 (en) Method of storing data in a memory circuit for AHO-corasick type character recognition automaton and corresponding storage circuit
CN115982310A (en) Link table generation method with verification function and electronic equipment
CN108304467B (en) Method for matching between texts

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190709

RJ01 Rejection of invention patent application after publication