Webpage standardized testing method and device and computer readable storage medium
By obtaining and analyzing console log data and automatically adjusting web page code, the problems of inefficient manual review and difficulty in ensuring the standardization of console data are solved, and efficient and accurate web page standardization testing is achieved.
Patent Information
- Application Number
- CN202411628829.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-03-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, the review of web page codes mainly relies on manual labor, is inefficient and easily affected by subjective factors, making it difficult to ensure the standardization of console data.
By obtaining the log data of the console, performing normative analysis, determining that the data that does not meet the normative requirements is abnormal data, and adjusting the web page code based on the abnormal data until there is no abnormal data in the log data.
Automatic web page standardized testing is realized, review efficiency and accuracy are improved, and the standardization of web page console data is ensured.
Smart Images

Figure CN119690796A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology, and in particular to a web page standardization testing method and device, and a computer-readable storage medium. Background Art
[0002] In the current mainstream automation process, there is no standard tool to detect the data specifications of the console. The data of the debugging console is mostly used for development debugging and troubleshooting, including debugging page functions and debugging interfaces. The data is printed and cannot be touched by regular users. However, this does not mean that the printing specifications of the debugging console are not important. On the contrary, standardized testing and constraints on the printing data of the debugging console will greatly improve information security and web page performance.
[0003] At present, the mainstream control method is for the code manager to manually review and block the printed data before the developer submits the code for release. However, manual review is inefficient and easily affected by subjective factors, and cannot fully guarantee the standardization of console debugging data.
[0004] Currently, no effective solution has been proposed for the problem that the above-mentioned related technologies usually rely solely on manual review of web page codes, which is easily affected by subjective factors, resulting in low review efficiency and difficulty in ensuring console data standardization. Summary of the invention
[0005] The embodiments of the present invention provide a web page standardization testing method and device, and a computer-readable storage medium, so as to at least solve the technical problems in the related art that web page codes are usually only reviewed manually, which is easily affected by subjective factors, resulting in low review efficiency and difficulty in ensuring console data standardization.
[0006] According to one aspect of an embodiment of the present invention, a web page standardization test method is provided, comprising: a first acquisition step, in the process of performing a standardization test on a web page, acquiring log data of a console, wherein the console is used to display the running status of the web page; a determination step, determining that the log data that does not meet the standardization requirements is abnormal data based on the analysis result of a standardization analysis on the log data, wherein the standardization analysis refers to analyzing whether the log data meets the standardization requirements, and the standardization requirements refer to pre-set requirements that the log data must meet; a second acquisition step, adjusting the code corresponding to the web page based on the abnormal data to obtain a target web page; an update step, updating the web page using the target web page; and repeating the first acquisition step, the determination step, the second acquisition step and the update step in sequence at least once until the abnormal data does not exist in the log data, and determining that the web page has passed the standardization test.
[0007] Optionally, in the process of performing standardized testing on the web page, the log data of the console is obtained, including: in the process of performing standardized testing on the web page, using a console monitoring tool to monitor the running status of the web page to obtain a monitoring result, wherein the console monitoring tool indirectly monitors the running status of the web page by monitoring the log data printed by the console; based on the monitoring result, the log data with a timestamp within a predetermined time range is obtained, wherein the timestamp refers to the time when the log data is presented on the console; based on the monitoring result, the log data with a log level of a predetermined log level is obtained, wherein the log level refers to the degree of danger of the log data; based on the monitoring result, the log data containing specific vocabulary is obtained, wherein the specific vocabulary is a predefined vocabulary.
[0008] Optionally, determining that the log data that does not meet the normative requirements is abnormal data based on the analysis result of the normative analysis of the log data includes: performing semantic analysis on the log data to obtain a first analysis result, wherein the semantic analysis refers to analyzing the semantic normative degree of the log data, and the semantic normative degree refers to the degree to which the data semantics follow predetermined semantic rules; determining that the log data that does not meet the semantic normative requirements is the first abnormal data based on the first analysis result, wherein the semantic normative requirement refers to the requirement that the semantic normative degree is higher than the semantic normative degree threshold; comparing and analyzing the log data with sensitive words in a sensitive vocabulary list to obtain a second analysis result, wherein the sensitive words include words that are prohibited from appearing in the console and pre-defined custom words; determining that the log data containing the sensitive words is the second abnormal data based on the second analysis result; integrating the first abnormal data and the second abnormal data to obtain the abnormal data.
[0009] Optionally, the semantic analysis includes: repeated semantic analysis, semantic meaning analysis, and redundant data analysis. The semantic analysis is performed on the log data to obtain a first analysis result, including: performing the repeated semantic analysis on the log data to obtain a first analysis sub-result, wherein the repeated semantic analysis refers to analyzing whether the log data contains repeated data; performing the semantic meaning analysis on the log data to obtain a second analysis sub-result, wherein the semantic meaning analysis refers to analyzing whether the semantic completeness in the log data is lower than a completeness threshold; performing the redundant data analysis on the log data to obtain a third analysis sub-result, wherein the redundant data analysis refers to analyzing whether there is data in the log data whose string length exceeds a length threshold; determining the first analysis result based on the first analysis sub-result, the second analysis sub-result, and the third analysis sub-result.
[0010] Optionally, determining the first analysis result according to the first analysis sub-result, the second analysis sub-result and the third analysis sub-result includes: when the first analysis sub-result indicates that the duplicate data does not exist in the log data, the second analysis sub-result indicates that there is no missing data in the log data, and the third analysis sub-result indicates that there is no redundant data in the log data, determining that the first analysis result is that the log data meets the semantic specification requirements, wherein the missing data refers to data whose semantic completeness is lower than the completeness threshold, and the redundant data refers to data whose string length exceeds the length threshold; when the first analysis sub-result, the second analysis result and the third analysis result are at least one of the following: when the first analysis sub-result indicates that the duplicate data exists in the log data, the second analysis sub-result indicates that the missing data exists in the log data, and the third analysis sub-result indicates that the redundant data exists in the log data, determining that the first analysis result is that there is data in the log data that does not meet the semantic specification requirements.
[0011] Optionally, determining that the log data that does not meet the normative requirements is abnormal data based on the analysis results of the normative analysis of the log data includes: inputting the log data into an abnormal analysis model to process the log data using the abnormal analysis model to obtain data identifiers in the log data, wherein the abnormal analysis model is trained using multiple groups of first training data through machine learning, and each of the multiple groups of first training data includes: sample log data, and a sample data identifier corresponding to the sample log data, the data identifier is used to identify the normative state of the log data, the log data with the data identifier being a normal identifier meets the normative requirements, and the log data with the data identifier being an abnormal identifier does not meet the normative requirements; determining that the log data with the data identifier being the abnormal identifier is the abnormal data.
[0012] Optionally, adjusting the code corresponding to the web page based on the abnormal data to obtain a target web page includes: inputting the abnormal data into a policy generation model, so as to use the policy generation model to generate an adjustment strategy for adjusting the code based on the abnormal data, wherein the policy generation model is trained by machine learning using multiple groups of second training data, each of the multiple groups of second training data includes: sample abnormal data, and a sample adjustment strategy corresponding to the sample abnormal data, the adjustment strategy being a strategy for adjusting the code so that the abnormal data does not exist in the log data; adjusting the code of the web page according to the adjustment strategy to obtain the target web page.
[0013] According to another aspect of an embodiment of the present invention, a web page standardization test device is also provided, including: a first acquisition unit, used to execute a first acquisition step, in the process of performing a standardization test on a web page, acquiring log data of a console, wherein the console is used to display the running status of the web page; a determination unit, used to execute a determination step, and determine that the log data that does not meet the standardization requirements is abnormal data according to the analysis result of the standardization analysis on the log data, wherein the standardization analysis refers to an analysis of whether the log data meets the standardization requirements, and the standardization requirements refer to pre-set requirements that the log data must meet; a second acquisition unit, used to execute a second acquisition step, based on the abnormal data, adjust the code corresponding to the web page to obtain a target web page; an update unit, used to execute an update step, and use the target web page to update the web page; an execution unit, used to repeat the first acquisition step, the determination step, the second acquisition step and the update step in sequence at least once, until the abnormal data does not exist in the log data, and it is determined that the web page passes the standardization test.
[0014] Optionally, the first acquisition unit includes: a first acquisition module, used to monitor the running status of the web page using a console monitoring tool to obtain a monitoring result during a standardized test of the web page, wherein the console monitoring tool indirectly monitors the running status of the web page by monitoring the log data printed by the console; a second acquisition module, used to acquire the log data whose timestamp is within a predetermined time range based on the monitoring result, wherein the timestamp refers to the time when the log data is presented on the console; a third acquisition module, used to acquire the log data with a predetermined log level based on the monitoring result, wherein the log level refers to the degree of danger of the log data; a fourth acquisition module, used to acquire the log data containing specific vocabulary based on the monitoring result, wherein the specific vocabulary is a predefined vocabulary.
[0015] Optionally, the determination unit includes: a fifth acquisition module, used to perform semantic analysis on the log data to obtain a first analysis result, wherein the semantic analysis refers to analyzing the semantic standardization degree of the log data, and the semantic standardization degree refers to the degree to which the data semantics follow predetermined semantic rules; a first determination module, used to determine that the log data that does not meet the semantic standardization requirements is the first abnormal data based on the first analysis result, wherein the semantic standardization requirement refers to the requirement that the semantic standardization degree is higher than the semantic standardization degree threshold; a sixth acquisition module, used to compare and analyze the log data with sensitive words in the sensitive vocabulary list to obtain a second analysis result, wherein the sensitive words include words that are prohibited from appearing in the console and pre-defined custom words; a second determination module, used to determine that the log data containing the sensitive words is the second abnormal data based on the second analysis result; a seventh acquisition module, used to integrate the first abnormal data and the second abnormal data to obtain the abnormal data.
[0016] Optionally, the semantic analysis includes: repeated semantic analysis, semantic meaning analysis, and redundant data analysis. The fifth acquisition module includes: a first acquisition submodule, used to perform the repeated semantic analysis on the log data to obtain a first analysis sub-result, wherein the repeated semantic analysis refers to analyzing whether the log data contains repeated data; a second acquisition submodule, used to perform the semantic meaning analysis on the log data to obtain a second analysis sub-result, wherein the semantic meaning analysis refers to analyzing whether the semantic completeness in the log data is lower than the completeness threshold; a third acquisition submodule, used to perform the redundant data analysis on the log data to obtain a third analysis sub-result, wherein the redundant data analysis refers to analyzing whether there is data in the log data whose string length exceeds the length threshold; a first determination submodule, used to determine the first analysis result based on the first analysis sub-result, the second analysis sub-result and the third analysis sub-result.
[0017] Optionally, the first determination submodule includes: a second determination submodule, used to determine that the first analysis result is that the log data meets the semantic specification requirements when the first analysis subresult indicates that the duplicate data does not exist in the log data, the second analysis subresult indicates that there is no missing data in the log data, and the third analysis subresult indicates that there is no redundant data in the log data, wherein the missing data refers to data whose semantic integrity is lower than the integrity threshold, and the redundant data refers to data whose string length exceeds the length threshold; and a third determination submodule, used to determine that the first analysis result is that there is data in the log data that does not meet the semantic specification requirements when the first analysis subresult, the second analysis result and the third analysis result are at least one of the following: the first analysis subresult indicates that the duplicate data exists in the log data, the second analysis subresult indicates that the missing data exists in the log data, and the third analysis subresult indicates that the redundant data exists in the log data.
[0018] Optionally, the determination unit includes: an eighth acquisition module, used to input the log data into an anomaly analysis model, so as to process the log data using the anomaly analysis model to obtain data identifiers in the log data, wherein the anomaly analysis model is trained by machine learning using multiple groups of first training data, and each of the multiple groups of first training data includes: sample log data, and sample data identifiers corresponding to the sample log data, the data identifiers are used to identify the standard status of the log data, the log data with the data identifier being a normal identifier meets the standard requirements, and the log data with the data identifier being an abnormal identifier does not meet the standard requirements; a third determination module, used to determine that the log data with the data identifier being the abnormal identifier is the abnormal data.
[0019] Optionally, the second acquisition unit includes: a generation module, which is used to input the abnormal data into a policy generation model, so as to use the policy generation model to generate an adjustment strategy for adjusting the code based on the abnormal data, wherein the policy generation model is trained by machine learning using multiple groups of second training data, and each of the multiple groups of second training data includes: sample abnormal data, and a sample adjustment strategy corresponding to the sample abnormal data, and the adjustment strategy is a strategy for adjusting the code so that the abnormal data does not exist in the log data; a ninth acquisition module, which is used to adjust the code of the web page according to the adjustment strategy to obtain the target web page.
[0020] According to another aspect of an embodiment of the present invention, a web page standardization testing system is further provided. The web page standardization testing system uses any one of the web page standardization testing methods described above.
[0021] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein the program executes any one of the web page normalization testing methods described above.
[0022] According to another aspect of an embodiment of the present invention, a processor is further provided, wherein the processor is used to run a program, wherein the program executes any one of the web page normalization testing methods described above when running.
[0023] According to another aspect of an embodiment of the present invention, a computer program product is provided, comprising computer instructions, wherein when the computer instructions are executed by a processor, any one of the web page normalization testing methods described above is executed.
[0024] In an embodiment of the present invention, a first acquisition step can be used to acquire log data of a console during a standardized test of a web page, wherein the console is used to display the running status of the web page; a determination step is used to determine that log data that does not meet the standardized requirements is abnormal data based on the analysis results of the standardized analysis of the log data, wherein the standardized analysis refers to an analysis of whether the log data meets the standardized requirements, and the standardized requirements refer to pre-set requirements that the log data must meet; a second acquisition step is used to adjust the code corresponding to the web page based on the abnormal data to obtain a target web page; an update step is used to update the web page using the target web page; the first acquisition step, the determination step, the second acquisition step and the update step are repeated at least once in sequence until there is no abnormal data in the log data, and it is determined that the web page has passed the standardized test. Through the above technical scheme, the purpose of monitoring the console and selectively grabbing the log data on the console to perform standardized analysis on the log data, and continuously adjusting the web page code based on the analysis results, so that the final web page passes the standardized test, is achieved. The technical effect of automatically reviewing and adjusting the web page code based on the standardized analysis of the console data is realized, the review efficiency and accuracy are improved, and the standardization of the web page console data is improved, thereby solving the technical problem in the related technology that the web page code is usually reviewed only manually, which is easily affected by subjective factors, resulting in low review efficiency and difficulty in ensuring the standardization of console data. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0026] Figure 1 It is a hardware structure block diagram of a mobile terminal of a web page standardization testing method according to an embodiment of the present invention;
[0027] Figure 2 is a flow chart of a web page normalization testing method according to an embodiment of the present invention;
[0028] Figure 3 is a flow chart of an optional web page normalization testing method according to an embodiment of the present invention;
[0029] Figure 4 is a schematic diagram of a web page normalization testing device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0032] As introduced in the background technology, the related art usually relies solely on manual review of web page codes, which is easily affected by subjective factors, resulting in low review efficiency and difficulty in ensuring console data standardization. In view of the above defects, a web page standardization test method and device, and a computer-readable storage medium are provided in the embodiments of the present invention.
[0033] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0034] The method embodiments provided in the embodiments of the present invention can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a webpage standardization testing method according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0035] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the web page normalization test method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The transmission device 106 is used to receive or send data via a network. The above-mentioned specific example of the network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0036] According to an embodiment of the present invention, a method embodiment of a web page standardization testing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0037] Figure 2 is a flow chart of a web page normalization testing method according to an embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:
[0038] Step S202, a first acquisition step, is to acquire log data of a console during a process of performing a standardized test on a web page, wherein the console is used to display the running status of the web page.
[0039] In this embodiment, in order to ensure the standardization of the data presented by the web page and its console, a standardization test can be performed before the web page or other mobile applications embedded with browser pages are officially deployed and put on the shelves to ensure their standardization; specifically, during the process of standardization testing of the web page, the system background can selectively crawl or capture the log data of the console to provide a data basis for subsequent standardization analysis.
[0040] Step S204 is a determination step, in which the log data that does not meet the normative requirements is determined as abnormal data based on the analysis results of the normative analysis of the log data, wherein the normative analysis refers to analyzing whether the log data meets the normative requirements, and the normative requirements refer to pre-set requirements that the log data must meet.
[0041] Optionally, the above normative requirements may indicate requirements that the log data appearing on the console needs to meet.
[0042] Normative requirements can constrain the log data printed on the console from multiple dimensions. For example, the data that can appear on the console should be clear, concise, civilized, and should not disclose commercial secrets. Data that is repeated, redundant, illogical, contains uncivilized language, or involves the disclosure of confidential information can all be considered data that does not meet normative requirements.
[0043] In this embodiment, the captured log data may be subjected to normative analysis from multiple perspectives to mark abnormal log data (ie, log data that does not meet normative requirements) therein to obtain abnormal data.
[0044] Step S206, a second acquisition step, adjusts the code corresponding to the webpage based on the abnormal data to obtain the target webpage.
[0045] In this embodiment, the code corresponding to the web page can be adjusted and optimized based on the abnormal data analyzed in the above step S204, so that similar abnormal data can be avoided from continuing to appear in the console of the web page; when adjusting and optimizing the web page code, the developer can analyze the abnormal data to make corresponding adjustments to the code, or the system background can analyze the abnormal data through a built-in model or by calling an external interface to automatically generate an adjustment strategy for the code adjustment, and adaptively adjust the code according to the obtained strategy to obtain an adjusted target web page.
[0046] Step S208, an updating step, updates the webpage using the target webpage.
[0047] In this embodiment, the optimized target web page can be used to update the web page. In fact, after the code adjustment is completed, the web page will also be automatically updated along with the code adjustment.
[0048] Step S210, repeating the first acquisition step, the determination step, the second acquisition step and the update step at least once in sequence until there is no abnormal data in the log data, and determining that the webpage passes the standardization test.
[0049] In this embodiment, the above steps can be repeated in sequence until there is no longer any data that does not meet the standardization requirements in the log data captured from the console or the probability of its occurrence is within the allowed range, and the web page can be considered to have preliminarily passed the standardization test; of course, after the web page is officially deployed and put on the shelves, it can also be subjected to standardization tests according to the above method from time to time to ensure its standardization.
[0050] As can be seen from the above, through the technical solution provided by the above embodiment of the present invention, the log data of the console can be obtained in the process of standardization test of the web page through the first acquisition step, wherein the console is used to display the running status of the web page; the determination step, according to the analysis result of the standardization analysis of the log data, the log data that does not meet the standardization requirements is determined as abnormal data, wherein the standardization analysis refers to the analysis of whether the log data meets the standardization requirements, and the standardization requirements refer to the pre-set requirements that the log data must meet; the second acquisition step, based on the abnormal data, the code corresponding to the web page is adjusted to obtain the target web page; the update step, using the target web page to update the web page; the first acquisition step, the determination step, the second acquisition step and the update step are repeated at least once in sequence until there is no abnormal data in the log data, and it is determined that the web page passes the standardization test, so as to achieve the purpose of monitoring the console and selectively grabbing the log data on the console to perform standardization analysis on the log data, and continuously adjusting the web page code based on the analysis result, so that the final web page passes the standardization test, and realizes the technical effect of automatically reviewing and adjusting the web page code based on the standardization analysis of the console data, improving the review efficiency and accuracy, and improving the standardization of the web page console data.
[0051] Therefore, the technical solution provided by the above-mentioned embodiment of the present invention solves the technical problem that the related art usually relies solely on manual review of web page codes, which is easily affected by subjective factors, resulting in low review efficiency and difficulty in ensuring console data standardization.
[0052] Combine the following Figure 3 The above embodiments of the present invention are further described in detail. Figure 3 It is a flowchart of an optional web page normalization testing method according to an embodiment of the present invention.
[0053] According to the above embodiment of the present invention, in the process of standardization testing of web pages, log data of the console is obtained, including: in the process of standardization testing of web pages, the running status of the web pages is monitored by the console monitoring tool to obtain monitoring results, wherein the console monitoring tool indirectly monitors the running status of the web pages by monitoring the log data printed by the console; based on the monitoring results, log data with a timestamp within a predetermined time range is obtained, wherein the timestamp refers to the time when the log data is presented on the console; based on the monitoring results, log data with a log level of a predetermined log level is obtained, wherein the log level refers to the degree of danger of the log data; based on the monitoring results, log data containing specific vocabulary is obtained, wherein the specific vocabulary is a predefined vocabulary.
[0054] As above Figure 3As shown, a python browser window monitoring service (i.e., console monitoring tool) can be built to monitor console (console) events. During the monitoring process, a specific time period (i.e., a predetermined time range) can be pre-set to capture the console log data. For example, assuming that the time for performing login operations on a web page is usually from 9:00 to 9:30 (the specific value here is only an example and does not represent a specific restriction on the value of the predetermined time range), and the log data printed on the console when the user or tester performs the login operation will inevitably have some non-compliant problems, so this time period can be set as a specific time period for the system background to capture log data, and then the data within this time period can be obtained according to the timestamp of each log data on the console; in addition, whenever there is a new message on the console, the Selenium module can be used to capture (get) the console (console) data. Selenium is a tool for Web application testing, which can be used to automatically monitor and test the console output of a web page.
[0055] Of course, when capturing data on the console according to the above method, in order to avoid affecting the analysis efficiency due to excessive amount of data, data filtering can be performed in advance when acquiring. For example, log data corresponding to log levels (i.e., predetermined log levels) that are more likely to have compliance issues can be filtered out, or log data containing specific vocabulary can be filtered out, thereby reducing the amount of data captured by the system and improving analysis efficiency. The specific vocabulary mentioned here can be a vocabulary library customized by the developer to obtain relevant data in a more targeted manner.
[0056] The log levels mentioned here usually include the following: 1) DEBUG (debug): This is the lowest log level, used to record detailed program running information, usually used in the development and testing phases to help locate and debug code problems. In a production environment, DEBUG-level logs are usually closed or restricted because they may contain sensitive information, and excessive output will degrade system performance; 2) INFO (information): Used to record general information about program running, such as the start, end, and status changes of operations, which can help understand the operating process and status of the system. INFO-level logs are usually retained in a production environment because they provide useful information about system health and performance without generating too many details like the DEBUG level. WARNING: indicates potential problems in the program, but these problems will not immediately cause the system to fail. WARNING-level logs are used to alert maintenance personnel to situations that may need to be resolved but the system is still operational. 4) ERROR: indicates serious problems encountered while the program is running, which may cause functional failure or abnormal termination. ERROR-level logs record detailed information about system failures and are the main basis for troubleshooting and repairing problems. 5) CRITICAL: indicates extremely serious problems, and the system may no longer be able to operate normally. This is the highest level of log, used to record situations that may require urgent attention and processing. 6) FATAL: sometimes mixed with the CRI TICAL level, indicating that the system has encountered an unrecoverable error and immediate action must be taken. In the specific testing process, the developer can set in advance which log levels need to be set to the predetermined log levels to focus on analyzing the log data at these log levels.
[0057] It should be noted that when filtering and capturing log data on the console, the above-mentioned filtering conditions can be used separately or in combination, and there is no specific limitation here.
[0058] According to the above embodiment of the present invention, determining that log data that does not meet the normative requirements is abnormal data based on the analysis result of the normative analysis of the log data includes: performing semantic analysis on the log data to obtain a first analysis result, wherein the semantic analysis refers to analyzing the semantic normative degree of the log data, and the semantic normative degree refers to the degree to which the data semantics follow predetermined semantic rules; determining that the log data that does not meet the semantic normative requirements is the first abnormal data based on the first analysis result, wherein the semantic normative requirement refers to the requirement that the semantic normative degree is higher than the semantic normative degree threshold; comparing the log data with the sensitive words in the sensitive vocabulary table to obtain a second analysis result, wherein the sensitive words include words that are prohibited from appearing in the console and pre-defined custom words; determining that the log data containing sensitive words is the second abnormal data based on the second analysis result; integrating the first abnormal data and the second abnormal data to obtain abnormal data.
[0059] Optionally, the above semantic analysis may include but is not limited to: repeated semantic analysis, semantic meaning analysis, and redundant data analysis.
[0060] The repeated semantic analysis here is to analyze whether there is data with repeated content in the log data. The semantic meaning analysis here is to analyze whether there is logically incoherent data in the log data, for example, a sentence contains a large number of punctuation marks or the sentence cannot express complete semantics, etc. The redundant data analysis here is to analyze whether there is too much and too long data in the log data (the string length is too long).
[0061] Specifically, as above Figure 3 As shown, after the system captures the log data, it can first pre-process it, which may include but is not limited to: removing redundant spaces and line breaks, unifying the data format, converting json data, timestamp data, etc.; then, the log data can be normatively analyzed from multiple dimensions of normative requirements. For example, the semantics of the log data can be first analyzed to determine whether it meets the semantic normative requirements. The situation of not meeting the semantic normative requirements here may include but is not limited to: the existence of duplicate data, the existence of data that is illogical or meaningless, and the existence of data with a string length that is too long; then, it can be analyzed whether the log data contains sensitive words, and the sensitive words here may include but are not limited to: a list of words that need to be eliminated by the business (such as brand labels, related banned words, data that exposes commercial secrets), special sensitive words customized by developers according to business needs and relevant regulations, etc.; after the above analysis, the log data with abnormalities (i.e., log data that does not meet the normative requirements) can be marked, and a field of data under multiple different analysis dimensions can be integrated and summarized to obtain an abnormal data table, which can contain the content of each abnormal data and its abnormal mark.
[0062] When filtering the word list that needs to be eliminated by the business, you can read the data model of the business code, use natural language processing and regular expression matching to process the data source, match the key data such as device information data, device control data, interface request data, interface response data, etc. with the data model for detection, determine whether the requested data content is printed in plain text, whether the data is directly exposed without escaping, and other compliance tests, and mark the detected non-compliant data; here, for custom special sensitive words, you can build an extensible rule library, and define detection rules and sensitive word lists according to business needs.
[0063] It should be noted that when marking log data with exceptions, log data belonging to different abnormal situations (i.e., abnormal data obtained in different analysis dimensions) can be marked with different abnormal tags, so that a more targeted code adjustment strategy can be formulated later.
[0064] In the above embodiment of the present invention, a semantic analysis is performed on the log data to obtain a first analysis result, including: performing a repeated semantic analysis on the log data to obtain a first analysis sub-result, wherein the repeated semantic analysis refers to analyzing whether the log data contains repeated data; performing a semantic meaning analysis on the log data to obtain a second analysis sub-result, wherein the semantic meaning analysis refers to analyzing whether the semantic completeness in the log data is lower than the completeness threshold; performing a redundant data analysis on the log data to obtain a third analysis sub-result, wherein the redundant data analysis refers to analyzing whether there is data in the log data whose string length exceeds the length threshold; and determining the first analysis result based on the first analysis sub-result, the second analysis sub-result, and the third analysis sub-result.
[0065] As above Figure 3 As shown, when performing repeated semantic analysis on log data, the repeatedly printed data can be filtered out: first, the complete and non-duplicate logs in the time period are filtered out through data deduplication, and the abnormal repeated data are put into the abnormal data queue and marked; when performing semantic meaning analysis on log data, meaningless natural text data can be filtered out: meaningless printing is filtered out through the logic preset in the code, such as retrieving the proportion of natural language contained in the data, retrieving the proportion of meaningless symbols, etc., and the content with too high proportion is filtered out and put into the abnormal data queue and marked; when performing redundant data analysis on log data, overly long and complex data can be filtered out: the remaining data is traversed to determine the string length, and the overly long data is also filtered out and put into the abnormal data queue and marked.
[0066] In the above embodiment of the present invention, the first analysis result is determined according to the first analysis sub-result, the second analysis sub-result and the third analysis sub-result, including: when the first analysis sub-result indicates that there is no duplicate data in the log data, the second analysis sub-result indicates that there is no missing data in the log data and the third analysis sub-result indicates that there is no redundant data in the log data, determining that the first analysis result is that the log data meets the semantic specification requirements, wherein the missing data refers to data whose semantic integrity is lower than the integrity threshold, and the redundant data refers to data whose character string length exceeds the length threshold; when the first analysis sub-result, the second analysis result and the third analysis result are at least one of the following: there is duplicate data in the log data of the first analysis sub-result, the second analysis sub-result indicates that there is missing data in the log data, and the third analysis sub-result indicates that there is redundant data in the log data, determining that the first analysis result is that there is data in the log data that does not meet the semantic specification requirements.
[0067] Specifically, if the analysis results of the semantic analysis of the log data from the above three dimensions all indicate that there is no data in the log data that does not meet the semantic specification requirements, it can be considered that the obtained log data meets the semantic specification requirements, and there is no need to mark the data therein as abnormal; if the analysis results of at least one analysis dimension indicate that there is data in the log data that does not meet the semantic specification requirements, it can be considered that the obtained log data does not meet the semantic specification requirements, and the data that does not meet the semantic specification requirements needs to be marked as abnormal.
[0068] In an optional embodiment of the present invention, log data that does not meet the normative requirements is determined as abnormal data based on the analysis results of normative analysis of log data, including: inputting the log data into an abnormal analysis model to process the log data using the abnormal analysis model to obtain data identifiers in the log data, wherein the abnormal analysis model is trained using multiple groups of first training data through machine learning, and each of the multiple groups of first training data includes: sample log data, sample data identifiers corresponding to the sample log data, the data identifier is used to identify the normative state of the log data, log data with the data identifier being a normal identifier meets the normative requirements, and log data with the data identifier being an abnormal identifier does not meet the normative requirements; determining that the log data with the data identifier being an abnormal identifier is abnormal data.
[0069] Specifically, a model that can perform anomaly analysis on captured log data can be customized and trained, so that when log data is captured, anomaly analysis can be automatically performed on it through the model to improve the efficiency of analyzing the standardization of log data.
[0070] In a specific embodiment of the present invention, the code corresponding to the web page is adjusted based on the abnormal data to obtain the target web page, including: inputting the abnormal data into a policy generation model, so as to use the policy generation model to generate an adjustment strategy for adjusting the code based on the abnormal data, wherein the policy generation model is trained by machine learning using multiple groups of second training data, each of the multiple groups of second training data includes: sample abnormal data, sample adjustment strategy corresponding to the sample abnormal data, the adjustment strategy is a strategy for adjusting the code so that the abnormal data does not exist in the log data; the code of the web page is adjusted according to the adjustment strategy to obtain the target web page.
[0071] Specifically, as above Figure 3 As shown, when the code is adjusted based on the abnormal data obtained by analysis, the developer can analyze the abnormal data to make corresponding adjustments to the code, or the system background can analyze the abnormal data through a built-in trained model or by calling an external interface to automatically generate an adjustment strategy for the code adjustment, and adaptively adjust the code according to the obtained strategy to obtain the adjusted target web page; and repeat the above steps to continue to perform standardization testing on the updated web page (target web page) until there is no abnormality (i.e., passes the standardization test) before it can be prepared for deployment and listing.
[0072] It should be noted that the anomaly analysis model and the strategy generation model involved in the above embodiments of the present invention can continuously use new input data to perform adaptive optimization during use to improve the performance of the model.
[0073] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0074] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0075] According to an embodiment of the present invention, a web page normalization testing device for implementing the above web page normalization testing method is also provided. Figure 4 is a schematic diagram of a web page normalization testing device according to an embodiment of the present invention. Figure 4 As shown, the device includes: a first acquisition unit 41, a determination unit 43, a second acquisition unit 45, an update unit 47 and an execution unit 49. The webpage normalization test device is described in detail below.
[0076] The first acquisition unit 41 is used to execute the first acquisition step to acquire the log data of the console during the process of performing the standardized test on the web page, wherein the console is used to display the running status of the web page.
[0077] The determination unit 43 is used to execute the determination step, and determine that the log data that does not meet the normative requirements is abnormal data based on the analysis results of the normative analysis of the log data, wherein the normative analysis refers to analyzing whether the log data meets the normative requirements, and the normative requirements refer to pre-set requirements that the log data must meet.
[0078] The second acquisition unit 45 is used to execute the second acquisition step, adjust the code corresponding to the webpage based on the abnormal data, and obtain the target webpage.
[0079] The updating unit 47 is used to execute the updating step to update the webpage using the target webpage.
[0080] The execution unit 49 is used to repeatedly execute the first acquisition step, the determination step, the second acquisition step and the update step in sequence at least once until there is no abnormal data in the log data, and it is determined that the webpage passes the normalization test.
[0081] It should be noted here that the above-mentioned first acquisition unit 41, determination unit 43, second acquisition unit 45, update unit 47 and execution unit 49 correspond to steps S202 to S210 in the above-mentioned embodiments, and the five units are the same as the instances and application scenarios implemented by the corresponding steps, but are not limited to the contents disclosed in the above-mentioned embodiments.
[0082] As can be seen from the above, in the scheme recorded in the above-mentioned embodiment of the present invention, the first acquisition unit can be used to perform the first acquisition step, and in the process of performing a standardized test on the web page, the log data of the console can be obtained, wherein the console is used to display the running status of the web page; then the determination unit is used to perform the determination step, and the log data that does not meet the standardized requirements is determined as abnormal data according to the analysis result of the standardized analysis on the log data, wherein the standardized analysis refers to the analysis of whether the log data meets the standardized requirements, and the standardized requirements refer to the pre-set requirements that the log data must meet; then the second acquisition unit is used to perform the second acquisition step, and the code corresponding to the web page is adjusted based on the abnormal data to obtain the target web page; then the determination unit is used to perform the determination step, and the log data that does not meet the standardized requirements is determined as abnormal data according to the analysis result of the standardized analysis on the log data. The update unit executes the update step and updates the web page using the target web page; finally, the execution unit is used to repeatedly execute the first acquisition step, the determination step, the second acquisition step and the update step at least once in sequence until there is no abnormal data in the log data, and it is determined that the web page has passed the standardization test, so as to achieve the purpose of monitoring the console and selectively grabbing the log data on the console to perform a standardized analysis on the log data, and continuously adjusting the web page code based on the analysis results, so that the final web page passes the standardization test, realizing the technical effect of automatically reviewing and adjusting and optimizing the web page code based on the standardized analysis of the console data, improving the review efficiency and accuracy, and improving the standardization of the web page console data.
[0083] Therefore, the technical solution provided by the above-mentioned embodiment of the present invention solves the technical problem that the related art usually relies solely on manual review of web page codes, which is easily affected by subjective factors, resulting in low review efficiency and difficulty in ensuring console data standardization.
[0084] Optionally, the first acquisition unit includes: a first acquisition module, used to monitor the running status of the web page using a console monitoring tool to obtain monitoring results during the process of standardized testing of the web page, wherein the console monitoring tool indirectly monitors the running status of the web page by monitoring the log data printed by the console; a second acquisition module, used to acquire log data with a timestamp within a predetermined time range based on the monitoring results, wherein the timestamp refers to the time when the log data is presented on the console; a third acquisition module, used to acquire log data with a predetermined log level based on the monitoring results, wherein the log level refers to the degree of danger of the log data; a fourth acquisition module, used to acquire log data containing specific vocabulary based on the monitoring results, wherein the specific vocabulary is a predefined vocabulary.
[0085] Optionally, the determination unit includes: a fifth acquisition module, which is used to perform semantic analysis on the log data to obtain a first analysis result, wherein the semantic analysis refers to the analysis of the semantic standardization degree of the log data, and the semantic standardization degree refers to the degree to which the data semantics follow predetermined semantic rules; a first determination module, which is used to determine, based on the first analysis result, that the log data that does not meet the semantic standardization requirements is the first abnormal data, wherein the semantic standardization requirement refers to the requirement that the semantic standardization degree is higher than the semantic standardization degree threshold; a sixth acquisition module, which is used to compare and analyze the log data with the sensitive words in the sensitive vocabulary table to obtain a second analysis result, wherein the sensitive words include words that are prohibited from appearing in the console and pre-defined custom words; a second determination module, which is used to determine that the log data containing sensitive words is the second abnormal data based on the second analysis result; and a seventh acquisition module, which is used to integrate the first abnormal data and the second abnormal data to obtain abnormal data.
[0086] Optionally, the semantic analysis includes: repeated semantic analysis, semantic meaning analysis, and redundant data analysis. The fifth acquisition module includes: a first acquisition sub-module, used to perform repeated semantic analysis on the log data to obtain a first analysis sub-result, wherein the repeated semantic analysis refers to analyzing whether the log data contains repeated data; a second acquisition sub-module, used to perform semantic meaning analysis on the log data to obtain a second analysis sub-result, wherein the semantic meaning analysis refers to analyzing whether the semantic completeness in the log data is lower than the completeness threshold; a third acquisition sub-module, used to perform redundant data analysis on the log data to obtain a third analysis sub-result, wherein the redundant data analysis refers to analyzing whether there is data in the log data whose string length exceeds the length threshold; a first determination sub-module, used to determine the first analysis result based on the first analysis sub-result, the second analysis sub-result and the third analysis sub-result.
[0087] Optionally, the first determination submodule includes: a second determination submodule, used to determine that the first analysis result is that the log data meets the semantic specification requirements when the first analysis subresult indicates that there is no duplicate data in the log data, the second analysis subresult indicates that there is no missing data in the log data, and the third analysis subresult indicates that there is no redundant data in the log data, wherein missing data refers to data with a semantic integrity lower than a completeness threshold, and redundant data refers to data with a character string length exceeding a length threshold; and a third determination submodule, used to determine that the first analysis result is that there is data in the log data that does not meet the semantic specification requirements when the first analysis subresult, the second analysis result, and the third analysis result are at least one of the following: there is duplicate data in the log data of the first analysis subresult, the second analysis subresult indicates that there is missing data in the log data, and the third analysis subresult indicates that there is redundant data in the log data.
[0088] Optionally, the determination unit includes: an eighth acquisition module, used to input the log data into an anomaly analysis model, so as to process the log data using the anomaly analysis model to obtain data identifiers in the log data, wherein the anomaly analysis model is trained by machine learning using multiple groups of first training data, and each of the multiple groups of first training data includes: sample log data, sample data identifiers corresponding to the sample log data, the data identifiers are used to identify the standard status of the log data, the log data with the data identifier being a normal identifier meets the standard requirements, and the log data with the data identifier being an abnormal identifier does not meet the standard requirements; a third determination module, used to determine that the log data with the data identifier being an abnormal identifier is abnormal data.
[0089] Optionally, the second acquisition unit includes: a generation module, which is used to input the abnormal data into the policy generation model, so as to use the policy generation model to generate an adjustment strategy for adjusting the code based on the abnormal data, wherein the policy generation model is trained by machine learning using multiple groups of second training data, and each of the multiple groups of second training data includes: sample abnormal data, and a sample adjustment strategy corresponding to the sample abnormal data, the adjustment strategy being a strategy for adjusting the code so that there is no abnormal data in the log data; a ninth acquisition module, which is used to adjust the code of the web page according to the adjustment strategy to obtain a target web page.
[0090] According to another aspect of an embodiment of the present invention, a web page standardization testing system is further provided. The web page standardization testing system uses any one of the above web page standardization testing methods.
[0091] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium includes a stored program, wherein the program executes any one of the above-mentioned web page normalization testing methods.
[0092] Optionally, in this embodiment, the computer-readable storage medium may be located in any one of the computer terminals in a computer terminal group in a computer network, or in any one of the communication devices in a communication device group.
[0093] Optionally, in this embodiment, the computer-readable storage medium is configured to store program codes for executing the following steps: a first acquisition step, in the process of performing a standardized test on a web page, acquiring log data of a console, wherein the console is used to display the running status of the web page; a determination step, determining that the log data that does not meet the standardized requirements is abnormal data based on the analysis results of the standardized analysis of the log data, wherein the standardized analysis refers to analyzing whether the log data meets the standardized requirements, and the standardized requirements refer to pre-set requirements that the log data must meet; a second acquisition step, adjusting the code corresponding to the web page based on the abnormal data to obtain a target web page; an update step, updating the web page using the target web page; repeating the first acquisition step, the determination step, the second acquisition step and the update step in sequence at least once, until there is no abnormal data in the log data, and determining that the web page has passed the standardized test.
[0094] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: in the process of performing standardized testing on the web page, using the console monitoring tool to monitor the running status of the web page to obtain monitoring results, wherein the console monitoring tool indirectly monitors the running status of the web page by monitoring the log data printed by the console; based on the monitoring results, obtaining log data with a timestamp within a predetermined time range, wherein the timestamp refers to the time when the log data is presented on the console; based on the monitoring results, obtaining log data with a log level of a predetermined log level, wherein the log level refers to the degree of danger of the log data; based on the monitoring results, obtaining log data containing specific vocabulary, wherein the specific vocabulary is a predefined vocabulary.
[0095] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: performing semantic analysis on the log data to obtain a first analysis result, wherein the semantic analysis refers to analyzing the semantic standardization degree of the log data, and the semantic standardization degree refers to the degree to which the data semantics follow predetermined semantic rules; determining, based on the first analysis result, that the log data that does not meet the semantic standardization requirements is the first abnormal data, wherein the semantic standardization requirements refer to the requirement that the semantic standardization degree is higher than the semantic standardization degree threshold; comparing and analyzing the log data with sensitive words in the sensitive vocabulary list to obtain a second analysis result, wherein the sensitive words include words that are prohibited from appearing in the console and pre-defined custom words; determining, based on the second analysis result, that the log data containing the sensitive words is the second abnormal data; integrating the first abnormal data and the second abnormal data to obtain abnormal data.
[0096] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: performing repeated semantic analysis on the log data to obtain a first analysis sub-result, wherein the repeated semantic analysis refers to analyzing whether the log data contains repeated data; performing semantic meaning analysis on the log data to obtain a second analysis sub-result, wherein the semantic meaning analysis refers to analyzing whether the semantic completeness in the log data is lower than a completeness threshold; performing redundant data analysis on the log data to obtain a third analysis sub-result, wherein the redundant data analysis refers to analyzing whether there is data in the log data whose string length exceeds a length threshold; determining the first analysis result based on the first analysis sub-result, the second analysis sub-result, and the third analysis sub-result.
[0097] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: when the first analysis sub-result indicates that there is no duplicate data in the log data, the second analysis sub-result indicates that there is no missing data in the log data, and the third analysis sub-result indicates that there is no redundant data in the log data, determine that the first analysis result is that the log data meets the semantic specification requirements, wherein missing data refers to data with a semantic integrity lower than a completeness threshold, and redundant data refers to data with a character string length exceeding a length threshold; when the first analysis sub-result, the second analysis result, and the third analysis result are at least one of the following: there is duplicate data in the log data of the first analysis sub-result, the second analysis sub-result indicates that there is missing data in the log data, and the third analysis sub-result indicates that there is redundant data in the log data, determine that the first analysis result is that there is data in the log data that does not meet the semantic specification requirements.
[0098] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: inputting log data into an anomaly analysis model to process the log data using the anomaly analysis model to obtain data identifiers in the log data, wherein the anomaly analysis model is trained using multiple groups of first training data by machine learning, and each of the multiple groups of first training data includes: sample log data, sample data identifiers corresponding to the sample log data, the data identifiers are used to identify the standard status of the log data, the log data with the data identifier being a normal identifier meets the standard requirements, and the log data with the data identifier being an abnormal identifier does not meet the standard requirements; determining that the log data with the data identifier being an abnormal identifier is abnormal data.
[0099] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: inputting the abnormal data into a policy generation model, so as to use the policy generation model to generate an adjustment strategy for adjusting the code based on the abnormal data, wherein the policy generation model is trained by machine learning using multiple groups of second training data, and each of the multiple groups of second training data includes: sample abnormal data, and a sample adjustment strategy corresponding to the sample abnormal data, the adjustment strategy being a strategy for adjusting the code so that no abnormal data exists in the log data; adjusting the code of the web page according to the adjustment strategy to obtain a target web page.
[0100] According to another aspect of an embodiment of the present invention, a processor is further provided, and the processor is used to run a program, wherein any one of the above-mentioned web page normalization testing methods is executed when the program is run.
[0101] According to another aspect of an embodiment of the present invention, a computer program product is provided, including computer instructions, and when the computer instructions are executed by a processor, any one of the above web page normalization testing methods is executed.
[0102] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0103] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0104] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0105] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0106] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0107] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0108] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A web page standardization testing method, characterized in that: include: The first acquisition step is to acquire log data of a console during a standardized test of a web page, wherein the console is used to display the running status of the web page; A determination step, determining that the log data that does not meet the normative requirements is abnormal data according to the analysis result of the normative analysis on the log data, wherein the normative analysis refers to analyzing whether the log data meets the normative requirements, and the normative requirements refer to pre-set requirements that the log data must meet; A second acquisition step is to adjust the code corresponding to the web page based on the abnormal data to obtain a target web page; An updating step, using the target web page to update the web page; The first acquisition step, the determination step, the second acquisition step and the update step are sequentially repeated at least once until the abnormal data does not exist in the log data, and it is determined that the webpage passes the normalization test.
2. The web page standardization testing method according to claim 1, characterized in that: During the standardized testing of web pages, the log data of the console is obtained, including: In the process of performing standardized testing on the webpage, the operation status of the webpage is monitored by using a console monitoring tool to obtain a monitoring result, wherein the console monitoring tool indirectly monitors the operation status of the webpage by monitoring the log data printed by the console; Acquire the log data with a timestamp within a predetermined time range based on the monitoring result, wherein the timestamp refers to the time when the log data is presented on the console; Acquire the log data having a log level of a predetermined log level based on the monitoring result, wherein the log level refers to the degree of danger of the log data; The log data containing specific words is obtained based on the monitoring result, wherein the specific words are predefined words.
3. The web page standardization testing method according to claim 1, characterized in that: Determining the log data that does not meet the normative requirements as abnormal data according to the analysis result of the normative analysis on the log data includes: Performing semantic analysis on the log data to obtain a first analysis result, wherein the semantic analysis refers to analyzing the semantic standardization degree of the log data, and the semantic standardization degree refers to the degree to which the semantics of the data follows a predetermined semantic rule; Determining, based on the first analysis result, that the log data that does not meet the semantic standard requirement is first abnormal data, wherein the semantic standard requirement refers to a requirement that the semantic standard degree is higher than a semantic standard degree threshold; Comparing and analyzing the log data with sensitive words in the sensitive word list to obtain a second analysis result, wherein the sensitive words include words that are prohibited from appearing in the console and pre-defined custom words; Determining, based on the second analysis result, that the log data containing the sensitive words is second abnormal data; The first abnormal data and the second abnormal data are integrated to obtain the abnormal data.
4. The web page standardization testing method according to claim 3, characterized in that: The semantic analysis includes: repeated semantic analysis, semantic meaning analysis, and redundant data analysis. The semantic analysis is performed on the log data to obtain a first analysis result, including: Performing the repetition semantic analysis on the log data to obtain a first analysis sub-result, wherein the repetition semantic analysis refers to analyzing whether the log data contains repetition data; Performing the semantic meaning analysis on the log data to obtain a second analysis sub-result, wherein the semantic meaning analysis refers to analyzing whether the semantic integrity in the log data is lower than a integrity threshold; Performing the redundant data analysis on the log data to obtain a third analysis sub-result, wherein the redundant data analysis refers to analyzing whether there is data in the log data whose character string length exceeds a length threshold; The first analysis result is determined according to the first analysis sub-result, the second analysis sub-result, and the third analysis sub-result.
5. The web page standardization testing method according to claim 4, characterized in that: Determining the first analysis result according to the first analysis sub-result, the second analysis sub-result, and the third analysis sub-result includes: In a case where the first analysis sub-result indicates that the duplicate data does not exist in the log data, the second analysis sub-result indicates that there is no missing data in the log data, and the third analysis sub-result indicates that there is no redundant data in the log data, determining that the first analysis result is that the log data all meet the semantic specification requirements, wherein the missing data refers to data whose semantic integrity is lower than the integrity threshold, and the redundant data refers to data whose character string length exceeds the length threshold; When the first analysis sub-result, the second analysis result and the third analysis result are at least one of the following: the first analysis sub-result indicates that the duplicate data exists in the log data, the second analysis sub-result indicates that the missing data exists in the log data, and the third analysis sub-result indicates that the redundant data exists in the log data, it is determined that the first analysis result is that there is data in the log data that does not meet the semantic specification requirements.
6. The web page standardization testing method according to claim 1, characterized in that: Determining the log data that does not meet the normative requirements as abnormal data according to the analysis result of the normative analysis on the log data includes: Input the log data into an abnormal analysis model to process the log data using the abnormal analysis model to obtain data identifiers in the log data, wherein the abnormal analysis model is trained by using multiple groups of first training data in a machine learning manner, and each of the multiple groups of first training data includes: sample log data, and sample data identifiers corresponding to the sample log data, the data identifiers are used to identify the normative state of the log data, the log data with the data identifier being a normal identifier meets the normative requirements, and the log data with the data identifier being an abnormal identifier does not meet the normative requirements; The log data whose data identifier is the abnormal identifier is determined to be the abnormal data.
7. The web page standardization testing method according to claim 1, characterized in that: Adjusting the code corresponding to the webpage based on the abnormal data to obtain a target webpage includes: The abnormal data is input into a strategy generation model, so as to use the strategy generation model to generate an adjustment strategy for adjusting the code based on the abnormal data, wherein the strategy generation model is trained by using multiple sets of second training data in a machine learning manner, and each of the multiple sets of second training data includes: sample abnormal data, and a sample adjustment strategy corresponding to the sample abnormal data, and the adjustment strategy is a strategy for adjusting the code so that the abnormal data does not exist in the log data; The code of the webpage is adjusted according to the adjustment strategy to obtain the target webpage.
8. A web page standardization testing device, characterized in that: include: A first acquisition unit, configured to execute a first acquisition step, and acquire log data of a console during a standardized test of a web page, wherein the console is used to display the running status of the web page; a determining unit, configured to execute a determining step, and determine that the log data that does not meet the normative requirements is abnormal data according to an analysis result of a normative analysis on the log data, wherein the normative analysis refers to an analysis of whether the log data meets the normative requirements, and the normative requirements refer to pre-set requirements that the log data must meet; A second acquisition unit, configured to execute a second acquisition step, adjust the code corresponding to the webpage based on the abnormal data, and obtain a target webpage; An updating unit, configured to execute an updating step to update the webpage using the target webpage; The execution unit is used to repeatedly execute the first acquisition step, the determination step, the second acquisition step and the update step in sequence at least once until the abnormal data does not exist in the log data, and determine that the webpage passes the standardization test.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the web page normalization testing method according to any one of claims 1 to 7.
10. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the web page normalization testing method described in any one of claims 1 to 7 is performed.
Citation Information
Patent Citations
Log file sensitive information detection method and device
CN112100660A
Test method, device, equipment and medium
CN117009247A
Log sensitive information detection method and system, electronic equipment and storage medium
CN117910030A
Software engineering development process compliance detection system and method
CN118069465A
Tracking zone log compliance verification method and related device
CN118132312A