CN114912991A - Security authentication method and device, electronic equipment and storage medium - Google Patents

Security authentication method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114912991A
CN114912991A CN202110169314.4A CN202110169314A CN114912991A CN 114912991 A CN114912991 A CN 114912991A CN 202110169314 A CN202110169314 A CN 202110169314A CN 114912991 A CN114912991 A CN 114912991A
Authority
CN
China
Prior art keywords
verification code
verification
client
determining
current service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110169314.4A
Other languages
Chinese (zh)
Inventor
余光飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Tongbang Zhuoyi Technology Co ltd
Original Assignee
Beijing Tongbang Zhuoyi Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Tongbang Zhuoyi Technology Co ltd filed Critical Beijing Tongbang Zhuoyi Technology Co ltd
Priority to CN202110169314.4A priority Critical patent/CN114912991A/en
Publication of CN114912991A publication Critical patent/CN114912991A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/12Accounting
    • G06Q40/128Check-book balancing, updating or printing arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The embodiment of the invention provides a security authentication method, a security authentication device, electronic equipment and a storage medium, wherein the method comprises the following steps: determining a current service scene under the condition of receiving a verification code acquisition request sent by a client; inquiring the verification code acquisition times counted for the current service scene, and determining the verification code generation times corresponding to the current service scene; under the condition that the verification code acquisition times reach the verification code generation times, returning a message that the verification code acquisition is invalid to the client; the message that the verification code acquisition is invalid is used for enabling the client to set a button triggering the verification code acquisition request to be in an unavailable state. Therefore, under the condition that the verification code acquisition times counted aiming at the current service scene reach the verification code generation times corresponding to the current service scene, the button triggering the verification code acquisition request can be set to be in an unavailable state, the verification code attack is avoided, and the verification code cost and the system pressure are reduced.

Description

Security authentication method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of security authentication technologies, and in particular, to a security authentication method and apparatus, an electronic device, and a storage medium.
Background
The bills include draft, cashier's bill and cheque, which are securities issued by the drawer, appointed to pay a certain amount unconditionally to the receiver or the bearer when viewing the bill or on the appointed date, i.e. some securities which can replace cash circulation.
At present, a buyer and a seller can trade for a bill, wherein the buyer places an order, after the order is successfully placed by the buyer, a bill order is generated, the buyer initiates payment for the bill order, and short message verification is required once in the process of initiating the payment for the bill order.
Because the short message verification has the cost problem, if an illegal user intends to continuously request the short message verification under the condition that the short message verification is required every time, and the short message verification code attack is formed, the cost of the short message verification code is increased, and the pressure of the system is increased.
Disclosure of Invention
The embodiment of the invention aims to provide a security authentication method, a security authentication device, electronic equipment and a storage medium, so as to achieve the beneficial effects of reducing the cost of verification codes and reducing the system pressure. The specific technical scheme is as follows:
in a first aspect of the embodiments of the present invention, a security authentication method is first provided, where the method includes:
determining a current service scene under the condition of receiving a verification code acquisition request sent by a client;
inquiring the verification code acquisition times counted aiming at the current service scene, and determining the verification code generation times corresponding to the current service scene;
under the condition that the verification code acquisition times reach the verification code generation times, returning a message that the verification code acquisition is invalid to the client;
the message that the verification code acquisition is invalid is used for enabling the client to set a button triggering the verification code acquisition request to be in an unavailable state.
In an optional embodiment, before performing the method, the method further comprises:
and counting verification code acquisition frequencies corresponding to different service scenes respectively, and setting generation times of different verification codes corresponding to different service scenes respectively according to the acquisition frequencies.
In an optional embodiment, the determining a current service scenario when receiving a verification code obtaining request sent by a client includes:
under the condition of receiving a verification code acquisition request sent by a client, analyzing a current service scene identifier carried in the verification code acquisition request;
and determining the current service scene corresponding to the current service scene identification according to the corresponding relation between the preset service scene identification and the service scene.
In an optional embodiment, after the returning of the message that the verification code acquisition is invalid to the client, the method further includes:
according to a preset verification code obtaining effective period, returning a verification code obtaining effective message to the client;
the message that the verification code acquisition is valid is used for enabling the client to set a button triggering the verification code acquisition request to be in an available state.
In an optional embodiment, the method further comprises:
under the condition that the verification code obtaining times do not reach the verification code generating times, analyzing a user identifier carried in the verification code obtaining request; and (c) a second step of,
determining a security level corresponding to the current service scene, generating a verification code according to the security level, and sending the verification code to a terminal corresponding to the user identifier;
receiving a target verification code sent by the client, and checking whether the target verification code is consistent with the verification code;
and determining that the verification code passes verification under the condition that the target verification code is consistent with the verification code.
In an optional embodiment, the generating the verification code according to the security level includes:
and determining the complexity and the length of the verification code corresponding to the security level, and generating the verification code with the complexity and the length.
In an optional embodiment, the checking whether the target verification code is consistent with the verification code comprises:
inquiring the verification times counted aiming at the verification code, and determining a verification threshold corresponding to the verification code;
and under the condition that the checking times do not exceed the checking threshold value, checking whether the target verification code is consistent with the verification code.
In an optional embodiment, the method further comprises:
and determining that the verification of the verification code is failed under the condition that the verification times exceed the verification threshold.
In an optional embodiment, in the case that the target verification code is identical to the verification code, determining that the verification code is verified comprises:
under the condition that the target verification code is consistent with the verification code, judging whether the verification code is in the validity period or not;
and determining that the verification code passes the verification under the condition that the verification code is in the valid period.
In an optional embodiment, the method further comprises:
and determining that the verification of the verification code fails under the condition that the verification code is not in the valid period.
In a second aspect of the embodiments of the present invention, there is also provided a security authentication apparatus, including:
the scene determining module is used for determining the current service scene under the condition of receiving a verification code obtaining request sent by a client;
the number query module is used for querying the number of times of acquiring the verification code counted aiming at the current service scene;
the number determining module is used for determining the generation number of the verification code corresponding to the current service scene;
an invalid message returning module, configured to return a message indicating that the verification code acquisition is invalid to the client when the verification code acquisition times reach the verification code generation times;
the message that the verification code acquisition is invalid is used for enabling the client to set a button triggering the verification code acquisition request to be in an unavailable state.
In a third aspect of the embodiments of the present invention, there is further provided an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor configured to implement the security authentication method according to any one of the first aspect described above when executing a program stored in a memory.
In a fourth aspect of the embodiments of the present invention, there is also provided a storage medium, in which instructions are stored, and when the storage medium runs on a computer, the storage medium causes the computer to execute the security authentication method according to any one of the first aspect.
In a fifth aspect of the embodiments of the present invention, there is also provided a computer program product including instructions, which when run on a computer, cause the computer to perform the security authentication method of any one of the above first aspects.
According to the technical scheme provided by the embodiment of the invention, under the condition of receiving the verification code acquisition request sent by the client, the current service scene is determined, the verification code acquisition times counted for the current service scene are inquired, the verification code generation times corresponding to the current service scene are determined, under the condition that the verification code acquisition times reach the verification code generation times, a message that the verification code acquisition is invalid is returned to the client, and the message that the verification code acquisition is invalid is used for enabling the client to set a button triggering the verification code acquisition request to be in an unavailable state. Therefore, under the condition that the verification code acquisition times counted aiming at the current service scene reach the verification code generation times corresponding to the current service scene, the button triggering the verification code acquisition request can be set to be in an unavailable state, the verification code attack is avoided, and the verification code cost and the system pressure are reduced.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic flowchart illustrating an implementation flow of a security authentication method according to an embodiment of the present invention;
fig. 2 is a schematic view of a scenario for sending an identifying code obtaining request according to an embodiment of the present invention;
fig. 3 is a schematic flow chart illustrating another implementation of the security authentication method in the embodiment of the present invention;
fig. 4 is a schematic flow chart illustrating another implementation of the security authentication method in the embodiment of the present invention;
fig. 5 is a schematic structural diagram of a security authentication apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device shown in the embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
As shown in fig. 1, an implementation flow diagram of a security authentication method provided in an embodiment of the present invention is shown, where the method may be applied to a server, and specifically includes the following steps:
s101, under the condition that a verification code acquisition request sent by a client is received, determining a current service scene.
In the embodiment of the invention, in a service scene needing security authentication, a user can click a certain button (such as a verification code acquisition button) so as to trigger a verification code acquisition request, and the client side sends the verification code acquisition request to the server.
The server can receive a verification code acquisition request sent by the client, and determine the current service scene under the condition of receiving the verification code acquisition request sent by the client.
For example, as shown in fig. 2, in a payment scenario that requires security authentication, a user may click an acquire verification code button, so as to trigger a verification code acquisition request, and a client sends the verification code acquisition request to a server.
The server may receive a verification code acquisition request sent by the client, and determine a current payment scenario when receiving the verification code acquisition request sent by the client.
It should be noted that, for a service scenario, for example, a check-in scenario, a cash-out scenario, a payment scenario, or a receipt clearing scenario may be used, which is not limited in the embodiment of the present invention.
S102, inquiring the verification code acquisition times counted aiming at the current service scene, and determining the verification code generation times corresponding to the current service scene.
In the embodiment of the present invention, the number of times of obtaining the verification code counted for the current service scenario may be queried, and the number of times of generating the verification code corresponding to the current service scenario may be determined (that is, the verification code is generated with a time limit).
For example, in the embodiment of the present invention, the verification code acquisition times M counted for the current payment scenario may be queried, and the verification code generation times N corresponding to the current payment scenario may be determined (that is, the verification code generation times may not exceed N).
S103, returning a message that the verification code acquisition is invalid to the client under the condition that the verification code acquisition times reach the verification code generation times.
And for the verification code acquisition times counted aiming at the current service scene and the verification code generation times corresponding to the current service scene, returning a message that the verification code acquisition is invalid to the client under the condition that the verification code acquisition times reach the verification code generation times.
The client may receive a message that the verification code acquisition is invalid, prompt the user that the current short message verification function is unavailable, and set the verification code acquisition button that triggers the verification code acquisition request to an unavailable state (e.g., set the verification code acquisition button that triggers the verification code acquisition request to gray).
Therefore, under the condition that the verification code acquisition times counted for the current service scene reach the verification code generation times corresponding to the current service scene, the button triggering the verification code acquisition request can be set to be in an unavailable state, verification code attack is avoided, and verification code cost and system pressure are reduced.
For example, for the verification code acquisition times M counted for the current payment scenario and the verification code generation times N corresponding to the current payment scenario, if the verification code acquisition times M reach the verification code generation times N (that is, M is equal to N), a message that the short message verification code acquisition is invalid is returned to the client.
For the client, the message that the short message verification code acquisition is invalid can be received, the user is prompted that the current short message verification function cannot be used, and the verification code acquisition request cannot be triggered any more by setting the verification code acquisition button triggering the verification code acquisition request to be grey.
Through the above description of the technical solution provided by the embodiment of the present invention, in the case of receiving a verification code acquisition request sent by a client, a current service scenario is determined, the verification code acquisition times counted for the current service scenario are queried, the verification code generation times corresponding to the current service scenario are determined, and in the case that the verification code acquisition times reach the verification code generation times, a verification code acquisition invalidity message is returned to the client, where the verification code acquisition invalidity message is used to enable the client to set a button triggering the verification code acquisition request to an unusable state.
Therefore, under the condition that the verification code acquisition times counted aiming at the current service scene reach the verification code generation times corresponding to the current service scene, the button triggering the verification code acquisition request can be set to be in an unavailable state, the verification code attack is avoided, and the verification code cost and the system pressure are reduced.
As shown in fig. 3, which is a schematic diagram of an implementation flow of another security authentication method provided in an embodiment of the present invention, the method may be applied to a server, and specifically may include the following steps:
s301, under the condition that a verification code acquisition request sent by a client is received, analyzing a current service scene identifier carried in the verification code acquisition request.
In the embodiment of the invention, in a service scene needing security authentication, a user can click a certain button (such as a verification code acquisition button) so as to trigger a verification code acquisition request, and the client side sends the verification code acquisition request to the server.
The server can receive a verification code acquisition request sent by the client, and analyze a current service scene identifier carried in the verification code acquisition request under the condition of receiving the verification code acquisition request sent by the client.
For example, as shown in fig. 2, in a payment scenario that requires security authentication, a user may click an acquire verification code button, so as to trigger a verification code acquisition request, and a client sends the verification code acquisition request to a server.
The server can receive a verification code acquisition request sent by the client, and analyze a current payment scene identifier carried in the verification code acquisition request under the condition of receiving the verification code acquisition request sent by the client.
It should be noted that, the service scenario identifier may be, for example, a service scenario name, a service scenario ID, a service scenario number, or a keyword (for example, payment, cash withdrawal, receipt, and the like) in the service scenario, which is not limited in this embodiment of the present invention.
S302, according to the corresponding relation between the preset service scene identification and the service scene, determining the current service scene corresponding to the current service scene identification.
For the current payment scene identifier carried in the verification code acquisition request, the embodiment of the invention can determine the current service scene corresponding to the current service scene identifier according to the corresponding relationship between the preset service scene identifier and the service scene.
For example, the embodiment of the present invention presets a corresponding relationship between a service scene identifier and a service scene, and as shown in table 1 below, for a current service scene identifier: and paying, so that the current service scene corresponding to the current service scene identification can be determined: a payment scenario.
Business scenario identification Business scenario
Payment Payment scenario
Cash withdrawal Cash-up scene
…… ……
TABLE 1
S303, inquiring the verification code acquisition times counted for the current service scene, and determining the verification code generation times corresponding to the current service scene.
In the embodiment of the present invention, the verification code acquisition times counted for the current service scenario may be queried, and the verification code generation times corresponding to the current service scenario may be determined (that is, the verification code generation times are limited).
It should be noted that, in the embodiment of the present invention, the verification code acquisition frequencies corresponding to different service scenarios are counted, and the generation times of different verification codes corresponding to different service scenarios are set according to the acquisition frequencies.
For example, in the embodiment of the present invention, the verification code acquisition frequencies corresponding to different service scenarios are counted, and the generation times of different verification codes corresponding to different service scenarios may be set according to the verification code acquisition frequencies, as shown in table 2 below. Wherein, the higher the verification code acquisition frequency is, the higher the verification code generation times can be.
Business scenario Verification code acquisition frequency Number of times of generation of verification code
Payment scenario 50 times/min 10
Cash-up scene 5 times/min 5
…… …… ……
TABLE 2
S304, when the verification code acquisition times reach the verification code generation times, returning a message that the verification code acquisition is invalid to the client.
In the embodiment of the present invention, this step is similar to the step S103, and the details of the embodiment of the present invention are not repeated herein.
S305, according to a preset verification code obtaining effective period, a verification code obtaining effective message is returned to the client.
In the embodiment of the invention, after the server returns the message that the verification code acquisition is invalid to the client, the client can receive the message that the verification code acquisition is invalid, prompt the user that the current short message verification function cannot be used, and set the verification code acquisition button triggering the verification code acquisition request to be in an unavailable state.
Therefore, the client cannot trigger the verification code acquisition request any more, but in order to ensure that the user continues to perform security authentication, the embodiment of the invention can return a verification code acquisition effective message to the client according to a preset verification code acquisition effective period, the client can receive the verification code acquisition effective message to prompt the user that the current short message verification function can be used, and the verification code acquisition button triggering the verification code acquisition request is set to be in an available state.
For example, for the client, a message that the short message verification code acquisition is invalid can be received, the user is prompted that the current short message verification function cannot be used, and the verification code acquisition request cannot be triggered any more by setting the verification code acquisition button triggering the verification code acquisition request to gray.
Therefore, the client cannot trigger the verification code acquisition request any more, after one day (namely the next day), the server returns a message that the short message verification code acquisition is valid to the client, the client can receive the message that the short message verification code acquisition is valid, the user is prompted that the current short message verification function can be used, the verification code acquisition button triggering the verification code acquisition request is set to be non-gray, and the verification code acquisition request can be triggered the next day.
Therefore, the server returns a valid verification code acquisition message to the client according to the preset verification code acquisition valid period, the client can receive the valid verification code acquisition message to prompt a user that the current short message verification function can be used, and the verification code acquisition button triggering the verification code acquisition request is set to be in a usable state to ensure that the verification function can be normally used.
As shown in fig. 4, which is a schematic diagram of an implementation flow of another security authentication method provided in an embodiment of the present invention, the method may be applied to a server, and specifically may include the following steps:
s401, under the condition that a verification code obtaining request sent by a client is received, analyzing a current service scene identification carried in the verification code obtaining request.
In the embodiment of the present invention, this step is similar to the step S301, and the details of the embodiment of the present invention are not repeated herein.
S402, determining the current service scene corresponding to the current service scene identification according to the corresponding relation between the preset service scene identification and the service scene.
In the embodiment of the present invention, this step is similar to the step S302, and the details of the embodiment of the present invention are not repeated herein.
S403, inquiring the verification code acquisition times counted for the current service scene, and determining the verification code generation times corresponding to the current service scene.
In the embodiment of the present invention, this step is similar to the step S303, and details of the embodiment of the present invention are not repeated herein.
S404, under the condition that the verification code obtaining times reach the verification code generating times, a message that the verification code obtaining is invalid is returned to the client.
In the embodiment of the present invention, this step is similar to the step S304, and the details of the embodiment of the present invention are not repeated herein.
S405, according to a preset verification code obtaining effective period, a verification code obtaining effective message is returned to the client.
In the embodiment of the present invention, this step is similar to the step S305, and details of the embodiment of the present invention are not repeated herein.
S406, under the condition that the verification code obtaining times do not reach the verification code generating times, analyzing the user identification carried in the verification code obtaining request.
S407, determining the security level corresponding to the current service scene, generating a verification code according to the security level, and sending the verification code to the terminal corresponding to the user identifier.
For the verification code obtaining times counted aiming at the current service scene and the verification code generating times corresponding to the current service scene, under the condition that the verification code obtaining times do not reach the verification code generating times, the server can analyze the user identification carried in the verification code obtaining request, determine the safety level corresponding to the current service scene, generate the verification code according to the safety level and send the verification code to the terminal corresponding to the user identification.
For example, for the number M of verification code acquisition counted for the current payment scenario and the number N of verification code generation corresponding to the current payment scenario, under the condition that the number M of verification code acquisition does not reach the number N of verification code generation (that is, M is smaller than N), the server may analyze the user identifier carried in the verification code acquisition request: thirdly, determining the security level corresponding to the current payment scene: and (4) level 1 (level 1, the highest security level and the next level of other levels), generating a verification code according to the security level, and sending the verification code to the mobile phone corresponding to the user identifier. The security levels corresponding to different service scenarios may be as shown in table 3 below.
Business scenario Level of security
Payment scenario Level 1
Embodying a scene Level 1
…… ……
TABLE 3
It should be noted that, for example, the user identifier may be a user ID, a user name, a user mobile phone number, and the like, which is not limited in the embodiment of the present invention. For the generated verification code, the verification code is sent to the terminal corresponding to the user identifier, and specifically, the verification code may be sent to the terminal corresponding to the user identifier in the form of a short message, an email, an application program push, and the like.
In addition, in the embodiment of the present invention, the server may specifically generate the verification code in the following manner: and determining the complexity and the length of the verification code corresponding to the security level, and generating the verification code with the complexity and the length. The way of generating the verification code may be random generation, which is not limited in this embodiment of the present invention.
For example, as shown in table 4 below, the complexity (a) and the length (10) of the verification code corresponding to the security level (level 1) may be determined, and the verification code of the complexity and the length may be randomly generated. Where A represents the highest complexity, the other next, where 10 represents the longest captcha, the other next.
Level of security Complexity of captcha Identifying code length
Level 1 A 10
Stage 2 B 8
…… …… ……
TABLE 4
It should be noted that, regarding the complexity of the verification code, it may be understood that the type of the symbol included in the verification code may be, for example, the verification code includes only numbers, which is regarded as the complexity of the verification code, or the verification code includes numbers and letters, which is regarded as the complexity of the verification code is higher, for example, the verification code includes numbers, letters and special characters, which is regarded as the complexity of the verification code is the highest, which is not limited in the embodiment of the present invention.
S408, receiving the target verification code sent by the client, and checking whether the target verification code is consistent with the verification code.
After the server sends the verification code to the terminal corresponding to the user identifier, the user can input a target verification code (which may be inconsistent with the verification code and used for distinguishing) at the client, so that the client can receive the target verification code input by the user and send the target verification code to the server for verification. And the server receives the target verification code sent by the client and verifies whether the target verification code is consistent with the verification code.
In addition, before checking whether the target verification code is consistent with the verification code, the server may query a checking frequency counted for the verification code, determine a checking threshold corresponding to the verification code, and check whether the target verification code is consistent with the verification code if the checking frequency does not exceed the checking threshold.
For example, the server queries the number m of times of verification counted for the verification code, and determines a verification threshold n (n may be 5) corresponding to the verification code, and if the number m of times of verification does not exceed the verification threshold n, verifies whether the target verification code is consistent with the verification code.
For the verification frequency counted by the verification code and the verification threshold corresponding to the verification code, if the verification frequency exceeds the verification threshold, it is determined that the verification of the verification code fails, which means that even if the target verification code is consistent with the verification code, the verification of the verification code is still determined to fail.
For example, if the number of times m of verification counted for the verification code and a verification threshold n (n may be 5) corresponding to the verification code exceed the verification threshold n, it is determined that the verification code fails, which means that even if the target verification code matches the verification code, the verification code fails.
S409, determining that the verification code passes the verification under the condition that the target verification code is consistent with the verification code.
For the target verification code and the verification code, in the case that the target verification code is consistent with the verification code, it may be determined that the verification code passes verification, so that subsequent steps (e.g., asset transfer, order confirmation) of the current business scenario may be continuously performed.
For example, for a target verification code and the verification code, if the target verification code is consistent with the verification code, it may be determined that the verification code passes verification, so that the following steps in the current payment scenario may be continuously performed: asset transfer, i.e., transfer of an asset to a seller account.
Further, since the validity period of the verification code is generally, for example, 15 minutes, before the verification of the verification code is determined to be passed, it is determined whether the verification code is in the validity period (that is, it is determined whether a time difference between the time at which the verification code is generated and the current time exceeds a threshold), and in the case where the verification code is in the validity period, it is determined that the verification of the verification code is passed.
For example, when the target verification code matches the verification code, it is determined whether the verification code is in a valid period (that is, it is determined whether a time difference between the time when the verification code is generated and the current time exceeds 15 minutes), and when the verification code is in the valid period, it is determined that the verification of the verification code is passed.
And for the verification code, determining that the verification of the verification code is not passed under the condition that the verification code is not in the valid period, which means that the verification code is invalid. For example, if the time difference between the time when the verification code is generated and the current time exceeds 15 minutes, the verification code is invalid, and it is determined that the verification of the verification code fails.
Corresponding to the above method embodiment, an embodiment of the present invention further provides a security authentication apparatus, as shown in fig. 5, the apparatus may include: a scene determining module 510, a times inquiring module 520, a times determining module 530, and an invalid message returning module 540.
A scene determining module 510, configured to determine a current service scene when a verification code obtaining request sent by a client is received;
a frequency query module 520, configured to query the number of times of obtaining the verification code counted for the current service scenario;
a frequency determining module 530, configured to determine the generation frequency of the verification code corresponding to the current service scenario;
an invalid message returning module 540, configured to return a message that the verification code acquisition is invalid to the client when the verification code acquisition times reach the verification code generation times;
the message that the verification code acquisition is invalid is used for enabling the client to set a button triggering the verification code acquisition request to be in an unavailable state.
In a specific implementation manner of the embodiment of the present invention, the apparatus further includes:
and the frequency setting module is used for counting the verification code acquisition frequency corresponding to different service scenes respectively and setting the generation frequency of different verification codes corresponding to different service scenes respectively according to the acquisition frequency.
In a specific implementation manner of the embodiment of the present invention, the scene determining module 510 is specifically configured to:
under the condition of receiving a verification code acquisition request sent by a client, analyzing a current service scene identifier carried in the verification code acquisition request;
and determining the current service scene corresponding to the current service scene identification according to the corresponding relation between the preset service scene identification and the service scene.
In a specific implementation manner of the embodiment of the present invention, the apparatus further includes:
the valid message returning module is used for obtaining a valid period according to a preset verification code and returning a verification code obtaining valid message to the client;
the message that the verification code acquisition is valid is used for enabling the client to set a button triggering the verification code acquisition request to be in an available state.
In a specific implementation manner of the embodiment of the present invention, the apparatus further includes:
the identification analysis module is used for analyzing the user identification carried in the verification code acquisition request under the condition that the verification code acquisition times do not reach the verification code generation times; and (c) a second step of,
the grade determining module is used for determining the safety grade corresponding to the current service scene;
the verification code generation module is used for generating a verification code according to the security level;
the verification code sending module is used for sending the verification code to a terminal corresponding to the user identifier;
the verification code checking module is used for receiving a target verification code sent by the client and checking whether the target verification code is consistent with the verification code;
and the verification passing module is used for determining that the verification code passes verification under the condition that the target verification code is consistent with the verification code.
In a specific implementation manner of the embodiment of the present invention, the verification code generation module is specifically configured to:
and determining the complexity and the length of the verification code corresponding to the security level, and generating the verification code with the complexity and the length.
In a specific implementation manner of the embodiment of the present invention, the verification code checking module is specifically configured to:
inquiring the number of times of verification counted by aiming at the verification code, and determining a verification threshold corresponding to the verification code;
and under the condition that the checking times do not exceed the checking threshold value, checking whether the target verification code is consistent with the verification code.
In a specific implementation manner of the embodiment of the present invention, the apparatus further includes:
and the verification failed first module is used for determining that the verification of the verification code fails under the condition that the verification times exceed the verification threshold value.
In a specific implementation manner of the embodiment of the present invention, the verification passing module is specifically configured to:
under the condition that the target verification code is consistent with the verification code, judging whether the verification code is in the validity period or not;
and determining that the verification code passes the verification under the condition that the verification code is in the valid period.
In a specific implementation manner of the embodiment of the present invention, the apparatus further includes:
and the verification failed second module is used for determining that the verification of the verification code fails under the condition that the verification code is not in the valid period.
An embodiment of the present invention further provides an electronic device, as shown in fig. 6, including a processor 61, a communication interface 62, a memory 63, and a communication bus 64, where the processor 61, the communication interface 62, and the memory 63 complete mutual communication through the communication bus 64,
a memory 63 for storing a computer program;
the processor 61 is configured to implement the following steps when executing the program stored in the memory 63:
determining a current service scene under the condition of receiving a verification code acquisition request sent by a client; inquiring the verification code acquisition times counted aiming at the current service scene, and determining the verification code generation times corresponding to the current service scene; under the condition that the verification code acquisition times reach the verification code generation times, returning a message that the verification code acquisition is invalid to the client; the message that the verification code acquisition is invalid is used for enabling the client to set a button triggering the verification code acquisition request to be in an unavailable state.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM), and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In another embodiment of the present invention, a storage medium is further provided, where instructions are stored, and when the storage medium runs on a computer, the storage medium causes the computer to execute the security authentication method in any one of the above embodiments.
In yet another embodiment provided by the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the security authentication method described in any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a storage medium or transmitted from one storage medium to another, for example, from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The storage medium may be any available medium that can be accessed by a computer or a data storage device including one or more available media integrated servers, data centers, and the like. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (13)

1. A method of secure authentication, the method comprising:
determining a current service scene under the condition of receiving a verification code acquisition request sent by a client;
inquiring the verification code acquisition times counted aiming at the current service scene, and determining the verification code generation times corresponding to the current service scene;
under the condition that the verification code acquisition times reach the verification code generation times, returning a message that the verification code acquisition is invalid to the client;
the message that the verification code acquisition is invalid is used for enabling the client to set a button triggering the verification code acquisition request to be in an unavailable state.
2. The method of claim 1, further comprising, prior to performing the method:
and counting verification code acquisition frequencies corresponding to different service scenes respectively, and setting generation times of different verification codes corresponding to the different service scenes respectively according to the acquisition frequencies.
3. The method of claim 1, wherein determining the current service scenario in case of receiving a request for acquiring a verification code sent by a client comprises:
under the condition of receiving a verification code acquisition request sent by a client, analyzing a current service scene identifier carried in the verification code acquisition request;
and determining the current service scene corresponding to the current service scene identification according to the corresponding relation between the preset service scene identification and the service scene.
4. The method of claim 1, wherein after the returning the message that the verification code acquisition is invalid to the client, further comprising:
according to a preset verification code obtaining effective period, returning a verification code obtaining effective message to the client;
the message that the verification code acquisition is valid is used for enabling the client to set a button triggering the verification code acquisition request to be in an available state.
5. The method according to any one of claims 1 to 4, further comprising:
under the condition that the verification code obtaining times do not reach the verification code generating times, analyzing a user identifier carried in the verification code obtaining request; and the number of the first and second groups,
determining a security level corresponding to the current service scene, generating a verification code according to the security level, and sending the verification code to a terminal corresponding to the user identifier;
receiving a target verification code sent by the client, and checking whether the target verification code is consistent with the verification code;
and determining that the verification code passes verification under the condition that the target verification code is consistent with the verification code.
6. The method of claim 5, wherein generating the verification code according to the security level comprises:
and determining the complexity and the length of the verification code corresponding to the security level, and generating the verification code with the complexity and the length.
7. The method of claim 5, wherein said verifying whether said target authentication code is consistent with said authentication code comprises:
inquiring the verification times counted aiming at the verification code, and determining a verification threshold corresponding to the verification code;
and under the condition that the checking times do not exceed the checking threshold value, checking whether the target verification code is consistent with the verification code.
8. The method of claim 7, further comprising:
and determining that verification of the verification code is failed under the condition that the verification times exceed the verification threshold.
9. The method of claim 5, wherein determining that the verification code is verified if the target verification code is consistent with the verification code comprises:
under the condition that the target verification code is consistent with the verification code, judging whether the verification code is in the validity period or not;
and determining that the verification code passes the verification under the condition that the verification code is in the valid period.
10. The method of claim 9, further comprising:
and under the condition that the verification code is not in the validity period, determining that the verification of the verification code is failed.
11. A security authentication apparatus, the apparatus comprising:
the scene determining module is used for determining the current service scene under the condition of receiving a verification code obtaining request sent by a client;
the number inquiry module is used for inquiring the verification code acquisition number counted aiming at the current service scene;
the number determining module is used for determining the generation number of the verification code corresponding to the current service scene;
an invalid message returning module, configured to return a message indicating that the verification code acquisition is invalid to the client when the verification code acquisition times reach the verification code generation times;
the message that the verification code acquisition is invalid is used for enabling the client to set a button triggering the verification code acquisition request to be in an unavailable state.
12. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 10 when executing a program stored in a memory.
13. A storage medium on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-10.
CN202110169314.4A 2021-02-07 2021-02-07 Security authentication method and device, electronic equipment and storage medium Pending CN114912991A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110169314.4A CN114912991A (en) 2021-02-07 2021-02-07 Security authentication method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110169314.4A CN114912991A (en) 2021-02-07 2021-02-07 Security authentication method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114912991A true CN114912991A (en) 2022-08-16

Family

ID=82762267

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110169314.4A Pending CN114912991A (en) 2021-02-07 2021-02-07 Security authentication method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114912991A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105095462A (en) * 2015-07-30 2015-11-25 北京京东尚科信息技术有限公司 Method and system for processing webpage repeated requests
CN108989263A (en) * 2017-05-31 2018-12-11 中国移动通信集团公司 Short message verification code attack guarding method, server and computer readable storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105095462A (en) * 2015-07-30 2015-11-25 北京京东尚科信息技术有限公司 Method and system for processing webpage repeated requests
CN108989263A (en) * 2017-05-31 2018-12-11 中国移动通信集团公司 Short message verification code attack guarding method, server and computer readable storage medium

Similar Documents

Publication Publication Date Title
US10580009B2 (en) Mobile communications message verification of financial transactions
CN110517097B (en) Method, device, equipment and storage medium for identifying abnormal users
US20180204215A1 (en) Detecting electronic intruders via updatable data structures
EP2255328A2 (en) Systems and methods to verify payment transactions
CN104954322A (en) Account binding method, device and system
CN112561633B (en) Virtual object order data verification method, device and equipment
KR20180113229A (en) Loan service providing method using black chain and system performing the same
CN108900525B (en) Processing method and device for verification code request
US20160112369A1 (en) System and Method for Validating a Customer Phone Number
CN112116389A (en) Method and system for identifying exchange fraud behaviors applied to point exchange
CN111476579A (en) Authority control method, device, equipment and medium
CN116862236A (en) Risk scene assessment method, system, terminal equipment and storage medium
CN114912991A (en) Security authentication method and device, electronic equipment and storage medium
CN112488562B (en) Service realization method and device
CN115065512A (en) Account login method, system, device, electronic equipment and storage medium
CN111507594B (en) Data processing method and device
CN114971632A (en) Social platform binding system, method and device, electronic equipment and storage medium
CN114841698A (en) Transaction information processing method and device and computer readable storage medium
CN114240436A (en) Electronic certificate verification and cancellation method and device, computer equipment and storage medium
CN113724077A (en) Loan approval method, device and system
CN111639241A (en) Processing method and device for screening name tickets
CN111901299A (en) Application authentication method and device, electronic equipment and storage medium
CA2877218C (en) Method for securing a transaction performed by bank card
KR20040040412A (en) Management System and method of Social Security number
CN109801092B (en) Resource security management method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination