Verification code acquisition method, electronic equipment and storage medium

By analyzing the request to obtain the verification code, using the verification strategy of the mobile phone number and IP address, the verification code is generated and issued, solving the problem of poor user experience and realizing a safe and convenient verification code acquisition process.

CN119653360AInactive Publication Date: 2025-03-18SHENZHEN XINRUISHI TECH CO LTD
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202411601162.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-03-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the current process of obtaining verification codes from the server, the user experience is poor, especially for middle-aged and elderly users, it may be difficult to identify the character information displayed in the graphic verification code, resulting in poor user experience.

Method used

By analyzing the request to obtain the verification code, the information carried by the request, such as the mobile phone number and/or IP address, determine whether the information has passed the verification according to the preset verification strategy, and if it is passed, a verification code will be generated and issued. The method includes querying the mobile phone number and IP address in the preset database, determining the number of requests within the preset time and the number of unique identification codes of the device to determine the legitimacy of the information.

Benefits of technology

It realizes the process of manually inputting the graphic verification code content from the server while safely obtaining verification code from the server, reducing user input items, improving user experience, and making the entire verification code acquisition process safe, convenient and efficient.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119653360A_ABST
    Figure CN119653360A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, in particular to a verification code obtaining method, electronic equipment and a computer readable storage medium, and the method comprises the steps: receiving a verification code obtaining request; analyzing the request to obtain information carried by the request; wherein the information comprises a mobile phone number and / or an IP address of the terminal equipment sending the request; judging whether the information passes verification according to a preset verification strategy; and if so, generating and sending a verification code. Visibly, according to the verification code acquisition method, the electronic equipment and the computer readable storage medium, by verifying the information of the mobile phone number and / or the IP address carried in the verification code acquisition request, the verification code is safely acquired from the server, and meanwhile, the process of manually inputting the content of the graphic verification code by a user is omitted. According to the mode of obtaining the verification code, when the user requests the verification code from the server, the user does not need to face the difficulty of identifying the graphic verification code, so that the input items of the user are reduced, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method for obtaining a verification code, an electronic device and a computer-readable storage medium. Background Art

[0002] As we all know, when users use mobile APP (Application) to register a new account or retrieve an account password, they need to request a verification code from the server. After receiving the request, the server will send the verification code to the user via SMS or email so that the user can obtain the verification code and continue to perform subsequent operations based on the verification code. However, due to the openness of the server interface, some malicious applications may simulate this behavior of the client, request a verification code from the server, and identify the content of the verification code through an algorithm, resulting in losses in server operations.

[0003] In order to reduce the losses caused by this phenomenon, the server usually adds a human-machine verification process before sending the verification code, that is, verifying the authenticity of the user's identity and operation to ensure that the request for obtaining the verification code comes from the user's own operation. Only after passing the human-machine verification will the server issue the verification code. In this human-machine verification process, the server will generate a graphic verification code containing numbers and letters, and require the user to enter the character information displayed in the graphic verification code. In order to enhance the security of the graphic verification code, the generated graphic verification code may also add confusing lines or graphics, and tilt the characters. The user enters the character information according to the effect presented by the graphic verification code. The server will further issue the verification code only after confirming that the user has entered the correct character information. This strict human-machine verification process can greatly improve the security of the server interface, but it also increases the difficulty of user operation. Especially for middle-aged and elderly users, it may be difficult to identify the character information displayed in the graphic verification code, which greatly reduces the user experience. Therefore, in order to balance security and user-friendliness, the server needs to find a better security verification method to ensure the security of the verification code acquisition process while improving the user experience. Summary of the invention

[0004] In view of this, the present invention proposes a method for obtaining a verification code, an electronic device and a computer-readable storage medium, aiming to solve the problem of poor user experience in the existing process of obtaining a verification code from a server.

[0005] In order to solve the above problems, the present invention adopts the following technical solutions:

[0006] In a first aspect, the present invention proposes a method for obtaining a verification code, comprising:

[0007] A request for obtaining a verification code is received;

[0008] By parsing the request, obtaining information carried in the request; wherein the information includes the mobile phone number and / or IP address of the terminal device sending the request;

[0009] Determine whether the information has passed the verification according to the preset verification strategy; if passed, generate and issue a verification code.

[0010] Furthermore, when the information is a mobile phone number, determining whether the information has passed verification according to a preset verification strategy includes:

[0011] Querying the mobile phone number in a preset database and determining the number of unique device identification codes that match the queried mobile phone number, and if the number is greater than or equal to a preset number, determining that the information fails verification;

[0012] The preset database includes a mobile phone information table, which includes a plurality of information records, each of which includes a mobile phone number and a device unique identification code, and each of the mobile phone numbers corresponds to at least one device unique identification code.

[0013] Furthermore, after searching the preset database for the mobile phone number, the method further includes:

[0014] If the mobile phone number is not found, insert a new information record into the mobile phone information table; wherein the new information record records the mobile phone number, the unique device identification code corresponding to the mobile phone number, and the recording time;

[0015] If the mobile phone number is found but the device unique identification code that matches the found mobile phone number is not found, insert a new information record into the mobile phone information table; wherein the new information record records the mobile phone number, the device unique identification code corresponding to the mobile phone number, and the recording time;

[0016] If the mobile phone number is found and a unique device identification code matching the found mobile phone number is found, then the recording time of the corresponding information record in the mobile phone information table is replaced with the current time;

[0017] Each information record includes a one-to-one corresponding device unique identification code and recording time, and the information also includes a device unique identification code of the terminal device that sends the request.

[0018] Furthermore, when the information is a mobile phone number, determining whether the information has passed verification according to a preset verification strategy includes:

[0019] Query the mobile phone number in a preset database, and determine the number of times the queried mobile phone number sends a request within a preset first time period, and if the number is greater than or equal to the preset first number, determine that the information fails the verification; wherein the preset database includes a first request record table, the first request record table includes a plurality of request records, and each request record includes a one-to-one corresponding mobile phone number and request time;

[0020] When the information is an IP address, determining whether the information passes verification according to a preset verification strategy includes:

[0021] The IP address is queried in a preset database, and the number of times the queried IP address sends a request within a preset second time period is determined. If the number is greater than or equal to the preset second number, it is determined that the information fails the verification; wherein the preset database includes a second request record table, the second request record table includes a number of request records, and each request record includes a one-to-one corresponding IP address and request time.

[0022] Further, the generating and issuing of the verification code includes:

[0023] Generate a verification code and send it via SMS and / or email, and record the mobile phone number, IP address, verification code and sending time in a preset database;

[0024] Among them, the preset database includes a sending record table, which includes several sending records, each of which includes a mobile phone number, an IP address, a verification code and a sending time, and each mobile phone number corresponds to an IP address, a verification code and a sending time.

[0025] Further, generating the request includes:

[0026] In response to the trigger instruction, obtain the unique device identification code of the terminal device and the current time information of the system;

[0027] splicing a preset first character sequence to the device unique identification code to obtain an encrypted plaintext string, and splicing a preset second character sequence to the time information to obtain an encrypted key string;

[0028] Using the encryption key string and a preset encryption algorithm to encrypt the encrypted plaintext string to obtain an encrypted string;

[0029] The encrypted string is transcoded into an encrypted text string using a preset encoding algorithm, and the request is generated according to the encrypted text string.

[0030] Further, the step of concatenating the preset first character sequence with the device unique identification code to obtain an encrypted plaintext string, and concatenating the preset second character sequence with the time information to obtain an encrypted key string includes:

[0031] splicing a preset first character sequence to the header of the device unique identification code to obtain an encrypted plaintext string, and splicing a preset second character sequence to the header of the time information to obtain an encryption key string;

[0032] The step of using the encryption key string and encrypting the encrypted plaintext string by a preset encryption algorithm includes:

[0033] According to a preset encryption algorithm, the encrypted plaintext string is completed between a preset first character sequence and the unique identification code of the device to obtain a completed encrypted plaintext string; wherein the completed encrypted plaintext string meets the alignment requirement of the preset encryption algorithm;

[0034] The completed encrypted plaintext string is encrypted using the encryption key string and a preset encryption algorithm.

[0035] Further, parsing the request includes:

[0036] splicing a preset second character sequence to the header of the current time information of the system to obtain a decryption key string; wherein the received request includes the encrypted text string;

[0037] Using a preset decoding algorithm to transcode the encrypted text string into an encrypted string, and using the decryption key string and a preset decryption algorithm to decrypt the encrypted string to obtain a decrypted plaintext string; wherein the decrypted plaintext string includes the information;

[0038] The determining whether the information has passed the verification according to the preset verification strategy includes:

[0039] Verify whether the decrypted plaintext string meets the alignment requirement of the preset decryption algorithm. If not, determine that the information fails the verification; wherein the alignment requirement of the preset decryption algorithm is consistent with the alignment requirement of the preset encryption algorithm.

[0040] In a second aspect, the present invention further provides an electronic device, comprising:

[0041] a memory for storing program instructions; and

[0042] The processor is used to execute the program instructions to implement the steps of the method for obtaining the verification code as described above.

[0043] In a third aspect, the present invention further proposes a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the method for obtaining a verification code as described above are implemented.

[0044] Compared with the prior art, the beneficial effects of the present invention are: a method for obtaining a verification code, an electronic device, and a computer-readable storage medium, comprising: receiving a request for obtaining a verification code; obtaining information carried by the request by parsing the request; wherein the information includes the mobile phone number and / or IP address of the terminal device that sends the request; judging whether the information has passed the verification according to a preset verification strategy; if passed, generating and issuing a verification code. It can be seen that the method for obtaining a verification code, the electronic device, and the computer-readable storage medium, by verifying the information of the mobile phone number and / or IP address carried in the request for obtaining the verification code, realizes the secure acquisition of the verification code from the server while eliminating the process of the user manually entering the content of the graphic verification code. This method of obtaining a verification code allows the user to no longer face the difficulty of identifying the graphic verification code when requesting the verification code from the server, reduces the user input items, improves the user experience, and makes the entire verification code acquisition process safe, convenient, and efficient. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0046] Figure 1 It is a flowchart of a first embodiment of a method for obtaining a verification code of the present invention;

[0047] Figure 2 It is a flow chart of a second embodiment of a method for obtaining a verification code of the present invention;

[0048] Figure 3 It is a flowchart of a third embodiment of a method for obtaining a verification code of the present invention;

[0049] Figure 4 The figure is a schematic diagram of the principle flow of the method for obtaining a verification code of the present invention;

[0050] Figure 5 It is a schematic diagram of the structure of an electronic device in a hardware operating environment involved in an embodiment of the present invention. DETAILED DESCRIPTION

[0051] The scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0052] It should be noted that if the embodiments of the present invention involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0053] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0054] See also Figure 1 As shown, it is a flow chart of the first embodiment of the method for obtaining a verification code of the present invention. The method for obtaining a verification code is applied to a server.

[0055] In this embodiment, the method for obtaining the verification code includes:

[0056] Step S100: receiving a request for obtaining a verification code.

[0057] Specifically, the request is sent by the client, that is, the terminal device used by the user, such as a mobile phone. The terminal device sends the request to allow the server to confirm the user's identity and the authenticity of the operation and then return a verification code so that the user can continue to perform subsequent operations on the terminal device.

[0058] Step S200: Obtain information carried in the request by parsing the request.

[0059] The information includes the mobile phone number and / or IP address of the terminal device that sends the request.

[0060] Specifically, the server needs to parse the request sent by the terminal device to extract the required information, such as the mobile phone number and / or IP address of the terminal device that sent the request. The server verifies the extracted mobile phone number and / or IP address to determine whether the user's identity and operation are authentic and valid. Mobile phone numbers and IP addresses are commonly used identity identification information. Using such information for verification helps to improve the operability of the method for obtaining the verification code. Of course, it should be noted that in addition to the mobile phone number and IP address, the information may also include other information, such as a fixed AppID (Application Identifie, application identifier), AppKey (Application Key, application key), mobile phone time, encryption string and other information. The specific types of information to be selected can be determined according to the preset verification strategy.

[0061] Step S300: Determine whether the information has passed verification according to a preset verification strategy; if passed, generate and issue a verification code.

[0062] Specifically, the preset verification strategy mainly verifies the information associated with the mobile phone number and IP address, such as the number of terminal devices and request frequency associated with the mobile phone number and IP address. The preset verification strategy ensures the authenticity and security of user operations by limiting the number of terminal devices that issue requests and the request frequency, thereby effectively preventing illegal behavior of malicious applications. And through the preset verification strategy, the server can directly generate and issue a verification code, which can help legitimate users quickly complete the verification process without the user manually entering the character information of the graphic verification code, greatly improving user satisfaction.

[0063] Compared with the prior art, the verification code acquisition method of the embodiment of the present invention realizes the secure acquisition of the verification code from the server by verifying the information of the mobile phone number and / or IP address carried in the verification code acquisition request, while eliminating the need for the user to manually input the content of the graphic verification code. This method of obtaining the verification code allows the user to no longer face the difficulty of identifying the graphic verification code when requesting the verification code from the server, reduces the user input items, improves the user experience, and makes the entire verification code acquisition process safe, convenient and efficient.

[0064] See also Figure 2 As shown, it is a flow chart of the second embodiment of the method for obtaining a verification code of the present invention.

[0065] Compared with other embodiments of the method for obtaining a verification code, this embodiment provides detailed descriptions of the situation where verification fails and the situation where different operations are performed for different query results.

[0066] In this embodiment, in step S300, judging whether the information has passed the verification according to the preset verification strategy includes:

[0067] Step S301: When the information is a mobile phone number, the mobile phone number is searched in a preset database.

[0068] Specifically, the preset database is pre-set by the server and stores various information associated with the mobile phone number and / or IP address, such as account information bound to the mobile phone number, recent login records, geographical location information of the IP address, etc., in order to help the server complete the verification of whether the mobile phone number and / or IP address is legal. By querying the information in the preset database, the server can verify the mobile phone number and / or IP address provided by the user to ensure the legitimacy and security of the request to obtain the verification code, and further improve the efficiency of automatic user identity verification.

[0069] Step S302a: Determine the number of times the queried mobile phone number sends a request within a preset first time period. If the number is greater than or equal to the preset first number, determine that the information fails verification.

[0070] The preset database includes a first request record table, which includes a plurality of request records, and each request record includes a one-to-one corresponding mobile phone number and request time.

[0071] Specifically, the number of times a user who normally uses the APP sends a request to obtain a verification code within a certain period of time is limited, and usually does not frequently send a large number of requests to obtain a verification code. Therefore, when a mobile phone number is detected to send a large number of requests within a certain period of time, it indicates that there may be abnormal behavior. This abnormal behavior may be caused by factors such as malicious applications, malicious attacks, or abuse of system resources. Once such abnormal behavior is detected, the server will refuse to send the verification code and return a specific error code to identify the abnormal state. The error code is usually a system preset identifier that helps the system identify and record the corresponding abnormal situation, which is convenient for subsequent processing and tracking. Of course, in order to avoid the system's misjudgment of normal user operations, the server will also issue a suggestion message, suggesting that the user contact the after-sales staff. Through communication and negotiation with the after-sales staff, the abnormal state can be unlocked later and normal use can be restored. Through such a verification mechanism, it can be ensured that the system correctly identifies abnormal behavior in the process of obtaining the verification code, and avoids inconvenience or misunderstanding caused to normal users, while protecting the security and stability of the system, ensuring that users can use the APP service normally. It should be noted that according to the request time in the first request record table, the number of times the mobile phone number sends a request within the preset first time length can be obtained. The preset first duration and the preset first number can be set according to specific usage scenarios and security requirements to ensure that the system can effectively identify and respond to abnormal situations. For example, the preset first duration is 7 days and the preset first number is 10 times.

[0072] Step S302b: Determine the number of unique device identification codes that match the queried mobile phone number. If the number is greater than or equal to a preset number, determine that the information has not passed the verification.

[0073] The preset database includes a mobile phone information table, which includes a plurality of information records, each of which includes a mobile phone number and a device unique identification code, and each of the mobile phone numbers corresponds to at least one device unique identification code.

[0074] Specifically, under normal circumstances, a user will only use the same mobile phone number to operate on one or a few terminal devices. Therefore, in the preset database, the number of device unique identification codes corresponding to a mobile phone number (device unique identification code is an identifier used to uniquely identify a device. Different types of devices have different forms of unique identification codes, which are used to accurately identify and track devices in the system) is limited, and there will not be a large number of device unique identification codes matching the same mobile phone number. When it is detected that the number of device unique identification codes matching a certain mobile phone number exceeds the preset number, it indicates that there may be abnormal behavior. This abnormal behavior may be caused by factors such as malicious applications, device sharing, or other security risks. Once this abnormal behavior is detected, the server will refuse to send the verification code and return a specific error code to identify the abnormal state. The error code is usually a system preset identifier that helps the system identify and record the corresponding abnormal situation, which is convenient for subsequent processing and tracking. Of course, in order to avoid the system's misjudgment of normal user operations, the server will also send a suggestion message, suggesting that the user contact the after-sales staff. Through communication and negotiation with the after-sales staff, the abnormal state can be unlocked later and normal use can be restored. Through such a verification mechanism, the system can correctly identify abnormal behavior in the process of obtaining the verification code, avoid inconvenience or misunderstanding to normal users, and ensure that users can use the APP service normally while protecting the security and stability of the system. It should be noted that the preset number can be set according to the specific usage scenario and security requirements to ensure that the system can effectively identify and respond to abnormal situations. For example, the preset number is 3.

[0075] Step S303a: If the mobile phone number is not found, insert a new information record into the mobile phone information table.

[0076] The new information record records the mobile phone number, the unique device identification code corresponding to the mobile phone number, and the recording time.

[0077] Specifically, when the mobile phone number is not found in the mobile phone information table, it means that the mobile phone number is not recorded in the mobile phone information table, and this may be a new user registration. In this case, inserting a new information record in the mobile phone information table can record the information related to the mobile phone number in time, providing necessary data support for subsequent verification and identification.

[0078] Step S303b: If the mobile phone number is found but a device unique identification code matching the found mobile phone number is not found, a new information record is inserted into the mobile phone information table.

[0079] The new information record records the mobile phone number, the unique device identification code corresponding to the mobile phone number, and the recording time.

[0080] Specifically, the mobile phone number is found in the mobile phone information table but the device unique identification code that matches the queried mobile phone number cannot be found. This means that the mobile phone number is found in the mobile phone information table, but the device unique identification code in the information record corresponding to the mobile phone number found does not match the device unique identification code requested this time. In this case, it may correspond to the situation that the user has updated the terminal device or used a temporary terminal device for operation. In the face of this situation, inserting a new information record in the mobile phone information table can accurately record the new device unique identification code corresponding to the mobile phone number, providing necessary data support for subsequent verification and identification.

[0081] Step S303c: If the mobile phone number is queried and a device unique identification code matching the queried mobile phone number is found, the recording time of the corresponding information record in the mobile phone information table is replaced with the current time.

[0082] Each information record includes a one-to-one corresponding device unique identification code and recording time, and the information also includes a device unique identification code of the terminal device that sends the request.

[0083] Specifically, the mobile phone number is queried in the mobile phone information table and the device unique identification code that matches the queried mobile phone number is found, which means that the mobile phone number is found in the mobile phone information table, and the device unique identification code in the information record corresponding to the mobile phone number found matches the device unique identification code requested this time, indicating that the terminal device used by the user and the mobile phone number can be accurately matched. In this case, the corresponding situation may be that the user uses a registered terminal device for operation. In this case, updating the record time in the information record helps to track the latest status of the user's use of the terminal device and ensure that the information recorded in the mobile phone information table is the most accurate and up-to-date.

[0084] It should be noted that step S303a, step S303b and step S303c are steps for performing different processing for different query results after querying in the mobile phone information table. Among them, step S303a is a step for performing corresponding processing for the mobile phone number not being queried. Step S303b is a step for performing corresponding processing for the mobile phone number being queried but the device unique identification code that matches the mobile phone number cannot be found. Step S303c is a step for performing corresponding processing for the mobile phone number being queried and the device unique identification code that matches the mobile phone number is found. There is no order of precedence for these three steps, and you can choose to implement any one of them.

[0085] Step S304: When the information is an IP address, query the IP address in a preset database and determine the number of times the queried IP address sends requests within a preset second time period. If the number is greater than or equal to the preset second number, determine that the information fails verification.

[0086] The preset database includes a second request record table, the second request record table includes a plurality of request records, and each request record includes a one-to-one corresponding IP address and request time.

[0087] Specifically, under normal circumstances, the number of times the same IP address sends a request to obtain a verification code within a certain period of time is also limited, and a large number of requests to obtain a verification code are usually not frequently sent. Therefore, when a certain IP address is detected to send a large number of requests within a certain period of time, it indicates that there may be abnormal behavior. This abnormal behavior may be caused by malicious applications, malicious attacks or other security risks. Once this abnormal behavior is detected, the server will refuse to send the verification code and return a specific error code to identify the abnormal state. The error code is usually a system preset identifier that helps the system identify and record the corresponding abnormal situation, which is convenient for subsequent processing and tracking. Of course, in order to avoid the system's misjudgment of normal user operations, the server will also issue a suggestion message, suggesting that the user contact the after-sales staff. Through communication and negotiation with the after-sales staff, the abnormal state can be unlocked later and normal use can be restored. Through such a verification mechanism, it can be ensured that the system correctly identifies abnormal behavior in the process of obtaining the verification code, and avoids inconvenience or misunderstanding caused to normal users, while protecting the security and stability of the system. Ensure that users can use the APP service normally. It should be noted that according to the request time in the second request record table, the number of times the IP address sends a request within the preset second time length can be obtained. The preset second duration and the preset second number can be set according to specific usage scenarios and security requirements to ensure that the system can effectively identify and respond to abnormal situations. For example, the preset second duration is 7 days and the preset second number is 10 times.

[0088] It should be noted that step S301 and step S302a, step S301 and step S302b, and step S304 are verification steps for different objects by the server. Among them, step S301 and step S302a are mainly for the verification of the number of times the same mobile phone number sends requests within a certain period of time. Step S301 and step S302b are mainly for the verification of the number of unique device identification codes associated with the same mobile phone number within a certain period of time. Step S304 is mainly for the verification of the number of times the same IP address sends requests within a certain period of time. There is no order of precedence for these three types of steps, and you can implement any one of them.

[0089] The method for obtaining a verification code in an embodiment of the present invention can be applied to a scenario in which a user uses a mobile phone APP to register a new account or retrieve an account password. While securely obtaining a verification code from a server, the user does not need to enter the content of the graphic verification code, thereby reducing user input items and greatly improving the user experience.

[0090] See also Figure 3 As shown, it is a flow chart of the third embodiment of the method for obtaining a verification code of the present invention.

[0091] Compared with other embodiments of the method for obtaining a verification code, this embodiment describes in detail the process of generating and parsing a request for obtaining a verification code.

[0092] In this embodiment, the method for obtaining the verification code includes:

[0093] Step S100: receiving a request for obtaining a verification code.

[0094] Step S200: Obtain information carried in the request by parsing the request.

[0095] The information includes the mobile phone number and / or IP address of the terminal device that sends the request.

[0096] Step S305: Determine whether the information has passed verification according to the preset verification strategy; if passed, generate a verification code and send the verification code via SMS and / or email, and record the mobile phone number, IP address, verification code and issuance time in a preset database.

[0097] Among them, the preset database includes a sending record table, which includes several sending records, each of which includes a mobile phone number, an IP address, a verification code and a sending time, and each mobile phone number corresponds to an IP address, a verification code and a sending time.

[0098] Specifically, the server verifies the information carried in the request according to the preset verification strategy. If the mobile phone number and / or IP address included in the information meets the requirements of the preset verification strategy, the information is judged to have passed the verification. If the information passes the verification, the server will generate a verification code, which is usually a string of numbers or characters. The server sends the generated verification code to the user by SMS and / or email. In this way, the user can perform subsequent operations based on the received verification code. At the same time, the server will record the relevant information of sending the verification code in a preset database to form a sending record table for subsequent tracking and management. The verification code generated by the server is sent in the form of SMS via a mobile phone number, or in the form of email via an email. When registering an account or performing identity authentication, the user usually provides an email address as a contact method, and sometimes fills in the email address in the personal information. Combining these methods, the server can effectively obtain the user's email address and ensure that the user receives the email, so as to achieve the purpose of sending the verification code in the form of an email.

[0099] Specifically, the preset database includes a mobile phone information table, a first request record table, a second request record table, and a sending record table. When designing the preset database, these four tables can be set up separately, or they can be merged into a general table, or they can be combined in pairs or in groups of three. The specific form can be determined according to actual needs. Preferably, these four tables are merged into a general table, which can simplify the process of data query and management, reduce data redundancy, improve query efficiency and reduce the complexity of the preset database, so as to achieve efficient management and use of information stored in the preset database.

[0100] In some embodiments of the present application, generating the request includes:

[0101] S11: In response to the trigger instruction, the unique device identification code of the terminal device and the current time information of the system are obtained.

[0102] Specifically, the terminal that generates the request is a terminal device that issues the request, such as a mobile phone.

[0103] Specifically, when a user clicks a button or enters a specific command in the application of the terminal device, these operations are recognized by the system as trigger instructions, which will start the process of obtaining the verification code and collect the unique device identification code and current time information of the terminal device. The unique device identification code is usually a unique identifier generated based on the hardware information or operating system of the device. The time information is usually expressed in the form of a timestamp.

[0104] Specifically, the mobile phone's device unique identification code (UUID, Universally Unique Identifier) ​​is an identifier used to uniquely identify mobile phone devices. Each mobile phone is assigned a unique UUID when it is produced to distinguish different mobile phones. The mobile phone UUID is usually generated by combining various information such as the device's hardware information, operating system information, and manufacturer information, and is generally expressed in hexadecimal. UUID is unique globally, that is, the UUIDs of different mobile phones are unique and will not be repeated. And the mobile phone UUID is usually persistent, that is, it will remain unchanged if the device is not replaced, which also makes UUID a reliable identifier for identifying mobile phones.

[0105] S12: splicing a preset first character sequence to the device unique identification code to obtain an encrypted plaintext string, and splicing a preset second character sequence to the time information to obtain an encrypted key string.

[0106] Specifically, the preset first character sequence and the preset second character sequence are fixed character strings preset by the system to increase the complexity and security of encryption. The device unique identification code is spliced ​​with the preset first character sequence to form an encrypted plaintext string for subsequent encryption operations. For example: assuming that the UUID value is 1E2DFA89-496A-47FD-9941-DF1FC4E6484A, and the preset first character sequence is P6S_, then the preset first character sequence is spliced ​​with the device unique identification code to obtain P6S_1E2DFA89-496A-47FD-9941-DF1FC4E6484A. The time information is spliced ​​with the preset second character sequence to form an encryption key string, which is used as the key for encryption operations. For example, assuming that the time information is 20241001080808000 (indicating 08:08:08:00 on October 1, 2024), and the preset second character sequence is P6SCODE_, then the preset second character sequence is concatenated with the time information to obtain P6SCODE_20241001080808000.

[0107] S13: Use the encryption key string and a preset encryption algorithm to encrypt the encrypted plaintext string to obtain an encrypted string.

[0108] Specifically, the preset encryption algorithms used by the system include the AES algorithm and the DES algorithm. In this embodiment, the preset encryption algorithm adopts the 3DES (Triple Data Encryption Standard) algorithm. The 3DES algorithm is an improved version of the DES algorithm, which is a symmetric encryption algorithm that uses a 56-bit key to encrypt a 64-bit data block. It uses three DES encryption processes to enhance data security.

[0109] S14: Transcode the encrypted string into an encrypted text string using a preset encoding algorithm, and generate the request according to the encrypted text string.

[0110] Specifically, the preset encoding algorithm used by the system is the BASE64 encoding algorithm. The BASE64 encoding algorithm is an encoding method for converting binary data into a text string. It converts binary data into a text form based on 64 printable characters for use during network transmission or storage. Through this preset encoding algorithm, the encrypted string can be transcoded into a transmittable encrypted text string so that the client can send a request to the server and perform subsequent processing.

[0111] In some embodiments of the present application, the step of concatenating a preset first character sequence to the device unique identification code to obtain an encrypted plaintext string, and concatenating a preset second character sequence to the time information to obtain an encrypted key string includes:

[0112] The preset first character sequence is spliced ​​to the header of the unique identification code of the device to obtain an encrypted plaintext string, and the preset second character sequence is spliced ​​to the header of the time information to obtain an encrypted key string.

[0113] Specifically, splicing the preset character sequence (preset first character sequence and preset second character sequence) to the header of the data (device unique identification code and time information) can help ensure the integrity of the data. During the encryption process, if the preset character sequence is randomly spliced ​​to any position of the data, such as the middle position, it may cause the encryption algorithm to be unable to correctly parse the data, thereby affecting the accuracy of the encryption result. In addition, during the encryption process, the encryption algorithm usually processes the data according to specific rules. If the preset character sequence is correctly placed in the header, it can ensure that the encryption algorithm encrypts the data in the expected manner, thereby improving encryption efficiency and the security of encrypted data.

[0114] In some embodiments of the present application, the using the encryption key string and encrypting the encrypted plaintext string by a preset encryption algorithm includes:

[0115] According to a preset encryption algorithm, the encrypted plaintext string is completed between a preset first character sequence and the unique identification code of the device to obtain a completed encrypted plaintext string; wherein the completed encrypted plaintext string meets the alignment requirement of the preset encryption algorithm;

[0116] The completed encrypted plaintext string is encrypted using the encryption key string and a preset encryption algorithm.

[0117] Specifically, by completing the encrypted plaintext string, the length of the encrypted plaintext string can be made to meet the requirements of the preset encryption algorithm, thereby ensuring that the preset encryption algorithm can correctly process the encrypted plaintext string and generate a valid encryption result, reducing errors or abnormal situations that may occur during the encryption process, simplifying the complexity of encryption operations, and improving encryption efficiency.

[0118] In some embodiments of the present application, parsing the request includes:

[0119] S21: splicing a preset second character sequence to the header of the current time information of the system to obtain a decryption key string; wherein the received request includes the encrypted text string;

[0120] S22: Use a preset decoding algorithm to transcode the encrypted text string into an encrypted string, and use the decryption key string and a preset decryption algorithm to decrypt the encrypted string to obtain a decrypted plaintext string; wherein the decrypted plaintext string includes the information.

[0121] Specifically, the terminal that parses the request is the server that receives the request.

[0122] Specifically, since data network transmission may have a certain delay, the system current time information obtained when parsing the request and the system current time information obtained when generating the request may be slightly different. However, during the decryption process, a certain time deviation can be allowed, or the time information can be calibrated by means of timestamps, etc., to ensure the accuracy of the decryption key string.

[0123] Specifically, the preset decoding algorithm and the preset decryption algorithm used to parse the request are consistent with the preset encoding algorithm and the preset encryption algorithm used to generate the request. This is to ensure that the data can be correctly decoded and decrypted when parsing the request, thereby restoring the original plaintext data and ensuring the accuracy and integrity of the plaintext data during transmission and processing.

[0124] In some embodiments of the present application, the determining whether the information has passed the verification according to a preset verification strategy includes:

[0125] Verify whether the decrypted plaintext string meets the alignment requirement of the preset decryption algorithm. If not, determine that the information fails the verification; wherein the alignment requirement of the preset decryption algorithm is consistent with the alignment requirement of the preset encryption algorithm.

[0126] Specifically, verifying whether the decrypted plaintext string meets the alignment requirements of the preset decryption algorithm can help ensure the integrity of the decrypted plaintext string. After the encrypted text string is decrypted, the decrypted plaintext string is obtained. If the format or length of the decrypted plaintext string does not meet the alignment requirements of the preset decryption algorithm, it may be that data loss or parsing errors occurred during the parsing process, or incorrect processing during data completion or truncation occurred during data transmission, which will seriously affect the subsequent processing and use of information. By verifying the alignment requirements of the decrypted plaintext string, the data anomaly can be discovered in advance. Once this data anomaly is detected, the server will refuse to send the verification code and return a specific error code to identify the abnormal state. The error code is usually a system preset identifier to help the system identify and record the corresponding abnormal situation, which is convenient for subsequent processing and tracking.

[0127] Specifically, the alignment requirement of the preset decryption algorithm is consistent with the alignment requirement of the preset encryption algorithm. By verifying the alignment requirement of the decrypted plaintext string, the consistency between the decryption operation and the encryption operation can be ensured, avoiding decryption failure or erroneous results caused by data format mismatch.

[0128] The method for obtaining the verification code in the embodiment of the present invention adopts a consistent preset encryption algorithm and a preset decryption algorithm, as well as a consistent preset encoding algorithm and a preset decoding algorithm, to ensure that the request generation and transmission process is safe and reliable, and the request parsing process is fast and efficient. Such a mechanism can effectively prevent attacks by malicious applications and obtaining verification codes by brute force cracking, thereby improving the security of the system.

[0129] The following describes in detail the workflow of the method for obtaining a verification code according to an embodiment of the present invention from two perspectives, namely, the client and the server.

[0130] See also Figure 4 As shown, it is a schematic diagram of the principle flow of the method for obtaining the verification code of the present invention.

[0131] The client workflow includes the client APP workflow and the SDK module workflow, as follows:

[0132] Client APP workflow:

[0133] 1. APP users enter their mobile phone number and click to obtain a verification code;

[0134] 2. The APP obtains the current time of the mobile phone and obtains the time information (such as 08:08:08:00 on October 1, 2024, and the time information is: 20241001080808000);

[0135] 3. Call the SDK module interface to obtain the encrypted text string;

[0136] 4. After obtaining the encrypted text string, request the server interface to obtain the verification code (parameters include fixed AppID, AppKey, user mobile phone number, mobile phone time, IP address, encrypted string and other information);

[0137] 5. Prompt the user to send the result (successful or failed) based on the server return value.

[0138] It should be noted that the mobile phone system integrates the SDK (Software Development Kit) module, and the SDK interface document can be used to directly call the interface provided by the SDK module to implement the functions of the SDK module. Through the SDK interface document, you can understand how to correctly use the functions provided by the SDK module, implement specific functional requirements, and control the scope of use of the SDK module to a certain extent.

[0139] SDK module workflow:

[0140] 1. Obtain the unique identification code of the mobile device (such as mobile phone UUID);

[0141] 2. Concatenate the fixed prefix and the mobile phone UUID to get the encrypted plaintext string (such as P6S_+UUID value (assuming it is 1E2DFA89-496A-47FD-9941-DF1FC4E6484A), get P6S_1E2DFA89-496A-47FD-9941-DF1FC4E6484A value);

[0142] 3. Concatenate the fixed prefix and time information to obtain the encryption key string (such as P6SCODE_+time information to obtain P6SCODE_20241001080808000);

[0143] 4. Complete the plaintext content for the fixed prefix of the encrypted plaintext string according to the characteristics of the preset encryption algorithm (for example, P6S0000_, add the completed content 0000 to get 8 characters, the actual number of 0s depends on whether the plaintext content meets the alignment requirements of the preset encryption algorithm. For example, if the preset encryption algorithm requires 8-byte alignment and the plaintext length is 14, then 2 characters of 0 need to be completed to keep the algorithm length aligned);

[0144] 5. Use the generated encryption key string to encrypt the plaintext string using the 3DES algorithm (preset encryption algorithm) to obtain the encrypted string P0;

[0145] 6. Use the BASE64 algorithm (preset encoding algorithm) to transcode the encrypted string P0 to obtain the encrypted text string P1;

[0146] 7. Return the encrypted text string P1.

[0147] Server workflow:

[0148] 1. Concatenate the key prefix and the phone time to get the decryption key string (such as P6SCODE_20241001080808000);

[0149] 2. Use the decryption key string to decode the encrypted text string P1 to obtain the decrypted plaintext string;

[0150] 3. Verify that the prefix of the decrypted plaintext string is P6S_ or the number of zeros between P6S and _ is less than or equal to 8 zeros. If the verification fails, return a sending failure and an error code;

[0151] 4. Query the number of records of mobile phone numbers matching different mobile phone UUIDs in the past week from the mobile phone information table in the preset database. If the number of records is greater than 3, the sending failure and error code are returned (indicating that the mobile phone number and mobile phone switch too frequently, which is an abnormal state and needs to contact after-sales personnel to unlock);

[0152] 5. Query the number of requests for the mobile phone number in the past week from the first request record table in the preset database. If the number of requests is greater than 10, the sending failure and error code are returned (indicating that the mobile phone number is sent too frequently, which is an abnormal state and needs to contact after-sales personnel to unlock);

[0153] 6. Get the public IP address of the request source, and query the number of consecutive requests for verification codes from the second request record table in the preset database in the past week. If the number of requests for verification codes is greater than 10, the sending failure and error code are returned (indicating that the source IP address is sent too frequently, which is an abnormal state and needs to contact after-sales personnel to unlock);

[0154] 7. If no record with a complete match between the mobile phone number and the mobile phone UUID is found in the mobile phone information table in the preset database, a new information record is inserted, which saves the mobile phone number, mobile phone UUID and the current database time. If an information record with a complete match between the mobile phone number and the mobile phone UUID is found, it means that the information record already exists in the mobile phone information table, and the queried record time is updated to the current time;

[0155] 8. Randomly generate verification codes; the randomly generated verification codes are generally in the form of random strings of a certain length. Common forms include: pure digital verification codes (random strings composed of numbers, such as 123456), mixed verification codes of numbers and letters (random strings composed of numbers and letters (uppercase and lowercase), such as aBcDeF), mixed verification codes of numbers, letters and special characters (random strings composed of numbers, letters (uppercase and lowercase) and special characters, such as $1aB#2cD), etc. The length of the generated verification code is generally 4-8 digits. A shorter verification code length makes it easier for users to quickly enter and verify. A longer verification code length will increase the difficulty for users to enter the verification code.

[0156] 9. Send verification codes or text messages via email or SMS;

[0157] 10. Insert a new record into the sending record table in the preset database, recording the mobile phone number, verification code, sending time, sending source IP address and other information;

[0158] 11. Return sent successfully.

[0159] The verification code acquisition method of the embodiment of the present invention is simple and efficient in design, and can automatically generate and send the verification code to the user, helping the user to quickly receive the verification code and complete the verification, thereby improving the user experience and operation efficiency, and ensuring the timeliness and effectiveness of the verification code. Moreover, by using the verification code acquisition method, the user does not need to perform complex input steps or operations to complete the human-machine verification process, and can easily obtain the verification code and perform the verification, thereby improving the user's convenience and satisfaction.

[0160] The following is an embodiment of the electronic device provided by the present invention. The embodiment of the electronic device and the embodiment of the verification code acquisition method described above are of the same concept, and the details not described in detail in the embodiment of the electronic device can refer to the embodiment of the verification code acquisition method described above.

[0161] See also Figure 5 As shown, it is a schematic diagram of the structure of an electronic device in a hardware operating environment involved in an embodiment of the present invention.

[0162] In this embodiment, an electronic device includes:

[0163] Memory 1005, used to store program instructions; and

[0164] The processor 1001 is used to execute the program instructions to implement the steps of the method for obtaining the verification code as described above.

[0165] The electronic device of the embodiment of the present invention can be a computing device such as a desktop computer, a notebook, a palm computer, and a server. Figure 5As shown, the electronic device may include: a processor 1001 (e.g., a CPU), a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit, such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0166] Those skilled in the art will understand that Figure 5 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0167] like Figure 5 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module and a computer program.

[0168] exist Figure 5 In the electronic device shown, the network interface 1004 is mainly used to connect to the background server and communicate data with the background server; the user interface 1003 is mainly used to connect to the client (user end) and communicate data with the client; and the processor 1001 can be used to call the computer program stored in the memory 1005. When the computer program is called and executed by the processor 1001, the steps of the above-mentioned verification code acquisition method are implemented.

[0169] The following is an embodiment of the computer-readable storage medium provided by the present invention. The embodiment of the computer-readable storage medium and the embodiment of the verification code acquisition method and the electronic device described above are of the same concept. For details not described in detail in the embodiment of the computer-readable storage medium, reference can be made to the embodiment of the verification code acquisition method and the electronic device described above.

[0170] In this embodiment, a computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the method for obtaining a verification code as described above are implemented.

[0171] Since the electronic device and computer-readable storage medium of the present invention can implement the steps of the above-mentioned verification code acquisition method, they at least have all the beneficial effects brought by the technical solutions of the above-mentioned verification code acquisition method step embodiments, which are not described one by one here.

[0172] The above description is only a partial or preferred embodiment of the present invention. Neither the text nor the drawings can limit the scope of protection of the present invention. All equivalent structural changes made by using the contents of the present invention specification and drawings under the overall concept of the present invention, or direct / indirect application in other related technical fields are included in the scope of protection of the present invention.

[0173] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD ROM, optical storage, etc.) containing computer-usable program codes.

[0174] The present application is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0175] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0176] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0177] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A method for obtaining a verification code, characterized in that: include: A request for obtaining a verification code is received; By parsing the request, obtaining information carried in the request; wherein the information includes the mobile phone number and / or IP address of the terminal device sending the request; Determine whether the information has passed the verification according to the preset verification strategy; if passed, generate and issue a verification code.

2. The method for obtaining a verification code according to claim 1, characterized in that: When the information is a mobile phone number, determining whether the information has passed verification according to a preset verification strategy includes: Querying the mobile phone number in a preset database and determining the number of unique device identification codes that match the queried mobile phone number, and if the number is greater than or equal to a preset number, determining that the information fails verification; The preset database includes a mobile phone information table, which includes a plurality of information records, each of which includes a mobile phone number and a device unique identification code, and each of the mobile phone numbers corresponds to at least one device unique identification code.

3. The method for obtaining a verification code according to claim 2, characterized in that: After searching the preset database for the mobile phone number, the method further includes: If the mobile phone number is not found, insert a new information record into the mobile phone information table; wherein the new information record records the mobile phone number, the unique device identification code corresponding to the mobile phone number, and the recording time; If the mobile phone number is found but the device unique identification code that matches the found mobile phone number is not found, insert a new information record into the mobile phone information table; wherein the new information record records the mobile phone number, the device unique identification code corresponding to the mobile phone number, and the recording time; If the mobile phone number is found and a unique device identification code matching the found mobile phone number is found, then the recording time of the corresponding information record in the mobile phone information table is replaced with the current time; Each information record includes a one-to-one corresponding device unique identification code and recording time, and the information also includes a device unique identification code of the terminal device that sends the request.

4. The method for obtaining a verification code according to claim 1, wherein: When the information is a mobile phone number, determining whether the information has passed verification according to a preset verification strategy includes: Query the mobile phone number in a preset database, and determine the number of times the queried mobile phone number sends a request within a preset first time period, and if the number is greater than or equal to the preset first number, determine that the information fails the verification; wherein the preset database includes a first request record table, the first request record table includes a plurality of request records, and each request record includes a one-to-one corresponding mobile phone number and request time; When the information is an IP address, determining whether the information passes verification according to a preset verification strategy includes: The IP address is queried in a preset database, and the number of times the queried IP address sends a request within a preset second time period is determined. If the number is greater than or equal to the preset second number, it is determined that the information fails the verification; wherein the preset database includes a second request record table, the second request record table includes a number of request records, and each request record includes a one-to-one corresponding IP address and request time.

5. The method for obtaining a verification code according to claim 1, characterized in that: The generating and issuing of the verification code comprises: Generate a verification code and send it via SMS and / or email, and record the mobile phone number, IP address, verification code and sending time in a preset database; Among them, the preset database includes a sending record table, which includes several sending records, each of which includes a mobile phone number, an IP address, a verification code and a sending time, and each mobile phone number corresponds to an IP address, a verification code and a sending time.

6. The method for obtaining a verification code according to claim 1, characterized in that: Generating the request, including: In response to the trigger instruction, obtain the unique device identification code of the terminal device and the current time information of the system; splicing a preset first character sequence to the device unique identification code to obtain an encrypted plaintext string, and splicing a preset second character sequence to the time information to obtain an encrypted key string; Using the encryption key string and a preset encryption algorithm to encrypt the encrypted plaintext string to obtain an encrypted string; The encrypted string is transcoded into an encrypted text string using a preset encoding algorithm, and the request is generated according to the encrypted text string.

7. The method for obtaining a verification code according to claim 6, wherein: The step of concatenating a preset first character sequence with the device unique identification code to obtain an encrypted plaintext string, and concatenating a preset second character sequence with the time information to obtain an encrypted key string, includes: splicing a preset first character sequence to the header of the device unique identification code to obtain an encrypted plaintext string, and splicing a preset second character sequence to the header of the time information to obtain an encryption key string; The step of using the encryption key string and encrypting the encrypted plaintext string by a preset encryption algorithm includes: According to a preset encryption algorithm, the encrypted plaintext string is completed between a preset first character sequence and the unique identification code of the device to obtain a completed encrypted plaintext string; wherein the completed encrypted plaintext string meets the alignment requirement of the preset encryption algorithm; The completed encrypted plaintext string is encrypted using the encryption key string and a preset encryption algorithm.

8. The method for obtaining a verification code according to claim 7, characterized in that: The parsing of the request comprises: splicing a preset second character sequence to the header of the current time information of the system to obtain a decryption key string; wherein the received request includes the encrypted text string; Using a preset decoding algorithm to transcode the encrypted text string into an encrypted string, and using the decryption key string and a preset decryption algorithm to decrypt the encrypted string to obtain a decrypted plaintext string; wherein the decrypted plaintext string includes the information; The determining whether the information has passed the verification according to the preset verification strategy includes: Verify whether the decrypted plaintext string meets the alignment requirement of the preset decryption algorithm. If not, determine that the information fails the verification; wherein the alignment requirement of the preset decryption algorithm is consistent with the alignment requirement of the preset encryption algorithm.

9. An electronic device, characterized in that: include: A memory for storing program instructions; as well as A processor is used to execute the program instructions to implement the steps of the method for obtaining a verification code as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the method for obtaining a verification code according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Processing method of identifying code and mobile terminal

    CN106713618A

  • False user automatic clearing method, device and equipment and storage medium

    CN108038130A

  • Method for preventing maliciously swiping short message verification code sending service

    CN108183914A

  • Method and device for obtaining short message verification code

    CN108900479A

  • Message verification code attack protection method, server and computer readable storage medium

    CN108989263A