Voice verification code acquisition method and system, and electronic equipment
By performing voice recognition on audio data, obtaining and copying text verification codes to the system clipboard, the problem of low voice verification code recognition efficiency in the prior art is solved, and more efficient verification code input and recognition is achieved.
Patent Information
- Application Number
- CN202411432454.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-02-14
AI Technical Summary
There is a lack of an effective automatic identification and processing mechanism in the prior art to identify verification codes in telephone or voice messages, especially in a noisy environment, resulting in user inconvenience and uncertain verification process.
By performing voice recognition of audio data, obtaining text verification codes, and copying text verification codes to the system clipboard to invoke text verification codes through the system clipboard.
It improves the recognition efficiency and input efficiency of voice verification codes, and reduces the time and error rate of user manual input verification codes, especially on mobile devices.
Smart Images

Figure CN119449374A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of voice data processing, and in particular to a method, system and electronic device for obtaining a voice verification code. Background Art
[0002] The use of verification codes is ubiquitous in online services, where they are used as a security measure to verify the identity of users. Traditionally, verification codes are usually sent to users via text messages or voice calls, and users need to manually enter these verification codes to complete the verification process. This process is not only time-consuming and error-prone, but also particularly difficult on mobile devices, where small screens and virtual keyboards increase the difficulty of input and affect the user experience. In addition, manually entering verification codes can be particularly challenging for users with poor vision or limited hand movement.
[0003] At present, in the prior art, although there are some solutions for automatically filling in verification codes by parsing the content of SMS, there is still a lack of effective automatic recognition and processing mechanisms for verification codes in phone calls or voice messages. In a noisy environment, the voice recognition system of the prior art often has difficulty in accurately recognizing verification codes, which increases the inconvenience of users and the uncertainty of the verification process. At the same time, most of the existing voice recognition technologies do not support multiple languages or dialects, which limits their global application. In summary, the recognition efficiency and input efficiency of voice verification codes in the existing technical solutions are low. Summary of the invention
[0004] The embodiments of the present application provide a method, system and electronic device for obtaining a voice verification code. The text verification code is obtained by performing voice recognition on audio data, and the text verification code is copied to the system clipboard so that the text verification code can be called through the system clipboard. The present application can improve the recognition efficiency and input efficiency of the voice verification code.
[0005] The embodiments of the present application provide the following technical solutions:
[0006] In a first aspect, an embodiment of the present application provides a method for obtaining a voice verification code, the method comprising:
[0007] Acquire audio data, wherein the audio data includes a voice verification code;
[0008] Performing speech recognition on the audio data to convert the audio data into text data;
[0009] Perform text recognition on text data to obtain a text verification code;
[0010] Copy the text verification code to the system clipboard to call the text verification code through the system clipboard.
[0011] In some embodiments, after acquiring the audio data, the method further includes:
[0012] Determine the language type corresponding to the audio data through a multilingual model;
[0013] Determine the speech recognition model based on the language type corresponding to the audio data.
[0014] In some embodiments, performing speech recognition on the audio data to convert the audio data into text data includes:
[0015] Acquire a first speech signal in the audio data;
[0016] Performing noise reduction processing on the first speech signal to obtain a second speech signal;
[0017] encoding the second voice signal to convert the second voice signal into a digital signal;
[0018] Through the speech recognition model, the digital signal is subjected to speech recognition to obtain text data.
[0019] In some embodiments, performing noise reduction processing on the first speech signal to obtain the second speech signal includes:
[0020] Performing Fourier transform on the first speech signal to obtain a frequency spectrum corresponding to the first speech signal;
[0021] Obtain the spectrum of noise through audio data;
[0022] Acquire a spectrum after noise reduction processing according to the spectrum of the noise and the spectrum corresponding to the first speech signal;
[0023] Perform inverse Fourier transform on the spectrum after noise reduction processing to obtain a second speech signal.
[0024] In some embodiments, before performing text recognition on the text data to obtain the text verification code, the method further includes:
[0025] Performing a data cleaning operation on the text data to remove irrelevant information in the text data to obtain first processed data, wherein the irrelevant information includes stop words, punctuation marks, and blank characters;
[0026] The format of the first processed data is converted into a preset format to obtain preprocessed text data.
[0027] In some embodiments, performing text recognition on text data to obtain a text verification code includes:
[0028] According to the preprocessed text data, determining whether the text data contains preset keywords;
[0029] If the text data contains preset keywords, the text data is recognized by regular expressions to obtain a text verification code.
[0030] In some embodiments, after copying the text verification code to the system clipboard, the method further includes:
[0031] Through the application interface, the text verification code in the system clipboard is automatically filled into the field waiting for verification in the application.
[0032] In a second aspect, an embodiment of the present application provides a system for obtaining a voice verification code, the system comprising:
[0033] The server is connected to the user terminal in communication, and the server is used to receive audio data sent by the user terminal; perform speech recognition on the audio data to convert the audio data into text data;
[0034] The user terminal is connected to the server for communication. The user terminal is used to send audio data to the server, or receive text data sent by the server, perform text recognition on the text data, and obtain a text verification code; copy the text verification code to the system clipboard to call the text verification code through the system clipboard.
[0035] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0036] at least one processor; and
[0037] a memory communicatively connected to at least one processor; wherein,
[0038] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for obtaining a voice verification code as described in the first aspect.
[0039] In a fourth aspect, an embodiment of the present application provides a non-volatile computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are used to enable an electronic device to execute a method for obtaining a voice verification code such as the first aspect or the fourth aspect.
[0040] The beneficial effect of the implementation of the present application is that, different from the prior art, the implementation of the present application provides a method for obtaining a voice verification code, the method comprising: obtaining audio data, wherein the audio data includes a voice verification code; performing voice recognition on the audio data to convert the audio data into text data; performing text recognition on the text data to obtain a text verification code; copying the text verification code to the system clipboard to call the text verification code through the system clipboard. By performing voice recognition on the audio data to obtain the text verification code, and copying the text verification code to the system clipboard to call the text verification code through the system clipboard, the present application can improve the recognition efficiency and input efficiency of the voice verification code. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] One or more embodiments are exemplarily described by corresponding drawings, which do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and the figures in the drawings do not constitute proportional limitations unless otherwise stated.
[0042] Figure 1 It is a structural diagram of a system for obtaining a voice verification code provided in an embodiment of the present application;
[0043] Figure 2 A flowchart of a method for obtaining a voice verification code provided in an embodiment of the present application;
[0044] Figure 3 It is a schematic diagram of a flow chart of determining a speech recognition model provided in an embodiment of the present application;
[0045] Figure 4 yes Figure 2 A detailed flow chart of step S202 in FIG.
[0046] Figure 5 yes Figure 4 A detailed flow chart of step S222 in FIG.
[0047] Figure 6 This is a schematic diagram of a process for obtaining preprocessed text data provided by an embodiment of the present application;
[0048] Figure 7 yes Figure 2 A detailed flow chart of step S203 in FIG.
[0049] Figure 8 It is a flowchart of filling a text verification code into a field to be verified provided by an embodiment of the present application;
[0050] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0051] Description of Figure Numbers:
[0052]
[0053] DETAILED DESCRIPTION
[0054] In order to facilitate the understanding of the present application, the present application is described in more detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that when an element is described as "fixed to" another element, it can be directly on the other element, or there can be one or more centered elements therebetween. When an element is described as "connected to" another element, it can be directly connected to the other element, or there can be one or more centered elements therebetween. The terms "vertical", "horizontal", "left", "right" and similar expressions used in this specification are for illustrative purposes only.
[0055] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used in this specification and in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The term "and / or" used in this specification includes any and all combinations of one or more of the related listed items.
[0056] The technical solution of the present application is described in detail below in conjunction with the accompanying drawings:
[0057] See also Figure 1 , Figure 1 It is a structural diagram of a system for obtaining a voice verification code provided in an embodiment of the present application;
[0058] like Figure 1 As shown, the voice verification code acquisition system 100 includes: a user terminal 101 and a server 102, wherein the user terminal 101 and the server 102 are connected via a network communication, wherein the network includes a wired network and / or a wireless network. It is understandable that the network includes wireless networks such as 2G, 3G, 4G, 5G, wireless LAN, Bluetooth, etc., and may also include wired networks such as serial cables and network cables.
[0059] The user terminal 101 is connected to the server 102 in communication, and is used to send audio data to the server 102, or receive text data sent by the server 102, perform text recognition on the text data, and obtain a text verification code; copy the text verification code to the system clipboard, so as to call the text verification code through the system clipboard; specifically, after the user terminal receives a call or a voice message, the audio data in the call or the voice message is obtained, and the audio data is sent to the server, so that the server processes the audio data and obtains text data; the user terminal receives the text data sent by the server, and performs a data cleaning operation on the text data to remove the text data. The invention relates to a method for obtaining first processed data by removing irrelevant information in the text data, wherein the irrelevant information includes stop words, punctuation marks and blank characters; converting the format of the first processed data into a preset format to obtain preprocessed text data; judging whether the text data contains preset keywords based on the preprocessed text data; if the text data contains preset keywords, performing text recognition on the text data through regular expressions to obtain a text verification code; copying the text verification code to a system clipboard, calling the text verification code through the system clipboard, and then automatically filling the text verification code in the system clipboard into a field waiting for verification in the application through an application program interface.
[0060] In the embodiment of the present application, the user terminal may be a device, or a component, integrated circuit, or chip in the terminal. The device may be a mobile electronic device or a non-mobile electronic device. For example, the mobile electronic device may be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile electronic device may be a server, a network attached storage (NAS), a personal computer (PC), etc., which is not specifically limited in the embodiment of the present application.
[0061] The server 102 is communicatively connected to the user terminal 101, and is used to receive audio data sent by the user terminal 101; perform speech recognition on the audio data to convert the audio data into text data; specifically, after receiving the audio data sent by the user terminal, the server determines the language type corresponding to the audio data through a multilingual model; determines a speech recognition model according to the language type corresponding to the audio data; obtains a first speech signal in the audio data; performs noise reduction processing on the first speech signal to obtain a second speech signal; encodes the second speech signal to convert the second speech signal into a digital signal; and performs speech recognition on the digital signal through a speech recognition model to obtain text data.
[0062] In the embodiment of the present application, the number of the server 102 may be one or more, and a plurality of servers may constitute a server cluster, for example, the server cluster includes a first server, a second server, ..., an Nth server, or the server cluster may be a cloud computing service center, which includes a plurality of servers. The servers in the embodiment of the present application include, but are not limited to, tower servers, rack servers, blade servers, and cloud servers. Preferably, the server is a cloud server (Elastic Compute Service, ECS).
[0063] In some embodiments, the voice verification code acquisition system may include two or more user terminals. For example, when the voice verification code acquisition system includes a first user terminal and a second user terminal, after the first user terminal receives the voice verification code, it sends the voice verification code to the server, the server performs voice recognition on the voice verification code, and converts the voice verification code into text data, and the server can send the text data to the second user terminal through the cloud service, so that the second user terminal receives the text data, and performs text recognition on the text data to obtain the text verification code; or, after the first user terminal receives the voice verification code, it sends the voice verification code to the server, the server performs voice recognition on the voice verification code, and converts the voice verification code into text data, and the server can send the text data to the first user terminal through the cloud service, so that the first user terminal receives the text data, and performs text recognition on the text data to obtain the text verification code, and the first user terminal uploads the text verification code to the server, so that the server sends the text verification code to the second user terminal synchronously.
[0064] It can be understood that this method can provide a user experience of seamlessly obtaining verification codes on multiple devices, allowing users to receive and process verification codes on multiple devices without manually switching between devices. For example, a user receives a verification code on one device, and this verification code can be synchronized to the user's other devices in real time through cloud services. Alternatively, the user installs the same application or uses the same service on multiple devices, and these applications or services synchronize data with the cloud service in the background through the user account. When a device receives a verification code, the application synchronizes the verification code information to other devices through the cloud service. This method can improve the efficiency of receiving verification codes on multiple devices.
[0065] See also Figure 2 , Figure 2 A flowchart of a method for obtaining a voice verification code provided in an embodiment of the present application;
[0066] The method for obtaining a voice verification code is applied to an electronic device. Specifically, the method is performed by one or more processors of the electronic device.
[0067] like Figure 2 As shown, the method for obtaining the voice verification code includes:
[0068] Step S201: Acquire audio data;
[0069] Specifically, audio data is obtained from a phone call or a voice message, wherein the method of obtaining the audio includes recording the phone call or the voice message to obtain the audio data, and the audio data includes a voice verification code.
[0070] Please refer to Figure 3 , Figure 3 It is a schematic diagram of a flow chart of determining a speech recognition model provided in an embodiment of the present application;
[0071] In an embodiment of the present application, since the acquired audio data may be audio in different languages, for example, the language used in the audio data may be Mandarin or a dialect, or it may be the language of other countries, such as English, French, German, etc., after acquiring the audio data, it is necessary to identify the audio data to determine the language type of the audio data, and then determine the speech recognition model corresponding to the language type.
[0072] like Figure 3 As shown in FIG. 1 , the process of determining the speech recognition model includes:
[0073] Step S301: Determine the language type corresponding to the audio data through a multilingual model;
[0074] Specifically, the multi-language model is a language recognition model based on machine learning. The multi-language model can analyze and recognize audio data and determine the language type of the audio. It can be understood that the multi-language model is trained based on a large amount of audio test data of different language types. In the training results, each language type of audio corresponds to an acoustic feature. During the recognition process, the multi-language model will analyze and recognize the acoustic features of different languages in the audio data, such as audio frequency, pitch, speaking speed, etc., to determine the language type corresponding to the audio data. Among them, the multi-language model includes but is not limited to the Whisper speech recognition model, ERes2Net developed and used in python, and CAM++ model.
[0075] In some embodiments, the audio data can also be input into the corresponding API through the speech recognition API for speech-to-text recognition. These APIs usually support multiple languages and return the recognition results in text form. Then, the language type of the audio data is obtained based on the specific words, spellings and grammar rules that appear in the text. Among them, the speech recognition API includes but is not limited to Google Cloud Speech-to-Text, Microsoft Azure Speech-to-Text, etc.
[0076] Step S302: determining a speech recognition model according to the language type corresponding to the audio data;
[0077] Specifically, each language type corresponds to a speech recognition model. After determining the language type corresponding to the audio data, the speech recognition model is determined according to the language type corresponding to the audio data. For example, assuming that the audio data is recognized as English, the speech recognition model corresponding to English is used to perform the following speech recognition operations.
[0078] In the embodiment of the present application, by using multilingual training data sets, the model's recognition ability for different languages and dialects is enhanced. These data sets contain speech samples of various languages and dialects, helping the multilingual model to learn different speech features, wherein the training methods include deep learning and machine learning and multi-task learning, and deep learning and machine learning refer to processing and recognizing speech features of different languages by using deep learning architectures such as deep neural networks (DNNs), convolutional neural networks (CNNs) and recurrent neural networks (RNNs). These networks can learn complex patterns from a large amount of multilingual data, and multi-task learning refers to the ability to simultaneously train models to recognize multiple languages and dialects in a multi-task learning framework. By sharing hidden layers, different language tasks can jointly utilize some common speech feature representations while maintaining independent output layers for specific languages.
[0079] Step S202: performing speech recognition on the audio data to convert the audio data into text data;
[0080] For details, please refer to Figure 4 , Figure 4 yes Figure 2 A detailed flow chart of step S202 in FIG.
[0081] like Figure 4 As shown, step S202: performing speech recognition on the audio data to convert the audio data into text data, including:
[0082] Step S221: Acquire a first speech signal in the audio data;
[0083] Specifically, a first voice signal in the audio data is obtained through an audio processing tool, wherein the first voice signal is a voice signal containing human voice, and the audio processing tool includes but is not limited to Voicemeeter, RX Audio Editor and other tools, and the audio processing tool is used to separate the human voice from the mixed audio.
[0084] Step S222: performing noise reduction processing on the first speech signal to obtain a second speech signal;
[0085] For details, please refer to Figure 5 , Figure 5 yes Figure 4 A detailed flow chart of step S222 in FIG.
[0086] like Figure 5As shown, step S222: performing noise reduction processing on the first speech signal to obtain a second speech signal, including:
[0087] Step S2221: performing Fourier transform on the first speech signal to obtain a frequency spectrum corresponding to the first speech signal;
[0088] Specifically, Fourier transform is a mathematical tool that converts a function (or signal) from the time domain to the frequency domain. It decomposes a function into the sum of a series of sine and cosine functions to obtain the frequency spectrum information of the function at different frequencies. The first voice signal is subjected to Fourier transform to convert the first voice signal from the time domain to the frequency domain. That is to say, Fourier transform can decompose a voice signal into a superposition of sine waves of different frequencies. The amplitude and phase information of these sine waves constitute the spectrum of the signal, thereby obtaining the spectrum corresponding to the first voice signal.
[0089] Step S2222: Obtain the frequency spectrum of noise through audio data;
[0090] Specifically, the audio corresponding to the time period without human voice in the audio data is obtained. It can be understood that the audio corresponding to the time period without human voice is a section of audio data with no voice and noise. The frequency spectrum of the noise is obtained by performing Fourier transform on the section of audio data with no voice and noise.
[0091] Step S2223: acquiring a spectrum after noise reduction processing according to the spectrum of the noise and the spectrum corresponding to the first speech signal;
[0092] Specifically, after the spectrum of the noise and the spectrum corresponding to the first speech signal are acquired, the spectrum of the noise is subtracted from the spectrum corresponding to the first speech signal to obtain a difference spectrum, and the difference spectrum is determined as the spectrum after noise reduction processing.
[0093] Step S2224: performing inverse Fourier transform on the spectrum after noise reduction processing to obtain a second speech signal;
[0094] Specifically, after obtaining the spectrum after noise reduction processing, the spectrum after noise reduction processing is inverse Fourier transformed to convert it back to the time domain through inverse Fourier transform to obtain a second speech signal. It can be understood that the second speech signal is the speech signal after noise reduction processing.
[0095] Step S223: Encode the second voice signal to convert the second voice signal into a digital signal;
[0096] Specifically, the second voice signal is encoded to convert it into a binary digital signal, i.e., encoding. Among them, the voice encoding methods include, but are not limited to, waveform encoding, parametric encoding, and hybrid encoding. Waveform encoding is a digital signal formed by sampling, quantizing, and encoding the second voice signal in the time domain. Parametric encoding is based on the pronunciation mechanism of human language to find the characteristic parameters representing the voice for encoding. Hybrid encoding and decoding is a method that combines waveform encoding and decoding and parametric encoding and decoding.
[0097] Step S224: Perform voice recognition on the digital signal through a voice recognition model to obtain text data;
[0098] Specifically, obtain the voice recognition model determined in step S302, and extract features from the digital signal through the voice recognition model to extract feature information from the voice signal. Among them, the feature information includes, but is not limited to, Mel Frequency Cepstral Coefficients (MFCC), Linear Predictive Coding (LPC), and cepstral coefficients, etc. It can be understood that the above-listed feature information includes information such as the prosody, pitch, timbre, and phoneme of the sound; further, compare the extracted feature information with a predefined word library, convert the sound signal into corresponding text output data, and in this step, a statistical model such as a Gaussian Mixture Model (GMM), a Deep Neural Network Model (DNN), and a Convolutional Neural Network (CNN), etc., is used to decode the text output data to obtain the text data corresponding to the feature information.
[0099] Please refer to Figure 6 , Figure 6 which is a schematic flowchart of a process for obtaining preprocessed text data provided by an embodiment of the present application;
[0100] As Figure 6 shown, the process for obtaining preprocessed text data includes:
[0101] Step S601: Perform data cleaning operations on the text data to remove irrelevant information in the text data to obtain first-processed data;
[0102] Specifically, perform data cleaning operations on the text data to remove irrelevant information in the text data. Among them, the irrelevant information includes, but is not limited to, stop words, punctuation marks, and blank characters. Removing blank characters means deleting the blank characters in the text data, including spaces, tab characters, line break characters, etc., to reduce the analysis error caused by format problems. Removing stop words means deleting the stop words in the text, such as common words like "de", "le", "zai", etc., to reduce the interference of irrelevant information. Removing punctuation marks means deleting the special symbols in the text data, such as punctuation marks, numbers, etc., to reduce the interference with subsequent analysis and recognition. Finally, determine the data after removing the irrelevant information in the text data as the obtained first-processed data.
[0103] Step S602: converting the format of the first processed data into a preset format to obtain pre-processed text data;
[0104] Specifically, in order to increase the accuracy of subsequent text recognition, it is necessary to convert the format of the first processed data into a preset format, wherein the preset format can be set according to actual needs. For example, the font of the first processed data is uniformly set to Songti, and all letters in the first processed data are converted into lowercase or uppercase for unified processing to avoid problems caused by inconsistent uppercase and lowercase letters, and finally obtain the preprocessed text data.
[0105] Step S203: Perform text recognition on the text data to obtain a text verification code;
[0106] For details, please refer to Figure 7 , Figure 7 yes Figure 2 A detailed flow chart of step S203 in FIG.
[0107] like Figure 7 As shown, step S203: performing text recognition on the text data to obtain a text verification code includes:
[0108] Step S231: obtaining preprocessed text data;
[0109] Specifically, preprocessed text data is obtained, wherein the preprocessed text data refers to text that has undergone a data cleaning operation and has been converted into a preset format.
[0110] Step S232: judging whether the text data contains preset keywords according to the preprocessed text data;
[0111] Specifically, since similar information such as "The verification code is xxx" will appear in the voice message containing the verification code, it is determined whether the text data contains preset keywords based on the preprocessed text data, where the preset keywords include but are not limited to "verification code" and "verification code is". If the text data contains the preset keywords, step S233 is entered; if the text data does not contain the preset keywords, step S2334 is entered.
[0112] Step S233: Perform text recognition on the text data using a regular expression to obtain a text verification code;
[0113] Specifically, if the text data contains preset keywords, the text data is recognized by a regular expression to obtain a text verification code, wherein a regular expression is a text processing tool, which is used to describe and identify the pattern of a string. In the embodiment of the present application, the verification code usually has a fixed format, such as a string of numbers, letters, or a combination of the two of a specific length. According to the specific format of the verification code, the verification code can be matched by writing a corresponding regular expression. For example, it is assumed that there are two formats of the verification code: the format of the first verification code is: composed only of numbers, with a length of 6 digits, for example: 123456; the format of the second verification code is: composed of numbers and uppercase letters , with a length of 8 digits, for example: 1A2B3C4D; then, for the above two formats of verification codes, two regular expressions can be written: for a 6-digit verification code consisting of only numbers, the regular expression is: \d{6}; for an 8-digit verification code consisting of numbers and uppercase letters, the regular expression is: [A-Z0-9]{8}. The verification codes in the text data are matched by these two regular expressions. It can be understood that when the verification code in the text data is a verification code in the first format, the first regular expression can match the verification code; when the verification code in the text data is a verification code in the second format, the second regular expression can match the verification code, and then the text verification code is obtained.
[0114] In some embodiments, the verification code in the text data can also be identified by a string matching algorithm, wherein the string matching algorithm includes but is not limited to the Knuth-Morris-Pratt (KMP) algorithm, the Boyer-Moore algorithm, the Rabin-Karp algorithm, the Aho-Corasick algorithm, and the Commentz-Walter algorithm. The Knuth-Morris-Pratt (KMP) algorithm is used to find the position of a specific substring in a text string. The algorithm calculates a partial match table for determining the next comparison starting point when there is no match, thereby improving the search efficiency; the Boyer-Moore algorithm starts matching from the end of the pattern string. match, and use the information of unmatched characters to skip as many useless positions as possible; the Rabin-Karp algorithm is used to use a hash function to quickly screen out candidate matching positions, calculate the hash value corresponding to each substring, and compare it with the hash value of the pattern string. If the hash value matches, the actual string is further checked; the Aho-Corasick algorithm is a multi-pattern string matching algorithm based on a finite state machine, which can scan the input string at the same time to find a set of pattern strings; the Commentz-Walter algorithm is an extension of the Boyer-Moore algorithm, which is used to use the bad word rule and the good suffix rule to slide the maximum distance when there is a mismatch, realize the jump matching of the pattern string, and thus reduce the time overhead.
[0115] In an embodiment of the present application, in the context of verification code recognition, a pattern matching algorithm can be used to identify and extract numbers, letters or strings of a specific format in the verification code. For example, if the verification code is a string of numbers or letters, a regular expression can be used to match this pattern; if the verification code has a more complex structure, such as a specific length or contains a specific character set, a more advanced string matching algorithm may be required to accurately identify the text data.
[0116] Step S234: not processing the preprocessed text data;
[0117] Specifically, if the text data does not include the preset keyword, it means that the text data does not include a text verification code, and the preprocessed text data is not processed.
[0118] Step S204: copying the text verification code to the system clipboard, so as to call the text verification code through the system clipboard;
[0119] Specifically, the system clipboard is a temporary copy stored in the memory. After obtaining the text verification code, the text verification code is copied to the system clipboard so that subsequent users can call the text verification code through the system clipboard. For example, the user can fill the text verification code into the field to be verified by clicking on the text verification code in the clipboard.
[0120] Please refer to Figure 8 , Figure 8 It is a flowchart of filling a text verification code into a field to be verified provided by an embodiment of the present application;
[0121] like Figure 8 As shown in the figure, the process of filling the text verification code into the field to be verified includes:
[0122] Step S801: automatically filling the text verification code in the system clipboard into the field waiting for verification in the application program through the application program interface;
[0123] Specifically, through the Application Programming Interface (API), the application can call the text verification code in the system clipboard. When the user performs a copy operation, the obtained text verification code is transferred to the clipboard; when the user performs a paste operation, the system reads the text verification code from the clipboard and inserts it into the target location, where the target location includes the field waiting for verification in the application. For example, when the user needs to use a mobile phone number to log in to an application, a voice verification code is received. The electronic device automatically recognizes the voice verification code and converts the voice verification code into a text verification code. The system will automatically copy the text verification code to the system clipboard and provide an option on the display screen of the electronic device to quickly fill in the activated text field. The user selects the quick fill option, and the verification code is filled in the corresponding field to be verified.
[0124] It can be understood that through the above-mentioned method of obtaining voice verification codes, users do not need to manually enter verification codes, thereby saving operation time and reducing the possibility of input errors on mobile devices, improving the accuracy of verification code processing and the efficiency of verification code input, and the automatic processing flow of the verification code reduces the risk of the verification code being observed when it is manually entered in public places, enhances security and privacy protection, and for users with poor eyesight or limited hand movement, the function of automatically identifying and filling in verification codes improves the user experience.
[0125] In an embodiment of the present application, the present application embodiment provides a method for obtaining a voice verification code, the method comprising: obtaining audio data, wherein the audio data includes a voice verification code; performing voice recognition on the audio data to convert the audio data into text data; performing text recognition on the text data to obtain a text verification code; copying the text verification code to a system clipboard to call the text verification code through the system clipboard. By performing voice recognition on the audio data to obtain a text verification code, and copying the text verification code to the system clipboard to call the text verification code through the system clipboard, the present application can improve the recognition efficiency and input efficiency of the voice verification code.
[0126] Please refer to Fig. 9 , Fig. 9 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;
[0127] like Fig. 9 As shown, the electronic device 901 includes one or more processors 911 and a memory 912. Fig. 9 A processor 911 is taken as an example.
[0128] The processor 911 and the memory 912 may be connected via a bus or other means. Fig. 9 The example of connecting through bus is taken in the following.
[0129] Processor 911 is used to provide computing and control capabilities to control the electronic device 901 to perform corresponding tasks, for example, to control the electronic device 901 to execute the method for obtaining a voice verification code in any one of the above-mentioned method embodiments, the method for obtaining a voice verification code comprising: obtaining audio data, wherein the audio data comprises a voice verification code; performing voice recognition on the audio data to convert the audio data into text data; performing text recognition on the text data to obtain a text verification code; and copying the text verification code to a system clipboard to call the text verification code through the system clipboard.
[0130] By performing voice recognition on audio data, obtaining a text verification code, and copying the text verification code to the system clipboard, so as to call the text verification code through the system clipboard, the present application can improve the recognition efficiency and input efficiency of the voice verification code.
[0131] The processor 911 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), a hardware chip or any combination thereof; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
[0132] The second memory 912 is a non-transitory computer-readable storage medium that can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the method for obtaining a voice verification code in the embodiment of the present application. The processor 911 can implement the above by running the non-transitory software programs, instructions and modules stored in the second memory 912. Figure 2Method for obtaining a voice verification code in. Specifically, the second memory 912 may include a volatile memory (VM), such as a random access memory (RAM); the second memory 912 may also include a non-volatile memory (NVM), such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD) or other non-transitory solid-state storage device; the second memory 912 may also include a combination of the above-mentioned types of memory.
[0133] The second memory 912 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 912 may optionally include a memory remotely arranged relative to the processor 911, and these remote memories may be connected to the processor 911 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0134] One or more modules are stored in the processor 911. When executed by one or more processors 911, the method for obtaining the voice verification code in any of the above method embodiments is executed. For example, the method described above is executed. Figure 2 The steps shown.
[0135] In the embodiment of the present application, the electronic device 901 may also have components such as a wired or wireless network interface, a keyboard, and an input / output interface for input and output. The electronic device 901 may also include other components for realizing device functions, which will not be described in detail here.
[0136] The embodiment of the present application also provides a non-volatile computer-readable storage medium, such as a memory including a program code, and the program code can be executed by a processor to complete the method for obtaining the voice verification code in the above embodiment. For example, the non-volatile computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CDROM), a magnetic tape, a floppy disk, and an optical data storage device.
[0137] The embodiment of the present application also provides a computer program product, which includes one or more program codes, and the program codes are stored in a non-volatile computer-readable storage medium. The processor of the electronic device reads the program code from the non-volatile computer-readable storage medium, and the processor executes the program code to complete the method steps of the method for obtaining the voice verification code provided in the above embodiment.
[0138] A person skilled in the art will appreciate that all or part of the steps for implementing the above embodiments may be accomplished by hardware or by hardware associated with a program code, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0139] Through the description of the above implementation methods, a person of ordinary skill in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, can also be implemented by hardware. A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the non-volatile computer-readable storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0140] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Under the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes in different aspects of the present application as mentioned above, which are not provided in detail for the sake of simplicity. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features can be replaced by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for obtaining a voice verification code, characterized in that: The method comprises: Acquire audio data, wherein the audio data includes a voice verification code; Performing speech recognition on the audio data to convert the audio data into text data; Performing text recognition on the text data to obtain a text verification code; The text verification code is copied to a system clipboard, so as to call the text verification code through the system clipboard.
2. The method according to claim 1, characterized in that: After acquiring the audio data, the method further includes: Determining the language type corresponding to the audio data through a multilingual model; A speech recognition model is determined according to the language type corresponding to the audio data.
3. The method according to claim 2, characterized in that The performing speech recognition on the audio data to convert the audio data into text data includes: Acquire a first speech signal in the audio data; Performing noise reduction processing on the first speech signal to obtain a second speech signal; encoding the second voice signal to convert the second voice signal into a digital signal; The digital signal is subjected to speech recognition through the speech recognition model to obtain text data.
4. The method according to claim 3, characterized in that The performing noise reduction processing on the first speech signal to obtain a second speech signal includes: Performing Fourier transform on the first speech signal to obtain a frequency spectrum corresponding to the first speech signal; Obtaining a frequency spectrum of noise through the audio data; Acquire a spectrum after noise reduction processing according to the spectrum of the noise and the spectrum corresponding to the first speech signal; Perform inverse Fourier transform on the frequency spectrum after the noise reduction processing to obtain the second speech signal.
5. The method according to claim 1, characterized in that Before performing text recognition on the text data to obtain a text verification code, the method further includes: Performing a data cleaning operation on the text data to remove irrelevant information in the text data to obtain first processed data, wherein the irrelevant information includes stop words, punctuation marks, and blank characters; The format of the first processed data is converted into a preset format to obtain preprocessed text data.
6. The method according to claim 5, characterized in that The performing text recognition on the text data to obtain a text verification code includes: According to the preprocessed text data, determining whether the text data contains preset keywords; If the text data contains preset keywords, the text data is subjected to text recognition through a regular expression to obtain a text verification code.
7. The method according to claim 1, characterized in that After copying the text verification code to the system clipboard, the method further includes: Through the application program interface, the text verification code in the system clipboard is automatically filled into the field waiting for verification in the application program.
8. A system for obtaining a voice verification code, characterized in that: The system comprises: A server, the server being communicatively connected to a user terminal, and the server being used to receive audio data sent by the user terminal; performing speech recognition on the audio data to convert the audio data into text data; A user terminal, wherein the user terminal is communicatively connected to the server, and the user terminal is used to send audio data to the server, or receive text data sent by the server, perform text recognition on the text data to obtain a text verification code; and copy the text verification code to a system clipboard so as to call the text verification code through the system clipboard.
9. An electronic device, characterized in that: include: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for obtaining a voice verification code as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program or instruction. When the computer program or instruction is executed, the method for obtaining a voice verification code according to any one of claims 1 to 7 is implemented.