Webpage analysis method and device based on browser plug-in, medium and program product
By crawling web page text data in the browser and sending it to a large language model for analysis, the limitations of real-time intelligent analysis of web page content in the existing technology are solved, and the effect of simplifying operations and improving analysis efficiency is achieved.
Patent Information
- Application Number
- CN202510030074.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-08
- Publication Date
- 2025-05-09
AI Technical Summary
The prior art has limitations in real-time intelligent analysis of web page content. Users need to manually copy and paste web page text into large language models for analysis, which is complex and inconvenient.
By building a browser plug-in in the browser, it crawls web page text data and receives user instructions, sends it to the backend service according to preset rules, and then the backend service sends the data to the large language model for real-time analysis.
Simplify user operations and improve analysis efficiency. It does not require users to manually download web pages or copy and paste data, automatically capture web page content and process and optimize processing.
Smart Images

Figure CN119961501A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data analysis, and in particular to a web page analysis method, device, medium and program product based on a browser plug-in. Background Art
[0002] Currently, artificial intelligence technology is increasingly used in the field of information processing, especially in processing large-scale text data, showing great potential. For example, models such as GPT and BERT have made significant progress in text analysis. However, in actual use, there are still limitations in real-time intelligent analysis of web content. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a web page analysis method, device, medium and program product based on a browser plug-in, which is used to capture web page text data through the browser plug-in, send the web page text data to a large language model, and enable the large language model to perform real-time analysis based on user instructions, thereby improving analysis efficiency.
[0004] In a first aspect, an embodiment of the present application provides a web page analysis method based on a browser plug-in, the method comprising: capturing text data of a target web page through a browser plug-in; the target web page is a web page opened through a browser; the browser plug-in is built into the browser; receiving user instructions input by a user through the browser plug-in; sending the text data and the user instructions to a back-end service that interacts with the browser plug-in according to a preset sending rule, so that the back-end service sends the text data and the user instructions to a large language model, so that the large language model analyzes the text data based on the user instructions to obtain an analysis result.
[0005] The embodiment of the present application captures web page text data and receives user instructions through a browser plug-in built into the browser, and sends the captured web page text data and user instructions to the back-end service according to the preset sending rules, and then sends the text data and user instructions to the large language model through the back-end service, so that the large language model performs real-time analysis on the text data based on the user instructions. In this process, since the user does not need to download the web page, open the large language model, and put the downloaded web page data into the large language model, the user operation is simplified and the analysis efficiency is improved.
[0006] In some embodiments, capturing text data of a target webpage via a browser plug-in includes: monitoring the loading process of the target webpage via the browser plug-in; if the browser plug-in monitors that the loading of the target webpage is complete, capturing text data of the target webpage via the browser plug-in.
[0007] The embodiment of the present application monitors the loading process of the target web page through the browser plug-in, so that the browser plug-in can know whether the target web page has been loaded in the first time, thereby capturing the information of the target web page in time, thereby improving the efficiency of web page analysis.
[0008] In some embodiments, the browser plug-in includes an interface for accessing the target web page and a script file for grabbing the text content of the web page; grabbing the text data of the target web page through the browser plug-in includes: injecting the script file into the target web page through the interface, and grabbing the text content of the target web page by running the script file; performing regular matching and structured processing on the text content to generate text data.
[0009] The embodiment of the present application establishes an access channel with the target web page through the access interface in the browser plug-in, grabs the text content of the target web page through the script file, thereby automatically capturing the text content of the target web page and processing and optimizing the text content. Since this process is automatically implemented through the browser plug-in, the efficiency and privacy of data processing are improved.
[0010] In some embodiments, crawling the text content of the target web page by running a script file includes: obtaining the document object model of the target web page by running the script file; the document object model is used to describe the data structure of the target web page; parsing the document object model to locate the text node of the target web page; crawling the text content in the text node.
[0011] The embodiment of the present application automatically captures the document object model of the target web page through the script file in the browser plug-in, and intelligently identifies and extracts the text content, thereby improving the efficiency and privacy of data processing.
[0012] In some embodiments, text data and user instructions are sent to a backend service that interacts with the browser plug-in according to preset sending rules, including: after crawling the text data of the target web page, sending the text data to the backend service that interacts with the browser plug-in for storage; after receiving the user instruction, sending the user instruction to the backend service; or, after receiving the user instruction, splicing the user instruction with the text data to obtain spliced text data; and sending the spliced text data to the backend service that interacts with the browser plug-in.
[0013] The embodiment of the present application sends text data and user instructions according to preset sending rules, thereby improving the efficiency of data processing. For the first method: after the web page text data is captured, it is sent to the back-end service for storage, realizing the centralized management of data and ensuring that the data will not be lost due to the closing of the browser plug-in or the user's operation error. For the second method: when the user asks a question, the user instruction and text data are spliced and sent to the back-end service, reducing the interaction with the back-end service and improving the resource utilization of the back-end service.
[0014] In some embodiments, the method further includes: the backend service initiates a session request to the large language model so that the large language model creates a session instance based on the session request; accordingly, the backend service sends the text data and user instructions to the large language model, including: the backend service sends the text data and user instructions to the large language model through the session instance.
[0015] The embodiment of the present application establishes a session instance between the backend service and the large language model, so that text data and user instructions are sent through the session instance, thereby improving the continuity and timeliness of data transmission.
[0016] In some embodiments, after sending the text data and user instructions to the back-end service that interacts with the browser plug-in according to preset sending rules, the method also includes: the back-end service performs a data check on the text data based on preset data check rules, and processes the text data based on the check results to obtain standard text data; accordingly, the back-end service sends the text data and user instructions to the large language model, including: the back-end service sends the standard text data and user instructions to the large language model.
[0017] The embodiment of the present application performs data checking on text data through a backend service, thereby improving the accuracy and security of data sent to the large language model, thereby improving the analysis speed of the large language model, and further improving the web page analysis speed.
[0018] In a second aspect, an embodiment of the present application provides a web page analysis device based on a browser plug-in, the device comprising: a capture module, used to capture text data of a target web page through a browser plug-in; the target web page is a web page opened through a browser; the browser plug-in is built into the browser; a receiving module, used to receive user instructions input by a user through the browser plug-in; a sending module, used to send the text data and user instructions to a back-end service that interacts with the browser plug-in according to a preset sending rule, so that the back-end service sends the text data and user instructions to a large language model, so that the large language model analyzes the text data based on the user instructions to obtain an analysis result.
[0019] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the machine-readable instructions are executed by the processor, the method steps of the first aspect can be executed.
[0020] In a fourth aspect, an embodiment of the present application provides a non-transitory computer-readable storage medium, comprising: computer program instructions are stored on the computer-readable storage medium, and when the computer program instructions are executed by a processor, the method steps of the first aspect are executed.
[0021] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising: computer program instructions, which, when executed by a processor, execute the method steps of the first aspect.
[0022] Other features and advantages of the present application will be described in the subsequent description, and in part will become apparent from the description, or will be understood by implementing the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0024] Figure 1 A flowchart of a web page analysis method based on a browser plug-in provided in an embodiment of the present application;
[0025] Figure 2 A schematic diagram of the structure of a web page analysis device based on a browser plug-in provided in an embodiment of the present application;
[0026] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The following embodiments of the technical solution of the present application are described in detail in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present application, and are therefore only used as examples, and cannot be used to limit the scope of protection of the present application.
[0028] It should be noted that all technical and scientific terms used in this document have the same meanings as those generally understood by technicians in the technical field to which this application belongs; the terms used in this document are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.
[0029] In the description of the embodiments of the present application, the technical terms "first", "second", etc. are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.
[0030] It should be noted that, unless otherwise specified, in the specific implementation of this application, when it involves request, response data and other related data, when the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0031] The amount of copywriting on traditional academic websites, web pages, professional document libraries or knowledge bases is quite large. For this type of documents, users are usually required to read the entire document to extract the key points, which requires a high time cost. Information retrieval through traditional methods, such as keyword retrieval, can only locate the position of keywords in the article, and still requires manual understanding, which cannot achieve the effect of automatic and effective analysis.
[0032] In the current wave of artificial intelligence applications, the massive amount of information that needs to be refined will be analyzed through large language models to meet the demand for refining information at the bottom level. However, most of the large model manufacturers currently on the market provide services to the outside world in the form of dialogue.
[0033] When using a large language model for analysis, you need to copy large sections of text from a web page and open the dialog box of the relevant large language model software to paste it. That is, the user needs to open the web page, copy the visible text in the web page, and then communicate with the large language model. This process requires switching back and forth between the browser web page and the large language model, as well as operations such as copying and pasting. The operation process is complicated and the interaction is very inconvenient. In addition, the information contained in the invisible meta tags in the web page cannot be copied directly, and the invisible content will not be perceived by the large language model.
[0034] In addition, when multiple browser windows are opened at the same time and a large amount of web page content is browsed in different windows, there is a lack of unified tools to integrate a large amount of browsing content, which makes the large language model lack browsing context information during analysis.
[0035] Therefore, although generative pre-trained language models (GPT, BERT, etc.) have made significant progress in text analysis, how to effectively integrate these models into the browsers that users use daily to achieve instant and in-depth analysis of web content remains a technical challenge. Existing technologies still have limitations in real-time intelligent analysis of web content.
[0036] Therefore, in view of the above problems, the present application provides a web page analysis method, device, medium and program product based on a browser plug-in. The browser plug-in is mounted in the browser, which can bring some functional extensions to the browser and is not affected by the switching of web pages. The web page text data is captured by the browser plug-in, and the web page text data is sent to the large language model, so that the large language model performs real-time analysis based on user instructions, thereby improving the analysis efficiency.
[0037] Figure 1 The flowchart of a web page analysis method based on a browser plug-in provided in an embodiment of the present application is shown in FIG. The web page analysis method based on a browser plug-in provided in an embodiment of the present application is applied to a terminal device (also referred to as an electronic device). The terminal device may specifically be a smart phone, a tablet computer, a computer, a personal digital assistant (PDA), etc. Figure 1 As shown, the method includes:
[0038] Step S101, the terminal captures text data of a target web page through a browser plug-in; the target web page is a web page opened through a browser; the browser plug-in is built into the browser.
[0039] Before the terminal grabs text data of the target web page through the browser plug-in, the user installs and authorizes the browser plug-in in the terminal in advance, and sets the browser plug-in to be fixed to the toolbar of the terminal for user convenience.
[0040] It should be noted that when installing and authorizing a browser plug-in, the browser plug-in startup mode can be set to automatically start when the browser is opened, and can also be set to start when the user manually clicks the browser plug-in icon in the toolbar.
[0041] When the browser is opened, a browser plug-in shortcut icon is displayed on the page to automatically capture text data of the target web page through the browser plug-in.
[0042] The target web page is a web page opened by a browser. If the browser opens multiple web pages, the target web page can be all the opened web pages, the most recently opened web page, or the web page currently displayed in the browser page, which can be preset according to actual needs.
[0043] Therefore, the browser plug-in provided in the embodiment of the present application has a cross-domain feature and can run across multiple browser windows.
[0044] Step S102: the terminal receives a user instruction input by the user through the browser plug-in.
[0045] The user clicks the browser plug-in shortcut icon to cause a text input box to appear on the target web page. The user enters a user instruction in the text input box, so that the terminal receives the user instruction entered by the user through the browser plug-in, thereby realizing interaction between the user and the terminal.
[0046] There is an Enter button in the text input box. When the user submits the user instruction, it can be submitted by clicking the Enter button in the text input box with the mouse, or by clicking the Enter key on the keyboard. If the terminal screen is a touch screen, it can also be submitted by manual clicking.
[0047] Common words can be set in the Enter button, that is, when the mouse cursor falls on the Enter button, a list of common words appears, and the user submits by selecting one of them as a user instruction. Exemplarily, the common word list includes: summarizing the full text, describing the background, and summarizing the core content.
[0048] The user instruction may also be instruction information input by the user in a text input box.
[0049] In step S103, the terminal sends the text data and the user instructions to the backend service that interacts with the browser plug-in according to the preset sending rules, so that the backend service sends the text data and the user instructions to the large language model, so that the large language model analyzes the text data based on the user instructions to obtain the analysis results.
[0050] The large language model can be a self-developed large language model, or a third-party large language model such as BERT, Wenxin Yiyan, ChatGPT, iFlytek Spark, etc. The backend service is legally accessed by using the external interface provided by the large language model.
[0051] The large language model can be directly integrated into the backend service that interacts with the browser plug-in, or the large language model can be set up in a separate service.
[0052] The preset sending rules are rules preset by the user.
[0053] When setting the sending rules, it can be set based on the resource conditions of the terminal where the browser plug-in is located and the backend service connected. Among them, the resource conditions include memory resources, CPU resources, disk resources, etc. It can also be set based on the number of historical web pages browsed by the user and the content of the web pages. It can also be set based on the actual needs of the user.
[0054] The terminal sends the text data and the user instruction to the backend service that interacts with the browser plug-in according to the preset sending rule, so that the backend service sends the text data and the user instruction to the large language model, so that the large language model analyzes the text data based on the user instruction and obtains the analysis result, including:
[0055] After the terminal captures the text data of the target web page through the browser plug-in, the text data is immediately sent to the back-end service that interacts with the browser plug-in for storage; after receiving the user instruction input by the user through the browser plug-in, the terminal sends the user instruction to the back-end service, and the back-end service obtains the text data related to the user instruction based on the user instruction, and then sends the user instruction and the text data to the large language model, so that the large language model analyzes the text data based on the user instruction to obtain the analysis result.
[0056] For example, if the user instruction is "summarize the full text", the backend service only obtains the text data of the web page that the user has browsed most recently, and sends the user instruction and text data to the large language model, so that the large language model analyzes and summarizes the text data to obtain the analysis results. If the user instruction is "sort out today's reading notes", the backend service obtains the text data of all web pages that the user has browsed today before the current time, and sends them to the large language model, so that the large language model analyzes the text data of all web pages that have been browsed today before the current time to obtain the analysis results.
[0057] In this implementation, after the terminal captures the webpage text data, it immediately sends it to the backend service for storage, thus realizing the centralized management of data and ensuring that the data will not be lost due to the closing of the browser plug-in or the user's operation error.
[0058] Optionally, after the terminal captures the text data of the target web page through the browser plug-in, the terminal stores the captured text data in the terminal. After receiving the user instruction input by the user through the browser plug-in, the terminal obtains the stored text data related to the user instruction, and splices the user instruction with the text data to generate spliced text data, and finally sends the spliced text data to the back-end service that interacts with the browser plug-in. The back-end service then sends the spliced text data to the large language model, so that the large language model parses the spliced text data to obtain the user instruction and the text data, and finally analyzes the text data based on the user instruction to obtain the analysis result.
[0059] In this implementation, only when the user asks a question will the terminal concatenate the user instructions and the captured text data and send them to the backend service, which then sends them to the large language model for analysis, thereby reducing the interaction with the backend service and improving the resource utilization of the backend service.
[0060] Optionally, after the backend service receives the user instruction for the first time, the backend service sends the first received user instruction and all text data received before to the large language model, so that the large language model analyzes the text data related to the user instruction based on the user instruction to obtain an analysis result. On this basis, after the backend service receives the user instruction subsequently, it sends the newly received text data and the user instruction to the large language model, so that the large language model analyzes the text data related to the user instruction based on the user instruction to obtain an analysis result.
[0061] In this embodiment, text data is sent to a large language model for storage, and after the first user instruction and text data, only the text data of the newly browsed web page is sent to the large language model each time, so that the large language model can quickly retrieve relevant information from the stored data, thereby speeding up the response speed.
[0062] After the large language model obtains the analysis result, it returns the analysis result to the backend service, and the backend service returns it to the terminal, so that the terminal displays the analysis result through the text display box of the browser plug-in.
[0063] The user can continue to ask questions based on the displayed content, that is, enter new user instructions in the text input box, so that the large language model can analyze the text data based on the new user instructions, obtain new analysis results and provide feedback.
[0064] For example, a user browses a webpage about the theme of "World Environment Day" and issues a user instruction of "summarize the full text". After obtaining the analysis results, the user can continue to ask questions, for example, enter "What is the significance of World Environment Day" in the text input box of the browser plug-in and submit it to obtain new analysis results.
[0065] In addition, the context retention mechanism based on the large language model and the cross-domain and cross-webpage capabilities of the browser plug-in support users to ask comprehensive questions based on the context previously submitted to the background.
[0066] For example: after browsing web pages about topics such as "World Environment Day", "A Brief History of Humankind", and "Freud's Psychology", you can ask the backend "organize today's reading notes", and the backend will return the "reading notes" after large model processing.
[0067] Therefore, the embodiment of the present application captures web page text data and receives user instructions through a browser plug-in built into the browser, and sends the captured web page text data and user instructions to the back-end service according to the preset sending rules, and then sends the text data and user instructions to the large language model through the back-end service, so that the large language model performs real-time analysis on the text data based on the user instructions. In this process, since the user does not need to download the web page, open the large language model, and put the downloaded web page data into the large language model, the user operation is simplified and the analysis efficiency is improved.
[0068] In some embodiments, the terminal captures text data of the target web page through a browser plug-in, including: the terminal monitors the loading process of the target web page through the browser plug-in; if the browser plug-in monitors that the loading of the target web page is complete, the terminal captures the text data of the target web page through the browser plug-in.
[0069] The loading status and progress of the target web page are monitored through the monitoring function in the browser plug-in. When it is detected that the target web page has been fully loaded, the built-in crawling function of the browser plug-in is triggered.
[0070] By executing the crawling function of the browser plug-in, the text data of the target web page is crawled.
[0071] The browser plug-in includes an interface for accessing the target web page and a script file for grabbing the text content of the web page.
[0072] The interface for accessing the target web page refers to an application programming interface (API) provided by the browser plug-in for interacting with the target web page, that is, a method for accessing the target web page.
[0073] For example, the chrome.tabs.executeScript method allows the browser plug-in to inject and execute scripts into the tab of the current target web page.
[0074] A script file refers to a piece of executable js code written in JavaScript language and used to crawl the text content of the target web page.
[0075] Therefore, the terminal injects the script file into the target web page through the interface, and grabs the text content of the target web page by running the script file.
[0076] The injection method of injecting the script file into the target web page can be declarative injection, programmatic injection, etc., which is specifically determined based on the design rules of the browser plug-in.
[0077] Declarative injection refers to configuring the script files that need to be injected in the configuration file of the browser plug-in and specifying which web pages need to be injected with the script files.
[0078] Programmatic injection refers to injecting a script file into a specified target web page when the preset target method is running.
[0079] Since the acquired text content is the original text content of the target web page, in order to enable the large language model to analyze the text data more accurately, the text content is regularly matched and structured through the browser plug-in to generate text data.
[0080] For example, after grabbing the text data of the main body of a web page through a browser plug-in, the elements in the text data of the web page are classified, and for text containing links, the links are retained, and emphasis marks are added to the title, abstract, keywords, etc., and finally a web page JSON format data containing the main body title, main body abstract, meta information, main body, hyperlinks and other information is generated as text data.
[0081] The embodiment of the present application monitors the loading process of the target web page through the browser plug-in, so that the browser plug-in can know whether the target web page has been loaded in the first time, thereby capturing the information of the target web page in time, thereby improving the efficiency of web page analysis.
[0082] Furthermore, an access channel is established with the target web page through the access interface in the browser plug-in, and the text content of the target web page is captured through the script file, thereby automatically capturing the text content of the target web page and processing and optimizing the text content. Since this process is automatically implemented through the browser plug-in, the efficiency and privacy of data processing are improved.
[0083] In some embodiments, the terminal captures the text content of the target web page by running a script file, including: obtaining the document object model of the target web page by running the script file; the document object model is used to describe the data structure of the target web page; parsing the document object model to locate the text node of the target web page; and capturing the text content in the text node.
[0084] The Document Object Model (DOM) provides an access model to the entire document, representing the document as a tree structure where each node represents an HTML tag or a text item within a tag.
[0085] Therefore, the document object model describes the data structure of the target web page. Specifically, the document object model represents the target web page as a tree structure, wherein each node represents a part of the target web page, such as an element, an attribute or a text.
[0086] The terminal reads and parses the data of the target webpage by running the script file to obtain the document object model of the target webpage. After obtaining the document object model, the document object model is parsed and traversed to access all text nodes of the target webpage; and the text content in all text nodes is captured as the text data of the target webpage.
[0087] The embodiment of the present application automatically captures the document object model of the target web page through the script file in the browser plug-in, and intelligently identifies and extracts the text content, thereby improving the efficiency and privacy of data processing.
[0088] In some embodiments, the method further includes: the backend service initiates a session request to the large language model so that the large language model creates a session instance based on the session request; accordingly, the backend service sends the text data and user instructions to the large language model, including: the backend service sends the text data and user instructions to the large language model through the session instance.
[0089] During the execution process, since the browser plug-in can collect text information of the target web page across domains, in order to capture the continuity of the target web page browsed by the user and track the user status, in an embodiment of the present application, a session is established between the terminal and the back-end service through the browser plug-in, and a session is established between the back-end service and the large language model.
[0090] The backend service establishes a session with the large language model, including: the backend service initiates a session request to the large language model, so that the large language model creates a session instance based on the session request. Finally, the backend service sends the text data and user instructions to the large language model through the session instance.
[0091] The session request includes user identity information, permissions, and security credentials to ensure session security and personalized services.
[0092] In one implementation, when the backend service is started, a session request is initiated to the large language model, so that the large language model creates a session instance based on the session request.
[0093] Optionally, since the backend service sends user instructions and text data related to the user instructions to the large language model only when receiving the user instructions, the backend service can initiate a session request to the large language model after receiving the user instructions and text data, so that the large language model creates a session instance based on the session request.
[0094] The embodiment of the present application establishes a session instance between the backend service and the large language model, so that text data and user instructions are sent through the session instance, thereby improving the continuity and timeliness of data transmission.
[0095] In some embodiments, after the terminal sends the text data and user instructions to the back-end service that interacts with the browser plug-in according to the preset sending rules, the method also includes: the back-end service performs a data check on the text data based on the preset data check rules, and processes the text data based on the check results to obtain standard text data; accordingly, the back-end service sends the text data and user instructions to the large language model, including: the back-end service sends the standard text data and user instructions to the large language model.
[0096] To further improve the accuracy and legitimacy of the text data sent to the large language model, the backend service reprocesses the text data sent by the terminal before sending the text data to the large language model.
[0097] Data check rules include length check rules and security check rules.
[0098] The backend service performs data checks on text data based on preset data check rules, including:
[0099] The data length of the text data is checked based on the length check rule in the data check rule; since different large language models have different requirements on the length of received data, and the backend service can be connected to multiple large language models at the same time, the length check rule corresponds to the large language model one by one;
[0100] A check is performed to determine whether sensitive words and executable codes are present in the text data according to the security check rules in the data check rules.
[0101] The text data is processed based on the inspection results to obtain standard text data, including:
[0102] If the data length of the text data is greater than the standard data length in the length check rule, the text data is truncated according to the standard data length to obtain multiple standard text data; if the text data contains the sensitive words, the sensitive words are deleted to obtain standard text data; if the text data contains the executable code, the executable code is annotated to obtain standard text data.
[0103] The embodiment of the present application performs data checking on text data through a backend service, thereby improving the accuracy and security of data sent to the large language model, thereby improving the analysis speed of the large language model, and further improving the web page analysis speed.
[0104] The embodiments of the present application have the following beneficial effects:
[0105] Improve efficiency: Users can quickly obtain key information and semantic summaries of web pages without having to manually browse the full text, which greatly improves the efficiency of information processing.
[0106] In-depth analysis: Utilizing the deep learning capabilities of large language models, we can conduct in-depth analysis of web page content and extract more accurate and comprehensive key information.
[0107] User-friendly: The browser plug-in's intuitive interface and convenient interactive design allow users to perform intelligent analysis of web page content without complicated operations, improving the user experience.
[0108] Wide application: The browser plug-in can be easily integrated into various browsers and is suitable for a variety of web content analysis scenarios, with broad application prospects.
[0109] Figure 2 A schematic diagram of the structure of a web page analysis device based on a browser plug-in provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the device includes: a capture module 201, a receiving module 202 and a sending module 203; wherein,
[0110] The crawling module 201 is used to crawl the text data of the target web page through the browser plug-in; the target web page is a web page opened through the browser; the browser plug-in is built into the browser; the receiving module 202 is used to receive the user instructions input by the user through the browser plug-in; the sending module 203 is used to send the text data and the user instructions to the back-end service that interacts with the browser plug-in according to the preset sending rules, so that the back-end service sends the text data and the user instructions to the large language model, so that the large language model analyzes the text data based on the user instructions to obtain the analysis results.
[0111] Based on the above embodiment, the capture module 201 is specifically used for: monitoring the loading process of the target webpage through the browser plug-in; if the browser plug-in monitors that the loading of the target webpage is completed, the text data of the target webpage is captured through the browser plug-in.
[0112] Based on the above embodiment, the browser plug-in includes an interface for accessing the target web page and a script file for grabbing the text content of the web page; the grab module 201 is specifically used to: inject the script file into the target web page through the interface, and grab the text content of the target web page by running the script file; perform regular matching and structured processing on the text content to generate text data.
[0113] Based on the above embodiment, the capture module 201 is specifically used for: obtaining the document object model of the target webpage by running the script file; the document object model is used to describe the data structure of the target webpage; parsing the document object model to locate the text node of the target webpage; and capturing the text content in the text node.
[0114] Based on the above embodiments, the sending module 203 is specifically used for: after grabbing the text data of the target web page, sending the text data to the back-end service that interacts with the browser plug-in for storage; after receiving the user instruction, sending the user instruction to the back-end service; or, after receiving the user instruction, splicing the user instruction with the text data to obtain the spliced text data; sending the spliced text data to the back-end service that interacts with the browser plug-in.
[0115] Based on the above embodiment, the device also includes a session initiation module, which is used for the backend service to initiate a session request to the large language model, so that the large language model creates a session instance based on the session request; accordingly, the sending module 203 is specifically used for: the backend service sends the text data and user instructions to the large language model through the session instance.
[0116] On the basis of the above-mentioned embodiment, the device also includes a processing module, which is used for the back-end service to perform data inspection on the text data based on preset data inspection rules, and to process the text data based on the inspection results to obtain standard text data; accordingly, the sending module 203 is specifically used for: the back-end service sends the standard text data and user instructions to the large language model.
[0117] It should be understood that the device corresponds to the above-mentioned embodiment of the webpage analysis method based on the browser plug-in, and can execute the various steps involved in the above-mentioned method embodiment. The specific functions of the device can be found in the description above. To avoid repetition, the detailed description is appropriately omitted here. The device includes at least one software function module that can be stored in the memory in the form of software or firmware or solidified in the operating system (OS) of the device.
[0118] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 3 As shown, the electronic device includes a processor 301 (processor), a memory 302 (memory) and a bus 303; wherein the processor 301 and the memory 302 communicate with each other through the bus 303. The processor 301 is used to call the program instructions in the memory 302 to execute the methods provided by the above-mentioned method embodiments.
[0119] The processor 301 can be an integrated circuit chip with signal processing capabilities. The above-mentioned processor 301 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. It can implement or execute various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0120] The memory 302 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable red-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, disk or optical disk.
[0121] This embodiment discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the methods provided by the above-mentioned method embodiments.
[0122] This embodiment provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions enable the computer to execute the methods provided by the above-mentioned method embodiments.
[0123] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only 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 communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0124] In addition, 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 network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0125] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0126] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the scope of protection of the present application.
Claims
1. A web page analysis method based on a browser plug-in, characterized in that: The method comprises: Capturing text data of a target webpage through a browser plug-in; the target webpage is a webpage opened through a browser; the browser plug-in is built into the browser; Receiving a user instruction input by the user through the browser plug-in; The text data and the user instructions are sent to a backend service that interacts with the browser plug-in according to a preset sending rule, so that the backend service sends the text data and the user instructions to a large language model, so that the large language model analyzes the text data based on the user instructions to obtain an analysis result.
2. The method according to claim 1, characterized in that: The method of capturing text data of a target web page through a browser plug-in includes: Monitor the loading process of the target web page through the browser plug-in; If the browser plug-in monitors that the loading of the target webpage is complete, the text data of the target webpage is captured by the browser plug-in.
3. The method according to claim 2, characterized in that The browser plug-in includes an interface for accessing the target web page and a script file for grabbing the text content of the web page; Capturing text data of the target webpage through the browser plug-in includes: Injecting the script file into the target webpage through the interface, and crawling the text content of the target webpage by running the script file; Regular matching and structural processing are performed on the text content to generate text data.
4. The method according to claim 3, characterized in that: The step of crawling the text content of the target webpage by running the script file includes: Obtaining a document object model of the target webpage by running the script file; the document object model is used to describe the data structure of the target webpage; Parsing the document object model to locate text nodes of the target web page; Grab the text content in the text node.
5. The method according to claim 1, characterized in that: The step of sending the text data and the user instruction to a backend service interacting with the browser plug-in according to a preset sending rule includes: After grabbing the text data of the target webpage, sending the text data to a backend service that interacts with the browser plug-in for storage; after receiving the user instruction, sending the user instruction to the backend service; or, After receiving the user instruction, the user instruction is spliced with the text data to obtain spliced text data; and the spliced text data is sent to a backend service that interacts with the browser plug-in.
6. The method according to claim 1, characterized in that The method further comprises: The backend service initiates a session request to the large language model, so that the large language model creates a session instance based on the session request; Accordingly, the backend service sends the text data and the user instruction to the large language model, including: The backend service sends the text data and the user instruction to the large language model through the session instance.
7. The method according to any one of claims 1 to 6, characterized in that: After sending the text data and the user instruction to a backend service that interacts with the browser plug-in according to a preset sending rule, the method further includes: The backend service performs data inspection on the text data based on preset data inspection rules, and processes the text data based on the inspection result to obtain standard text data; Accordingly, the backend service sends the text data and the user instruction to the large language model, including: The backend service sends the standard text data and the user instruction to the large language model.
8. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the machine-readable instructions are executed by the processor, the method according to any one of claims 1 to 7 is performed.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is executed.
10. A computer program product, characterized in that include: Computer program instructions, when executed by a processor, perform the method according to any one of claims 1 to 7.
Citation Information
Cited By
Internet tool using method based on private network, electronic equipment and program product
CN121037354A
Browser context sensing method, system and equipment based on large model and medium
CN121958683A