Front-end page verification method, verification device, equipment and medium
By simulating end-user interaction in the verification server and using a neural network model to identify the front-end page, the problems of low efficiency and accuracy in front-end page verification under agile development are solved, achieving efficient and accurate page display and server response verification.
Patent Information
- Application Number
- CN202210135160.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-14
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2042-02-14
AI Technical Summary
In an agile development environment, the rapid version updates of front-end pages make traditional validation work cumbersome and inefficient, making it difficult to ensure the normal display of front-end pages and the accuracy of server responses.
By simulating end-user interaction with the web server on the verification server, the front-end page is captured and screenshots are taken. The neural network model deployed on the verification server is used to identify whether the page display is normal, and the correctness of the page type and server response is compared by the trained neural network model.
It achieves efficient and accurate front-end page verification, reduces the risk of omissions in manual verification, lowers the workload of operation and maintenance, and can identify page display anomalies and server response errors, thereby improving the reliability and efficiency of verification results.
Smart Images

Figure CN114491488B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the field of artificial intelligence, and more particularly to a front-end page verification method, a verification device, equipment, a medium and a program product. BACKGROUND
[0002] When a user uses an application (for example, browses a website page) in a terminal device, whether the display of the front-end page is normal will directly affect the user experience. If the front-end page deviates, it usually needs to be highly valued, otherwise it may cause serious customer complaints or customer loss. Especially with the popularization of agile development, the version iteration speed is getting faster and faster, and the version update speed of the system front-end page also increases, so the verification work for numerous front-end pages becomes crucial. SUMMARY
[0003] In view of the above problems, the present disclosure provides an efficient front-end page verification method, verification device, equipment, medium and program product.
[0004] In a first aspect of the embodiments of the present disclosure, a front-end page verification method is provided, applied to a verification server. The verification method comprises: simulating a terminal user to initiate N transaction requests to a web server, wherein the N transaction requests are respectively used to request N front-end pages of an application running in the web server, wherein N is an integer greater than or equal to 1; receiving a front-end page returned by the web server in response to each transaction request; performing screenshot processing on each received front-end page to generate a verification picture; and identifying each verification picture based on a neural network model deployed in the verification server to obtain label information of each verification picture, wherein the label information of each verification picture is used to indicate whether the front-end page corresponding to the verification picture is displayed normally.
[0005] According to an embodiment of the present disclosure, the neural network model is trained in the following manner: obtaining pictures of the N front-end pages respectively displayed normally to obtain a normal picture set; obtaining pictures of the N front-end pages respectively displayed abnormally to obtain an abnormal picture set; setting label information based on the type of the front-end page in the picture and the state information of normal display for each picture in the normal picture set, wherein N label information is set in the normal picture set one by one corresponding to the N front-end pages; setting one label information based on the state of abnormal display for the pictures in the abnormal picture set; and training the neural network model using the normal picture set and the abnormal picture set with the set label information, wherein the trained neural network is used to classify any input picture in N+1 categories corresponding to N+1 label information.
[0006] According to an embodiment of the present disclosure, the identifying each of the verification pictures based on the neural network model deployed in the verification server comprises: classifying the verification pictures into one of the N+1 categories by using the neural network model; and taking the label information corresponding to the category into which the verification picture is classified as the label information of the verification picture.
[0007] According to an embodiment of the present disclosure, after the label information of each of the verification pictures is obtained, the method further comprises: in the case that the label information of the verification picture indicates that the front-end page in the verification picture is displayed normally, comparing the type of the front-end page requested in the transaction request corresponding to the verification picture with the type of the front-end page contained in the label information of the verification picture to obtain a comparison result; determining that the response of the web server is correct when the comparison result is consistent; and determining that the response of the web server is incorrect when the comparison result is inconsistent.
[0008] According to an embodiment of the present disclosure, the N front-end pages comprise at least one of the following types: a portal page, a login page, or at least one type of function page.
[0009] According to an embodiment of the present disclosure, the simulating the terminal user to initiate N transaction requests to the web server comprises: receiving a verification request initiated by an operation and maintenance terminal, and sending the N transaction requests to the web server in response to the verification request.
[0010] According to an embodiment of the present disclosure, the neural network model adopts a Resnet residual network model.
[0011] According to another aspect of the embodiments of the present disclosure, a verification device of a front-end page is provided, which is arranged in a verification server. The verification device comprises a simulated transaction initiation module, a picture generation module, and a neural network model. The simulated transaction initiation module is configured to simulate a terminal user to initiate N transaction requests to a web server, wherein the N transaction requests are respectively used to request N front-end pages of an application program running in the web server, and N is an integer greater than or equal to 1. The picture generation module is configured to receive a front-end page returned by the web server in response to each transaction request, and perform screenshot processing on each received front-end page to generate a verification picture. The neural network model is configured to identify each of the verification pictures to obtain label information of each of the verification pictures, wherein the label information of each of the verification pictures is used to indicate whether the front-end page corresponding to the verification picture is displayed normally.
[0012] According to an embodiment of the present disclosure, the device further comprises a training module. The training module is configured to train the neural network model by: obtaining pictures in which the N front-end pages are normally displayed respectively to obtain a normal picture set; obtaining pictures in which the N front-end pages are not normally displayed respectively to obtain an abnormal picture set; setting label information for each picture in the normal picture set based on the type of the front-end page in the picture and the state information of normal display, wherein N label information is set in the normal picture set in one-to-one correspondence with the N front-end pages; setting one label information for the pictures in the abnormal picture set based on the state information of abnormal display; and training the neural network model by using the normal picture set and the abnormal picture set in which the label information is set, wherein the trained neural network is configured to classify an input arbitrary picture into N+1 categories in one-to-one correspondence with N+1 label information.
[0013] According to an embodiment of the present disclosure, the neural network model is configured to classify the verification picture into one of the N+1 categories, and output label information corresponding to the category into which the verification picture is classified, to obtain label information of the verification picture.
[0014] According to an embodiment of the present disclosure, the device further comprises a verification conclusion determination module. The verification conclusion determination module is configured to, in a case where the label information of the verification picture indicates that the front-end page in the verification picture is displayed normally, compare the type of the front-end page requested in the transaction request corresponding to the verification picture with the type of the front-end page included in the label information of the verification picture to obtain a comparison result; determine that the response of the web server is correct when the comparison result is consistent; and determine that the response of the web server is incorrect when the comparison result is inconsistent.
[0015] According to an embodiment of the present disclosure, the device further comprises a terminal interaction module. The terminal interaction module is configured to receive a verification request initiated by an operation and maintenance terminal. The transaction initiation module is further configured to send the N transaction requests to the web server in response to the verification request.
[0016] A third aspect of the embodiments of the present disclosure provides an electronic device. The electronic device comprises one or more processors and one or more memories. The one or more memories are configured to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors are caused to perform the above method.
[0017] A fourth aspect of the embodiments of the present disclosure further provides a computer-readable storage medium having stored executable instructions, which, when executed by a processor, cause the processor to perform the above method.
[0018] A fifth aspect of the embodiments of the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements the above method. BRIEF DESCRIPTION OF DRAWINGS
[0019] The above and other objects, features and advantages of the present disclosure will become more apparent from the following description when taken in conjunction with the accompanying drawings, in which:
[0020] Figure 1 A system architecture applying the front-end page verification method, verification device, equipment, medium and program product according to the embodiments of the present disclosure is schematically shown;
[0021] Figure 2 A flowchart of the front-end page verification method according to the embodiments of the present disclosure is schematically shown;
[0022] Figure 3 A flowchart of training a neural network model in the front-end page verification method according to the embodiments of the present disclosure is schematically shown;
[0023] Figure 4 A structure diagram of a Resnet-50 network used in the front-end page verification method according to an embodiment of the present disclosure is schematically shown;
[0024] Figure 5 A residual learning unit diagram in a Resnet residual network model used in the front-end page verification method according to an embodiment of the present disclosure is schematically shown;
[0025] Figure 6 A flowchart of the front-end page verification method according to another embodiment of the present disclosure is schematically shown;
[0026] Figure 7 A structure block diagram of the front-end page verification device according to the embodiments of the present disclosure is schematically shown; and
[0027] Figure 8 A block diagram of an electronic device suitable for implementing the front-end page verification method according to the embodiments of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0028] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it is to be understood that these descriptions are only exemplary and are not intended to limit the scope of the present disclosure. In the following detailed description, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. However, it will be apparent to those skilled in the art that one or more embodiments can be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted to avoid unnecessarily obscuring the concept of the present disclosure.
[0029] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used herein, the terms "comprises", "comprising", "includes", "including" and the like are, unless otherwise stated, taken to mean the statement that one includes, i.e. at least one, but not excluding others.
[0030] All terms used herein, including technical and scientific terms, have the meanings commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the use of certain terms or phrases in various places in the specification is not intended to exclude those terms or phrases from the scope of the specification, unless otherwise indicated.
[0031] In the case where expressions such as "at least one of A, B, and C, etc." are used, in general, it should be interpreted to mean any one of A, B, or C, etc., or a combination of A, B, and C, etc. (for example, "a system having at least one of A, B, and C" should include a system having A alone, a system having B alone, a system having C alone, a system having A and B together, a system having A and C together, a system having B and C together, and / or a system having A, B, and C together, etc.).
[0032] The embodiments of the present disclosure provide a front-end page verification method, a verification device, equipment, a medium and a program product, which can verify the display of a front-end page provided by a web server to a terminal user. By simulating the interaction between a terminal user and a web server in a verification server, part or all of the front-end page of an application running in the web server is obtained, and then a screenshot of the obtained front-end page is generated to generate a verification picture, and then a neural network model arranged in the verification server is used to identify each verification picture to determine whether the front-end page display is normal. In this way, by separately setting up a verification server to verify the front-end page, the original architecture can be unaffected, and the web server is not intruded, and the verification and application are decoupled. The horizontal expansion of verification is facilitated, and the working state of the web server in the production environment can be more truly restored, so that the verification result is more reliable.
[0033] According to the embodiments of the present disclosure, the front-end page verification is performed by the neural network in the manner of picture recognition, which can simulate artificial vision and determine from the perspective of a terminal user, and the verification efficiency is higher, the missing risk of traditional manual verification can be greatly reduced, and the workload of an operation and maintenance worker is greatly reduced.
[0034] According to some other embodiments of the present disclosure, the label information of the verification icon identified by the neural network model further provides the information of the page type when the verification picture is displayed normally. Thus, when the front-end page is verified, it can be determined not only whether the content of the front-end page is displayed normally, but also whether the front-end page fed back by the web server is correct. That is, it is determined whether the front-end page fed back by the web server is the page requested by the user. In this way, the problem of incorrect response of the web server can be found out.
[0035] It should be noted that the verification method, verification device, equipment, medium and program product of the front-end page determined by the embodiments of the present disclosure can be used in the financial field, and can also be used in any field other than the financial field. The present disclosure does not limit the application field.
[0036] Figure 1 The system architecture 100 to which the verification method, verification device, equipment, medium and program product of the front-end page according to the embodiments of the present disclosure are applied is schematically shown. It should be noted that, Figure 1 The system architecture shown is only an example of the system architecture to which the embodiments of the present disclosure can be applied, to help those skilled in the art understand the technical content of the present disclosure, but does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0037] As Figure 1 The system architecture 100 includes a B / S architecture (Browser / Server Architecture, i.e., browser and server architecture). The B / S architecture includes a plurality of web servers 101 and a plurality of App servers 102. One web server 101 can be in communication connection with one App server 102. The web server 101 is used to specially process HTTP requests and transmit front-end pages to terminal users through the HTTP protocol to be browsed through the browser. The App server 102 processes the background business logic of the application program. In some embodiments, the web server 101 and the App server 102 having a connection relationship can be combined into one server.
[0038] In the system architecture 100, the plurality of web servers 101 and the plurality of App servers 102 constitute a server cluster of an application program, wherein the functions provided by different App servers 102 are the same, and the functions provided by different WEB servers are also the same. The requests from external terminal users are distributed among the plurality of web servers 101 and the corresponding App servers 102 through a load balancing mechanism.
[0039] According to an embodiment of the present disclosure, in order to verify the front-end pages fed back by the web server 101 to the terminal user in the B / S architecture, the system architecture 100 is further provided with at least one verification server 103 (a plurality of verification servers 103 are shown in the figure). Each verification server 103 is in communication connection with at least one web server 101. In Figure 1 each verification server 103 is in communication connection with two web servers 101, wherein the connection of each verification server 103 with the web servers 101 is divided and configured in advance. Each verification server 103 is used to perform verification processing on the front-end pages transmitted in the connected web server 101. According to an embodiment of the present disclosure, a neural network model for image recognition is deployed in the verification server 103.
[0040] According to some embodiments of the present disclosure, the system architecture 100 can further include an operation terminal 104, which is used to control the verification process of the front-end pages and view the verification process. The operation terminal 104 can interact with the verification server 103, for example, trigger the verification server 103 to perform verification on the front-end pages transmitted in the connected web server 101 through user instructions, or view the verification process / verification progress of the verification server 103, or receive the verification result information or error prompt information fed back by the verification server 103, etc.
[0041] The verification method of the front-end pages provided by the embodiment of the present disclosure is executed by the verification server 103. Accordingly, the verification device, apparatus, medium and program product of the front-end pages provided by the embodiment of the present disclosure can be arranged in the verification server 103.
[0042] It should be understood that Figure 1 the types and numbers of terminal devices, networks and servers in may be only illustrative. According to the implementation needs, there can be any number and type of terminal devices, networks and servers.
[0043] The following will describe the verification method of the front-end pages of the embodiment of the present disclosure based on Figure 1 the scenario described by Figures 2-6 .
[0044] Figure 2 The flowchart of the verification method of the front-end pages according to the embodiment of the present disclosure is schematically shown.
[0045] As shown in Figure 2 , the verification method of the front-end pages according to the embodiment can include operation S210 to operation S240. The method is executed by the verification server 103.
[0046] At operation S210, the simulation terminal user initiates N transaction requests to the web server 101, where the N transaction requests are respectively for requesting N front-end pages of an application program running in the web server 101, and N is an integer greater than or equal to 1.
[0047] The N front-end pages can be all front-end pages in the application program running in the web server 101, or can be part of the front-end pages that are updated after version update. The selection and setting of the N transaction requests can be used to determine the N front-end pages.
[0048] The verification server 103 initiates the transaction request in simulation of the terminal user, which can be triggered by a user instruction of the operation terminal 104, can be triggered at a set time of the verification server 103, or can be triggered by a specific condition such as a version update event.
[0049] At operation S220, the front-end page returned by the web server 101 in response to each transaction request is received.
[0050] When verifying multiple front-end pages in the web server 101, due to the large number of pages to be verified, the single verification server 103 can simulate the terminal user to initiate the transaction request to the web server 101 multiple times in turn. After the transaction request enters the web server 101, the corresponding front-end page is called by the web server 101 through a series of interface interactions in response to the transaction request, and the front-end page is finally returned to the verification server 103. In general, if all front-end pages in the application program are to be verified, the transaction request of all front-end pages needs to be initiated to each web server 101 in the system architecture 100.
[0051] At operation S230, a screenshot processing is performed on each received front-end page to generate a verification picture. After receiving the front-end page, the verification server 103 performs the screenshot processing through a script to generate the verification picture.
[0052] At operation S240, each verification picture is identified based on a neural network model deployed in the verification server 103 to obtain label information of each verification picture, where the label information of each verification picture is used to indicate whether the corresponding front-end page of the verification picture is displayed normally. According to an embodiment of the present disclosure, the YOLO (you Only look once) algorithm neural network can be used to realize the automatic verification of the front-end page, simulate the terminal user's perspective, and improve the verification efficiency.
[0053] In some embodiments, after obtaining the label information of the verification picture, the label information can be fed back to the operation terminal 104. In some other embodiments, the label information can be further processed to feed back the verification conclusion information to the operation terminal 104.
[0054] The content of the label information of the verification picture is determined by the annotation of the data set used when training the neural network model.
[0055] When collecting the data set, for each front-end page, the picture of the front-end page displayed normally and the picture of the front-end page displayed abnormally need to be collected. Then, in an embodiment, the picture of the front-end page displayed normally and the picture of the front-end page displayed abnormally can be respectively set with positive and negative labels. Thus, by using the data set of the front-end page to train the neural network model, a binary classification model for the front-end page can be obtained. Similarly, according to the embodiment, N binary classification models can be obtained respectively corresponding to N front-end pages. Thus, in operation S240, the verification picture can be classified and recognized according to the binary classification model corresponding to the front-end page requested in operation S210. In another embodiment, the picture of each front-end page displayed normally can be set with label information based on the type of the front-end page and the state of the front-end page displayed normally, that is, N front-end pages correspond to N label information. And for all the pictures of the front-end page displayed abnormally collected, a label information is uniformly set regardless of the type of the page. Thus, by using all the labeled data sets to train the neural network, the neural network model is actually trained as a multi-classification model. Thus, in operation S240, the neural network model can perform multi-classification recognition on the verification picture and output the label information of the class to which the verification picture belongs.
[0056] Figure 3 A flowchart of training a neural network model in a verification method of a front-end page according to an embodiment of the present disclosure is schematically shown.
[0057] As shown in Figure 3 , the process of training the neural network model according to the embodiment can include operation S311 to operation S330.
[0058] First, the pictures are collected through operation S311 and operation S312.
[0059] Specifically, in operation S311, the pictures of N front-end pages displayed normally are obtained, and a normal picture set is obtained.
[0060] In operation S312, the pictures of N front-end pages displayed abnormally are obtained, and an abnormal picture set is obtained.
[0061] Next, the label information is set through operation S321 and operation S322.
[0062] Specifically, in operation S321, for each picture in the normal picture set, label information is set based on the type of the front-end page in the picture and the state information of normal display. The N front-end pages may, for example, include at least one of the following types: a portal page, a login page, or at least one type of function page. Thus, the N label information is set one-to-one for the N front-end pages.
[0063] In operation S322, for the pictures in the abnormal picture set, one label information is set based on the state of abnormal display. In this way, all pages with abnormal display can be collected into one category without detailed distinction of which type of front-end page.
[0064] Finally, in operation S330, the neural network model is trained using the normal picture set and the abnormal picture set with the set label information. The trained neural network is used to classify an input picture into N+1 categories corresponding to N+1 label information.
[0065] In this way, compared with training a classification model for each front-end page, the training method of the embodiments of the present disclosure can train N front-end pages collectively, simplify the training process, and reduce the training cost.
[0066] During training, the data set formed by mixing the normal picture set and the abnormal picture set can be divided into a training data set and a test data set. The training data set is mainly used for training the neural network, and the test data set is used for testing the training effect of the neural network. The training data set and the test data set can maintain a ratio of, for example, 4:1.
[0067] For example, when performing front-end page verification on a mobile banking application, the various pictures and their label information in the training data set can be as shown in Table 1, and the pictures and their label information in the test data set can be as shown in Table 2.
[0068] Table 1
[0069] Picture Tag information Portal page Portal page normal Login page Login page normal Balance inquiry page Balance inquiry page normal Inquiry of bank page Bank page normal Complaint page Complaint page normal Points exchange page Points exchange page normal Special function page Special function page normal Various pages with masking Page verification abnormal
[0070] Table 2
[0071] Picture Tag information Portal page Portal page normal Login page Login page normal Balance inquiry page Balance inquiry page normal Inquiry of bank page Bank page normal Complaint page Complaint page normal Points exchange page Points exchange page normal Special function page Special function page normal Various pages with masking Page verification abnormal
[0072] Wherein, in obtaining the training data set and the test data set in Table 1 and Table 2, only one correct picture of the portal page, the login page, the balance inquiry page, the inquiry opening bank page, the complaint page, the points exchange page and the special function page can be reserved, and the reserved correct picture can be repeatedly used in the model training process. The various masking pages contain a large amount of masking information relative to the various correct pictures, for example, a large amount of masking information can be added to the correct pictures of various pages, or various possible deletions and modifications can be made. As shown in Table 1 and Table 2, when the labels of the various masking pages are set, the page types are not distinguished, but are uniformly set as "page verification is not normal". When the labels of the various correct pictures are set, they are set as "xx page is normal", thereby covering the information of the page types.
[0073] According to an embodiment of the present disclosure, through the label information marked in Table 1 and Table 2, the neural network model can not only recognize the correct page when the display is normal, but also recognize which type of page is normal.
[0074] It can be seen that, through the training of the neural network, the neural network can recognize the page type of the verification picture when the display is normal when identifying the picture. Therefore, when verifying the front-end page, the comparison between the page type in the label information and the page type of the front-end page requested by the transaction request corresponding to the verification picture can be used to determine whether the front-end page fed back by the web server 101 is correct.
[0075] In one embodiment, the neural network model can specifically adopt a Resnet (Residual Network) residual network model. For example, a Resnet-50 neural network can be adopted, and the robustness of the Resnet-50 neural network can be used to more effectively train the weight values, thereby achieving a more excellent recognition effect.
[0076] Figure 4 The structure diagram of the Resnet-50 network used in the verification method of the front-end page according to an embodiment of the present disclosure is schematically shown.
[0077] In combination Figure 4 , the structure of the Resnet-50 network refers to the VGG19 network, wherein VGG is the abbreviation of Visual Geometry Group, and includes a series of convolutional network models, wherein VGG16-19 can be applied in face recognition and image classification. The Resnet-50 network adds residual units through a short circuit mechanism on the basis of the VGG19 network, thereby optimizing the degradation problem of the deep neural network.
[0078] When the pre-processed picture (e.g., a verification picture) enters the Resnet-50 neural network, a convolution and pooling operation is first performed to obtain a feature map, and then the feature map is subjected to a convolution operation. When the feature map is reduced in size by half after passing through two convolution layers again, the original feature map is subjected to down-sampling processing to make the size consistent with the current feature map, and then the next convolution operation is performed together.
[0079] Through repeated operations as above, the final feature map is input into a fully connected layer, and a recognition result is finally obtained through calculation.
[0080] The Resnet-50 neural network includes convolution layers, pooling layers, residual learning, and fully connected layers. Details are as follows.
[0081] Convolution layer: The convolution used by the Resnet-50 neural network is a 2D convolution, that is, the convolution kernel and the picture maintain the same number of channels, so that the convolution kernel can only be displaced in the x-axis and y-axis of the picture, but not across the channels.
[0082] The verification picture can be pre-processed to have a size of 224*224*3, that is, to be processed into a single-channel picture with 224 pixel points in length and 224 pixel points in width, containing R, G, and B three channels. Then the verification picture enters the convolution layer of the Resnet-50 neural network.
[0083] The first convolution layer can have 64 convolution kernels with a size of 7*7*3. The convolution kernel performs convolution operation on the 224*224*3 picture with a step size of 2. Then, after passing through the convolution layer, a feature map with a size of 112*112*3 can be output, with a total of 64.
[0084] The convolution formula is shown in the following formula (1): where W T represents the transpose matrix of the convolution kernel, x represents the matrix of the convolution kernel, b represents the bias, and the final calculation result is a numerical value.
[0085] f(x)=W T x+b (1)
[0086] Pooling layer: The main function is to reduce the dimension of the feature map, remove redundant information, and compress the feature values. The Resnet-50 network structure can use two common pooling methods for pooling operation: average pooling and maximum pooling.
[0087] Average pooling is to superimpose the pixel values in the pooling region and then average to get a single value. Max pooling is to select the maximum value of the pooling region. Both can achieve good pooling effect.
[0088] When the verification picture passes through the convolution layer, it enters the pooling layer. The first layer of pooling can take a 3*3 size of the pooling region to carry out the maximum pooling. When the displacement step of the pooling region is 2, the size of the feature map after the pooling is 56*56*3.
[0089] Residual learning: To solve the problem of gradient disappearance caused by the increase of network layers in deep network, residual learning mechanism can be introduced. Among them, Figure 5 The residual learning unit in the Resnet residual network model used in the verification method of the front-end page according to an embodiment of the disclosure is schematically shown.
[0090] In combination Figure 5 , when the input is x, the feature learned by the neural network is denoted as H(x), if it is desired to learn the residual F(x) = H(x)-x, then the original learning feature should be F(x)+x. In this way, residual learning is easier than direct learning of original features.
[0091] From a mathematical point of view, the residual unit can be represented by the following formula (2) and formula (3):
[0092] g1=h(x l )+F(x l ,W l ) (2)
[0093] x l+1 =f(g l ) (3)
[0094] In the above formula, x l and x l+1 represent the input and output of the lth residual unit respectively,
[0095] where F is the residual function, which represents the learned residual,
[0096] h(x) represents the function of the identity mapping, h(x) = x l ,
[0097] f represents the ReLU activation function.
[0098] Through the above formula (2) and (3), the learning features from the shallow layer l to the deep layer L can be obtained as shown in formula (4):
[0099]
[0100] Thus, by calculating the gradient of the back propagation process, it can be known that, due to another residual gradient, the gradient is not directly passed through the layer with weights, so it will not cause the gradient disappearance phenomenon.
[0101] Fully connected layer: the fully connected layer plays a role of "classifier" in the deep neural network. The fully connected layer can map the distributed feature representation obtained by the convolution and pooling layer to the sample space, and then calculate the score value of each sample corresponding to the picture through the softmax classifier. The label with the highest score value is the recognition result.
[0102] In the training of the neural network model, the model parameters are updated based on back propagation. The principle of back propagation is that back propagation is introduced after the forward propagation process. Back propagation mainly includes three steps.
[0103] First, the overall error error L is calculated using the loss function.
[0104] Second, update the weight from the hidden layer to the output layer, for example, the weight w1. According to the chain rule, the influence of w1 on the overall error can be determined by calculating the partial derivative of the overall error with respect to w1. Then the updated value of w1 can be determined using the gradient descent algorithm as shown in equation (5).
[0105]
[0106] Third, update the weight from the hidden layer to the hidden layer. This step is similar to the second step, and the updated weight is determined by the partial derivative and the gradient descent method, so as to achieve the learning effect.
[0107] Figure 6 A flowchart of a verification method of a front-end page according to another embodiment of the present disclosure is schematically shown.
[0108] As Figure 6 shown, the verification method of the front-end page according to the embodiment can include operations S611-S612, operations S220-S240, and operations S651-S654.
[0109] First, in operation S611, a verification request initiated by the operation and maintenance terminal 104 is received.
[0110] Then, in operation S612, in response to the verification request, the terminal user simulates sending N transaction requests to the web server 101.
[0111] For example, the operation and maintenance personnel can access the verification program deployed in the verification server 103 through a webpage in the operation and maintenance terminal 104. The verification program in the verification server 103 can provide a verification interface to the operation and maintenance terminal 104. When the operation and maintenance personnel initiates a verification request, the verification server 103 receives the request. After receiving the verification request of the operation and maintenance terminal 104, the verification server 103 can simulate the terminal user to initiate N transaction requests through an internally deployed script for N times.
[0112] Next, through operations S220 to operation S240, the verification server 103 receives the front-end page from the web server 101 and obtains the verification picture after taking a screenshot, and then uses the neural network model to identify the verification picture to obtain the label information. Operations S220 to operation S240 are consistent with the foregoing description and will not be repeated here.
[0113] When the neural network model is trained according to the training process shown in FIG. 8, the label information of each verification picture identified in operation S240 can be that the page is displayed abnormally or that a certain type of page is displayed normally. Figure 3
[0114] Next, it can be determined in operation S651 whether the label information of the verification picture identified by the neural network model indicates that the page is normal. If not, the label information is that the page is displayed abnormally, and in this case, it can be determined in operation S664 that the verification result is that the front-end page is displayed abnormally. If yes, it can be further determined through operation S652.
[0115] Specifically, in operation S652, when the label information of the verification picture is displayed normally, whether the type of the front-end page requested by the transaction request corresponding to the verification picture is consistent with the type of the page contained in the label information of the verification picture? If not, it means that the response of the web server 101 is wrong. For example, the transaction request is to request a login page, but the web server 101 returns a portal page for the transaction request. When this situation occurs, it means that the web server 101 responds incorrectly, so that the front-end page is determined to be displayed abnormally in operation S654. If consistent, it means that not only the content of the front-end page is displayed normally, but also the response of the web server 101 is correct, so that in this case, the page is finally determined to be displayed normally in operation S653. It can be seen that through the determination of operation S652, the problem that the page picture is displayed normally but the response of the web server 101 is wrong can be avoided
[0116] It can be seen that according to the embodiments of the present disclosure, the display of the front-end page can be confirmed to be normal only when the display content of the front-end page is normal and consistent with the requested page type. The vulnerability that cannot be found by verification because the web server 101 calls an incorrect page when responding to a transaction request is effectively prevented.
[0117] According to some other embodiments of the present disclosure, after determining that the display of the front-end page is not normal in operation S654, the reason for the abnormal display can be fed back to the operation and maintenance terminal 104. For example, it can be informed to the operation and maintenance terminal 104 that the abnormal display of the front-end page is because the page is interfered and obscured, or the abnormal display of the front-end page is because the web server responds incorrectly. In this way, the operation and maintenance personnel and the developers can be helped to more accurately troubleshoot the problem.
[0118] The front-end page verification method of the embodiments of the present disclosure can verify all the front-end pages in each web server 101 of the application before the application provides services to the terminal user. For example, assuming that an application has 10 pages after version update and before the application is formally put into use, the 10 pages requested from each web server 101 are verified respectively to determine whether they are normal. In this way, it can be ensured that each page transmitted from any one web server 101 when the application is formally put into use is normal and correct.
[0119] According to the embodiments of the present disclosure, the verification efficiency of the front-end page can be effectively improved through the automatic image recognition of the neural network model. And by separately setting the verification server 103 to perform the front-end page verification, the intrusion to the original architecture of the application is reduced or even avoided, the verification and the application are decoupled, and the verification environment of the front-end page of the application and the real use environment are basically consistent, which improves the credibility of the verification result of the front-end page.
[0120] Based on the front-end page verification method of each of the above embodiments, the embodiments of the present disclosure further provide a front-end page verification device. The following will be described in detail in combination with Figure 7 The device will be described in detail.
[0121] Figure 7 The structure block diagram of the front-end page verification device 700 according to the embodiments of the present disclosure is schematically shown. The verification device 700 can be arranged in the verification server 103.
[0122] As Figure 7As shown, according to some embodiments of the present disclosure, the verification device 700 can include a simulated transaction initiation module 710, a picture generation module 720, and a neural network model 730. According to some other embodiments of the present disclosure, the verification device 700 can further include at least one of a training module 740, a verification conclusion determination module 750, or a terminal interaction module 760. The verification device 700 can be configured to perform the method described in the foregoing Figures 2-6 .
[0123] The simulated transaction initiation module 710 is configured to simulate a terminal user to initiate N transaction requests to the web server 101, where the N transaction requests are respectively for requesting N front-end pages of an application running in the web server 101, and N is an integer greater than or equal to 1. In one embodiment, the simulated transaction initiation module 710 can be configured to perform the operation S210 described in the foregoing.
[0124] The picture generation module 720 is configured to receive the front-end pages returned by the web server 101 in response to each transaction request, and perform screenshot processing on each received front-end page to generate a verification picture. In one embodiment, the picture generation module 720 can be configured to perform the operation S220 and the operation S230 described in the foregoing.
[0125] The neural network model 730 is configured to identify each verification picture to obtain label information of each verification picture, where the label information of each verification picture is used to indicate whether the front-end page corresponding to the verification picture is displayed normally. In one embodiment, the neural network model 730 can be configured to perform the operation S240 described in the foregoing.
[0126] The training module 740 is configured to train the neural network model 730 by the following manner, including: obtaining pictures of N front-end pages respectively displayed normally to obtain a normal picture set; obtaining pictures of the N front-end pages respectively displayed abnormally to obtain an abnormal picture set; setting label information for each picture in the normal picture set based on a page type in the picture and state information of normal display; setting uniform label information for the pictures in the abnormal picture set based on state information of abnormal display; and training the neural network model 730 by using the normal picture set and the abnormal picture set with the set label information. In one embodiment, the training module 740 can be configured to perform the training process described in the foregoing Figure 3 .
[0127] The verification conclusion determination module 750 is configured to, after obtaining the label information of each verification picture, determine the display state of the front-end page corresponding to the verification picture based on a comparison between the page type requested by the transaction request corresponding to the verification picture and the page type contained in the label information of the verification picture when the label information of the verification picture contains the page type. In an embodiment, the verification conclusion determination module 750 can be configured to perform the operation S651-S654 described above.
[0128] The terminal interaction module 760 is configured to receive a verification request initiated by the operation and maintenance terminal 104. The simulated transaction initiation module 710 is further configured to send the N transaction requests to the web server 101 in response to the verification request. In an embodiment, the terminal interaction module 760 can be configured to perform the operation S611 described above. Accordingly, the simulated transaction initiation module 710 can be configured to perform the operation S612 described above.
[0129] According to an embodiment of the present disclosure, any of the simulated transaction initiation module 710, the picture generation module 720, the neural network model 730, the training module 740, the verification conclusion determination module 750, or the terminal interaction module 760 can be combined in one module, or any of the modules can be split into multiple modules. Alternatively, at least part of the function of one or more of the modules can be combined with at least part of the function of the other modules, and implemented in one module. According to an embodiment of the present disclosure, at least one of the simulated transaction initiation module 710, the picture generation module 720, the neural network model 730, the training module 740, the verification conclusion determination module 750, or the terminal interaction module 760 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on board, a system on package, an application specific integrated circuit (ASIC), or any other reasonable manner of integrating or packaging a circuit, etc. hardware or firmware, or in any one of software, hardware, and firmware or in any appropriate combination of any of them. Alternatively, at least one of the simulated transaction initiation module 710, the picture generation module 720, the neural network model 730, the training module 740, the verification conclusion determination module 750, or the terminal interaction module 760 can be at least partially implemented as a computer program module which can perform the corresponding function when the computer program module is run.
[0130] Figure 8 A block diagram of an electronic device 800 suitable for implementing the method of verifying a front-end page according to an embodiment of the present disclosure is schematically shown. The electronic device 800 can be disposed in the verification server 103.
[0131] As Figure 8As shown, an electronic device 800 according to an embodiment of this disclosure includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage portion 808 into a random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this disclosure.
[0132] RAM 803 stores various programs and data required for the operation of electronic device 800. Processor 801, ROM 802, and RAM 803 are interconnected via bus 804. Processor 801 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 802 and / or RAM 803. It should be noted that the programs may also be stored in one or more memories other than ROM 802 and RAM 803. Processor 801 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.
[0133] According to embodiments of this disclosure, the electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to a bus 804. The electronic device 800 may also include one or more of the following components connected to the I / O interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 810 as needed so that computer programs read from it can be installed into the storage section 808 as needed.
[0134] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.
[0135] According to an embodiment of the present disclosure, the computer readable storage medium can be a nonvolatile computer readable storage medium, for example, can include, but is not limited to, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any appropriate combination thereof. In the present disclosure, the computer readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present disclosure, the computer readable storage medium can include the ROM 802 and / or the RAM 803 described above and / or one or more memory other than the ROM 802 and the RAM 803.
[0136] Embodiments of the present disclosure also include a computer program product that includes a computer program containing program codes for executing the methods shown in the flowcharts. When the computer program product is run in a computer system, the program codes are used to make the computer system implement the methods provided by the embodiments of the present disclosure.
[0137] The above-described functions defined in the system / device of the embodiments of the present disclosure are performed when the computer program is executed by the processor 801. According to an embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by computer program modules.
[0138] In one embodiment, the computer program can rely on a tangible storage medium such as an optical storage device, a magnetic storage device, etc. In another embodiment, the computer program can also be transmitted, distributed, and downloaded in the form of a signal on a network medium. The computer program containing program codes can be transmitted by any appropriate network medium, including but not limited to wireless, wired, etc., or any appropriate combination thereof.
[0139] In such an embodiment, the computer program can be downloaded and installed from the network by the communication part 809 and / or installed from the detachable medium 811. When the computer program is executed by the processor 801, the above-described functions defined in the system of the embodiments of the present disclosure are performed. According to an embodiment of the present disclosure, the system, device, apparatus, module, unit, etc. described above can be implemented by computer program modules.
[0140] According to embodiments of the present disclosure, program code of the computer program for performing the methods provided by the embodiments of the present disclosure can be written in any combination of one or more programming languages, and can be implemented in a computer program product. Specifically, the computer program can be implemented in a high-level procedural and / or object-oriented programming language, and / or in assembly / machine language. The programming language includes, but is not limited to, Java, C++, python, “C” language, or similar programming languages. The program code can execute entirely on the user's computing device, partly on the user's device, and partly on a remote computing device, or entirely on the remote computing device or server. In the latter scenario, the remote computing device can be connected to the user's computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computing device, such as through the Internet using an Internet Service Provider (ISP).
[0141] The computer program product of the present disclosure can be a computer program product, which is a machine-readable medium (or computer readable medium) having stored therein a sequence of instructions readable by a machine (e.g., a computer). The instructions in the machine-readable medium focus on the function of the computer program (e.g., in the form of a computer program product). The instructions can be executed by one or more processors to produce a computer-implemented process, such as the one(s) described above. The instructions can be stored in a computer memory, which can be a single memory or spread out over multiple memories. The machine-readable medium can be a magnetic or optical disk, a magnetic tape, a semiconductor memory, a computer disk, or any other suitable medium. The machine-readable medium can be loaded into the computer memory, or the computer memory can access the machine-readable medium through a connection, such as a communication network. The instructions represent examples of the program code means adapted to carry out the steps of the disclosed methods.
[0142] Those skilled in the art will understand that features of the various embodiments and / or claims of the present disclosure can be combined or / and integrated with one another, even though such a combination or integration is not expressly disclosed in the present disclosure. In particular, the features of the various embodiments and / or claims of the present disclosure can be combined or / and integrated with one another in any combination, without departing from the spirit and scope of the present disclosure. All such combinations and / or integrations are within the scope of the present disclosure.
[0143] The above describes embodiments of the present disclosure. However, these embodiments are merely for illustrative purposes, and are not intended to limit the scope of the present disclosure. Although each embodiment is described above separately, this does not mean that the measures in each embodiment cannot be used advantageously in combination. The scope of the present disclosure is defined by the appended claims and their equivalents. Those skilled in the art can make various substitutions and modifications without departing from the scope of the present disclosure, and these substitutions and modifications should all fall within the scope of the present disclosure.
Claims
1. A method for verifying front-end pages, applied to a verification server, comprising: triggering a simulated end user to initiate N transaction requests to a web server by a version update event, wherein the N transaction requests are respectively for requesting N front-end pages of an application running in the web server, the N front-end pages being front-end pages that are updated in the version update event, wherein N is an integer greater than or equal to 1; receiving a front-end page returned by the web server in response to each of the N transaction requests; taking a screenshot of each of the received front-end pages to generate a verification picture; and identifying each of the verification pictures based on a neural network model deployed in the verification server to obtain label information of each of the verification pictures, wherein the label information of each of the verification pictures is used to indicate whether the front-end page corresponding to the verification picture is displayed normally, and the label information indicating normal display further provides page type information; in the case that the label information of the verification picture indicates that the front-end page in the verification picture is displayed normally, comparing the type of the front-end page requested in the transaction request corresponding to the verification picture with the type of the front-end page contained in the label information of the verification picture to obtain a comparison result; when the comparison result is consistent, determining that the response of the web server is correct; and when the comparison result is inconsistent, determining that the response of the web server is incorrect.
2. The method of claim 1, wherein, The neural network model is trained in the following manner: obtaining pictures of the N front-end pages respectively displayed normally to obtain a normal picture set; obtaining pictures of the N front-end pages respectively displayed abnormally to obtain an abnormal picture set; setting label information based on the type of the front-end page in each picture in the normal picture set and the state information of normal display, wherein N label information is set in the normal picture set one-to-one corresponding to the N front-end pages; uniformly setting one label information based on the state information of abnormal display for the pictures in the abnormal picture set; and training the neural network model using the normal picture set and the abnormal picture set with the set label information, wherein the trained neural network is used to classify any input picture into N+1 categories one-to-one corresponding to N+1 label information.
3. The method of claim 2, wherein, The identification of each of the verification pictures based on the neural network model deployed in the verification server to obtain label information of each of the verification pictures comprises: classifying the verification picture into one of the N+1 categories using the neural network model; and taking the label information corresponding to the category into which the verification picture is classified as the label information of the verification picture.
4. The method according to any one of claims 1 to 3, wherein, The N front-end pages comprise at least one of the following types: a portal page, or at least one type of function page.
5. The method according to any one of claims 1 to 3, wherein The simulated end user initiating N transaction requests to the web server comprises: receiving a verification request initiated by an operation and maintenance terminal, and sending the N transaction requests to the web server in response to the verification request.
6. The method of any one of claims 1-3, wherein, The neural network model adopts a Resnet residual network model. 7.A front-end page verification apparatus, arranged in a verification server, comprising: a simulated transaction initiation module configured to initiate N transaction requests from a simulated end user to a web server triggered by a version update event, wherein the N transaction requests are respectively for requesting N front-end pages of an application program running in the web server, and the N front-end pages are front-end pages that are updated in the version update event, wherein N is an integer greater than or equal to 1; a picture generation module configured to receive front-end pages returned by the web server in response to each of the N transaction requests, and perform screenshot processing on each of the received front-end pages to generate a verification picture; and a neural network model configured to: identify each of the verification pictures to obtain label information of each of the verification pictures, wherein the label information of each of the verification pictures is used to indicate whether the front-end page corresponding to the verification picture is displayed normally, and the label information indicating normal display further provides page type information; and in a case where the label information of the verification picture indicates that the front-end page in the verification picture is displayed normally, compare the type of the front-end page requested in the transaction request corresponding to the verification picture with the type of the front-end page contained in the label information of the verification picture to obtain a comparison result; when the comparison result is consistent, determine that the response of the web server is correct; and when the comparison result is inconsistent, determine that the response of the web server is incorrect.
8. The apparatus of claim 7, wherein, further comprising a training module configured to train the neural network model in the following manner: obtain pictures in which the N front-end pages are respectively displayed normally to obtain a normal picture set; obtain pictures in which the N front-end pages are respectively displayed abnormally to obtain an abnormal picture set; for each picture in the normal picture set, set label information based on the type of the front-end page in the picture and the state information of normal display, wherein N label information is set in the normal picture set in one-to-one correspondence with the N front-end pages; for the pictures in the abnormal picture set, uniformly set one label information based on the state information of abnormal display; and train the neural network model using the normal picture set and the abnormal picture set in which the label information is set, wherein the trained neural network is used to classify any input picture into N+1 categories in one-to-one correspondence with N+1 label information. 9.An electronic device, comprising: one or more processors; one or more memories configured to store one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method according to any one of claims 1-6. 10.A computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the method according to any one of claims 1-6.
11. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Page abnormality detection method and device
CN107832774A
Software page classification method and device, electronic equipment and storage medium
CN110781925A
Page detection method, device and equipment
CN112307392A