Method and device for sharing network resources of multi-account browser

By starting http service locally on the client and setting up caches, and using network request filters to filter access requests, the problem of high traffic costs in resource sharing of multi-account browsers is solved, and efficient resource sharing and service quality are achieved.

CN119922176APending Publication Date: 2025-05-02ZIXUN TECHNOLOGY (FUJIAN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510073079.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2024-11-06
Filing Date
2025-01-17
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

Existing multi-account browsers realize resource sharing through proxy servers, resulting in high traffic costs and serious resource waste.

Method used

Start a local http service locally on the client and set up a local cache to filter access requests through the network request filter. If the preset filter rules are met, it will be forwarded to the local http service. If there are resources in the local cache, it will be returned directly, otherwise it will be obtained and cached through the proxy server.

Benefits of technology

It significantly reduces traffic costs, reduces unnecessary resource requests, improves service quality, and increases the speed and success rate of users' access to some resources by 50%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119922176A_ABST
    Figure CN119922176A_ABST
Patent Text Reader

Abstract

The invention provides a network resource sharing method and device for a multi-account browser, and the method comprises the steps: starting a local http service at the local of a client, and setting a local cache; the method comprises the following steps: setting a network request filter in a multi-account browser, receiving an access request of a user through the multi-account browser, and screening through the network request filter according to a domain name of the access request; if the domain name of the access request is consistent, forwarding the access request to a local http service to access the local cache of the client, if the local cache of the client has required network resources, sending the network resources to the multi-account browser, and if the local cache of the client does not have the required network resources, sending the network resources to the multi-account browser; if yes, accessing through the proxy server to obtain required network resources, and sending the required network resources to the multi-account browser; and if the domain name of the access request is not consistent, the access request is directly forwarded through the proxy server, and the corresponding network resource is obtained, so that the cost is remarkably reduced, and the service quality is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of resource sharing, and in particular to a method and device for sharing network resources of a multi-account browser. Background Art

[0002] A multi-account browser is a browser that allows users to create and manage multiple independent browser environments on the same device, each with its own unique configuration and settings; for example: Purple Bird Browser. Existing multi-account browsers are all implemented through proxy servers, so traffic passing through proxy servers is charged, which is expensive.

[0003] When a user opens a multi-account browser container, the resource cache cannot be shared by default due to the isolation of the browser environment. However, users usually need to manage multiple accounts on the same platform. Before users can see the platform web pages, they need to download the corresponding static resources. When multiple browser containers are opened, each container needs to download the same static resources, which is undoubtedly a waste of resources and increases the traffic cost for users. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a method and device for sharing network resources of a multi-account browser, which significantly reduces costs and improves service quality.

[0005] In a first aspect, the present invention provides a method for sharing network resources of a multi-account browser, comprising the following steps:

[0006] Step 1: Start a local http service on the client and set a local cache, where the local cache is used to store network resources.

[0007] Step 2: Set a network request filter in the multi-account browser to receive access requests from users through the multi-account browser, and filter the access requests through the network request filter according to the domain name of the access request;

[0008] Step 3: If the domain name of the access request meets the preset screening rules of the network request filter, the access request is forwarded to the local http service, the client local cache is accessed, if the client local cache has the required network resources, the network resources are sent to the multi-account browser, if the client local cache does not have the required network resources, the required network resources are accessed through the proxy server, the obtained network resources are cached in the client local cache, and sent to the multi-account browser;

[0009] If the domain name of the access request does not meet the preset screening rules of the network request filter, the access request is directly forwarded through the proxy server to obtain the corresponding network resources.

[0010] In a second aspect, the present invention provides a device for sharing network resources of a multi-account browser, comprising:

[0011] A local setting module starts a local http service on the client and sets a local cache, wherein the local cache is used to store network resources;

[0012] The request screening module sets a network request filter in the multi-account browser, receives the access request from the user through the multi-account browser, and screens the access request through the network request filter according to the domain name of the access request;

[0013] Return to the request module. If the domain name of the access request meets the preset screening rules of the network request filter, the access request is forwarded to the local http service, and the client local cache is accessed. If the client local cache has the required network resources, the network resources are sent to the multi-account browser. If the client local cache does not have the required network resources, the required network resources are accessed through the proxy server, and the obtained network resources are cached in the client local cache and sent to the multi-account browser.

[0014] If the domain name of the access request does not meet the preset screening rules of the network request filter, the access request is directly forwarded through the proxy server to obtain the corresponding network resources.

[0015] One or more technical solutions provided by the present invention have at least the following technical effects or advantages:

[0016] Significantly reduce costs: Network traffic is charged, but if it is sent directly from the user's network after being filtered, the cost will be lower. Reusing it among multiple browsers can reduce more unnecessary requests.

[0017] Configurable forwarding rules: Dynamically configure filtering rules on the proxy server, and new rules can take effect between different client versions: The backend can control the acquisition method of network resources such as js, css, png / jpg of certain domain names;

[0018] Improve service quality: The network of a multi-account browser may not be able to access some resources, but the user's local network can access and download them. After this solution, the user's access speed and success rate to some resources will be increased by 50%.

[0019] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The present invention will be further described below in conjunction with embodiments with reference to the accompanying drawings.

[0021] Figure 1 is a flow chart of the method in Embodiment 1 of the present invention;

[0022] Figure 2 It is a structural schematic diagram of the device in the second embodiment of the present invention;

[0023] Figure 3 Schematic diagram of an embodiment of the present invention. DETAILED DESCRIPTION

[0024] The technical solution in the embodiment of the present application has the following general idea:

[0025] By controlling the domain name and resource whitelist, the request is selectively forwarded to the local service to initiate a network request. If the local service cache hits, the corresponding resource is directly returned.

[0026] like Figure 3 As shown, under normal circumstances, the user terminal device is connected to an e-commerce server through a local gateway, then through the operator network, through the boarding point and the alighting point, and then through the proxy server to obtain network resources; the present invention can be set so that the user terminal device can be screened after passing through the local gateway, and then the specified domain name will not go through the proxy, and the network resources can be obtained from the local cache through the specified local.ziniao.com. If the local cache does not have it, the e-commerce server can be accessed through nginx after passing through the boarding point and the alighting point to obtain network resources.

[0027] The backend can control the js, css, png / jpg and other resources of certain domain names. For example, if the js resources under www.amazon.com need to match the rules, then when the browser initiates a js request for www.amazon.com, it will be intercepted by the plug-in and forwarded to the new domain name for proxy request. If the request is for www.yuque.com, since there is no configured rule, although it is intercepted, it will be released immediately and the js request for www.yuque.com will be directly requested.

[0028] 1. Resource screening: Get a batch of resources that can be forwarded locally (such as js resources, css resources, png / jpg / webp and other image resources) preset by the server through the plug-in, and add a network request filter to the plug-in (the chrome plug-in has a function chrome.webrequest.onBefreRequest, which can intercept network requests and redirect them to the domain name with the prefix of local.ziniao.com according to the rules. For example, if the preset png image resource rule is hit, the request will be returned from the service request of local.ziniao.com). All resources pass through the filter, and if the rule is hit, they will be forwarded to the local server.

[0029] 2. Local service: Local service refers to starting an http service locally on the client. The domain name is resolved from local.ziniao.com to 127.0.0.1 (this domain name is fixed for a product line. Different product lines will have different names and certificates. It is a configuration). After configuring the *.ziniao.com certificate, you can accept https and http resource requests.

[0030] 3. Resource caching: If the resources served locally do not hit the cache, a request will be forwarded from a cloud forwarding service and downloaded locally. Based on the URL path, it will be converted into a fixed-length key as the file name through a hash method and cached to the user's disk. The validity period is 24 hours.

[0031] 4. Forwarding service: a cloud-based http service based on nginx+CDN, used to accelerate the download of resources.

[0032] The backend can control the js, css, png / jpg and other resources of certain domain names. For example, if the js resources under www.amazon.com need to hit the rules, then when the browser initiates a js request for www.amazon.com, it will be intercepted by the plug-in and forwarded to the new domain name to proxy the request back.

[0033] Embodiment 1

[0034] like Figure 1 As shown, this embodiment provides a method for sharing network resources of a multi-account browser, including the following steps:

[0035] Step 1: Start a local http service on the client and set a local cache, where the local cache is used to store network resources.

[0036] Step 2: Set a network request filter in the multi-account browser to receive access requests from users through the multi-account browser, and filter the access requests through the network request filter according to the domain name of the access request;

[0037] Step 3: If the domain name of the access request meets the preset screening rules of the network request filter, the access request is forwarded to the local http service, the client local cache is accessed, if the client local cache has the required network resources, the network resources are sent to the multi-account browser, if the client local cache does not have the required network resources, the required network resources are accessed through the proxy server, the obtained network resources are cached in the client local cache, and sent to the multi-account browser;

[0038] If the domain name of the access request does not meet the preset screening rules of the network request filter, the access request is directly forwarded through the proxy server to obtain the corresponding network resources.

[0039] In this embodiment, preferably, step 1 is specifically as follows: starting a local http service locally on the client, setting the client domain name and the corresponding client IP address, and configuring a certificate, the local http service is used to undertake https and http resource requests, and setting a local cache, the local cache is used to store network resources.

[0040] In this embodiment, preferably, the preset screening rule of the network request filter is set on the proxy server and then sent to the client, and the preset screening rule is at least one preset domain name and corresponding network resources.

[0041] In this embodiment, preferably, a cloud HTTP service based on Nginx and CDN is created, and the step 3 is specifically as follows: if the domain name of the access request meets the preset screening rule of the network request filter, the access request is forwarded to the local http service, the client local cache is accessed, if the client local cache has the required network resources, the network resources are sent to the multi-account browser, if the client local cache does not have the required network resources, the cloud HTTP service is used to access and obtain the required network resources, the obtained network resources are cached in the client local cache, and sent to the multi-account browser;

[0042] If the domain name of the access request does not meet the preset screening rules of the network request filter, the access request is directly forwarded through the proxy server to obtain the corresponding network resources.

[0043] In this embodiment, preferably, the step 3 of caching the acquired network resources into the client local cache is as follows: the acquired network resources are based on the URL Path, converted into a key of a set length as the file name through Hash, stored in the client local cache, and set an expiration date.

[0044] Based on the same inventive concept, the present application also provides a device corresponding to the method in Example 1, see Example 2 for details.

[0045] Embodiment 2

[0046] like Figure 2 As shown, in this embodiment, a device for sharing network resources of a multi-account browser is provided, including:

[0047] A local setting module starts a local http service on the client and sets a local cache, wherein the local cache is used to store network resources;

[0048] The request screening module sets a network request filter in the multi-account browser, receives the access request from the user through the multi-account browser, and screens the access request through the network request filter according to the domain name of the access request;

[0049] Return to the request module. If the domain name of the access request meets the preset screening rules of the network request filter, the access request is forwarded to the local http service, and the client local cache is accessed. If the client local cache has the required network resources, the network resources are sent to the multi-account browser. If the client local cache does not have the required network resources, the required network resources are accessed through the proxy server, and the obtained network resources are cached in the client local cache and sent to the multi-account browser.

[0050] If the domain name of the access request does not meet the preset screening rules of the network request filter, the access request is directly forwarded through the proxy server to obtain the corresponding network resources.

[0051] In this embodiment, preferably, the setting module is specifically: starting a local http service locally on the client, setting the client domain name and the corresponding client IP address, and configuring a certificate, the local http service is used to undertake https and http resource requests, and setting a local cache, the local cache is used to store network resources.

[0052] In this embodiment, preferably, the preset screening rule of the network request filter is set on the proxy server and then sent to the client, and the preset screening rule is at least one preset domain name and corresponding network resources.

[0053] In this embodiment, preferably, a cloud HTTP service based on Nginx and CDN is created, and the return request module is specifically as follows: if the domain name of the access request meets the preset screening rule of the network request filter, the access request is forwarded to the local http service, the client local cache is accessed, if the client local cache has the required network resources, the network resources are sent to the multi-account browser, if the client local cache does not have the required network resources, the required network resources are accessed through the cloud HTTP service, the obtained network resources are cached in the client local cache, and sent to the multi-account browser;

[0054] If the domain name of the access request does not meet the preset screening rules of the network request filter, the access request is directly forwarded through the proxy server to obtain the corresponding network resources.

[0055] In this embodiment, preferably, the return request module caches the acquired network resources to the client local cache specifically as follows: the acquired network resources are based on the URL Path, converted into a key of a set length as the file name through Hash, stored in the client local cache, and set an expiration date.

[0056] Since the device introduced in the second embodiment of the present invention is a device used to implement the method of the first embodiment of the present invention, those skilled in the art can understand the specific structure and deformation of the device based on the method introduced in the first embodiment of the present invention, so it is not described here in detail. All devices used in the method of the first embodiment of the present invention belong to the scope of protection of the present invention.

[0057] The technical solution provided in the embodiments of the present application has at least the following technical effects or advantages:

[0058] This embodiment adopts a forwarding method. When the user opens the first browser container, the resource is redirected to a local http service. Therefore, the static resource only needs to be downloaded once, and then the resource is stored after being hashed by URLPath through disk caching. When the second container is opened, the resource is redirected to the local http service in the same way to detect whether there is a cached resource. If so, the downloaded content is directly returned without going through any network layer, which effectively reduces the time consumption and traffic loss of network requests.

[0059] Although the specific implementation modes of the present invention are described above, those skilled in the art should understand that the specific implementation modes described are only illustrative and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be included in the scope of protection of the claims of the present invention.

Claims

1. A method for sharing network resources of a multi-account browser, characterized in that: The steps include: Step 1: Start a local http service on the client and set a local cache, where the local cache is used to store network resources. Step 2: Set a network request filter in the multi-account browser to receive access requests from users through the multi-account browser, and filter the access requests through the network request filter according to the domain name of the access request; Step 3: If the domain name of the access request meets the preset screening rules of the network request filter, the access request is forwarded to the local http service, the client local cache is accessed, if the client local cache has the required network resources, the network resources are sent to the multi-account browser, if the client local cache does not have the required network resources, the required network resources are accessed through the proxy server, the obtained network resources are cached in the client local cache, and sent to the multi-account browser; If the domain name of the access request does not meet the preset screening rules of the network request filter, the access request is directly forwarded through the proxy server to obtain the corresponding network resources.

2. A method for sharing network resources of a multi-account browser according to claim 1, characterized in that: The step 1 is specifically as follows: starting a local http service on the client, setting the client domain name and the corresponding client IP address, and configuring a certificate, the local http service is used to accept https and http resource requests, and setting a local cache, the local cache is used to store network resources.

3. A method for sharing network resources of a multi-account browser according to claim 1, characterized in that: The preset screening rule of the network request filter is set on the proxy server and then sent to the client, and the preset screening rule is at least one preset domain name and corresponding network resources.

4. A method for sharing network resources of a multi-account browser according to claim 1, characterized in that: Create a cloud HTTP service based on Nginx and CDN, and the step 3 is specifically as follows: if the domain name of the access request meets the preset screening rules of the network request filter, forward the access request to the local http service, access the client local cache, if the client local cache has the required network resources, send the network resources to the multi-account browser, if the client local cache does not have the required network resources, access the required network resources through the cloud HTTP service, cache the obtained network resources in the client local cache, and send them to the multi-account browser; If the domain name of the access request does not meet the preset screening rules of the network request filter, the access request is directly forwarded through the proxy server to obtain the corresponding network resources.

5. A method for sharing network resources of a multi-account browser according to claim 1, characterized in that: The specific steps of caching the acquired network resources in the client local cache in step 3 are as follows: the acquired network resources are converted into a key of a set length as the file name based on the URL Path through Hash, stored in the client local cache, and an expiration date is set.

6. A device for sharing network resources of a multi-account browser, characterized in that: include: A local setting module starts a local http service on the client and sets a local cache, wherein the local cache is used to store network resources; The request screening module sets a network request filter in the multi-account browser, receives the access request from the user through the multi-account browser, and screens the access request through the network request filter according to the domain name of the access request; Return to the request module. If the domain name of the access request meets the preset screening rules of the network request filter, the access request is forwarded to the local http service, and the client local cache is accessed. If the client local cache has the required network resources, the network resources are sent to the multi-account browser. If the client local cache does not have the required network resources, the required network resources are accessed through the proxy server, and the obtained network resources are cached in the client local cache and sent to the multi-account browser. If the domain name of the access request does not meet the preset screening rules of the network request filter, the access request is directly forwarded through the proxy server to obtain the corresponding network resources.

7. The device for sharing network resources of a multi-account browser according to claim 6, characterized in that: The setting module specifically starts a local http service on the client, sets the client domain name and the corresponding client IP address, and configures a certificate. The local http service is used to accept https and http resource requests, and sets a local cache, which is used to store network resources.

8. A method for sharing network resources of a multi-account browser according to claim 6, characterized in that: The preset screening rule of the network request filter is set on the proxy server and then sent to the client, and the preset screening rule is at least one preset domain name and corresponding network resources.

9. The device for sharing network resources of a multi-account browser according to claim 6, characterized in that: Create a cloud HTTP service based on Nginx and CDN, and the return request module is specifically as follows: if the domain name of the access request meets the preset screening rules of the network request filter, the access request is forwarded to the local http service, the client local cache is accessed, if the client local cache has the required network resources, the network resources are sent to the multi-account browser, if the client local cache does not have the required network resources, the cloud HTTP service is used to access and obtain the required network resources, the obtained network resources are cached in the client local cache, and sent to the multi-account browser; If the domain name of the access request does not meet the preset screening rules of the network request filter, the access request is directly forwarded through the proxy server to obtain the corresponding network resources.

10. The device for sharing network resources of a multi-account browser according to claim 6, characterized in that: The return request module caches the acquired network resources to the client local cache specifically as follows: the acquired network resources are converted into a key of a set length as the file name based on the URL Path through Hash, stored in the client local cache, and an expiration date is set.