Verification code generation method, device and computing equipment based on image filtering transformation
The verification code is generated through image filtering transformation, and the user selects the chessboard endgame and the place where the move is set, solving the problem that the existing verification code is easily cracked, improving the security and difficulty.
Patent Information
- Application Number
- CN202110875117.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-30
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2041-07-30
AI Technical Summary
Existing verification codes are easily identified and cracked by machines, and cannot effectively prevent malicious behaviors such as automatic batch registration, and are mostly two-dimensional structures, making it difficult to improve security.
Using the verification code generation method based on image filtering transformation, filter the original image by randomly obtaining multiple filters, randomly deleting elements to generate chessboard endgame, and determining the coordinates and position of the winning step, displaying it to the user to select verification, enhance verification code difficulty.
It improves the difficulty and security of verification code cracking, increases the cost and time of machine cracking, and effectively prevents malicious behavior.
Smart Images

Figure CN113570680B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a verification code generation method, device and computing equipment based on image filtering transformation. Background Art
[0002] The verification codes generated by current technology have many forms, such as random combinations of numbers and letters, pictures containing specific text or specific elements, randomly generated binary arithmetic operations, sliding verification codes, etc.
[0003] The verification code elements in many input schemes are mostly numbers and letters. In the context of random verification codes, most schemes only require users to operate once, such as entering numbers and letters, or sliding a slider to a specific position. Each type of verification code is in a specific format, such as fixed length for digital verification and matching principle for image verification. The user interaction process is short, which reduces the cost of machine processing. In addition, even for verification codes such as finding specific objects in pictures or selecting pictures containing objects, although the number of user operations is increased, due to the development of machine learning, target detection and recognition have been greatly developed. With the advancement of technology, overly simple verification codes have become easy to be recognized by machines, and cannot achieve the original intention of designing verification codes, such as: preventing false registration, preventing account theft, preventing promotion cheating, and preventing ticket swiping and activity arbitrage. Moreover, the existing verification codes are basically no more than two dimensions, which can be easily cracked by machine learning and cannot effectively prevent malicious behaviors such as automatic batch registration. Summary of the invention
[0004] In view of the above problems, the embodiments of the present invention provide a verification code generation method, apparatus and computing device based on image filtering transformation, which overcome the above problems or at least partially solve the above problems.
[0005] According to one aspect of an embodiment of the present invention, a verification code generation method based on image filtering transformation is provided, the method comprising: randomly obtaining a plurality of different filters, selecting any one of the filters as a target filter to filter an original image to obtain a verification code image; randomly deleting at least one element from the plurality of the filters, generating chess endgames based on the plurality of the filters after deleting the elements, and determining the winning move coordinates corresponding to each chess endgame, the winning move coordinates being the chess piece placement position of the chess endgame that is at least one step back after the chess endgame is determined; setting the winning move coordinates and a plurality of chess piece placement positions different from the winning move coordinates in each chess endgame and displaying them for user selection and verification.
[0006] In an optional manner, the multiple filters after deleting elements respectively generate chess endgames, and respectively determine the winning move coordinates corresponding to each chess endgame, including: obtaining a first model and a second model for chessboard simulation; according to the elements deleted by each filter, applying the first model and the second model to perform chessboard simulation on each chess game, respectively generating the chess endgames, and respectively determining the winning move coordinates corresponding to each chess endgame.
[0007] In an optional manner, the obtaining of the first model and the second model for chessboard simulation includes: applying a self-simulation algorithm and a Monte Carlo tree search algorithm to cyclically train a strategy value network according to the current situation of the input chess game to obtain the probability of placing a piece at each position of the chess game and a situation score; if the loss function calculated according to the probability of placing a piece at each position of the chess game and the situation score meets a preset condition, the first model is obtained; and the self-simulation algorithm and the Monte Carlo tree search algorithm based on different parameters are subjected to the same training method to obtain the second model which is different from the first model.
[0008] In an optional manner, the first model and the second model are applied to perform chessboard simulation on each chess game according to the elements deleted by each filter, the chess endgames are generated respectively, and the winning move coordinates corresponding to each chess endgame are determined respectively, including: for each chess game, according to the type and value of the elements deleted by the filter, the characters represented by the first model and the second model are adjusted to perform chessboard simulation on the chess game until a winner is determined, at least one step back is taken to generate the chess endgame, and the winning move coordinates corresponding to the chess endgame are recorded.
[0009] In an optional manner, the method of randomly deleting at least one element from a plurality of the filters, generating chess endgames based on the plurality of filters after deleting the elements, and determining the coordinates of the winning moves corresponding to each chess endgame, comprises: for a plurality of the filters, randomly deleting a plurality of elements from each of the filters; generating a multi-move winning chess endgame based on the plurality of elements deleted from each of the filters, and obtaining a plurality of winning move coordinates determined in sequence.
[0010] In an optional manner, the winning move coordinates and multiple chess position placements different from the winning move coordinates are set in each chess endgame and displayed for user selection and verification, including: randomly selecting and recording multiple chess position placements different from the winning move coordinates in the chess endgame; displaying the chess endgame with the winning move coordinates and multiple chess position placements different from the winning move coordinates in a display interface for user selection and verification.
[0011] In an optional manner, the method further includes: obtaining the chessboard endgame and chess piece placement position selected by the user; determining a filter based on the chessboard endgame and chess piece placement position; and applying the filter to filter the original image to obtain a first image and compare it with the verification code image to complete verification.
[0012] According to another aspect of an embodiment of the present invention, there is provided a verification code generation device based on image filtering transformation, the device comprising: an image acquisition unit, used to randomly acquire a plurality of different filters, and select any one of the filters as a target filter to filter an original image to obtain a verification code image; an endgame acquisition unit, used to randomly delete at least one element from the plurality of filters, and generate chess endgames based on the plurality of filters after deleting the elements, and respectively determine the winning move coordinates corresponding to each chess endgame, the winning move coordinates being the chess piece drop position of the chess endgame that is at least one step back after the chess endgame is determined; and a position acquisition unit, used to set the winning move coordinates and a plurality of chess piece drop positions different from the winning move coordinates in each chess endgame and display them for user selection and verification.
[0013] According to another aspect of an embodiment of the present invention, there is provided a computing device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;
[0014] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute the steps of the verification code generation method based on image filtering transformation.
[0015] According to another aspect of the embodiments of the present invention, a computer storage medium is provided, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables the processor to execute the steps of the verification code generation method based on image filtering transformation.
[0016] The embodiment of the present invention randomly obtains a plurality of different filters, selects any one of the filters as a target filter to filter the original image to obtain a verification code image; randomly deletes at least one element from the plurality of filters, generates chess endgames based on the plurality of filters after the element is deleted, and determines the winning move coordinates corresponding to each chess endgame, the winning move coordinates being the chess piece placement position of the chess endgame that is retreated at least one step after the chess endgame is determined; the winning move coordinates and a plurality of chess piece placement positions different from the winning move coordinates are set in each chess endgame and displayed for the user to select and verify, which can enhance the difficulty coefficient of cracking and identification, increase the cost and time of machine cracking, and improve security.
[0017] The above description is only an overview of the technical solution of the embodiment of the present invention. In order to more clearly understand the technical means of the embodiment of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0019] Figure 1 A schematic diagram of the process of a verification code generation method based on image filtering transformation provided by an embodiment of the present invention is shown;
[0020] Figure 2 A schematic diagram of an actual display interface of a verification code generation method based on image filtering transformation provided by an embodiment of the present invention is shown;
[0021] Figure 3 A schematic diagram of generating a verification code image of a verification code generating method based on image filtering transformation provided by an embodiment of the present invention is shown;
[0022] Figure 4 A convolution schematic diagram of a verification code generation method based on image filtering transformation provided by an embodiment of the present invention is shown;
[0023] Figure 5 A filter schematic diagram of a verification code generation method based on image filtering transformation provided by an embodiment of the present invention is shown;
[0024] Figure 6 Another filter schematic diagram of the verification code generation method based on image filtering transformation provided by an embodiment of the present invention is shown;
[0025] Figure 7 Another filter schematic diagram of the verification code generation method based on image filtering transformation provided by an embodiment of the present invention is shown;
[0026] Figure 8 A schematic diagram of the network structure of a strategy value network of a verification code generation method based on image filtering transformation provided by an embodiment of the present invention is shown;
[0027] Fig. 9 A schematic diagram of a self-play mode of strategy value network training of a verification code generation method based on image filtering transformation provided by an embodiment of the present invention is shown;
[0028] Fig.10A schematic diagram of a Gobang endgame corresponding to a filter lacking three elements in the verification code generation method based on image filtering transformation provided by an embodiment of the present invention is shown;
[0029] Fig.11 A schematic diagram of the structure of a verification code generation device based on image filtering transformation provided by an embodiment of the present invention is shown;
[0030] Fig.12 A schematic diagram of the structure of a computing device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0031] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.
[0032] Figure 1 FIG. 1 is a flow chart of a verification code generation method based on image filtering transformation provided by an embodiment of the present invention. The verification code generation method based on image filtering transformation is applied to electronic devices, such as Figure 1 As shown, the verification code generation method based on image filtering transformation includes:
[0033] Step S11: randomly obtain a plurality of different filters, and select one of the filters as a target filter to filter the original image to obtain a verification code image.
[0034] In the embodiment of the present invention, the electronic device can be any terminal device that can play videos, such as a mobile phone, a computer, an IPAD, etc. The electronic device terminal will perform digital filtering on a clear original image, and the filtering is the verification code image that needs to be verified. For example, see Figure 2 The actual display interface of the electronic device terminal shown in the figure, when the user enters the verification interface, the electronic device terminal randomly generates 3 different sets of filters {F1, F2, F3}, and randomly selects one of the sets of filters to filter the original image, and displays the original image and the filtered image at the same time. The electronic device terminal background needs to record this set of filters Fx (Fx = F1 or Fx = F2 or Fx = F3, for example Figure 2 In addition, in the simplest mode, each of the three filters randomly deletes an element, and the background needs to record the deleted elements {F1: f10, F2: f20, F3: f30}. Figure 3In , the original image is filtered by the selected filter to generate the filtered verification code image, where [[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]] is a digital filter. The operation of multiplying the image and the filter matrix element by element and then summing them is equivalent to moving a two-dimensional function to all positions of another two-dimensional function. This operation is called convolution or co-correlation. The specific process is shown in Figure 4 .
[0035] In the embodiment of the present invention, there are many types of filters, not limited to Figure 2 The style in . Figure 5-Figure 7 Several typical filter types are provided in Figure 5 The filter in the figure a means multiplying the middle pixel value of the original pixel by 1 and the rest by 0. The pixel value will not change at all. Figure 1 To. Figure 5 Figure b shows that the role of the convolution kernel is to take the average of nine values instead of the middle pixel value, which has a smoothing effect. Figure 6 The two filters in the image use the fact that the edge information in the image has a higher contrast than the surrounding pixels, and after convolution, this contrast is further enhanced, making the image appear sharp and clear, thus sharpening the image. Figure 7 The horizontal gradient (Prewitt) convolution kernel and the vertical gradient (Sobel) convolution kernel in are similar, both of which have a better detection effect on horizontal edges or vertical edges. In addition, the size of the convolution kernel is not limited to 3x3, 5x5, 7x7 are all possible, and there is no restriction here.
[0036] Step S12: randomly deleting at least one element from the plurality of filters, generating chess endgames respectively based on the plurality of filters after deleting the elements, and respectively determining the winning move coordinates corresponding to each chess endgame, the winning move coordinates being the positions of the chess pieces corresponding to each retreat step of the chess endgame that is retreated at least one step after the chess endgame is determined.
[0037] In an embodiment of the present invention, any one element can be randomly deleted in each filter, and then a chessboard endgame is generated based on the filter lacking one element, and a winning move coordinate corresponding to the chessboard endgame is determined. It is also possible to randomly delete multiple elements in each of the filters respectively for multiple filters; generate a multi-move winning chessboard endgame based on the multiple elements deleted from each filter respectively, and obtain multiple winning move coordinates in a determined order. That is, randomly delete multiple elements in each filter, and then generate a chessboard endgame based on the filter of the deleted multiple elements, and determine multiple winning move coordinates corresponding to the chessboard endgame, the number of which is the same as the number of deleted elements, and the order of the multiple winning move coordinates is also determined. For example, 2 elements are randomly deleted in each filter, and each filter based on the deleted 2 elements generates a chessboard endgame respectively, and determines 2 winning step coordinates corresponding to each chessboard endgame respectively, and the 2 winning step coordinates are respectively the chessboard endgame positions corresponding to the retreat step of each chessboard endgame that retreats one step after the chessboard endgame is decided and the chessboard endgame positions corresponding to the retreat step of each chessboard endgame that retreats one step on the basis after the chessboard endgame is decided. The 2 winning step coordinates are the chessboard positions of the penultimate first step and the penultimate second step after the chessboard endgame is decided. Wherein, the chessboard endgame is preferably a Gobang endgame. Of course, in other embodiments of the present invention, it can also be other chessboard endgames, which are not limited here.
[0038] The following describes the process of randomly deleting any element in each filter, generating chess endgames based on the multiple filters after the element is deleted, and determining the winning move coordinates corresponding to each chess endgame:
[0039] Optionally, first obtain a first model and a second model for chessboard simulation. The self-simulation algorithm and the Monte Carlo tree search algorithm can be applied to cyclically train the strategy value network according to the current situation of the input chess game to obtain the probability of placing a piece at each position of the chess game and the situation score; if the loss function calculated according to the probability of placing a piece at each position of the chess game and the situation score meets preset conditions, the first model is obtained; the self-simulation algorithm and the Monte Carlo tree search algorithm based on different parameters are applied with the same training method to obtain the second model which is different from the first model. The situation description of the embodiment of the present invention includes at least four planes. Taking an 11x11 chessboard as an example, see Figure 2, using four 11x11 binary feature planes, where the first two planes represent the current player's chess piece position and the opponent's chess piece position, respectively. The position with a chess piece is 1, and the position without a chess piece is 0. Then the third plane represents the opponent's most recent move, that is, only one position in the entire plane is 1, and the rest are all 0. The fourth plane, which is the last plane, indicates whether the current player has the first move. If the player is the first mover, the entire plane is all 1, otherwise it is all 0. The network structure of the strategy value network used is as follows Figure 8 As shown in the figure, first there is a 3-layer full convolution network, the outputs are 64, 128 and 256 layers of 3x3 convolution, and the ReLu activation function is used. Then it is divided into two outputs, policy and value. On the policy side, four 1x1 convolution kernels are used for dimensionality reduction, and then a fully connected layer is connected, and the softmax nonlinear function is used to directly output the probability of each position on the board; on the value side, two 1x1 convolution kernels are used for dimensionality reduction, and then a fully connected layer with 121 neurons is connected, and finally another fully connected layer is connected, and the tanh nonlinear function is used to directly output the situation score between [-1,1].
[0040] The embodiment of the present invention uses a policy network to return the probability of each feasible behavior (action) in the current situation and the model of the current situation score given the current situation s. The data collected through self-play is used to train the policy value network, and the updated policy value network will be immediately applied to the Monte Carlo Tree Search (MCTS) for subsequent self-play to generate better self-play data. The two are nested and mutually reinforcing, forming the entire training cycle. For details on the self-play method, please refer to Fig. 9 The input is the current situation description s, and the output is the probability P of each feasible action in the current situation and the score v of the current situation. The data (s, π, z) collected during the self-play process is used to train the policy value network. The training goal is to make the action probability P output by the policy value network closer to the probability π output by MCTS, so that the situation score v output by the policy network can more accurately predict the actual game result z. The specific loss function is:
[0041] l=(zv) 2 -π T logP.
[0042] During training, the function is continuously reduced. After about 4,000 rounds of training, the model has reached a certain level, that is, the first model is obtained. Considering the efficiency issue in the actual battle, the model only uses 400 simulations at each step. Similarly, another model is trained, that is, the second model, and the two models can be used for battle.
[0043] In an embodiment of the present invention, after obtaining the first model and the second model, the first model and the second model are applied to simulate the chessboard of each chess game according to the elements deleted by each filter, and the chessboard endgames are generated respectively, and the winning move coordinates corresponding to each chessboard endgame are determined respectively. For each chess game, the characters represented by the first model and the second model can be adjusted according to the type and value of the elements deleted by the filter to simulate the chessboard of the chess game until the winner is determined, and the chessboard endgame is generated at least one step back, and the winning move coordinates corresponding to the chessboard endgame are recorded. For example, if the element deleted by the filter is an odd number or the sum of all elements is an odd number, the first model is applied to play black first, and the second model is applied to play white, until the winner is determined, and the chessboard endgame is generated one step back, and the winning move coordinates are recorded, and the flag flag=True is assigned. If the element deleted by the filter is an even number or less than 1, the second model is applied to play black first and compete with the first model to play white until a winner is determined. Then, the chess endgame is generated by taking one step back, the coordinates of the winning step are recorded, and flag=True is assigned.
[0044] Step S13: setting the winning move coordinates and a plurality of chess placement positions different from the winning move coordinates in each chess endgame and displaying them for the user to select and verify.
[0045] In the embodiment of the present invention, optionally, multiple chess positions different from the winning move coordinates are randomly selected in the chess endgame and recorded; the chess endgame with the winning move coordinates and multiple chess positions different from the winning move coordinates is displayed in the display interface for the user to select and verify. Figure 2, after determining the winning step coordinates, randomly select 3 other position coordinates at the same time, the electronic device terminal records the coordinates in the background, and randomly assigns values {F1: {f11, f12, f13}, F2: {f21, f22, f23}, F3: {f31, f32, f33}}, where f10≠{f11, f12, f13}, f20≠{f21, f22, f23}, f30≠{f31, f32, f33}, and assigns flag=False. Randomly assign ABCD to the 4 groups of coordinates, and return to the foreground for display after completion. The coordinates with flag=True are the correct positions, and the background records the assigned letters, and the result dictionary is recorded by matching the background. For example Figure 2 Middle: {F1: B, F2: C, F3: A}. The display effect is shown in Figure 2 The embodiment of the present invention effectively solves the current verification code replacement problem through the innovation of style and display, and expands the two-dimensional verification code to a three-dimensional verification code through user operation, making the brute force hard solution of the machine algorithm invalid, increasing the difficulty of cracking and improving security.
[0046] The actual display interface of the electronic device terminal is shown in Figure 2 , the original image, the verification code image, the display area, and multiple filters with missing elements and multiple chessboard endgames corresponding to the filters are displayed on the display interface, and each chessboard endgame is provided with a position corresponding to the winning move coordinates and multiple randomly selected positions different from the winning move coordinates. Figure 2 The ABCD positions in the figure represent multiple chess positions including the winning move coordinates for the user to choose. When the user performs verification, the electronic device terminal obtains the chessboard endgame and chess position selected by the user; determines the filter according to the chessboard endgame and the chess position; applies the filter to filter the original image and obtains a first image, which is compared with the verification code image to complete the verification. The first image obtained after filtering is displayed in the display area. If the first image is consistent with the verification code image, the verification is determined to be successful. If the first image is inconsistent with the verification code image, the verification is determined to be unsuccessful.
[0047] In the embodiment of the present invention, the user selects the convolution (filter) to be used and plays the chess endgame. The user can click Figure 2ABCD in the three chess games, clicks on other positions are invalid. If the electronic device terminal is a mobile phone or a computer, a pop-up window will appear after the user clicks, asking the user whether he is sure. At this time, the display area will also display the image filtering result corresponding to the result selected by the user to guide the user to verify. After the user clicks 'Yes' in the pop-up window, the selected result will be matched with the dictionary {F1: B, F2: C, F3: A}. For example, if the user selects A in F1, that is, F1: A, it is inconsistent with the dictionary F1: B, and the match is unsuccessful. If the match is successful, the selected chess game will continue to be matched with Fx. If they are equal, all verifications will be completed, and if they are not equal, the verification will fail. After the user clicks 'No', the pop-up window disappears, the picture in the display area is cleared, and the user can reselect. Users with relevant image filtering knowledge can directly judge the chessboard endgame that needs to be played based on the first image displayed after filtering and the different filtering forms. Users without relevant image filtering knowledge can also verify through multiple experiments.
[0048] by Figure 2 Taking the simplest mode in as an example, each filter randomly deletes a parameter. The user needs to choose which chess game to play and where the black piece falls in the picture to win in the fastest way. After the user chooses the correct position, the corresponding position will also be filled with the number deleted in the filter. Only the filter elements in the correct position are correct. Taking the chess game on the left as an example, position B is the correct position. After the user makes the correct choice, the filter will be filled with 1, then the first image processed by the filter is consistent with the verification code image, and the image will be displayed in the display area. Obviously, the verification cannot be completed and does not match the background filter. If the filter on the right is selected, position A is the correct position, and the filter will then fill 1 / 9. By displaying the first image after filtering, it is found that it still does not match the filtered image. Finally, the middle chess game is selected, position C is the correct position, and then the filter is filled with the number 2. The first image displayed in the display area is consistent with the filtered verification code image, and the verification is completed. By interacting with users multiple times, the cost and time of machine cracking are improved, and a good anti-brush purpose is achieved. It can be used in many scenarios such as user login and payment.
[0049] In an embodiment of the present invention, the filter size, deleted elements and chess game difficulty can also be adjusted according to different difficulties. If more than one element is deleted from the multiple filters displayed, the user needs to select the correct chess endgame and the corresponding multiple chess positions and winning move coordinates determined by the order. The electronic device terminal obtains the chess endgame selected by the user, as well as multiple chess positions and corresponding chess order in the selected chess endgame that are the same as the number of deleted elements. For example, if the filter deletes three elements, the corresponding chess endgame is as follows: Fig.10As shown, the user needs to complete three moves to win the endgame, and the corresponding winning move coordinates are 1, 3, and W. That is, the user needs to click on the three positions 1, 3, and W in order to complete the verification. The embodiment of the present invention increases the difficulty coefficient of cracking and identification by increasing the number of user operations, which increases the machine processing cost and further improves security.
[0050] The embodiment of the present invention randomly obtains a plurality of different filters, selects any one of the filters as a target filter to filter the original image to obtain a verification code image; randomly deletes at least one element from the plurality of filters, generates chess endgames based on the plurality of filters after the element is deleted, and determines the winning move coordinates corresponding to each chess endgame, the winning move coordinates being the positions of chess pieces corresponding to each retreat step of the chess endgame that retreats at least one step after the chess endgame is determined; the winning move coordinates and a plurality of positions of chess pieces different from the winning move coordinates are set in each chess endgame and displayed for users to select and verify, which can enhance the difficulty coefficient of cracking and identification, increase the cost and time of machine cracking, and improve security.
[0051] Fig.11 FIG. 2 shows a schematic diagram of the structure of a verification code generation device based on image filtering transformation according to an embodiment of the present invention. Fig.11 As shown, the verification code generation device based on image filtering transformation includes: an image acquisition unit 101, a game acquisition unit 102, a position acquisition unit 103 and a verification unit 104. Among them:
[0052] The image acquisition unit 101 is used to randomly acquire multiple different filters, and select any one of the filters as the target filter to filter the original image to obtain a verification code image; the endgame acquisition unit 102 is used to randomly delete at least one element from the multiple filters, and generate chess endgames based on the multiple filters after deleting the elements, and respectively determine the winning move coordinates corresponding to each chess endgame, the winning move coordinates being the chess position corresponding to each retreat step of the chess endgame that retreats at least one step after the chess endgame is determined; the position acquisition unit 103 is used to set the winning move coordinates and multiple chess position positions different from the winning move coordinates in each chess endgame and display them for the user to select and verify.
[0053] In an optional manner, the endgame acquisition unit 102 is used to: obtain a first model and a second model for chessboard simulation; apply the first model and the second model to perform chessboard simulation on each chess game according to the elements deleted by each filter, respectively generate the chessboard endgames, and respectively determine the winning move coordinates corresponding to each chessboard endgame.
[0054] In an optional manner, the endgame acquisition unit 102 is used to: apply self-simulation and Monte Carlo tree search to cyclically train the strategy value network according to the current situation of the input chess game to obtain the probability of placing a piece at each position of the chess game and the situation score; if the loss function calculated based on the probability of placing a piece at each position of the chess game and the situation score meets preset conditions, the first model is obtained; and the second model different from the first model is obtained by applying the same training method based on self-simulation and Monte Carlo tree search with different parameters.
[0055] In an optional manner, the endgame acquisition unit 102 is used to: for each chess game, adjust the characters represented by the first model and the second model to perform chessboard simulation on the chess game according to the type and value of the elements deleted by the filter until a winner is determined, go back at least one step to generate the chess endgame, and record the winning move coordinates corresponding to the chess endgame.
[0056] In an optional manner, the endgame acquisition unit 102 is used to: for multiple filters, randomly delete multiple elements in each filter; generate a multi-move winning chess endgame based on the multiple elements deleted from each filter, and obtain multiple winning move coordinates determined in sequence.
[0057] In an optional manner, the position acquisition unit 103 is used to: randomly select and record multiple chess position placement positions that are different from the winning move coordinates in the chess endgame; and display the chess endgame with the winning move coordinates and multiple chess position placement positions that are different from the winning move coordinates in a display interface for the user to select and verify.
[0058] In an optional manner, the verification unit 104 is used to: obtain the chessboard endgame and chess piece placement selected by the user; determine a filter based on the chess game and the chess piece placement; and compare a first image obtained by filtering the original image using the filter with the verification code image to complete verification.
[0059] The embodiment of the present invention randomly obtains a plurality of different filters, selects any one of the filters as a target filter to filter the original image to obtain a verification code image; randomly deletes at least one element from the plurality of filters, generates chess endgames based on the plurality of filters after the element is deleted, and determines the winning move coordinates corresponding to each chess endgame, the winning move coordinates being the positions of chess pieces corresponding to each retreat step of the chess endgame that retreats at least one step after the chess endgame is determined; the winning move coordinates and a plurality of positions of chess pieces different from the winning move coordinates are set in each chess endgame and displayed for users to select and verify, which can enhance the difficulty coefficient of cracking and identification, increase the cost and time of machine cracking, and improve security.
[0060] An embodiment of the present invention provides a non-volatile computer storage medium, wherein the computer storage medium stores at least one executable instruction, and the computer executable instruction can execute the verification code generation method based on image filtering transformation in any of the above method embodiments.
[0061] The executable instructions may be specifically used to cause the processor to perform the following operations:
[0062] Randomly obtain a plurality of different filters, and select one of the filters as a target filter to filter the original image to obtain a verification code image;
[0063] Randomly delete at least one element from the plurality of filters, generate chess endgames based on the plurality of filters after the elements are deleted, and determine the winning move coordinates corresponding to each chess endgame, the winning move coordinates being the positions of the chess pieces corresponding to each retreat step of the chess endgame that retreats at least one step after the chess endgame is determined;
[0064] In each chess endgame, the winning move coordinates and a plurality of chess move positions different from the winning move coordinates are set and displayed for the user to select and verify.
[0065] In an optional manner, the executable instruction causes the processor to perform the following operations:
[0066] Acquire a first model and a second model for chessboard simulation;
[0067] According to the elements deleted by each filter, the first model and the second model are applied to perform chessboard simulation on each chess game, the chess endgames are generated respectively, and the winning move coordinates corresponding to each chess endgame are determined respectively.
[0068] In an optional manner, the executable instruction causes the processor to perform the following operations:
[0069] Applying self-simulation and Monte Carlo tree search loop training strategy value network according to the current situation of the chess game input, to obtain the probability of placing a piece at each position of the chess game and the situation score;
[0070] If the loss function calculated according to the probability of placing a piece at each position of the chess game and the situation score meets a preset condition, the first model is obtained;
[0071] The second model different from the first model is obtained by applying the same training method based on self-simulation and Monte Carlo tree search with different parameters.
[0072] In an optional manner, the executable instruction causes the processor to perform the following operations:
[0073] For each chess game, according to the type and value of the elements deleted by the filter, the characters represented by the first model and the second model are adjusted to perform chessboard simulation on the chess game until a winner is determined, and the chess endgame is generated by at least one step back, and the winning move coordinates corresponding to the chess endgame are recorded.
[0074] In an optional manner, the executable instruction causes the processor to perform the following operations:
[0075] For a plurality of the filters, randomly deleting a plurality of elements in each of the filters;
[0076] Based on the multiple elements deleted by each of the filters, a multi-move winning chess endgame is generated respectively, and multiple winning move coordinates determined in sequence are obtained.
[0077] In an optional manner, the executable instruction causes the processor to perform the following operations:
[0078] In the chessboard endgame, a plurality of chess-dropping positions different from the winning move coordinates are randomly selected and recorded;
[0079] The chessboard endgame recording the winning move coordinates and multiple chess piece placement positions different from the winning move coordinates is displayed in a display interface for the user to select and verify.
[0080] In an optional manner, the executable instruction causes the processor to perform the following operations:
[0081] Get the chessboard endgame and chess piece placement selected by the user;
[0082] Determine a filter according to the chessboard endgame and the chess piece placement position;
[0083] The verification is completed by comparing a first image obtained by filtering the original image with the verification code image using the filter.
[0084] The embodiment of the present invention randomly obtains a plurality of different filters, selects any one of the filters as a target filter to filter the original image to obtain a verification code image; randomly deletes at least one element from the plurality of filters, generates chess endgames based on the plurality of filters after the element is deleted, and determines the winning move coordinates corresponding to each chess endgame, the winning move coordinates being the positions of chess pieces corresponding to each retreat step of the chess endgame that retreats at least one step after the chess endgame is determined; the winning move coordinates and a plurality of positions of chess pieces different from the winning move coordinates are set in each chess endgame and displayed for users to select and verify, which can enhance the difficulty coefficient of cracking and identification, increase the cost and time of machine cracking, and improve security.
[0085] An embodiment of the present invention provides a computer program product, which includes a computer program stored on a computer storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the verification code generation method based on image filtering transformation in any of the above method embodiments.
[0086] The executable instructions may be specifically used to cause the processor to perform the following operations:
[0087] Randomly obtain a plurality of different filters, and select one of the filters as a target filter to filter the original image to obtain a verification code image;
[0088] Randomly delete at least any element in the plurality of filters, generate chess endgames based on the plurality of filters after the elements are deleted, and determine the winning move coordinates corresponding to each chess endgame, the winning move coordinates being the positions of the chess pieces corresponding to each retreat step of the chess endgame that retreats at least one step after the chess endgame is determined;
[0089] In each chess endgame, the winning move coordinates and a plurality of chess move positions different from the winning move coordinates are set and displayed for the user to select and verify.
[0090] In an optional manner, the executable instruction causes the processor to perform the following operations:
[0091] Acquire a first model and a second model for chessboard simulation;
[0092] According to the elements deleted by each filter, the first model and the second model are applied to perform chessboard simulation on each chess game, the chess endgames are generated respectively, and the winning move coordinates corresponding to each chess endgame are determined respectively.
[0093] In an optional manner, the executable instruction causes the processor to perform the following operations:
[0094] Applying self-simulation and Monte Carlo tree search loop training strategy value network according to the current situation of the chess game input, to obtain the probability of placing a piece at each position of the chess game and the situation score;
[0095] If the loss function calculated according to the probability of placing a piece at each position of the chess game and the situation score meets a preset condition, the first model is obtained;
[0096] The second model different from the first model is obtained by applying the same training method based on self-simulation and Monte Carlo tree search with different parameters.
[0097] In an optional manner, the executable instruction causes the processor to perform the following operations:
[0098] For each chess game, according to the type and value of the elements deleted by the filter, the characters represented by the first model and the second model are adjusted to perform chessboard simulation on the chess game until a winner is determined, and the chess endgame is generated by at least one step back, and the winning move coordinates corresponding to the chess endgame are recorded.
[0099] In an optional manner, the executable instruction causes the processor to perform the following operations:
[0100] For a plurality of the filters, randomly deleting a plurality of elements in each of the filters;
[0101] Based on the multiple elements deleted by each of the filters, a multi-move winning chess endgame is generated respectively, and multiple winning move coordinates determined in sequence are obtained.
[0102] In an optional manner, the executable instruction causes the processor to perform the following operations:
[0103] In the chessboard endgame, a plurality of chess-dropping positions different from the winning move coordinates are randomly selected and recorded;
[0104] The chessboard endgame recording the winning move coordinates and multiple chess piece placement positions different from the winning move coordinates is displayed in a display interface for the user to select and verify.
[0105] In an optional manner, the executable instruction causes the processor to perform the following operations:
[0106] Obtain the chessboard endgame and chess piece placement positions selected by the user;
[0107] Determine a filter according to the chessboard endgame and the chess piece placement position;
[0108] The verification is completed by comparing a first image obtained by filtering the original image with the verification code image using the filter.
[0109] The embodiment of the present invention randomly obtains a plurality of different filters, selects any one of the filters as a target filter to filter the original image to obtain a verification code image; randomly deletes at least one element from the plurality of filters, generates chess endgames based on the plurality of filters after the element is deleted, and determines the winning move coordinates corresponding to each chess endgame, the winning move coordinates being the positions of chess pieces corresponding to each retreat step of the chess endgame that retreats at least one step after the chess endgame is determined; the winning move coordinates and a plurality of positions of chess pieces different from the winning move coordinates are set in each chess endgame and displayed for users to select and verify, which can enhance the difficulty coefficient of cracking and identification, increase the cost and time of machine cracking, and improve security.
[0110] Fig.12 A schematic diagram of the structure of a computing device provided by an embodiment of the present invention is shown, and the specific embodiment of the present invention does not limit the specific implementation of the device.
[0111] like Fig.12 As shown, the computing device may include: a processor (processor) 202 , a communications interface (Communications Interface) 204 , a memory (memory) 206 , and a communication bus 208 .
[0112] The processor 202, the communication interface 204, and the memory 206 communicate with each other via the communication bus 208. The communication interface 204 is used to communicate with other devices such as a client or other server network elements. The processor 202 is used to execute the program 210, which can specifically execute the relevant steps in the embodiment of the verification code generation method based on image filtering transformation.
[0113] Specifically, the program 210 may include program codes, which include computer operation instructions.
[0114] The processor 202 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the device may be processors of the same type, such as one or more CPUs; or may be processors of different types, such as one or more CPUs and one or more ASICs.
[0115] The memory 206 is used to store the program 210. The memory 206 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0116] The program 210 may be specifically configured to enable the processor 202 to perform the following operations:
[0117] Randomly obtain a plurality of different filters, and select one of the filters as a target filter to filter the original image to obtain a verification code image;
[0118] Randomly delete at least one element from the plurality of filters, generate chess endgames based on the plurality of filters after the elements are deleted, and determine the winning move coordinates corresponding to each chess endgame, the winning move coordinates being the positions of the chess pieces corresponding to each retreat step of the chess endgame that retreats at least one step after the chess endgame is determined;
[0119] In each chess endgame, the winning move coordinates and a plurality of chess move positions different from the winning move coordinates are set and displayed for the user to select and verify.
[0120] In an optional manner, the program 210 enables the processor to perform the following operations:
[0121] Acquire a first model and a second model for chessboard simulation;
[0122] According to the elements deleted by each filter, the first model and the second model are applied to perform chessboard simulation on each chess game, the chess endgames are generated respectively, and the winning move coordinates corresponding to each chess endgame are determined respectively.
[0123] In an optional manner, the program 210 enables the processor to perform the following operations:
[0124] Applying self-simulation and Monte Carlo tree search loop training strategy value network according to the current situation of the chess game input, to obtain the probability of placing a piece at each position of the chess game and the situation score;
[0125] If the loss function calculated according to the probability of placing a piece at each position of the chess game and the situation score meets a preset condition, the first model is obtained;
[0126] The second model different from the first model is obtained by applying the same training method based on self-simulation and Monte Carlo tree search with different parameters.
[0127] In an optional manner, the program 210 enables the processor to perform the following operations:
[0128] For each chess game, according to the type and value of the elements deleted by the filter, the characters represented by the first model and the second model are adjusted to perform chessboard simulation on the chess game until a winner is determined, and the chess endgame is generated by at least one step back, and the winning move coordinates corresponding to the chess endgame are recorded.
[0129] In an optional manner, the program 210 enables the processor to perform the following operations:
[0130] For a plurality of the filters, randomly deleting a plurality of elements in each of the filters;
[0131] Based on the multiple elements deleted by each of the filters, a multi-move winning chess endgame is generated respectively, and multiple winning move coordinates determined in sequence are obtained.
[0132] In an optional manner, the program 210 enables the processor to perform the following operations:
[0133] In the chessboard endgame, a plurality of chess-dropping positions different from the winning move coordinates are randomly selected and recorded;
[0134] The chessboard endgame recording the winning move coordinates and multiple chess piece placement positions different from the winning move coordinates is displayed in a display interface for the user to select and verify.
[0135] In an optional manner, the program 210 enables the processor to perform the following operations:
[0136] Obtain the chessboard endgame and chess piece placement positions selected by the user;
[0137] Determine a filter according to the chessboard endgame and the chess piece placement position;
[0138] The verification is completed by comparing a first image obtained by filtering the original image with the verification code image using the filter.
[0139] The embodiment of the present invention randomly obtains a plurality of different filters, selects any one of the filters as a target filter to filter the original image to obtain a verification code image; randomly deletes at least one element from the plurality of filters, generates chess endgames based on the plurality of filters after the element is deleted, and determines the winning move coordinates corresponding to each chess endgame, the winning move coordinates being the positions of chess pieces corresponding to each retreat step of the chess endgame that retreats at least one step after the chess endgame is determined; the winning move coordinates and a plurality of positions of chess pieces different from the winning move coordinates are set in each chess endgame and displayed for users to select and verify, which can enhance the difficulty coefficient of cracking and identification, increase the cost and time of machine cracking, and improve security.
[0140] The algorithm or display provided herein is not inherently related to any particular computer, virtual system or other equipment. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious to construct the structure required for this type of system. In addition, the embodiment of the present invention is not directed to any specific programming language yet. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description made to specific languages above is for disclosing the best mode of the present invention.
[0141] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0142] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the embodiments of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this method of disclosure should not be interpreted as reflecting an intention that the claimed invention requires more features than those expressly recited in each claim.
[0143] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0144] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.
Claims
1. A verification code generation method based on image filtering transformation, characterized in that: The method comprises: Randomly obtain a plurality of different filters, and select one of the filters as a target filter to filter the original image to obtain a verification code image; Randomly deleting at least one element in a plurality of the filters, generating chess endgames based on the plurality of the filters after the elements are deleted, and determining the winning move coordinates corresponding to each chess endgame, including: obtaining a first model for chessboard simulation and a second model different from the first model; for each chess game, adjusting the roles represented by the first model and the second model to perform chessboard simulation on the chess game according to the type and value of the elements deleted by the filter, until a winner is determined, retreating at least one step to generate the chess endgame, and recording the winning move coordinates corresponding to the chess endgame; the winning move coordinates are the positions of the chess pieces corresponding to each retreat step in the chess endgame retreated at least one step after the winner is determined; The winning move coordinates and multiple chess piece placement positions different from the winning move coordinates are set in each chess endgame and displayed for user selection and verification, including: obtaining the chess endgame and chess piece placement positions selected by the user; determining a filter according to the chess endgame and the chess piece placement positions; applying the filter to filter the original image to obtain a first image and compare it with the verification code image to complete verification.
2. The method according to claim 1, characterized in that The step of obtaining a first model for chessboard simulation and a second model different from the first model comprises: Applying self-simulation and Monte Carlo tree search loop training strategy value network according to the current situation of the chess game input, to obtain the probability of placing a piece at each position of the chess game and the situation score; If the loss function calculated according to the probability of placing a piece at each position of the chess game and the situation score meets a preset condition, the first model is obtained; The second model different from the first model is obtained by applying the same training method based on self-simulation and Monte Carlo tree search with different parameters.
3. The method according to claim 1, characterized in that: The step of randomly deleting at least one element from the plurality of filters, generating chess endgames based on the plurality of filters after the element is deleted, and determining the winning move coordinates corresponding to each chess endgame, respectively, includes: For a plurality of the filters, randomly deleting a plurality of elements in each of the filters; Based on the multiple elements deleted by each of the filters, a multi-move winning chess endgame is generated respectively, and multiple winning move coordinates determined in sequence are obtained.
4. The method according to claim 1, characterized in that: In each chessboard endgame, the winning move coordinates and multiple chess move positions different from the winning move coordinates are set and displayed for the user to select and verify, including: In the chessboard endgame, a plurality of chess-dropping positions different from the winning move coordinates are randomly selected and recorded; The chessboard endgame recording the winning move coordinates and multiple chess piece placement positions different from the winning move coordinates is displayed in a display interface for the user to select and verify.
5. A verification code generation device based on image filtering transformation, characterized in that: The device comprises: An image acquisition unit, used for randomly acquiring a plurality of different filters, and selecting one of the filters as a target filter to filter the original image to obtain a verification code image; The endgame acquisition unit is used to randomly delete at least one element from a plurality of the filters, generate chess endgames based on the plurality of filters after the elements are deleted, and respectively determine the winning move coordinates corresponding to each chess endgame, including: obtaining a first model for chessboard simulation and a second model different from the first model; for each chess game, adjusting the roles represented by the first model and the second model to perform chessboard simulation on the chess game according to the type and value of the elements deleted by the filter, until a winner is determined, retreating at least one step to generate the chess endgame, and recording the winning move coordinates corresponding to the chess endgame; the winning move coordinates are the positions of the chess pieces corresponding to each retreat step of the chess endgame retreated at least one step after the winner is determined; A position acquisition unit is used to set the winning move coordinates and multiple chess piece placement positions different from the winning move coordinates in each chess endgame and display them for user selection and verification, including: obtaining the chess endgame and chess piece placement positions selected by the user; determining a filter based on the chess endgame and the chess piece placement positions; applying the filter to filter the original image to obtain a first image and compare it with the verification code image to complete verification.
6. A computing device, characterized in that include: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute the steps of the verification code generation method based on image filtering transformation according to any one of claims 1 to 4.
7. A computer storage medium, characterized in that: The storage medium stores at least one executable instruction, and the executable instruction enables the processor to execute the steps of the verification code generation method based on image filtering transformation according to any one of claims 1 to 4.
