A software adaptive page verification method and system based on convolutional neural network

Through convolutional neural network technology, combined with device parameters and visual effects, SVG vector diagrams are generated and adjusted, which solves the problem of inconsistent page verification on devices with different resolutions, achieving an efficient and convenient user experience and reducing development and maintenance costs.

CN119514610BActive Publication Date: 2025-04-04ZHEJIANG SHUXIN NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510058479.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2025-04-04
Estimated Expiration
2045-01-15

AI Technical Summary

Technical Problem

The existing page verification technology has inconsistent display effects on devices with different resolutions, which leads to inconvenience in user operation, difficult to identify graphic verification codes, and complex development and maintenance.

Method used

Convolutional neural network (CNN) is used as the basis, and adaptive page verification is achieved by obtaining device parameters, calculating the minimum size of visual effects and verification elements, generating and adjusting the SVG vector diagram, and finally inputting the trained CNN for adjustment, realizing adaptive page verification.

Benefits of technology

It realizes page verification consistency on different devices and resolutions, improves user experience and operational convenience, and reduces development and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119514610B_ABST
    Figure CN119514610B_ABST
Patent Text Reader

Abstract

The present invention discloses a software adaptive page verification method and system based on a convolutional neural network, belonging to the field of computer technology; the device comprises: obtaining device parameters; calculating visual effects according to the device parameters; calculating the minimum size of the verification element according to the device parameters and the visual effects; generating an SVG vector image according to the minimum size of the verification element and the element content; adjusting the SVG vector image to obtain a resolution-adapted SVG vector image; inputting the resolution-adapted SVG vector image and the visual effects into a trained convolutional neural network, and outputting the adjustment result. The technical solution of the present invention can run stably on different operating systems and device platforms, and is not limited by specific hardware or software environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a software adaptive page verification method and system based on a convolutional neural network. Background Art

[0002] With the increase in the types of devices, displays with different resolutions are widely used in various electronic devices, such as smartphones, tablets, laptops, and desktop computers. The rendering effect of software pages at different resolutions has become one of the key factors in user experience. However, due to the inconsistency of screen size and resolution, the display effect of software pages on different devices may vary greatly, which directly affects the user's operating convenience and visual experience.

[0003] The disadvantages of the currently used inspection methods are as follows:

[0004] 1. Weak adaptability: Existing page verification technologies are often designed for specific resolutions. When the software page is rendered on devices with different resolutions, the verification elements may not be displayed correctly or the layout may be chaotic, resulting in users being unable to complete the verification operation normally.

[0005] 2. Difficulty in graphic recognition: On a low-resolution screen, verification elements such as graphic verification codes may become difficult to recognize due to insufficient pixels, while on a high-resolution screen, the graphics may be distorted due to enlargement, affecting user recognition and operation.

[0006] 3. Inconsistent user experience: Since existing verification technologies fail to adapt well to different resolutions, users may encounter inconsistent verification processes when using the same software on different devices, reducing overall user satisfaction. Summary of the invention

[0007] The purpose of the present invention is to provide a software adaptive page verification method and system based on convolutional neural network, which adopts a universal solution, simplifies the development process and improves development efficiency.

[0008] In order to solve the above technical problems, the present invention provides a software adaptive page verification method based on a convolutional neural network, comprising the following steps:

[0009] Get device parameters;

[0010] According to the equipment parameters, the visual effect is calculated;

[0011] Calculate the minimum size of the verification element based on device parameters and visual effects;

[0012] Generate SVG vector graphics based on the minimum size and content of the validation element;

[0013] Adjust the SVG vector image to obtain a resolution-adapted SVG vector image;

[0014] Input the resolution-adapted SVG vector image and visual effects into the trained convolutional neural network and output the adjusted results.

[0015] Preferably, obtaining device parameters specifically includes the following steps:

[0016] Detecting device parameters of the graphics on the current device through WebGL; the device parameters include screen resolution and related parameters;

[0017] The screen resolution includes the number of pixels in width and the number of pixels in height;

[0018] The relevant parameters include device pixel ratio and screen size.

[0019] Preferably, the calculation formula of the visual effect is:

[0020] V = a*R + b*P + c

[0021] In the formula: V is the visual effect; R is the screen resolution; P is the relevant parameter; a is the coefficient of the influence of the screen resolution R on the visual effect V; b is the coefficient of the influence of the relevant parameter P on the visual effect V; c is the basic value of the visual effect V; R is the screen resolution; P is the relevant parameter.

[0022] Preferably, the calculation formula of the screen resolution R is:

[0023] R = Rx + Ry

[0024] Where: Rx and Ry are the number of pixels of width and height respectively;

[0025] The calculation formula of the relevant parameter P is:

[0026] P = w1P1 + w2P2 + …… + wn*Pn

[0027] Where: w1~wn are weights; P1~Pn are parameters, which are the device pixel ratio and screen size.

[0028] Preferably, the calculation formula of the minimum size of the verification element is:

[0029] ;

[0030] Where: h is the base size; Rx and Ry are the width and height pixels of the screen resolution respectively; BaseRes x and BaseRes yare the width and height of the base resolution, respectively; DPR is the device pixel ratio.

[0031] Preferably, the calculation formula of the SVG vector image is:

[0032] ;

[0033] Where: ElementContent is the element content; Scale is the function of MinSize to scale ElementContent; AutoScale is the function to determine the scaling ratio; is the current size of the element; OptimalScaleFactor is the optimal scaling factor calculated based on the view frame size and screen resolution; Auto is a special identifier.

[0034] Preferably, the calculation formula for adapting the resolution to the SVG vector image is:

[0035] AdjustedSVG = (1 + P_scale) * SVG * (R / R_reference)

[0036] Where: AdjustedSVG is the resolution-adapted SVG vector image; P_scale is the scale factor; R_reference is the reference resolution.

[0037] Preferably, the convolutional neural network includes an input layer, a convolution layer, an activation layer, a pooling layer, a normalization layer, a fully connected layer and an output layer;

[0038] The input layer is used to receive the image data generated by the verification module;

[0039] The convolution layer is used to extract image features;

[0040] The activation layer is used to introduce the nonlinear factor ReLU function;

[0041] The pooling layer is used to reduce the feature dimension and reduce the amount of calculation;

[0042] The normalization layer is used to speed up the training process and prevent overfitting;

[0043] The fully connected layer is used for classification or regression tasks;

[0044] The output layer is used to output prediction results.

[0045] Preferably, the training method of the convolutional neural network is:

[0046] The input data is forward calculated through the network to obtain the prediction result;

[0047] Compare the predicted results with the true labels and calculate the loss value, the cross entropy loss function;

[0048] Calculate the gradient according to the loss function and update the network weights;

[0049] Update network weights according to the optimization algorithm Adam.

[0050] The present invention also provides a software adaptive page verification system based on a convolutional neural network, comprising:

[0051] Acquisition module, used to obtain device parameters;

[0052] A first calculation module, used for calculating and obtaining visual effects according to device parameters;

[0053] The second calculation module is used to calculate the minimum size of the verification element according to the device parameters and the visual effect;

[0054] A vector graphics generation module, used to generate SVG vector graphics according to the minimum size and element content of the verification element;

[0055] The optimization module is used to adjust the SVG vector image to obtain a resolution-adapted SVG vector image;

[0056] The adjustment module is used to input the resolution-adapted SVG vector image and visual effects into the trained convolutional neural network and output the adjustment results.

[0057] Compared with the prior art, the present invention has the following beneficial effects:

[0058] 1. Construction and training of SVG vector convolutional neural network:

[0059] Design and implement an efficient Convolutional Neural Network (CNN) architecture based on SVG vector graphics, suitable for the characteristics of page verification tasks.

[0060] A large number of generated SVG vector graphics are used to train CNN with samples of verification elements at different resolutions to ensure that the model can accurately identify and handle various verification scenarios.

[0061] 2. Intelligent verification process:

[0062] Through the self-learning ability of convolutional neural networks, the verification process can be made intelligent, such as automatically adjusting the verification difficulty, type and interaction mode.

[0063] 3. Cross-platform compatibility:

[0064] The technical solution of the present invention can run stably on different operating systems and device platforms and is not restricted by specific hardware or software environments.

[0065] 4. Improved development and maintenance efficiency:

[0066] Reduce the complexity and cost of software development and maintenance by reducing the duplication of development work to accommodate different resolutions. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] The specific implementation modes of the present invention are further described in detail below with reference to the accompanying drawings.

[0068] Figure 1 It is a flow chart of a software adaptive page verification method based on a convolutional neural network according to the present invention. DETAILED DESCRIPTION

[0069] Many specific details are set forth in the following description to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present invention, so the present invention is not limited to the specific implementation disclosed below.

[0070] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0071] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0072] The present invention is further described in detail below in conjunction with the accompanying drawings:

[0073] like Figure 1 As shown, the present invention provides a software adaptive page verification method based on a convolutional neural network, comprising the following steps:

[0074] Get device parameters;

[0075] According to the equipment parameters, the visual effect is calculated;

[0076] Calculate the minimum size of the verification element based on device parameters and visual effects;

[0077] Generate SVG vector graphics based on the minimum size and content of the validation element;

[0078] Adjust the SVG vector image to obtain a resolution-adapted SVG vector image;

[0079] Input the resolution-adapted SVG vector image and visual effects into the trained convolutional neural network and output the adjusted results.

[0080] Preferably, obtaining device parameters specifically includes the following steps:

[0081] Detecting device parameters of the graphics on the current device through WebGL; the device parameters include screen resolution and related parameters;

[0082] The screen resolution includes the number of pixels in width and the number of pixels in height;

[0083] The relevant parameters include device pixel ratio and screen size.

[0084] Preferably, the calculation formula of the visual effect is:

[0085] V = a*R + b*P + c

[0086] In the formula: V is the visual effect; R is the screen resolution; P is the relevant parameter; a is the coefficient of the influence of the screen resolution R on the visual effect V; b is the coefficient of the influence of the relevant parameter P on the visual effect V; c is the basic value of the visual effect V; R is the screen resolution; P is the relevant parameter.

[0087] Preferably, the calculation formula of the screen resolution R is:

[0088] R = Rx + Ry

[0089] Where: Rx and Ry are the number of pixels of width and height respectively;

[0090] The calculation formula of the relevant parameter P is:

[0091] P = w1P1 + w2P2 + …… + wn*Pn

[0092] Where: w1~wn are weights; P1~Pn are parameters, which are the device pixel ratio and screen size.

[0093] Preferably, the calculation formula of the minimum size of the verification element is:

[0094] ;

[0095] Where: h is the base size; Rx and Ry are the width and height pixels of the screen resolution respectively; BaseRes x and BaseRes y are the width and height of the base resolution, respectively; DPR is the device pixel ratio.

[0096] Preferably, the calculation formula of the SVG vector image is:

[0097] ;

[0098] Where: ElementContent is the element content; Scale is the function of MinSize to scale ElementContent; AutoScale is the function to determine the scaling ratio; is the current size of the element; OptimalScaleFactor is the optimal scaling factor calculated based on the view frame size and screen resolution; Auto is a special identifier.

[0099] Preferably, the calculation formula for adapting the resolution to the SVG vector image is:

[0100] AdjustedSVG = (1 + P_scale) * SVG * (R / R_reference);

[0101] Where: AdjustedSVG is the resolution-adapted SVG vector image; P_scale is the scale factor; R_reference is the reference resolution.

[0102] Preferably, the convolutional neural network includes an input layer, a convolution layer, an activation layer, a pooling layer, a normalization layer, a fully connected layer and an output layer;

[0103] The input layer is used to receive the image data generated by the verification module;

[0104] The convolution layer is used to extract image features;

[0105] The activation layer is used to introduce the nonlinear factor ReLU function;

[0106] The pooling layer is used to reduce the feature dimension and reduce the amount of calculation;

[0107] The normalization layer is used to speed up the training process and prevent overfitting;

[0108] The fully connected layer is used for classification or regression tasks;

[0109] The output layer is used to output prediction results.

[0110] Preferably, the training method of the convolutional neural network is:

[0111] The input data is forward calculated through the network to obtain the prediction result;

[0112] Compare the predicted results with the true labels and calculate the loss value, the cross entropy loss function;

[0113] Calculate the gradient according to the loss function and update the network weights;

[0114] Update network weights according to the optimization algorithm Adam.

[0115] The present invention also provides a software adaptive page verification system based on a convolutional neural network, comprising:

[0116] Acquisition module, used to obtain device parameters;

[0117] A first calculation module, used for calculating and obtaining visual effects according to device parameters;

[0118] The second calculation module is used to calculate the minimum size of the verification element according to the device parameters and the visual effect;

[0119] A vector graphics generation module, used to generate SVG vector graphics according to the minimum size and element content of the verification element;

[0120] The optimization module is used to adjust the SVG vector image to obtain a resolution-adapted SVG vector image;

[0121] The adjustment module is used to input the resolution-adapted SVG vector image and visual effects into the trained convolutional neural network and output the adjustment results.

[0122] In order to better illustrate the technical effect of the present invention, the present invention provides the following specific embodiments to illustrate the above technical process:

[0123] Embodiment 1: A software adaptive page verification system based on a convolutional neural network, comprising:

[0124] 1. Page rendering monitoring module:

[0125] Use WebGL to detect the performance of graphics rendering on the screen resolution and other related parameters of the current device, provide real-time feedback on the page rendering status, provide a basis for verifying element generation, and provide data support for convolutional neural network model training.

[0126] 2. Verification element generation module:

[0127] 1. Let R represent screen resolution, P represent related parameters (device pixel ratio, screen size), and V represent the visual effect of the verification element. The relationship between the verification element and screen resolution and other related parameters can be expressed as:

[0128] V = f(R, P)

[0129] Where f is a linear function that combines the screen resolution R and related parameters P to calculate the visual effect:

[0130] f(R, P) = a*R + b*P + c

[0131] in:

[0132] a is the coefficient of the screen resolution R on the visual effect V;

[0133] b is the coefficient of the influence of the relevant parameter P on the visual effect V;

[0134] c is a constant term, representing the base value of the visual effect V even when R and P are both zero;

[0135] R is the screen resolution, which is a two-dimensional vector (Rx, Ry) representing the number of pixels in width and height, and is scalared using direct addition R = Rx + Ry;

[0136] P is a vector containing multiple parameters. The relevant parameters P include device pixel ratio and screen size, P=(P1, P2, …, Pn), and the weighted sum P = w1P1 + w2P2 + … + wn*Pn.

[0137] For example, setting the parameters to:

[0138] R = (1920, 1080) (screen resolution is 1920x1080)

[0139] P = (2.0, 5.5) (device pixel ratio is 2.0, screen size is 5.5 inches)

[0140] a = 0.5, b = 1.0, c = 10

[0141] The direct addition method is used to scalarize R, and each parameter in P has the same weight:

[0142] R = 1920 + 1080 = 3000

[0143] P = 2.0 + 5.5 = 7.5

[0144] The calculation of the visual effect V is:

[0145] V = f(R, P) = 0.5R + 1.0P + 10 V = 0.53000 + 1.07.5 + 10 V = 1500 +7.5 + 10 V = 1517.5

[0146] 2. Set the screen resolution R: R = (Width, Height) Where Width is the width of the screen in pixels, and Height is the height of the screen in pixels.

[0147] 3. Device pixel ratio (DPR) = number of physical pixels / width of the viewport

[0148] 4. Calculate the minimum size of the verification element: MinSize = g(R, P)

[0149] in:

[0150] MinSize represents the minimum size of the validation element;

[0151] R stands for screen resolution;

[0152] P is a vector containing multiple parameters, P=(P1, P2, ..., Pn), each parameter represents the impact of different device pixel ratios and screen sizes;

[0153] g is a function that defines how to calculate the minimum size of the validation element to ensure legibility based on the screen resolution R and related parameters P.

[0154] The specific form of the function g depends on many factors, including but not limited to the user's visual ability, screen type, and usage environment. In actual applications, this function may need to be accurately determined through experiments and user testing. The calculation formula is as follows:

[0155] ;

[0156] Where: h is the base size; Rx and Ry are the width and height of the screen resolution respectively; BaseRes x and BaseRes y are the width and height of the base resolution respectively; DPR is the device pixel ratio;

[0157] 5. Generate SVG vector image: SVG = h(MinSize, ElementContent)

[0158] in:

[0159] MinSize is a specific value, the generated SVG image will be at least this size

[0160] ElementContent is the element content in the SVG image, which is a string containing the shape, color, and size tags of the SVG graphic;

[0161] h is a function that generates an SVG vector image based on the minimum size MinSize and element content ElementContent.

[0162] ;

[0163] Among them: Auto is a special identifier used to tell function h to determine the minimum size of ElementContent; Auto means that the minimum size is not explicitly specified by the user, but is determined by the system based on the element content, screen resolution, device pixel ratio, etc.

[0164] Scale is a function that scales ElementContent according to MinSize;

[0165] ;

[0166] AutoScale is a function that automatically determines the scaling ratio;

[0167]

[0168] Where: is the current size of the element's content; OptimalScaleFactor is the optimal scaling factor automatically calculated based on the view frame size and screen resolution.

[0169] 6. Adjust the SVG vector image to fit the screen and get a resolution-adapted SVG vector image:

[0170] AdjustedSVG = (1 + P_scale) * SVG * (R / R_reference)

[0171] Where: AdjustedSVG is the adjusted resolution-adapted SVG vector image; SVG is the vector image; R is the resolution of the target screen; P_scale is a scaling factor used to enlarge or reduce the SVG image; R_reference is the reference resolution, that is, the resolution of the SVG vector image when it was originally designed, which is the screen resolution R set in step 2.

[0172] P_scale is the ratio of the current target screen resolution to the resolution of the SVG vector image originally designed, minus 1, indicating the relative proportion of the size change;

[0173] R / R_reference is a factor used to resize the SVG based on the ratio of the target screen resolution relative to the reference resolution;

[0174] The above formula adjusts the SVG vector image to fit the screen, ensuring consistency and clarity on different devices.

[0175] 3. Convolutional Neural Network Training Module for SVG Vector Graphics:

[0176] 3.1 Data Collection and Preprocessing

[0177] (1) Data collection:

[0178] Input data:

[0179] Data required for WebGL rendering: screen resolution, device pixel ratio, screen size, frame rate at different resolutions;

[0180] SVG vector image and its tag data: verify the SVG vector image of the element, the shape, color, and size of the SVG vector image;

[0181] Output data:

[0182] The above collected indicators and corresponding SVG vector features;

[0183] (2) Data preprocessing:

[0184] Data normalization: minimum and maximum normalization methods scale the data to a fixed range of [0, 1].

[0185] Data enhancement: Increase data diversity through rotation, scaling, shearing, etc. to improve the generalization ability of the model.

[0186] 3.2 Network architecture design

[0187] (1) Design a convolutional neural network architecture, including the following layers:

[0188] Input layer: receives the image data generated by the verification module.

[0189] Convolutional layer: extracts image features.

[0190] Activation layer: introduces the nonlinear factor ReLU function.

[0191] Pooling layer: reduces feature dimensions and reduces computational effort.

[0192] Normalization layer: speeds up the training process and prevents overfitting.

[0193] Fully connected layer: performs classification or regression tasks.

[0194] Output layer: outputs the prediction results.

[0195] (2) Determine network hyperparameters:

[0196] The learning rate is (1e-3), the batch size is 32, the number of iterations is 15, and the L2 regularization is (1e-3)

[0197] 3.3 Model Training

[0198] (1) Forward propagation: The input data is forward calculated through the network to obtain the prediction result.

[0199] (2) Loss function calculation: Compare the predicted results with the true labels and calculate the loss value, cross entropy loss function.

[0200] (3) Back propagation: Calculate the gradient based on the loss function and update the network weights.

[0201] (4) Weight update: Use the optimization algorithm Adam to update the network weights.

[0202] 3.4 Model Evaluation and Optimization

[0203] (1) Evaluation metrics: Use accuracy metrics to evaluate model performance.

[0204] (2) Model tuning: Adjust the network architecture or hyperparameters based on the evaluation results to improve model performance.

[0205] (3) Cross-validation: Use the cross-validation method to evaluate the generalization ability of the model.

[0206] 4. Adaptive adjustment module:

[0207] Use the trained convolutional neural network model to perform real-time analysis and adjustment on the generated verification elements; that is, adapt the resolution obtained in step 2 to the SVG vector image and visual effects, input them into the trained convolutional neural network, and obtain the adjustment result;

[0208] The convolutional neural network model is used to predict users' operating habits at different resolutions, and optimize the layout and interaction methods of verification elements.

[0209] This embodiment can solve the following existing problems:

[0210] Intelligent verification problem: Using the self-learning ability of convolutional neural networks to realize intelligent verification technology, it can quickly verify the accuracy of page adaptive display screens with different resolutions based on user behavior and device characteristics, and improve the intelligent level of page display verification

[0211] Graphic verification code recognition problem: Improve the recognizability of graphic verification codes at different resolutions to avoid blurring or distortion of verification codes caused by resolution changes, and ensure that users can accurately recognize and enter verification codes.

[0212] User experience consistency issue: Through adaptive technology, users can get a consistent verification experience when using the software on devices with different resolutions, reducing the operational inconvenience caused by resolution differences.

[0213] Development and maintenance efficiency issues: Reduce repetitive development work to adapt to different resolutions, reduce software development and maintenance costs, and improve development efficiency.

[0214] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules, modules or units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units, modules or components can be combined or integrated into another device, or some features can be ignored or not executed.

[0215] The units may or may not be physically separated, and the components displayed as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0216] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0217] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part, and / or installed from a removable medium. When the computer program is executed by the central processing unit (CPU), the above-mentioned functions defined in the method of the present invention are executed. It should be noted that the above-mentioned computer-readable medium of the present invention can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of an electrical, magnetic, optical, electromagnetic, infrared segment, or semiconductor, or any combination of the above.

[0218] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0219] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A software adaptive page verification method based on convolutional neural network, characterized in that: The following steps are involved: Detecting device parameters of the graphics on the current device through WebGL; the device parameters include screen resolution and related parameters; the screen resolution includes width pixels and height pixels; the related parameters include device pixel ratio and screen size; According to the equipment parameters, the visual effect is calculated; The calculation formula of the visual effect is: V = a*R + b*P + c; Where: V is the visual effect; R is the screen resolution; P is the relevant parameter; a is the coefficient of the screen resolution R on the visual effect V; b is the coefficient of the relevant parameter P on the visual effect V; c is the basic value of the visual effect V; Calculate the minimum size of the verification element based on device parameters and visual effects; The calculation formula for the minimum size of the verification element is: ; Where: h is the base size; Rx and Ry are the width and height pixels of the screen resolution respectively; BaseRes x and BaseRes y are the width and height of the base resolution respectively; DPR is the device pixel ratio; Generate SVG vector graphics based on the minimum size and content of the validation element; The calculation formula of the SVG vector image is: ; Where: ElementContent is the element content; Scale is the function of MinSize to scale ElementContent; AutoScale is the function to determine the scaling ratio; is the current size of the element; OptimalScaleFactor is the optimal scaling factor calculated based on the view frame size and screen resolution; Auto is a special identifier; Adjust the SVG vector image to obtain a resolution-adapted SVG vector image; The calculation formula for the resolution adaptation SVG vector image is: AdjustedSVG = (1 + P_scale) * SVG * (R / R_reference); Where: AdjustedSVG is the resolution-adapted SVG vector image; P_scale is the scale factor; R_reference is the reference resolution; Input the resolution-adapted SVG vector image and visual effects into the trained convolutional neural network and output the adjusted results.

2. The software adaptive page verification method based on convolutional neural network according to claim 1, characterized in that: The calculation formula of the screen resolution R is: R = Rx + Ry; Where: Rx and Ry are the number of pixels of width and height respectively; The calculation formula of the relevant parameter P is: P = w1P1 + w2P2 + … + wn*Pn; Where: w1~wn are weights; P1~Pn are parameters, which are the device pixel ratio and screen size.

3. The software adaptive page verification method based on convolutional neural network according to claim 2 is characterized in that: The convolutional neural network includes an input layer, a convolution layer, an activation layer, a pooling layer, a normalization layer, a fully connected layer and an output layer; The input layer is used to receive the image data generated by the verification module; The convolution layer is used to extract image features; The activation layer is used to introduce the nonlinear factor ReLU function; The pooling layer is used to reduce the feature dimension and reduce the amount of calculation; The normalization layer is used to speed up the training process and prevent overfitting; The fully connected layer is used for classification or regression tasks; The output layer is used to output prediction results.

4. The software adaptive page verification method based on convolutional neural network according to claim 3 is characterized in that: The training method of the convolutional neural network is: The input data is forward calculated through the network to obtain the prediction result; Compare the predicted results with the true labels and calculate the loss value, the cross entropy loss function; Calculate the gradient according to the loss function and update the network weights; Update network weights according to the optimization algorithm Adam.

5. A software adaptive page verification system based on a convolutional neural network, used to implement the software adaptive page verification method based on a convolutional neural network as described in any one of claims 1 to 4, characterized in that: include: Acquisition module, used to obtain device parameters; A first calculation module, used for calculating and obtaining visual effects according to device parameters; The second calculation module is used to calculate the minimum size of the verification element according to the device parameters and the visual effect; A vector graphics generation module, used to generate SVG vector graphics according to the minimum size and element content of the verification element; The optimization module is used to adjust the SVG vector image to obtain a resolution-adapted SVG vector image; The adjustment module is used to input the resolution-adapted SVG vector image and visual effects into the trained convolutional neural network and output the adjustment results.

Citation Information

Patent Citations

  • Processing method and device for multi-platform multi-resolution application program interface

    CN102023849A

  • Multi-screen adaptive method for mobile terminal front-end development

    CN105912336A