WO2019144756A1 - 验证短信的处理方法及系统 - Google Patents

验证短信的处理方法及系统 Download PDF

Info

Publication number
WO2019144756A1
WO2019144756A1 PCT/CN2018/124338 CN2018124338W WO2019144756A1 WO 2019144756 A1 WO2019144756 A1 WO 2019144756A1 CN 2018124338 W CN2018124338 W CN 2018124338W WO 2019144756 A1 WO2019144756 A1 WO 2019144756A1
Authority
WO
WIPO (PCT)
Prior art keywords
short message
verification
keyword
local server
preset
Prior art date
Application number
PCT/CN2018/124338
Other languages
English (en)
French (fr)
Inventor
徐国诚
Original Assignee
深圳壹账通智能科技有限公司
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 深圳壹账通智能科技有限公司 filed Critical 深圳壹账通智能科技有限公司
Publication of WO2019144756A1 publication Critical patent/WO2019144756A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/284Lexical analysis, e.g. tokenisation or collocates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2411Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on the proximity to a decision surface, e.g. support vector machines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/30Noise filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/153Segmentation of character regions using recognition of characters or words
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/083Network architectures or network communication protocols for network security for authentication of entities using passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/133Protocols for remote procedure calls [RPC]
    • 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]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2463/00Additional details relating to network architectures or network communication protocols for network security covered by H04L63/00
    • H04L2463/082Additional details relating to network architectures or network communication protocols for network security covered by H04L63/00 applying multi-factor authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/083Network architectures or network communication protocols for network security for authentication of entities using passwords
    • H04L63/0838Network architectures or network communication protocols for network security for authentication of entities using passwords using one-time-passwords

Definitions

  • the present application belongs to the field of Internet technologies, and in particular, to a method and system for processing a verification short message.
  • the prior art has a problem of low operational efficiency and poor convenience due to the existence of the verification code in the multi-server function invocation process.
  • a first aspect of the embodiment of the present application provides a method for processing a verification short message, including:
  • the local server receives the instruction input by the user, and records the time of the instruction input; the local server sends the request message to the remote server according to the instruction, to control the remote server to send the verification short message to the terminal device; the terminal device is receiving Determining whether the short message is the verification short message when the short message is sent; if the short message is the verification short message, the terminal device forwards the verification short message to the local server; the local server receives the verification message Sending a short message, and recording a short message receiving time of the verified short message; if the difference between the time input by the instruction and the short message receiving time is less than or equal to a preset time difference threshold, the local server identifies the verified short message Verification code, and sending the verification code to the remote server to invoke a function in the remote server corresponding to the instruction.
  • a second aspect of the embodiments of the present application provides a processing system for verifying a short message, where the processing system for verifying a short message includes: a local server, configured to receive an instruction input by a user, and record a time input by the instruction; the local server further The method is configured to send a request message to the remote server according to the instruction, to control the remote server to send the verification short message to the terminal device, where the terminal device is configured to determine, when the short message is received, whether the short message is the verification short message.
  • the terminal device is further configured to: if the short message is the verification short message, forward the verification short message to the local server; the local server is configured to receive the verification short message, and record the verification The short message receiving time of the short message; the local server is further configured to: if the difference between the time input by the instruction and the short message receiving time is less than or equal to a preset time difference threshold, identify the verification code in the verification short message, And sending the verification code to the remote server to invoke a function in the remote server corresponding to the instruction.
  • the local server receives the instruction input by the user, records the time of the instruction input, and sends a request message to the remote server according to the instruction, so as to control the remote server to send the verification short message to the terminal device;
  • the terminal device forwards the verification short message to the local server;
  • the local server receives the verification short message, And recording the short message receiving time of the verification short message; if the difference between the time input by the instruction and the short message receiving time is less than or equal to a preset time difference threshold, the local server identifies the verification code in the verification short message. And sending the verification code to the remote server to invoke a function corresponding to the instruction in the remote server, so that the local server is more automated and more efficient when calling the function of the remote server .
  • FIG. 1 is a flowchart of an implementation of a method for processing a verification short message according to an embodiment of the present application
  • FIG. 2 is a specific implementation flowchart of a method for processing a verification short message S103 according to an embodiment of the present application
  • FIG. 3 is a flowchart of a specific implementation of a method for processing a verification short message provided by an embodiment of the present application
  • FIG. 4 is a specific implementation flowchart of a method for processing a verification short message provided by an embodiment of the present application
  • FIG. 5 is an interaction diagram of a processing system for verifying a short message provided by an embodiment of the present application.
  • FIG. 1 is a flowchart showing an implementation process of a method for processing a verification short message provided by an embodiment of the present application, where the method includes steps S101 to S109.
  • the specific implementation principle of each step is as follows.
  • Step S101 The local server receives an instruction input by the user, and records the time when the instruction is input.
  • the method for verifying the short message mainly relates to a local server, and a plurality of remote servers that can provide functions or data for the local server, and the terminal device, wherein the terminal device can be a fixed terminal such as a personal computer. It can also be a mobile terminal such as a mobile phone.
  • the user can directly input an instruction to the local server through the client or other control device, and is used to control the local server to call the function in the local server or the data stored in the local server, and can also be used to control the local server. Calling other servers, ie functions or data within the remote server.
  • Step S102 The local server sends a request message to the remote server according to the instruction, so as to control the remote server to send the verification short message to the terminal device.
  • the local server receives an instruction to invoke a function or data in the local server, the local server processes the data in the local server through a module encapsulated in the local server to meet the user's needs. If the local server recognizes that the received instruction needs to call the functions and data of other remote servers, the local server needs to add the instruction to a request message and send it to the corresponding remote server.
  • the description information of the terminal device corresponding to the instruction is added to the request message, where the description information of the terminal device includes the ID of the terminal device or the phone number of the terminal device, and the remote server receives the request message.
  • the verification short message is sent to the corresponding terminal device according to the description information of the terminal device.
  • Step S103 When receiving the short message, the terminal device determines whether the short message is the verification short message.
  • the remote server after receiving the request packet, the remote server sends a verification short message to the corresponding terminal device according to the description information of the terminal device, but it is understandable that the terminal device may receive various types of short messages. It is a verification short message sent by the remote server. Therefore, in the embodiment of the present application, when receiving a short message, the terminal device first determines whether the short message is a verification short message.
  • the verification message contains the verification code
  • the verification message in order to indicate the verification code, the verification message often contains related keywords.
  • whether the number of keywords in the short message appears is used to determine whether a short message is Verify the text message.
  • the foregoing S103 includes:
  • Step S1031 Perform word segmentation on the text of the short message to generate a plurality of short message words.
  • the terminal device first performs word segmentation processing on the received short message by using a word segmentation program encapsulated by the Dijkstra algorithm to generate a plurality of short message words.
  • a text message is: "You are applying for A Bank's SMS verification code is: 12345.”, will generate multiple text messages, namely: you, in the process, application, bank A, a flash pass, , SMS, verification code, yes,: 12345.
  • step S1032 it is determined whether each short message word exists in the keyword database.
  • the keyword database includes a correspondence between words and keyword probabilities.
  • the keyword database may be stored in the terminal device, or may be stored in the local server.
  • the terminal device can call the keyword database from the local server.
  • a text message may be split into: SMS, Yes, Apply, Bank A, Flash, SMS, Verification Code, Yes, 12345, etc. Then, among the short message words, only the words “A bank”, “one flash pass” and “verification code” exist in the keyword database, and the keyword probability corresponding to “A bank” in the keyword database is : 60%; the probability of a keyword corresponding to "one flash pass” is 40%; and the probability of a keyword corresponding to "verification code” is 90%.
  • step S1033 if the short message word exists in the preset keyword database, the keyword probability corresponding to each short message word is determined according to the correspondence between the word and the keyword probability in the keyword database.
  • the keyword probability corresponding to the short message "A Bank” is: 60 %; the probability of the keyword corresponding to the short message "one flash pass” is 40%; and the probability of the keyword corresponding to the short message “verification code” is 90%.
  • Step S1034 If the short message word does not exist in the keyword database, assign a preset keyword probability to the short message word.
  • Keyword probability As mentioned in the example above, only the three words “A Bank”, “One Flash” and “Verification Code” exist in the keyword database, so the short message words: “you", “being”, “application”, “ “,” “sMS”, “yes”, “:12345” cannot determine the corresponding keyword probabilities by the correspondence between the words and keyword probabilities contained in the keyword database, and the terminal device assigns a preset to these short message words. Keyword probability. Alternatively, the preset keyword probability may be 0%.
  • Step S1035 The short message words in the text of the short message whose keyword probability is greater than or equal to the preset probability threshold are used as keywords.
  • the keyword is determined by comparing whether the keyword probability of a short message word is greater than or equal to a preset probability threshold. For example, if the preset probability threshold is 50%, in the above example, the keyword probability corresponding to the short message "A Bank” is: 60%; the keyword probability of the short message “One Flash” is 40%. The keyword probability of the short message "Verification Code” is 90%, so only "A Bank” and “Verification Code” will be judged as keywords.
  • the text message "You are applying for A Bank's SMS verification code: 12345" contains two keywords.
  • Step S1036 If the short message includes a keyword greater than or equal to a preset number, determining that the short message is the verification short message.
  • the SMS will be judged as a verification SMS because the SMS “You are applying for A Bank One Flash Authentication Code: 12345” contains two keywords. .
  • Step S104 If the short message is the verification short message, the terminal device forwards the verification short message to the local server.
  • the terminal device determines whether the received short message is a verification short message, which can reduce unnecessary transmission of the short message to the local server, is beneficial to reduce invalid data transmission, and can save the local server processing resources for invalid data. .
  • Step S105 If the short message is not the verification short message, the terminal device stores the verification short message in the terminal device, and does not forward the short message to the local server.
  • Step S106 the local server receives the verification short message, and records the short message receiving time of the verification short message.
  • the local server after receiving the instruction input by the user, the local server records the time of the instruction input. In this step, after receiving the verification short message, the local server records the short message receiving time of the verification short message, thereby passing the The time difference between the time of the command input and the time of receiving the short message, and determining whether the verification short message forwarded from the terminal device is a verification short message generated by the remote server according to the instruction input by the user.
  • Step S107 determining whether the difference between the time input by the instruction and the short message receiving time is less than or equal to a preset time difference threshold.
  • the verification short message forwarded by the terminal device is likely to be generated by the remote server according to the instruction input by the user.
  • Verification SMS If the difference between the time of the instruction input and the short message receiving time is greater than a preset time difference threshold, the verification message may not be a verification message generated by the remote server according to an instruction input by the user, or the verification message is likely The valid time for verifying the SMS has been exceeded.
  • Step S108 if the difference between the time input by the instruction and the short message receiving time is less than or equal to a preset time difference threshold, the local server identifies the verification code in the verification short message, and sends the verification code. Go to the remote server to invoke a function in the remote server corresponding to the instruction.
  • the verification short message forwarded by the terminal device is likely to be the remote server according to the user input.
  • the verification message generated by the instruction is generated, so the local server will automatically identify the verification code in the verification message.
  • the above S108 includes:
  • Step S1081 Perform word segmentation on the text of the verification short message to generate a plurality of short message words.
  • the method for performing word segmentation processing on the text of the verification short message by the local server is the same as the method for performing word segmentation processing on the text of the short message in the step S1031 in the above embodiment, and is not described herein.
  • step S1082 if the short message word exists in the preset keyword database, the keyword probability corresponding to each short message word is determined according to the correspondence between the word and the keyword probability in the keyword database.
  • the method for the local server to determine the keyword probability corresponding to each short message word is the same as the method for the terminal device to determine the keyword probability corresponding to each short message word in step S1032 of the above embodiment, and is not described herein.
  • Step S1083 using the short message with the highest probability of the keyword in the verification short message as the special keyword.
  • the terminal device uses a short message including a keyword greater than or equal to a preset number as a verification short message, and sends the verification short message to the local server, so if the preset number is greater than 1 , to verify that there are multiple keywords in the text message.
  • the keyword probability is Among the highest-ranking keywords, the one with the highest position in the verification SMS is selected as a special keyword.
  • Step S1084 If there is a number between the preset cutoff flag before the special keyword and the preset cutoff flag after the special keyword, the number is used as the verification code.
  • the punctuation mark "]” and the punctuation mark ",” are preset break marks, suppose an interface verification message is: "[Software A] 581458 (Software A mobile phone verification code) Please complete the verification. If you are not working, please ignore this SMS.”
  • the preset partition mark before the keyword is "]” and the preset cutoff flag after the keyword is ",”, so the "] 581458 can be intercepted from the interface verification message by two preset cutoff flags (software A mobile phone verification) Code, please complete the verification),", by identifying the number in the section, get "581458" as the verification code in the interface verification SMS.
  • the method for setting a preset blocking flag includes: selecting a punctuation mark whose appearance frequency is greater than or equal to the first frequency threshold from the plurality of interface verification short messages, to obtain a first symbol group; and calculating each of the first symbols
  • the punctuation marks in the group appear in the frequency between the verification code and the keyword as the second frequency of each punctuation mark; the punctuation symbol in the first symbol group whose second frequency is greater than the second frequency threshold is deleted to obtain the second a symbol group; the punctuation marks in the second symbol group are used as a preset blocking flag.
  • the interval of the verification code in the interface verification short message is divided, and the number of the interval is extracted as a verification code, thereby realizing automatic analysis of the interface verification short message. Extract the verification code without human intervention to improve the automation of the entire interface call process.
  • Step S1085 if there is no number between the preset cutoff flag before the special keyword and the preset cutoff flag after the special keyword, but the picture exists, the character string in the picture is identified, and The character string is used as the verification code.
  • the above S1085 includes:
  • Step S10851 Perform noise reduction processing on the picture by a median filtering algorithm to generate a verification image.
  • median filtering is a nonlinear signal processing technique based on the theory of sorting statistics that can effectively suppress noise.
  • the basic principle of median filtering is to use the value of a point in a digital image with the value of a point in a neighborhood of the point. The median value is substituted so that the surrounding pixel values are close to the true value, thus eliminating isolated noise points.
  • Step S10852 Calculate a gray average value of the verification image according to a gray value of each pixel in the verification image, and convert a pixel point in the verification image with a gray value smaller than the gray average value into A black pixel point converts a pixel point in the verification image whose gray value is greater than or equal to the gray average value into a white pixel point.
  • the verification image in order to accurately identify the verification code included in the verification image, it is necessary to maximize the distinction between the pixel point where the verification code is located in the verification image and the pixel point that the verification code does not occupy, so the verification image is first calculated.
  • the grayscale average of all the pixels in the middle In the embodiment of the present application, in order to accurately identify the verification code included in the verification image, it is necessary to maximize the distinction between the pixel point where the verification code is located in the verification image and the pixel point that the verification code does not occupy, so the verification image is first calculated. The grayscale average of all the pixels in the middle.
  • the gray value of each pixel of the current general digital image is divided into 256 sections, which are respectively a gray value of 0 - a gray value of 255, wherein the gray value of the white pixel is 255, and the black pixel The gray value of the point is 0. Therefore, in order to classify different pixel points of the verification image, in the embodiment of the present application, the gray value of the pixel point in the verification image whose gray value is smaller than the gray average value is set to 0, and the image is verified.
  • the gradation value of the pixel whose gradation value is greater than or equal to the gradation average value is set to 255.
  • Step S10853 Scanning from one end to the other end of the verification image, and displaying a black pixel point for the first time on the scan line to an area between the black line pixels for the first time on the scan line as a verification area, to The verification image is sliced into more than one of the verification regions.
  • the verification image is a rectangular image, which is divided into two dimensions of length and width. It is assumed that in the verification image, the verification code is sequentially arranged from the left side to the right side of the verification image, and then in the embodiment of the present application, The scan is performed from the left side to the right side of the verification image, and the scan line is a line perpendicular to the long axis of the verification image. It can be understood that the scan line may not detect any black pixel points during the beginning of the scan, but as the scan line continues to move to the right, there is a moment when the black pixel points appear for the first time on the scan line.
  • the example records the position of the scanning line at this time, and uses the position of the scanning line at this time as a cutting line for cutting the verification image. Then, the scan line continues to move to the right. In a period of time, due to the existence of the verification code, black pixel points will continue to exist on the scan line. Until one time, the scan line does not contain black pixel points for the first time. At this time, the position of the scanning line and the position at which the scanning line is located at this time serve as a cutting line for cutting the verification image, and it is understood that the verification image is divided into a verification area according to the above procedure.
  • the scan line continues to move to the right.
  • the scan line will be During a period of time, since there is a space between the characters and the characters in the verification image, the scan line will be During a period of time, no black pixel points can be detected. Until a certain time, black pixel points appear again on the scan line.
  • Black pixel points appear again, also known as the first occurrence of black pixel points; there will be black pixel points for each scan line until one time, the scan line no longer contains black pixels, also known as black pixels for the first time. point.
  • Step S10854 Calculate feature vectors of each of the verification regions of the verification image, and identify characters corresponding to feature vectors of the verification regions by using a supervised learning model as characters corresponding to the verification regions.
  • the verification image is divided into more than one verification area, and each verification area contains only one character. Therefore, in the embodiment of the present application, characters in each verification area can be identified by the supervised learning model.
  • the character database includes a correspondence between a character and a feature vector, and a character corresponding to the feature vector of the verification region may be calculated by using a support vector machine model.
  • Step S10855 Combine characters corresponding to each of the verification areas to generate a character string in the picture.
  • the picture including the verification code is divided into multiple verification areas, and individual image recognition is performed on each verification area to improve recognition accuracy and reduce recognition calculation amount. It helps to identify the verification code in the picture more quickly and accurately.
  • the verification code is sent to the remote server to invoke the function corresponding to the instruction in the remote server.
  • the local server stores the verification short message forwarded by the terminal device, and stores the corresponding relationship between the verification short message and the terminal device; and the local server receives the verification code error sent by the remote server.
  • the user is prompted to input the device name and view the password; if the device name and the viewing password entered by the user are correct, the local server displays the terminal corresponding to the device name. The device recently forwarded the verification SMS.
  • Step S109 If the difference between the time input by the instruction and the short message receiving time is greater than the time difference threshold, the verification short message is not recognized. It should be understood that the size of the sequence of the steps in the above embodiments does not mean that the order of execution is performed. The order of execution of each process should be determined by its function and internal logic, and should not be construed as limiting the implementation process of the embodiments of the present application.
  • FIG. 5 is a cross-sectional view of the processing system for verifying the short message provided by the embodiment of the present application.
  • the system includes:
  • the local server 501 is configured to receive an instruction input by the user, and record a time when the instruction is input;
  • the local server 501 is further configured to send a request message to the remote server 502 according to the instruction, to control the remote server to send a verification short message to the terminal device, where the terminal device 503 is configured to determine when receiving the short message. Whether the short message is the verification short message; the terminal device 503 is further configured to forward the verification short message to the local server if the short message is the verification short message; the local server 501 is configured to: Receiving the verification short message, and recording the short message receiving time of the verification short message; the local server 501 is further configured to: if the difference between the time input by the instruction and the short message receiving time is less than or equal to a preset time difference threshold And identifying a verification code in the verification short message, and sending the verification code to the remote server to invoke a function corresponding to the instruction in the remote server.
  • the terminal device 503 includes:
  • a word segmentation module configured to perform word segmentation on the text of the verification short message to generate a plurality of short message words
  • a first determining module configured to determine, according to a correspondence between a word and a keyword probability in the keyword database, a keyword corresponding to each short message word, if the short message word exists in a preset keyword database
  • a second determining module configured to: assign a preset keyword probability to the short message word if the short message word does not exist in the keyword database; and use a keyword identifying module to send the short message
  • the text message whose keyword probability is greater than or equal to the preset probability threshold is used as a keyword
  • the verification short message identification module is configured to determine, if the short message includes a keyword greater than or equal to a preset number, The short message is the verification short message.
  • the local server 501 includes:
  • a server word segmentation module configured to perform word segmentation processing on the text of the short message to generate a plurality of short message words
  • a server first determining module configured to: if the short message word exists in a preset keyword database, according to the key a correspondence between a word and a keyword probability in the word database, determining a keyword probability corresponding to each of the short message words; and a server second determining module, configured to use a keyword with a highest probability in the top position of the verification short message
  • the short message word is used as a special keyword;
  • the first identifying module is configured to: if there is a number between the preset blocking flag before the special keyword and the preset blocking flag after the special keyword, the number is
  • the second identification module is configured to: if there is no number between the preset blocking flag before the special keyword and the preset blocking flag after the special keyword, but the image exists, a character string in the picture, and the character string is used as the verification code.
  • the local server 501 further includes:
  • a generating module configured to perform noise reduction processing on the image by a median filtering algorithm to generate a verification image
  • a conversion module configured to calculate a grayscale of the verification image according to a gray value of each pixel in the verification image An average value, and converting, in the verification image, a pixel point whose gray value is smaller than the gray average value into a black pixel point, and a pixel point in the verification image whose gray value is greater than or equal to the gray average value Converting to a white pixel
  • a dividing module configured to scan from one end to the other end of the verification image, to first display a black pixel point on the scan line to a region between the black line pixel for the first time on the scan line a verification area for dividing the verification image into more than one of the verification areas
  • a calculation module for calculating feature vectors of each of the verification areas of the verification image, and identifying each part by a supervised learning model a character corresponding to a feature vector of the verification area, as a character
  • the local server 501 further includes:
  • a storage module configured to store, by the local server, a verification short message forwarded by the terminal device, and store a correspondence between the verification short message and the terminal device; and a prompting module, configured to receive the far distance at the local server After the verification code sent by the terminal server is notified by mistake, or after receiving the instruction of the user to input the verification verification message, the user is prompted to input the device name and view the password; and the display module is used if the device name and the viewing password entered by the user are correct, The local server displays the latest verified verification short message of the terminal device corresponding to the device name.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Telephonic Communication Services (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本方案适用于互联网技术领域,提供了一种验证短信的处理方法及系统,通过本地服务器接收用户输入的指令,并记录指令输入的时间,根据所述指令向远端服务器发送请求报文;终端设备在接收到短信时,判断所述短信是否为验证短信;若所述短信为验证短信,则终端设备将所述验证短信转发至所述本地服务器;本地服务器接收所述验证短信,并记录所述验证短信的短信接收时间;若所述指令输入的时间与所述短信接收时间的差值小于或等于预设的时间差阈值,则所述本地服务器识别所述验证短信中的验证码,并将验证码发送至所述远端服务器,以调用远端服务器中与所述指令对应的功能,使得本地服务器在调用远端服务器的功能时,自动化程度以及工作效率更高。

Description

验证短信的处理方法及系统
本申请要求于2018年01月29日提交中国专利局、申请号为2018100845877、发明名称为“验证短信的处理方法及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请属于互联网技术领域,尤其涉及一种验证短信的处理方法及系统。
背景技术
随着互联网技术的发展,设备和设备之间的数据交互日益密切,现在的分布式系统,往往需要多台服务器或平台互相调取数据和调用功能,这有利于数据处理效率以及降低成本。为了保证分布式系统中各个服务器之间的数据安全,一台本地服务器在调用其他服务器的数据或功能时,往往需要输入正确的验证码,而在一般情况下,其他服务器并不会直接将验证码发送至本地服务器,而是会将验证码以短信的形式发送至一个终端设备,例如发送至一台手机中,用户需要将该短信中的验证码输入本地服务器中,才可以完成从其他服务器调用数据或功能的目的。
但是,在多个用户同时使用本地服务器,并调用不同的远端服务器的数据或功能时,或一个用户需要调用多个远端服务器的功能,需要正确输入多个验证码时,如果每个用户都需要人工读取各自终端设备接收到的验证码,并将其输入至本地服务器,就会影响本地服务器的使用效率,并且对于用户而言,便捷性也比较差。
技术问题
现有技术在多服务器功能调用过程中由于验证码的存在而带来的运行效率不高,便捷性较差的问题。
技术解决方案
本申请实施例的第一方面提供了一种验证短信的处理方法,包括:
本地服务器接收用户输入的指令,并记录指令输入的时间;所述本地服务器根据所述指令向远端服务器发送请求报文,以控制远端服务器向终端设备发送验证短信;所述终端设备在接收到短信时,判断所述短信是否为所述验证短信;若所述短信为所述验证短信,则所述终端设备将所述验证短信转发至所述本地服务器;所述本地服务器接收所述验证短信,并记录所述验证短信的短信接收时间;若所述指令输入的时间与所述短信接收时间的差值小于或等于预设的时间差阈值,则所述本地服务器识别所述验证短信中的验证码,并将所述验证码发送至所述远端服务器,以调用所述远端服务器中与所述指令对应的功能。
本申请实施例的第二方面提供了一种验证短信的处理系统,该验证短信的处理系统包括:本地服务器,用于接收用户输入的指令,并记录指令输入的时间;所述本地服务器,还用于根据所述指令向远端服务器发送请求报文,以控制远端服务器向终端设备发送验证短信;所述终端设备,用于在接收到短信时,判断所述短信是否为所述验证短信;所述终端设备,还用于若所述短信为所述验证短信,则将所述验证短信转发至所述本地服务器;所述本地服务器,用于接收所述验证短信,并记录所述验证短信的短信接收时间;所述本地服务器,还用于若所述指令输入的时间与所述短信接收时间的差值小于或等于预设的时间差阈值,则识别所述验证短信中的验证码,并将所述验证码发送至所述远端服务器,以调用所述远端服务器中与所述指令对应的功能。
有益效果
在本申请实施例中,通过本地服务器接收用户输入的指令,并记录指令输入的时间,根据所述指令向远端服务器发送请求报文,以控制远端服务器向终端设备发送验证短信;终端设备在接收到短信时,判断所述短信是否为所述验证短信;若所述短信为所述验证短信,则终端设备将所述验证短信转发至所述本地服务器;本地服务器接收所述验证短信,并记录所述验证短信的短信接收时间;若所述指令输入的时间与所述短信接收时间的差值小于或等于预设的时间差阈值,则所述本地服务器识别所述验证短信中的验证码,并将所述验证码发送至所述远端服务器,以调用所述远端服务器中与所述指令对应的功能,使得本地服务器在调用远端服务器的功能时,自动化程度以及工作效率更高。
附图说明
图1是本申请实施例提供的验证短信的处理方法的实现流程图;
图2是本申请实施例提供的验证短信的处理方法S103的具体实现流程图;
图3是本申请实施例提供的验证短信的处理方法S108的具体实现流程图;
图4是是本申请实施例提供的验证短信的处理方法S1085的具体实现流程图;
图5是本申请实施例提供的验证短信的处理系统交互图。
本发明的实施方式
为了说明本申请所述的技术方案,下面通过具体实施例来进行说明。
图1示出了本申请实施例提供的验证短信的处理方法的实现流程,该方法流程包括步骤S101至S109。各步骤的具体实现原理如下。
步骤S101:本地服务器接收用户输入的指令,并记录指令输入的时间。
本申请实施例中,验证短信的处理方法主要涉及本地服务器,以及可以为本地服务器提供功能或数据的多个远端服务器,以及终端设备,其中,终端设备可以是诸如个人电脑在内的固定终端,也可以是诸如手机在内的移动终端。
在本申请实施例中,用户可以通过客户端或其他控制设备直接向本地服务器输入指令,用于控制本地服务器调用本地服务器内的功能或存储在本地服务器内的数据,也可以用于控制本地服务器调用其他服务器即远端服务器内的功能或数据。
值得注意地,在本申请实施例中,由于考虑到安全性的因素,引入了时间验证的概念,所以在本地服务器接收到用户输入的指令时,需要同时记录指令输入的时间,以为后续在验证时间是否符合要求的步骤中,提供一类时间数据。
步骤S102,所述本地服务器根据所述指令向远端服务器发送请求报文,以控制远端服务器向终端设备发送验证短信。
可以理解地,如果本地服务器接收到的指令是调用本地服务器内的功能或数据,则本地服务器通过封装于本地服务器中的模块处理本地服务器中的数据,以满足用户的需求。如果本地服务器识别出接收到的指令需要调用其他远端服务器的功能和数据,则本地服务器需要将该指令添加进一个请求报文,发送至对应的远端服务器。
值得注意地,请求报文中还会添加与所述指令对应的终端设备的描述信息,所述终端设备的描述信息包括终端设备的ID或终端设备的电话号码,远端服务器在接收到请求报文后,会根据终端设备的描述信息向对应的终端设备发送验证短信。
步骤S103,所述终端设备在接收到短信时,判断所述短信是否为所述验证短信。
如上文示例所述,远端服务器在接收到请求报文后,会根据终端设备的描述信息向对应的终端设备发送验证短信,但是可以理解地,终端设备可能会接收到各类短信并不一定是远端服务器发送的验证短信,所以在本申请实施例中,终端设备在接收到一个短信时,会首先判断该短信是否是验证短信。
可选地,由于验证短信中含有验证码,所以为了指示验证码,验证短信中往往含有相关的关键词,在本申请实施例中,通过一个短信中关键词出现的次数,判断一个短信是否是验证短信。
作为本申请的一个实施例,如图2所示,上述S103包括:
步骤S1031,对所述短信的文本进行分词处理,生成多个短信词。
可选地,在本申请实施例中,终端设备首先通过封装有基于dijkstra算法的分词程序对接收到的短信进行分词处理,以生成多个短信词。
示例性地,一个短信为:“您正在申请A银行一闪通的短信验证码是:12345。”,会生成多个短信词,分别为:您、正在、申请、A银行、一闪通、的、短信、验证码、是、:12345。
步骤S1032,判断各个短信词是否存在于关键词数据库中。
在本申请实施例中,存在一个关键词数据库,关键词数据库中包含词语与关键词概率的对应关系,可选地,该关键词数据库可以存储在终端设备中,也可能存储与本地服务器中,终端设备可以从本地服务器中调用该关键词数据库。
示例性地,如上文示例所述,一个短信可能被拆分为:您、正在、申请、A银行、一闪通、的、短信、验证码、是、:12345等短信词。则可能在这些短信词中只有“A银行”、“一闪通”以及“验证码”这三个词语存在于关键词数据库中,且在关键词数据库中“A银行”对应的关键词概率为:60%;“一闪通”对应的关键词概率为40%;而“验证码”对应的关键词概率为90%。
步骤S1033,若所述短信词存在于预设的关键词数据库中,则根据所述关键词数据库中的词语与关键词概率的对应关系,确定各个所述短信词对应的关键词概率。
如上文示例所述,则只有“A银行”、“一闪通”以及“验证码”可以通过关键词数据库确定对应的关键词概率,即短信词“A银行”对应的关键词概率为:60%;短信词“一闪通”对应的关键词概率为40%;而短信词“验证码”对应的关键词概率为90%。
步骤S1034,若所述短信词不存在于所述关键词数据库中,则为所述短信词分配一个预设的关键词概率。
如上文示例所述,只有“A银行”、“一闪通”以及“验证码”这三个词语存在于关键词数据库中,所以短信词:“您”、“正在”、“申请”、“的”、“短信”、“是”、“:12345”无法通过关键词数据库包含的词语与关键词概率的对应关系确定各自对应的关键词概率,则终端设备为这些短信词分配一个预设的关键词概率。可选地,预设的关键词概率可以是0%。
步骤S1035,将所述短信的文本中所述关键词概率大于或等于预设概率阈值的短信词,作为关键词。
在本申请实施例中,通过比对一个短信词的关键词概率是否大于或等于预设概率阈值,以确定关键词。例如:如果预设概率阈值为50%,则在上文示例中,由于短信词“A银行”对应的关键词概率为:60%;短信词“一闪通”对应的关键词概率为40%;而短信词“验证码”对应的关键词概率为90%,所以只有“A银行”以及“验证码”会被判定为关键词。
综上,在本示例中,短信“您正在申请A银行一闪通的短信验证码是:12345”中含有两个关键词。
步骤S1036,若所述短信中包含大于或等于预设个数的关键词,则判定所述短信为所述验证短信。
如上文示例所述,假设预设个数为2,则由于短信“您正在申请A银行一闪通的短信验证码是:12345”中含有两个关键词,所以该短信会被判定为验证短信。
步骤S104,若所述短信为所述验证短信,则所述终端设备将所述验证短信转发至所述本地服务器。
在本申请实施例中,通过终端设备判断接收到的短信是否为验证短信,可以减少传输不必要的短信至本地服务器,有利于减少传输无效的数据,并且可以节省本地服务器对无效数据的处理资源。
步骤S105,若所述短信不为所述验证短信,则所述终端设备将所述验证短信存储于所述终端设备中,并不将所述短信转发至本地服务器。
步骤S106,所述本地服务器接收所述验证短信,并记录所述验证短信的短信接收时间。
在上文实施例中,本地服务器在接收到用户输入的指令后,就记录了指令输入的时间,在本步骤中,本地服务器在接收验证短信后,记录验证短信的短信接收时间,以此通过指令输入的时间到短信接收时间之间的时间差,判断从终端设备转发的验证短信,是否为远端服务器根据用户输入的指令生成的验证短信。
步骤S107,判断所述指令输入的时间与所述短信接收时间的差值是否小于或等于预设的时间差阈值。
可以理解地,如果所述指令输入的时间与所述短信接收时间的差值小于或等于预设的时间差阈值,则该由终端设备转发的验证短信很可能就是远端服务器根据用户输入的指令生成的验证短信。而如果所述指令输入的时间与所述短信接收时间的差值大于预设的时间差阈值,则该验证短信很可能不是远端服务器根据用户输入的指令生成的验证短信,或者该验证短信很可能已经超过了验证短信的有效时间。
步骤S108,若所述指令输入的时间与所述短信接收时间的差值小于或等于预设的时间差阈值,则所述本地服务器识别所述验证短信中的验证码,并将所述验证码发送至所述远端服务器,以调用所述远端服务器中与所述指令对应的功能。
如上文示例所述,如果所述指令输入的时间与所述短信接收时间的差值小于或等于预设的时间差阈值,则该由终端设备转发的验证短信很可能就是远端服务器根据用户输入的指令生成的验证短信,所以本地服务器将自动识别验证短信中的验证码。
作为本申请的一个实施例,如图所示,上述S108包括:
步骤S1081,对所述验证短信的文本进行分词处理,生成多个短信词。
在本申请实施例中,本地服务器对于验证短信的文本进行分词处理的方法与上文实施例的步骤S1031中终端设备对于短信的文本进行分词处理的方法相同,不在此赘述。
步骤S1082,若所述短信词存在于预设的关键词数据库中,则根据所述关键词数据库中的词语与关键词概率的对应关系,确定各个所述短信词对应的关键词概率。
在本申请实施例中,本地服务器确定各个短信词对应的关键词概率的方法与上文实施例的步骤S1032中终端设备确定各个所述短信词对应的关键词概率的方法相同,不在此赘述。
步骤S1083,将所述验证短信中位置最靠前的一个关键词概率最高的短信词作为特殊关键词。
可以理解地地,在上文实施例中,终端设备将一个包含大于或等于预设个数的关键词的短信作为验证短信,并将验证短信发送到了本地服务器,所以如果预设个数大于1,则验证短信存在多个关键词。在本申请实施例中,需要从这些关键词中选择关键词概率最高的关键词作为特殊关键词,在特殊情况下,如果存在多个关键词的关键词概率并列最高,则在这些关键词概率并列最高的关键词中选择在验证短信中位置最靠前的一个,作为特殊关键词。
步骤S1084,若所述特殊关键词之前的预设隔断标志与所述特殊关键词之后的所述预设隔断标志之间存在数字,则将所述数字作为所述验证码。
示例性地,若词语“验证码”为关键词,标点符号“】”以及标点符号“,”为预设隔断标志,假设一个接口验证短信为:“【软件A】581458(软件A手机验证码,请完成验证),如非本人操作,请忽略本短信”。关键词之前的预设隔断标志为“】”,关键词之后的预设隔断标志为“,”,所以通过两个预设隔断标志可以从接口验证短信中截取出“】581458(软件A手机验证码,请完成验证),”,通过识别该部分中的数字,得到“581458”作为接口验证短信中的验证码。
可选地,设定预设隔断标志的方法包括:从多个接口验证短信中,筛选出出现频率大于或等于第一频率阈值的标点符号,得到第一符号组;计算各个所述第一符号组里的标点符号出现在验证码与关键词之间的频率,作为各个标点符号的第二频率;将所述第一符号组中第二频率大于第二频率阈值的标点符号删除,得到第二符号组;将所述第二符号组内的标点符号作为预设隔断标志。
值得注意地,特殊关键词之前的预设隔断标志与所述特殊关键词之后的所述预设隔断标志之间可能不仅存在数字,还存在图片,但是在本申请实施例中,当特殊关键词之前的预设隔断标志与所述特殊关键词之后的所述预设隔断标志之间同时存在数字和图片时,直接将数字作为验证码,而不对图片进行识别。
在本申请实施例中,通过对关键词以及预设隔断标志的提取,划分出验证码在接口验证短信中的区间,提取该区间的数字作为验证码,实现了对接口验证短信的自动化分析,在无人工干预的情况下提取验证码,提高整个接口调用过程的自动化程度。
步骤S1085,若所述特殊关键词之前的预设隔断标志与所述特殊关键词之后的所述预设隔断标志之间不存在数字但存在图片,则识别所述图片中的字符串,并将所述字符串作为所述验证码。
由于一些验证短信中的验证码存在于一个图片中,所以在本申请实施例提供了一种识别图片中验证码的方法。
作为本申请的一个实施例,如图所示,上述S1085包括:
步骤S10851,通过中值滤波算法对所述图片进行降噪处理,生成验证图像。
可以理解地,验证短信的包含验证码的图片中,存在一些干扰因素,所以需要首先对图片进行降噪处理,以生成相对清晰的验证图像。
具体地,中值滤波是基于排序统计理论的一种能有效抑制噪声的非线性信号处理技术,中值滤波的基本原理是把数字图像中一点的值用该点的一个邻域中各点值的中值代替,让周围的像素值接近的真实值,从而消除孤立的噪声点。
步骤S10852,根据所述验证图像中各个像素点的灰度值,计算所述验证图像的灰度平均值,并将所述验证图像中灰度值小于所述灰度平均值的像素点转换为黑色像素点,将所述验证图像中灰度值大于或等于所述灰度平均值的像素点转换为白色像素点。
在本申请实施例中,为了准确的识别验证图像中包含的验证码,需要将验证图像中验证码所在的像素点与验证码不占用的像素点进行最大限度的区分,所以首先计算出验证图像中全部像素点的灰度平均值。
可以理解地,当前一般的数字图像的各个像素点的灰度值被分为256个区间,分别为灰度值0-灰度值255,其中,白色像素点的灰度值为255,黑色像素点的灰度值为0。因此,为了将验证图像的不同像素点进行分类,在本申请实施例中,将验证图像中灰度值小于所述灰度平均值的像素点的灰度值设定为0,将验证图像中灰度值大于或等于所述灰度平均值的像素点的灰度值设定为255。
步骤S10853,从所述验证图像的一端至另一端进行扫描,将扫描线上首次出现黑色像素点到所述扫描线上首次不含有黑色像素点之间的区域作为一个验证区域,以将所述验证图像切分为一个以上的所述验证区域。
具体地,假设验证图像是一个矩形图像,分为长和宽两个维度,假设在验证图像中,验证码是从验证图像的左侧向右侧依次排布的,那么在本申请实施例中就从验证图像的左侧向右侧进行扫描,且扫描线是一个垂直于验证图像的长轴的线。可以理解地,在扫描开始的一段时间内,扫描线可能无法检测到任何黑色像素点,但是随着扫描线持续向右移动,会存在一个时刻,扫描线上首次出现黑色像素点,本申请实施例记录下此时扫描线的位置,并将此时的扫描线所在的位置作为用于切割验证图像的一个切割线。随后扫描线持续向右移动,在一个时间段内,由于验证码的存在,扫描线上会持续存在黑色像素点,直到一个时刻,扫描线上首次不含有黑色像素点,本申请实施例记录下此时扫描线的位置并将此时的扫描线所在的位置作为用于切割验证图像的一个切割线,可以理解地,根据上述过程,验证图像会被划分出一个验证区域。
在本申请实施例中,验证图像在被划分出一个验证区域后,扫描线会继续向右移动,在一段时间内,由于验证图像中的字符与字符之间存在间隔区域,所以扫描线会在一段时间内,无法检测到任何黑色像素点,直到某一个时刻,扫描线上再次出现黑色像素点,值得注意地,在本申请实施例中,将扫描线上经过一段无法检测到黑色像素点后再次出现黑色像素点,也称为首次出现黑色像素点;将每次扫描线持续存在黑色像素点,直到一个时刻,扫描线上又一次不再含有黑色像素点,也称为首次不含有黑色像素点。
步骤S10854,计算所述验证图像的各个所述验证区域的特征向量,并通过有监督学习模型识别各个所述验证区域的特征向量对应的字符,作为各个所述验证区域对应的字符。
可以理解地,根据上一个步骤,验证图像被划分为一个以上的验证区域,每个验证区域内只含有一个字符。所以在本申请实施例中,可以通过有监督学习模型识别各个验证区域中的字符。
可选地,在本申请实施例中,存在一个字符数据库,该字符数据库中包含字符与特征向量的对应关系,可以通过支持向量机模型计算出验证区域的特征向量对应的字符。
步骤S10855,组合各个所述验证区域对应的字符,生成所述图片中的字符串。
在本申请实施例中,基于各个像素点的灰度值,将包含验证码的图片划分为多个验证区域,并对各个验证区域进行单独的图像识别,以提高识别准确性以及降低识别计算量,有利于更加快速准确地识别出图片中的验证码。
可以理解地,当本地服务器识别出验证短信中的验证码后,会将验证码发送至远端服务器,以调用远端服务器中与指令对应的功能。
进一步地,所述本地服务器存储由所述终端设备转发的验证短信,并存储所述验证短信与所述终端设备的对应关系;在所述本地服务器接收到所述远端服务器发送的验证码错误通知后,或在接收到用户输入的查看验证短信的指令后,提示用户输入设备名称以及查看密码;若用户输入的设备名称以及查看密码正确,则所述本地服务器显示所述设备名称对应的终端设备最新转发的验证短信。
步骤S109,若所述指令输入的时间与所述短信接收时间的差值大于时间差阈值,则不对验证短信进行识别。应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
对应于上文实施例所述的验证短信的处理方法,图5示出了本申请实施例提供的验证短信的处理系统交互图,。参照图5,该系统包括:
本地服务器501,用于接收用户输入的指令,并记录指令输入的时间;
所述本地服务器501,还用于根据所述指令向远端服务器502发送请求报文,以控制远端服务器向终端设备发送验证短信;所述终端设备503,用于在接收到短信时,判断所述短信是否为所述验证短信;所述终端设备503,还用于若所述短信为所述验证短信,则将所述验证短信转发至所述本地服务器;所述本地服务器501,用于接收所述验证短信,并记录所述验证短信的短信接收时间;所述本地服务器501,还用于若所述指令输入的时间与所述短信接收时间的差值小于或等于预设的时间差阈值,则识别所述验证短信中的验证码,并将所述验证码发送至所述远端服务器,以调用所述远端服务器中与所述指令对应的功能。
可选地,所述终端设备503,包括:
分词模块,用于对所述验证短信的文本进行分词处理,生成多个短信词;
第一确定模块,用于若所述短信词存在于预设的关键词数据库中,则根据所述关键词数据库中的词语与关键词概率的对应关系,确定各个所述短信词对应的关键词概率;第二确定模块,用于若所述短信词不存在于所述关键词数据库中,则为所述短信词分配一个预设的关键词概率;关键词识别模块,用于将所述短信的文本中所述关键词概率大于或等于预设概率阈值的短信词,作为关键词;验证短信识别模块,用于若所述短信中包含大于或等于预设个数的关键词,则判定所述短信为所述验证短信。
可选地,本地服务器501,包括:
服务器分词模块,用于对所述短信的文本进行分词处理,生成多个短信词;服务器第一确定模块,用于若所述短信词存在于预设的关键词数据库中,则根据所述关键词数据库中的词语与关键词概率的对应关系,确定各个所述短信词对应的关键词概率;服务器第二确定模块,用于将所述验证短信中位置最靠前的一个关键词概率最高的短信词作为特殊关键词;第一识别模块,用于若所述特殊关键词之前的预设隔断标志与所述特殊关键词之后的所述预设隔断标志之间存在数字,则将所述数字作为所述验证码;第二识别模块,用于若所述特殊关键词之前的预设隔断标志与所述特殊关键词之后的所述预设隔断标志之间不存在数字但存在图片,则识别所述图片中的字符串,并将所述字符串作为所述验证码。
可选地,本地服务器501,还包括:
生成模块,用于通过中值滤波算法对所述图片进行降噪处理,生成验证图像;转换模块,用于根据所述验证图像中各个像素点的灰度值,计算所述验证图像的灰度平均值,并将所述验证图像中灰度值小于所述灰度平均值的像素点转换为黑色像素点,将所述验证图像中灰度值大于或等于所述灰度平均值的像素点转换为白色像素点;划分模块,用于从所述验证图像的一端至另一端进行扫描, 将扫描线上首次出现黑色像素点到所述扫描线上首次不含有黑色像素点之间的区域作为一个验证区域,以将所述验证图像切分为一个以上的所述验证区域;计算模块,用于计算所述验证图像的各个所述验证区域的特征向量,并通过有监督学习模型识别各个所述验证区域的特征向量对应的字符,作为各个所述验证区域对应的字符;组合模块,用于组合各个所述验证区域对应的字符,生成所述图片中的字符串。
可选地,本地服务器501,还包括:
存储模块,用于所述本地服务器存储由所述终端设备转发的验证短信,并存储所述验证短信与所述终端设备的对应关系;提示模块,用于在所述本地服务器接收到所述远端服务器发送的验证码错误通知后,或在接收到用户输入的查看验证短信的指令后,提示用户输入设备名称以及查看密码;显示模块,用于若用户输入的设备名称以及查看密码正确,则所述本地服务器显示所述设备名称对应的终端设备最新转发的验证短信。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (20)

  1. 一种验证短信的处理方法,其特征在于,包括:
    本地服务器接收用户输入的指令,并记录指令输入的时间;
    所述本地服务器根据所述指令向远端服务器发送请求报文,以控制远端服务器向终端设备发送验证短信;
    所述终端设备在接收到短信时,判断所述短信是否为所述验证短信;
    若所述短信为所述验证短信,则所述终端设备将所述验证短信转发至所述本地服务器;
    所述本地服务器接收所述验证短信,并记录所述验证短信的短信接收时间;
    若所述指令输入的时间与所述短信接收时间的差值小于或等于预设的时间差阈值,则所述本地服务器识别所述验证短信中的验证码,并将所述验证码发送至所述远端服务器,以调用所述远端服务器中与所述指令对应的功能。
  2. 如权利要求1所述的验证短信的处理方法,其特征在于,所述判断所述短信是否为所述验证短信,包括:
    对所述短信的文本进行分词处理,生成多个短信词;
    若所述短信词存在于预设的关键词数据库中,则根据所述关键词数据库中的词语与关键词概率的对应关系,确定各个所述短信词对应的关键词概率;
    将所述短信的文本中所述关键词概率大于或等于预设概率阈值的短信词,作为关键词;
    若所述短信中包含大于或等于预设个数的关键词,则判定所述短信为所述验证短信。
  3. 如权利要求1所述的验证短信的处理方法,其特征在于,所述本地服务器识别所述验证短信中的验证码,包括:
    对所述验证短信的文本进行分词处理,生成多个短信词;
    若所述短信词存在于预设的关键词数据库中,则根据所述关键词数据库中的词语与关键词概率的对应关系,确定各个所述短信词对应的关键词概率;
    将所述验证短信中位置最靠前的一个关键词概率最高的短信词作为特殊关键词;
    若所述特殊关键词之前的预设隔断标志与所述特殊关键词之后的所述预设隔断标志之间不存在数字但存在图片,则识别所述图片中的字符串,并将所述字符串作为所述验证码。
  4. 如权利要求3所述的验证短信的处理方法,其特征在于,所述则识别所述图片中的字符串,包括:
    通过中值滤波算法对所述图片进行降噪处理,生成验证图像;
    根据所述验证图像中各个像素点的灰度值,计算所述验证图像的灰度平均值,并将所述验证图像中灰度值小于所述灰度平均值的像素点转换为黑色像素点,将所述验证图像中灰度值大于或等于所述灰度平均值的像素点转换为白色像素点;
    从所述验证图像的一端至另一端进行扫描,将扫描线上首次出现黑色像素点到所述扫描线上首次不含有黑色像素点之间的区域作为一个验证区域,以将所述验证图像切分为一个以上的所述验证区域;
    计算所述验证图像的各个所述验证区域的特征向量,并通过有监督学习模型识别各个所述验证区域的特征向量对应的字符,作为各个所述验证区域对应的字符;
    组合各个所述验证区域对应的字符,生成所述图片中的字符串。
  5. 如权利要求1所述的验证短信的处理方法,其特征在于,还包括:
    所述本地服务器存储由所述终端设备转发的验证短信,并存储所述验证短信与所述终端设备的对应关系;
    在所述本地服务器接收到所述远端服务器发送的验证码错误通知后,或在接收到用户输入的查看验证短信的指令后,提示用户输入设备名称以及查看密码;
    若用户输入的设备名称以及查看密码正确,则所述本地服务器显示所述设备名称对应的终端设备最新转发的验证短信。
  6. 如权利要求2所述的验证短信的处理方法,其特征在于,还包括:
    若所述短信词不存在于所述关键词数据库中,则为所述短信词分配一个预设的关键词概率。
  7. 如权利要求2所述的验证短信的处理方法,其特征在于,所述对所述短信的文本进行分词处理,包括:通过封装有基于dijkstra算法的分词程序对接收到的短信进行分词处理。
  8. 如权利要求3所述的验证短信的处理方法,其特征在于,还包括:若所述特殊关键词之前的预设隔断标志与所述特殊关键词之后的所述预设隔断标志之间存在数字,则将所述数字作为所述验证码。
  9. 如权利要求4所述的验证短信的处理方法,其特征在于,所述通过有监督学习模型识别各个所述验证区域的特征向量对应的字符,包括:通过支持向量机模型计算出验证区域的特征向量对应的字符。
  10. 如权利要求1所述的验证短信的处理方法,其特征在于,还包括:若所述指令输入的时间与所述短信接收时间的差值大于时间差阈值,则不对验证短信进行识别。
  11. 一种验证短信的处理系统,其特征在于,包括:
    本地服务器,用于接收用户输入的指令,并记录指令输入的时间;
    所述本地服务器,还用于根据所述指令向远端服务器发送请求报文,以控制远端服务器向终端设备发送验证短信;
    所述终端设备,用于在接收到短信时,判断所述短信是否为所述验证短信;
    所述终端设备,还用于若所述短信为所述验证短信,则将所述验证短信转发至所述本地服务器;
    所述本地服务器,用于接收所述验证短信,并记录所述验证短信的短信接收时间;
    所述本地服务器,还用于若所述指令输入的时间与所述短信接收时间的差值小于或等于预设的时间差阈值,则识别所述验证短信中的验证码,并将所述验证码发送至所述远端服务器,以调用所述远端服务器中与所述指令对应的功能。
  12. 根据权利要求11所述的验证短信的处理系统,其特征在于,所述终端设备包括:
    分词模块,用于对所述验证短信的文本进行分词处理,生成多个短信词;第一确定模块,用于若所述短信词存在于预设的关键词数据库中,则根据所述关键词数据库中的词语与关键词概率的对应关系,确定各个所述短信词对应的关键词概率;第二确定模块,用于若所述短信词不存在于所述关键词数据库中,则为所述短信词分配一个预设的关键词概率;关键词识别模块,用于将所述短信的文本中所述关键词概率大于或等于预设概率阈值的短信词,作为关键词;验证短信识别模块,用于若所述短信中包含大于或等于预设个数的关键词,则判定所述短信为所述验证短信。
  13. 根据权利要求11所述的验证短信的处理系统,其特征在于,所述本地服务器,包括:
    服务器分词模块,用于对所述短信的文本进行分词处理,生成多个短信词;
    服务器第一确定模块,用于若所述短信词存在于预设的关键词数据库中,则根据所述关键词数据库中的词语与关键词概率的对应关系,确定各个所述短信词对应的关键词概率;
    服务器第二确定模块,用于将所述验证短信中位置最靠前的一个关键词概率最高的短信词作为特殊关键词;
    第一识别模块,用于若所述特殊关键词之前的预设隔断标志与所述特殊关键词之后的所述预设隔断标志之间存在数字,则将所述数字作为所述验证码;
    第二识别模块,用于若所述特殊关键词之前的预设隔断标志与所述特殊关键词之后的所述预设隔断标志之间不存在数字但存在图片,则识别所述图片中的字符串,并将所述字符串作为所述验证码。
  14. 根据权利要求13所述的验证短信的处理系统,其特征在于,所述本地服务器,还包括:
    生成模块,用于通过中值滤波算法对所述图片进行降噪处理,生成验证图像;
    转换模块,用于根据所述验证图像中各个像素点的灰度值,计算所述验证图像的灰度平均值,并将所述验证图像中灰度值小于所述灰度平均值的像素点转换为黑色像素点,将所述验证图像中灰度值大于或等于所述灰度平均值的像素点转换为白色像素点;
    划分模块,用于从所述验证图像的一端至另一端进行扫描, 将扫描线上首次出现黑色像素点到所述扫描线上首次不含有黑色像素点之间的区域作为一个验证区域,以将所述验证图像切分为一个以上的所述验证区域;
    计算模块,用于计算所述验证图像的各个所述验证区域的特征向量,并通过有监督学习模型识别各个所述验证区域的特征向量对应的字符,作为各个所述验证区域对应的字符;
    组合模块,用于组合各个所述验证区域对应的字符,生成所述图片中的字符串。
  15. 根据权利要求11所述的验证短信的处理系统,其特征在于,所述本地服务器,还包括:
    存储模块,用于所述本地服务器存储由所述终端设备转发的验证短信,并存储所述验证短信与所述终端设备的对应关系;提示模块,用于在所述本地服务器接收到所述远端服务器发送的验证码错误通知后,或在接收到用户输入的查看验证短信的指令后,提示用户输入设备名称以及查看密码;显示模块,用于若用户输入的设备名称以及查看密码正确,则所述本地服务器显示所述设备名称对应的终端设备最新转发的验证短信。
  16. 根据权利要求12所述的验证短信的处理系统,其特征在于,还包括:
    若所述短信词不存在于所述关键词数据库中,则为所述短信词分配一个预设的关键词概率。
  17. 根据权利要求12所述的验证短信的处理系统,其特征在于,所述对所述短信的文本进行分词处理,包括:通过封装有基于dijkstra算法的分词程序对接收到的短信进行分词处理。
  18. 根据权利要求13所述的验证短信的处理系统,其特征在于,还包括:若所述特殊关键词之前的预设隔断标志与所述特殊关键词之后的所述预设隔断标志之间存在数字,则将所述数字作为所述验证码。
  19. 根据权利要求14所述的验证短信的处理系统,其特征在于,所述通过有监督学习模型识别各个所述验证区域的特征向量对应的字符,包括:通过支持向量机模型计算出验证区域的特征向量对应的字符。
  20. 根据权利要求11所述的验证短信的处理系统,其特征在于,还包括:若所述指令输入的时间与所述短信接收时间的差值大于时间差阈值,则不对验证短信进行识别。
PCT/CN2018/124338 2018-01-29 2018-12-27 验证短信的处理方法及系统 WO2019144756A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810084587.7A CN108366052B (zh) 2018-01-29 2018-01-29 验证短信的处理方法及系统
CN201810084587.7 2018-01-29

Publications (1)

Publication Number Publication Date
WO2019144756A1 true WO2019144756A1 (zh) 2019-08-01

Family

ID=63007232

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/124338 WO2019144756A1 (zh) 2018-01-29 2018-12-27 验证短信的处理方法及系统

Country Status (2)

Country Link
CN (1) CN108366052B (zh)
WO (1) WO2019144756A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114124455A (zh) * 2021-10-22 2022-03-01 中国联合网络通信集团有限公司 短信验证方法及短信验证系统
CN115767537A (zh) * 2022-11-15 2023-03-07 南京鼎山信息科技有限公司 一种短信验证码的权限处理方法、装置和计算机设备
CN116996840A (zh) * 2023-09-26 2023-11-03 北京百悟科技有限公司 短信审核方法、装置、设备和存储介质

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108366052B (zh) * 2018-01-29 2021-01-01 深圳壹账通智能科技有限公司 验证短信的处理方法及系统
CN109600722B (zh) * 2018-11-14 2021-11-02 平安科技(深圳)有限公司 短信接收验证方法及装置、电子设备、存储介质
CN110677338B (zh) * 2019-09-16 2021-10-15 北京达佳互联信息技术有限公司 验证信息计时方法、装置、电子设备和存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160092970A1 (en) * 2014-09-30 2016-03-31 Wal-Mart Stores, Inc. Systems and methods for performing in-store and online transactions
CN106170004A (zh) * 2016-09-23 2016-11-30 北京小米移动软件有限公司 处理验证码的方法及装置
CN106851602A (zh) * 2017-03-31 2017-06-13 武汉票据交易中心有限公司 一种交易系统短信验证方法及系统
CN108366052A (zh) * 2018-01-29 2018-08-03 深圳壹账通智能科技有限公司 验证短信的处理方法及系统

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103530642B (zh) * 2012-08-21 2016-03-09 深圳市中金岭南有色金属股份有限公司凡口铅锌矿 雷管自动识别机以及雷管编码图像识别方法
CN103618606A (zh) * 2013-11-26 2014-03-05 觅林网络科技(上海)有限公司 通过短信验证的App登录方法
WO2015188277A1 (en) * 2014-06-13 2015-12-17 BicDroid Inc. Methods, systems and computer program product for providing encryption on a plurality of devices
CN105703921A (zh) * 2014-11-24 2016-06-22 甘肃省科学技术情报研究所 一种利用手机短信远程控制服务器的装置和方法
CN105046140A (zh) * 2015-06-09 2015-11-11 苏州德锐朗智能科技有限公司 一种用于字符验证码的自动输入方法
CN105159533A (zh) * 2015-08-31 2015-12-16 努比亚技术有限公司 一种移动终端及其验证码自动输入方法
CN106294714A (zh) * 2016-08-08 2017-01-04 龙官波 一种信息采集方法和装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160092970A1 (en) * 2014-09-30 2016-03-31 Wal-Mart Stores, Inc. Systems and methods for performing in-store and online transactions
CN106170004A (zh) * 2016-09-23 2016-11-30 北京小米移动软件有限公司 处理验证码的方法及装置
CN106851602A (zh) * 2017-03-31 2017-06-13 武汉票据交易中心有限公司 一种交易系统短信验证方法及系统
CN108366052A (zh) * 2018-01-29 2018-08-03 深圳壹账通智能科技有限公司 验证短信的处理方法及系统

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114124455A (zh) * 2021-10-22 2022-03-01 中国联合网络通信集团有限公司 短信验证方法及短信验证系统
CN114124455B (zh) * 2021-10-22 2023-05-05 中国联合网络通信集团有限公司 短信验证方法及短信验证系统
CN115767537A (zh) * 2022-11-15 2023-03-07 南京鼎山信息科技有限公司 一种短信验证码的权限处理方法、装置和计算机设备
CN115767537B (zh) * 2022-11-15 2023-10-17 南京鼎山信息科技有限公司 一种短信验证码的权限处理方法、装置和计算机设备
CN116996840A (zh) * 2023-09-26 2023-11-03 北京百悟科技有限公司 短信审核方法、装置、设备和存储介质
CN116996840B (zh) * 2023-09-26 2023-12-29 北京百悟科技有限公司 短信审核方法、装置、设备和存储介质

Also Published As

Publication number Publication date
CN108366052B (zh) 2021-01-01
CN108366052A (zh) 2018-08-03

Similar Documents

Publication Publication Date Title
WO2019144756A1 (zh) 验证短信的处理方法及系统
CN107889070B (zh) 图片处理方法、装置、终端及计算机可读存储介质
EP2814212B1 (en) Method and apparatus for adding friend, and storage medium
US20220115012A1 (en) Method and apparatus for processing voices, device and computer storage medium
WO2022095735A1 (zh) 应用程序多语言支持方法、装置、计算机设备及存储介质
WO2016165557A1 (zh) 验证码的实现方法及装置
CN102405474A (zh) 使用基于地理地点或用户身份的信息的用户询问
CN112184367A (zh) 一种订单处理方法和装置
WO2020140925A1 (zh) 识别损坏二维码的方法、装置、设备以及存储介质
CN109670109A (zh) 信息获取方法、装置、服务器、终端和介质
CN105203121A (zh) 在地理应用程序中动态地整合离线和在线建议
CN106156595B (zh) 一种通过验证码图片进行验证的方法、装置及系统
JP2004164180A (ja) 情報処理装置、通信処理装置、および方法、並びにコンピュータ・プログラム
US9348999B2 (en) User terminal, reliability management server, and method and program for preventing unauthorized remote operation
WO2017093412A1 (en) System and method for detecting and predicting level of importance of electronic mail messages
CN110764685B (zh) 用于识别二维码的方法和设备
CN110519373B (zh) 用于推送信息的方法和装置
CN110912801B (zh) 一种检测电子红包的方法、系统及终端设备
CN111083705A (zh) 群发诈骗短信检测方法、装置、服务器及存储介质
CN116303888A (zh) 一种生僻字处理方法、装置、存储介质及电子设备
KR102347070B1 (ko) 단말기의 정보 처리 방법 및 장치
CN112272135B (zh) 一种存储软件的邮件发送方法、装置、设备及存储介质
CN112580762A (zh) 动态二维码及其识别方法和识别装置
CN113595884A (zh) 一种消息提醒方法及应用端
CN114386010A (zh) 应用登录方法、装置、电子设备以及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18902508

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18902508

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 30.11.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18902508

Country of ref document: EP

Kind code of ref document: A1