Method and device for detecting page loading exception
By determining the detection scheme based on the system language type and text language type and detecting the page text content, the problem of low accuracy caused by a single detection dimension in the prior art is solved, and a higher accuracy rate of page loading abnormal detection is achieved.
Patent Information
- Application Number
- CN202311503719.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-13
- Publication Date
- 2025-05-13
AI Technical Summary
In the prior art, only the page is detected from the color dimension, and the detection dimension is single, resulting in low accuracy of the detection results of abnormal page loading.
Determine the detection scheme of the page and the text content of the page according to whether the system language type and text language type are the same. The specific method includes generating the first exception score by comparing the preset exception text set with the page text content when the system language type and text language type are different; when the system language type and text language type are the same, natural semantic recognition is performed to generate the second exception score, and when necessary, text comparison is performed to generate the first exception score.
By enriching the detection dimensions of page loading exceptions, improving the accuracy of detection results, it can detect page loading exceptions more effectively.
Smart Images

Figure CN119988771A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for detecting page loading anomalies. Background Art
[0002] With the rapid development of mobile terminal technology, more and more web (World Wide Web) pages are connected to mobile terminals. The diversity and real-time nature of the displayed information make it increasingly important to monitor abnormal loading of web pages. The current detection scheme for abnormal loading of pages is to perform color analysis on the page. When the proportion of pure gray color is high or the color contrast is low, the page loading abnormality is determined.
[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0004] The page is detected only from the color dimension, the detection dimension is single, and the accuracy of the detection result of page loading anomaly is low. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a method and device for detecting page loading anomalies, which determines the detection scheme of the page according to whether the system language type and the text language type are the same, and detects the text content of the page according to the detection scheme, thereby enriching the detection dimensions of page loading anomalies and improving the accuracy of the detection results.
[0006] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for detecting page loading anomalies is provided.
[0007] A method for detecting page loading anomalies, comprising: in response to a page loading anomaly detection request, obtaining text content and a system language type of a loaded page, and determining the text language type of the page based on the text content; when the system language type and the text language type are different, generating a first anomaly score of the page by performing a text comparison between a preset anomaly text set and the text content of the page, and determining a loading anomaly detection result of the page based on the first anomaly score; when the system language type and the text language type are the same, performing natural semantic recognition on the text content of the page to generate a second anomaly score of the page, and when the second anomaly score exceeds a set threshold, generating a first anomaly score of the page by performing a text comparison between the anomaly text set and the text content of the page, and determining a loading anomaly detection result of the page based on the first anomaly score.
[0008] In one embodiment, the abnormal text set includes at least one abnormal text; the generating a first abnormal score of the page by performing text comparison between a preset abnormal text set and the text content of the page includes: for each abnormal text in the abnormal text set, performing text comparison between the abnormal text and the text content of the page by a text comparison algorithm, and generating an abnormal score corresponding to the abnormal text according to the text comparison result; and selecting the highest abnormal score from the abnormal scores corresponding to each abnormal text in the abnormal text set as the first abnormal score of the page.
[0009] In one embodiment, the abnormal text set is generated in the following manner: according to a preset garbled text type, obtaining no less than one garbled text; according to the configuration information of the page, obtaining the page development standard text of the page; and generating the abnormal text set based on the garbled text and the page development standard text.
[0010] In one embodiment, determining the page loading anomaly detection result based on the first anomaly score includes: when the first anomaly score is greater than a preset first score threshold, the loading anomaly detection result is that the page loading is abnormal; otherwise, the loading anomaly detection result is that the page loading is normal.
[0011] In one embodiment, obtaining the text content of the loaded page includes: capturing an image of the loaded page; performing character recognition on the captured image to obtain the text content of the loaded page; determining the text language type of the page based on the text content includes: determining the language types included in the page and the language proportion of each language type based on the text content, and using the language type with the highest language proportion as the text language type of the page.
[0012] In one embodiment, the method further includes: when the second anomaly score does not exceed the set threshold, the loading anomaly detection result is that the page loading is normal.
[0013] In one embodiment, before obtaining the text content of the page and the corresponding system language type, the method further includes: performing color analysis on the page to obtain a third anomaly score of the page, and determining that the third anomaly score is greater than a preset third score threshold.
[0014] According to another aspect of an embodiment of the present invention, a device for detecting abnormal page loading is provided.
[0015] A device for detecting page loading anomalies comprises: a language type determination module, which is used to obtain the text content and system language type of the loaded page in response to a detection request for page loading anomalies, and determine the text language type of the page based on the text content; a first detection module, which is used to generate a first anomaly score of the page by performing text comparison between a preset abnormal text set and the text content of the page when the system language type and the text language type are different, and determine a loading anomaly detection result of the page based on the first anomaly score; a second detection module, which is used to perform natural semantic recognition on the text content of the page when the system language type and the text language type are the same, and generate a second anomaly score of the page; when the second anomaly score exceeds a set threshold, generate a first anomaly score of the page by performing text comparison between the abnormal text set and the text content of the page, and determine the loading anomaly detection result of the page based on the first anomaly score.
[0016] In one embodiment, the abnormal text set includes no less than one abnormal text; the first detection module or the second detection module is further used to: for each abnormal text in the abnormal text set, perform text comparison between the abnormal text and the text content of the page through a text comparison algorithm, and generate an abnormal score corresponding to the abnormal text according to the text comparison result; select the highest abnormal score from the abnormal scores corresponding to each abnormal text in the abnormal text set as the first abnormal score of the page.
[0017] In one embodiment, it also includes an abnormal text set generation module, which is used to: obtain no less than one garbled text according to a preset garbled type; obtain the page development standard text of the page according to the configuration information of the page; and generate the abnormal text set based on the garbled text and the page development standard text.
[0018] In one embodiment, the first detection module or the second detection module is further used for: when the first anomaly score is greater than a preset first score threshold, the loading anomaly detection result is that the page loading is abnormal; otherwise, the loading anomaly detection result is that the page loading is normal.
[0019] In one embodiment, the language type determination module is also used to: capture an image of the loaded page; obtain the text content of the loaded page by performing character recognition on the captured image; based on the text content, determine the language types included in the page and the language proportion of each language type, and use the language type with the highest language proportion as the text language type of the page.
[0020] In one embodiment, the second detection module is further configured to: when the second anomaly score does not exceed the set threshold, the loading anomaly detection result is that the page loading is normal.
[0021] In one embodiment, a third detection module is further included, which is used to: perform color analysis processing on the page to obtain a third anomaly score of the page, and determine whether the third anomaly score is greater than a preset third score threshold.
[0022] According to yet another aspect of the embodiments of the present invention, an electronic device is provided.
[0023] An electronic device includes: one or more processors; a memory for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the page loading anomaly detection method provided by an embodiment of the present invention.
[0024] According to yet another aspect of an embodiment of the present invention, a computer readable medium is provided.
[0025] A computer-readable medium stores a computer program, which, when executed by a processor, implements a method for detecting page loading anomalies provided by an embodiment of the present invention.
[0026] An embodiment of the above invention has the following advantages or beneficial effects: by responding to a page loading anomaly detection request, obtaining the text content and system language type of the loaded page, and determining the text language type of the page based on the text content; when the system language type and the text language type are different, by performing text comparison between a preset abnormal text set and the text content of the page, a first abnormality score of the page is generated, and the page loading anomaly detection result is determined based on the first abnormality score; when the system language type and the text language type are the same, natural semantic recognition is performed on the text content of the page to generate a second abnormality score of the page, and when the second abnormality score exceeds a set threshold, a first abnormality score of the page is generated by performing text comparison between the abnormal text set and the text content of the page, and a technical solution for determining the page loading anomaly detection result based on the first abnormality score, determining the page detection scheme according to whether the system language type and the text language type are the same, and detecting the text content of the page according to the detection scheme, can enrich the detection dimension of page loading anomalies and improve the accuracy of the detection results.
[0027] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0029] Figure 1 It is a schematic diagram of the main steps of a method for detecting abnormal page loading according to an embodiment of the present invention;
[0030] Figure 2 is a schematic diagram of a page in which the system language type is Chinese according to an embodiment of the present invention;
[0031] Figure 3 is a schematic diagram of a page in which the system language type is English according to an embodiment of the present invention;
[0032] Figure 4 is a schematic diagram of a page with abnormal loading according to an embodiment of the present invention;
[0033] Figure 5 is a flow chart of a method for detecting page loading anomalies according to an embodiment of the present invention;
[0034] Figure 6 is a schematic diagram of main modules of a device for detecting abnormal page loading according to an embodiment of the present invention;
[0035] Figure 7 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0036] Figure 8 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0037] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0038] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution of the present invention are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security and national security.
[0039] Figure 1 The figure is a schematic diagram of the main steps of a method for detecting page loading anomalies according to an embodiment of the present invention.
[0040] like Figure 1 As shown, a method for detecting page loading anomalies according to an embodiment of the present invention mainly includes the following steps S101 to S103.
[0041] Step S101: in response to a page loading anomaly detection request, the text content and system language type of the loaded page are obtained, and the text language type of the page is determined based on the text content.
[0042] In one embodiment, obtaining the text content of the loaded page may include: capturing an image of the loaded page; and obtaining the text content of the loaded page by performing character recognition on the captured image.
[0043] Specifically, the loaded page can be captured using a screenshot tool provided by the system, and the captured image can be recognized using OCR (Optical Character Recognition) technology to obtain all character texts of the current page and generate the text content of the page.
[0044] In one embodiment, determining the text language type of a page based on text content may include: determining the language types included in the page and the language proportion of each language type based on the text content, and using the language type with the highest language proportion as the text language type of the page.
[0045] Specifically, a schematic diagram of a page in which the system language type is Chinese according to an embodiment of the present invention is as follows: Figure 2 As shown, based on the text content, it can be determined that the language types included in the page include Chinese and English, and the language proportion of Chinese is higher than the language proportion of English, then the text language type of the page is Chinese. Figure 3 As shown, based on the text content, it can be determined that the language types included in the page include English, and English accounts for the highest proportion, so the text language type of the page is English.
[0046] Step S102: when the system language type and the text language type are different, a first anomaly score of the page is generated by performing a text comparison between a preset anomaly text set and the text content of the page, and a loading anomaly detection result of the page is determined based on the first anomaly score.
[0047] Step S103: When the system language type and the text language type are the same, natural semantic recognition is performed on the text content of the page to generate a second anomaly score for the page. When the second anomaly score exceeds a set threshold, a first anomaly score for the page is generated by performing a text comparison between the abnormal text set and the text content of the page, and a loading anomaly detection result of the page is determined based on the first anomaly score. Wherein, when the second anomaly score does not exceed the set threshold, the loading anomaly detection result is that the page is loading normally.
[0048] In one embodiment, the abnormal text set may include at least one abnormal text. The abnormal text set may be generated in the following manner: obtaining at least one garbled text according to a preset garbled type; obtaining a page development standard text of the page according to the configuration information of the page; and generating the abnormal text set based on the garbled text and the page development standard text.
[0049] Specifically, the garbled code types may include ancient Chinese code, spoken word code, symbol code, pinyin code, etc. Examples, characteristics and causes of each garbled code type are shown in Table 1.
[0050] Table 1 Examples, characteristics and causes of various garbled code types
[0051]
[0052] According to the configuration information of the page, the page development standard text of the page is obtained. The page development standard is such as HTML5 (a language description method for building Web content). The page development standard text of HTML5 is as follows:
[0053]
[0054] In one embodiment, generating a first anomaly score for a page by performing a text comparison between a preset anomaly text set and text content of a page may include: for each anomaly text in the anomaly text set, performing a text comparison between the anomaly text and the text content of the page by using a text comparison algorithm, and generating an anomaly score corresponding to the anomaly text according to the text comparison result; and selecting the highest anomaly score from the anomaly scores corresponding to each anomaly text in the anomaly text set as the first anomaly score for the page.
[0055] Specifically, the text comparison algorithm is used to compare the detected text content with the abnormal text. The similarity between the text content and the abnormal text is obtained by calculating the number of identical words, phrases, sentences or paragraphs that appear in the text, and the similarity is used as the anomaly score corresponding to the abnormal text.
[0056] Figure 4 is a schematic diagram of a page with abnormal loading according to an embodiment of the present invention.
[0057] like Figure 4 As shown, based on the text content of the page, the anomaly score corresponding to each abnormal text can be: Ancient Chinese code: 5 points; Word code: 5 points; Symbol code: 8 points; Pinyin code: 10 points; HTML5 page development standard text: 80 points. Then the similarity between the text content of the page and the HTML5 page development standard text is high. When the abnormal text is the HTML5 page development standard text, the anomaly score is the highest. The anomaly score corresponding to the HTML5 page development standard text can be used as the first anomaly score of the page, that is, the first anomaly score of the page is 80 points.
[0058] In one embodiment, determining the page loading anomaly detection result based on the first anomaly score may include: when the first anomaly score is greater than a preset first score threshold, the loading anomaly detection result is that the page loading is abnormal; otherwise, the loading anomaly detection result is that the page loading is normal.
[0059] Continue to see Figure 4 The preset first score threshold can be set to 60 points, and the first anomaly score of the page is 80 points. The first anomaly score of the page is greater than the preset first score threshold, and the loading anomaly detection result is page loading anomaly.
[0060] In one embodiment, before obtaining the text content of the page and the corresponding system language type, the method may further include: performing color analysis on the page to obtain a third anomaly score of the page, and determining that the third anomaly score is greater than a preset third score threshold.
[0061] Specifically, a color analysis process is performed on the page, and a third anomaly score is obtained according to the gray pure color ratio and color contrast of the page, wherein the third anomaly score is larger when the gray pure color ratio is larger or the color contrast is lower. If the third anomaly score is greater than the preset third score threshold, it can be considered that the page is suspected of being loaded abnormally. The embodiment of the present invention can perform secondary detection on the page suspected of being loaded abnormally according to the text content and language type of the page, thereby improving the accuracy of the detection result.
[0062] In one embodiment, when the system language type and the text language type are the same, natural semantic recognition is performed on the text content of the page to generate a second anomaly score for the page.
[0063] Specifically, by performing natural semantic recognition on the text content of the page through natural language processing (NLP), the normality of the semantics of the text content can be obtained, and then the second anomaly score of the page can be generated. The higher the normality of the semantics, the lower the second anomaly score. Among them, natural language processing is the theory and method of studying effective communication between people and computers using natural language. It can analyze the semantics of words and sentences based on lexical analysis and syntactic analysis. Common evaluation indicators for semantic analysis include, for example: accuracy (i.e., the proportion of correct semantic roles, relationships, sentiment tendencies, etc.), F1 value (considering the harmonic mean of recall rate and accuracy, used for comprehensive evaluation effect), cross entropy loss (measures the difference between the generated semantic representation and the true semantics, used for tasks such as semantic generation), etc.
[0064] Figure 5 The figure is a flow chart of a method for detecting page loading anomalies according to an embodiment of the present invention.
[0065] like Figure 5 As shown, in one embodiment, in response to a detection request for abnormal page loading, the text content and system language type of the loaded page are obtained, and the text language type of the page is determined based on the text content, and it is determined whether the system language type and the text language type are the same. In the case where the system language type and the text language type are different, a text comparison is performed between the abnormal text set and the text content of the page to generate a first abnormal score for the page. If the first abnormal score does not exceed the first score threshold, the page loads normally, otherwise, the page loads abnormally. In the case where the system language type and the text language type are the same, natural semantic recognition is performed on the text content of the page to generate a second abnormal score for the page. If the second abnormal score does not exceed the set threshold, the page loads normally. Otherwise, the first abnormal score of the page is generated by performing a text comparison between the abnormal text set and the text content of the page. If the first abnormal score does not exceed the first score threshold, the page loads normally, otherwise, the page loads abnormally.
[0066] It should be noted that the system language type and the text language type are usually the same. If the system language type and the text language type are different, it is likely that an abnormality has occurred in the page. Therefore, when the system language type and the text language type are the same, the page loading anomaly detection method is relatively strict, and it is necessary to first obtain a second anomaly score through natural semantic recognition. When the second anomaly score does not exceed the set threshold, it can be considered that the loading anomaly detection result is that the page loads normally. When the second anomaly score exceeds the set threshold, it is necessary to detect the first anomaly score obtained by text comparison. In the case where the system language type and the text language type are different, detection can be performed only through the first anomaly score obtained by text comparison. The embodiment of the present invention determines the detection scheme of the page by whether the system language type and the text language type are the same, and detects the text content of the page according to the detection scheme, which can enrich the detection dimension of page loading anomalies and improve the accuracy of the detection results.
[0067] Figure 6 It is a schematic diagram of main modules of a device for detecting abnormal page loading according to an embodiment of the present invention.
[0068] like Figure 6 As shown, a device 600 for detecting abnormal page loading according to an embodiment of the present invention mainly includes: a language type determination module 601 , a first detection module 602 , and a second detection module 603 .
[0069] The language type determination module 601 is used to obtain the text content and system language type of the loaded page in response to a detection request of page loading anomaly, and determine the text language type of the page based on the text content.
[0070] The first detection module 602 is used to generate a first anomaly score of the page by performing text comparison between a preset anomaly text set and the text content of the page when the system language type and the text language type are different, and determine a loading anomaly detection result of the page based on the first anomaly score.
[0071] The second detection module 603 is used to perform natural semantic recognition on the text content of the page when the system language type and the text language type are the same, and generate a second anomaly score for the page. When the second anomaly score exceeds a set threshold, a first anomaly score for the page is generated by performing a text comparison between the abnormal text set and the text content of the page, and a loading anomaly detection result of the page is determined based on the first anomaly score.
[0072] In one embodiment, the abnormal text set may include no less than one abnormal text; the first detection module 602 or the second detection module 603 is specifically used to: for each abnormal text in the abnormal text set, perform text comparison between the abnormal text and the text content of the page through a text comparison algorithm, and generate an abnormal score corresponding to the abnormal text according to the text comparison result; select the highest abnormal score from the abnormal scores corresponding to each abnormal text in the abnormal text set as the first abnormal score of the page.
[0073] In one embodiment, an abnormal text set generation module (not shown in the figure) may also be included, which is used to: obtain no less than one garbled text according to a preset garbled type; obtain the page development standard text of the page according to the configuration information of the page; and generate an abnormal text set based on the garbled text and the page development standard text.
[0074] In one embodiment, the first detection module 602 or the second detection module 603 is specifically used to: when the first anomaly score is greater than a preset first score threshold, the loading anomaly detection result is that the page loading is abnormal; otherwise, the loading anomaly detection result is that the page loading is normal.
[0075] In one embodiment, the language type determination module 601 is specifically used to: capture an image of the loaded page; obtain the text content of the loaded page by performing character recognition on the captured image; based on the text content, determine the language types included in the page and the language proportion of each language type, and use the language type with the highest language proportion as the text language type of the page.
[0076] In one embodiment, the second detection module 603 is specifically configured to: when the second anomaly score does not exceed a set threshold, the loading anomaly detection result is that the page loading is normal.
[0077] In one embodiment, a third detection module (not shown) may be further included, which is used to: perform color analysis on the page to obtain a third anomaly score of the page, and determine whether the third anomaly score is greater than a preset third score threshold.
[0078] In addition, the specific implementation content of the device for detecting abnormal page loading in the embodiment of the present invention has been described in detail in the above method for detecting abnormal page loading, so the repeated content will not be described here.
[0079] Figure 7 An exemplary system architecture 700 is shown to which the page loading anomaly detection method or the page loading anomaly detection device according to the embodiment of the present invention can be applied.
[0080] like Figure 7As shown, system architecture 700 may include terminal devices 701, 702, 703, network 704 and server 705. Network 704 is used to provide a medium for communication links between terminal devices 701, 702, 703 and server 705. Network 704 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0081] The user can use the terminal devices 701, 702, 703 to interact with the server 705 through the network 704 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 701, 702, 703, such as page loading anomaly detection applications, web browser applications, page display applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0082] The terminal devices 701 , 702 , and 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0083] The server 705 may be a server that provides various services, such as a backend management server that provides support for a page loading anomaly detection website browsed by a user using terminal devices 701, 702, and 703 (for example only). The backend management server may respond to the page loading anomaly detection request and other data received, obtain the text content and system language type of the loaded page, and determine the text language type of the page based on the text content; in the case where the system language type and the text language type are different, a first anomaly score of the page is generated by text comparison between a preset abnormal text set and the text content of the page, and a page loading anomaly detection result is determined based on the first anomaly score; in the case where the system language type and the text language type are the same, the text content of the page is natural semantically recognized to generate a second anomaly score of the page, and in the case where the second anomaly score exceeds a set threshold, a first anomaly score of the page is generated by text comparison between the abnormal text set and the text content of the page, and a page loading anomaly detection result is determined based on the first anomaly score, and the processing result (for example, a page loading anomaly detection result - for example only) is fed back to the terminal device.
[0084] It should be noted that the page loading anomaly detection method provided in the embodiment of the present invention is generally executed by the server 705 , and accordingly, the page loading anomaly detection device is generally set in the server 705 .
[0085] It should be understood that Figure 7The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.
[0086] Reference below Figure 8 , which shows a schematic diagram of the structure of a computer system 800 of a terminal device or server suitable for implementing an embodiment of the present invention. Figure 8 The terminal device or server shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0087] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The CPU 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0088] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.
[0089] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processing unit (CPU) 801, the above-mentioned functions defined in the system of the present invention are executed.
[0090] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0091] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0092] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be provided in a processor, for example, may be described as: a processor including a language type determination module, a first detection module, and a second detection module. The names of these modules do not, in some cases, constitute limitations on the modules themselves, for example, the language type determination module may also be described as "a module for responding to a detection request for page loading anomalies, obtaining the text content and system language type of the loaded page, and determining the text language type of the page based on the text content".
[0093] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: in response to a detection request for page loading anomaly, obtaining the text content and system language type of the loaded page, and determining the text language type of the page based on the text content; when the system language type and the text language type are different, by performing text comparison between a preset abnormal text set and the text content of the page, a first abnormality score of the page is generated, and the page loading anomaly detection result is determined based on the first abnormality score; when the system language type and the text language type are the same, the text content of the page is natural semantically recognized to generate a second abnormality score of the page, and when the second abnormality score exceeds a set threshold, by performing text comparison between the abnormal text set and the text content of the page, a first abnormality score of the page is generated, and the page loading anomaly detection result is determined based on the first abnormality score.
[0094] According to the technical solution of the embodiment of the present invention, in response to a detection request for page loading anomaly, the text content and system language type of the loaded page are obtained, and the text language type of the page is determined based on the text content; when the system language type and the text language type are different, a first anomaly score of the page is generated by text comparison between a preset abnormal text set and the text content of the page, and the page loading anomaly detection result is determined based on the first anomaly score; when the system language type and the text language type are the same, the text content of the page is natural semantically recognized to generate a second anomaly score of the page, and when the second anomaly score exceeds a set threshold, a first anomaly score of the page is generated by text comparison between the abnormal text set and the text content of the page, and the page loading anomaly detection result is determined based on the first anomaly score. The detection scheme of the page is determined according to whether the system language type and the text language type are the same, and the text content of the page is detected according to the detection scheme, which can enrich the detection dimension of page loading anomaly and improve the accuracy of the detection result.
[0095] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for detecting abnormal page loading, characterized in that: include: In response to a page loading anomaly detection request, obtaining text content and a system language type of the loaded page, and determining a text language type of the page based on the text content; In the case where the system language type and the text language type are different, a first anomaly score of the page is generated by performing a text comparison between a preset anomaly text set and the text content of the page, and a loading anomaly detection result of the page is determined based on the first anomaly score; When the system language type and the text language type are the same, natural semantic recognition is performed on the text content of the page to generate a second anomaly score for the page; when the second anomaly score exceeds a set threshold, a first anomaly score for the page is generated by performing a text comparison between the abnormal text set and the text content of the page, and a loading anomaly detection result of the page is determined based on the first anomaly score.
2. The method according to claim 1, characterized in that The abnormal text set includes no less than one abnormal text; The step of performing text comparison between a preset abnormal text set and the text content of the page to generate a first abnormality score of the page includes: For each abnormal text in the abnormal text set, perform text comparison between the abnormal text and the text content of the page by using a text comparison algorithm, and generate an abnormal score corresponding to the abnormal text according to the text comparison result; The highest anomaly score is selected from the anomaly scores corresponding to each of the anomaly texts in the anomaly text set as the first anomaly score of the page.
3. The method according to claim 1 or 2, characterized in that: The abnormal text set is generated in the following way: According to the preset garbled code type, obtain at least one garbled code text; According to the configuration information of the page, obtaining a page development standard text of the page; The abnormal text set is generated based on the garbled text and the page development standard text.
4. The method according to claim 1, characterized in that: The determining the page loading anomaly detection result based on the first anomaly score includes: When the first anomaly score is greater than a preset first score threshold, the loading anomaly detection result is that the page loading is abnormal; Otherwise, the loading anomaly detection result is that the page loading is normal.
5. The method according to claim 1, characterized in that The step of obtaining the text content of the loaded page includes: Take a picture of the loaded page; Obtain the text content of the loaded page by performing character recognition on the captured image; The determining the text language type of the page based on the text content includes: Based on the text content, the language types included in the page and the language proportion of each language type are determined, and the language type with the highest language proportion is used as the text language type of the page.
6. The method according to claim 1, characterized in that The method further comprises: When the second anomaly score does not exceed the set threshold, the loading anomaly detection result is that the page loading is normal.
7. The method according to claim 1, characterized in that Before obtaining the text content of the page and the corresponding system language type, the method further includes: Performing color analysis processing on the page to obtain a third anomaly score of the page, and determining that the third anomaly score is greater than a preset third score threshold.
8. A device for detecting abnormal page loading, characterized in that: include: A language type determination module, for obtaining the text content and system language type of the loaded page in response to a detection request of page loading anomaly, and determining the text language type of the page based on the text content; A first detection module is used for, when the system language type and the text language type are different, generating a first anomaly score of the page by performing text comparison between a preset anomaly text set and the text content of the page, and determining a loading anomaly detection result of the page based on the first anomaly score; The second detection module is used to perform natural semantic recognition on the text content of the page when the system language type and the text language type are the same, and generate a second anomaly score for the page; when the second anomaly score exceeds a set threshold, generate a first anomaly score for the page by performing a text comparison between the abnormal text set and the text content of the page, and determine a loading anomaly detection result of the page based on the first anomaly score.
9. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
10. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.