CN111143191A - Website testing method and device, computer equipment and storage medium - Google Patents

Website testing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN111143191A
CN111143191A CN201911139293.0A CN201911139293A CN111143191A CN 111143191 A CN111143191 A CN 111143191A CN 201911139293 A CN201911139293 A CN 201911139293A CN 111143191 A CN111143191 A CN 111143191A
Authority
CN
China
Prior art keywords
paragraph
text
abnormal
log
trained
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911139293.0A
Other languages
Chinese (zh)
Other versions
CN111143191B (en
Inventor
王德华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Clp Jinxin Software Shanghai Co ltd
Original Assignee
Shanghai Lingling Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Lingling Technology Co Ltd filed Critical Shanghai Lingling Technology Co Ltd
Priority to CN201911139293.0A priority Critical patent/CN111143191B/en
Publication of CN111143191A publication Critical patent/CN111143191A/en
Application granted granted Critical
Publication of CN111143191B publication Critical patent/CN111143191B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0766Error or fault reporting or storing
    • G06F11/0775Content or structure details of the error report, e.g. specific table structure, specific error fields
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/079Root cause analysis, i.e. error or fault diagnosis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2411Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on the proximity to a decision surface, e.g. support vector machines
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Computer Hardware Design (AREA)
  • Data Mining & Analysis (AREA)
  • Biomedical Technology (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application relates to a website testing method, a website testing device, computer equipment and a storage medium. The method comprises the following steps: acquiring a log to be detected; the log to be detected is a log generated by testing a website; extracting text paragraph features in the log to be detected; the text paragraph features are features corresponding to text paragraphs of the log to be detected; classifying the text paragraph features to obtain an abnormal classification result; and determining the abnormal type of the website according to the abnormal classification result. By adopting the method, the testing efficiency of the website can be improved.

Description

Website testing method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for testing a website, a computer device, and a storage medium.
Background
The website test refers to uploading the manufactured website to a server and carrying out a series of detection work according to various performance conditions of the website.
In the process of testing a website, all functions of the website are often required to be tested to ensure that all the websites normally run before the website is formally on-line. After the website test is completed, various analysis logs are generated for a tester to read and determine the error type corresponding to the website. However, when testing a website with a large number of functions, a tester often needs to spend a lot of time reading a large number of complicated analysis logs to determine the error type of the website, which also makes testing efficiency of the website not high.
Therefore, the existing website test method has the problem of low test efficiency.
Disclosure of Invention
Therefore, it is necessary to provide a website testing method, an apparatus, a computer device, and a storage medium capable of improving the website testing efficiency, in order to solve the problem of low testing efficiency of the existing website testing method.
The website testing method in the embodiment of the invention comprises the following steps:
acquiring a log to be detected; the log to be detected is a log generated by testing a website;
extracting text paragraph features in the log to be detected; the text paragraph features are features corresponding to text paragraphs of the log to be detected;
classifying the text paragraph features to obtain an abnormal classification result; and determining the abnormal type of the website according to the abnormal classification result.
In one embodiment, the extracting text paragraph features in the log to be detected includes:
acquiring a text paragraph in the log to be detected;
inputting the text paragraphs into a pre-trained feature extraction model, and determining target paragraph vectors corresponding to the text paragraphs according to output results of the pre-trained feature extraction model;
and taking the target paragraph vector corresponding to the text paragraph as the text paragraph feature.
In one embodiment, the acquiring a text paragraph in the log to be detected includes:
determining paragraphs to be spliced in the log to be detected; wherein, the paragraph to be spliced is provided with a plurality of paragraphs;
and splicing the paragraphs to be spliced to obtain the text paragraphs in the log to be detected.
In one embodiment, the inputting the text paragraphs into a pre-trained feature extraction model, and determining a target paragraph vector corresponding to the text paragraph according to an output result of the pre-trained feature extraction model includes:
in the text passage, determining a target prediction word and a sample word; wherein the target predicted word is a word in any one of the plurality of words; the sample word is a word in the plurality of words other than the target predicted word;
generating an initial paragraph vector of the text paragraph, and obtaining a word vector corresponding to the sample word;
inputting the initial paragraph vector and the word vector corresponding to the sample word into the pre-trained feature extraction model to generate a predicted word; the predicted words are words obtained by predicting words except the sample words in the plurality of words by the pre-trained feature extraction model;
adjusting the initial paragraph vector according to the predicted word and the target predicted word to obtain an adjusted initial paragraph vector;
and taking the adjusted initial paragraph vector as a target paragraph vector corresponding to the text paragraph.
In one embodiment, the text paragraph features are classified to obtain an abnormal classification result; and according to the abnormal classification result, determining the abnormal type of the website, including:
inputting the text paragraph features into a pre-trained abnormal type classification model; the pre-trained abnormal type classification model is used for classifying the text paragraph features and outputting a corresponding abnormal classification result;
determining the abnormal type of the website according to the abnormal classification result output by the pre-trained abnormal type classification model;
or
Acquiring paragraph vectors corresponding to a plurality of abnormal paragraph features;
calculating the vector distance between the paragraph vector corresponding to the text paragraph feature and the paragraph vector corresponding to each abnormal paragraph feature as the feature similarity between the text paragraph feature and each abnormal paragraph feature;
classifying the text paragraph features according to the feature similarity to obtain the abnormal classification result, and determining the abnormal type of the website according to the abnormal classification result.
In one embodiment, the method further comprises the following steps:
constructing an abnormal type classification model to be trained;
obtaining a text paragraph feature sample as a training sample of the abnormal type classification model to be trained;
determining an abnormal type corresponding to the text paragraph feature sample as a classification label of the text paragraph feature sample;
training the abnormal type classification model to be trained according to the text paragraph feature sample and the abnormal type corresponding to the text paragraph feature sample to obtain a trained abnormal type classification model;
and taking the trained abnormal type classification model as the pre-trained abnormal type classification model.
In one embodiment, the method further comprises the following steps:
acquiring an original log;
and filtering irrelevant data in the original log by adopting a preset regular expression to obtain the log to be detected.
In one embodiment, the method further comprises the following steps:
inquiring an exception removing guide corresponding to the exception type according to the exception type of the log to be detected;
and pushing the exception eliminating guide to a user side so that the user can eliminate the exception existing in the website according to the exception eliminating guide.
In one embodiment, the method further comprises the following steps:
acquiring memory data corresponding to the trained abnormal type classification model;
serializing the memory data to obtain a data serialization file corresponding to the trained abnormal type classification model;
and storing the data serialization file.
In an embodiment of the present invention, a website testing apparatus includes:
the acquisition module is used for acquiring the log to be detected; the log to be detected is a log generated by testing a website;
the extraction module is used for extracting the text paragraph characteristics in the log to be detected; the text paragraph features are features corresponding to text paragraphs of the log to be detected;
the classification module is used for classifying the text paragraph features to obtain an abnormal classification result; and determining the abnormal type of the website according to the abnormal classification result.
The computer device in the embodiment of the invention comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the following steps when executing the computer program:
acquiring a log to be detected; the log to be detected is a log generated by testing a website;
extracting text paragraph features in the log to be detected; the text paragraph features are features corresponding to text paragraphs of the log to be detected;
classifying the text paragraph features to obtain an abnormal classification result; and determining the abnormal type of the website according to the abnormal classification result.
A computer-readable storage medium in an embodiment of the present invention, on which a computer program is stored, the computer program, when executed by a processor, implementing the steps of:
acquiring a log to be detected; the log to be detected is a log generated by testing a website;
extracting text paragraph features in the log to be detected; the text paragraph features are features corresponding to text paragraphs of the log to be detected;
classifying the text paragraph features to obtain an abnormal classification result; and determining the abnormal type of the website according to the abnormal classification result.
In the website testing method, the website testing device, the computer equipment and the storage medium in the embodiment, the log to be tested generated by testing the website is obtained; then, extracting the characteristics corresponding to the text paragraphs in the log to be detected to obtain the characteristics of the text paragraphs; then, classifying the text paragraph features to obtain an abnormal classification result; and according to the abnormal classification result, the abnormal type of the website is determined, so that the automatic test of the website test logs with different formats can be flexibly realized, a tester does not need to spend a large amount of time to read the analysis logs with various and complicated contents to determine the abnormal type of the website, and the test efficiency of the website is improved.
Drawings
FIG. 1 is a diagram of an exemplary environment in which a method for testing a website may be implemented;
FIG. 2 is a flowchart illustrating a website testing method according to an embodiment;
FIG. 3 is a schematic flow chart diagram illustrating the feature extraction step of a website testing method in one embodiment;
FIG. 4 is a diagram of an application environment of a website testing method in another embodiment;
FIG. 5 is a flowchart illustrating a website testing method according to another embodiment;
FIG. 6 is a block diagram of a website test apparatus according to an embodiment;
FIG. 7 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The website testing method provided by the embodiment of the application can be applied to the application environment shown in fig. 1. The server 110 first obtains a log to be detected; the log to be detected is a log generated by testing a website; then, the server 110 extracts the text paragraph features in the log to be detected; the text paragraph features are features corresponding to text paragraphs of the log to be detected; finally, the server 110 identifies the abnormal type of the website according to the text paragraph characteristics. In practical application. The server 110 may be implemented as a stand-alone server or as a server cluster comprising a plurality of servers.
In one embodiment, as shown in fig. 2, there is provided a website testing method, including the steps of:
s210, acquiring the log to be detected.
The log to be detected can be a website test log waiting for detecting the website abnormity type
The log to be detected is a log generated by testing the website.
In specific implementation, a tester can test the manufactured website through a pre-written test script. The test script tests various functions of the website, such as a pressure test, a connection speed test, a load test or a safety test. When the test script tests that the website has errors or abnormalities, the test script generates a corresponding website test log for the website. And finally, determining the log to be detected according to the website test log so that the server 110 can obtain the log to be detected.
S220, extracting the text paragraph features in the log to be detected.
The text paragraph features are features corresponding to each text paragraph in the log to be detected.
In a specific implementation, after the server 110 obtains the log to be detected, the server 110 analyzes the log to be detected, and determines each text paragraph in the log to be detected. Then, the server 110 performs feature extraction on each text paragraph in the log to be detected, so as to obtain a feature corresponding to each text paragraph in the log to be detected, and names the feature corresponding to each text paragraph in the log to be detected as a text paragraph feature.
In practical application, the server 110 may specifically perform preprocessing on each text paragraph in the log to be detected and input the preprocessed text paragraph into a pre-trained feature extraction neural network during feature extraction of each text paragraph in the log to be detected, extract features corresponding to each text paragraph through the feature extraction neural network, and finally extract an output result of the neural network according to the features, where the features of the text paragraphs in the log to be detected are extracted.
S230, classifying the text paragraph features to obtain an abnormal classification result; and determining the abnormal type of the website according to the abnormal classification result.
The exception type may refer to an error or exception type occurring when the website tests. In practical applications, the exception types may include error reporting during website execution, error reporting during website configuration, and error reporting in website environment. Website product line error reporting, etc.
In a specific implementation, after the server 110 extracts the text paragraph features in the log to be detected, the text paragraph features may be used as input parameters of a pre-trained log classification model, input into the pre-trained log classification model, and then obtain an abnormal classification result output by the pre-trained log classification model; finally, the server 110 determines the abnormal type of the website according to the abnormal classification result.
In practical applications, the pre-trained log classification model may be an SVM (Support Vector Machine). SVMs are a class of classifiers that classify data in a supervised learning (supervised learning) manner.
In addition, after the server 110 extracts the text paragraph features in the log to be detected, the abnormal classification result can be obtained by calculating the feature similarity between the text paragraph features and each abnormal paragraph feature and classifying the text paragraph features according to the feature similarity. Specifically, the server 110 takes the abnormal paragraph feature with the highest similarity as the target abnormal paragraph feature. And taking the target abnormal paragraph characteristics as an abnormal classification result; finally, the server 110 determines the target abnormal paragraph feature corresponding to the abnormal classification result, and finally, the server 110 takes the known abnormal type corresponding to the target abnormal paragraph feature as the currently existing abnormal type of the website.
The abnormal paragraph feature may refer to a text paragraph feature corresponding to a website test log generated according to a website with a known abnormal type.
In practical applications, the abnormal paragraph features include a plurality. For example, a first exception paragraph feature corresponding to an error report during execution of the website, a second exception paragraph feature corresponding to an error report during configuration of the website, a third exception paragraph feature corresponding to an error report in environment of the website, a fourth exception paragraph feature corresponding to an error report in product line of the website, and the like.
In the website testing method, a log to be detected generated by testing a website is obtained; then, extracting the characteristics corresponding to the text paragraphs in the log to be detected to obtain the characteristics of the text paragraphs; then, classifying the text paragraph features to obtain an abnormal classification result; and according to the abnormal classification result, the abnormal type of the website is determined, so that the automatic test of the website test logs with different formats can be flexibly realized, a tester does not need to spend a large amount of time to read the analysis logs with various and complicated contents to determine the abnormal type of the website, and the test efficiency of the website is improved.
In another embodiment, extracting text paragraph features in the log to be detected includes: acquiring a text paragraph in a log to be detected; inputting the text paragraphs into a pre-trained feature extraction model, and determining target paragraph vectors corresponding to the text paragraphs according to output results of the pre-trained feature extraction model; and taking the target paragraph vector corresponding to the text paragraph as the text paragraph characteristic.
In a specific implementation, the server 110 specifically includes extracting text paragraph features in the log to be detected; the server 110 determines text paragraphs in the log to be detected; inputting the text paragraphs into a pre-trained feature extraction model, more specifically, identifying the text paragraphs in the log to be detected by the server 110, and inputting the text paragraphs into the pre-trained feature extraction model as input parameters of the pre-trained feature extraction model respectively; then, the server 110 determines a target paragraph vector corresponding to the text paragraph according to an output result of the pre-trained feature extraction model; finally, the server 110 determines the text paragraph features according to the target paragraph vector corresponding to the text paragraph.
According to the technical scheme of the embodiment, text paragraphs in the log to be detected are determined; inputting the text paragraphs into a pre-trained feature extraction model; therefore, the target paragraph vector corresponding to the text paragraph can be quickly determined; and determining the characteristics of the text paragraphs according to the target paragraph vectors corresponding to the text paragraphs, so that the identification efficiency of the abnormal types of the websites is improved, and the test efficiency of the websites is improved.
In another embodiment, obtaining a text paragraph in the log to be detected includes: determining paragraphs to be spliced in the log to be detected; wherein, the paragraph to be spliced has a plurality of; and splicing the paragraphs to be spliced to obtain the text paragraphs in the log to be detected.
The paragraphs to be spliced may refer to text paragraphs that have not been spliced in the log to be detected.
In a specific implementation, in a process of acquiring a text paragraph in a log to be detected by the server 110, the method specifically includes: the server 110 identifies a plurality of paragraphs to be spliced in the log to be detected; then, carrying out the operation; the server 110 splices the plurality of paragraphs to be spliced to obtain spliced text paragraphs; and using the spliced text paragraphs as text paragraphs in the log to be detected.
According to the technical scheme of the embodiment, a plurality of paragraphs to be spliced in the log to be detected are spliced to obtain a complete text paragraph in the log to be detected; facilitating input of the entire text passage into a pre-trained feature extraction model; therefore, the target paragraph vector corresponding to the text paragraph can be quickly determined; and determining the characteristics of the text paragraphs according to the target paragraph vectors corresponding to the text paragraphs, and simultaneously realizing characteristic classification by combining the document characteristics corresponding to the whole log to be detected, thereby improving the accuracy of website abnormal type identification and further improving the testing efficiency of the website.
In another embodiment, referring to fig. 3, inputting the text paragraphs into the pre-trained feature extraction model, and determining the target paragraph vectors corresponding to the text paragraphs according to the output result of the pre-trained feature extraction model specifically includes the following steps: s310, in the text paragraph, determining a target prediction word and a sample word; s320, generating an initial paragraph vector of the text paragraph, and obtaining a word vector corresponding to the sample word; s330, inputting the initial paragraph vector and the word vector corresponding to the sample word into a pre-trained feature extraction model to generate a predicted word; s340, adjusting the initial paragraph vector according to the predicted word and the target predicted word to obtain an adjusted initial paragraph vector; and S350, taking the adjusted initial paragraph vector as a target paragraph vector corresponding to the text paragraph.
Where a text passage includes a plurality of words, a word may refer to each of the words that make up the text passage. For example, in the text paragraph "(INFO) STARTING SCENARO" Search an activity to book tissue page "there are words such as" INFO "," STARTING "," SCENARO "," Search "," an "," activity "," book "," page "," title ", etc.
Wherein the target predicted word is a word in any one of the plurality of words.
Wherein the sample word is a word other than the target predicted word among the plurality of words.
In practical applications, in the text paragraph "(INFO) STARTING SCENARO: Search an activity book tissue page", when the target predicted word is "activity", the sample words are divided into "INFO", "STARTING", "SCENARO", "Search", "an", "book", "page" and "title", respectively.
The predicted words are words obtained by predicting words except for the sample words in the plurality of words through a pre-trained feature extraction model.
In a specific implementation, in the process of respectively inputting a text paragraph to a pre-trained feature extraction model and determining a target paragraph vector corresponding to the text paragraph according to an output result of the pre-trained feature extraction model, the server 110 determines a target prediction word and a sample word in the text paragraph. The server 110 randomly generates an initial paragraph vector of a text paragraph and obtains a word vector corresponding to a sample word in a word vector database; then, the server 110 inputs the feature vector obtained by cascading or averaging the initial paragraph vector and the word vector corresponding to the sample word as an input parameter of the pre-trained feature extraction model to the pre-trained feature extraction model, so that the pre-trained feature extraction model generates a predicted word according to the input parameter.
The server 110 then determines the loss of the feature extraction model based on the predicted word and the target predicted word. The server 110 then adjusts the initial paragraph vector using a stochastic gradient descent method based on the loss of the feature extraction model. And continuously iterating and adjusting in a sliding window mode according to the steps until the target predicted word traverses each word in the text paragraphs, so that the server 110 obtains an adjusted initial paragraph vector as a target paragraph vector corresponding to the text paragraphs, and further mapping each text paragraph in the log to be detected into a vector space. In practical applications, the target paragraph vector corresponding to the text paragraph can be represented by one column of the matrix. The vector of each word in a text passage may be represented by a column of the matrix.
According to the technical scheme of the embodiment, a server determines a target prediction word and a sample word in a text paragraph; then, the server generates an initial paragraph vector of the text paragraph and obtains a word vector corresponding to the sample word; inputting the initial paragraph vector and the word vector corresponding to the sample word into a pre-trained feature extraction model to generate a predicted word; finally, the server adjusts the initial paragraph vector according to the predicted word and the target predicted word to obtain an adjusted initial paragraph vector which is used as a target paragraph vector corresponding to the text paragraph; therefore, the target paragraph vector corresponding to the text paragraph semantic meaning can be obtained, and the text paragraph characteristic corresponding to the text paragraph can be accurately obtained, so that the accuracy of website abnormal type identification is improved, and the testing efficiency of the website is improved.
In another embodiment, the text paragraph features are classified to obtain an abnormal classification result; and according to the abnormal classification result, determining the abnormal type of the website, including: inputting the text paragraph features into a pre-trained abnormal type classification model; the pre-trained abnormal type classification model is used for classifying the characteristics of the text paragraphs and outputting corresponding abnormal classification results; and determining the abnormal type of the website according to the abnormal classification result output by the pre-trained abnormal type classification model.
In a specific implementation, after the server 110 extracts the text paragraph features in the log to be detected, the text paragraph features may be used as input parameters of a pre-trained abnormal type classification model, input into the pre-trained abnormal type classification model, and then obtain an abnormal classification result output by the pre-trained abnormal type classification model; finally, the server 110 determines the abnormal type of the website according to the abnormal classification result.
In practical applications, the pre-trained log classification model may be an SVM (Support Vector Machine). SVMs are a class of classifiers that classify data in a supervised learning (supervised learning) manner.
In addition, after the server 110 extracts the text paragraph features in the log to be detected, paragraph vectors corresponding to a plurality of abnormal paragraph features can be obtained; calculating the vector distance between the paragraph vector corresponding to the text paragraph feature and the paragraph vector corresponding to each abnormal paragraph feature as the feature similarity between the text paragraph feature and each abnormal paragraph feature; and classifying the text paragraph features according to the feature similarity to obtain an abnormal classification result, and determining the abnormal type of the website according to the abnormal classification result.
In a specific implementation, the server 110 first obtains paragraph vectors corresponding to a plurality of abnormal paragraph features; and then, calculating Euclidean distance between the paragraph vector corresponding to the text paragraph feature and the paragraph vector corresponding to the abnormal paragraph feature as a vector distance. Then, the server 110 takes the vector distance as the feature similarity between the text paragraph features and each abnormal paragraph feature pre-stored in the database; then, the server 110 classifies the text paragraph features according to the feature similarity, and outputs an abnormal classification result. Specifically, the server 110 uses the abnormal paragraph feature corresponding to the highest feature similarity as the target abnormal paragraph feature, and uses the target abnormal paragraph feature as the abnormal classification result. Finally, the server 110 uses the website exception type corresponding to the target exception paragraph feature as the current exception type of the website. According to the technical scheme, the accuracy of identifying the abnormal types of the websites can be improved as much as possible, and further the testing efficiency of the websites is improved.
In another embodiment, the method further comprises: constructing an abnormal type classification model to be trained; obtaining a text paragraph feature sample as a training sample of an abnormal type classification model to be trained; determining an abnormal type corresponding to the text paragraph feature sample as a classification label of the text paragraph feature sample; training an abnormal type classification model to be trained according to the text paragraph feature samples and the abnormal types corresponding to the text paragraph feature samples to obtain a trained abnormal type classification model; and taking the trained abnormal type classification model as a pre-trained abnormal type classification model.
The text paragraph feature sample may refer to a text paragraph feature corresponding to a website test log of a known abnormal type.
In practical application, the website test logs of known abnormal types can be input into the pre-trained feature extraction model, and text paragraph feature samples corresponding to the website test logs of known abnormal types can be obtained according to the output result of the pre-trained feature extraction model.
In a specific implementation, before the server 110 uses the pre-trained abnormal type classification model, the server 110 may construct an abnormal type classification model to be trained; then, the server 110 obtains a text paragraph feature sample as a training sample of the abnormal type classification model to be trained; meanwhile, the server 110 determines the abnormal type corresponding to the text paragraph feature sample as a classification label of the text paragraph feature sample; then, the server 110 trains the abnormal type classification model to be trained according to the text paragraph feature samples and the abnormal types corresponding to the text paragraph feature samples to obtain a trained abnormal type classification model; finally, the server 110 takes the trained anomaly type classification model as a pre-trained anomaly type classification model.
In practical application, the abnormal type classification model to be trained may be a support vector machine with a multi-classification function, where the support vector machine may be composed of a plurality of sub-support vector machines, and a combination strategy of one vs rest (a training method of the support vector machine) may be used to train the support vector machine when the abnormal type classification model to be trained is trained.
According to the technical scheme of the embodiment, the abnormal type classification model to be trained is constructed, and the abnormal type classification model to be trained is trained according to the text paragraph feature sample and the abnormal type corresponding to the text paragraph feature sample, so that the trained abnormal type classification model is obtained; finally, the trained abnormal type classification model is used as a pre-trained abnormal type classification model; therefore, the pre-trained abnormal type classification model can accurately output the abnormal classification result according to the text paragraph characteristics, so that the accuracy of website abnormal type identification is improved, and the testing efficiency of the website is improved.
In another embodiment, the method further comprises: acquiring an original log; and filtering irrelevant data in the original log by adopting a preset regular expression to obtain the log to be detected.
Wherein, the original log may refer to an unprocessed network test log.
The irrelevant data may refer to data irrelevant to the test content and the test result.
In a specific implementation, before the server 110 obtains the log to be detected, the server 110 collects the unprocessed network test log, i.e., the original log. Then, the server 110 cleans the original log data, and filters out irrelevant data irrelevant to the test content and the test result in the original log to obtain the log to be detected.
In practical application, the server 110 obtains an original log from a database, for example, a mongodb database, then the server 110 extracts data related to the test content and the test result from the original log by using a regular expression preset by a developer, so as to filter the data unrelated to the test content and the test result from the original log, and finally the server 110 adjusts the format of the extracted data, so as to obtain a log to be detected.
According to the technical scheme, before the server acquires the log to be detected, the original log is acquired and preprocessed, irrelevant data in the original log is filtered, and the log to be detected with the data relevant to the test content and the test result is acquired.
In another embodiment, the website testing method described above can also be applied to the application environment shown in fig. 4. The server 110 and the client 120 may perform communication connection through a network, and the server 110 first queries an exception removal guide corresponding to an exception type according to the exception type of the log to be detected; then, the server 110 pushes an exception exclusion guide to the user terminal 120, so that the user can exclude the existing exception of the website according to the exception exclusion guide.
In practical application. The server 110 may be implemented as a stand-alone server or as a server cluster comprising a plurality of servers. The user end 120 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices
The abnormality exclusion guidance may be operation guidance for guiding a detection person to debug a website with an abnormality.
In practical applications, the exception-removing guide may be an operation guide document, an operation guide video, or the like.
In a specific implementation, after the server 110 determines the abnormal type corresponding to the log to be detected, the server 110 queries, according to the abnormal type of the log to be detected, an abnormal exclusion guide having a mapping relationship with the abnormal type in a preset database; finally, the server 110 sends the exception eliminating guide to the user terminal 120, so that the user can eliminate the exception existing in the website according to the exception eliminating guide after using the user terminal 120 to check the exception eliminating guide.
According to the technical scheme of the embodiment, after the server judges the current abnormal type of the website, the server inquires the abnormal removing guide corresponding to the abnormal type according to the abnormal type of the log to be detected; and the abnormal exclusion guide is pushed to the user side for the user to check, so that the user can quickly exclude the abnormal condition of the website according to the abnormal exclusion guide, the functions of the website are close to perfect, the times of repeated tests on the website are reduced, and the efficiency of the test personnel for testing the website is improved.
In another embodiment, the method further comprises: acquiring memory data corresponding to the trained abnormal type classification model; serializing the memory data to obtain a data serialization file corresponding to the trained abnormal type classification model; the data serialization file is stored.
The memory data may refer to data stored in the memory of the server 110 for direct operation.
In a specific implementation, when the server 110 trains an abnormal type classification model to be trained to obtain the trained abnormal type classification model, the server 110 obtains memory data corresponding to the trained abnormal type classification model; then, the server 110 serializes the memory data corresponding to the trained abnormal type classification model to obtain a data serialization file corresponding to the trained abnormal type classification model; finally, the server 110 stores the data serialization file on a local hard disk device.
For example, based on a python (a programming language) platform, the server 110 may perform serialization and persistence on the memory data corresponding to the trained abnormal type classification model by calling a pickle module of the python itself, so as to obtain a data serialization file corresponding to the trained abnormal type classification model; finally, the server 110 stores the data serialization file on a local hard disk device.
According to the technical scheme of the embodiment, memory data corresponding to the trained abnormal type classification model is obtained; the memory data are serialized, and the obtained data serialization file is stored, so that a user can conveniently archive or copy the trained abnormal type classification model, the reusability of the trained abnormal type classification model is improved, and the efficiency of testing various websites by testers is improved.
In another embodiment, referring to fig. 5, a website testing method is provided, which specifically includes the following steps: s510, acquiring a log to be detected; the log to be detected is a log generated by testing a website. S520, determining the text paragraphs in the log to be detected. S530, inputting the text paragraphs to a pre-trained feature extraction model, and determining target paragraph vectors corresponding to the text paragraphs according to output results of the pre-trained feature extraction model. S540, determining paragraphs to be spliced in the log to be detected; wherein, the paragraph to be spliced has a plurality of. And S550, splicing the paragraphs to be spliced to obtain the text paragraphs in the log to be spliced. And S560, inputting the text paragraphs into a pre-trained feature extraction model, and determining target paragraph vectors corresponding to the text paragraphs according to output results of the pre-trained feature extraction model. S570, using the target paragraph vector corresponding to the text paragraph as the text paragraph feature. S580, inputting the text paragraph features into a pre-trained abnormal type classification model; and the pre-trained abnormal type classification model is used for classifying the text paragraph features and outputting a corresponding abnormal classification result. And S590, determining the abnormal type of the website according to the abnormal classification result output by the pre-trained abnormal type classification model.
According to the website testing method, the log to be detected generated by testing the website is obtained; then, extracting the characteristics corresponding to the text paragraphs in the log to be detected to obtain the characteristics of the text paragraphs; then, classifying the text paragraph features to obtain an abnormal classification result; and according to the abnormal classification result, the abnormal type of the website is determined, so that the automatic test of the website test logs with different formats can be flexibly realized, a tester does not need to spend a large amount of time to read the analysis logs with various and complicated contents to determine the abnormal type of the website, and the test efficiency of the website is improved.
It should be understood that although the steps in the flowcharts of fig. 2, 3 and 5 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2, 3, and 5 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed alternately or alternatingly with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 6, there is provided a website testing apparatus, including:
an obtaining module 610, configured to obtain a log to be detected; the log to be detected is a log generated by testing a website.
An extracting module 620, configured to extract text paragraph features in the log to be detected; the text paragraph features are features corresponding to text paragraphs of the log to be detected.
A classification module 630, configured to classify the text paragraph features to obtain an abnormal classification result; and determining the abnormal type of the website according to the abnormal classification result.
The website testing device obtains a log to be detected generated by testing a website; then, extracting the characteristics corresponding to the text paragraphs in the log to be detected to obtain the characteristics of the text paragraphs; then, classifying the text paragraph features to obtain an abnormal classification result; and according to the abnormal classification result, the abnormal type of the website is determined, so that the automatic test of the website test logs with different formats can be flexibly realized, a tester does not need to spend a large amount of time to read the analysis logs with various and complicated contents to determine the abnormal type of the website, and the test efficiency of the website is improved.
In one embodiment, the extracting module 620 includes: the paragraph determining submodule is used for acquiring text paragraphs in the log to be detected; the vector determination submodule is used for inputting the text paragraphs into a pre-trained feature extraction model and determining target paragraph vectors corresponding to the text paragraphs according to output results of the pre-trained feature extraction model; and the characteristic determining submodule is used for taking the target paragraph vector corresponding to the text paragraph as the text paragraph characteristic.
In one embodiment, the log to be detected includes a plurality of text paragraphs, and the paragraph determination sub-module is specifically configured to determine paragraphs to be spliced in the log to be detected; wherein, the paragraph to be spliced is provided with a plurality of paragraphs; and splicing the paragraphs to be spliced to obtain the text paragraphs in the log to be detected.
In one embodiment, the text passage includes a plurality of words, and the vector determination sub-module is configured to determine a target predicted word and a sample word in the text passage; wherein the target predicted word is a word in any one of the plurality of words; the sample word is a word in the plurality of words other than the target predicted word; generating an initial paragraph vector of the text paragraph, and obtaining a word vector corresponding to the sample word; inputting the initial paragraph vector and the word vector corresponding to the sample word into the pre-trained feature extraction model to generate a predicted word; the predicted words are words obtained by predicting words except the sample words in the plurality of words by the pre-trained feature extraction model; adjusting the initial paragraph vector according to the predicted word and the target predicted word to obtain an adjusted initial paragraph vector; and taking the adjusted initial paragraph vector as a target paragraph vector corresponding to the text paragraph.
In one embodiment, the classification module 630 includes: the input submodule is used for inputting the text paragraph features into a pre-trained abnormal type classification model; the pre-trained abnormal type classification model is used for classifying the text paragraph features and outputting a corresponding abnormal classification result; the type determining submodule is used for determining the abnormal type of the website according to the abnormal classification result output by the pre-trained abnormal type classification model; or, the vector obtaining submodule is used for obtaining paragraph vectors corresponding to the plurality of abnormal paragraph features; the calculation submodule is used for calculating the vector distance between the paragraph vector corresponding to the text paragraph feature and the paragraph vector corresponding to each abnormal paragraph feature, and the vector distance is used as the feature similarity between the text paragraph feature and each abnormal paragraph feature; and the abnormality classification submodule is used for classifying the text paragraph features according to the feature similarity to obtain an abnormality classification result, and determining the abnormality type of the website according to the abnormality classification result.
The input submodule is used for inputting the text paragraph features into a pre-trained abnormal type classification model; the pre-trained abnormal type classification model is used for calculating the vector distance between the feature vector corresponding to the text paragraph feature and the feature vector corresponding to the abnormal paragraph feature; the vector distance is used as the feature similarity between the text paragraph feature and the abnormal paragraph feature; and the text paragraph features are classified according to the feature similarity, and the abnormal classification result is output.
In one embodiment, the website testing apparatus further includes: the building module is used for building an abnormal type classification model to be trained; the sample acquisition module is used for acquiring a text paragraph feature sample as a training sample of the abnormal type classification model to be trained; the label acquisition module is used for determining the abnormal type corresponding to the text paragraph feature sample and taking the abnormal type as a classification label aiming at the text paragraph feature sample; the training module is used for training the abnormal type classification model to be trained according to the text paragraph feature sample and the abnormal type corresponding to the text paragraph feature sample to obtain a trained abnormal type classification model; and the model determining module is used for taking the trained abnormal type classification model as the pre-trained abnormal type classification model.
In one embodiment, the website testing apparatus further includes: the memory data acquisition module is used for acquiring memory data corresponding to the trained abnormal type classification model; the serial number module is used for serializing the memory data to obtain a data serialization file corresponding to the trained abnormal type classification model; and the storage module is used for storing the data serialization file.
In one embodiment, the website testing apparatus further includes: the original log obtaining module is used for obtaining an original log; and the filtering module is used for filtering the irrelevant data in the original log by adopting a preset regular expression to obtain the log to be detected.
In one embodiment, the website testing apparatus further includes: the query module is used for querying an exception eliminating guide corresponding to the exception type according to the exception type of the log to be detected; and the pushing module is used for pushing the exception eliminating guide to a user side so that the user can eliminate the exception existing in the website according to the exception eliminating guide.
For the specific definition of the website testing apparatus, reference may be made to the above definition of the website testing method, which is not described herein again. All or part of each module in the website test device can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing website test data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a website testing method.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
s210, acquiring a log to be detected; the log to be detected is a log generated by testing a website;
s220, extracting the text paragraph features in the log to be detected; the text paragraph features are features corresponding to text paragraphs of the log to be detected;
s230, classifying the text paragraph features to obtain an abnormal classification result; and determining the abnormal type of the website according to the abnormal classification result.
In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring a text paragraph in the log to be detected; inputting the text paragraphs into a pre-trained feature extraction model, and determining target paragraph vectors corresponding to the text paragraphs according to output results of the pre-trained feature extraction model; and taking the target paragraph vector corresponding to the text paragraph as the text paragraph feature.
In one embodiment, the processor, when executing the computer program, further performs the steps of: determining paragraphs to be spliced in the log to be detected; wherein, the paragraph to be spliced is provided with a plurality of paragraphs; and splicing the paragraphs to be spliced to obtain the text paragraphs in the log to be detected.
In one embodiment, the text passage comprises a plurality of words, and the processor when executing the computer program further performs the steps of: in the text passage, determining a target prediction word and a sample word; wherein the target predicted word is a word in any one of the plurality of words; the sample word is a word in the plurality of words other than the target predicted word; generating an initial paragraph vector of the text paragraph, and obtaining a word vector corresponding to the sample word; inputting the initial paragraph vector and the word vector corresponding to the sample word into the pre-trained feature extraction model to generate a predicted word; the predicted words are words obtained by predicting words except the sample words in the plurality of words by the pre-trained feature extraction model; adjusting the initial paragraph vector according to the predicted word and the target predicted word to obtain an adjusted initial paragraph vector; and taking the adjusted initial paragraph vector as a target paragraph vector corresponding to the text paragraph.
In one embodiment, the processor, when executing the computer program, further performs the steps of: inputting the text paragraph features into a pre-trained abnormal type classification model; the pre-trained abnormal type classification model is used for classifying the text paragraph features and outputting a corresponding abnormal classification result; determining the abnormal type of the website according to the abnormal classification result output by the pre-trained abnormal type classification model;
or
Acquiring paragraph vectors corresponding to a plurality of abnormal paragraph features; calculating the vector distance between the paragraph vector corresponding to the text paragraph feature and the paragraph vector corresponding to each abnormal paragraph feature as the feature similarity between the text paragraph feature and each abnormal paragraph feature; classifying the text paragraph features according to the feature similarity to obtain the abnormal classification result, and determining the abnormal type of the website according to the abnormal classification result.
In one embodiment, the processor, when executing the computer program, further performs the steps of: constructing an abnormal type classification model to be trained; obtaining a text paragraph feature sample as a training sample of the abnormal type classification model to be trained; determining an abnormal type corresponding to the text paragraph feature sample as a classification label for the text paragraph feature sample; training the abnormal type classification model to be trained according to the text paragraph feature sample and the abnormal type corresponding to the text paragraph feature sample to obtain a trained abnormal type classification model; and taking the trained abnormal type classification model as the pre-trained abnormal type classification model.
In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring an original log; and filtering irrelevant data in the original log by adopting a preset regular expression to obtain the log to be detected.
In one embodiment, the processor, when executing the computer program, further performs the steps of: inquiring an exception removing guide corresponding to the exception type according to the exception type of the log to be detected; and pushing the exception eliminating guide to a user side so that the user can eliminate the exception existing in the website according to the exception eliminating guide.
In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring memory data corresponding to the trained abnormal type classification model; serializing the memory data to obtain a data serialization file corresponding to the trained abnormal type classification model; and storing the data serialization file.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
s210, acquiring a log to be detected; the log to be detected is a log generated by testing a website;
s220, extracting the text paragraph features in the log to be detected; the text paragraph features are features corresponding to text paragraphs of the log to be detected;
s230, classifying the text paragraph features to obtain an abnormal classification result; and determining the abnormal type of the website according to the abnormal classification result.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring a text paragraph in the log to be detected; inputting the text paragraphs into a pre-trained feature extraction model, and determining target paragraph vectors corresponding to the text paragraphs according to output results of the pre-trained feature extraction model; and taking the target paragraph vector corresponding to the text paragraph as the text paragraph feature.
In one embodiment, the computer program when executed by the processor further performs the steps of: determining paragraphs to be spliced in the log to be detected; wherein, the paragraph to be spliced is provided with a plurality of paragraphs; and splicing the paragraphs to be spliced to obtain the text paragraphs in the log to be detected.
In one embodiment, the text passage comprises a plurality of words, the computer program when executed by the processor further performing the steps of, in the text passage, determining a target predicted word and a sample word; wherein the target predicted word is a word in any one of the plurality of words; the sample word is a word in the plurality of words other than the target predicted word; generating an initial paragraph vector of the text paragraph, and obtaining a word vector corresponding to the sample word; inputting the initial paragraph vector and the word vector corresponding to the sample word into the pre-trained feature extraction model to generate a predicted word; the predicted words are words obtained by predicting words except the sample words in the plurality of words by the pre-trained feature extraction model; adjusting the initial paragraph vector according to the predicted word and the target predicted word to obtain an adjusted initial paragraph vector; and taking the adjusted initial paragraph vector as a target paragraph vector corresponding to the text paragraph.
In one embodiment, the computer program when executed by the processor further performs the steps of: inputting the text paragraph features into a pre-trained abnormal type classification model; the pre-trained abnormal type classification model is used for classifying the text paragraph features and outputting a corresponding abnormal classification result; determining the abnormal type of the website according to the abnormal classification result output by the pre-trained abnormal type classification model;
or
Acquiring paragraph vectors corresponding to a plurality of abnormal paragraph features; calculating the vector distance between the paragraph vector corresponding to the text paragraph feature and the paragraph vector corresponding to each abnormal paragraph feature as the feature similarity between the text paragraph feature and each abnormal paragraph feature; classifying the text paragraph features according to the feature similarity to obtain the abnormal classification result, and determining the abnormal type of the website according to the abnormal classification result.
In one embodiment, the computer program when executed by the processor further performs the steps of: constructing an abnormal type classification model to be trained; obtaining a text paragraph feature sample as a training sample of the abnormal type classification model to be trained; determining an abnormal type corresponding to the text paragraph feature sample as a classification label for the text paragraph feature sample; training the abnormal type classification model to be trained according to the text paragraph feature sample and the abnormal type corresponding to the text paragraph feature sample to obtain a trained abnormal type classification model; and taking the trained abnormal type classification model as the pre-trained abnormal type classification model.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring an original log; and filtering irrelevant data in the original log by adopting a preset regular expression to obtain the log to be detected.
In one embodiment, the computer program when executed by the processor further performs the steps of: inquiring an exception removing guide corresponding to the exception type according to the exception type of the log to be detected; and pushing the exception eliminating guide to a user side so that the user can eliminate the exception existing in the website according to the exception eliminating guide.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring memory data corresponding to the trained abnormal type classification model; serializing the memory data to obtain a data serialization file corresponding to the trained abnormal type classification model; and storing the data serialization file.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (12)

1. A method for testing a website, the method comprising:
acquiring a log to be detected; the log to be detected is a log generated by testing a website;
extracting text paragraph features in the log to be detected; the text paragraph features are features corresponding to text paragraphs of the log to be detected;
classifying the text paragraph features to obtain an abnormal classification result; and determining the abnormal type of the website according to the abnormal classification result.
2. The method according to claim 1, wherein the extracting text passage features in the log to be detected comprises:
acquiring a text paragraph in the log to be detected;
inputting the text paragraphs into a pre-trained feature extraction model, and determining target paragraph vectors corresponding to the text paragraphs according to output results of the pre-trained feature extraction model;
and taking the target paragraph vector corresponding to the text paragraph as the text paragraph feature.
3. The method according to claim 2, wherein the obtaining of the text passage in the log to be detected comprises:
determining paragraphs to be spliced in the log to be detected; wherein, the paragraph to be spliced is provided with a plurality of paragraphs;
and splicing the paragraphs to be spliced to obtain the text paragraphs in the log to be detected.
4. The method according to claim 2, wherein the text paragraphs include a plurality of words, and the inputting the text paragraphs into pre-trained feature extraction models respectively and determining the target paragraph vectors corresponding to the text paragraphs according to the output results of the pre-trained feature extraction models comprises:
in the text passage, determining a target prediction word and a sample word; wherein the target predicted word is a word in any one of the plurality of words; the sample word is a word in the plurality of words other than the target predicted word;
generating an initial paragraph vector of the text paragraph, and obtaining a word vector corresponding to the sample word;
inputting the initial paragraph vector and the word vector corresponding to the sample word into the pre-trained feature extraction model to generate a predicted word; the predicted words are words obtained by predicting words except the sample words in the plurality of words by the pre-trained feature extraction model;
adjusting the initial paragraph vector according to the predicted word and the target predicted word to obtain an adjusted initial paragraph vector;
and taking the adjusted initial paragraph vector as a target paragraph vector corresponding to the text paragraph.
5. The method according to claim 1, wherein the text paragraph features are classified to obtain an abnormal classification result; and according to the abnormal classification result, determining the abnormal type of the website, including:
inputting the text paragraph features into a pre-trained abnormal type classification model; the pre-trained abnormal type classification model is used for classifying the text paragraph features and outputting a corresponding abnormal classification result;
determining the abnormal type of the website according to the abnormal classification result output by the pre-trained abnormal type classification model;
or
Acquiring paragraph vectors corresponding to a plurality of abnormal paragraph features;
calculating the vector distance between the paragraph vector corresponding to the text paragraph feature and the paragraph vector corresponding to each abnormal paragraph feature as the feature similarity between the text paragraph feature and each abnormal paragraph feature;
classifying the text paragraph features according to the feature similarity to obtain the abnormal classification result, and determining the abnormal type of the website according to the abnormal classification result.
6. The method of claim 5, further comprising:
constructing an abnormal type classification model to be trained;
obtaining a text paragraph feature sample as a training sample of the abnormal type classification model to be trained;
determining an abnormal type corresponding to the text paragraph feature sample as a classification label for the text paragraph feature sample;
training the abnormal type classification model to be trained according to the text paragraph feature sample and the abnormal type corresponding to the text paragraph feature sample to obtain a trained abnormal type classification model;
and taking the trained abnormal type classification model as the pre-trained abnormal type classification model.
7. The method of claim 6, further comprising:
acquiring memory data corresponding to the trained abnormal type classification model;
serializing the memory data to obtain a data serialization file corresponding to the trained abnormal type classification model;
and storing the data serialization file.
8. The method of any one of claims 1 to 6, further comprising:
acquiring an original log;
and filtering irrelevant data in the original log by adopting a preset regular expression to obtain the log to be detected.
9. The method of any one of claims 1 to 6, further comprising:
inquiring an exception removing guide corresponding to the exception type according to the exception type of the log to be detected;
and pushing the exception eliminating guide to a user side.
10. A website testing apparatus, the apparatus comprising:
the acquisition module is used for acquiring the log to be detected; the log to be detected is a log generated by testing a website;
the extraction module is used for extracting the text paragraph characteristics in the log to be detected; the text paragraph features are features corresponding to text paragraphs of the log to be detected;
the classification module is used for classifying the text paragraph features to obtain an abnormal classification result; and determining the abnormal type of the website according to the abnormal classification result.
11. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 9 when executing the computer program.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 9.
CN201911139293.0A 2019-11-20 2019-11-20 Website testing method, device, computer equipment and storage medium Active CN111143191B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911139293.0A CN111143191B (en) 2019-11-20 2019-11-20 Website testing method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911139293.0A CN111143191B (en) 2019-11-20 2019-11-20 Website testing method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111143191A true CN111143191A (en) 2020-05-12
CN111143191B CN111143191B (en) 2024-02-13

Family

ID=70517182

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911139293.0A Active CN111143191B (en) 2019-11-20 2019-11-20 Website testing method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111143191B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111949551A (en) * 2020-09-01 2020-11-17 网易(杭州)网络有限公司 Application program testing method, device, equipment and storage medium
CN112182193A (en) * 2020-10-19 2021-01-05 山东旗帜信息有限公司 Log obtaining method, device and medium in traffic industry
CN113098715A (en) * 2021-03-29 2021-07-09 杭州网易云音乐科技有限公司 Information processing method, device, system, medium and computing equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170278015A1 (en) * 2016-03-24 2017-09-28 Accenture Global Solutions Limited Self-learning log classification system
CN107861950A (en) * 2017-11-28 2018-03-30 北京潘达互娱科技有限公司 The detection method and device of abnormal text
US20190197105A1 (en) * 2017-12-21 2019-06-27 International Business Machines Corporation Unsupervised neural based hybrid model for sentiment analysis of web/mobile application using public data sources
CN110210512A (en) * 2019-04-19 2019-09-06 北京亿阳信通科技有限公司 A kind of automation daily record method for detecting abnormality and system
CN110347547A (en) * 2019-05-27 2019-10-18 中国平安人寿保险股份有限公司 Log method for detecting abnormality, device, terminal and medium based on deep learning

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170278015A1 (en) * 2016-03-24 2017-09-28 Accenture Global Solutions Limited Self-learning log classification system
CN107861950A (en) * 2017-11-28 2018-03-30 北京潘达互娱科技有限公司 The detection method and device of abnormal text
US20190197105A1 (en) * 2017-12-21 2019-06-27 International Business Machines Corporation Unsupervised neural based hybrid model for sentiment analysis of web/mobile application using public data sources
CN110210512A (en) * 2019-04-19 2019-09-06 北京亿阳信通科技有限公司 A kind of automation daily record method for detecting abnormality and system
CN110347547A (en) * 2019-05-27 2019-10-18 中国平安人寿保险股份有限公司 Log method for detecting abnormality, device, terminal and medium based on deep learning

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
任明;宋云奎;: "基于深度学习的云计算***异常检测方法" *
杨沛;: "顾及规则矩阵约束的ELK日志数据统计分析" *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111949551A (en) * 2020-09-01 2020-11-17 网易(杭州)网络有限公司 Application program testing method, device, equipment and storage medium
CN112182193A (en) * 2020-10-19 2021-01-05 山东旗帜信息有限公司 Log obtaining method, device and medium in traffic industry
CN112182193B (en) * 2020-10-19 2023-01-13 山东旗帜信息有限公司 Log obtaining method, device and medium in traffic industry
CN113098715A (en) * 2021-03-29 2021-07-09 杭州网易云音乐科技有限公司 Information processing method, device, system, medium and computing equipment
CN113098715B (en) * 2021-03-29 2022-07-22 杭州网易云音乐科技有限公司 Information processing method, device, system, medium and computing equipment

Also Published As

Publication number Publication date
CN111143191B (en) 2024-02-13

Similar Documents

Publication Publication Date Title
CN109829629B (en) Risk analysis report generation method, apparatus, computer device and storage medium
CN107798047B (en) Repeated work order detection method, device, server and medium
CN111177714B (en) Abnormal behavior detection method and device, computer equipment and storage medium
EP3594860A1 (en) Sparse neural network based anomaly detection in multi-dimensional time series
CN111143191B (en) Website testing method, device, computer equipment and storage medium
CN110751533B (en) Product portrait generation method and device, computer equipment and storage medium
US20150347923A1 (en) Error classification in a computing system
EP2806374A1 (en) Method and system for automatic selection of one or more image processing algorithm
CN110704304B (en) Application program testing method and device, storage medium and server
CN109726058B (en) Detection method and device and computer equipment
CN111859916B (en) Method, device, equipment and medium for extracting key words of ancient poems and generating poems
CN112820367B (en) Medical record information verification method and device, computer equipment and storage medium
US20220108222A1 (en) Systems and methods for detecting prejudice bias in machine-learning models
CN113835962A (en) Server fault detection method and device, computer equipment and storage medium
CN113377484A (en) Popup window processing method and device
CN105630656A (en) Log model based system robustness analysis method and apparatus
CN114491282B (en) Abnormal user behavior analysis method and system based on cloud computing
CN116361147A (en) Method for positioning root cause of test case, device, equipment, medium and product thereof
CN112989256B (en) Method and device for identifying web fingerprint in response information
CN109992778B (en) Resume document distinguishing method and device based on machine learning
CN111444093B (en) Method and device for determining quality of project development process and computer equipment
CN110889357B (en) Underground cable fault detection method and device based on labeling area
CN113420777A (en) Abnormal log detection method, device storage medium and equipment
CN110515792B (en) Monitoring method and device based on web version task management platform and computer equipment
US11488023B2 (en) Adaptability calculation method, adaptability calculation device, identification method, identification device, and computer-readable recording medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 200030 room 607, building 4, No. 299, Longcao Road, Xuhui District, Shanghai

Applicant after: Shanghai wensihai huizhike Technology Co.,Ltd.

Address before: 200030 room 607, building 4, No. 299, Longcao Road, Xuhui District, Shanghai

Applicant before: Shanghai Lingling Technology Co.,Ltd.

CB02 Change of applicant information
TA01 Transfer of patent application right

Effective date of registration: 20230718

Address after: Room 814, Floor 8, Building 2, No. 1535, Hongmei Road, Xuhui District, Shanghai, 200030

Applicant after: CLP Jinxin software (Shanghai) Co.,Ltd.

Address before: Room 607, Building 4, No. 299, Longcao Road, Xuhui District, Shanghai, 200030

Applicant before: Shanghai wensihai huizhike Technology Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant