Disclosure of Invention
The embodiment of the application provides a picture verification method, a picture verification device, a storage medium and picture verification equipment, which at least solve the technical problems of complicated background processing, high database pressure and low program running speed.
According to one aspect of the embodiment of the application, a picture verification method is provided, which comprises the steps of randomly generating a first coordinate point according to a coordinate area range corresponding to a picture to be verified, sending the first coordinate point to a client, 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 generated by clicking a position indicated by the first coordinate point in the verification interface of the client, and determining that the client passes verification under the condition that the first coordinate point and the second coordinate point meet preset conditions.
Optionally, under the condition that the first coordinate point and the second coordinate point meet the preset condition, determining that the client passes the verification comprises performing rounding operation on the second coordinate point to obtain the rounded second coordinate point, and under the condition that the rounded second coordinate point is consistent with the first coordinate point, determining that the client passes the verification.
Optionally, rounding operation is realized by determining the number of bits of the horizontal axis coordinate and the vertical axis coordinate after the decimal point in the second coordinate point, and rounding the numerical value corresponding to the number of bits after the decimal point to obtain the rounded second coordinate point.
Optionally, before the first coordinate point is randomly generated according to the coordinate area range corresponding to the picture to be verified, the method further comprises the steps of establishing a coordinate system by taking a preset position in the picture to be verified as an origin, determining the coordinate positions corresponding to the vertexes of the picture to be verified in the coordinate system, and generating the coordinate area range according to the coordinate positions.
Optionally, before sending the first coordinate point to the client, the method includes determining a first name of the picture to be verified, encrypting the first name and the first coordinate point by adopting a first type encryption and decryption algorithm to obtain encrypted first data, and storing the first data in a value database.
Optionally, the sending of the first coordinate point to the client comprises the steps of encrypting the first name of the picture to be verified by adopting a second type encryption and decryption algorithm to obtain a name in a ciphertext form, and sending the name in the ciphertext form and the first coordinate point to the client.
Optionally, under the condition that the first coordinate point and the second coordinate point meet the preset condition, determining that the client passes verification includes invoking a second type encryption and decryption algorithm to decrypt the ciphertext to obtain a plaintext form name, invoking the first type encryption and decryption algorithm to encrypt the plaintext form name and the second coordinate point to obtain encrypted second data, comparing the second data with the first data stored in the database, and determining that the client passes verification under the condition that the second data and the first data.
According to another aspect of the embodiment of the application, a picture verification device is provided, which comprises a generation module, a sending module, a receiving module and a determining module, wherein the generation module is used for randomly generating a first coordinate point according to a coordinate area range corresponding to a picture to be verified, the sending module is used for sending the first coordinate point to a client, displaying the first coordinate point on a verification interface of the client, the receiving module is used for receiving a second coordinate point returned by the client, the second coordinate point is generated by clicking a position indicated by the first coordinate point in the verification interface of the client, and the determining module is used for determining that the client passes verification under the condition that the first coordinate point and the second coordinate point meet preset conditions.
According to another aspect of the embodiment of the application, a nonvolatile storage medium is provided, which comprises a stored program, wherein the program is used for controlling a device where the storage medium is located to execute any picture verification method.
According to another aspect of the embodiment of the application, there is also provided an electronic device, including a processor, a memory for storing instructions executable by the processor, wherein the processor is configured to execute the instructions to implement any one of the picture verification methods.
In the embodiment of the application, a first coordinate point is randomly generated according to a coordinate area range corresponding to a picture to be verified by adopting an image verification mode, the first coordinate point is sent to a client, the first coordinate point is displayed on a verification interface of the client, a second coordinate point returned by the client is received, wherein the second coordinate point is generated after clicking operation is performed on a position indicated by the first coordinate point in the verification interface of the client, under the condition that the first coordinate point and the second coordinate point meet preset conditions, the client verification is determined to pass, the aim of comparing and verifying is fulfilled by combining a picture name with the coordinate point and then encrypting the coordinate point is fulfilled, so that the difficulty of a recognition program is increased, the pressure during program operation is reduced, and the safety of verification is also increased to a certain extent. The technical effects of saving data space by omitting the parameters of text information, fonts, colors and the like in various pictures are further solved, and the technical problems of complicated background processing of a picture verification mode, high database pressure, low program running speed and the like in the related technology are further solved.
Detailed Description
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For a better understanding of the related embodiments of the present application, technical terms or partial terms that may be related to the present application will now be explained:
The DES encryption refers to DES symmetric encryption, which is a relatively traditional encryption method, the encryption operation and the decryption operation use the same secret key, and the sender of information and the receiver of information must commonly hold the password (called symmetric password) when transmitting and processing the information, so that the DES encryption is a symmetric encryption algorithm. DES encryption divides plaintext into fixed blocks of bytes, encrypts the blocks of bytes, and finally strings together to form ciphertext. DES uses a 56-bit key and an additional 8-bit parity bit to produce a maximum packet size of 64 bits. This is an iterative block cipher, using a technique called Feistel, in which an encrypted block of text is split into two halves.
RSA encryption is an asymmetric encryption. Decryption may be accomplished without directly passing the key. This ensures the security of the information and avoids the risk of hacking caused by direct transfer of the key. Is a process of encrypting and decrypting by a pair of keys, which are respectively called a public key and a private key. In the RAS algorithm, the public key is public, while the private key is required to be kept secret. Both encryption and decryption algorithms are also disclosed. Although the private key is determined by the public key, the private key cannot be calculated from the public key, which is the security of RSA.
According to an embodiment of the present application, a method embodiment of picture verification is provided, it being noted that the steps shown in the flowchart of the figures may be performed 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 may be performed in an order other than that shown or described herein.
Fig. 1 is a picture verification method according to an embodiment of the present application, as shown in fig. 1, the method comprising the steps of:
step S102, randomly generating a first coordinate point according to a coordinate area range corresponding to a picture to be verified;
step S104, a first coordinate point is sent to a client, and the first coordinate point is displayed on a verification interface of the client;
step S106, receiving a second coordinate point returned by the client, wherein the second coordinate point is generated after clicking the position indicated by the first coordinate point in the verification interface of the client;
Step S108, when the first coordinate point and the second coordinate point are determined to meet the preset condition, the client verification is determined to pass.
The picture verification method includes the steps of randomly generating a first coordinate point according to a coordinate area range corresponding to a picture to be verified, sending the first coordinate point to a client, 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 generated after clicking operation is performed on a position indicated by the first coordinate point in the verification interface of the client, determining that the client is verified by determining that the first coordinate point and the second coordinate point meet preset conditions, and completing comparison verification in a mode of combining picture names with the coordinate points and then encrypting the coordinate points, so that difficulty of a recognition program is increased, pressure during program operation is reduced, and verification safety is improved to a certain extent. The technical effects of saving data space by omitting the parameters of text information, fonts, colors and the like in various pictures are further solved, and the technical problems of complicated background processing of a picture verification mode, high database pressure, low program running speed and the like in the related technology are further solved.
In some embodiments of the present application, according to the case that the first coordinate point and the second coordinate point are determined to satisfy the preset condition, determining that the client verification passes may be implemented by specifically performing rounding operation on the second coordinate point to obtain a rounded second coordinate point, and determining that the client verification passes under the case that the rounded second coordinate point is consistent with the first coordinate point. For example, if the position clicked by the user on the client is not an integer, rounding is performed, and if the second coordinate clicked by the user is (6.3,6.1), rounding is performed to obtain rounded second coordinates (6, 6), and the first coordinates are also (6, 6), so that the rounded second coordinate point is consistent with the first coordinate point, and then it may be determined that the client verification is passed.
In some embodiments of the present application, according to the rounding operation, the method may specifically determine the number of bits of the horizontal axis coordinate and the vertical axis coordinate after the decimal point in the second coordinate point, and round the numerical value corresponding to the number of bits after the decimal point to obtain the rounded second coordinate point. For example, the rounding of the second coordinate point is to round the decimal part of the abscissa, and assuming that the coordinates of the second coordinate point are (7.8,7.9), the rounding operation is performed at this time, so as to obtain the rounded second coordinate point as (8, 8).
In some embodiments of the present application, before randomly generating the first coordinate point according to the coordinate area range corresponding to the picture to be verified, the method may be implemented by specifically establishing a coordinate system with a predetermined position in the picture to be verified as an origin, determining coordinate positions corresponding to each vertex of the picture to be verified in the coordinate system, and generating the coordinate area range according to the coordinate positions. For example, the position of the origin of coordinates is determined first, and the position of the origin of coordinates may be at the center of the picture, or may be at four vertices or any other positions of the picture. The positions of the origin of coordinates are different, and the ranges of the areas of coordinates are also different, so that the positions of the origin of coordinates are determined.
In some embodiments of the present application, before sending the first coordinate point to the client, the determining of the first name of the picture to be verified may be performed specifically by encrypting the first name and the first coordinate point by using a first type encryption and decryption algorithm to obtain encrypted first data, and storing the first data in a value database.
In some embodiments of the present application, according to the sending of the first coordinate point to the client, the sending may be implemented in such a manner that, specifically, the first name of the picture to be verified is encrypted by using the second type encryption/decryption algorithm to obtain a name in a ciphertext form, and the name in the ciphertext form and the first coordinate point are sent to the client.
In some embodiments of the present application, according to the case that the first coordinate point and the second coordinate point are determined to satisfy the preset condition, determining that the client verification passes may be implemented by specifically invoking a second type encryption/decryption algorithm to decrypt the ciphertext to obtain a plaintext form name, invoking the first type encryption/decryption algorithm to encrypt the plaintext form name and the second coordinate point to obtain encrypted second data, and comparing the second data with the first data stored in the database, and determining that the client verification passes under the condition that the second data and the first data.
In order to facilitate a better understanding of the technical solution of the present application by a person skilled in the art, a description will now be given with reference to a specific embodiment.
Fig. 2 is a schematic view of a flowchart for implementing coordinate axis anchor point picture verification according to an embodiment of the present application, as shown in fig. 2, the flowchart mainly includes the following steps:
(1) Establishing a picture library, marking picture names by using universal unique identifiers, then storing the picture names into a database, encrypting the names of all pictures and corresponding coordinate points by using DES (data encryption standard), and storing the names and the corresponding coordinate points into the database for comparison and verification.
(2) And randomly acquiring one picture to obtain information such as encrypted data, picture names and the like, encrypting the picture names by using RSA, then sending the picture names to a client, planning coordinate axes in the picture through calculation, displaying coordinate points (x, y), and allowing the client to click and view the coordinate points.
(3) And obtaining the maximum value and the minimum value of the coordinate points in the picture, randomly generating a coordinate point belonging to the coordinate axis range of the picture by the code, then sending the coordinate point to the client, and completing verification by clicking the corresponding coordinate point by the client through a mouse.
(4) When the clicked position of the client is in the range between the coordinate points, a smaller coordinate point is taken if the distance is smaller than 1/2, a larger coordinate point is taken if the distance is larger than or equal to 1/2, rounding operation is carried out, the clicked position is on the x axis with the same standard, the x point is changed, the y is unchanged, and the y point is changed and the x is unchanged on the y axis.
(5) And (2) extracting the coordinate point and the picture name of the client, firstly performing RSA decryption on the picture name, performing DES encryption on the picture name and the coordinate point, comparing the encrypted data with the encrypted data information of the picture name and the coordinate point in the step (2), if the encrypted data are consistent with the encrypted data information of the picture name and the coordinate point, verifying, otherwise, failing to verify, re-acquiring the picture after failing to verify, and planning until the verification is passed.
It is easy to note that this solution has the following effective effects:
(1) Through the verification of coordinate axis positioning, the method is convenient in the aspect of establishing a drawing library and the aspect of planning data aiming at the prior art. Through the accuracy of coordinate points and the diversity of pictures, the recognition difficulty of a program is increased.
(2) The security of the verification code is ensured by means of encryption and decryption, violent cracking of the machine is prevented, and the operation and the use of the client are simplified to a certain extent.
(3) The related technology is mostly to extract information in the picture and combine with coordinate points to obtain a range so as to finish the verification technology.
Fig. 3 is a device for verifying a picture according to an embodiment of the present application, as shown in fig. 3, the device includes:
the generating module 40 is configured to randomly generate a first coordinate point according to a coordinate region range corresponding to the picture to be verified;
the 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;
The receiving module 44 is configured to receive a second coordinate point returned by the client, where the second coordinate point is a coordinate point generated by performing a clicking operation on a position indicated by the first coordinate point in the verification interface of the client;
The determining module 46 is configured to determine that the client verification passes if it is determined that the first coordinate point and the second coordinate point satisfy the preset condition.
The picture verification device comprises a generation module 40 for randomly generating a first coordinate point according to a coordinate area range corresponding to a picture to be verified, a transmission module 42 for transmitting the first coordinate point to a client, displaying the first coordinate point on a verification interface of the client, a receiving module 44 for receiving a second coordinate point returned by the client, wherein the second coordinate point is a coordinate point generated by clicking operation on a position indicated by the first coordinate point in the verification interface of the client, and a determination module 46 for determining that the client passes the verification under the condition that the first coordinate point and the second coordinate point meet preset conditions, so that the aim of comparing and verifying the picture name and the coordinate point is fulfilled in an encryption processing mode after the coordinate point is combined, thereby realizing the purposes of increasing the difficulty of a recognition program, reducing the pressure during the program operation, improving the safety of the verification to a certain extent, omitting the technical effects of saving data space by parameters such as text information, fonts and colors in various pictures, further solving the technical problems of complicated background processing of a picture verification mode, slow database pressure and the like in related technology.
According to another aspect of the embodiment of the present application, there is also provided a nonvolatile storage medium, the nonvolatile storage medium including a stored program, wherein when the program runs, a device in which the nonvolatile storage medium is controlled to execute any one of the picture verification methods.
Specifically, the storage medium is configured to store program instructions for the following functions, and implement the following functions:
The method comprises the steps of randomly generating a first coordinate point according to a coordinate area range corresponding to a picture to be verified, sending the first coordinate point to a client, 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 generated by clicking a position indicated by the first coordinate point in the verification interface of the client, and determining that the client passes verification under the condition that the first coordinate point and the second coordinate point meet preset conditions.
There is provided, in accordance with an embodiment of the present application, an electronic device comprising at least one processor, and a memory communicatively coupled to the at least one processor, wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform any one of the above.
Optionally, the electronic device may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input device is connected to the processor.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed technology may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, for example, may be a logic function division, and may be implemented in another manner, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. The storage medium includes a U disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, etc. which can store the program code.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application, which are intended to be comprehended within the scope of the present application.