Disclosure of Invention
In view of the above, the present invention aims to provide a verification code display method and system for lightweight business intrusion, so as to alleviate the technical problem of high additional operation cost of users in the prior art.
In a first aspect, an embodiment of the present invention provides a verification code display method for lightweight service intrusion, which is applied to a server; comprising the following steps: acquiring a service request when a target user accesses a target service; the target service is a service accessing to the verification code function; judging whether the target user stores a trusted voucher in the server; the trusted credential is a credential generated based on user environment information of the target user; if so, under the condition that the trusted credential is detected to have no abnormality, the verification code is not displayed to the target user.
Further, before acquiring the service request when the target user accesses the target service, the method further includes: acquiring user environment information of the target user; the user environment information includes: operating system, browser version, network conditions, hardware information; determining a security score for the target user based on the user environment information; the security score is an index for representing the security performance of the user environment information; generating a trusted voucher of the target user when the security score is greater than a first preset score; and storing the trusted certificate in the server, and performing persistence operation on the trusted certificate.
Further, the method further comprises: if the target user is judged to store the trusted voucher in the server and the trusted voucher is detected to be abnormal, acquiring user environment information of the target user; determining a security score for the target user based on the user environment information; judging whether the safety score is larger than a second preset score or not; if yes, the verification code is not displayed to the target user; and if not, displaying the verification code to the target user.
Further, the method further comprises: and adjusting the second preset score based on the current service security logic of the target service.
Further, the method further comprises: if the target user is judged to not store the trusted voucher in the server, judging whether the current service security logic of the target service needs to display a verification code to the target user or not; if yes, showing a verification code to the target user; and if not, not displaying the verification code to the target user.
In a second aspect, the embodiment of the invention also provides a verification code display system for lightweight business invasion, which is applied to a server; comprising the following steps: the display device comprises an acquisition module, a judgment module and a display module; the acquisition module is used for acquiring a service request when a target user accesses a target service; the target service is a service accessing to the verification code function; the judging module is used for judging whether the target user stores the trusted certificate in the server or not; the trusted credential is a credential generated based on user environment information of the target user; and the display module is used for not displaying the verification code to the target user under the condition that the trusted credential is detected to be not abnormal if the trusted credential is judged to be stored in the server by the target user.
Further, the system further comprises: the generation module is used for acquiring the user environment information of the target user; the user environment information includes: operating system, browser version, network conditions, hardware information; determining a security score for the target user based on the user environment information; the security score is an index for representing the security performance of the user environment information; and generating a trusted voucher of the target user when the security score is greater than a first preset score.
Further, the system further comprises: and the storage module is used for storing the trusted certificate in the server and carrying out persistence operation on the trusted certificate.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor executes the computer program to implement the steps of the method described in the first aspect.
In a fourth aspect, embodiments of the present invention also provide a computer readable medium having non-volatile program code executable by a processor, the program code causing the processor to perform the method of the first aspect.
The invention provides a verification code display method and a verification code display system for lightweight business invasion, which can greatly reduce the cost of a trusted user for verification by repeatedly passing through a verification code by setting a trusted certificate of a target user, reduce the cost of a normal user used by a common user, alleviate the technical problem of high additional operation cost of the user in the prior art, and improve the use experience of the user.
Detailed Description
The following description of the embodiments of the present invention will be made apparent and fully in view of the accompanying drawings, in which some, but not all embodiments of the invention are shown. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Embodiment one:
fig. 1 is a flowchart of a verification code display method for lightweight service intrusion, which is applied to a server according to an embodiment of the present invention. As shown in fig. 1, the method specifically includes the following steps:
step S102, obtaining a service request when a target user accesses a target service; the target service is a service accessing to the verification code function.
Step S104, judging whether the target user stores the trusted voucher in the server; the trusted credential is a credential generated based on user context information of the target user.
Step S106, if yes, under the condition that the trusted certificate is detected to be free from abnormality, the verification code is not displayed to the target user.
Optionally, the validity period of the trusted credential of the target user exists, and the detection of whether the trusted credential is abnormal or not can be achieved by monitoring whether the trusted credential is within the validity period or whether the use environment of the target user is consistent with the use environment of the target user when the trusted credential is generated.
The invention provides a verification code display method for lightweight business invasion, which can greatly reduce the cost of a trusted user for verification by repeatedly passing through a verification code by setting a trusted certificate of a target user, reduce the cost of a normal user used by a common user, alleviate the technical problem of high additional operation cost of the user in the prior art, and promote the use experience of the user.
Optionally, before step S102, the method provided by the embodiment of the present invention further includes generating a trusted credential of the target user, specifically including the following steps:
step S11, obtaining user environment information of a target user; the user environment information includes: operating system, browser version, network conditions, hardware information.
Step S12, determining the security score of the target user based on the user environment information; the security score is an indicator that characterizes the security performance of the user context information.
And S13, when the security score is larger than a first preset score, generating a trusted voucher of the target user. Alternatively, the trusted voucher needs to be obtained by the user by accessing the specified link address and in case the security score passes.
Step S14 stores the trusted voucher in the server and performs a persistence operation on the trusted voucher.
Optionally, if in step S104, it is determined that the target user stores the trusted credential in the server, and an abnormality is detected in the trusted credential, for example: and judging the security score of the target user again if the validity period of the trusted voucher is expired or the environment of the trusted voucher in use is inconsistent with the acquired environment.
Specifically, user environment information of a target user is obtained; determining a security score for the target user based on the user environment information; judging whether the safety score is larger than a second preset score or not; if yes, the verification code is not displayed to the target user; if not, the verification code is displayed to the target user.
Optionally, the method provided by the embodiment of the invention further includes: and adjusting a second preset score based on the current service security logic of the target service. That is, the safety threshold (i.e., the second preset score) in the embodiment of the present invention may be dynamically adjusted or set according to the actual needs.
The security of the network information in the prior art cannot be effectively ensured completely based on the trusted certificates or only through the setting of security rules or security scores. Therefore, the method provided by the embodiment of the invention realizes the dynamic treatment of the security risk by combining the trusted certificate with the security score of the user and configuring the security threshold, and reduces the experience blocking and the use cost of the verification code to the common user.
Optionally, in the embodiment of the present invention, if it is determined that the target user does not store the trusted credential in the server, it is determined whether the current service security logic of the target service needs to display the verification code to the target user; if yes, showing the verification code to the target user; if not, the verification code is not displayed to the target user.
Specifically, the target service with the verification code function is docked, the security risk threshold can be dynamically set according to the security index requirement of the current service logic, and if the security index of the current service logic needs to reduce interception setting, the verification code is not displayed to the target user; and if the security index of the current business logic and the detected security index reach the security risk threshold, displaying the verification code.
According to the verification code display method for lightweight service intrusion, the triggering threshold value (namely the second preset score) of the verification code can be set through the security score, the cost that trusted users need to repeatedly verify through the verification code can be greatly reduced through the trusted certificates, the cost of normal service use of common users is reduced, and the use experience of users is provided.
Embodiment two:
fig. 2 is a schematic diagram of a verification code display system for lightweight service intrusion, which is applied to a server according to an embodiment of the present invention. As shown in fig. 2, the system includes: the system comprises an acquisition module 10, a judgment module 20 and a display module 30.
Specifically, the acquiring module 10 is configured to acquire a service request when the target user accesses the target service; the target service is a service accessing to the verification code function.
A judging module 20, configured to judge whether the target user stores the trusted certificate in the server; the trusted credential is a credential generated based on user context information of the target user.
And the display module 30 is configured to not display the verification code to the target user if it is determined that the target user stores the trusted credential in the server and if it is detected that the trusted credential does not have an abnormality.
The invention provides a verification code display system for lightweight business invasion, which can greatly reduce the cost of a trusted user for verification by repeatedly passing through a verification code by setting a trusted certificate of a target user, reduce the cost of a normal user used by a common user, alleviate the technical problem of high additional operation cost of the user in the prior art, and promote the use experience of the user.
Optionally, the display module 30 is further configured to, if it is determined that the target user stores the trusted certificate in the server and it is detected that the trusted certificate is abnormal, re-determine the security score of the target user. Specifically, user environment information of a target user is obtained; determining a security score for the target user based on the user environment information; judging whether the safety score is larger than a second preset score or not; if yes, the verification code is not displayed to the target user; if not, the verification code is displayed to the target user.
Optionally, the display module 30 is further configured to adjust the second preset score based on the current service security logic of the target service.
Optionally, the display module 30 is further configured to determine whether the current service security logic of the target service needs to display the verification code to the target user if it is determined that the target user does not store the trusted credential in the server; if yes, showing the verification code to the target user; if not, the verification code is not displayed to the target user.
Optionally, fig. 3 is a schematic diagram of another verification code display system for lightweight business intrusion provided according to an embodiment of the present invention. As shown in fig. 3, the system further includes: a generating module 40, configured to obtain user environment information of a target user; the user environment information includes: operating system, browser version, network conditions, hardware information; determining a security score for the target user based on the user environment information; the security score is an index for representing the security performance of the user environment information; and when the security score is greater than the first preset score, generating a trusted voucher of the target user.
As shown in fig. 3, the system provided by the embodiment of the present invention further includes: the storage module 50 is configured to store the trusted certificate in the server and perform a persistence operation on the trusted certificate.
The embodiment of the invention also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the computer program to realize the steps of the method in the first embodiment.
The present invention also provides a computer-readable medium having non-volatile program code executable by a processor, the program code causing the processor to perform the method of the first embodiment.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the invention.