Method and system for constructing CCNoV data set and WESVM classifier to assist Web program design

By constructing the CCNoV dataset and developing the WESVM classifier, the ErrorMsg problem in Web applications was solved, more efficient error message display was achieved, and the accuracy and speed of Web program development were improved.

CN120669967APending Publication Date: 2025-09-19HANJIANG NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510755066.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2024-11-18
Filing Date
2025-06-06
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

During the development of Web applications, the problem of error messages not being displayed due to string length restrictions not being effective is difficult to solve effectively with existing technologies.

Method used

The CCNoV dataset was constructed and a support vector machine classifier model WESVM was developed. By designing 15 features and 1 label, the PCA and tSNE methods were combined to perform data dimensionality reduction, and the WESVM classifier with Gaussian kernel function was trained to improve the accuracy.

Benefits of technology

It can identify and solve ErrorMsg problems faster and more accurately, assist Web program development, and improve the efficiency and accuracy of Web programming.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120669967A_ABST
    Figure CN120669967A_ABST
Patent Text Reader

Abstract

According to the method, the debugging problem in Web program design is summarized, and particularly the complex ErrorMsg problem is solved. Based on a code annotation method and a NoValidate attribute method, the ErrorMsg problem is solved, features are designed, a CCNoV data set is constructed, and dimension reduction processing is carried out through PCA and tSNE technologies. Experimental results show that the original 15-dimensional data set is excellent in performance in the WESVM classifier, and the training and testing accuracy is up to 97% or above. However, when the data is reduced to two dimensions, the classification effect of the Gaussian Kernel method is better than that of the Learar Kernel, and the accuracy rate reaches 100%. The method disclosed by the invention not only discloses the advantages of a kernel method in processing dimension reduction data, but also shows that the CCNoV data set and the WESVM classifier constructed by the method can improve the efficiency and the accuracy of Web application program development, and support is provided for a programmer to develop the Web application program.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a technology for processing specific ErrorMsg problems in web programming, and in particular to a method and system for assisting web programming with a WESVM classifier. Background Art

[0002] Django is a back-end framework developed in the Python programming language. It provides a series of powerful tools and libraries designed to simplify and accelerate the development process of web applications. The framework takes on the main tasks of back-end logic and server-side development, making the construction of web applications more efficient. Django not only provides the necessary functions for implementing back-end logic, but also comes with a template engine for generating HTML pages, making it possible to display and generate dynamic content. This template engine supports developers to create dynamic HTML pages in the back-end logic and effectively interact with front-end technologies. Django's core features include back-end processing logic, database management, URL routing, and user authentication. Although Django is compatible with front-end technologies such as JavaScript, CSS, and HTML, its main focus is not on front-end logic processing technology.

[0003] The support vector machine (SVM) method uses a nonlinear mapping function to map the sample space to a high-dimensional or even infinite-dimensional feature space (i.e., Hilbert space), thereby transforming problems that originally could not be linearly separated in the sample space into linearly separable problems in the feature space. Raising the dimension means mapping the sample to a higher-dimensional space, which generally increases computational complexity and may even cause the so-called "curse of dimensionality," so it is often avoided. However, for problems such as classification and regression, datasets that cannot be processed by linear methods in the low-dimensional sample space can be effectively linearly segmented (or regressed) in the high-dimensional feature space using a linear hyperplane. Although raising the dimension generally increases computational complexity, the SVM method cleverly overcomes this problem: by applying the expansion theorem of the kernel function, there is no need to understand the specific expression of the nonlinear mapping. Summary of the Invention

[0004] The main purpose of this invention is to solve the ErrorMsg problem in the Web development process by constructing the CCNoV dataset and developing a support vector machine classifier model WESVM classifier to assist the development of Web programs, thereby achieving faster and more accurate Web programming.

[0005] To achieve the above objectives, the present invention provides a method for constructing a CCNoV dataset, comprising the following steps: 15 features and 1 label were designed, and these 15 features were divided into 6 groups; The first set of features includes UserNmaxLen, UserNminLen, and UserNtextLen, where UserNmaxLen and UserNminLen are set to fixed values, for example, 8 and 3, respectively, and UserNtextLen represents the length of the username character string entered by the user.

[0006] The second set of features includes PassWmaxLen, PassWminLen, and PassWtextLen. They are similar to the first set of features. PassWmaxLen and PassWminLen set the password length range, and PassWtextLen indicates the length of the password string actually entered by the user.

[0007] The third set of features, formpy, indicates whether the form code file is valid. Code related to the code comment method is written to the form code file. If the formpy value is set to 0, error messages will not be displayed even if the code comment method is used. Therefore, the code comment method is only valid when the formpy value is set to 1. The viewspy feature has similar functionality, but it ensures that the length of the username and password input strings is correct. If there is a mismatch with the user information stored in the backend database, the web page displays the incorrect username or password.

[0008] The fourth group of features is novalidateM, which indicates whether to use the NoValidate attribute method. When the NoValidate attribute method is used, the newly defined attribute is added to the HTML file, the program executes according to the expected logic, and an error message is output; otherwise, no error message is output.

[0009] The fifth set of features includes codeCM, codeCMAction1, and codeCMAction2. These three features can take values ​​of 0 or 1, with a total of eight possible combinations. Only when all three features are set to 1 will the error message be displayed in the expected manner, indicating that the code annotation method was used and the correct steps were followed. If the code annotation method is used with codeCM set to 1 but is not followed correctly, no error message is output.

[0010] The sixth set of features includes popUpUserN, popUpPassW, and UPError. PopUpUserN and popUpPassW indicate whether a pop-up window appears after the user enters the username and password to prompt the user of input errors. UPError indicates whether the username or password error message is printed when the length of the entered username and password meets the length requirements but the username or password is correct or incorrect. The label of the CCNoV dataset is ErrorMsg. During the execution of the test program, when an error message appears, the system will set the value of ErrorMsg to 1; otherwise, the system will set it to 0. Based on the designed features, run the program to perform verification experiments, and record the experimental results in the CCNoV dataset.

[0011] On the other hand, the present invention develops a support vector machine classifier model WESVM to solve the ErrorMsg problem in the Web development process, including the following steps: Using the original 15-dimensional CCNoV data as the input of the WESVM classifier, the training accuracy of the WESVM classifier is 97.39% and the test accuracy is 97.09%.

[0012] By applying PCA and tSNE methods to reduce CCNoV data to two dimensions, the processed two-dimensional data is used as the input of WESVM classifier. The accuracy of linear kernel and Gaussian kernel under different hyperparameter settings is compared. The results show that the performance of Gaussian kernel method is better than that of linear kernel method.

[0013] For the Gaussian kernel method, when the value of C is fixed and the value of γ increases, the classifier exhibits overfitting. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The present invention will be further described below with reference to the accompanying drawings and examples.

[0015] Figure 1 Diagram for debugging ErrorMsg problems.

[0016] Figure 2 Schematic diagram of constructing the CCNoV dataset.

[0017] Figure 3 Schematic diagram of using WESVM classifier to analyze CCNoV dataset.

[0018] Figure 4 Develop schematics for assistive web applications. DETAILED DESCRIPTION

[0019] Figure 1 This is the background introduction of ErrorMsg problem and the debugging diagram. Figure 1As shown, ErrorMsg problem debugging includes the following submodules: The first submodule, this invention describes the ErrorMsg problem. From a general problem description perspective, the problem overview is that during the debugging of a web application, during program implementation, the output Error Message is logically processed: when the length of the string entered into the web page text box does not meet the set requirements, an Error Message is output; however, when the input string length does not meet the preset value, the program does not output the expected Error Message. This invention defines this problem as the ErrorMsg problem. The ErrorMsg problem is a problem that arises in web application development scenarios.

[0020] The cause of the problem is that the string length limit is not effective and the Error Message is not displayed on the web page.

[0021] The second submodule is a solution to the ErrorMsg problem. The present invention lists two methods: code annotation method and NoValidate attribute method. For the code annotation method, multiple experimental steps are iterated to verify the output of the expected Error Message result. First, start the Django server and input data that can trigger an error, that is, the Error Message is not displayed on the Web page. By commenting and uncommenting the relevant code, the Error Message can be displayed on the Web page. For the NoValidate attribute method, add the NoValidate attribute setting in the code of the page component setting, and the ErrorMessage can also be correctly displayed on the Web page.

[0022] The third submodule is the code file structure. The core code files for reproducing the ErrorMsg issue include the entry point main program file (Mainpy), which starts the server with default parameters; the Viewpy file, which handles debugging information and string length limit statements; the HTML file, which sets up the various components of the web page, such as the text boxes for entering the username and password and the submit button; and the Formspy file, which defines the error message and designs program statements for input data validation.

[0023] The fourth sub-module is debugging and presentation. Debugging includes two modes: terminal mode and web page mode. Terminal mode involves starting program debugging from a command line terminal, outputting debugging information such as the values ​​of intermediate variables and displaying them in the command line terminal. Web page mode involves setting the properties of components like input text boxes and submit buttons, as well as displaying error messages on the page or displaying pop-up windows when error messages are not output properly. Similar to debugging, presentation also has both terminal output and web page interface modes.

[0024] Figure 2 This is a schematic diagram of constructing the CCNoV dataset. The first submodule is the normal program execution flow. During web application development, the string length of the input text box is restricted, and an ErrorMsg variable is defined to store the prompt message string. After clicking the Submit button on the page, the program invokes the judgment logic to check whether the string length entered into the text box meets the required length. If the check result is true, meaning the input string length meets the preset requirement, the program executes the next instruction. If the check result is false, meaning the input string length is greater or less than the preset length, an Error Message is output on the web page below the input text box.

[0025] The second submodule is ErrorMessage processing. It analyzes the causes of ErrorMessage issues. Breakpoints are set at the main program entry point to debug both command line terminal output and web page output. This paper outlines methods for displaying ErrorMessages according to the expected logic of the web program: code annotation methods and the NoValidate attribute method.

[0026] The third submodule is a dataset overview. It comprehensively considers factors such as the causes and solutions of ErrorMsg issues. For example, in core code files, it distinguishes the length of input text and refines the specific steps of the code annotation method. This generates a 256-row, 16-column dataset with 15 features and 1 label.

[0027] The fourth submodule is the data set design. Before generating specific data records, the data set is designed to have 15 features and 1 label. The user name and password are both entered into the text box as strings, and there is a string length limit. When designing the data set, a certain value is fixed as the legal length of the string; the validity of the form code file, the code related to the reproduction of the ErrorMsg problem involves the form code file, and the premise is that the form code file is in a valid state. Only when the form code file is valid can the ErrorMsg problem be reproduced. Otherwise, if the form code file is invalid, the ErrorMsg problem cannot be reproduced. The present invention finds two methods to solve the ErrorMsg problem: code annotation method and NoValidate attribute method. The attributes related to these two solutions are also designed as features of the CCNoV data set. The debug window and error message feature refers to when the Error Message is not displayed normally on the Web page, unexpected results occur during the program running, that is, the error message is displayed in a pop-up window.

[0028] The fifth submodule is experimental verification and data logging. After designing the features of the CCNoV dataset, we experimented by entering strings of various lengths into the text box to verify the conditions under which ErrorMsg is output to the page. The results of each experimental verification were written to the CCNoV dataset.

[0029] The sixth submodule is data dimensionality reduction and visualization. Using two different dimensionality reduction methods, PCA and tSNE, the original 15-dimensional CCNoV dataset is reduced to 2 or 3 dimensions for visualization, allowing for an intuitive understanding of the distribution of data points in the dataset.

[0030] Figure 3The CCNoV dataset was analyzed using the WESVM classifier. The original CCNoV dataset has 15 features. The WESVM classifier achieved training and test accuracies of 97.39% and 97.09%, respectively. The 15-dimensional data was reduced to 2 dimensions using PCA and tSNE. The WESVM classifier was trained using the 2-dimensional data as input. The classifier accuracy was compared using different kernel methods, LinearKernel and Gaussian Kernel, with different hyperparameters for each kernel method. For the data obtained using different dimensionality reduction methods, the experimental results for the Gaussian Kernel method generally show that increasing the γ value with a fixed C value leads to overfitting. The analysis of the CCNoV dataset also includes a seventh visualization submodule. This visualization consists of two parts: one is the visualization of the reduced dimensionality data, divided into 2D and 3D data; the other is the visualization of the WESVM classifier accuracy using the reduced dimensionality data (in this case, the reduced dimensionality data is 2D) as input. Comparison of the WESVM classifier accuracy using original data and reduced data. Gaussian Kernel achieved the highest accuracy of 99.61% and 100% for data obtained using PCA and tSNE, respectively.

[0031] Figure 4 Assisting Web application development. In Web program debugging, the present invention summarizes the ErrorMsg problem and finds two methods to solve the ErrorMsg problem. For the code annotation method and the NoValidate attribute method, specific experimental steps are designed to verify the ErrorMsg problem, and based on the characteristics of the problem, a CCNoV data set is constructed. Because CCNoV data is 15-dimensional data, it cannot be directly visualized. PCA and tSNE dimensionality reduction methods are used to visualize the distribution of data points. A WESVM classifier is designed, and 15-dimensional data and 2-dimensional data are used to train and test the classifier respectively. Using different kernel methods and setting different hyperparameters for different kernel methods, the WESVM classifier has different accuracy rates. The cause of the problem can be found more quickly and accurately, thereby assisting Web application development.

Claims

1. Design the CCNoV dataset to use the WESVM algorithm to assist Web programming, which is characterized by: The following steps are involved: In the process of debugging Web programs, the ErrorMsg problem is summarized and two different solutions are given. Through experimental verification, the code annotation method, namely the NoValidate method, can reproduce the ErrorMsg problem in a certain step. We constructed the CCNoV dataset and designed a validation experiment to distinguish between features such as the length of the input text, the number of files containing core code, and the specific steps of the code annotation method. The dataset consists of 256 rows, 15 features, and 1 label. We used PCA and tSNE to reduce the dimensionality of the CCNoV dataset to two and three dimensions. After dimensionality reduction, we visualized the data to better understand the characteristics of the CCNoV data. Using the original 15-dimensional CCNoV data as the input of the WESVM classifier, the training accuracy of WESVM is 97.39% and the test accuracy is 97.09%.

2. The solution to ErrorMsg described in the method and system for constructing CCNoV dataset and WESVM classifier-assisted Web programming according to claim 1 is characterized in that: The following steps are involved: The first method is to add the Novalidate attribute to display the expected error message on the web page. The second method is code commenting. By commenting / uncommenting the code that limits the string length and defining the maximum and minimum lengths, you can display the expected error message on the web page. The detailed steps for commenting / uncommenting the code are as follows: Start the Django server using the default runserver parameters; Enter the local IP address and port in the browser address. The web page will display two empty text boxes. Enter the username and password strings. Enter "usertest" in the username field and "pwdtest" in the password field. The lengths of the two input strings are 8 and 7, respectively, but the code limits the minimum input string length to at least 10. This means the current input string length doesn't conform to the algorithm's logic, causing an exception. The restriction code is currently uncommented. Clicking the Submit button displays an error message, prompting the user to enter a text length error, rather than a specific username or password error. Comment out some code and save the current version of the code; Uncomment the lines made in the previous step; Enter "usertest" in the first text box and "pwdtest" in the second text box, then click the Submit button. The expected error message "Username string length does not meet the setting requirements" is displayed on the web page, rather than the pop-up window prompting the user that the text entered is incorrect in length as shown in the previous steps.

3. The CCNoV dataset construction method and system for constructing CCNoV dataset and WESVM classifier-assisted Web programming according to claim 1, characterized in that: The following steps are involved: 15 features and 1 label are designed, and the 15 features are divided into 6 groups; the first group includes UserNmaxLen, UserNminLen, and UserNtextLen, where the UserNmaxLen and UserNminLen fields are set to fixed values, such as 8 and 3, respectively, and UserNtextLen represents the length of the username string entered by the user; The second set of features includes PassWmaxLen, PassWminLen, and PassWtextLen. They are similar to the first set of features, except that this set of features is related to the input password text, while the first set of features is related to the input username text; For the third set of features, formpy indicates whether the form code file is valid; the code related to the code comment method is written into the form code file. If the value of the formpy feature is set to 0, the error message will not be displayed even if the code comment method is used; therefore, the code comment method is only valid when the formpy value is set to 1; the viewspy feature has a similar function, but it ensures that the length of the username and password input strings is correct; when it does not match the user information stored in the back-end database, the web page displays that the username or password is incorrect; The fourth group of features is novalidateM, which indicates whether NoValMethod is used. When NoValMethod is used, a new definition attribute is added to the HTML file, the program is executed with the expected logic, and an error message is output. Otherwise, no error message is output; The fifth set of features includes codeCM, codeCMAction1, and codeCMAction2, which are three binary variables with a total of 8 possible combinations. Only when all three variables are set to 1 can the error message be displayed in the expected way, indicating that the code annotation method was used and the correct steps were followed. If the code annotation method is used and codeCM is set to 1, but the operation is incorrect, no error message is output. The sixth group of functions includes popUpUserN, popUpPassW, and UPError. PopUpUserN and popUpPassW indicate whether a pop-up window will appear after the user enters the username and password to prompt the user if the input is incorrect. UPError indicates whether to print a message indicating that the username or password is incorrect when the length of the entered username and password meets the length requirements but the username or password is correct or incorrect. The label of the CCNoV dataset is ErrorMsg. During the execution of the test program, when an error message appears, the system will set the value of ErrorMsg to 1, otherwise, the system will set it to 0. According to the designed characteristics, the program is run to perform verification experiments, and the experimental results are recorded in the CCNoV dataset.

4. The method for visualizing the CCNoV dataset according to claim 1, wherein: The following steps are involved: The CCNoV dataset constructed in the present invention is a 15-dimensional dataset. PCA and tSNE were used to reduce the dimensionality of the CCNoV data to two or three dimensions to better demonstrate the characteristics of the CCNoV dataset. By visualizing the distribution of data points in two or three-dimensional space, the differences between ErrorMsg labels can be intuitively displayed. In addition, PCA and tSNE were also selected as dimensionality reduction methods to compare the impact of the original 15-dimensional data and the reduced two-dimensional data on the accuracy of the WESVM classifier.

5. The WESVM classifier method according to the method and system for constructing CCNoV dataset and WESVM classifier-assisted Web programming according to claim 1 is characterized in that: The following steps are involved: The original 15-dimensional CCNoV data was used as input to construct a WESVM classifier. The training accuracy of the WESVM classifier was 97.39% and the test accuracy was 97.09%. The CCNoV data was reduced to two dimensions by applying PCA and tSNE methods. The processed two-dimensional data was used as the input of the WESVM classifier. The accuracy of the linear kernel and Gaussian kernel under different hyperparameter settings were compared. The results showed that the Gaussian kernel method performed better than the linear kernel method. For the Gaussian kernel method, when the C value was fixed and the γ value increased, the classifier showed overfitting. For the data obtained by the two different dimensionality reduction methods, PCA and tSNE, the Gaussian Kernel had the highest accuracy of 99.61% and 100%.