Human verification method, apparatus, electronic device, storage medium and computer program product
By randomly generating the starting point and path point in the human-computer verification image area, the complex Bezier curve is generated using the de Casteljau algorithm to dynamically generate dynamic images for human-computer verification, the problem of low recognition rate in the existing technology is solved, and the recognition accuracy and user experience are improved.
Patent Information
- Application Number
- PCT/CN2024/131368
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-02-20
- Filing Date
- 2024-11-11
- Publication Date
- 2025-08-28
AI Technical Summary
The existing human-machine verification methods have low recognition rates, and traditional verification codes are easily cracked by machines, and have poor user experience.
By randomly generating multiple starting points in the human-computer verification image area, determining the path point of the motion trajectory based on the starting point, generating dynamic images, and performing human-computer verification in response to the user's click event, using the de Casteljau algorithm to calculate the Bezier curve to generate complex trajectories, increasing the difficulty of cracking.
It improves the recognition rate of human-computer verification, enhances the defense capabilities of automation tools, and improves the user experience.
Smart Images

Figure CN2024131368_28082025_PF_FP_ABST
Abstract
Description
Human-machine verification method, device, electronic device, storage medium and computer program product
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application is based on the Chinese patent application with application number 202410189603.4 and application date of February 20, 2024, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is hereby introduced into this application as a reference. Technical Field
[0003] The present application relates to the field of computer technology, and more particularly to a human-machine verification method, device, electronic device, storage medium, and computer program product. Background Art
[0004] The rapid development of technologies such as computer science, artificial intelligence, and machine learning has also brought about an increasing number of network security issues. A major challenge is defending against illegal requests from automated tools and robots. To address this issue, human-machine recognition technology has emerged. Human-machine recognition technology uses computer programs to identify the differences between humans and machines, thereby preventing illegal requests from automated tools and robots. Human-machine recognition technology stems from network security issues. Its development aims to protect the security of network systems and user privacy, providing users with more convenient and secure network services.
[0005] Traditional human-machine verification methods include image verification codes, sliding verification codes, and SMS voice verification codes. Image verification codes increase the difficulty of cracking by increasing the recognition difficulty. However, deep learning-based algorithms can surpass normal human image recognition performance, rendering traditional verification codes ineffective in distinguishing human from machine. Sliding verification codes are limited by user operation and cannot generate overly complex motion trajectories, which would disrupt the user experience. They are also easily cracked by machines that simulate sliding trajectories. SMS voice verification codes require plain text transmission and have relatively simple and fixed content, making them easily intercepted and captured by hackers, leading to cracking. Therefore, the low recognition rate of human-machine verification has become a pressing issue that needs to be addressed.
[0006] Summary of the Invention
[0007] The embodiments of the present application provide a human-machine verification method, device, electronic device, storage medium and computer program product to solve the problem of low recognition rate of human-machine verification in the prior art.
[0008] This embodiment of the present application provides a human-machine verification method, including:
[0009] Determine multiple starting points in the human-machine verification image area; wherein any of the starting points corresponds to a motion trajectory;
[0010] Based on the starting point, determining a path point of each of the motion trajectories; wherein any of the motion trajectories includes a plurality of path points;
[0011] generating a plurality of dynamic images of the motion trajectories based on the plurality of path points;
[0012] The dynamic image responds to a click event of the user, and human-machine verification is performed based on the click event; wherein the click event represents the user's selection of the motion trajectory.
[0013] In one embodiment, determining multiple starting points in the human-machine verification image area includes:
[0014] Randomly select a point from the human-machine verification image area as an initial starting point, and add the initial starting point to the sampling point set;
[0015] Randomly selecting a first target point from the set of sampling points, and generating a target area with the first target point as the center and a first set distance as the radius;
[0016] Determine at least one candidate point from the target area, and determine the distance between the candidate point and each sampling point in the sampling point set;
[0017] If the distance is greater than a second set distance, adding the candidate point to the sampling point set;
[0018] If the number of the sampling points in the sampling point set is greater than or equal to a set number, the sampling points in the sampling point set are used as the starting points.
[0019] In one embodiment, determining the path point of each of the motion trajectories based on the starting point includes:
[0020] Selecting any of the starting points as a first target starting point of a following trajectory, and selecting any of the starting points as a second target starting point; wherein the following trajectory is a motion trajectory corresponding to the first target starting point;
[0021] Randomly select a second target point from the perpendicular median of a first line segment; wherein the first line segment is a connecting line segment between the first target starting point and the second target starting point;
[0022] The vertex of the perpendicular line of the second line segment is used as a control point; wherein the second line segment is a connecting line segment of the first target starting point and the second target point; and the length of the perpendicular line is greater than the set length;
[0023] Based on the control points, a path point of each of the motion trajectories is determined.
[0024] In one embodiment, generating dynamic images of all the motion trajectories based on the path points includes:
[0025] Controlling the motion trajectory to move between the path points and confusing the following trajectory with all other motion trajectories; wherein the other motion trajectories are motion trajectories other than the following trajectory; all the motion trajectories have the same number of path points, and all the motion trajectories have the same time interval between the path points;
[0026] After the confusion is completed, each motion track is controlled to move to the end point, stop and disappear, and generate the dynamic image.
[0027] In one embodiment, confusing the following trajectory with all other motion trajectories comprises:
[0028] The following trajectory and each of the other motion trajectories are controlled to move to the second target point, thereby completing the confusion between the following trajectory and all other motion trajectories.
[0029] In one embodiment, determining the path point of each of the motion trajectories based on the control points includes:
[0030] Determining the number of recursive operations on the path points based on the number of control points;
[0031] Based on the number of the control points, the number of recursions and preset parameters, the path points of each of the motion trajectories are determined.
[0032] In one embodiment, responding to a user's click event based on the dynamic image and performing human-machine verification based on the click event includes:
[0033] Displaying the dynamic image and detecting a click event based on the dynamic image;
[0034] If the click event is a click-following track, it is determined that the user performs a click operation;
[0035] If the click event is not a click on the follow track, it is determined that the machine performs a click operation.
[0036] The present invention provides a human-machine verification device, including:
[0037] A starting point determination module is configured to determine a plurality of starting points in the human-machine verification image area; wherein any of the starting points corresponds to a motion trajectory;
[0038] a path point determination module, configured to determine a path point of each of the motion trajectories based on the starting point; wherein any of the motion trajectories includes a plurality of path points;
[0039] A dynamic image generation module is configured to generate a plurality of dynamic images of the motion trajectories based on the plurality of path points;
[0040] The human-machine verification module is configured to respond to a user's click event based on the dynamic image and perform human-machine verification based on the click event; wherein the click event represents the user's selection of the motion trajectory.
[0041] An embodiment of the present application provides an electronic device, including a processor and a memory storing a computer program, wherein when the processor executes the program, the steps of the human-machine verification method described in the first aspect are implemented.
[0042] An embodiment of the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the human-machine verification method described in the first aspect are implemented.
[0043] An embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the human-machine verification method described in the first aspect.
[0044] The human-machine verification method, apparatus, electronic device, storage medium, and computer program product provided in the embodiments of the present application determine multiple starting points in a human-machine verification image area; each starting point corresponds to a motion trajectory; based on the starting points, path points of each motion trajectory are determined; each motion trajectory includes multiple path points; based on the multiple path points, dynamic images of multiple motion trajectories are generated; the dynamic images respond to user click events, and human-machine verification is performed based on the click events; the click events represent the user's selection of the motion trajectory. By randomly generating multiple motion trajectories to determine whether the operator is a human or a machine, the present application improves the recognition rate of human-machine verification. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the present application or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0046] FIG1 is a flow chart of a human-machine verification method according to an embodiment of the present application;
[0047] FIG2 is a schematic diagram of the starting points of various motion trajectories provided in an embodiment of the present application;
[0048] FIG3 is a schematic diagram of a motion trajectory provided by an embodiment of the present application;
[0049] FIG4 is a schematic diagram of motion trajectory confusion provided by an embodiment of the present application;
[0050] FIG5 is a flow chart of a human-machine verification method according to an embodiment of the present application;
[0051] FIG6 is a schematic diagram of the structure of a human-machine verification device provided in an embodiment of the present application;
[0052] FIG7 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] To make the objectives, technical solutions, and advantages of this application more clear, the technical solutions in this application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this application.
[0054] FIG1 is a flow chart of a human-machine verification method provided by an embodiment of the present application. Referring to FIG1 , an embodiment of the present application provides a human-machine verification method, which may include:
[0055] Step 100: Determine multiple starting points in the human-machine verification image area.
[0056] The embodiment of the present application is based on the form of a picture verification code, dynamically drawing multiple complex motion trajectories in the human-machine verification image area, and all motion trajectories have the same morphological characteristics. Among them, the motion trajectory can be understood as a path, and each motion trajectory corresponds to a starting point. Therefore, the starting point of the motion trajectory needs to be determined in advance.
[0057] In the human-machine verification image area, multiple starting points are determined. For example, referring to Figure 2, multiple starting points are randomly generated in the human-machine verification image area. The starting points need to be evenly distributed in the human-machine verification image area, and no two starting points are repeated. The starting points exist in the form of coordinates, so the starting point can be understood as the starting coordinate point. All motion trajectories have a common identification header and a common tail section, which is used to actually move on the image and help users determine the actual direction of movement. The motion trajectory is shown in Figure 3.
[0058] Step 200: Determine the path points of each of the motion trajectories based on the starting point.
[0059] Any motion trajectory consists of multiple path points. A path point can be understood as an intermediate coordinate point, representing each position point along the trajectory. During human-machine verification, each motion trajectory passes through a series of path points, which determine the trajectory's shape and path.
[0060] After determining the starting point of each motion trajectory, the path points of each motion trajectory are determined based on the starting point. For example, the de Casteljau algorithm is used, which calculates the intermediate coordinate points on the Bezier curve based on the control points and the parameter t, i.e., the path points. Exemplarily, the control points are determined based on the starting point, and the control points are recursively interpolated to calculate the intermediate coordinate points on the curve. Each recursion divides the control points according to a certain ratio and calculates new intermediate coordinate points. This process is repeated multiple times until a preset accuracy or number of calculations is reached.
[0061] Step 300: Generate a plurality of dynamic images of the motion trajectories based on the plurality of path points.
[0062] After determining the path points of each motion trajectory, the motion trajectory is controlled to move between the path points, and the entire motion trajectory movement process is generated into a Graphics Interchange Format (GIF) picture or video animation. Among them, the GIF picture will contain multiple frames of images, each frame of image describes the state of the motion trajectory at a certain moment in the movement process. When these frame images are played continuously at a certain speed, an animation is formed, showing the entire trajectory movement process. Video animation refers to an animation effect presented in the form of a video. The video contains the complete trajectory movement process, and the movement process of the trajectory from the starting point to the final position is displayed in a continuous picture.
[0063] Step 400: respond to a click event of the user based on the dynamic image, and perform human-machine verification based on the click event.
[0064] After generating a dynamic image, the dynamic image is displayed and a click event based on the dynamic image is detected, wherein the click event represents the user's selection of a motion trajectory; if the click event is a click-following trajectory, it is determined that the user performed a click operation; if the click event is a non-click-following trajectory, it is determined that the machine performed a click operation.
[0065] For example, the client (or front-end) displays the movement process of each motion track. When the GIF image or video animation is played, all motion tracks stop and disappear. A click button is generated at the position where each motion track disappears, and the user needs to click the button to select the disappearing position. The client uploads the user's selection results to the server (or back-end server), and finally determines whether it is a natural person or a machine based on the selection results. If the position of the button clicked by the user is consistent with the disappearance position of the follow-up track recorded by the server, it is judged as a natural person, which means that the user successfully observed and clicked the position that matches the movement of the track, indicating that the user's selection of the motion track is based on visual observation. If the position of the button clicked by the user is inconsistent with the disappearance position of the follow-up track recorded by the server, it is judged as a machine, which means that the user did not accurately observe and follow the motion track, or performed the click operation through other means instead of based on visual observation of the motion track.
[0066] The human-machine verification method provided in an embodiment of the present application determines multiple starting points within a human-machine verification image area; each starting point corresponds to a motion trajectory; based on the starting points, path points for each motion trajectory are determined; each motion trajectory includes multiple path points; based on the path points, dynamic images of all motion trajectories are generated; user click events are obtained based on the dynamic images, and human-machine verification is performed based on the click events; the click events represent the user's selection of the motion trajectory. By randomly generating multiple motion trajectories to determine whether the operator is a human or a machine, the present application improves the recognition rate of human-machine verification.
[0067] Based on the above embodiment, determining multiple starting points in the human-machine verification image area includes:
[0068] Step 111: randomly select a point from the human-machine verification image area as an initial starting point, and add the initial starting point to a sampling point set;
[0069] Step 112: randomly selecting a first target point from the set of sampling points, and generating a target area with the first target point as the center and a first set distance as the radius;
[0070] Step 113, determining at least one candidate point from the target area, and determining the distance between the candidate point and each sampling point in the sampling point set;
[0071] Step 114: if the distance is greater than a second set distance, adding the candidate point to the sampling point set;
[0072] Step 115: If the number of the sampling points in the sampling point set is greater than or equal to a set number, the sampling point in the sampling point set is used as the starting point.
[0073] The server randomly generates multiple starting points on the human-machine verification image area. The starting points need to be evenly distributed in the human-machine verification image area, and no two starting points are repeated. Therefore, the following method can be used to randomly generate multiple starting points:
[0074] Step 1: Divide the human-machine verification image area into several small areas, where each small area has at most one sampling point, namely the starting point.
[0075] Step 2: Randomly select a point in each small area as the starting point (i.e., the initial starting point), add it to the sampling point set, and mark the area around it as occupied.
[0076] Step 3: Randomly select a point (i.e., the first target point) from the set of sampling points. Generate a target area with the first target point as the center and the first set distance as the radius. Generate a candidate point within the target area and check whether the candidate point meets the minimum distance requirement (i.e., the second set distance) with each sampling point in the set of sampling points. The minimum distance is set to ensure that the generated starting points are separated from each other and avoid being too close or overlapping. By limiting the minimum distance, the starting points can be evenly distributed across the human-machine verification image area, improving the reliability and accuracy of verification. If the distance between the candidate point and other sampling points is greater than the minimum distance, it is considered to meet the requirements and the candidate point can be added to the set of sampling points. If the distance between the candidate point and other sampling points is less than or equal to the minimum distance, it is considered to not meet the requirements and a new candidate point needs to be generated to ensure that the final generated starting point meets the requirements. This processing method ensures that the generated starting points are evenly distributed across the entire human-machine verification image area, improving the difficulty and security of verification.
[0077] Step 4: Repeat the candidate point generation process until the sampling point set reaches the preset size, that is, the number of sampling points in the sampling point set is greater than or equal to the set data. Then, the sampling points in the sampling point set are used as the starting points of each small area.
[0078] The embodiment of the present application increases the difficulty and diversity of verification by randomly generating multiple starting coordinate points and ensuring that they do not overlap, making it difficult for automated programs to guess or simulate the verification process, thereby improving the security of verification.
[0079] Based on the above embodiment, determining the path point of each motion trajectory based on the starting point includes:
[0080] Step 211: selecting any of the starting points as a first target starting point of a following trajectory, and selecting any of the starting points as a second target starting point; wherein the following trajectory is a motion trajectory corresponding to the first target starting point;
[0081] Step 212: randomly select a second target point from the perpendicular median of the first line segment; wherein the first line segment is a line segment connecting the first target starting point and the second target starting point;
[0082] Step 213: Use the vertex of the perpendicular line of the second line segment as a control point; wherein the second line segment is a line segment connecting the first target starting point and the second target point; and the length of the perpendicular line is greater than a set length;
[0083] Step 214: Determine the path points of each of the motion trajectories based on the control points.
[0084] The server calculates the coordinates of each path point along each motion trajectory. Since the trajectory follows a smooth curved path, the trajectory uses a Bezier curve to generate a complex smooth curve, making it more difficult to crack the human-machine authentication.
[0085] The present embodiment uses the de Casteljau algorithm, which has high accuracy and fast calculation speed, to calculate the Bezier curve. The curve generated by this method requires a set of control points and a parameter t. The control points determine the general shape of the curve, while the parameter t controls the number of intermediate points generated by the curve. Exemplarily, the following steps are included:
[0086] After all starting points are generated, each starting point is displayed as a circle in the human-machine verification image area, and one of the starting points is highlighted to indicate that the coordinate point is the starting point of the motion trajectory to be tracked, that is, the starting point of the tracking trajectory G1 (that is, the first target starting point). The coordinate point generation is shown in Figure 2.
[0087] The starting point of each trajectory is selected as the starting control point of the Bezier curve. The first target starting point S1 = (x1, y1) is chosen for trajectory G1, and the second target starting point S2 = (x2, y2) is randomly selected for trajectory G2, forming a first line segment S1S2. Using the perpendicular bisector formula, the perpendicular bisector C1 of the first line segment S1S2 is obtained. A point S3 = (x3, y3) (the second target point) is randomly selected on perpendicular bisector G1 as the endpoint of the next movement of trajectories G1 and G2. To make the trajectory smoother and more natural and improve the user experience, S1S3 is combined into a second line segment. A perpendicular line H1 is constructed with a length greater than a fixed length h, with the base of H1 at S1S3. Its vertex T is used as the control point, resulting in three control points: S1, S2, and T. Simultaneously, for each trajectory, a point at a distance from its starting point equal to the length of the second line segment S1S3 is randomly selected as the endpoint of this movement. The third control point is obtained using the same method. After the control points are determined, the number of recursive operations of the path points is determined based on the number of control points, and then the path points of each motion trajectory are determined based on the number of control points, the number of recursive operations and preset parameters.
[0088] For example, to calculate the intermediate coordinate points (i.e., path points) of each motion trajectory, the de Casteljau algorithm is used, and the calculation formula is as follows:
[0089] The calculation of the path point is a recursive formula, where k represents the kth recursion, n represents the number of control points, i represents the i-th control point, k=0 is the initial control point, and t ranges from 0 to 1. represents the path point obtained by the i-th control point after the k-th recursion, represents the path point obtained by the i-th control point after the k-1-th recursion, Indicates the path point obtained after the k-1th recursion of the i+1th control point. Each time the path point is calculated, the value of t is fixed, t increases evenly, and the step size of each increase is d, then a total of waypoints.
[0090] The present embodiment utilizes the de Casteljau algorithm to dynamically generate multiple complex moving trajectories. This algorithm can balance curve accuracy and computational complexity based on actual conditions, is highly flexible, and the resulting curves are smooth. Furthermore, by using complex Bezier curve paths and randomly generated control points, the difficulty of cracking the verification process can be increased.
[0091] Based on the above embodiment, generating dynamic images of all the motion trajectories based on the path points includes:
[0092] Step 311: Control the motion trajectory to move between the path points, and confuse the following trajectory with all other motion trajectories; wherein the other motion trajectories are motion trajectories other than the following trajectory; all the motion trajectories have the same number of path points, and all the motion trajectories have the same time interval between the path points;
[0093] Step 312: After the obfuscation is completed, each motion track is controlled to move to an end point, stop, and disappear, thereby generating the dynamic image.
[0094] After the server calculates the path points for all trajectories, all trajectories begin to move. After all path points have been calculated, and all trajectories have the same number of path points, to ensure that all trajectories move for the same amount of time, the intervals between path points are also the same. The following trajectory and each of the other trajectories are controlled to move to the second target point, thereby completing the confusion between the following trajectory and all other trajectories.
[0095] For example, after the same movement time, G1 and G2 reach the perpendicular bisector coordinate point S3 = (x3, y3), completing a confusion. The other trajectories also stop moving at the same time. The movement state during confusion is shown in Figure 4. After the confusion is completed, another trajectory other than G2 is selected as the new G2. The above steps are repeated multiple times until the trajectory has been confused with all other trajectories once. G1 has been confused with all other trajectories once, and the end point of each trajectory is determined. All trajectories move one final time, and finally all trajectories stop and disappear. The server records the disappearance position and generates a dynamic image of the trajectory movement of the entire process, such as a GIF image or video animation.
[0096] The embodiment of the present application utilizes trajectory obfuscation to design a set of trajectory obfuscation methods, making the trajectory movement process more complex, further increasing the difficulty of AI recognition, and effectively preventing automated programs from identifying and cracking the verification process, thereby improving the reliability of verification.
[0097] In order to further analyze and illustrate the human-machine verification method proposed in this application, refer to Figure 5 and the following examples.
[0098] The present application proposes a human-machine verification method based on multi-path obfuscation. Using a terminal device, multiple complex motion trajectories are dynamically drawn in the human-machine verification image area in the form of an image verification code. All motion trajectories have the same morphological characteristics. Before the trajectory moves, the user is prompted with a tracking trajectory, and the user needs to continuously observe the movement of the tracking trajectory. During the movement of the trajectory, each motion trajectory is fully obfuscated, further increasing the difficulty of cracking the human-machine verification. Finally, the user needs to click a button to select the coordinate point where the trajectory stops to complete the human-machine verification.
[0099] The human-machine verification process of the embodiment of the present application mainly includes four parts: generating the starting point of the motion trajectory, dynamically generating the path points of the motion trajectory, trajectory movement, and human-machine recognition result processing. Among them, the generation of the starting point, the calculation of the path points of each motion trajectory, and the human-machine recognition result processing are all processed on the server side (or back-end server), and the client side (or front-end) is used to display the trajectory movement and submit the user's selection results. Among them, the analysis of each part is as follows:
[0100] (1) Generating the starting points of the motion trajectory: The server randomly generates multiple starting points in the human-machine verification image area. The starting points need to be evenly distributed in the human-machine verification image area, and no two starting points are repeated. Therefore, the following method can be used to randomly generate multiple starting points.
[0101] 1.1) Divide the human-machine verification image area into several small areas, where each small area has at most one sampling point, namely the starting point.
[0102] 1.2) Randomly select a point in each small area as the starting point (i.e., the initial starting point), add it to the sampling point set, and mark the area around it as occupied.
[0103] 1.3) A point is randomly selected from the sampling point set. A candidate point is generated within a certain radius with this point as the center. The candidate point is then checked to see if it meets the minimum distance requirement with each sampling point in the sampling point set. That is, the distance between the candidate point and each sampling point is calculated. If all distances are greater than the set minimum distance, the minimum distance requirement is met and the candidate point is added to the sampling point set. If any distance is less than or equal to the set minimum distance, the minimum distance requirement is not met and a new candidate point is generated.
[0104] 1.4) Repeat the candidate point generation process until the sampling point set reaches the preset size, that is, the number of sampling points in the sampling point set is greater than or equal to the set data. Then, the sampling points in the sampling point set are used as the starting points in each small area. After all the starting points are generated, each starting point is displayed as a circle in the human-machine verification image area, and one of the starting points is highlighted to indicate that the coordinate point is the starting point of the motion trajectory to be tracked, that is, the starting point of the tracking trajectory G1. The coordinate point generation is shown in Figure 2. All motion trajectories have the same identification head and the same tail, which are used to actually move on the image and help users judge the actual direction of movement. The motion trajectory is shown in Figure 3.
[0105] (2) Dynamically generate path points for motion trajectories: The server calculates the coordinates of the path points along each motion trajectory. The trajectory moves along a smooth curved path, so the motion trajectory uses a Bezier curve to calculate and generate a relatively complex smooth curve to increase the difficulty of cracking the human-machine verification.
[0106] This embodiment of the application uses the highly accurate and fast de Casteljau algorithm to calculate a Bezier curve. The curve generated by this method requires a set of control points and a parameter t. The control points determine the general shape of the curve, while the parameter t controls the number of intermediate points generated by the curve. The following steps are included:
[0107] First, we need to determine the control points for each trajectory. The starting point of each trajectory is selected as the starting control point of the Bezier curve. For trajectory G1, we select the starting point S1 = (x1, y1). We also randomly select the starting point S2 = (x2, y2) for another trajectory G2, forming a line segment S1S2. Using the perpendicular bisector formula, we can determine the perpendicular bisector C1 of segment S1S2. We then randomly select a point S3 = (x3, y3) on perpendicular bisector G1 as the endpoint for the next movement of trajectories G1 and G2. To achieve a smoother and more natural trajectory and improve the user experience, we combine S1S3 into a line segment. We then construct a perpendicular line H1 with a length greater than a fixed length h. The base of H1 is S1S3, and its vertex T is used as the control point. This results in three control points: S1, S2, and T. Simultaneously, for each trajectory, we randomly select a point S1S3 from its starting point as the endpoint for this movement. The third control point is determined using the same method. After determining the control points, calculate the intermediate coordinate points (i.e., path points) of each motion trajectory using the de Casteljau algorithm. The calculation formula is as follows:
[0108] The calculation of the path point is a recursive formula, where k represents the kth recursion, n represents the number of control points, i represents the i-th control point, k=0 is the initial control point, and t ranges from 0 to 1. represents the path point obtained by the i-th control point after the k-th recursion, represents the path point obtained by the i-th control point after the k-1-th recursion, Indicates the path point obtained after the k-1th recursion of the i+1th control point. Each time the path point is calculated, the value of t is fixed, t increases evenly, and the step size of each increase is d, then a total of waypoints.
[0109] (3) Trajectory movement and confusion: After the server calculates the path points of all motion trajectories, all trajectories begin to move. In step (2), the path points of all motion trajectories have been calculated, and the number of path points of all trajectories is the same. In order to allow all motion trajectories to move for the same time, the interval time between the path points of all motion trajectories is also the same. After the same movement time, G1 and G2 reach the perpendicular coordinate point S3 = (x3, y3) to complete one confusion. The other motion trajectories also stop moving at the same time. The movement state during confusion is shown in Figure 4. After the confusion is completed, another trajectory other than G2 is selected as the new G2, and steps (2) and (3) are repeated multiple times until the motion trajectory has been confused with all other motion trajectories once.
[0110] (4) After repeating (2) and (3) for several times, G1 has been confused with all other motion trajectories once. The end point of each motion trajectory is determined, and all motion trajectories move one last time. Finally, all motion trajectories stop and disappear. The server records the disappearance position. The server generates a GIF image or video animation of the trajectory movement of the entire process and sends it to the client. The client displays the movement process of each motion trajectory. After the animation is played, all motion trajectories stop and disappear. A click button is generated at the position where the motion trajectory disappears. The user needs to click the button to select the disappearance position. The client uploads the user's selection result to the server, and finally determines whether it is a natural person or a machine based on the selection result. If the button position clicked by the user is consistent with the disappearance position of the follow-up trajectory recorded by the server, it is judged to be a natural person, otherwise it is judged to be a machine.
[0111] The embodiment of the present application provides a human-machine verification method based on multi-path confusion, which combines the advantages of picture verification codes and sliding verification codes. It has the advantage of the sliding verification code generating complex trajectories to increase the difficulty of cracking human-machine verification, and the advantage of the picture verification code being easy to operate and improving user experience. At the same time, by using the de Casteljau algorithm to dynamically generate multiple complex moving trajectories, the algorithm can balance the curve accuracy and calculation complexity according to actual conditions, has strong flexibility, and the calculated curve is smooth. By utilizing trajectory confusion, a set of trajectory confusion methods is designed to make the movement process of the trajectory more complicated, further increasing the difficulty of AI recognition. By randomly generating starting coordinate points, it can be ensured that the starting coordinate points of the trajectory do not overlap and are evenly distributed in the human-machine verification picture area, thereby improving user experience.
[0112] The human-machine verification device provided in an embodiment of the present application is described below. The human-machine verification device described below and the human-machine verification method described above can be referenced to each other.
[0113] 6 , which is a schematic structural diagram of a human-machine verification device according to an embodiment of the present application, includes a starting point determination module 601 , a path point determination module 602 , a dynamic image generation module 603 , and a human-machine verification module 604 .
[0114] The starting point determination module 601 is configured to determine a plurality of starting points in the human-machine verification image area; wherein any of the starting points corresponds to a motion trajectory;
[0115] A path point determination module 602 is configured to determine a path point of each of the motion trajectories based on the starting point; wherein each of the motion trajectories includes a plurality of path points;
[0116] A dynamic image generation module 603 is configured to generate a plurality of dynamic images of the motion trajectories based on the plurality of path points;
[0117] The human-machine verification module 604 is configured to respond to a click event of the user based on the dynamic image and perform human-machine verification based on the click event; wherein the click event represents the user's selection of the motion trajectory.
[0118] The human-machine verification device provided in an embodiment of the present application determines multiple starting points in a human-machine verification image area; each starting point corresponds to a motion trajectory; based on the starting points, path points of each motion trajectory are determined; each motion trajectory includes multiple path points; based on the path points, dynamic images of all motion trajectories are generated; user click events are obtained based on the dynamic images, and human-machine verification is performed based on the click events; the click events represent the user's selection of the motion trajectory. By randomly generating multiple motion trajectories to determine whether the operator is a human or a machine, the present application improves the recognition rate of human-machine verification.
[0119] In one embodiment, the starting point determination module 601 is further configured to:
[0120] Randomly select a point from the human-machine verification image area as an initial starting point, and add the initial starting point to the sampling point set;
[0121] Randomly selecting a first target point from the set of sampling points, and generating a target area with the first target point as the center and a first set distance as the radius;
[0122] Determine at least one candidate point from the target area, and determine the distance between the candidate point and each sampling point in the sampling point set;
[0123] If the distance is greater than a second set distance, adding the candidate point to the sampling point set;
[0124] If the number of the sampling points in the sampling point set is greater than or equal to a set number, the sampling points in the sampling point set are used as the starting points.
[0125] In one embodiment, the waypoint determination module 602 is further configured to:
[0126] Selecting any of the starting points as a first target starting point of a following trajectory, and selecting any of the starting points as a second target starting point; wherein the following trajectory is a motion trajectory corresponding to the first target starting point;
[0127] Randomly select a second target point from the perpendicular median of a first line segment; wherein the first line segment is a connecting line segment between the first target starting point and the second target starting point;
[0128] The vertex of the perpendicular line of the second line segment is used as a control point; wherein the second line segment is a connecting line segment of the first target starting point and the second target point; and the length of the perpendicular line is greater than the set length;
[0129] Based on the control points, a path point of each of the motion trajectories is determined.
[0130] In one embodiment, the dynamic image generation module 603 is further configured to:
[0131] Controlling the motion trajectory to move between the path points and confusing the following trajectory with all other motion trajectories; wherein the other motion trajectories are motion trajectories other than the following trajectory; all the motion trajectories have the same number of path points, and all the motion trajectories have the same time interval between the path points;
[0132] After the confusion is completed, each motion track is controlled to move to the end point, stop and disappear, and generate the dynamic image.
[0133] In one embodiment, the dynamic image generation module 603 is further configured to:
[0134] The following trajectory and each of the other motion trajectories are controlled to move to the second target point, thereby completing the confusion between the following trajectory and all other motion trajectories.
[0135] In one embodiment, the waypoint determination module 602 is further configured to:
[0136] Determining the number of recursive operations on the path points based on the number of control points;
[0137] Based on the number of the control points, the number of recursions and preset parameters, the path points of each of the motion trajectories are determined.
[0138] In one embodiment, the human-machine verification module 604 is further configured to:
[0139] Displaying the dynamic image and detecting a click event based on the dynamic image;
[0140] If the click event is a click-following track, it is determined that the user performs a click operation;
[0141] If the click event is not a click on the follow track, it is determined that the machine performs a click operation.
[0142] FIG7 illustrates a schematic diagram of the physical structure of an electronic device. As shown in FIG7 , the electronic device may include: a processor 710, a communication interface 720, a memory 730, and a communication bus 740. The processor 710, the communication interface 720, and the memory 730 communicate with each other via the communication bus 740. The processor 710 may call a computer program in the memory 730 to execute the steps of the human-machine verification method, for example, including:
[0143] Determine multiple starting points in the human-machine verification image area; wherein any of the starting points corresponds to a motion trajectory;
[0144] Based on the starting point, determining a path point of each of the motion trajectories; wherein any of the motion trajectories includes a plurality of path points;
[0145] generating a plurality of dynamic images of the motion trajectories based on the plurality of path points;
[0146] The dynamic image responds to a click event of the user, and human-machine verification is performed based on the click event; wherein the click event represents the user's selection of the motion trajectory.
[0147] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0148] On the other hand, embodiments of the present application further provide a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the human-machine verification method provided in each of the above embodiments are implemented, for example, including:
[0149] Determine multiple starting points in the human-machine verification image area; any of the starting points corresponds to a motion trajectory;
[0150] Based on the starting point, determining a path point of each of the motion trajectories; any of the motion trajectories includes a plurality of path points;
[0151] generating dynamic images of all the motion trajectories based on the path points;
[0152] A click event of the user is acquired based on the dynamic image, and human-machine verification is performed based on the click event; the click event represents the user's selection of the motion trajectory.
[0153] On the other hand, embodiments of the present application further provide a computer program product, comprising a computer program. The computer program may be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can perform the steps of the human-machine authentication method provided in each of the above embodiments, for example, including:
[0154] Determine multiple starting points in the human-machine verification image area; wherein any of the starting points corresponds to a motion trajectory;
[0155] Based on the starting point, determining a path point of each of the motion trajectories; wherein any of the motion trajectories includes a plurality of path points;
[0156] generating dynamic images of all the motion trajectories based on the path points;
[0157] A click event of the user is acquired based on the dynamic image, and human-machine verification is performed based on the click event; wherein the click event represents the user's selection of the motion trajectory.
[0158] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0159] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.
[0160] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A human-machine verification method, comprising: Determine multiple starting points in the human-machine verification image area; wherein any of the starting points corresponds to a motion trajectory; Based on the starting point, determining a path point of each of the motion trajectories; wherein any of the motion trajectories includes a plurality of path points; generating a plurality of dynamic images of the motion trajectories based on the plurality of path points; The dynamic image responds to a click event of the user, and human-machine verification is performed based on the click event; wherein the click event represents the user's selection of the motion trajectory.
2. The human-machine verification method according to claim 1, wherein: Determining multiple starting points in the human-machine verification image area includes: Randomly select a point from the human-machine verification image area as an initial starting point, and add the initial starting point to the sampling point set; Randomly selecting a first target point from the set of sampling points, and generating a target area with the first target point as the center and a first set distance as the radius; Determine at least one candidate point from the target area, and determine the distance between the candidate point and each sampling point in the sampling point set; If the distance is greater than a second set distance, adding the candidate point to the sampling point set; If the number of the sampling points in the sampling point set is greater than or equal to a set number, the sampling points in the sampling point set are used as the starting points.
3. The human-machine verification method according to claim 1, wherein: The step of determining a path point of each motion trajectory based on the starting point includes: Select any of the starting points as the first target starting point of the following trajectory, and select Any of the starting points is used as the second target starting point; wherein the following trajectory is the motion trajectory corresponding to the first target starting point; Randomly select a second target point from the perpendicular median of a first line segment; wherein the first line segment is a connecting line segment between the first target starting point and the second target starting point; The vertex of the perpendicular line of the second line segment is used as a control point; wherein the second line segment is a connecting line segment of the first target starting point and the second target point; and the length of the perpendicular line is greater than the set length; Based on the control points, a path point of each of the motion trajectories is determined.
4. The human-machine verification method according to claim 3, wherein: The step of generating dynamic images of all the motion trajectories based on the path points includes: Controlling the motion trajectory to move between the path points and confusing the following trajectory with all other motion trajectories; wherein the other motion trajectories are motion trajectories other than the following trajectory; all the motion trajectories have the same number of path points, and all the motion trajectories have the same time interval between the path points; After the confusion is completed, each motion track is controlled to move to the end point, stop and disappear, and generate the dynamic image.
5. The human-machine verification method according to claim 4, wherein: The following trajectory is confused with all other motion trajectories, including: The following trajectory and each of the other motion trajectories are controlled to move to the second target point, thereby completing the confusion between the following trajectory and all other motion trajectories.
6. The human-machine verification method according to claim 3, wherein: The step of determining a path point of each motion trajectory based on the control point includes: Determining the number of recursive operations on the path points based on the number of control points; Based on the number of the control points, the number of recursions and preset parameters, the path points of each of the motion trajectories are determined.
7. The human-machine verification method according to claim 1, wherein: The step of responding to a user's click event based on the dynamic image and performing human-machine verification based on the click event includes: Displaying the dynamic image and detecting a click event based on the dynamic image; If the click event is a click-following track, it is determined that the user performs a click operation; If the click event is not a click on the follow track, it is determined that the machine performs a click operation.
8. A human-machine verification device, comprising: A starting point determination module is configured to determine a plurality of starting points in the human-machine verification image area; wherein any of the starting points corresponds to a motion trajectory; a path point determination module, configured to determine a path point of each of the motion trajectories based on the starting point; wherein any of the motion trajectories includes a plurality of path points; A dynamic image generation module is configured to generate a plurality of dynamic images of the motion trajectories based on the plurality of path points; The human-machine verification module is configured to respond to a user's click event based on the dynamic image and perform human-machine verification based on the click event; wherein the click event represents the user's selection of the motion trajectory.
9. An electronic device comprising a processor and a memory storing a computer program, wherein when the processor executes the computer program, the steps of the human-machine verification method according to any one of claims 1 to 7 are implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the human-machine verification method according to any one of claims 1 to 7 are implemented.
11. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of the human-machine authentication method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Verification method and apparatus used for distinguishing man and machine
CN105975823A
Verification methods and devices and calculation equipment
CN108121906A
Track verification code identification method and device, electronic equipment and storage medium
CN116894242A
Method for controlling a graphical user interface for touchscreen-enabled computer systems
US20090027334A1