CN117688543A - Graph verification method, device, equipment and storage medium - Google Patents

Graph verification method, device, equipment and storage medium Download PDF

Info

Publication number
CN117688543A
CN117688543A CN202311695607.1A CN202311695607A CN117688543A CN 117688543 A CN117688543 A CN 117688543A CN 202311695607 A CN202311695607 A CN 202311695607A CN 117688543 A CN117688543 A CN 117688543A
Authority
CN
China
Prior art keywords
verification
graph
user
color
client
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
CN202311695607.1A
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.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications Group 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 China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN202311695607.1A priority Critical patent/CN117688543A/en
Publication of CN117688543A publication Critical patent/CN117688543A/en
Pending legal-status Critical Current

Links

Abstract

The application provides a graph verification method, a device, equipment and a storage medium. The method comprises the following steps: receiving a verification request sent by a client, and feeding back a verification graph to the client so that a user can draw the verification graph on a drawing board of the client; acquiring user operation information of a user submitted by a client when the user draws the verification graph, and drawing the graph by the user; judging whether the drawing graph is drawn by a machine according to the user operation information, and judging whether the drawing graph passes the verification according to the verification graph and the drawing graph if the drawing graph is not drawn by the machine. According to the method, by combining sliding verification and graphic verification and establishment of a verification evaluation model, verification accuracy and verification efficiency of verification codes are improved.

Description

Graph verification method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of security, and in particular, to a method, an apparatus, a device, and a storage medium for graphic verification.
Background
Captcha technology is a network security measure aimed at identifying and confirming whether a user is human to prevent automated operation of a malicious program or a malicious attacker. Verification codes evolve from simple text strings or numbers to complex forms containing images, sounds, or other multimedia elements, such as graphical verification codes, voice verification codes, and sliding verification codes.
The graphic verification code is a verification mode with more application scenes, and the currently common graphic verification code randomly selects characters from a server, displays the characters on a picture, and inputs the characters into a designated text box by a user to be submitted to the background for verification.
The scene requires that the user can correctly input the displayed characters, has higher requirements on the user, and certain verification codes using the uncommon words bring bad experience to some users. The method has the problems of poor readability, poor user experience and the like.
Disclosure of Invention
The application provides a graph verification method, a device, equipment and a storage medium, which are used for realizing the graph verification method combining a sliding verification mechanism and a graph verification mechanism and improving the accuracy and verification efficiency of verification codes.
In a first aspect, the present application provides a method for graphical verification, including:
receiving a verification request sent by a client, and feeding back a verification graph to the client so that a user can draw the verification graph on a drawing board of the client;
acquiring user operation information of a user submitted by a client when the user draws the verification graph, and drawing the graph by the user;
judging whether the drawing graph is drawn by a machine according to the user operation information, and judging whether the drawing graph passes the verification according to the verification graph and the drawing graph if the drawing graph is not drawn by the machine.
In one possible design, the feeding back verification graphics to the client includes:
randomly acquiring a verification graph from a graph library, wherein the verification graph is a linear picture or a Chinese character, the number of strokes of the verification graph does not exceed a preset number, and the display information of each stroke of the verification graph is different;
and sending the verification graph to the client.
In one possible design, before the randomly acquiring a verification pattern from the pattern library, the method further includes:
acquiring the number N of strokes of the verification graph, and randomly selecting a first color and a second color, wherein the first color and the second color are different;
generating a gradient color gamut of two colors according to the first color and the second color, and performing N-1 equal division processing on the gradient color gamut to obtain N-2 equal division points, or performing N equal division processing on the gradient color gamut to obtain N-1 equal division points, wherein N is a positive integer;
if N-2 equal dividing points are obtained, each stroke color is given in sequence according to the first color, the color on each equal dividing point and the second color, and a verification graph with colors is obtained;
If N-1 equal dividing points are obtained, each stroke color is given in sequence according to the first color and the color on each equal dividing point, and a verification graph with colors is obtained.
In one possible design, the randomly retrieving a verification pattern from a pattern library includes:
randomly acquiring a verification graph and drawing board information corresponding to the verification graph from a graph library, wherein the drawing board information comprises selectable target colors for drawing the verification graph, and the target colors are different from the colors of the verification graph;
transmitting the verification graphic to the client, comprising:
and sending the verification graph and the drawing board information to the client so that the client can display the color on the drawing board according to the drawing board information.
In one possible design, at least one non-linear stroke exists in the linear drawing, and at least one non-horizontal and non-vertical stroke exists in the Chinese character.
In one possible design, the determining whether the drawing pattern is a machine drawing according to the user operation information includes:
acquiring user operation behaviors of single strokes according to the user operation information, wherein the user operation behaviors of the single strokes comprise at least one of operation running speed, stroke jump or change amplitude of the operation running speed;
And judging whether the drawing graph is drawn by a machine according to the operation behaviors of the user of the single stroke.
In one possible design, the determining whether the drawing graphic is a machine drawing according to the user operation behavior of the single stroke includes:
inputting the user operation behaviors of the single strokes into a machine judging model, wherein the machine judging model is used for judging whether the drawing graph is drawn by a machine or not; wherein the machine discriminant model is a classification model;
obtaining a classification result output by the machine discrimination model, and determining whether the drawing graph is drawn by a machine according to the classification result;
and if the non-machine drawing of the drawing graph is determined according to the single stroke, continuing to judge whether the drawing graph is machine drawing or not based on the user operation behavior of the next stroke until the drawing graph is determined to be machine drawing or all strokes are judged to be finished, and determining that the drawing graph is non-machine drawing.
In one possible design, the determining whether the verification passes according to the verification pattern and the drawing pattern includes:
obtaining the similarity between the verification graph and the drawing graph;
And if the similarity is higher than the first preset similarity and lower than the second preset similarity, confirming that the verification is passed.
In one possible design, a drawing board of the client is further provided with a cancel control, and the cancel control responds to the cancel operation of the user to cancel the last drawn stroke; the revocation control may be operated at least once.
In one possible design, the drawing pattern is a pattern drawn by a user after enlarging the verification pattern.
In a second aspect, the present application provides a graphic verification apparatus, comprising:
the processing module is used for receiving the verification request sent by the client and feeding back the verification graph to the client so that a user can draw the verification graph on a drawing board of the client;
the processing module is also used for acquiring user operation information submitted by the client when the user draws the verification graph and drawing graph completed by the user;
and the analysis module is used for judging whether the drawing graph is drawn by a machine according to the user operation information, and judging whether the drawing graph passes the verification according to the verification graph and the drawing graph if the drawing graph is not drawn by the machine.
In one possible design, the processing module is further specifically configured to:
randomly acquiring a verification graph from a graph library, wherein the verification graph is a linear picture or a Chinese character, the number of strokes of the verification graph does not exceed a preset number, and the display information of each stroke of the verification graph is different;
and sending the verification graph to the client.
In one possible design, the processing module is further specifically configured to:
acquiring the number N of strokes of the verification graph, and randomly selecting a first color and a second color, wherein the first color and the second color are different;
generating a gradient color gamut of two colors according to the first color and the second color, and performing N-1 equal division processing on the gradient color gamut to obtain N-2 equal division points, or performing N equal division processing on the gradient color gamut to obtain N-1 equal division points, wherein N is a positive integer;
if N-2 equal dividing points are obtained, each stroke color is given in sequence according to the first color, the color on each equal dividing point and the second color, and a verification graph with colors is obtained;
if N-1 equal dividing points are obtained, each stroke color is given in sequence according to the first color and the color on each equal dividing point, and a verification graph with colors is obtained.
In one possible design, the processing module is further specifically configured to:
randomly acquiring a verification graph and drawing board information corresponding to the verification graph from a graph library, wherein the drawing board information comprises selectable target colors for drawing the verification graph, and the target colors are different from the colors of the verification graph;
transmitting the verification graphic to the client, comprising:
and sending the verification graph and the drawing board information to the client so that the client can display the color on the drawing board according to the drawing board information.
In one possible design, the processing module is further specifically configured to:
at least one non-linear stroke exists in the linear picture, and at least one non-horizontal stroke and at least one non-vertical stroke exists in the Chinese character.
In one possible design, the analysis module is also specifically configured to:
acquiring user operation behaviors of single strokes according to the user operation information, wherein the user operation behaviors of the single strokes comprise at least one of operation running speed, stroke jump or change amplitude of the operation running speed;
and judging whether the drawing graph is drawn by a machine according to the operation behaviors of the user of the single stroke.
In one possible design, the analysis module is also specifically configured to:
inputting the user operation behaviors of the single strokes into a machine judging model, wherein the machine judging model is used for judging whether the drawing graph is drawn by a machine or not; wherein the machine discriminant model is a classification model;
obtaining a classification result output by the machine discrimination model, and determining whether the drawing graph is drawn by a machine according to the classification result;
and if the non-machine drawing of the drawing graph is determined according to the single stroke, continuing to judge whether the drawing graph is machine drawing or not based on the user operation behavior of the next stroke until the drawing graph is determined to be machine drawing or all strokes are judged to be finished, and determining that the drawing graph is non-machine drawing.
In one possible design, the analysis module is also specifically configured to:
obtaining the similarity between the verification graph and the drawing graph;
and if the similarity is higher than the first preset similarity and lower than the second preset similarity, confirming that the verification is passed.
In one possible design, a drawing board of the client is further provided with a cancel control, and the cancel control responds to the cancel operation of the user to cancel the last drawn stroke; the revocation control may be operated at least once.
In one possible design, the drawing pattern is a pattern drawn by a user after enlarging the verification pattern. In a third aspect, the present application provides a graphical verification electronic device, comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored by the memory such that the processor performs the graphical verification method in any one of the possible implementations of any one of the aspects above.
In a fourth aspect, the present application provides a computer-readable storage medium having stored therein computer-executable instructions which, when executed by a processor, implement a graphical verification method in any one of the possible implementations of any one of the aspects above.
The application provides a graph verification method, a device, equipment and a storage medium, wherein the method comprises the following steps: receiving a verification request sent by a client, and feeding back a verification graph to the client so that a user can draw the verification graph on a drawing board of the client; acquiring user operation information of a user submitted by a client when the user draws the verification graph, and drawing the graph by the user; judging whether the drawing graph is drawn by a machine according to the user operation information, and judging whether the drawing graph passes the verification according to the verification graph and the drawing graph if the drawing graph is not drawn by the machine. Through the mode of stroke drawing, the user is not required to recognize and input characters, the use threshold is reduced, verification results are jointly judged through multiple dimensions such as operation information verification and graphic verification, and the accuracy and efficiency of verification code verification are improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
Fig. 1 is a data interaction diagram of a graph verification method according to an embodiment of the present application.
Fig. 2 is a flowchart of a graphics verification method according to an embodiment of the present application.
Fig. 3 is a flowchart of a second method for graphic verification according to an embodiment of the present application.
Fig. 4 is a flowchart III of a graph verification method according to an embodiment of the present application.
Fig. 5 is a schematic structural diagram of a graphic verification device according to an embodiment of the present application.
Fig. 6 is a hardware schematic diagram of a graphics verification device according to an embodiment of the present application.
Specific embodiments thereof have been shown by way of example in the drawings and will herein be described in more detail. These drawings and the written description are not intended to limit the scope of the inventive concepts in any way, but to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the accompanying claims.
In order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second", etc. are used to distinguish the same item or similar items having substantially the same function and effect. For example, the first device and the second device are merely for distinguishing between different devices, and are not limited in their order of precedence. It will be appreciated by those of skill in the art that the words "first," "second," and the like do not limit the amount and order of execution, and that the words "first," "second," and the like do not necessarily differ.
In this application, the terms "exemplary" or "such as" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "for example" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
In the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a alone, a and B together, and B alone, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b, or c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or plural.
Captcha technology is a network security measure aimed at identifying and confirming whether a user is human to prevent automated operation of a malicious program or a malicious attacker. The application range of the system is wide, and the system covers network services and applications in various fields, namely login verification, account registration, data submission and other scenes.
Verification codes evolve from simple text strings or numbers to complex forms containing images, sounds, or other multimedia elements, such as graphical verification codes, voice verification codes, and sliding verification codes.
At present, the graphic verification code is a verification mode with more application scenes, but the graphic verification code has the problems of easy cracking, poor readability, poor user experience and the like, and some verification codes using rarely used words bring bad experience to some users.
FIG. 1 is a scene interaction diagram of graphic verification provided by the present application, as shown in the figure, process 1 is that a client initiates a verification request to a server; the process 2 is that the server returns a verification graph; the process 3 is that the client reports the user operation data; process 4 is the client submitting the graphic to be verified depicted by the user based on the verification graphic in the graphic library; and 5, the server returns a verification result.
According to the method, through a stroke drawing mode, a user is not required to recognize and input characters, the use threshold is reduced, the cracking difficulty is improved through adding special strokes and a color gray level change technology among the strokes, verification results are jointly judged through multiple dimensions such as sliding verification and graphic verification, and the accuracy and efficiency of verification code verification are improved.
The following describes the technical solutions of the present application and how the technical solutions of the present application solve the above technical problems in detail with specific embodiments. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 2 is a flowchart of a graphics verification method provided in an embodiment of the present application, as shown in fig. 2, where the method includes:
s201, receiving a verification request sent by a client, and feeding back a verification graph to the client so that a user can draw the verification graph on a drawing board of the client.
The client may be a web page, mobile application, desktop application, etc., which sends an authentication request to the server when authentication of the user's identity is required. This request contains identity information of the user, device information, etc. The server, upon receiving the authentication request, processes it. This processing includes verifying the validity of the request, for example checking whether the request originates from a legitimate client, or whether valid user identity information is included in the request. The server generates a specific verification pattern based on the received verification request, which may be a simple word or a more complex pattern, and the specific verification pattern is randomly generated by the server. The server then sends this graphic back to the client.
After the client receives the verification graphic sent by the server, the user can see the graphic on the drawing board of the client. According to the prompt information, the user needs to draw the verification graph on the drawing board. Wherein the graphical editing area of the palette may be clicked on to zoom in and view and provide a button for final submission by the user.
The drawing modes can be mouse drawing, touch screen drawing, handwriting pen drawing and the like according to different input modes. The mouse drawing means that a user can click and drag on the drawing board by using the mouse, and verification graphics are gradually drawn according to prompt information. Through movement and clicking operations of the mouse, the user can draw various shapes and lines. If the client is a touch screen device, the user can directly use a finger to operate on the drawing board. They can drag and draw the required graph with the finger according to the prompt information. Touch screen devices typically provide some gesture or swipe gesture to assist the user in more convenient operation. Some client devices are equipped with a stylus or other similar input device. The user can write on the drawing board by using the handwriting pen, and gradually draw the verification graph according to the prompt information. In the process of drawing the verification pattern, if errors occur in the drawing process, the verification information can be modified as long as the verification information is not submitted.
In a specific embodiment, a drawing board of the client is further provided with a cancel control, and the cancel control responds to the cancel operation of the user to cancel the last drawn stroke; the revocation control may be operated at least once.
The undo control will typically assist the user in correcting errors or improving graphics in response to the user's undo operation. This control can be operated at least once, that is, the user can make multiple undo and redraw until they are satisfied. By withdrawing the control, the user may withdraw their last stroke and may again withdraw as desired.
In a specific embodiment, the drawing pattern is a pattern drawn by a user after enlarging the verification pattern.
The verification graph can be selected to be displayed in a full screen mode, so that the user can observe and draw the details of the verification graph better, and the drawn verification graph can be submitted directly or submitted after being cancelled.
S202, acquiring user operation information submitted by a client when the user draws the verification graph and drawing the graph completed by the user;
in the verification process of the graphic verification code, the client side collects operation information and a final drawing result of a user when drawing a verification graphic, and submits the operation information to the server for verification. The user operation information includes information such as track coordinates of the user drawing verification pattern, drawing speed, and the like. The final rendering result refers to the final version of the graphical verification code that the user rendered on the client palette. The depicted graph is transmitted in a binary form or a Base64 coding form, and the transmission efficiency and the security are ensured through an encryption algorithm.
S203, judging whether the drawing graph is drawn by a machine according to the user operation information, and judging whether the drawing graph passes the verification according to the verification graph and the drawing graph if the drawing graph is not drawn by the machine.
Because the drawing operation is usually executed according to preset algorithms and parameters by the machine drawing program, and the drawing operation is not affected by factors such as artificial emotion or physical strength, the operation running speed of the machine drawing is usually stable, and no obvious speed change exists. Because the drawing is performed according to a preset algorithm and parameters, the jump among each stroke is less, the line looks smoother, and obvious mutation and pause are avoided when the drawing is performed artificially. Because machine-drawn programs typically use the same algorithms and parameters to draw multiple graphics, resulting in higher similarity in shape, machine-drawn graphics typically have higher shape repeatability. In yet another aspect, machine mapped operating speeds may be time dependent. For example, the speed of machine drawing may be gradually increased or gradually decreased over time, or remain constant for a particular period of time.
Through the characteristics, according to the user operation information, the behavior of the drawing process is analyzed to judge whether the drawing is machine drawing, if the drawing is not machine drawing, the drawn graph is further judged, the drawn graph is compared with the original verification code graph, the similarity of the drawn graph and the original verification code graph is judged, and finally whether verification is passed is determined.
In a specific embodiment, the determining whether the drawing graphic is a machine drawing according to the user operation information includes: acquiring user operation behaviors of single strokes according to the user operation information, wherein the user operation behaviors of the single strokes comprise at least one of operation running speed, stroke jump or change amplitude of the operation running speed; and judging whether the drawing graph is drawn by a machine according to the operation behaviors of the user of the single stroke.
In this embodiment, the user operation behavior abstracts a plurality of behavior indexes, including an operation running speed, a stroke jump, or a variation range of the operation running speed. The operation running speed refers to the speed of performing single stroke operation when a user draws a graph. If the operating speed is stable, i.e. there is no significant change in speed during stroke drawing, or there is a significant periodicity in the law of change, this may indicate that the pattern is drawn by the machine. Stroke jump refers to whether there is a sudden break or discontinuity in the line between individual strokes. If there is no apparent jump between strokes, the line appears smooth, which may indicate that the graph is drawn by the machine. Conversely, if there are significant jumps or line discontinuities, this may be an artificially drawn trace. The magnitude of change in the operation running speed means that if the user changes the magnitude of change in the operation running speed, such as abrupt acceleration or deceleration, or the speed does not change at the time of drawing a graphic, this may be machine drawing. In addition, the magnitude of the change in the operation running speed is related to the content or structure of the graph, for example, when a curve or a broken line is drawn, the speed change is irregularly or periodically changed, and then this may be a trace drawn by the machine.
First, we need to collect the operation information of the user when drawing the graphics. By monitoring touch events and the like, behaviors such as moving tracks, dragging, touching, sliding and the like are acquired, the information can be captured and collected to a client through a front-end technology, and user operation behavior data such as operation running speed, stroke jump, change amplitude of the operation running speed and the like of a user are acquired through analysis, wherein the analysis process can be put at the client or a server. The method comprises the steps that a client collects a coordinate point of a moving track of a user in a unit time, the operation running speed in the unit time is obtained by calculating the distance between a starting point and an ending point in the unit time, and the maximum value and the minimum value of the speeds in all the unit time are obtained; obtaining stroke jump through changing the horizontal and vertical coordinates of continuous points on the track coordinates in the process of drawing one stroke, and obtaining the maximum value and the minimum value of the stroke jump in the drawing process; and obtaining the maximum value and the minimum value of the variation amplitude of the operation running speed by the operation speed in the adjacent unit time period. These data are input into a machine-learned model for determining whether or not the drawing figure is machine drawing, and it is determined whether or not the pen drawn by the user is machine drawing.
According to the method for verifying the graphic verification code, the verification request sent by the client is received, and the verification graphic is fed back to the client, so that a user can draw the verification graphic on a drawing board of the client; acquiring user operation information of a user submitted by a client when drawing a verification graph and drawing the graph completed by the user; judging whether the drawing graph is drawn by a machine according to the user operation information, and judging whether the drawing graph passes the verification according to the verification graph and the drawing graph if the drawing graph is not drawn by the machine. The embodiment realizes that the user is not required to recognize and input characters in a stroke drawing mode, reduces the use threshold, and improves the accuracy and efficiency of verification code verification by jointly judging the verification result through multiple dimensions such as operation information verification, graphic verification and the like.
Fig. 3 is a flowchart second of a graph verification method provided in an embodiment of the present application, as shown in fig. 3, on the basis of fig. 1, illustrating a client feedback verification graph method, including:
s301, randomly acquiring a verification graph from a graph library, wherein the verification graph is a linear picture or a Chinese character, the number of strokes of the verification graph does not exceed a preset number, and the display information of each stroke of the verification graph is different;
The graphic library contains various linear pictures or Chinese characters which can be used as verification graphics, and the linear pictures or Chinese characters cannot exceed the preset number of strokes, so that the graphics cannot be excessively complicated. And each stroke of the verification pattern displays different information, so as to ensure the uniqueness and the identifiability of the verification pattern, and the gray scale or the color of different strokes can be confirmed according to the number of strokes of the verification pattern. In a specific embodiment, obtaining the number of strokes N of the verification pattern, and randomly selecting a first color and a second color, wherein the first color and the second color are different; generating a gradient color gamut of two colors according to the first color and the second color, and performing N-1 equal division processing on the gradient color gamut to obtain N-2 equal division points, or performing N equal division processing on the gradient color gamut to obtain N-1 equal division points, wherein N is a positive integer; if N-2 equal dividing points are obtained, each stroke color is given in sequence according to the first color, the color on each equal dividing point and the second color, and a verification graph with colors is obtained; if N-1 equal dividing points are obtained, each stroke color is given in sequence according to the first color and the color on each equal dividing point, and a verification graph with colors is obtained.
By taking two different colors and generating a gradient gamut of the two colors. And obtaining the color value in the gradient color domain according to the stroke number of the verification graph, and finally confirming the color of each stroke of the verification graph. The first color is typically one color with high saturation and the second color is another color with high saturation or white with zero saturation. If both colors are high saturation colors, the same number of color values as the number of strokes is obtained by performing a stroke number halving operation on the gradient color gamut consisting of the two high saturation colors, including the color values of the halving point and the two end points. For example: the selected colors are positive red and positive blue, a 'no' word is written, the target 'no' word is divided into 4 strokes, the gradual change color gamut from positive red to positive blue is halved, two trisection points are obtained, and then the 4 strokes of the target word respectively fall on the positive red of the endpoint, the color of the first trisection point color value, the color of the second trisection point color value and the positive blue of the other endpoint.
If only one color with higher saturation is selected, generating a gradual change color gamut from secondary color to white color, and dividing the gradual change color gamut by the number of strokes because the strokes do not take the white color, sequentially acquiring the color of the saturated color and the color of the color value of the equal division point. For example: the selected color is normal red, a 'no' word is written, the target characters are divided into 4 strokes, four equal divisions are carried out on the gradual change color gamut from normal red to white, three equal division points are obtained, each stroke color is composed of normal red and three equal division point color value colors, and no white pen is dropped.
After each selected presentation of the verification graphic in the graphic library, a different gradient color from that of the previous selected presentation needs to be reconfigured, the graphic is regenerated according to the newly selected color and put into the graphic library for replacement, and the used graphic is deleted.
In a specific embodiment, at least one non-linear stroke exists in the linear picture, and at least one non-horizontal stroke and at least one non-vertical stroke exists in the Chinese character.
Ensuring that the selected verification patterns are of a certain complexity and uniqueness so that they contain non-straight and non-horizontal and non-vertical strokes requires a machine or person to more accurately recognize and process the strokes. This design can increase the difficulty in identifying the verification pattern, thereby increasing its security.
S302, drawing board information corresponding to the verification graph is obtained from a graph library, wherein the drawing board information comprises selectable target colors for drawing the verification graph, and the target colors are different from the colors of the verification graph.
And generating corresponding drawing board information according to the verification graph. The palette information includes background, borders, or other decorative information. In order to prevent the colors of the lines of the drawing figures and the colors of the verification figures from being indistinguishable, the user experience is improved, the colors of the brushes are calculated simultaneously when the verification figures are obtained from the figure library, and the client is informed of drawing the figures or Chinese characters by using the colors of the brushes. For example: according to each color of the verification graph, an ordered sequence of colors is obtained, the ordered sequence of colors is issued to the client, the colors of the user drawing the verification graph can be sequentially valued according to the ordered sequence, wherein the first color value of the sequence is obtained, the second color value of the sequence is obtained, and the third color value of the second color value of the sequence is obtained, and so on. If the verification pattern is a stroke verification pattern, the color values of the verification pattern and the bisector point of the white gradient color gamut are obtained.
Wherein, S301 and S302 have no strict time limit relationship, and the drawing board information may be acquired when the verification pattern is acquired, or the verification pattern may be acquired first, and then the drawing board information may be acquired.
S303, the verification graph and drawing board information corresponding to the verification graph are sent to the client.
And sending the randomly acquired verification graph and drawing board information generated according to the verification graph to the client for the user to draw the graph verification code.
By limiting the graphic verification code, the graphic verification code is not too simple or complex for the purpose of facilitating user identification and operability, and at least one oblique line or a nonlinear line is necessary to be arranged in the graphic verification code; meanwhile, each verification pattern is set with colors, so that the risk that verification codes are easy to be recognized by a machine is reduced; in order to prevent the user drawing color from being similar or consistent with the line color of the verification code picture, the drawing line track color is specified.
Fig. 4 is a flowchart III of a graph verification method provided in an embodiment of the present application, as shown in fig. 4, further illustrating how to determine whether verification is passed or not through user operation information and a drawing graph on the basis of fig. 1, including:
S401, acquiring user operation information submitted by a client when the user draws the verification graph and drawing the graph completed by the user;
s402, inputting the user operation behaviors of the single strokes into a machine judging model, wherein the machine judging model is used for judging whether the drawing graph is drawn by a machine or not; wherein the machine discriminant model is a classification model;
s403, obtaining a classification result output by the machine discrimination model, and determining whether the drawing graph is drawn by a machine according to the classification result; if the drawing is non-machine drawing, executing S404; if not, executing S405;
in the verification process of the graphic verification code, operation information of a user when the user draws the verification graph and the drawn verification graph are collected through a client, the operation information of the user is counted according to the dimension of drawing the verification code strokes, the collected stroke data are preprocessed to obtain the maximum value and the minimum value of the operation running speed of drawing each stroke, the maximum value and the minimum value of the position change of a drawing track and the maximum value and the minimum value of the change amplitude of the operation speed of drawing each stroke. And inputting the single preprocessed data into a machine judging model, and judging that the operation information drawn by the user is a probability value of the machine behavior by the model. This probability value is between 0 and 1, and in the practice of the present model, a class label with a probability greater than 0.5 is initially set to 1, i.e., machine drawing, and a class label with a probability less than 0.5 is set to 0, i.e., human drawing. As the model is iteratively optimized, the class label with probability greater than 0.8 is set to 1, and the class label with probability less than 0.8 is set to 0.
The machine discrimination model is an evaluation model established according to the operation running speed, track jump and the variation amplitude dimension of the operation running speed of the collected strokes. In the early stage of model establishment, volunteers are organized, data sets depicting tracks are collected by simulating normal writing with codes, and the collected data are preprocessed, including denoising, smoothing and standardization processing, so as to reduce noise, improve data quality and complement necessary behavior data characteristics. A dataset is generated that includes, but is not limited to, the three dimensions above. The data set was partitioned, with 70% data as the training set, 10% data as the validation set, and 20% data as the test set. The three most relevant features of the operation running speed, the track jump and the change amplitude of the operation running speed are determined by using a feature selection algorithm (such as a correlation coefficient, mutual information and the like) to select the most relevant features so as to reduce redundant information and improve model performance.
And selecting a proper machine learning model, such as a support vector machine, a random forest or a neural network, according to the problem demand by considering the factors of complexity, training efficiency, generalization capability and the like of the model. In the model training process, the model parameters are iteratively updated according to the loss function and the optimization algorithm to minimize the prediction error.
The super parameters of the model, such as learning rate, regularization parameters, etc., are adjusted using methods such as cross-validation, etc., by defining a grid or parameter search space, combinations of different parameters are tried, e.g., one learning rate ranging from 0.001 to 0.1 is selected, and regularization parameters ranging from 0.0001 to 1. The training set is further divided into k subsets, with k-1 subsets as training subsets and the remaining subset as verification subset. A different subset will be used in each iteration as verification subset, the remaining k subsets being training sets. In this way k models are obtained, each model being trained and tested on a different data set. The best performing parameter combination is selected by continually trying different parameter combinations and evaluating the performance on the validation set.
After training, the test set is used for predicting and evaluating the trained model. This includes calculating an index of error or accuracy between the predicted result and the real tag, and further analyzing the performance of the model across different categories by confusion matrices. And comparing the performances of the different models, and selecting the model with the best performance. And determining an optimal model, then carrying out practice to obtain data in the practice process for a plurality of times, and substituting the data into the model again to carry out parameter optimization.
S404, judging whether all strokes are finished or not, and if so, executing S406;
s405, determining that the drawing graph is drawn by a machine and verification fails;
s406, obtaining the similarity between the verification graph and the drawing graph, and if the similarity is higher than a first preset similarity and lower than a second preset similarity, confirming that verification is passed.
If the first stroke is judged to be non-machine drawn, then the next stroke is judged, if the strokes are machine drawn, all the judgment is directly finished, the drawing graph is confirmed to be machine drawn, and verification fails. If the stroke is not detected as machine drawing, then judging the next stroke, and not confirming the machine drawing until all strokes are judged to be finished. At this time, similarity judgment is performed according to the drawing pattern and the verification pattern submitted by the client, if the similarity is higher than the first preset similarity, it is indicated that the drawing pattern and the verification pattern are too high in similarity, and the degree which cannot be achieved manually is judged to be machine drawing. If the similarity is lower than the second preset similarity, the fact that the similarity of the drawing graph and the verification graph is too low is indicated, the verification requirement is not met, and the verification fails.
The stroke behaviors of the user are sequentially analyzed through the machine judging model by acquiring the process operation behavior data of the drawing graph, whether the drawing is machine drawing or not is confirmed, and the user is finally submitted to draw the verification graph through combination of multiple analysis and verification, so that the operation difficulty and time cost of the user are reduced, and the safety and the verification efficiency are improved.
Fig. 5 is a schematic structural diagram of a graphic verification device according to an embodiment of the present application. As shown in fig. 5, the graphic verification apparatus 50 includes: a processing module 501 and an analysis module 502.
The processing module 501 is configured to receive a verification request sent by a client, and feed back a verification graphic to the client, so that a user depicts the verification graphic on a drawing board of the client;
the processing module 501 is further configured to obtain user operation information submitted by the client when the user draws the verification graphic and a drawing graphic that is drawn by the user;
and the analysis module 502 is configured to determine whether the drawing pattern is drawn by a machine according to the user operation information, and if not, determine whether the drawing pattern passes the verification according to the verification pattern and the drawing pattern.
In one possible design, the processing module 501 is further specifically configured to:
randomly acquiring a verification graph from a graph library, wherein the verification graph is a linear picture or a Chinese character, the number of strokes of the verification graph does not exceed a preset number, and the display information of each stroke of the verification graph is different;
and sending the verification graph to the client.
In one possible design, the processing module 501 is further specifically configured to:
acquiring the number N of strokes of the verification graph, and randomly selecting a first color and a second color, wherein the first color and the second color are different;
generating a gradient color gamut of two colors according to the first color and the second color, and performing N-1 equal division processing on the gradient color gamut to obtain N-2 equal division points, or performing N equal division processing on the gradient color gamut to obtain N-1 equal division points, wherein N is a positive integer;
if N-2 equal dividing points are obtained, each stroke color is given in sequence according to the first color, the color on each equal dividing point and the second color, and a verification graph with colors is obtained;
if N-1 equal dividing points are obtained, each stroke color is given in sequence according to the first color and the color on each equal dividing point, and a verification graph with colors is obtained. In one possible design, the processing module 501 is further specifically configured to:
randomly acquiring a verification graph and drawing board information corresponding to the verification graph from a graph library, wherein the drawing board information comprises selectable target colors for drawing the verification graph, and the target colors are different from the colors of the verification graph;
Transmitting the verification graphic to the client, comprising:
and sending the verification graph and the drawing board information to the client so that the client can display the color on the drawing board according to the drawing board information.
In one possible design, the processing module 501 is further specifically configured to:
at least one non-linear stroke exists in the linear picture, and at least one non-horizontal stroke and at least one non-vertical stroke exists in the Chinese character.
In one possible design, the analysis module 502 is further specifically configured to:
acquiring user operation behaviors of single strokes according to the user operation information, wherein the user operation behaviors of the single strokes comprise at least one of operation running speed, stroke jump or change amplitude of the operation running speed;
and judging whether the drawing graph is drawn by a machine according to the operation behaviors of the user of the single stroke.
In one possible design, the analysis module 502 is further specifically configured to:
inputting the user operation behaviors of the single strokes into a machine judging model, wherein the machine judging model is used for judging whether the drawing graph is drawn by a machine or not; wherein the machine discriminant model is a classification model;
Obtaining a classification result output by the machine discrimination model, and determining whether the drawing graph is drawn by a machine according to the classification result;
and if the non-machine drawing of the drawing graph is determined according to the single stroke, continuing to judge whether the drawing graph is machine drawing or not based on the user operation behavior of the next stroke until the drawing graph is determined to be machine drawing or all strokes are judged to be finished, and determining that the drawing graph is non-machine drawing.
In one possible design, the analysis module 502 is further specifically configured to:
obtaining the similarity between the verification graph and the drawing graph;
and if the similarity is higher than the first preset similarity and lower than the second preset similarity, confirming that the verification is passed.
In one possible design, a drawing board of the client is further provided with a cancel control, and the cancel control responds to the cancel operation of the user to cancel the last drawn stroke; the revocation control may be operated at least once.
In one possible design, the drawing pattern is a pattern drawn by a user after enlarging the verification pattern. Fig. 6 is a schematic hardware diagram of a graphics verification detection device according to an embodiment of the present application. As shown in fig. 6, the graphic verification detecting apparatus 60 provided in the present embodiment includes: at least one processor 601 and a memory 602. The device 60 further comprises a communication component 603. The processor 601, the memory 602, and the communication section 603 are connected via a bus 604.
In a specific implementation, at least one processor 601 executes computer-executable instructions stored in the memory 602, such that the at least one processor 601 performs the graphical verification method as described above.
The specific implementation process of the processor 601 may refer to the above-mentioned method embodiment, and its implementation principle and technical effects are similar, and this embodiment will not be described herein again.
In the embodiment shown in fig. 5, it should be understood that the processor may be a central processing unit (english: central Processing Unit, abbreviated as CPU), or may be other general purpose processors, digital signal processors (english: digital Signal Processor, abbreviated as DSP), application specific integrated circuits (english: application Specific Integrated Circuit, abbreviated as ASIC), or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in a processor for execution.
The memory may comprise high speed RAM memory or may further comprise non-volatile storage NVM, such as at least one disk memory.
The bus may be an industry standard architecture (Industry Standard Architecture, ISA) bus, an external device interconnect (Peripheral Component, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, the buses in the drawings of the present application are not limited to only one bus or one type of bus.
The present application also provides a computer-readable storage medium having stored therein computer-executable instructions that, when executed by a processor, implement the above graphical verification method.
The computer readable storage medium described above may be implemented by any type of volatile or non-volatile memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk. A readable storage medium can be any available medium that can be accessed by a general purpose or special purpose computer.
An exemplary readable storage medium is coupled to the processor such the processor can read information from, and write information to, the readable storage medium. In the alternative, the readable storage medium may be integral to the processor. The processor and the readable storage medium may reside in an application specific integrated circuit (Application Specific Integrated Circuits, ASIC for short). It is also possible that the processor and the readable storage medium reside as discrete components in the device 60.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all alternative embodiments, and that the acts and modules referred to are not necessarily required in the present application.
It should be further noted that, although the steps in the flowchart are sequentially shown as indicated by arrows, the steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least a portion of the steps in the flowcharts may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order in which the sub-steps or stages are performed is not necessarily sequential, and may be performed in turn or alternately with at least a portion of the sub-steps or stages of other steps or other steps.

Claims (13)

1. A method of graphical verification, comprising:
receiving a verification request sent by a client, and feeding back a verification graph to the client so that a user can draw the verification graph on a drawing board of the client;
acquiring user operation information of a user submitted by a client when the user draws the verification graph, and drawing the graph by the user;
judging whether the drawing graph is drawn by a machine according to the user operation information, and judging whether the drawing graph passes the verification according to the verification graph and the drawing graph if the drawing graph is not drawn by the machine.
2. The method of claim 1, wherein the feeding back a verification pattern to the client comprises:
randomly acquiring a verification graph from a graph library, wherein the verification graph is a linear picture or a Chinese character, the number of strokes of the verification graph does not exceed a preset number, and the display information of each stroke of the verification graph is different;
and sending the verification graph to the client.
3. The method of claim 2, wherein prior to randomly retrieving a verification pattern from a pattern library, the method further comprises:
Acquiring the number N of strokes of the verification graph, and randomly selecting a first color and a second color, wherein the first color and the second color are different;
generating a gradient color gamut of two colors according to the first color and the second color, and performing N-1 equal division processing on the gradient color gamut to obtain N-2 equal division points, or performing N equal division processing on the gradient color gamut to obtain N-1 equal division points, wherein N is a positive integer;
if N-2 equal dividing points are obtained, each stroke color is given in sequence according to the first color, the color on each equal dividing point and the second color, and a verification graph with colors is obtained;
if N-1 equal dividing points are obtained, each stroke color is given in sequence according to the first color and the color on each equal dividing point, and a verification graph with colors is obtained.
4. The method of claim 2, wherein randomly retrieving a verification pattern from a pattern library comprises:
randomly acquiring a verification graph and drawing board information corresponding to the verification graph from a graph library, wherein the drawing board information comprises selectable target colors for drawing the verification graph, and the target colors are different from the colors of the verification graph;
Transmitting the verification graphic to the client, comprising:
and sending the verification graph and the drawing board information to the client so that the client can display the color on the drawing board according to the drawing board information.
5. The method of claim 2, wherein at least one non-linear stroke is present in the linear drawing and at least one non-horizontal and non-vertical stroke is present in the chinese character.
6. The method of claim 1, wherein the determining whether the drawing figure is a machine drawing according to the user operation information comprises:
acquiring user operation behaviors of single strokes according to the user operation information, wherein the user operation behaviors of the single strokes comprise at least one of operation running speed, stroke jump or change amplitude of the operation running speed;
and judging whether the drawing graph is drawn by a machine according to the operation behaviors of the user of the single stroke.
7. The method of claim 6, wherein the determining whether the rendered graphic is machine rendered based on the user operation behavior of the single stroke comprises:
inputting the user operation behaviors of the single strokes into a machine judging model, wherein the machine judging model is used for judging whether the drawing graph is drawn by a machine or not; wherein the machine discriminant model is a classification model;
Obtaining a classification result output by the machine discrimination model, and determining whether the drawing graph is drawn by a machine according to the classification result;
and if the non-machine drawing of the drawing graph is determined according to the single stroke, continuing to judge whether the drawing graph is machine drawing or not based on the user operation behavior of the next stroke until the drawing graph is determined to be machine drawing or all strokes are judged to be finished, and determining that the drawing graph is non-machine drawing.
8. The method of claim 1, wherein said determining whether the verification passed based on the verification pattern and the drawing pattern comprises:
obtaining the similarity between the verification graph and the drawing graph;
and if the similarity is higher than the first preset similarity and lower than the second preset similarity, confirming that the verification is passed.
9. The method of claim 1, wherein a drawing board of the client is further provided with a cancel control, and the cancel control cancels a last drawn stroke in response to a cancel operation of a user; the revocation control may be operated at least once.
10. The method according to claim 1, wherein the drawing pattern is a pattern drawn by a user after enlarging the verification pattern.
11. A graphic verification apparatus, comprising:
the processing module is used for receiving the verification request sent by the client and feeding back the verification graph to the client so that a user can draw the verification graph on a drawing board of the client;
the processing module is also used for acquiring user operation information submitted by the client when the user draws the verification graph and drawing graph completed by the user;
and the analysis module is used for judging whether the drawing graph is drawn by a machine according to the user operation information, and judging whether the drawing graph passes the verification according to the verification graph and the drawing graph if the drawing graph is not drawn by the machine.
12. An electronic device, comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored in the memory to implement the method of any one of claims 1 to 10.
13. A computer readable storage medium having stored therein computer executable instructions which when executed by a processor are adapted to carry out the method of any one of claims 1 to 10.
CN202311695607.1A 2023-12-11 2023-12-11 Graph verification method, device, equipment and storage medium Pending CN117688543A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311695607.1A CN117688543A (en) 2023-12-11 2023-12-11 Graph verification method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311695607.1A CN117688543A (en) 2023-12-11 2023-12-11 Graph verification method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117688543A true CN117688543A (en) 2024-03-12

Family

ID=90131318

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311695607.1A Pending CN117688543A (en) 2023-12-11 2023-12-11 Graph verification method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117688543A (en)

Similar Documents

Publication Publication Date Title
US10769487B2 (en) Method and device for extracting information from pie chart
CN106293074B (en) Emotion recognition method and mobile terminal
US20180365557A1 (en) Information processing method and information processing apparatus
US7925062B2 (en) Image processing apparatus, image processing method, signature registration program, and storage medium
US20150161365A1 (en) Automatic construction of human interaction proof engines
US10169853B2 (en) Score weights for user interface (UI) elements
KR20180064371A (en) System and method for recognizing multiple object inputs
US11449706B2 (en) Information processing method and information processing system
US20230161570A1 (en) Learning user interface controls via incremental data synthesis
CN109523611A (en) Identifying code Picture Generation Method and device
Conti et al. CAPTCHaStar! A novel CAPTCHA based on interactive shape discovery
CN106778151A (en) Method for identifying ID and device based on person's handwriting
CN110138800A (en) Interface alternation and its verification method, log on request generation and verification method and device
WO2023055426A1 (en) Techniques for input classification and responses using generative neural networks
CN108400980B (en) User identity authentication method and device, computer equipment and storage medium
JP6821751B2 (en) Methods, systems, and computer programs for correcting mistyping of virtual keyboards
CN117688543A (en) Graph verification method, device, equipment and storage medium
US20220280086A1 (en) Management server, method of generating relative pattern information between pieces of imitation drawing data, and computer program
CN113190310B (en) Verification code design method based on random position object semantic recognition
US11282267B2 (en) System and method for providing automated data visualization and modification
US20120023549A1 (en) CAPTCHA AND reCAPTCHA WITH SINOGRAPHS
CN107085849B (en) Image binarization processing method, device, equipment and storage medium
CN110598392A (en) Man-machine verification method and device, storage medium and electronic equipment
Wang et al. Missing standard features compared with similar apps? A feature recommendation method based on the knowledge from user interface
JP2013254468A (en) Inversion tuning test method and access authentication method

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