Sliding verification method and device, computer equipment and storage medium
By obtaining slider and gap position information, combining distance recursive rules and time generation rules to generate sliding trajectories, the problem of low pass rate of traditional sliding verification is solved and the success rate of sliding verification is improved.
Patent Information
- Application Number
- CN202411242917.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2024-12-20
AI Technical Summary
Traditional automated testing tools only focus on the sliding distance when simulating sliding verification, resulting in the generated sliding trajectory being easily detected by the human-machine verification mechanism as non-real-person behavior, and the sliding verification pass rate is low.
By obtaining the position information of the slider and notch, the target sliding offset is determined, and based on the preset distance recursive rules and time generation rules, a sliding trajectory that is closer to the operating habits of real users, including the sliding distance and time characteristics of each step .
The pass rate of sliding verification is improved, the generated sliding trajectory is closer to the operating habits of real users, and the success rate of sliding verification is enhanced.
Smart Images

Figure CN119166517A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a sliding verification method, device, computer equipment and storage medium. Background Art
[0002] With the development of Internet technology, Internet security is becoming increasingly important. Among them, sliding verification is a common user verification mechanism and is widely used on websites to prevent automated script attacks and robot behavior.
[0003] Software automation testing can improve testing efficiency. In order to realize the full-process automated testing of the website, it is necessary to automate the sliding verification. However, the website sets up a human-machine verification mechanism for sliding verification. When simulating sliding verification, traditional automated testing tools often only focus on the sliding distance, resulting in the generated sliding trajectory being easily detected by the human-machine verification mechanism as non-human behavior, and the sliding verification pass rate is low. Summary of the invention
[0004] The embodiments of the present application provide a sliding verification method, apparatus, computer equipment and storage medium, which can improve the pass rate of sliding verification.
[0005] In a first aspect, an embodiment of the present application provides a sliding verification method, which includes:
[0006] Get the slider position information and gap position information of the current verification page;
[0007] Determine a target sliding offset according to the slider position information and the notch position information;
[0008] Based on a preset distance recursive rule, the sliding distance of each step interval is determined according to a preset target number of sliding steps and the target sliding offset;
[0009] Based on a preset time generation rule, the sliding time of each step interval is determined according to the target number of sliding steps and the preset target sliding time;
[0010] Generate a target sliding trajectory according to the sliding distance and the sliding time between each step interval;
[0011] The slider in the current verification page is moved according to the target sliding track to perform sliding verification.
[0012] In a second aspect, the embodiment of the present application further provides a sliding verification device, which includes:
[0013] The transceiver unit is used to obtain the slider position information and the notch position information of the current verification page;
[0014] A processing unit is used to determine a target sliding offset according to the slider position information and the gap position information; based on a preset distance recursive rule, determine the sliding distance of each step interval according to a preset target sliding step number and the target sliding offset; based on a preset time generation rule, determine the sliding time of each step interval according to the target sliding step number and the preset target sliding time; generate a target sliding trajectory according to the sliding distance and the sliding time of each step interval; move the slider in the current verification page according to the target sliding trajectory to perform sliding verification.
[0015] In a third aspect, an embodiment of the present application further provides a computer device, which includes a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the above method when executing the computer program.
[0016] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the storage medium stores a computer program, wherein the computer program includes program instructions, and wherein the program instructions can implement the above method when executed by a processor.
[0017] The embodiment of the present application provides a sliding verification method, device, computer equipment and storage medium. The method includes: obtaining the slider position information and the notch position information of the current verification page; determining the target sliding offset according to the slider position information and the notch position information; determining the sliding distance of each step interval according to the preset target sliding steps and the target sliding offset based on the preset distance recursive rule; determining the sliding time of each step interval according to the target sliding steps and the preset target sliding time based on the preset time generation rule; generating a target sliding trajectory according to the sliding distance and the sliding time of each step interval; moving the slider in the current verification page according to the target sliding trajectory to perform sliding verification. When generating the sliding trajectory, the embodiment of the present application not only considers the sliding distance of each step, but also integrates the time characteristics of each step sliding, so that the generated sliding trajectory is closer to the operating habits of real users, thereby improving the pass rate of sliding verification. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 A schematic diagram of a flow chart of a sliding verification method provided in an embodiment of the present application;
[0020] Figure 2 A schematic diagram of a sub-process of the sliding verification method provided in an embodiment of the present application;
[0021] Figure 3 A schematic diagram of a sub-process of the sliding verification method provided in an embodiment of the present application;
[0022] Figure 4 A schematic diagram of a sub-process of the sliding verification method provided in an embodiment of the present application;
[0023] Figure 5 A schematic block diagram of a sliding verification device provided in an embodiment of the present application;
[0024] Figure 6 A schematic block diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0026] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0027] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0028] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0029] Embodiments of the present application provide a sliding verification method, apparatus, computer device, and storage medium.
[0030] The executor of the sliding verification method may be the sliding verification device provided in the embodiment of the present application, or a computer device integrating the sliding verification device, wherein the sliding verification device may be implemented in hardware or software, the computer device may be a terminal or a server, and the terminal may be a smart phone, a tablet computer, a PDA, or a laptop computer, etc.
[0031] Figure 1 is a flow chart of the sliding verification method provided in the embodiment of the present application. Figure 1 As shown, the method includes the following steps S110-S160.
[0032] S110, obtaining the slider position information and the notch position information of the current verification page.
[0033] Specifically, Figure 2 As shown, in some embodiments, step S110 is implemented by the following steps:
[0034] S1101, perform a web page request operation on the target website through a preset automated testing tool to enter the current verification page.
[0035] Specifically, the automated testing tool may be a Selenium tool. When an automated test is required on a target website, the automated testing tool first automatically logs in to the target website through a browser, and performs a web page request operation to enter a sliding verification page of the target website, where the sliding verification page is the current verification page.
[0036] S1102. Obtain a target picture combination and the slider position information by analyzing the front-end web page structure of the current verification page, wherein the target picture combination is a first picture combination or a second picture combination, wherein the first picture combination includes a background picture with a gap and a complete background picture, and the second picture combination includes a background picture with a gap and a slider picture.
[0037] Specifically, after entering the current verification page through the automated testing tool, the front-end web page structure of the current verification page is analyzed to obtain the target image combination and the slider position information, wherein the target image combination obtained is different according to different sliding verification settings of the target website.
[0038] The first picture combination is obtained specifically through the following steps:
[0039] First, the complete background image is captured, and then the complete background image as the mask layer is deleted in the web page source code corresponding to the front-end web page structure, and the background image with the gap and the slider is displayed. Then, the slider is hidden in the web page source code, and then the background image with the gap is captured, thereby obtaining the first image combination consisting of the background image with the gap and the complete background image.
[0040] The second picture combination is obtained specifically through the following steps:
[0041] The download link of the background image with a gap and the slider corresponding to the gap is obtained in the source code of the webpage, and the background image with a gap and the slider image are obtained through the download link, so as to obtain the second picture combination.
[0042] S1103: Perform image recognition processing on the target picture combination to obtain the gap position information.
[0043] Specifically, when the target picture combination is the first picture combination, the gap position information is automatically obtained through a preset first gap position recognition method; when the target picture combination is the second picture combination, the gap position information is automatically obtained through a preset second gap position recognition method.
[0044] The first gap position identification method is as follows:
[0045] After obtaining the background image with a gap and the complete background image, the RGB difference of the pixels between the background image with a gap and the complete background image are compared one by one, the first leftmost position where the difference is greater than a predetermined value is obtained, and the position is determined as the position of the gap, thereby obtaining the gap position information.
[0046] The second gap position identification method is as follows:
[0047] Use cv2 to read the notched background image and the slider image, where the slider image is read in grayscale mode, and then use cv2's pyrMeanShiftFiltering method to filter the notched background image to reduce noise, use cv2's Canny method to detect the edges of the notched background image and the slider image, determine the target notched background image and the target slider image inside the edge, and then use cv2's matchTemplate method to match the notch position in the target notched background image with the target slider image (specifically use the normalized correlation coefficient matching method for matching), and finally use cv2's minMaxLoc method to find the maximum matching value (highest matching degree) from the matching results, and determine the position corresponding to the maximum matching value as the notch position, thereby obtaining the notch position information.
[0048] S120: Determine a target sliding offset according to the slider position information and the notch position information.
[0049] Specifically, the distance value between the position of the slider and the position of the notch is determined according to the slider position information and the notch position information, and the distance value is determined as the target sliding offset.
[0050] S130 , based on a preset distance recursive rule, determining a sliding distance of each step interval according to a preset target number of sliding steps and the target sliding offset.
[0051] Among them, the embodiment of the present application can preset multiple sliding steps, and then randomly select a sliding step from the multiple sliding steps as the target sliding step. For example, the preset sliding steps are 1 to 12 steps, and the currently randomly selected target sliding step is 10 steps; or, different sliding step intervals are set for multiple different sliding offset intervals. The larger the sliding offset, the larger the number of steps set in the sliding step interval. At this time, first determine the target sliding offset interval where the target sliding offset is located, and then determine the target sliding step interval corresponding to the target sliding offset interval, and then randomly select a sliding step from the target sliding step interval as the target sliding step.
[0052] After determining the target sliding step number, the target sliding offset is divided into step intervals of the target sliding step number in sequence, and then the sliding distance and sliding time corresponding to each step interval are further determined.
[0053] Specifically, Figure 3 As shown, in some embodiments, step S130 is implemented by the following steps:
[0054] S1301. Determine the step interval closest to the slider as the current step interval.
[0055] For example, when the slider is located on the left side of the gap, the leftmost step interval is determined as the current step interval, and when the slider is located on the right side of the gap, the rightmost step interval is determined as the current step interval.
[0056] S1302: Determine a current average step length according to the target number of sliding steps and the target sliding offset.
[0057] For example, the target sliding step number is count, and the target sliding offset is offset. At this time, the current average step length is
[0058] S1303: Determine a sliding distance corresponding to the current step interval according to the current average step length and a random multiple of the current step length.
[0059] Specifically, the current step length multiple is randomly determined from a preset step length multiple interval; and then the current average step length is multiplied by the current step length multiple to obtain the sliding distance.
[0060] The step multiple interval may be [0.5, 1.5], and the current step multiple is a number randomly determined from the step multiple interval, for example, 1.2.
[0061] S1304: Update the step interval adjacent to the current step interval and with an undetermined sliding distance as the current step interval, and update the current average step length according to the current remaining number of sliding steps and the current remaining sliding offset.
[0062] Specifically, after determining the sliding distance of the current step interval, the sliding distance of the next step interval will be determined. At this time, the step interval adjacent to the current step interval and with an undetermined sliding distance will be updated as the new current step interval, and then the current remaining number of sliding steps and the current remaining sliding offset will be determined, and the current average step length will be updated according to the current remaining number of sliding steps and the current remaining sliding offset.
[0063] The current remaining number of sliding steps is the number of step intervals for which sliding distance calculation has not been performed, and the current remaining sliding offset is the remaining sliding offset after the allocated sliding offset is subtracted from the target sliding offset.
[0064] For example, the current remaining sliding steps are cur-count, and the target sliding offset is cur-offset. At this time, the updated current average step length is
[0065] S1305, determining whether the current step interval is the last step interval among the multiple step intervals, if so, executing step S1306; if not, returning to executing step S1303.
[0066] Specifically, it is determined whether the current remaining sliding step number is 1 step. If so, the current remaining sliding offset is directly set to the sliding distance of the current step interval. At this time, the current remaining sliding offset is the latest calculated current average step length. Otherwise, return to step S1303 to continue calculating the updated sliding offset of the current step interval.
[0067] S1306: Determine the current remaining sliding offset as the sliding distance of the current step interval.
[0068] Specifically, when the current step interval is the last step interval among the multiple step intervals, the current remaining sliding offset is directly determined as the sliding distance of the current step interval.
[0069] S140 , based on a preset time generation rule, determining the sliding time of each step interval according to the target number of sliding steps and a preset target sliding time.
[0070] Among them, the embodiment of the present application can preset multiple sliding time consumptions (total sliding time consumption), and then randomly select a sliding time consumption from the multiple sliding time consumptions as the target sliding time consumption. For example, the preset sliding time consumption is 0.3 to 8 seconds, and the currently randomly selected target sliding time consumption is 3 seconds; or, different sliding time consumption intervals are set for multiple different sliding offset intervals. The larger the sliding offset, the larger the time consumption set in the sliding time consumption interval. At this time, first determine the target sliding offset interval where the target sliding offset is located, and then determine the target sliding time consumption interval corresponding to the target sliding offset interval, and then randomly select a sliding time consumption from the target sliding time consumption interval as the target sliding time consumption.
[0071] Specifically, Figure 4 As shown, in some embodiments, step S140 is implemented by the following steps:
[0072] S1401. Determine a target average time according to the target number of sliding steps and a preset target sliding time.
[0073] For example, the target sliding steps are count, the target sliding duration is total-duration, and the target average time is
[0074] S1402: Randomly determine a corresponding random time multiple for each step interval from a preset time multiple interval.
[0075] For example, the duration multiple interval may be [0.5, 2], and then a random duration multiple is randomly selected from the duration multiple interval for each step interval. For example, if there are 3 step intervals in total, the duration multiples corresponding to each step interval are 0.8, 1.2, and 0.7, respectively.
[0076] S1403: Determine the sliding time corresponding to each of the step intervals according to the target average time and each of the random time multiples.
[0077] Specifically, for each step interval, the target average time is multiplied by the corresponding random time multiple to obtain the sliding time corresponding to the step interval.
[0078] S150: Generate a target sliding trajectory according to the sliding distance and the sliding time between each step interval.
[0079] Specifically, after the corresponding sliding distances and sliding times are generated for the plurality of sequentially ordered step intervals corresponding to the target sliding offset, the corresponding sliding distances and sliding intervals are used as the sliding distances and sliding times corresponding to the corresponding step intervals.
[0080] S160: Move the slider in the current verification page according to the target sliding track to perform sliding verification.
[0081] Specifically, after the target sliding track is generated, the slider in the current verification page will be automatically slid according to the target sliding track to perform slider verification.
[0082] It can be seen that this embodiment, through the fusion of the time dimension, not only considers the change of the spatial distance when generating the sliding trajectory, but also deeply integrates the time characteristics of each sliding step, such as acceleration, deceleration, pause, etc., so that the generated trajectory is closer to the operation habits of real users. Among them, pause means that the sliding distance in a certain step interval is zero, but the sliding time is not zero.
[0083] Furthermore, in some embodiments, after performing the sliding verification, the method further includes:
[0084] Obtain a verification result corresponding to the target sliding trajectory, wherein the verification result includes a verification pass result or a verification fail result; update a new trajectory success rate in a decision library according to the verification result, and when the verification result is a verification pass result, store the target sliding trajectory in a trajectory database.
[0085] Specifically, the decision library dynamically maintains the new trajectory success rate and the reused trajectory success rate, where the new trajectory success rate refers to the success probability of sliding verification using a newly generated trajectory, and the reused trajectory success rate refers to the success probability of sliding verification using a sliding trajectory that has been generated historically and successfully verified.
[0086] Furthermore, this embodiment can determine the new trajectory probability interval and the reused trajectory probability interval according to the new trajectory success rate and the reused trajectory success rate in the decision library, and formulate an efficient reuse strategy through the new trajectory probability interval and the reused trajectory probability interval. Through the efficient reuse strategy, all verified sliding trajectory data can be automatically recorded and saved, including information such as offset, sliding distance and time of each step. When encountering sliding verification with the same offset, it will choose to generate a new trajectory or randomly reuse the historical successful trajectory according to a certain probability ratio, which can effectively improve the pass rate.
[0087] At this time, before determining the sliding distance of each step interval based on the preset distance recursive rule according to the preset target number of sliding steps and the target sliding offset, the method further includes:
[0088] Determine a new trajectory probability interval and a reused trajectory probability interval according to the new trajectory success rate and the reused trajectory success rate in the decision library; generate a random number, and determine a target trajectory interval into which the random number falls, the target trajectory interval being a new trajectory probability interval or a reused trajectory probability interval;
[0089] At this time, the sliding distance of each step interval is determined based on the preset distance recursive rule according to the preset target number of sliding steps and the target sliding offset, including:
[0090] If the target trajectory interval is the new trajectory probability interval, based on the distance recursive rule, the sliding distance of each step interval is determined according to the target sliding step number and the target sliding offset.
[0091] It can be seen that in this embodiment, a new trajectory is generated only when the random number falls into the new trajectory probability interval, otherwise the old trajectory is reused.
[0092] Among them, when the random number falls into the old trajectory probability interval, there is no need to generate a new trajectory. At this time, it is necessary to determine whether the trajectory database contains a target historical sliding trajectory corresponding to the target sliding offset; if the target historical sliding trajectory exists, the slider in the current verification page is moved according to the target historical sliding trajectory to perform sliding verification. In addition, if the trajectory database does not contain a target historical sliding trajectory corresponding to the target sliding offset and with successful historical sliding, a new trajectory needs to be generated.
[0093] After using the historical sliding trajectory for sliding verification, it is also necessary to obtain the reuse verification result corresponding to the historical sliding trajectory, which includes a verification pass result or a verification failure result; and update the reuse trajectory success rate in the decision library according to the reuse verification result.
[0094] It can be seen that this embodiment can automatically record the pass rates of the two operations of generating new trajectories and reusing historical successful trajectories through dynamic probability decision-making, thereby dynamically adjusting the probability ratio of selecting these two operations, which helps to achieve a higher sliding verification pass rate and more stable performance in automated testing.
[0095] In summary, when generating a sliding trajectory, the embodiment of the present application not only considers the sliding distance of each step, but also integrates the time characteristics of each sliding step, so that the generated sliding trajectory is closer to the operating habits of real users, thereby improving the pass rate of sliding verification.
[0096] Figure 5 is a schematic block diagram of a sliding verification device 500 provided in an embodiment of the present application. Figure 5 As shown, corresponding to the above sliding verification method, the present application also provides a sliding verification device 500. The sliding verification device 500 includes a unit for executing the above sliding verification method, and the sliding verification device 500 can be configured in a desktop computer, a tablet computer, a laptop computer, etc. For details, please refer to Figure 5 The sliding verification device 500 includes a transceiver unit 501 and a processing unit 502 .
[0097] The transceiver unit 501 is used to obtain the slider position information and the notch position information of the current verification page;
[0098] Processing unit 502 is used to determine the target sliding offset according to the slider position information and the gap position information; based on a preset distance recursive rule, determine the sliding distance of each step interval according to the preset target sliding steps and the target sliding offset; based on a preset time generation rule, determine the sliding time of each step interval according to the target sliding steps and the preset target sliding time; generate a target sliding trajectory according to the sliding distance and the sliding time of each step interval; move the slider in the current verification page according to the target sliding trajectory to perform sliding verification.
[0099] In some embodiments, when the processing unit 502 executes the preset distance recursive rule and determines the sliding distance step of each step interval according to the preset target number of sliding steps and the target sliding offset, it is specifically used to:
[0100] Determine the step interval closest to the slider as the current step interval; determine the current average step length according to the target sliding step number and the target sliding offset; determine the sliding distance corresponding to the current step interval according to the current average step length and a random multiple of the current step length; update the step interval adjacent to the current step interval and whose sliding distance has not been determined as the current step interval, and update the current average step length according to the current remaining sliding step number and the current remaining sliding offset, and return to execute the step of determining the sliding distance corresponding to the current step interval according to the current average step length and the random multiple of the current step length until the current step interval is the last step interval among the multiple step intervals; if the current step interval is the last step interval among the multiple step intervals, determine the current remaining sliding offset as the sliding distance of the current step interval.
[0101] For example, when the slider is located on the left side of the gap, the leftmost step interval is determined as the current step interval, and when the slider is located on the right side of the gap, the rightmost step interval is determined as the current step interval.
[0102] In some embodiments, when the processing unit 502 executes the preset time generation rule and determines the sliding time step of each step interval according to the target number of sliding steps and the preset target sliding time, it is specifically used to:
[0103] The target average time is determined according to the target number of sliding steps and the preset target sliding time; the corresponding random time multiples are randomly determined for each step interval from the preset time multiple interval; and the sliding time corresponding to each step interval is determined according to the target average time and each random time multiple.
[0104] Specifically, for each step interval, the target average time is multiplied by the corresponding random time multiple to obtain the sliding time corresponding to the step interval.
[0105] In some embodiments, after executing the step of moving the slider in the current verification page according to the target sliding track to perform sliding verification, the processing unit 502 is further configured to:
[0106] The verification result corresponding to the target sliding trajectory is obtained through the transceiver unit 501, and the verification result includes a verification pass result or a verification fail result; the new trajectory success rate in the decision library is updated according to the verification result, and when the verification result is a verification pass result, the target sliding trajectory is stored in the trajectory database.
[0107] In some embodiments, before executing the step of determining the sliding distance of each step interval according to the preset target number of sliding steps and the target sliding offset based on the preset distance recursive rule, the processing unit 502 is further configured to:
[0108] Determine a new trajectory probability interval and a reused trajectory probability interval according to the new trajectory success rate and the reused trajectory success rate in the decision library; generate a random number, and determine a target trajectory interval into which the random number falls, the target trajectory interval being a new trajectory probability interval or a reused trajectory probability interval;
[0109] At this time, when the processing unit 502 executes the preset distance recursive rule and determines the sliding distance step of each step interval according to the preset target sliding step number and the target sliding offset, it is specifically used to:
[0110] If the target trajectory interval is the new trajectory probability interval, based on the distance recursive rule, the sliding distance of each step interval is determined according to the target sliding step number and the target sliding offset.
[0111] In some embodiments, after executing the step of determining the target trajectory interval into which the random number falls, the processing unit 502 is further configured to:
[0112] If the target trajectory interval is the multiplexed trajectory probability interval, determining whether the trajectory database contains a target historical sliding trajectory corresponding to the target sliding offset; if the target historical sliding trajectory exists, moving the slider in the current verification page according to the target historical sliding trajectory to perform sliding verification;
[0113] At this time, when the processing unit 502 executes the preset distance recursive rule and determines the sliding distance step of each step interval according to the preset target sliding step number and the target sliding offset, it is specifically used to:
[0114] If the target historical sliding track does not exist, the sliding distance of each step interval is determined based on the distance recursive rule according to the target sliding step number and the target sliding offset.
[0115] In some embodiments, when executing the step of obtaining the slider position information and the notch position information of the current verification page, the processing unit 502 is specifically configured to:
[0116] A web page request operation is performed on the target website through a preset automated testing tool to enter the current verification page; by analyzing the front-end web page structure of the current verification page, a target picture combination and the slider position information are obtained, the target picture combination is a first picture combination or a second picture combination, the first picture combination includes a background picture with a gap and a complete background picture, the second picture combination includes a background picture with a gap and a slider picture; image recognition processing is performed on the target picture combination to obtain the gap position information.
[0117] Specifically, after entering the current verification page through the automated testing tool, the front-end webpage structure of the current verification page is analyzed to obtain the target picture combination and the slider position information, wherein the target picture combination obtained is different according to different sliding verification settings of the target website. When the target picture combination is the first picture combination, the gap position information is automatically obtained through the preset first gap position recognition method; when the target picture combination is the second picture combination, the gap position information is automatically obtained through the preset second gap position recognition method.
[0118] To sum up, when the sliding verification device 500 provided in the embodiment of the present application is used to generate a sliding trajectory, not only the sliding distance of each step is considered, but also the time characteristics of each sliding step are integrated, so that the generated sliding trajectory is closer to the operating habits of real users, thereby improving the pass rate of sliding verification.
[0119] It should be noted that technicians in the relevant field can clearly understand that the specific implementation process of the above-mentioned sliding verification device and each unit can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and conciseness of the description, it will not be repeated here.
[0120] The above sliding verification device can be implemented in the form of a computer program, which can be used in Figure 6 Runs on the computer device shown.
[0121] See also Figure 6 , Figure 6 600 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 600 can be a terminal or a server, wherein the terminal can be an electronic device with communication functions such as a smart phone, a tablet computer, a laptop computer, a desktop computer, a personal digital assistant, and a wearable device. The server can be an independent server or a server cluster composed of multiple servers.
[0122] See also Figure 6 The computer device 600 includes a processor 602 , a memory and a network interface 605 connected via a system bus 601 , wherein the memory may include a non-volatile storage medium 603 and an internal memory 604 .
[0123] The non-volatile storage medium 603 may store an operating system 6031 and a computer program 6032. The computer program 6032 includes program instructions, and when the program instructions are executed, the processor 602 may perform a sliding verification method.
[0124] The processor 602 is used to provide computing and control capabilities to support the operation of the entire computer device 600 .
[0125] The internal memory 604 provides an environment for the operation of the computer program 6032 in the non-volatile storage medium 603. When the computer program 6032 is executed by the processor 602, the processor 602 can execute a sliding verification method.
[0126] The network interface 605 is used to communicate with other devices over the network. Figure 6 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 600 to which the solution of the present application is applied. The specific computer device 600 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0127] The processor 602 is used to run a computer program 6032 stored in the memory to implement the following steps:
[0128] Get the slider position information and gap position information of the current verification page;
[0129] Determine a target sliding offset according to the slider position information and the notch position information;
[0130] Based on a preset distance recursive rule, the sliding distance of each step interval is determined according to a preset target number of sliding steps and the target sliding offset;
[0131] Based on a preset time generation rule, the sliding time of each step interval is determined according to the target number of sliding steps and the preset target sliding time;
[0132] Generate a target sliding trajectory according to the sliding distance and the sliding time between each step interval;
[0133] The slider in the current verification page is moved according to the target sliding track to perform sliding verification.
[0134] It should be understood that in the embodiment of the present application, the processor 602 may be a central processing unit (CPU), and the processor 602 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0135] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.
[0136] Therefore, the present application also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor, the processor executes the following steps:
[0137] Get the slider position information and gap position information of the current verification page;
[0138] Determine a target sliding offset according to the slider position information and the notch position information;
[0139] Based on a preset distance recursive rule, the sliding distance of each step interval is determined according to a preset target number of sliding steps and the target sliding offset;
[0140] Based on a preset time generation rule, the sliding time of each step interval is determined according to the target number of sliding steps and the preset target sliding time;
[0141] Generate a target sliding trajectory according to the sliding distance and the sliding time between each step interval;
[0142] The slider in the current verification page is moved according to the target sliding track to perform sliding verification.
[0143] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.
[0144] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0145] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0146] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present application can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0147] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.
[0148] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A sliding verification method, characterized in that: include: Get the slider position information and gap position information of the current verification page; Determine a target sliding offset according to the slider position information and the notch position information; Based on a preset distance recursive rule, the sliding distance of each step interval is determined according to a preset target number of sliding steps and the target sliding offset; Based on a preset time generation rule, the sliding time of each step interval is determined according to the target number of sliding steps and the preset target sliding time; Generate a target sliding trajectory according to the sliding distance and the sliding time between each step interval; The slider in the current verification page is moved according to the target sliding track to perform sliding verification.
2. The method according to claim 1, characterized in that: The method of determining the sliding distance of each step interval based on a preset distance recursive rule according to a preset target number of sliding steps and the target sliding offset includes: Determine the step interval closest to the slider as the current step interval; Determine a current average step length according to the target number of sliding steps and the target sliding offset; Determine a sliding distance corresponding to the current step interval according to the current average step length and a random current step length multiple; Updating the step interval adjacent to the current step interval and with an undetermined sliding distance as the current step interval, and updating the current average step length according to the current remaining number of sliding steps and the current remaining sliding offset, and returning to execute the step of determining the sliding distance corresponding to the current step interval according to the current average step length and a random multiple of the current step length, until the current step interval is the last step interval among the multiple step intervals; If the current step interval is the last step interval among the multiple step intervals, the current remaining sliding offset is determined as the sliding distance of the current step interval.
3. The method according to claim 1, characterized in that The method of generating a sliding time for each step interval based on a preset time generation rule and according to the target number of sliding steps and a preset target sliding time consumption includes: Determine the target average time according to the target number of sliding steps and the preset target sliding time; Randomly determine a corresponding random time multiple for each step interval from a preset time multiple interval; The sliding time corresponding to each of the step intervals is determined according to the target average time and each of the random time multiples.
4. The method according to claim 1, characterized in that: After moving the slider in the current verification page according to the target sliding track to perform sliding verification, the method further includes: Obtaining a verification result corresponding to the target sliding track, wherein the verification result includes a verification pass result or a verification fail result; The success rate of the new trajectory in the decision database is updated according to the verification result, and when the verification result is a verification pass result, the target sliding trajectory is stored in the trajectory database.
5. The method according to claim 4, characterized in that Before determining the sliding distance of each step interval based on the preset distance recursive rule and according to the preset target number of sliding steps and the target sliding offset, the method further includes: Determine a new trajectory probability interval and a reused trajectory probability interval according to the new trajectory success rate and the reused trajectory success rate in the decision library; Generate a random number, and determine a target trajectory interval in which the random number falls, wherein the target trajectory interval is a new trajectory probability interval or a reused trajectory probability interval; The method of determining the sliding distance of each step interval based on a preset distance recursive rule according to a preset target number of sliding steps and the target sliding offset includes: If the target trajectory interval is the new trajectory probability interval, based on the distance recursive rule, the sliding distance of each step interval is determined according to the target sliding step number and the target sliding offset.
6. The method according to claim 5, characterized in that After determining the target trajectory interval into which the random number falls, the method further includes: If the target trajectory interval is the multiplexed trajectory probability interval, determining whether a target historical sliding trajectory corresponding to the target sliding offset is stored in the trajectory database; If the target historical sliding track is stored, moving the slider in the current verification page according to the target historical sliding track to perform sliding verification; The method of determining the sliding distance of each step interval based on a preset distance recursive rule according to a preset target number of sliding steps and the target sliding offset includes: If the target historical sliding track does not exist, the sliding distance of each step interval is determined based on the distance recursive rule according to the target sliding step number and the target sliding offset.
7. The method according to claim 1, characterized in that The obtaining of the slider position information and the notch position information of the current verification page includes: Perform a web page request operation on the target website through a preset automated testing tool to enter the current verification page; By analyzing the front-end webpage structure of the current verification page, a target picture combination and the slider position information are obtained, wherein the target picture combination is a first picture combination or a second picture combination, wherein the first picture combination includes a background picture with a gap and a complete background picture, and the second picture combination includes a background picture with a gap and a slider picture; Image recognition processing is performed on the target picture combination to obtain the gap position information.
8. A sliding verification device, characterized in that: include: The transceiver unit is used to obtain the slider position information and the notch position information of the current verification page; A processing unit, configured to determine a target sliding offset according to the slider position information and the notch position information; Based on a preset distance recursive rule, the sliding distance of each step interval is determined according to a preset target number of sliding steps and the target sliding offset; based on a preset time generation rule, the sliding time of each step interval is determined according to the target number of sliding steps and the preset target sliding time; a target sliding trajectory is generated according to the sliding distance and the sliding time of each step interval; and the slider in the current verification page is moved according to the target sliding trajectory to perform sliding verification.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the sliding verification method according to any one of claims 1 to 7 is implemented.
10. A storage medium, characterized in that: The storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor, the processor executes the sliding verification method according to any one of claims 1 to 7.
Citation Information
Cited By
Picture verification code automatic verification method, device and equipment and readable storage medium
CN122153865A
