Image verification method, device, storage medium, and image verification equipment
By randomly generating and processing coordinate point information during image verification, the verification process is simplified, database pressure is reduced, program running speed is increased, and security is enhanced, solving the problems of cumbersome and slow image verification methods in existing technologies.
Patent Information
- Application Number
- CN202210988136.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-17
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2042-08-17
AI Technical Summary
The existing image verification method has cumbersome background processing, heavy database pressure, and slow program operation.
By randomly generating the coordinate points of the image to be verified, sending it to the client for click verification, and determining that the verification is passed when the preset conditions are met, and combining the encryption and decryption algorithm to process the coordinate point information, the verification process is simplified and security is enhanced.
It reduces the complexity of background processing, reduces database pressure, increases program running speed, and enhances verification security.
Smart Images

Figure CN115348093B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to an image verification method, apparatus, storage medium, and image verification device. Background Art
[0002] With the rapid development of computer technology and electronics, and the increasing maturity of communication and computer network technologies, the verification code methods provided by servers are becoming increasingly diverse, including image verification, sliding verification, arithmetic verification, and text click verification. Most existing image verification methods are cumbersome in backend processing, significantly increasing database pressure and program execution speed. For example, verification based on clicking an image area requires obtaining a large amount of information, including detailed image information, canvas coloring, font, brightness, and shadows.
[0003] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention
[0004] The embodiments of the present application provide an image verification method, apparatus, storage medium, and image verification device to at least solve the technical problems of cumbersome background processing, high database pressure, and slow program running speed.
[0005] According to one aspect of an embodiment of the present application, a picture verification method is provided, including: randomly generating a first coordinate point based on a coordinate area range corresponding to the picture to be verified; sending the first coordinate point to a client and displaying the first coordinate point on a verification interface of the client; receiving a second coordinate point returned by the client, wherein the second coordinate point is a coordinate point generated by clicking on a position indicated by the first coordinate point in the verification interface of the client; and determining that the client verification is successful when it is determined that the first coordinate point and the second coordinate point meet preset conditions.
[0006] Optionally, when it is determined that the first coordinate point and the second coordinate point meet preset conditions, determining that the client verification is successful includes: performing a rounding operation on the second coordinate point to obtain a rounded second coordinate point; when the rounded second coordinate point is consistent with the first coordinate point, determining that the client verification is successful.
[0007] Optionally, the rounding operation is implemented in the following manner: determining the number of digits after the decimal point of the horizontal axis coordinate and the vertical axis coordinate in the second coordinate point; rounding the values corresponding to the digits after the decimal point to obtain the rounded second coordinate point.
[0008] Optionally, before randomly generating a first coordinate point according to the coordinate area range corresponding to the image to be verified, the method also includes: establishing a coordinate system with a predetermined position in the image to be verified as the origin; determining the coordinate positions corresponding to each vertex of the image to be verified in the coordinate system; and generating a coordinate area range according to the coordinate positions.
[0009] Optionally, before sending the first coordinate point to the client, the method includes: determining a first name of the image to be verified, encrypting the first name and the first coordinate point using a first type of encryption and decryption algorithm to obtain encrypted first data, and storing the first data in a database.
[0010] Optionally, sending the first coordinate point to the client includes: encrypting the first name of the image to be verified using a second type of encryption and decryption algorithm to obtain a name in ciphertext; and sending the ciphertext name and the first coordinate point to the client.
[0011] Optionally, when it is determined that the first coordinate point and the second coordinate point meet preset conditions, determining that the client verification is successful includes: calling the second type of encryption and decryption algorithm to decrypt the ciphertext to obtain the name in plain text; calling the first type of encryption and decryption algorithm to encrypt the plain text name and the second coordinate point to obtain encrypted second data; comparing the second data with the first data stored in the database, and when the second data is consistent with the first data, determining that the client verification is successful.
[0012] According to another aspect of an embodiment of the present application, a picture verification device is also provided, including: a generation module for randomly generating a first coordinate point according to a coordinate area range corresponding to the picture to be verified; a sending module for sending the first coordinate point to the client and displaying the first coordinate point on the verification interface of the client; a receiving module for receiving a second coordinate point returned by the client, wherein the second coordinate point is a coordinate point generated by clicking on the position indicated by the first coordinate point in the verification interface of the client; and a determination module for determining that the client verification is passed when it is determined that the first coordinate point and the second coordinate point meet preset conditions.
[0013] According to another aspect of an embodiment of the present application, a non-volatile storage medium is further provided, including: the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute any one of the image verification methods.
[0014] According to another aspect of an embodiment of the present application, an electronic device is further provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement any one of the image verification methods.
[0015] In an embodiment of the present application, an image verification method is adopted, by randomly generating a first coordinate point according to the coordinate area range corresponding to the image to be verified; sending the first coordinate point to the client, and displaying the first coordinate point on the verification interface of the client; receiving a second coordinate point returned by the client, wherein the second coordinate point is a coordinate point generated after clicking the position indicated by the first coordinate point in the verification interface of the client; when it is determined that the first coordinate point and the second coordinate point meet the preset conditions, it is determined that the client verification has passed, and the purpose of completing the comparative verification by combining the image name with the coordinate point and then encrypting it is achieved, thereby increasing the difficulty of the recognition program, reducing the pressure when the program is running, and increasing the security of the verification to a certain extent. The technical effect of omitting the parameters of text information, fonts, colors, etc. in various images saves data space, thereby solving the technical problems of the related art such as the cumbersome background processing of the image verification method, the high database pressure and the slow program running speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0017] Figure 1 is a flowchart of an image verification method according to an embodiment of the present application;
[0018] Figure 2 Schematic diagram of a flow chart for implementing image verification of coordinate axis positioning points according to an embodiment of the present application;
[0019] Figure 3 2 is a schematic diagram of the device structure of an image verification method according to an embodiment of the present application. DETAILED DESCRIPTION
[0020] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0021] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0022] In order to facilitate better understanding by those skilled in the art of the present application, the following technical terms or some nouns that may be involved in the present application are explained:
[0023] DES encryption refers to DES symmetric encryption, a relatively traditional encryption method. The same key is used for both encryption and decryption. The sender and receiver of information must share this key (called a symmetric key) when transmitting and processing information. It is a symmetric encryption algorithm. DES encryption divides plaintext into fixed byte blocks, encrypts these byte blocks, and then concatenates them to form ciphertext. DES uses a 56-bit key and an additional 8-bit parity bit, resulting in a maximum block size of 64 bits. It is an iterative block cipher that uses a technique called Feistel, in which encrypted text blocks are split in half.
[0024] RSA encryption is a type of asymmetric encryption. It allows decryption without directly transmitting the key. This ensures information security and avoids the risk of compromise associated with direct key transmission. Encryption and decryption are performed using a pair of keys: a public key and a private key. In the RSA algorithm, the public key is public, while the private key is kept secret. Both the encryption and decryption algorithms are public. Although the private key is determined by the public key, it cannot be calculated from the public key. This is the security of RSA.
[0025] According to an embodiment of the present application, an embodiment of a method for image verification is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0026] Figure 1 This is a picture verification method according to an embodiment of the present application, such as Figure 1 As shown, the method includes the following steps:
[0027] Step S102: randomly generate a first coordinate point according to the coordinate area range corresponding to the image to be verified;
[0028] Step S104: sending the first coordinate point to the client, and displaying the first coordinate point on the verification interface of the client;
[0029] Step S106, receiving a second coordinate point returned by the client, wherein the second coordinate point is a coordinate point generated by clicking the position indicated by the first coordinate point in the verification interface of the client;
[0030] Step S108 : When it is determined that the first coordinate point and the second coordinate point meet the preset conditions, it is determined that the client verification is passed.
[0031] In this image verification method, a first coordinate point is randomly generated according to the coordinate area range corresponding to the image to be verified; the first coordinate point is sent to the client and displayed on the verification interface of the client; a second coordinate point returned by the client is received, wherein the second coordinate point is a coordinate point generated after clicking the position indicated by the first coordinate point in the verification interface of the client; when it is determined that the first coordinate point and the second coordinate point meet the preset conditions, it is determined that the client verification has passed, achieving the purpose of completing the comparison verification by combining the image name with the coordinate point and then encrypting it, thereby increasing the difficulty of the recognition program, reducing the pressure when the program is running, and to a certain extent, increasing the security of the verification. The technical effect of omitting parameters such as text information, fonts, colors, etc. in various images saves data space, thereby solving technical problems in related technologies such as cumbersome background processing of image verification methods, high database pressure, and slow program running speed.
[0032] In some embodiments of the present application, upon determining that the first coordinate point and the second coordinate point satisfy a preset condition, determining that the client verification has passed can be achieved in the following manner: specifically, performing a rounding operation on the second coordinate point to obtain a rounded second coordinate point; and upon the rounded second coordinate point being consistent with the first coordinate point, determining that the client verification has passed. For example, if the position clicked by the user on the client is not an integer, it is rounded off. Assuming that the second coordinate clicked by the user is (6.3, 6.1), then rounding is performed to obtain a rounded second coordinate (6, 6), and at this time the first coordinate is also (6, 6), so the rounded second coordinate point is consistent with the first coordinate point, and then it can be determined that the client verification has passed.
[0033] In some embodiments of the present application, the rounding operation can be implemented as follows: specifically, determining the number of digits after the decimal point of the horizontal and vertical coordinates of the second coordinate point; rounding the values corresponding to the digits after the decimal point to obtain the rounded second coordinate point. For example, rounding the second coordinate point is rounding the decimal part of the horizontal and vertical coordinates. Assuming that the coordinates of the second coordinate point are (7.8, 7.9), then the rounding operation is performed at this time, and the rounded second coordinate point is (8, 8).
[0034] In some embodiments of the present application, before randomly generating the first coordinate point according to the coordinate area range corresponding to the image to be verified, it can be achieved in the following manner: specifically, a coordinate system is established with a predetermined position in the image to be verified as the origin; the coordinate positions corresponding to each vertex of the image to be verified in the coordinate system are determined; and the coordinate area range is generated according to the coordinate positions. For example, the position of the coordinate origin must be determined first. The position of the coordinate origin can be at the center of the image, or at the four vertices of the image, or at any other position. The position of the coordinate origin is different, and the coordinate area range is also different, so the position of the coordinate origin must be determined.
[0035] In some embodiments of the present application, before sending the first coordinate point to the client, it can be achieved in the following way: specifically, determine the first name of the image to be verified, use the first type of encryption and decryption algorithm to encrypt the first name and the first coordinate point, obtain the encrypted first data, and store the first data in the database.
[0036] In some embodiments of the present application, sending the first coordinate point to the client can be achieved in the following manner: specifically, using the second type of encryption and decryption algorithm to encrypt the first name of the image to be verified to obtain a name in ciphertext form; and sending the ciphertext name and the first coordinate point to the client.
[0037] In some embodiments of the present application, determining that the client verification is successful when it is determined that the first coordinate point and the second coordinate point meet the preset conditions can be achieved in the following manner. Specifically, calling the second type of encryption and decryption algorithm to decrypt the ciphertext to obtain the name in plain text; calling the first type of encryption and decryption algorithm to encrypt the plain text name and the second coordinate point to obtain the encrypted second data; comparing the second data with the first data stored in the database, and determining that the client verification is successful when the second data is consistent with the first data.
[0038] In order to facilitate those skilled in the art to better understand the technical solution of the present application, a specific embodiment is now described.
[0039] Figure 2 Schematic diagram of a flow chart for implementing image verification of coordinate axis positioning points according to an embodiment of the present application. Figure 2As shown, the process mainly includes the following steps:
[0040] (1) Create a gallery, mark the image names with universal unique identifiers, and then save them in the database. All image names and corresponding coordinate points are encrypted with DES and stored in the database for comparison and verification.
[0041] (2) Randomly obtain a picture to obtain encrypted data, picture name and other information, encrypt the picture name using RSA and then send it to the client. Through calculation, plan the coordinate axis in the picture and display the coordinate point (x, y) for the client to click to view the coordinate point.
[0042] (3) Obtain the maximum and minimum values of the coordinate points in the image. The code randomly generates a coordinate point within the image coordinate axis range and then sends it to the client. The client completes the verification by clicking the corresponding coordinate point with the mouse.
[0043] (4) When the position clicked by the client is within the area between the coordinate points, if the distance is less than 1 / 2, the smaller coordinate point is taken; if the distance is greater than or equal to 1 / 2, the larger coordinate point is taken, and rounding is performed. The same standard applies: if the position clicked is on the x-axis, the x point changes, but the y point remains unchanged; if the y point changes on the y-axis, the x point remains unchanged.
[0044] (5) The coordinate points and picture names of the client are extracted. The picture names are first decrypted by RSA, and the picture names and coordinate points are encrypted by DES. The encrypted data is compared with the encrypted data information of the picture names and coordinate points in step 2. If they are consistent, the verification is passed. Otherwise, the verification fails. If the verification fails, the picture is obtained again for planning until it passes the verification.
[0045] It is easy to notice that this solution has the following effective effects:
[0046] (1) Verification is performed through coordinate axis positioning. Compared with existing technologies, this patent is more convenient in terms of establishing a library and planning data. The accuracy of coordinate points and the diversity of images increase the recognition difficulty of the program.
[0047] (2) The security of the verification code is guaranteed by encryption and decryption, which prevents brute force cracking by machines and simplifies the operation of the client to a certain extent.
[0048] (3) Most related technologies extract information from images and then combine it with coordinate points to obtain a range to complete the verification technology. The present invention directly uses specific coordinate points to complete the verification, which simplifies the technology and reduces data pressure.
[0049] Figure 3 This is a device for image verification according to an embodiment of the present application, such as Figure 3 As shown, the device includes:
[0050] A generating module 40 is configured to randomly generate a first coordinate point according to a coordinate region corresponding to the image to be verified;
[0051] A sending module 42 is configured to send the first coordinate point to the client and display the first coordinate point on a verification interface of the client;
[0052] The receiving module 44 is configured to receive a second coordinate point returned by the client, wherein the second coordinate point is a coordinate point generated by clicking the position indicated by the first coordinate point in the verification interface of the client;
[0053] The determination module 46 is configured to determine that the client verification is successful if it is determined that the first coordinate point and the second coordinate point meet a preset condition.
[0054] In the image verification device, a generation module 40 is used to randomly generate a first coordinate point according to the coordinate area range corresponding to the image to be verified; a sending module 42 is used to send the first coordinate point to the client and display the first coordinate point on the verification interface of the client; a receiving module 44 is used to receive a second coordinate point returned by the client, wherein the second coordinate point is a coordinate point generated by clicking on the position indicated by the first coordinate point in the verification interface of the client; a determination module 46 is used to determine that the client verification is passed when it is determined that the first coordinate point and the second coordinate point meet the preset conditions, thereby achieving the purpose of completing the comparison verification by combining the image name with the coordinate point and then encrypting it, thereby increasing the difficulty of the recognition program, reducing the pressure on the program during operation, and increasing the security of the verification to a certain extent, omitting the parameters of text information, fonts, colors, etc. in various images, saving data space, and thus solving the technical problems of the related art such as the cumbersome background processing of the image verification method, the high database pressure and the slow program running speed.
[0055] According to another aspect of an embodiment of the present application, a non-volatile storage medium is further provided. The non-volatile storage medium includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute any one of the image verification methods.
[0056] Specifically, the above storage medium is used to store program instructions for the following functions to implement the following functions:
[0057] A first coordinate point is randomly generated according to the coordinate area range corresponding to the image to be verified; the first coordinate point is sent to the client and the first coordinate point is displayed on the verification interface of the client; a second coordinate point returned by the client is received, wherein the second coordinate point is a coordinate point generated by clicking the position indicated by the first coordinate point in the verification interface of the client; when it is determined that the first coordinate point and the second coordinate point meet the preset conditions, it is determined that the client verification is passed.
[0058] According to an embodiment of the present application, an electronic device is provided, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any of the above items.
[0059] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0060] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0061] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0062] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0063] 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, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0064] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0065] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or 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 read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0066] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A picture verification method, characterized in that: include: Randomly generate the first coordinate point according to the coordinate area range corresponding to the image to be verified; Sending the first coordinate point to a client, and displaying the first coordinate point on a verification interface of the client; Receiving a second coordinate point returned by the client, wherein the second coordinate point is a coordinate point generated by clicking the position indicated by the first coordinate point in the verification interface of the client; If it is determined that the first coordinate point and the second coordinate point meet a preset condition, determining that the client verification is passed; The method further includes: determining a first name of the image to be verified, encrypting the first name and the first coordinate point using a first type of encryption and decryption algorithm to obtain encrypted first data, and storing the first data in a database; encrypting the first name of the image to be verified using a second type of encryption and decryption algorithm to obtain a ciphertext name; and sending the ciphertext name and the first coordinate point to the client; After receiving the second coordinate point returned by the client, the second type of encryption and decryption algorithm is called to decrypt the ciphertext to obtain the name in plain text; the first type of encryption and decryption algorithm is called to encrypt the plain text name and the second coordinate point to obtain encrypted second data; the second data is compared with the first data stored in the database, and when the second data is consistent with the first data, it is determined that the client verification is successful.
2. The method according to claim 1, characterized in that When it is determined that the first coordinate point and the second coordinate point meet a preset condition, determining that the client verification is passed includes: performing a rounding operation on the second coordinate point to obtain a rounded second coordinate point; When the rounded second coordinate point is consistent with the first coordinate point, it is determined that the client verification is successful.
3. The method according to claim 2, characterized in that The rounding operation is implemented as follows: Determine the number of decimal places of the horizontal axis coordinate and the vertical axis coordinate of the second coordinate point; The numerical value corresponding to the number of digits after the decimal point is rounded to obtain the rounded second coordinate point.
4. The method according to claim 1, wherein Before randomly generating a first coordinate point according to the coordinate area range corresponding to the image to be verified, the method further includes: Establishing a coordinate system with a predetermined position in the image to be verified as the origin; Determine the coordinate position of each vertex of the image to be verified in the coordinate system; The coordinate area range is generated according to the coordinate position.
5. A picture verification device, characterized in that: include: a generation module, configured to randomly generate a first coordinate point based on a coordinate region corresponding to the image to be verified, determine a first name for the image to be verified, encrypt the first name and the first coordinate point using a first type of encryption and decryption algorithm to obtain encrypted first data, and store the first data in a database; a sending module, configured to send the first coordinate point to a client, display the first coordinate point on a verification interface of the client, and encrypt the first name of the image to be verified using a second type of encryption and decryption algorithm to obtain a ciphertext name; and send the ciphertext name and the first coordinate point to the client; a receiving module, configured to receive a second coordinate point returned by the client, wherein the second coordinate point is a coordinate point generated by clicking the position indicated by the first coordinate point in the verification interface of the client; A determination module is used to determine that the client verification has passed when it is determined that the first coordinate point and the second coordinate point meet preset conditions, and is also used to call the second type of encryption and decryption algorithm to decrypt the ciphertext to obtain the name in plain text; call the first type of encryption and decryption algorithm to encrypt the plain text name and the second coordinate point to obtain encrypted second data; compare the second data with the first data stored in the database, and determine that the client verification has passed when the second data is consistent with the first data.
6. A non-volatile storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is run, the device where the storage medium is located is controlled to execute the image verification method according to any one of claims 1 to 4.
7. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the image verification method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Dynamic Turing verification method and device
CN101853350A