A webpage classification method, an electronic device, and a storage medium
Patent Information
- Application Number
- CN202411229459.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2044-09-03
AI Technical Summary
[0002]对网页进行分类能够使用户进一步的了解网页的相关信息,从而使用户对网页进行调整和优化,在现有技术中,对网页进行分类需要根据用户的需求选择相应的分类方法对待分类网页进行分类,现有技术中的分类方法包括:按网页的内容主题分类;按网页的功能和用途分类;按网页的用户交互性分类;按网页的技术实现分类;按网页的商业模型分类;按网页的目标受众分类;按网页的信息更新频率分类;按网页的设计和布局分类;按网页内容来源分类;按网页的地域和服务范围分类;按打开网页的浏览器的浏览器类型分类,但是上述方法也存在以下技术问题:现有技术中只有按打开网页的浏览器的浏览器类型对网页进行分类,并没有按打开网页的浏览器对网页进行分类的方法,当用户的需求为按打开网页的浏览器对网页进行分类时,无法满足用户需求
[0013]本发明提供了一种网页分类方法、电子设备及存储介质,所述方法能够获取待分类网页ID对应的初始Cookie数据,初始Cookie数据包括初始请求键值对,将初始请求键值对作为关键请求键值进一步的获取目标请求键值对,当初始请求键值对与目标请求键值对相同时,将所述初始请求键值对对应的待分类网页ID对应的待分类网页作为所述目标请求键值对对应的浏览器对应的目标网页,可知,所述方法能够将若干个待分类网页按照其被打开的浏览器进行分类以获取浏览器对应的目标网页,当用户的需求为按打开网页的浏览器对网页进行分类时,能够满足用户需求。
Smart Images

Figure CN119003902B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a webpage classification method, electronic device, and storage medium. Background Technology
[0002] Categorizing web pages allows users to better understand their information, enabling them to adjust and optimize the pages. Current categorization methods require selecting appropriate methods based on user needs. These methods include: categorizing by content theme; categorizing by function and purpose; categorizing by user interactivity; categorizing by technical implementation; categorizing by business model; categorizing by target audience; categorizing by update frequency; categorizing by design and layout; categorizing by content source; categorizing by region and service scope; and categorizing by browser type. However, these methods have the following technical problems: current technologies only categorize web pages by browser type, not by browser itself. Therefore, when a user's requirement is categorized by browser, this method fails to meet that need. Summary of the Invention
[0003] To address the aforementioned technical problems, the technical solution adopted by this invention is as follows:
[0004] According to a first aspect of the present invention, a webpage classification method is provided. The method is used to classify a plurality of webpages to be classified according to the browser in which they are opened to obtain the target webpage corresponding to the browser. The method includes the following steps:
[0005] S1. Obtain the list of webpage IDs to be categorized, A = {A1, A2, ..., A...} i , ..., A m}, where A i Let be the ID of the i-th webpage to be categorized, where i ranges from 1 to m, and m is the number of webpages to be categorized.
[0006] S2. Obtain the initial cookie data list B = {B1, B2, ..., B} corresponding to A. i , ..., B m}, where B i For A iThe corresponding initial cookie data includes the initial request key-value pairs. The initial cookie data corresponding to the page ID to be categorized is the data in the cookie returned by the target server to the target SDK after the target server receives the request sent by the target SDK corresponding to the page ID to be categorized.
[0007] S3, B i The initial request key-value pair in the A i The corresponding key-value pair C i To obtain the list of key-value pairs C corresponding to A, C = {C1, C2, ..., C...} i , ..., C m}
[0008] S4. Perform deduplication on C to obtain the target request key-value pair list D = {D1, D2, ..., D...} j , ..., D n}, where D j Let j be the j-th target request key-value pair, where j ranges from 1 to n and n is the number of target request key-value pairs. Each target request key-value pair corresponds to a browser.
[0009] S5, when C i =D j At that time, C i Corresponding A i The corresponding webpage to be categorized is D j The corresponding browser and the corresponding target webpage and A i Use the target webpage ID to obtain the target webpage ID list set E = {E1, E2, ..., E...} j , ..., E n}, E j ={E j1 E j2 , ..., E jk , ..., E jt(j)}, where E j D j The corresponding browser and the corresponding list of target webpage IDs, E jk D j The corresponding browser's target webpage ID for the k-th target webpage, where k ranges from 1 to t(j), and t(j) is D. j The number of target web pages corresponding to the corresponding browser.
[0010] According to a second aspect of the present invention, a non-transitory computer-readable storage medium is provided, wherein a computer program is stored in the storage medium, and the computer program is loaded and executed by a processor to implement the aforementioned method.
[0011] According to a third aspect of the present invention, an electronic device is provided, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the aforementioned method.
[0012] The present invention has at least the following beneficial effects:
[0013] This invention provides a webpage classification method, an electronic device, and a storage medium. The method can obtain initial cookie data corresponding to the ID of the webpage to be classified. The initial cookie data includes an initial request key-value pair. The initial request key-value pair is used as a key request key to further obtain a target request key-value pair. When the initial request key-value pair is the same as the target request key-value pair, the webpage to be classified corresponding to the ID of the webpage to be classified corresponding to the initial request key-value pair is used as the target webpage corresponding to the browser of the target request key-value pair. It can be seen that the method can classify several webpages to be classified according to the browser that opened them to obtain the target webpage corresponding to the browser. When the user's requirement is to classify webpages according to the browser that opened the webpage, it can meet the user's needs. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 A flowchart of a webpage classification method provided in an embodiment of the present invention. Detailed Implementation
[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0017] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar tasks and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0018] Embodiments of the present invention provide a webpage classification method. The method is used to classify a plurality of webpages to be classified according to the browser in which they are opened, thereby obtaining the target webpage corresponding to the browser. The target webpage corresponding to the browser can be understood as the webpage to be classified that is opened by the browser among the plurality of webpages to be classified. The method includes the following steps, such as... Figure 1 As shown:
[0019] S1. Obtain the list of webpage IDs to be categorized, A = {A1, A2, ..., A...} i , ..., A m}, where A i Let be the ID of the i-th webpage to be categorized, where i ranges from 1 to m, and m is the number of webpages to be categorized.
[0020] Specifically, the page ID to be categorized is a unique identifier for the page to be categorized. As those skilled in the art know, the page to be categorized is a page that is predetermined by those skilled in the art based on actual needs, and will not be elaborated further here.
[0021] S2. Obtain the initial cookie data list B = {B1, B2, ..., B} corresponding to A. i , ..., B m}, where B i For A i The corresponding initial cookie data includes initial request key-value pairs. The initial cookie data corresponding to the page ID to be categorized is the data in the cookie returned by the target server to the target SDK after the target server receives the request sent by the target SDK corresponding to the page ID to be categorized. Cookies are simple text files stored on the client machine and can be understood as cached data.
[0022] Specifically, the target SDK is an SDK (Software Development Kit) integrated into the webpage to be categorized and capable of sending requests to the target server when the webpage to be categorized is opened by a browser.
[0023] Specifically, the target server is the server that interacts with the target SDK to provide services, data, or functions.
[0024] Specifically, the initial request key-value pairs include the request name and the request address.
[0025] Specifically, the initial cookie data corresponding to the webpage ID to be categorized is stored in the cookie data storage space of the browser that opens the webpage corresponding to the webpage ID to be categorized. As those skilled in the art know, the cookie data storage space of the browser is determined by those skilled in the art according to actual needs, and will not be elaborated here. For example, the cookie data storage space of the browser can be a browser-specific storage area, a folder set by the user using the browser, or memory.
[0026] Furthermore, if the browser's corresponding cookie data storage space does not store any initial cookie data before the webpage to be categorized is opened by the browser, then the request name of the initial request key-value pair in the initial cookie data corresponding to the webpage ID to be categorized is the request name of the request sent by the target SDK corresponding to the webpage to be categorized to the target server when the webpage to be categorized is opened by the browser, and the request address of the initial request key-value pair in the initial cookie data corresponding to the webpage ID to be categorized is the request address of the request sent by the target SDK corresponding to the webpage to be categorized to the target server when the webpage to be categorized is opened by the browser; the absence of any initial cookie data in the browser's corresponding cookie data storage space before the webpage to be categorized is understood to mean that the browser has not opened any webpage before opening the webpage to be categorized, or that the data in the browser's corresponding cookie data storage space was cleared before opening the webpage to be categorized.
[0027] Furthermore, if at least one initial cookie data is stored in the browser's corresponding cookie data storage space before the webpage to be categorized is opened by the browser, then when the webpage to be categorized is opened by the browser, the request sent by the target SDK corresponding to the webpage to the target server includes an initial request key-value pair from any initial cookie data in the cookie data storage space, and uses the initial request key-value pair as the initial request key-value pair in the initial cookie data corresponding to the webpage ID to be categorized. The fact that at least one initial cookie data is stored in the browser's corresponding cookie data storage space before the webpage to be categorized is understood to mean that the browser opened at least one webpage before opening the webpage to be categorized, and the data in the browser's corresponding cookie data storage space was not cleared before opening the webpage to be categorized.
[0028] Optionally, the request sent by the target SDK corresponding to the webpage to be categorized to the target server is used to load a blank image in the browser that opens the webpage to be categorized.
[0029] Specifically, the request names and URLs sent by the target SDKs to the target servers for two web pages to be categorized, which are opened by different browsers, are all different. This can be understood as follows: if web page 1 is opened by browser 1 and web page 2 is opened by browser 2, then the request names and URLs of the requests sent by the target SDKs to the target servers in web page 1 and web page 2 are different. Furthermore, the initial request key-value pairs in the initial cookie data corresponding to the web page ID of web page 1 are different from those in the initial cookie data corresponding to the web page ID of web page 1.
[0030] S3, B i The initial request key-value pair in the A i The corresponding key-value pair C i To obtain the list of key-value pairs C corresponding to A, C = {C1, C2, ..., C...} i , ..., C m}
[0031] S4. Perform deduplication on C to obtain the target request key-value pair list D = {D1, D2, ..., D...} j , ..., D n}, where D jLet j be the j-th target request key-value pair, where j ranges from 1 to n and n is the number of target request key-value pairs. Each target request key-value pair corresponds to a browser, and the two browsers corresponding to any two target request key-value pairs are different. As those skilled in the art know, any deduplication method in the prior art is within the protection scope of this invention, and will not be described in detail here.
[0032] Specifically, the target request key-value pair is the same as the initial request key-value pair in any initial cookie data stored in the browser's corresponding cookie data storage space.
[0033] S5, when C i =D j At that time, C i Corresponding A i The corresponding webpage to be categorized is D j The corresponding browser and the corresponding target webpage and A i The target webpage ID is used to obtain a list set of target webpage IDs E = {E1, E2, ..., E...} j , ..., E n}, E j ={E j1 E j2 , ..., E jk , ..., E jt(j)}, where E j D j The corresponding browser and the corresponding list of target webpage IDs, E jk D j The corresponding browser's target webpage ID for the k-th target webpage, where k ranges from 1 to t(j), and t(j) is D. j The number of target web pages corresponding to the corresponding browser.
[0034] Through the above steps, the initial cookie data corresponding to the webpage ID to be categorized is obtained. The initial cookie data includes an initial request key-value pair. The initial request key-value pair is used as the key request key to further obtain the target request key-value pair. When the initial request key-value pair is the same as the target request key-value pair, the webpage to be categorized corresponding to the webpage ID to be categorized corresponding to the initial request key-value pair is used as the target webpage corresponding to the browser of the target request key-value pair. This allows several webpages to be categorized according to the browser in which they are opened to obtain the target webpage corresponding to the browser. When the user's requirement is to categorize webpages according to the browser in which the webpage is opened, this can meet the user's needs.
[0035] Embodiments of the present invention also provide a non-transitory computer-readable storage medium that can be disposed in an electronic device to store a computer program related to implementing a method in the method embodiments, the computer program being loaded and executed by the processor to implement the method provided in the above embodiments.
[0036] Embodiments of the present invention also provide an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method provided in the above embodiments.
[0037] Embodiments of the present invention also provide a computer program product including program code, which, when the program product is run on an electronic device, causes the electronic device to perform the steps of the methods described above in various exemplary embodiments of the present invention.
[0038] This invention provides a webpage classification method, an electronic device, and a storage medium. The method can obtain initial cookie data corresponding to the ID of the webpage to be classified. The initial cookie data includes an initial request key-value pair. The initial request key-value pair is used as a key request key to further obtain a target request key-value pair. When the initial request key-value pair is the same as the target request key-value pair, the webpage to be classified corresponding to the ID of the webpage to be classified corresponding to the initial request key-value pair is used as the target webpage corresponding to the browser of the target request key-value pair. It can be seen that the method can classify several webpages to be classified according to the browser that opened them to obtain the target webpage corresponding to the browser. When the user's requirement is to classify webpages according to the browser that opened the webpage, it can meet the user's needs.
[0039] While specific embodiments of the invention have been described in detail by way of examples, those skilled in the art should understand that the examples are for illustrative purposes only and are not intended to limit the scope of the invention. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of the invention.
Claims
1. A webpage classification method, characterized in that, The method is used to classify several web pages to be categorized according to the browsers they are opened in, in order to obtain the target web pages corresponding to those browsers. The method includes the following steps: S1. Obtain the list of webpage IDs to be categorized, A = {A1, A2, ..., A...} i , ..., A m }, where A i Let i be the ID of the i-th webpage to be categorized, where i ranges from 1 to m, and m is the number of webpages to be categorized. S2. Obtain the initial cookie data list B = {B1, B2, ..., B} corresponding to A. i , ..., B m }, where B i For A i The corresponding initial cookie data includes initial request key-value pairs. The initial cookie data corresponding to the page ID to be categorized is the data in the cookie returned by the target server to the target SDK after the target server receives the request sent by the target SDK corresponding to the page ID to be categorized. S3, B i The initial request key-value pair in the A i The corresponding key-value pair C i To obtain the list of key-value pairs C corresponding to A, C = {C1, C2, ..., C...} i , ..., C m }; S4. Perform deduplication on C to obtain the target request key-value pair list D = {D1, D2, ..., D...} j , ..., D n }, where D j For the j-th target request key-value pair, j takes the value from 1 to n, and n is the number of target request key-value pairs. Each target request key-value pair corresponds to a browser. S5, when C i =D j At that time, C i Corresponding A i The corresponding webpage to be categorized is D j The corresponding browser and the corresponding target webpage and A i The target webpage ID is used to obtain a list set of target webpage IDs E = {E1, E2, ..., E...} j , ..., E n }, E j ={E j1 E j2 , ..., E jk , ..., E jt(j) }, where E j D j The corresponding browser and the corresponding list of target webpage IDs, E jk D j The corresponding browser's target webpage ID for the k-th target webpage, where k ranges from 1 to t(j), and t(j) is D. j The number of target web pages corresponding to the corresponding browser.
2. The webpage classification method according to claim 1, characterized in that, The initial request key-value pairs include the request name and the request URL.
3. The webpage classification method according to claim 2, characterized in that, The initial cookie data corresponding to the page ID to be categorized is stored in the cookie data storage space of the browser that opens the page corresponding to the page ID to be categorized.
4. The webpage classification method according to claim 3, characterized in that, If no initial cookie data is stored in the browser's corresponding cookie data storage space before the webpage to be categorized is opened by the browser, then the request name of the initial request key-value pair in the initial cookie data corresponding to the webpage ID to be categorized is the request name of the request sent by the target SDK corresponding to the webpage to be categorized to the target server when the webpage to be categorized is opened by the browser, and the request address of the initial request key-value pair in the initial cookie data corresponding to the webpage ID to be categorized is the request address of the request sent by the target SDK corresponding to the webpage to be categorized to the target server when the webpage to be categorized is opened by the browser.
5. The webpage classification method according to claim 3, characterized in that, If at least one initial cookie data is stored in the browser's corresponding cookie data storage space before the webpage to be categorized is opened by the browser, then when the webpage to be categorized is opened by the browser, the request sent by the target SDK corresponding to the webpage to the target server includes the initial request key-value pair from any initial cookie data in the cookie data storage space, and the initial request key-value pair is used as the initial request key-value pair in the initial cookie data corresponding to the webpage ID to be categorized.
6. The webpage classification method according to claim 3, characterized in that, The target request key-value pair is the same as the initial request key-value pair in any initial cookie data stored in the browser's corresponding cookie data storage space.
7. The webpage classification method according to claim 1, characterized in that, The ID of the page to be categorized is a unique identifier for the page to be categorized.
8. The webpage classification method according to claim 1, characterized in that, The key-value pairs of any two target requests will be different in the two browsers.
9. A non-transitory computer-readable storage medium, characterized in that, The storage medium stores a computer program, which is loaded and executed by a processor to implement the web page classification method as described in any one of claims 1-8.
10. An electronic device, comprising: A processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that, when the processor executes the computer program, it implements the web page classification method as described in any one of claims 1-8.
Citation Information
Patent Citations
Control method and device for browser skipping to application program
CN106528657A
Data processing method and device for switching browser kernel, terminal and storage medium
CN109634753A