Browser page updating method and apparatus

By detecting the target image in the browser page and obtaining its cache path, finding the target network path in the web server, and replacing the browser cache path, the problem of long browser page update time is solved, and a faster update process is achieved.

CN115757996BActive Publication Date: 2026-03-03TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-03
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

In existing technologies, the browser page update process is complicated, resulting in a long update time.

Method used

By detecting the target image in the browser page, obtaining its cache path, finding the corresponding target network path in the web server, replacing the cache path with the target network path, and updating the browser cache to replace the target image.

Benefits of technology

The size of the updated content is reduced, thus shortening the time it takes for the browser page to update.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115757996B_ABST
    Figure CN115757996B_ABST
Patent Text Reader

Abstract

The application provides a browser page updating method and device. The method comprises the following steps: detecting a target picture needing to be replaced in a browser page, and acquiring a cache path of the target picture in a browser cache; searching for a target network path corresponding to the cache path in a network server, the target network path being a storage path of a specified picture for replacing the target picture in the network server; using the target network path to replace the cache path stored in the browser cache to obtain an updated browser cache; and updating the browser page based on the updated browser cache, so as to replace the target picture with the specified picture, and to reduce the time spent in updating the browser page.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of computer and communication technology, and in particular to a browser page updating method and apparatus. Background Technology

[0002] In existing technologies, when updating a browser page, the process typically involves first locating the storage location corresponding to the browser page, then finding the file used to generate the browser page before the update from that storage location, and finally replacing that file with the file used to generate the browser page after the update. The updated browser page is then generated based on the file stored in the browser page's storage location. This update process is very complicated and results in a long update time. Summary of the Invention

[0003] This application aims to provide a browser page updating method and apparatus, which can solve the problem of long update times for browser pages to a certain extent.

[0004] According to one aspect of the embodiments of this application, a browser page update method is provided, comprising: detecting a target image in the browser page that needs to be replaced, and obtaining the cache path of the target image in the browser cache; searching a target network path in a network server corresponding to the cache path, wherein the target network path is the storage path of a specified image used to replace the target image in the network server; storing the specified image in the browser cache using the target network path instead of the cache path, thereby obtaining an updated browser cache; and updating the browser page based on the updated browser cache to replace the target image with the specified image.

[0005] According to one aspect of the embodiments of this application, a browser page update apparatus is provided, comprising: a detection module configured to detect a target image in a browser page that needs to be replaced, and to obtain the cache path of the target image in the browser cache; a search module configured to search a target network path in a network server corresponding to the cache path, wherein the target network path is the storage path of a specified image used to replace the target image in the network server; a replacement module configured to use the target network path to replace the cache path and store it in the browser cache, thereby obtaining an updated browser cache; and an update module configured to update the browser page based on the updated browser cache, so as to replace the target image with the specified image.

[0006] In one embodiment of this application, based on the foregoing scheme, the search module is configured to: obtain the replacement path naming rule corresponding to the target image in the browser cache; obtain the target image identifier from the cache path based on the replacement path naming rule; and search for the network path corresponding to the target image identifier in the network server based on the target image identifier, and use it as the target network path.

[0007] In one embodiment of this application, based on the foregoing scheme, after finding the target network path corresponding to the cache path in the network server, the search module is configured to: obtain the code library file corresponding to the browser page in the code library; obtain the library path corresponding to the cache path stored in the code library file; and use the target network path to replace the library path in the library file.

[0008] In one embodiment of this application, based on the foregoing scheme, the search module is configured to: obtain the replacement path naming rule corresponding to the target image in the browser cache, and the library path naming rule corresponding to the code library; obtain the target image identifier from the cache path based on the replacement path naming rule; obtain the candidate library image identifier corresponding to the candidate library path from the candidate library path stored in the code library file based on the library path naming rule; and use the candidate library path corresponding to the candidate library image identifier that is the same as the target image identifier as the library path corresponding to the cache path.

[0009] In one embodiment of this application, based on the foregoing scheme, there are multiple library path naming rules. Before obtaining the candidate library image identifier corresponding to the candidate library path from the candidate library paths stored in the code library file, the search module is further configured to: select a library path naming rule that is the same as the replacement path naming rule from the multiple library path naming rules; and take the path corresponding to the library path naming rule that is the same as the replacement path naming rule as the candidate library path.

[0010] In one embodiment of this application, based on the foregoing scheme, before searching for the target network path corresponding to the cached path in the network server, the search module is further configured to: obtain the upload path generated by uploading the specified image to the network server through a browser plugin; obtain the replacement path naming rule corresponding to the target image in the browser cache; and modify the upload path based on the replacement path naming rule to obtain the target network path.

[0011] In one embodiment of this application, based on the foregoing scheme, the detection module is configured to: acquire a replaceable image from the browser page; display the replaceable image in the operation panel of the browser page; and, in response to an image-changing operation in the operation panel, acquire the replaceable image targeted by the image-changing operation as the target image.

[0012] In one embodiment of this application, based on the foregoing scheme, the detection module is configured to: obtain the replacement path naming rules corresponding to the browser page for indicating that an image can be replaced; and select an image whose path conforms to the replacement path naming rules in the browser page as the replaceable image.

[0013] In one embodiment of this application, based on the foregoing scheme, before obtaining the cache path of the target image in the browser cache, the detection module is configured to: obtain a page whitelist corresponding to the browser plugin installed on the client where the page is located; if the browser page is in the page whitelist, then detect the target image that needs to be replaced in the browser page.

[0014] According to one aspect of the embodiments of this application, a computer program storage medium is provided, which stores computer program instructions that, when executed by a computer, cause the computer to perform any of the methods described above.

[0015] According to one aspect of the embodiments of this application, an electronic device is provided, comprising: a processor; and a memory storing computer-readable instructions, wherein when the computer-readable instructions are executed by the processor, the electronic device implements the method as described in any of the preceding claims.

[0016] According to one aspect of the embodiments of this application, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various alternative embodiments described above.

[0017] The technical solutions provided by the embodiments of this application may include the following beneficial effects:

[0018] In some embodiments of this application, the technical solutions involve detecting the target image to be replaced on the browser page and obtaining the cache path of the target image in the browser cache; finding the target network path corresponding to the cache path on the network server, where the target network path is the storage path of the specified image used to replace the target image on the network server; using the target network path instead of the cache path to store in the browser cache, resulting in an updated browser cache; and updating the browser page based on the updated browser cache to replace the target image with the specified image, using the updated path instead of the updated file. Since the size of the bytes recording the path is usually smaller than that of the target image, the updated content is smaller, thus reducing the time spent updating the browser page.

[0019] It should be understood that the above general description and the following detailed description are merely exemplary and do not limit this application. Attached Figure Description

[0020] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the specification, serve to explain the principles of this application.

[0021] Figure 1 A schematic diagram of an exemplary system architecture to which the technical solutions of the embodiments of this application can be applied is shown;

[0022] Figure 2 A flowchart illustrating a browser page update method according to an embodiment of this application is shown schematically;

[0023] Figure 3 This illustration shows a schematic diagram of a browser plugin resource mapping process according to an embodiment of this application;

[0024] Figure 4 This illustration schematically shows a browser page update timing diagram in one embodiment of this application;

[0025] Figure 5 This illustration schematically shows a process diagram of a browser page update method according to an embodiment of the present application;

[0026] Figure 6 The illustration shows a schematic diagram of an interface for uploading images on a static resource platform according to an embodiment of this application;

[0027] Figure 7 The illustration shows a schematic diagram of an interface with an operation panel according to an embodiment of the present application;

[0028] Figure 8 This illustration schematically shows a diagram of an interface for selecting a library branch according to one embodiment of this application;

[0029] Figure 9 This illustration schematically depicts a path replacement process according to an embodiment of the present application;

[0030] Figure 10 A block diagram illustrating a browser page updating apparatus according to an embodiment of this application is shown schematically.

[0031] Figure 11 This is a hardware diagram of an electronic device according to an exemplary embodiment. Detailed Implementation

[0032] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this application more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art.

[0033] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this application.

[0034] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0035] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.

[0036] Figure 1 A schematic diagram of an exemplary system architecture 100 to which the technical solutions of the embodiments of this application can be applied is shown.

[0037] like Figure 1As shown, system architecture 100 may include client 101, network 102, and server 103. Network 102 is used as a medium to provide a communication link between client 101 and server 103. Network 102 may include various connection types, such as wired communication links, wireless communication links, etc., which are not limited herein.

[0038] It should be understood that Figure 1 The number of clients 101, networks 102, and servers 103 shown is merely illustrative. Depending on implementation needs, there can be any number of clients 101, networks 102, and servers 103. For example, server 103 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. Client 101 can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these.

[0039] In one embodiment of this application, when the task execution time arrives, the server 103 detects the target image that needs to be replaced in the browser page (Web page) and obtains the cache path of the target image in the browser cache; it searches for the target network path corresponding to the cache path in the network server, where the target network path is the storage path of the specified image used to replace the target image in the network server; it uses the target network path to replace the cache path in the browser cache, resulting in an updated browser cache; and it updates the browser page based on the updated browser cache to replace the target image with the specified image, and updates the path instead of the file. The size of the bytes recording the path is usually smaller than the size of the target image, which can reduce the amount of content updated, thereby reducing the time spent updating the browser page.

[0040] It should be noted that the browser page update method provided in this application embodiment is generally executed by server 103, and correspondingly, the browser page update device is generally located in server 103. However, in other embodiments of this application, client 101 may also have similar functions to server 103, thereby executing the browser page update method provided in this application embodiment.

[0041] The implementation details of the technical solutions in the embodiments of this application are described in detail below:

[0042] Figure 2The flowchart illustrating a browser page update method according to an embodiment of this application is shown in the schematic diagram. The execution entity of the browser page update method can be a server, for example, a... Figure 1 Server 103 is shown in the image.

[0043] Reference Figure 2 As shown, this browser page update method includes at least steps S210 to S240, which are detailed below:

[0044] In step S210, the target image that needs to be replaced in the browser page is detected, and the cache path of the target image in the browser cache is obtained.

[0045] In one embodiment of this application, a replaceable image can be obtained from a browser page; the replaceable image can be displayed in the operation panel of the browser page; in response to the image replacement operation in the operation panel, the replaceable image targeted by the image replacement operation can be obtained as the target image.

[0046] In one embodiment of this application, the replacement path naming rules corresponding to the browser page for indicating that an image can be replaced can be obtained; in the browser page, an image whose path conforms to the replacement path naming rules is selected as a replaceable image.

[0047] In one embodiment of this application, replaceable image identifiers can be obtained, and replaceable image identifiers can form a replaceable image list, which is displayed on the operation panel of the browser page. The replaceable image list can also be formed by the replaceable images themselves.

[0048] In one embodiment of this application, click operations or touch operations in the operation panel can be detected, and the coordinates corresponding to the click operations or touch operations can be obtained to determine the replaceable image for the image replacement operation.

[0049] In one embodiment of this application, the browser page is generated from files in the browser cache, and the files in the browser cache are synchronized with static resource files (SRS JSON) in the code repository (Git), and the browser cache can be updated based on the static resource files (SRS JSON).

[0050] In one embodiment of this application, before obtaining the cache path of the target image in the browser cache, a page whitelist corresponding to the browser plugin installed on the client where the page is located can be obtained; if the browser page is in the page whitelist, the target image that needs to be replaced in the browser page is detected; if the browser page is not in the page whitelist, the target image that needs to be replaced in the browser page is not detected, and the browser page update method of this application is stopped, thereby effectively preventing illegal replacement operations.

[0051] In one embodiment of this application, the plugin identifier of the browser plugin installed on the client can be obtained, and the corresponding page whitelist can be looked up based on the plugin identifier. The correspondence between browser plugins and page whitelists can be pre-defined.

[0052] In step S220, the target network path corresponding to the cache path is located in the network server. The target network path is the storage path of the specified image used to replace the target image in the network server.

[0053] In one embodiment of this application, the replacement path naming rule corresponding to the target image in the browser cache can be obtained; based on the replacement path naming rule, the target image identifier can be obtained from the cache path; based on the target image identifier, the network path corresponding to the target image identifier in the network server can be found as the target network path.

[0054] In one embodiment of this application, before searching for the target network path corresponding to the cached path in the network server, the upload path generated by uploading a specified image to the network server through a browser plugin can be obtained; the replacement path naming rule corresponding to the target image in the browser cache can be obtained; based on the replacement path naming rule, the upload path can be modified to obtain the target network path, so that the target network path satisfies the replacement path naming rule, thereby modifying the upload path to the same rule as the cached path, so that the target image corresponding to the target network path can be easily determined according to the target network path.

[0055] In one embodiment of this application, the naming rules for the replacement path can be the same as those for the static resource platform.

[0056] In one embodiment of this application, the naming rule for the replacement path can be determined as: srs_{md5_A}_{md5_B}, where srs is the identification prefix of the static resource file, md5_A is the update identifier for each file update, and md5_B is the unique identifier of the file in SRSJSON, used for identifier judgment.

[0057] In one embodiment of this application, the target network path may be the CDN address of the specified image on the network server.

[0058] In step S230, the target network path is used instead of the cache path and stored in the browser cache to obtain the updated browser cache.

[0059] In one embodiment of this application, if there are multiple target images on a browser page, the target image information of the multiple target images can be obtained, the multiple target images can be sorted based on the target image information of each target image, and the images can be replaced according to the sorting.

[0060] In one embodiment of this application, when sorting multiple target images, the similarity between each pair of target images can be calculated based on the target image information, and target images with similarity can be arranged together for easy replacement.

[0061] In one embodiment of this application, the target image information may include display features such as image format, display position, color, pattern, etc.; the target image information may also include intent features, which can be input into a machine learning model to determine the intent features of the target image; the target image information may also include behavioral features, such as the number of historical clicks on the image, etc.

[0062] In one embodiment of this application, target images with similar intent features can be arranged together for easy replacement.

[0063] In one embodiment of this application, target images with a high number of historical clicks can be prioritized to quickly replace frequently used images.

[0064] In other embodiments of this application, multiple threads can be used to replace multiple target images simultaneously.

[0065] In other embodiments of this application, when multiple threads replace multiple target images simultaneously, if the maximum number of replacements is less than the number of target images, images can be selected from target images with a similarity greater than a set similarity for replacement, so that target images with greater differences are replaced first, thereby enabling the simultaneous replacement of multiple images.

[0066] In step S240, the browser page is updated based on the updated browser cache to replace the target image with the specified image.

[0067] In one embodiment of this application, the content corresponding to the changed path in the browser cache can be obtained, and a specified image can be loaded into the browser page based on the changed target network cache path to update the browser page. In other embodiments of this application, the entire content of the corresponding browser page in the browser cache can be loaded to update the browser page.

[0068] exist Figure 2In this embodiment, the process involves detecting the target image to be replaced in the browser page and obtaining the cache path of the target image in the browser cache; finding the target network path corresponding to the cache path in the network server, where the target network path is the storage path of the specified image used to replace the target image in the network server; using the target network path instead of the cache path to store the image in the browser cache, resulting in an updated browser cache; and updating the browser page based on the updated browser cache to replace the target image with the specified image, using the updated path instead of the updated file. Since the size of the path is usually smaller than that of the target image, the updated content is smaller, thus reducing the time spent updating the browser page.

[0069] In one embodiment of this application, after finding the target network path corresponding to the cached path in the network server, the code library file corresponding to the browser page in the code library can be obtained; the library path corresponding to the cached path stored in the code library file can be obtained; and the target network path can be used to replace the library path in the library file to update the code library.

[0070] In one embodiment of this application, a specified code branch of the code library corresponding to the browser page can be obtained; the static resource file (SRS JSON) stored in the specified code branch can be obtained as the code library file corresponding to the browser page.

[0071] In one embodiment of this application, the browser page corresponds to a specific code branch in the codebase, which may be specified by the browser developer or selected by the browser page updater from multiple branches specified by the browser developer.

[0072] In one embodiment of this application, the replacement path naming rules corresponding to the target image in the browser cache and the library path naming rules corresponding to the code library can be obtained; based on the replacement path naming rules, the target image identifier is obtained from the cache path; based on the library path naming rules, the candidate library image identifier corresponding to the candidate library path is obtained from the candidate library path stored in the code library file; the candidate library path corresponding to the candidate library image identifier that is the same as the target image identifier is used as the library path corresponding to the cache path.

[0073] In one embodiment of this application, there may be multiple library path naming rules. Before obtaining the candidate library image identifier corresponding to the candidate library path from the candidate library paths stored in the code library file, the same library path naming rule as the replacement path naming rule may be selected from the multiple library path naming rules. The path corresponding to the library path naming rule that is the same as the replacement path naming rule is used as the candidate library path.

[0074] In one embodiment of this application, a library path that differs from the replacement path naming rule can be modified to make the library path conform to the replacement path naming rule, thereby facilitating the determination of the candidate library path corresponding to the candidate library image identifier that is the same as the target image identifier.

[0075] In one embodiment of this application, the browser plugin can perform resource mapping between files in the browser cache and library files. Figure 3 This illustration shows a schematic diagram of a browser plugin resource mapping process according to an embodiment of this application, such as... Figure 3 As shown, the browser plugin can traverse and search for replaceable images in the browser page (web page), and based on the image paths of replaceable images in the browser cache, analyze the replaceable image identifiers that conform to the naming rules of the static resource platform. By pulling SRS JSON resources from the Git branch, it finds the candidate library image identifiers corresponding to the replaceable image identifiers in the code repository through identifier matching, so as to complete the resource mapping relationship, and complete the image path replacement for the web page according to the interaction requirements.

[0076] This application provides online quick replacement and Git commit management: the requester only needs to find the target image on the web page and replace it directly to complete the Git repository commit. It can also be previewed directly without synchronizing the environment, which improves development efficiency. Figure 4 This schematically illustrates a browser page update timing diagram in one embodiment of this application, by... Figure 4 It is evident that the browser page update design department does not need to involve the development department. Compared to existing technologies that require developers to replace files, this eliminates developer involvement, simplifies the process, reduces intermediate roles, saves communication costs, and shortens the cycle. Figure 4 As shown, product personnel check the page, find the target image in the file on the page, and then send the file to the designer for design. After the designer sends the updated file, i.e. the specified image, to the product personnel, the product personnel test the updated file locally through a browser plugin, generate a change order recording the update, and send it to the testers. The testers test the environment, and after passing the test, the system is launched.

[0077] pass Figure 4 As can be seen from the embodiments, the browser page update method of this application intuitively and quickly places the engineering code modification process on the web browser through a browser plugin, thereby reducing the multi-role and multi-process development operations required in the traditional development process, which not only ensures development efficiency but also development security, reduces communication costs, and can greatly improve development efficiency when replacing a large number of images.

[0078] In one embodiment of this application, an execution flow of the browser page update method of this application is proposed. Figure 5 This illustration schematically depicts a process diagram of a browser page update method according to an embodiment of this application, such as... Figure 5 As shown, the implementation steps of the browser page update method include steps S510 to S540, which are described in detail below:

[0079] In step S510, the image resources are uploaded.

[0080] In one embodiment of this application, a specified image can be uploaded to a web server via a browser plugin. The resources on the web server serve as browser plugin cache resources. The browser plugin overwrites browser page resources based on the plugin cache resources to replace the cache path of the target image with the target network path of the specified image, thereby generating a web page.

[0081] In one embodiment of this application, a specified image upload can be initiated on a static resource platform. The platform uploads the image to a CDN and stores it in a Git SRS JSON file. The JSON is stored in the following structure:

[0082]

[0083] The corresponding JSON example is

[0084] {

[0085] "srsimg_3258cdadc90e430a17484ae63a10d7d4":{

[0086] "tag":"nl / index",

[0087] "path":"https: / / wwcdn.weixin.qq.com / node / wework / images / srsimg_3258cdadc90e430a17484ae63a10d7d4_3258cdadc90e430a17484ae63a10d7d4.png"

[0088] }

[0089] Among them, the static resource ID is a variable value used by developers, which will be presented as the actual path of the image on the web page. Figure 6 This illustration schematically shows a diagram of an interface for uploading images on a static resource platform according to an embodiment of this application, such as... Figure 6 As shown, the upload interface can display local images, and developers can select specific images from their local storage to upload. Figure 6The interface shown may also include a "View Differences" button, which allows users to see the differences between the selected image and the target image, enabling developers to easily determine which local image to upload to the static resource platform.

[0090] In one embodiment of this application, after a user initiates the upload of a specified image through a browser plugin, the browser plugin can read Git branch resources and modify the Git branch resources according to the upload, so as to realize the synchronization of browser cache and static resource files in Git branch.

[0091] In step S520, the target user accesses a browser page.

[0092] In one embodiment of this application, the target user pre-installs a browser plugin and then accesses a browser page on the plugin's whitelist. The plugin injects an operation panel into the browser page, iterates through all image resources on the page, automatically filters image resources that conform to the naming rules, and lists them as replaceable images on the right side of the page, as shown below. Figure 7 , Figure 7 This illustration schematically shows a user interface diagram with an operation panel according to one embodiment of this application. Of course, alternative images can also be displayed in other locations on the browser page. When clicking... Figure 7 After clicking the "Edit" button, the browser page will redirect to... Figure 6 The interface shown allows you to select a specific image.

[0093] In step S530, an image replacement preview is performed.

[0094] In one embodiment of this application, image replacement preview can be performed based on the target network path in the browser cache.

[0095] In one embodiment of this application, previewing can be based on a Git branch. When the user selects a Git branch in the control panel, the plugin will pull the corresponding SRS JSON from Git and replace the image with the same identifier on the page, thus enabling fast previewing. Figure 8 The diagram illustrates an interface for selecting a library branch according to one embodiment of this application. Figure 8 The branches in the library can be preset library branches corresponding to browser pages. When there are multiple library branches corresponding to a browser page, the library branch selection interface can also display a branch drop-down button, which developers can use to select from multiple library branches corresponding to the browser page.

[0096] In step S540, the image is replaced.

[0097] In one embodiment of this application, image replacement can be performed based on the target network path in the browser cache.

[0098] In one embodiment of this application, the replacement can be performed based on a Git branch. When a user selects and clicks on an image in the operation panel to initiate an image replacement interaction, the browser plugin will use the CDN address of the uploaded image as the target network path, and find the corresponding path in the SRS JSON based on the target image identifier to complete the replacement of the path in the browser cache. Figure 9 The illustration shows a schematic diagram of a path replacement process according to an embodiment of this application.

[0099] The following describes an apparatus embodiment of this application, which can be used to execute the browser page update method in the above embodiments of this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the browser page update method described above.

[0100] Figure 10 A block diagram of a browser page updating apparatus according to an embodiment of this application is illustrated schematically.

[0101] Reference Figure 10 As shown, a browser page update device 1000 according to an embodiment of this application includes a detection module 1001, a search module 1002, a replacement module 1003, and an update module 1004.

[0102] According to one aspect of the embodiments of this application, based on the foregoing scheme, the detection module 1001 is configured to detect the target image to be replaced in the browser page and obtain the cache path of the target image in the browser cache; the search module 1002 is configured to search for the target network path corresponding to the cache path in the network server, wherein the target network path is the storage path of the specified image used to replace the target image in the network server; the replacement module 1003 is configured to use the target network path to replace the cache path and store it in the browser cache, thereby obtaining the updated browser cache; the update module 1004 is configured to update the browser page based on the updated browser cache, so as to replace the target image with the specified image.

[0103] In one embodiment of this application, based on the aforementioned scheme, the lookup module 1002 is configured to: obtain the replacement path naming rule corresponding to the target image in the browser cache; obtain the target image identifier from the cache path based on the replacement path naming rule; and find the network path corresponding to the target image identifier in the network server based on the target image identifier, and use it as the target network path.

[0104] In one embodiment of this application, based on the foregoing scheme, after finding the target network path corresponding to the cache path in the network server, the lookup module 1002 is configured to: obtain the code library file corresponding to the browser page in the code library; obtain the library path corresponding to the cache path stored in the code library file; and store the target network path in the library file instead of the library path.

[0105] In one embodiment of this application, based on the aforementioned scheme, the search module 1002 is configured to: obtain the replacement path naming rule corresponding to the target image in the browser cache, and the library path naming rule corresponding to the code library; obtain the target image identifier from the cache path based on the replacement path naming rule; obtain the candidate library image identifier corresponding to the candidate library path from the candidate library path stored in the code library file based on the library path naming rule; and use the candidate library path corresponding to the candidate library image identifier that is the same as the target image identifier as the library path corresponding to the cache path.

[0106] In one embodiment of this application, based on the aforementioned scheme, there are multiple library path naming rules. Before obtaining the candidate library image identifier corresponding to the candidate library path from the candidate library paths stored in the code library file, the search module 1002 is further configured to: select the library path naming rule that is the same as the replacement path naming rule from the multiple library path naming rules; and take the path corresponding to the library path naming rule that is the same as the replacement path naming rule as the candidate library path.

[0107] In one embodiment of this application, based on the aforementioned scheme, before searching for the target network path corresponding to the cached path in the network server, the search module 1002 is further configured to: obtain the upload path generated by uploading the specified image to the network server through a browser plugin; obtain the replacement path naming rule corresponding to the target image in the browser cache; and modify the upload path based on the replacement path naming rule to obtain the target network path.

[0108] In one embodiment of this application, based on the aforementioned scheme, the detection module 1001 is configured to: obtain a replaceable image from a browser page; display the replaceable image in the operation panel of the browser page; respond to the image replacement operation in the operation panel, obtain the replaceable image targeted by the image replacement operation, and use it as the target image.

[0109] In one embodiment of this application, based on the aforementioned scheme, before obtaining the cache path of the target image in the browser cache, the detection module is configured to: obtain the page whitelist corresponding to the browser plugin installed on the client where the page is located; if the browser page is in the page whitelist, then detect the target image that needs to be replaced in the browser page.

[0110] Those skilled in the art will understand that various aspects of this application can be implemented as a system, method, or program product. Therefore, various aspects of this application can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, collectively referred to herein as a "circuit," "module," or "system."

[0111] The following reference Figure 11 To describe an electronic device 1100 according to this embodiment of the present application. Figure 11 The electronic device 1100 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0112] like Figure 11 As shown, the electronic device 1100 is manifested in the form of a general-purpose computing device. The components of the electronic device 1100 may include, but are not limited to: at least one processing unit 1110, at least one storage unit 1120, a bus 1130 connecting different system components (including storage unit 1120 and processing unit 1110), and a display unit 1140.

[0113] The storage unit stores program code, which can be executed by the processing unit 1110, causing the processing unit 1110 to perform the steps described in the "Embodiment Method" section above according to various exemplary embodiments of this application.

[0114] Storage unit 1120 may include readable media in the form of volatile storage units, such as random access memory (RAM) 1121 and / or cache memory 1122, and may further include read-only memory (ROM) 1123.

[0115] Storage unit 1120 may also include a program / utility 1124 having a set (at least one) program module 1125, such program module 1125 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.

[0116] Bus 1130 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

[0117] Electronic device 1100 can also communicate with one or more external devices (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with electronic device 1100, and / or any device that enables electronic device 1100 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 1150. Furthermore, electronic device 1100 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 1160. As shown, network adapter 1160 communicates with other modules of electronic device 1100 via bus 1130. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 1100, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0118] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the method according to the embodiments of this application.

[0119] According to one embodiment of this application, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above in this specification is stored. In some possible implementations, various aspects of this application may also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of this application described in the "Exemplary Methods" section of this specification.

[0120] According to one embodiment of this application, the program product for implementing the above method can be a portable compact disc read-only memory (CD-ROM) and include program code, and can run on a terminal device, such as a personal computer. However, the program product of this application is not limited thereto. In this document, the readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0121] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0122] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.

[0123] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0124] Program code for performing the operations of this application can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0125] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of this application, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0126] It should be understood that this application is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A method of updating a browser page, characterized by, The method comprises: detecting a target image in a browser page that needs to be replaced, and obtaining a cache path of the target image in a browser cache; if there are multiple target images in the browser page, obtaining target image information of the multiple target images, and sorting the multiple target images based on the target image information of each target image; the target image information comprises at least one of a display feature, an intention feature and a behavior feature of the image; finding a target network path corresponding to the cache path in a network server, the target network path being a storage path of a specified image in the network server for replacing the target image; the specified image is different from the target image, and the difference can be viewed through an image upload interface; storing the target network path in the browser cache instead of the cache path to obtain an updated browser cache; updating the browser page based on the updated browser cache to replace the target image with the specified image.

2. The browser page updating method of claim 1, wherein, The method of finding a target network path corresponding to the cache path in a network server comprises: obtaining a replacement path naming rule corresponding to the target image in the browser cache; based on the replacement path naming rule, obtaining a target image identifier from the cache path; based on the target image identifier, finding a network path corresponding to the target image identifier in the network server as the target network path.

3. The browser page updating method of claim 1, wherein, After finding the target network path corresponding to the cache path in the network server, the method comprises: obtaining a code library file corresponding to the browser page in a code library; obtaining a library path corresponding to the cache path stored in the code library file; storing the target network path in the library file instead of the library path.

4. The browser page updating method of claim 3, wherein, The method of obtaining the library path corresponding to the cache path stored in the code library file comprises: obtaining a replacement path naming rule corresponding to the target image in the browser cache, and a library path naming rule corresponding to the code library; based on the replacement path naming rule, obtaining a target image identifier from the cache path; based on the library path naming rule, obtaining a candidate library image identifier corresponding to a candidate library path from the candidate library path stored in the code library file; the candidate library path corresponding to the candidate library image identifier identical to the target image identifier is taken as the library path corresponding to the cache path.

5. The browser page updating method of claim 4, wherein, The library path naming rule has multiple, and before obtaining the candidate library image identifier corresponding to the candidate library path from the candidate library path stored in the code library file, the method further comprises: selecting a library path naming rule identical to the replacement path naming rule from the multiple library path naming rules; the path corresponding to the library path naming rule identical to the replacement path naming rule is taken as the candidate library path.

6. The browser page updating method of claim 1, wherein, Before finding the target network path corresponding to the cache path in the network server, the method further comprises: obtaining an upload path generated by uploading the specified image to the network server through a browser plug-in; Obtaining a replacement path naming rule corresponding to the target picture in the browser cache; Based on the replacement path naming rule, the upload path is modified to obtain the target network path.

7. The browser page updating method of claim 1, wherein, The method for detecting a target picture in a browser page comprises: Obtaining a replaceable picture in the browser page; Displaying the replaceable picture in an operation panel of the browser page; In response to a picture changing operation in the operation panel, obtaining a replaceable picture targeted by the picture changing operation as the target picture.

8. The browser page updating method of claim 7, wherein, The method for obtaining a replaceable picture in the browser page comprises: Obtaining a replacement path naming rule corresponding to the browser page, which indicates that the picture can be replaced; In the browser page, selecting a picture whose path meets the replacement path naming rule as the replaceable picture.

9. The browser page updating method of claim 1, wherein, Before obtaining the cache path of the target picture in the browser cache, the method comprises: Obtaining a page whitelist corresponding to a browser plug-in installed in a client where the page is located; If the browser page is in the page whitelist, detecting a target picture in the browser page that needs to be replaced.

10. A browser page updating apparatus characterized by comprising: Comprise: A detection module configured to detect a target picture in a browser page that needs to be replaced and obtain a cache path of the target picture in a browser cache; wherein if there are multiple target pictures in the browser page, target picture information of the multiple target pictures is obtained, and the multiple target pictures are sorted based on the target picture information of each target picture; the target picture information comprises at least one of a display feature, an intention feature and a behavior feature of the picture; A search module configured to search for a target network path corresponding to the cache path in a network server, the target network path being a storage path of a specified picture in the network server for replacing the target picture; the specified picture and the target picture have differences, and the differences can be viewed through a picture uploading interface; A replacement module configured to use the target network path to replace the cache path stored in the browser cache to obtain an updated browser cache; An update module configured to update the browser page based on the updated browser cache to replace the target picture with the specified picture.

11. A computer readable medium having stored thereon a computer program, characterized in that The computer program is executed by a processor to implement the browser page updating method of any one of claims 1 to 9.

12. An electronic device, comprising: Comprise: A processor; And A memory for storing executable instructions of the processor; Wherein the processor executes the executable instructions to enable the electronic device to perform the browser page updating method of any one of claims 1 to 9.

13. A computer program product, characterised in that, The computer program product or computer program comprises computer instructions stored in a computer readable storage medium; The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to enable the computer device to perform the browser page updating method of any one of claims 1 to 9.

Citation Information

Patent Citations

  • Picture processing method and device

    CN109684568A