Pressure testing method and device, computer equipment and readable storage medium

By obtaining and optimizing verification code recognition in real time, generating and sending login requests, the existing stress testing methods are solved, and more efficient and accurate stress testing is achieved.

CN119576722APending Publication Date: 2025-03-07CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411706250.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

When simulating high concurrent login scenarios, existing stress testing methods cannot accurately test the load-bearing capacity of the login server in a production environment, resulting in low test accuracy.

Method used

By obtaining the current verification code image in real time, the convolutional neural network is optimized to identify the verification code, a login request is generated, and the verification results are received until the test process is interrupted, which is used to determine the test results.

Benefits of technology

It improves the matching degree between the convolutional neural network and the production environment, speeds up the recognition speed, realizes real-time monitoring of whether the login server can handle high concurrent requests in the production environment, and improves the accuracy of stress testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119576722A_ABST
    Figure CN119576722A_ABST
Patent Text Reader

Abstract

The invention relates to a pressure testing method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: acquiring a current verification code image to be sent in real time; optimizing the convolutional neural network according to a previous verification code image of the current verification code image and a verification result corresponding to the previous verification code image, and performing image recognition on the current verification code image based on the optimized convolutional neural network to obtain a recognition result; sending a login request to a login server according to the identification result, and receiving a verification result corresponding to the current verification code image; and executing the step of acquiring the current verification code image to be sent in real time until the test process is interrupted, and determining a test result according to each verification result. By adopting the method, the accuracy of the pressure testing method can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automated testing technology, and in particular to a stress testing method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] Before releasing an application, you need to test each process in the application to ensure that the application can be used normally. Among them, the user login process is an important process of the application. The user login process needs to be stress tested to ensure that the application can run normally when a large number of users log in concurrently.

[0003] The current stress test method obtains a preset number of concurrent verification code images from a database, and performs image recognition on each verification code image through an adversarial network to obtain each recognition result. Each login request is established according to each recognition result, and each login request is sent to the login server at the same time. The test result is determined according to the operating status of the login server.

[0004] However, the current stress testing method only sends a fixed number of concurrent login requests to the login server in a test environment and cannot accurately test whether the login server can continuously withstand high concurrent requests in a production environment. Therefore, the accuracy of the current stress testing method is low. Summary of the invention

[0005] Based on this, it is necessary to provide a stress testing method, apparatus, computer equipment, computer-readable storage medium and computer program product to address the above technical issues.

[0006] In a first aspect, the present application provides a stress testing method, comprising:

[0007] Obtain the current verification code image to be sent in real time;

[0008] Optimizing a convolutional neural network according to a previous verification code image of the current verification code image and a verification result corresponding to the previous verification code image, and performing image recognition on the current verification code image based on the optimized convolutional neural network to obtain a recognition result;

[0009] Sending a login request to a login server according to the recognition result, and receiving a verification result corresponding to the current verification code image;

[0010] The step of acquiring the current verification code image to be sent in real time is performed until the test process is interrupted, and the test result is determined according to each of the verification results.

[0011] In one embodiment, optimizing the convolutional neural network according to a previous verification code image of the current verification code image and a verification result corresponding to the previous verification code image includes:

[0012] Determining a previous verification code image of the current verification code image in each verification code image, and determining a verification result corresponding to the previous verification code image;

[0013] Based on the gradient descent optimization algorithm, the previous verification code image and the verification result corresponding to the previous verification code image, the width factor and the resolution factor in the convolutional neural network are updated to obtain an optimized convolutional neural network.

[0014] In one embodiment, the performing image recognition on the current verification code image based on the optimized convolutional neural network to obtain a recognition result includes:

[0015] Performing grayscale processing and normalization processing on the current verification code image to obtain a target verification code image;

[0016] Inputting the target verification code image into the optimized convolutional neural network, performing image recognition processing on the target verification code image through the optimized convolutional neural network, and obtaining an initial recognition result;

[0017] The initial recognition result is converted into a character string to obtain a recognition result of the current verification code image.

[0018] In one embodiment, the optimized convolutional neural network includes an optimized resolution factor and an optimized width factor, and the image recognition processing of the target verification code image by the optimized convolutional neural network to obtain an initial recognition result includes:

[0019] Adjusting the resolution of the target verification code image based on the optimized resolution factor to obtain an adjusted target verification code image;

[0020] Performing a standard convolution operation on the adjusted target verification code image through the initial convolution layer in the optimized convolutional neural network to obtain an initial feature map;

[0021] Convolutionally processing the initial feature map based on the optimized width factor and the deep convolutional layer in the optimized convolutional neural network to obtain a feature map;

[0022] The feature map is processed according to the global average pooling layer, the fully connected layer and the output layer in the optimized convolutional neural network to obtain an initial recognition result.

[0023] In one embodiment, before sending a login request to the login server according to the identification result, the method further includes:

[0024] Querying the verification character corresponding to the current verification code image according to the image identifier of the current verification code image;

[0025] In the case where the verification character exists, determining whether the verification character is the same as the recognition result, and obtaining a determination result;

[0026] A verification result corresponding to the current verification code image is determined based on the judgment result.

[0027] In one embodiment, sending a login request to the login server according to the recognition result and receiving a verification result corresponding to the current verification code image includes:

[0028] In the absence of the verification character, constructing a login request based on the recognition result and the current verification code image;

[0029] Sending the login request to the login server; the login request is used to enable the login server to determine the verification result corresponding to the current verification code image;

[0030] Receive a verification result corresponding to the current verification code sent by the login server.

[0031] In a second aspect, the present application also provides a pressure testing device, comprising:

[0032] An acquisition module is used to acquire the current verification code image to be sent in real time;

[0033] an optimization module, configured to optimize a convolutional neural network according to a previous verification code image of the current verification code image and a verification result corresponding to the previous verification code image, and perform image recognition on the current verification code image based on the optimized convolutional neural network to obtain a recognition result;

[0034] A sending module, used to send a login request to a login server according to the recognition result, and receive a verification result corresponding to the current verification code image;

[0035] The execution module is used to execute the step of acquiring the current verification code image to be sent in real time until the test process is interrupted, and determine the test result according to each of the verification results.

[0036] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0037] Obtain the current verification code image to be sent in real time;

[0038] Optimizing a convolutional neural network according to a previous verification code image of the current verification code image and a verification result corresponding to the previous verification code image, and performing image recognition on the current verification code image based on the optimized convolutional neural network to obtain a recognition result;

[0039] Sending a login request to a login server according to the recognition result, and receiving a verification result corresponding to the current verification code image;

[0040] The step of acquiring the current verification code image to be sent in real time is performed until the test process is interrupted, and the test result is determined according to each of the verification results.

[0041] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0042] Obtain the current verification code image to be sent in real time;

[0043] Optimizing a convolutional neural network according to a previous verification code image of the current verification code image and a verification result corresponding to the previous verification code image, and performing image recognition on the current verification code image based on the optimized convolutional neural network to obtain a recognition result;

[0044] Sending a login request to a login server according to the recognition result, and receiving a verification result corresponding to the current verification code image;

[0045] The step of acquiring the current verification code image to be sent in real time is performed until the test process is interrupted, and the test result is determined according to each of the verification results.

[0046] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0047] Obtain the current verification code image to be sent in real time;

[0048] Optimizing a convolutional neural network according to a previous verification code image of the current verification code image and a verification result corresponding to the previous verification code image, and performing image recognition on the current verification code image based on the optimized convolutional neural network to obtain a recognition result;

[0049] Sending a login request to a login server according to the recognition result, and receiving a verification result corresponding to the current verification code image;

[0050] The step of acquiring the current verification code image to be sent in real time is performed until the test process is interrupted, and the test result is determined according to each of the verification results.

[0051] The above stress test method, device, computer equipment, computer-readable storage medium and computer program product obtain the current verification code image to be sent in real time; optimize the convolutional neural network according to the previous verification code image of the current verification code image and the verification result corresponding to the previous verification code image, and perform image recognition on the current verification code image based on the optimized convolutional neural network to obtain the recognition result; send a login request to the login server according to the recognition result, and receive the verification result corresponding to the current verification code image; execute the step of obtaining the current verification code image to be sent in real time until the test process is interrupted, and determine the test result according to each of the verification results. With this method, the convolutional neural network is optimized by the verification result and the verification code image, which improves the matching degree between the convolutional neural network and the production environment and speeds up the recognition speed of the convolutional neural network. In addition, the current verification code image to be sent by the login server is quickly identified based on the optimized convolutional neural network, and the login request is sent based on the recognition result, which realizes real-time monitoring of whether the login server can normally and continuously process high-concurrency login requests in the production environment, and improves the accuracy of the stress test method. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0053] Figure 1 An application environment diagram of a stress testing method in an embodiment;

[0054] Figure 2 A schematic diagram of a pressure testing method according to an embodiment of the present invention;

[0055] Figure 3 A schematic diagram of a process for optimizing a convolutional neural network in one embodiment;

[0056] Figure 4 A schematic diagram of a process for determining a recognition result in one embodiment;

[0057] Figure 5 A schematic diagram of a process for determining an initial recognition result in one embodiment;

[0058] Figure 6 A schematic diagram of a process for determining a verification result in one embodiment;

[0059] Figure 7 A schematic diagram of a flow chart for determining a verification result in another embodiment;

[0060] Figure 8 A schematic diagram of a process of optimizing a convolutional neural network in an embodiment when the verification result is verification failure;

[0061] Fig. 9 is a flow chart of a pressure testing method in an exemplary embodiment;

[0062] Fig.10 is a structural block diagram of a pressure testing device in one embodiment;

[0063] Fig.11 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0064] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0065] The pressure testing method provided in the embodiment of the present application can be applied to Figure 1 In the stress testing system 100 shown. The stress testing system includes a test server 110 and a login server 120. The test server 110 is used to execute the stress testing method. The login server 120 is used to receive a login request sent by a terminal or the test server 110, and return the verification result of the verification code image in the login request. The test server 110 and the login server 120 are connected via a network. The test server 110 or the login server 120 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0066] In an exemplary embodiment, Figure 2 As shown, a stress test method is provided, which is applied to Figure 1 The test server 110 (hereinafter, the reference numeral is omitted, referred to as the test server) in FIG. 1 is used as an example to illustrate the method, which includes the following steps 202 to 208. Among them:

[0067] Step 202: Acquire the current verification code image to be sent in real time.

[0068] In implementation, during the execution of the login process, the login server will send a verification code image to the terminal. The test server obtains the current verification code image to be sent from the login server in real time.

[0069] Specifically, during the user login process, the user sends a request to display the login page to the login server through the terminal. In response to the request to display the login page, the login server obtains the current verification code image and sends the current verification code image to the terminal based on the verification code interface. While the login server sends the current verification code image to the terminal, the test server requests the verification code interface to obtain the current verification code image to be sent by the login server.

[0070] In an exemplary embodiment, a timed interface dialing task is provided in the test server. The test server performs stress testing according to a preset time period. When the test server executes the timed interface dialing task, the test server requests the SMS verification code interface or the email verification code interface of the bound device, and obtains the current verification code image from the SMS verification code interface or the email verification code interface. The bound device is a login server. The test server saves the current verification code image to a local path, and then reads the current verification code image from the local path. The current verification code image is the verification code image in the terminal login scenario of the actual user.

[0071] Optionally, the verification code interface may be, but is not limited to, a login verification code interface, a secondary authentication verification code interface, and a forgotten password verification code interface. The embodiment of the present application does not limit the verification code interface.

[0072] Step 204: optimize the convolutional neural network according to the previous verification code image of the current verification code image and the verification result corresponding to the previous verification code image, and perform image recognition on the current verification code image based on the optimized convolutional neural network to obtain a recognition result.

[0073] Among them, the convolutional neural network is MobileNetV2 (Mobile Network 2, a lightweight convolutional neural network).

[0074] In the implementation, the test server optimizes the convolutional neural network according to the gradient descent algorithm, the previous verification code image of the current verification code image, and the verification result corresponding to the previous verification code image to obtain an optimized convolutional neural network. Then, the test server performs image recognition on the current verification code image through the optimized convolutional neural network to obtain a recognition result. The recognition result is the character sequence information input by the simulated user when logging in.

[0075] Specifically, the test server determines the previous verification code image of the current verification code image in each verification code image. Then, the test server determines the verification result corresponding to the previous verification code image. The test server optimizes the convolutional neural network according to the previous verification code image, the verification result of the previous verification code image, and the gradient descent optimization algorithm to obtain an optimized convolutional neural network. Then, the test server preprocesses the image format and image color of the current verification code image to obtain a target verification code image, and performs image recognition on the target verification code image based on the optimized convolutional neural network recognition to obtain a recognition result.

[0076] Step 206: Send a login request to the login server according to the recognition result, and receive the verification result corresponding to the current verification code image.

[0077] In implementation, the test server sends a login request to the login server based on the current verification code image and the recognition result of the current verification code image, so that the login server determines the verification result corresponding to the current verification code image according to the login request. Then, the test server receives the verification result corresponding to the current verification code image sent by the login server. The verification result represents whether the optimized convolutional neural network correctly recognizes the verification code in the current verification code image. Since the recognition result simulates the character sequence information input by the user when logging in. Therefore, the verification result represents whether the character sequence information input by the user when logging in is correct. If the verification result represents that the character sequence information input by the user is correct, the user passes the verification code verification. If the verification result represents that the character sequence information input by the user is incorrect, the user fails the verification code verification.

[0078] Step 208, executing the step of acquiring the current verification code image to be sent in real time until the test process is interrupted, and determining the test result according to each verification result.

[0079] In implementation, the test server executes the step of obtaining the current verification code to be sent in real time until the test process is interrupted. The step of obtaining the current verification code image to be sent in real time is the above-mentioned step 202. The specific processing process of step 202 has been described in detail in the above-mentioned embodiment, and the embodiment of the present application will not be repeated here. Then, the test server determines the test result according to the number of verification results processed by the login server, the time of the login request processed by the login server, and the number of login requests processed simultaneously by the login server.

[0080] Specifically, there are many situations in which the test is interrupted. For example, the test server crashes, the optimized convolutional neural network cannot recognize the current verification code image, the login server crashes, or the network between the login server and the test server is interrupted. The test server executes the above step 202 until the test process is interrupted. The test server determines the cause of the interruption. If the cause of the interruption is the crash of the login server, the test server constructs the test result of the login server based on the total number of verification results processed by the login server, the time of the login request processed by the login server, the maximum number of login requests processed by the login server at the same time, and the total time of the normal operation of the login server.

[0081] In an optional embodiment, when the test process is interrupted, the test server determines the interruption reason and sends interruption information to the tester's terminal according to the interruption reason. The tester adjusts the login server or the test server based on the interruption information to continue the test process.

[0082] In the above stress testing method, the convolutional neural network is optimized by verifying the results and the verification code image, which improves the matching degree between the convolutional neural network and the production environment and speeds up the recognition speed of the convolutional neural network. In addition, the current verification code image to be sent by the login server is quickly identified based on the optimized convolutional neural network, and a login request is sent based on the recognition result, which realizes real-time monitoring of whether the login server can normally and continuously process high-concurrency login requests in the production environment, and improves the accuracy of the stress testing method.

[0083] In an exemplary embodiment, Figure 3 As shown, the specific processing process of optimizing the convolutional neural network according to the previous verification code image of the current verification code image and the verification result corresponding to the previous verification code image in step 204 includes steps 302 to 304. Among them:

[0084] Step 302: Determine the previous verification code image of the current verification code image in each verification code image, and determine the verification result corresponding to the previous verification code image.

[0085] In implementation, the cache of the test server contains each verification code image and each verification result. The test server obtains the time of each verification code image, and determines the previous verification code image of the current verification code image in each verification code image in the cache. Then, the test server determines the verification result corresponding to the previous verification code image in each verification result according to the image identifier of the previous verification code image.

[0086] Specifically, the test server sorts each verification code image in the order of the acquisition time of each verification code image from the last to the first, and obtains a verification code image sequence. Then, the test server determines the first verification code image in the verification code image sequence as the previous verification code image of the current verification code image. Then, the test server determines the verification result corresponding to the previous verification code image in each cached verification result according to the image identifier of the previous verification code image.

[0087] Step 304, based on the gradient descent optimization algorithm, the previous verification code image and the verification result corresponding to the previous verification code image, update the width factor and the resolution factor in the convolutional neural network to obtain an optimized convolutional neural network.

[0088] In the implementation, the test server determines the loss value according to the preset loss function algorithm and the verification result corresponding to the previous verification code image, and performs data operation on the loss value according to the chain rule to obtain the gradient. Then, the test server updates the width factor and resolution factor in the convolutional neural network according to the gradient and the gradient optimization algorithm to obtain the optimized convolutional neural network. In the optimization process, the test server freezes the parameters of each convolution layer in the convolutional neural network, leaving only the width factor and the resolution factor to change.

[0089] Specifically, if the verification result corresponding to the previous verification code image is verification passed, the test server will determine the recognition result and initial recognition result corresponding to the previous verification code image. Then, the test server performs a loss operation on the recognition result and the initial recognition result according to a preset loss function to obtain a loss value. If the verification result corresponding to the previous verification code image is verification failed, the test server will determine the initial recognition result corresponding to the previous verification code image, and obtain the verification character of the previous verification code image from the login server. Then, the test server performs a loss operation on the verification character and the initial recognition result according to a preset loss function to obtain a loss value.

[0090] In an optional embodiment, an initial convolutional neural network is pre-set in the test server. The test server obtains each sample verification code image from the database, and obtains the sample verification character corresponding to each sample verification code image from the login server. The test server inputs each sample verification code image into the initial convolutional neural network, and performs image recognition on each sample verification code image through the initial convolutional neural network to obtain a sample recognition result. Then, the test server calculates the loss of each sample verification character and each sample recognition result according to the loss function to obtain a sample loss value. The test server determines whether the sample loss value reaches the sample loss threshold. If the sample loss value reaches the sample loss threshold, the test server determines that the initial convolutional neural network meets the training stop condition, and determines the initial convolutional neural network as a convolutional neural network. If the sample loss value does not reach the loss threshold, the test server updates the initial convolutional neural network according to the sample loss value, and executes the step of inputting each sample verification code image into the initial convolutional neural network until the initial convolutional neural network meets the training stop condition.

[0091] Optionally, the loss function may be but is not limited to cross entropy loss, and the gradient descent optimization algorithm may be but is not limited to stochastic gradient descent (SGD) and momentum. The embodiments of the present application do not limit the loss function and the gradient descent optimization algorithm.

[0092] In this embodiment, the width factor and resolution factor in the convolutional neural network are optimized by using the previous verification code image and the verification result corresponding to the previous verification code image, thereby improving the matching degree between the convolutional neural network and the production environment, accelerating the recognition speed of the convolutional neural network, and thereby improving the efficiency of the stress testing method.

[0093] In an exemplary embodiment, Figure 4 As shown, the specific process of performing image recognition on the current verification code image based on the optimized convolutional neural network in step 204 to obtain the recognition result includes steps 402 to 406. Among them:

[0094] Step 402: grayscale and normalize the current verification code image to obtain a target verification code image.

[0095] In the implementation, the test server adjusts the format of the current verification code image according to the preset image format to obtain the current verification code image after the format adjustment. Then, the test server performs grayscale processing on the adjusted current verification code image to obtain a grayscale verification code image. The test server performs normalization processing on the grayscale verification code image according to the normalization algorithm to obtain the target verification code image.

[0096] Specifically, the image format is 224px (pixel) * 224 px. The test server adjusts the current verification code image to a 224px * 224 px image according to the preset image format, and obtains the current verification code image after the format adjustment. Then, the test server converts the adjusted current verification code image into a grayscale verification code image, and linearly maps the pixel value of the grayscale verification code image from the range of [0, 255] to the range of [-1, 1] based on TensorFlow (an open source machine learning framework), and obtains the target verification code image.

[0097] Optionally, the image format may be, but is not limited to, 224px*224px, or 299px*299px. The embodiment of the present application does not limit the image format.

[0098] Optionally, the normalization algorithm may be but is not limited to TensorFlow, and the pixel mapping range may be [-1, 1] or [0, 1]. The embodiment of the present application does not limit the normalization algorithm and the pixel mapping range.

[0099] Step 404: input the target verification code image into the optimized convolutional neural network, perform image recognition processing on the target verification code image through the optimized convolutional neural network, and obtain an initial recognition result.

[0100] During implementation, the test server inputs the target verification code image into the optimized convolutional neural network, performs convolution processing on the target verification code image through the optimized convolutional neural network, and obtains an initial recognition result.

[0101] Specifically, the optimized convolutional neural network is an optimized MobileNetV2. The test server inputs the target verification code into the optimized MobileNetV2, adjusts the resolution of the target verification code image by the resolution factor in the optimized MobileNetV2, and obtains the adjusted target verification code image. Then, the test server performs convolution processing on the adjusted target verification code image by each convolution layer and width factor in the optimized MobileNetV2 to obtain the initial recognition result.

[0102] Step 406: convert the initial recognition result into a character string to obtain the recognition result of the current verification code image.

[0103] In implementation, the test server converts the initial recognition result into a character string to obtain the recognition result of the current verification code image.

[0104] Specifically, the test server decodes the initial recognition result and performs character string conversion to obtain the recognition result of the current verification code image, and the recognition result is a character sequence.

[0105] In this embodiment, the current verification code can be quickly identified through a lightweight and optimized convolutional neural network to obtain a recognition result, thereby ensuring the recognition accuracy of the current verification code image and ensuring the rapid testing of the associated interface, thus realizing a high-recognition and low-latency automated interface dialing solution. Moreover, based on the rapid recognition result, it is possible to monitor in real time in a production environment whether the login server can normally and continuously process high-concurrency login requests, thereby improving the accuracy of the stress testing method.

[0106] In an exemplary embodiment, the optimized convolutional neural network includes an optimized resolution factor and an optimized width factor, such as Figure 5 As shown, the specific process of performing image recognition processing on the target verification code image by using the optimized convolutional neural network in step 404 to obtain the initial recognition result includes steps 502 to 508. Among them:

[0107] Step 502: adjusting the resolution of the target verification code image based on the optimized resolution factor to obtain an adjusted target verification code image.

[0108] In implementation, the test server scales the resolution of the target verification code image by the optimized resolution factor to obtain an adjusted target verification code image.

[0109] Specifically, the optimized resolution factor is ρ. The resolution of the target verification code image is 224px*224px. The test server multiplies the optimized resolution factor and the resolution of the target verification code image to obtain the target resolution. The target resolution is ρ224px*ρ224px. Then, the test server adjusts the resolution of the target verification code image according to the target resolution to obtain the adjusted target verification code image. By adjusting the resolution of the target verification code image according to the optimized resolution factor, the amount of calculation of the optimized convolutional network can be reduced without changing the number of parameters of the optimized convolutional network, thereby speeding up the recognition speed.

[0110] Step 504: Perform a standard convolution operation on the adjusted target verification code image through the initial convolution layer in the optimized convolutional neural network to obtain an initial feature map.

[0111] Among them, the optimized convolutional neural network includes the initial convolution layer, the deep convolution layer, the global average pooling layer, the fully connected layer and the output layer.

[0112] In implementation, the test server performs a standard convolution operation on the adjusted target verification code image through an initial convolution layer to extract basic features in the target verification code image and obtain an initial feature map.

[0113] Specifically, the initial convolution layer includes various convolution kernels. The test server performs standard convolution on the adjusted target verification code image through the various convolution kernels in the initial convolution layer, extracts preliminary features in the target verification code image, and obtains an initial feature map.

[0114] Step 506, convolution processing is performed on the initial feature map based on the optimized width factor and the optimized depth convolution layer in the convolutional neural network to obtain a feature map.

[0115] In implementation, the deep convolution layer includes inverse residual blocks. Each inverse residual block includes channel expansion, deep convolution, and channel contraction operations. The test server performs channel expansion on the initial feature map through each inverse residual block in the deep convolution layer and the optimized width factor to obtain the expanded initial feature map. Then, the test server performs deep convolution on the initial feature map after expansion of each inverse residual block in the deep convolution layer to obtain a spatial feature map. The test server performs channel contraction on the spatial feature map through each inverse residual block in the deep convolution layer and the optimized width factor to obtain a feature map.

[0116] Specifically, each inverse residual block contains a 1*1 expansion layer, a 3*3 deep convolution layer and a 1*1 projection layer. The 1*1 expansion layer and the 1*1 projection layer are essentially convolution layers. The test server performs channel expansion on the initial feature map through the 1*1 expansion layer and the optimized width factor in each inverse residual block to obtain the expanded initial feature map. The optimized width factor can reduce the number of expanded channels, thereby reducing the calculation amount of the 3*3 deep convolution layer and speeding up the processing speed of the optimized convolutional neural network. The test server performs deep convolution on the initial feature map after the expansion of the 3*3 deep convolution layer, and extracts the spatial features of the expanded initial feature map to obtain a spatial feature map. The test server performs channel contraction on the spatial feature map through the 1*1 projection layer and the optimized width factor in each inverse residual block to obtain a feature map. Spatial contraction can reduce the calculation amount of the subsequent global average pooling layer and speed up the processing speed of the optimized convolutional neural network. It should be noted that in the process of channel expansion and channel contraction, the width factor α can be used to adjust the increase or decrease ratio of the channel. For example, if the original number of channels is C and the expansion factor is 6, the number of channels after expansion is 6C; after applying the width factor α, the actual number of expanded channels becomes α*6C. Similarly, α is also applied in the contraction stage to adjust the final number of channels.

[0117] Step 508, performing data processing on the feature map according to the global average pooling layer, the fully connected layer and the output layer in the optimized convolutional neural network to obtain an initial recognition result.

[0118] In the implementation, the test server performs global average pooling on the feature map through the global average pooling layer, thereby converting the two-dimensional feature map into a one-dimensional feature vector to obtain the pooled feature. The test server integrates the pooled features through the fully connected layer, and normalizes the integrated features through the softmax function (normalized exponential function) of the output layer to obtain the output result of the current verification code image.

[0119] In an exemplary embodiment, the optimized convolutional neural network is an optimized MobileNetV2. MobileNetV2 mainly uses deep separable convolution and reverse residual structure to achieve a significant reduction in the number of parameters and the amount of calculation while retaining the accuracy, thereby reducing the latency of image recognition. The amount of calculation is compared with the traditional convolution as a reference.

[0120] Define the size of the target verification code image as:

[0121] (1)

[0122] In the above formula (1), The length and width of the target verification code image. The convolutional layer configuration.

[0123] Taking CNN (Convolutional Neural Networks) as an example, the size of the convolutional layer is defined as:

[0124] (2)

[0125] In the above formula (2), is the size of a single convolutional layer, is the number of channels of the convolutional layer.

[0126] The traditional convolution calculation amount is determined based on the size of the convolution layer and the size of the target verification code image:

[0127] (3)

[0128] In the above formula (3), is the size of a single convolutional layer, is the number of channels of the convolutional layer, The length and width of the target verification code image. The convolutional layer configuration.

[0129] Depthwise convolution is divided into two steps. The first step is to perform a depthwise convolution operation. The test server performs convolution on each channel separately. The second step is to perform a pointwise convolution operation on the entire feature map.

[0130] The Depthwise Convolution operation convolution kernel is defined as:

[0131] (4)

[0132] In the above formula (4), Represents the spatial dimension of the convolution kernel. Represents the number of channels of the input feature map.

[0133] The Pointwise Convolution operation convolution kernel is defined as:

[0134] (5)

[0135] In the above formula (5), represents the depth of the convolution kernel, Indicates the number of channels of the feature map.

[0136] Then the computational cost of depth-wise separable convolution is:

[0137] (6)

[0138] In the above formula (6), Represents the spatial dimension of the input feature map. Where M is the number of input channels and N is the number of output channels. is the spatial dimension of the input feature map.

[0139] Therefore, the difference in computational complexity between depth-wise separable and standard convolution is:

[0140] (7)

[0141] Where, in the above formula (7), N is the number of channels of the output feature map, is the square of the spatial dimension of the convolution kernel.

[0142] Generally speaking, the number of channels (N) is relatively large. If a 3×3 convolution kernel is used, depthwise separable convolution can reduce the amount of computation by about 9 times compared to standard convolution. In addition, in order to achieve the goal of smaller structure and computation, the optimized MobileNetV2 also introduces two parameters - width factor α and resolution factor ρ. The width factor acts on each layer of the uniformly sparse network, multiplying each layer of channels by a certain ratio, thereby reducing the number of channels in each layer. The resolution factor multiplies the size of each layer's feature map by a certain ratio. The resolution factor only affects the amount of computation and does not change the parameter amount, as shown in the following formula:

[0143] (8)

[0144] (9)

[0145] The above formula (8) adds the width factor Formula (9) adds the width factor and resolution factor The computational effort of the subsequent depthwise separable convolution.

[0146] In this embodiment, the optimized convolutional neural network can quickly identify the current verification code and obtain the recognition result, thereby ensuring the recognition accuracy of the current verification code image and ensuring the rapid testing of the associated interface, thus realizing an automated interface dialing solution with high recognition and low latency. In addition, the width factor and resolution factor in the optimized convolutional neural network can reduce the amount of calculation of the convolutional neural network, speed up the calculation speed of the optimized convolutional neural network, and improve the efficiency of the stress testing method.

[0147] In an exemplary embodiment, before sending a login request, it is necessary to first check whether there is a verification character in the cache of the test server. Figure 6 As shown, before step 206 is executed, the specific processing process of the stress test method includes steps 602 to 606. Among them:

[0148] Step 602: query the verification character corresponding to the current verification code image according to the image identifier of the current verification code image.

[0149] In implementation, the test server searches for the verification character corresponding to the current verification code image in the cached verification characters according to the image identifier of the current verification code image. The verification character is the correct recognition result of the current verification code image.

[0150] In an exemplary embodiment, the image identifier is an image ID. The current verification code image is generally a letter image or a digital image with interference. The test server searches for the verification character corresponding to the current verification code image in the cached verification characters based on the ID of the current verification code image. The verification character is js72.

[0151] Step 604: if there is a verification character, determine whether the verification character is the same as the recognition result, and obtain a determination result.

[0152] In implementation, when there is a verification character, the test server determines whether the verification character is identical to a character sequence in the recognition result, and obtains a determination result.

[0153] Specifically, in the case where there is a verification character, the test server can directly verify whether the recognition result is correct. The test server determines that the verification character is the same as the recognition result. If the verification character is the same as the recognition result, the test server determines that the judgment result is the same. If the verification character is different from the recognition result, the test server determines that the judgment result is different.

[0154] In an exemplary embodiment, the verification character is js72. The test server determines whether the recognition result is js72. If the recognition result is js72, the test server determines that the judgment result is the same. If the recognition result is not js72, the test server determines that the judgment result is not the same.

[0155] Step 606: Determine the verification result corresponding to the current verification code image based on the judgment result.

[0156] In implementation, the judgment result includes the same and different. If the judgment result is the same, the test server determines that the verification result corresponding to the current verification code image is a passed verification. If the judgment result is different, the test server determines that the verification result of the current verification code image is a failed verification. In the case of a passed verification result, the test server continues to execute the above step 208. In the case of a failed verification result, the test server executes the following step 802.

[0157] In this embodiment, by querying the verification character of the current verification code image, the verification result of the current verification code image can be directly determined, which speeds up the stress test and improves the efficiency of the stress test method.

[0158] In an exemplary embodiment, Figure 7 As shown, the specific processing process of step 206 includes steps 702 to 706. Among them:

[0159] Step 702: In the absence of a verification character, a login request is constructed based on the recognition result and the current verification code image.

[0160] In implementation, in the absence of a verification character, the test server needs to determine whether the recognition result is correct through the login server. Therefore, the test server constructs a login request for the current verification code image based on the recognition result and the current verification code image.

[0161] Step 704: Send a login request to the login server.

[0162] The login request is used to enable the login server to determine the verification result corresponding to the current verification code image.

[0163] In implementation, the test server sends a login request for the current verification code image to the login server through a network connection. The login server receives the login request for the current verification code image. Then, the login server queries the database for the verification character corresponding to the current verification code image, and determines whether the verification character is the same as the recognition result in the login request, and obtains the verification result corresponding to the current verification code image. Among them, the process of the login server determining the verification result of the current verification code image is the same as the process of the test server determining the verification result of the current verification code image, please refer to the above steps 604 to 606, and the embodiments of the present application will not be repeated here.

[0164] Step 706: Receive the verification result corresponding to the current verification code sent by the login server.

[0165] In implementation, the login server sends the verification result corresponding to the current verification code to the test server. The test server receives the verification result corresponding to the current verification code sent by the login server, and determines whether the verification result is a successful verification. If the verification result is a successful verification, the test server executes the above step 208. If the verification result is a failed verification, the test server executes the above step 802.

[0166] In this embodiment, a login request is sent to the login server based on the identification result, thereby achieving real-time monitoring in a production environment of whether the login server can normally and continuously process high-concurrency login requests, thereby improving the accuracy of the stress testing method.

[0167] In an exemplary embodiment, Figure 8 As shown, after step 206 is executed, the stress testing method further includes:

[0168] Step 802: If the verification result is that the verification fails, the convolutional neural network is optimized according to the current verification code image and the verification result corresponding to the current verification code image.

[0169] In implementation, if the verification result is verification failure, the test server will determine the initial recognition result corresponding to the current verification code image, and obtain the verification character of the current verification code image from the login server. Then, the test server performs a loss operation on the verification character and the initial recognition result according to a preset loss function to obtain a loss value.

[0170] Step 804, performing image recognition on the current verification code image based on the optimized convolutional neural network to obtain a recognition result, until the verification result is verification passed.

[0171] In the implementation, the computer device continues to perform the step of performing image recognition on the current verification code image based on the optimized convolutional neural network to obtain the recognition result in the above step 204 until the verification result is verification passed. The step of performing image recognition on the current verification code image based on the optimized convolutional neural network to obtain the recognition result has been described in detail in the above implementation, and the embodiment of the present application will not be repeated here.

[0172] In this embodiment, when the verification result is verification failure, the convolutional neural network is optimized based on the current verification code image and the verification result corresponding to the current verification code image, and the current verification code image is reprocessed based on the optimized convolutional neural network, so that the optimized convolutional neural network can correctly process the current verification code image and improve the recognition accuracy of the convolutional neural network.

[0173] In an exemplary embodiment, Fig. 9 FIG. 1 is a flow chart of a pressure testing method in an exemplary embodiment. Fig. 9 As shown, the stress testing method includes:

[0174] Step 901, obtain the verification code interface.

[0175] Step 902: Obtain the current verification code image from the verification code interface.

[0176] Step 903: Optimize MobileNetV2 according to the previous verification code image of the current verification code image and the verification result corresponding to the previous verification code image.

[0177] Step 904: grayscale and normalize the current verification code image to obtain a target verification code image.

[0178] Step 905: Perform image recognition on the target verification code image through the optimized MobileNetV2 to obtain an initial recognition result.

[0179] Step 906: convert the initial recognition result into a character string to obtain a recognition result of the verification code image.

[0180] Step 907: Send a login request to the login server according to the recognition result, and receive the verification result corresponding to the current verification code image.

[0181] Among them, MobileNetV2 contains a deep convolution layer, which contains a 1x1 "Expansion" layer ("Expansion" Layer), 3 batch normalizations (Batch Normalizaiton), 2 ReLU6 (an activation function), a 3x3 deep convolution layer (Depthwise Convoluiton) and a 1x1 "Projection" layer ("Projection" Layer).

[0182] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0183] Based on the same inventive concept, the embodiment of the present application also provides a pressure testing device for implementing the pressure testing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more pressure testing device embodiments provided below can refer to the limitations on the pressure testing method above, and will not be repeated here.

[0184] In an exemplary embodiment, Fig.10 As shown, a stress testing device 1000 is provided, comprising: an acquisition module 1001, an optimization module 1002, a sending module 1003 and an execution module 1004, wherein:

[0185] The acquisition module 1001 is used to acquire the current verification code image to be sent in real time.

[0186] The optimization module 1002 is used to optimize the convolutional neural network according to the previous verification code image of the current verification code image and the verification result corresponding to the previous verification code image, and perform image recognition on the current verification code image based on the optimized convolutional neural network to obtain a recognition result.

[0187] The sending module 1003 is used to send a login request to the login server according to the recognition result, and receive the verification result corresponding to the current verification code image.

[0188] The execution module 1004 is used to execute the step of acquiring the current verification code image to be sent in real time until the test process is interrupted, and determine the test result according to each verification result.

[0189] In an exemplary embodiment, the optimization module 1002 includes a first optimization submodule and a first identification submodule. The first optimization submodule includes:

[0190] The first determination submodule is used to determine the previous verification code image of the current verification code image in each verification code image, and determine the verification result corresponding to the previous verification code image.

[0191] The second optimization submodule is used to update the width factor and the resolution factor in the convolutional neural network based on the gradient descent optimization algorithm, the previous verification code image and the verification result corresponding to the previous verification code image to obtain an optimized convolutional neural network.

[0192] In an exemplary embodiment, the optimization module 1002 includes a first optimization submodule and a first identification submodule. The first identification submodule includes:

[0193] The first processing submodule is used to perform grayscale processing and normalization processing on the current verification code image to obtain a target verification code image.

[0194] The second recognition submodule is used to input the target verification code image into the optimized convolutional neural network, perform image recognition processing on the target verification code image through the optimized convolutional neural network, and obtain an initial recognition result.

[0195] The first conversion submodule is used to convert the initial recognition result into a character string to obtain the recognition result of the current verification code image.

[0196] In an exemplary embodiment, the optimized convolutional neural network includes an optimized resolution factor and an optimized width factor, and the second recognition submodule includes:

[0197] The first adjustment submodule is used to adjust the resolution of the target verification code image based on the optimized resolution factor to obtain an adjusted target verification code image.

[0198] The first convolution submodule is used to perform a standard convolution operation on the adjusted target verification code image through the initial convolution layer in the optimized convolutional neural network to obtain an initial feature map.

[0199] The second convolution submodule is used to perform convolution processing on the initial feature map based on the optimized width factor and the optimized deep convolution layer in the convolutional neural network to obtain the feature map.

[0200] The second processing submodule is used to process the feature map according to the global average pooling layer, the fully connected layer and the output layer in the optimized convolutional neural network to obtain the initial recognition result.

[0201] In an exemplary embodiment, the pressure testing device 1000 further includes:

[0202] The query module is used to query the verification character corresponding to the current verification code image according to the image identifier of the current verification code image.

[0203] The judgment module is used to judge whether the verification character and the recognition result are the same when the verification character exists, and obtain a judgment result.

[0204] The determination module is used to determine the verification result corresponding to the current verification code image based on the judgment result.

[0205] In an exemplary embodiment, the sending module 1003 includes:

[0206] The first construction submodule is used to construct a login request based on the recognition result and the current verification code image when there is no verification character.

[0207] The first sending submodule is used to send a login request to the login server; the login request is used to enable the login server to determine the verification result corresponding to the current verification code image.

[0208] The first receiving submodule is used to receive the verification result corresponding to the current verification code sent by the login server.

[0209] Each module in the above-mentioned pressure testing device can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0210] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig.11As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data used for the stress testing method. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a stress testing method is implemented.

[0211] Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0212] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0213] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0214] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0215] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0216] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0217] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A stress testing method, characterized in that: The method comprises: Obtain the current verification code image to be sent in real time; Optimizing a convolutional neural network according to a previous verification code image of the current verification code image and a verification result corresponding to the previous verification code image, and performing image recognition on the current verification code image based on the optimized convolutional neural network to obtain a recognition result; Sending a login request to a login server according to the recognition result, and receiving a verification result corresponding to the current verification code image; The step of acquiring the current verification code image to be sent in real time is performed until the test process is interrupted, and the test result is determined according to each of the verification results.

2. The method according to claim 1, characterized in that: The optimizing the convolutional neural network according to the previous verification code image of the current verification code image and the verification result corresponding to the previous verification code image includes: Determining a previous verification code image of the current verification code image in each verification code image, and determining a verification result corresponding to the previous verification code image; Based on the gradient descent optimization algorithm, the previous verification code image and the verification result corresponding to the previous verification code image, the width factor and the resolution factor in the convolutional neural network are updated to obtain an optimized convolutional neural network.

3. The method according to claim 1, characterized in that: The performing image recognition on the current verification code image based on the optimized convolutional neural network to obtain a recognition result includes: Performing grayscale processing and normalization processing on the current verification code image to obtain a target verification code image; Inputting the target verification code image into the optimized convolutional neural network, performing image recognition processing on the target verification code image through the optimized convolutional neural network, and obtaining an initial recognition result; The initial recognition result is converted into a character string to obtain a recognition result of the current verification code image.

4. The method according to claim 3, characterized in that The optimized convolutional neural network includes an optimized resolution factor and an optimized width factor, and the image recognition processing is performed on the target verification code image by the optimized convolutional neural network to obtain an initial recognition result, including: Adjusting the resolution of the target verification code image based on the optimized resolution factor to obtain an adjusted target verification code image; Performing a standard convolution operation on the adjusted target verification code image through the initial convolution layer in the optimized convolutional neural network to obtain an initial feature map; Convolutionally processing the initial feature map based on the optimized width factor and the deep convolutional layer in the optimized convolutional neural network to obtain a feature map; The feature map is processed according to the global average pooling layer, the fully connected layer and the output layer in the optimized convolutional neural network to obtain an initial recognition result.

5. The method according to claim 1, characterized in that Before sending a login request to the login server according to the identification result, the method further includes: Querying the verification character corresponding to the current verification code image according to the image identifier of the current verification code image; In the case where the verification character exists, determining whether the verification character is the same as the recognition result, and obtaining a determination result; A verification result corresponding to the current verification code image is determined based on the judgment result.

6. The method according to claim 5, characterized in that The sending a login request to the login server according to the recognition result, and receiving a verification result corresponding to the current verification code image, includes: In the absence of the verification character, constructing a login request based on the recognition result and the current verification code image; Sending the login request to the login server; the login request is used to enable the login server to determine the verification result corresponding to the current verification code image; Receive a verification result corresponding to the current verification code sent by the login server.

7. A pressure testing device, characterized in that: The device comprises: An acquisition module is used to acquire the current verification code image to be sent in real time; an optimization module, configured to optimize a convolutional neural network according to a previous verification code image of the current verification code image and a verification result corresponding to the previous verification code image, and perform image recognition on the current verification code image based on the optimized convolutional neural network to obtain a recognition result; A sending module, used to send a login request to a login server according to the recognition result, and receive a verification result corresponding to the current verification code image; The execution module is used to execute the step of acquiring the current verification code image to be sent in real time until the test process is interrupted, and determine the test result according to each of the verification results.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.