CN115757996A - Browser page updating method and device - Google Patents

Browser page updating method and device Download PDF

Info

Publication number
CN115757996A
CN115757996A CN202111036063.9A CN202111036063A CN115757996A CN 115757996 A CN115757996 A CN 115757996A CN 202111036063 A CN202111036063 A CN 202111036063A CN 115757996 A CN115757996 A CN 115757996A
Authority
CN
China
Prior art keywords
path
cache
browser
picture
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111036063.9A
Other languages
Chinese (zh)
Inventor
杨俊标
李斌
黄梓群
刘怡涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202111036063.9A priority Critical patent/CN115757996A/en
Publication of CN115757996A publication Critical patent/CN115757996A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The application provides a browser page updating method and device. The method comprises the following steps: detecting a target picture to be replaced in a browser page, and acquiring a cache path of the target picture in a browser cache; searching a target network path corresponding to the cache path in the network server, wherein the target network path is a storage path of a specified picture for replacing the target picture in the network server; replacing a cache path with a target network path to store in a browser cache to obtain an updated browser cache; and updating the browser page based on the updated browser cache to replace the target picture by the specified picture, so that the time for updating the browser page is shorter.

Description

Browser page updating method and device
Technical Field
The present application relates to the field of computer and communications technologies, and in particular, to a method and an apparatus for updating a browser page.
Background
In the prior art, when a browser page is updated, a storage location corresponding to the browser page is usually found, then a file used for generating the browser page before updating is found from the storage location corresponding to the browser page, and then the file used for generating the browser page before updating is replaced with the file used for generating the browser page after updating, so that the browser page after updating is generated according to the file used for generating the browser page after updating and stored in the storage location corresponding to the browser page, and the updating process is very complicated, which results in that the browser page is updated with a long time.
Disclosure of Invention
The application aims to provide a browser page updating method and device, which can solve the problem that the time spent on updating a browser page is long to a certain extent.
According to an aspect of the embodiments of the present application, a method for updating a browser page is provided, including: detecting a target picture to be replaced in a browser page, and acquiring a cache path of the target picture in a browser cache; searching a target network path corresponding to the cache path in a network server, wherein the target network path is a storage path of a specified picture used for replacing the target picture in the network server; replacing the cache path with the target network path to store in the browser cache to obtain an updated browser cache; updating the browser page based on the updated browser cache to replace the target picture by the designated picture.
According to an aspect of the embodiments of the present application, there is provided a browser page updating apparatus, including: the detection module is configured to detect a target picture needing to be replaced in a browser page and acquire a cache path of the target picture in a browser cache; the searching module is configured to search a target network path corresponding to the cache path in a network server, wherein the target network path is a storage path of a specified picture used for replacing the target picture in the network server; the replacing module is configured to use the target network path to replace the cache path to be stored in the browser cache to obtain an updated browser cache; and the updating module is configured to update the browser page based on the updated browser cache so as to replace the target picture by the specified picture.
In an embodiment of the present application, based on the foregoing solution, the lookup module is configured to: acquiring a replacement path naming rule corresponding to the target picture in the browser cache; acquiring a target picture identifier from the cache path based on the alternative path naming rule; and searching a network path corresponding to the target picture identifier in the network server based on the target picture identifier to be used as the target network path.
In an embodiment of the application, based on the foregoing solution, after searching for the target network path corresponding to the cache path in the network server, the search module is configured to: acquiring a code library file corresponding to the browser page in a code library; acquiring a library path corresponding to the cache path and stored in the code library file; using the target network path in place of the library path to store in the library file.
In an embodiment of the present application, based on the foregoing solution, the lookup module is configured to: acquiring a replacement path naming rule corresponding to the target picture in the browser cache and a library path naming rule corresponding to the code library; acquiring a target picture identifier from the cache path based on the alternative path naming rule; based on the library path naming rule, acquiring a candidate library picture identifier corresponding to the candidate library path from the candidate library path stored in the code library file; and taking the candidate library path corresponding to the candidate library picture identifier which is the same as the target picture identifier as the library path corresponding to the cache path.
In an embodiment of the application, based on the foregoing solution, there are a plurality of library path naming rules, and before obtaining a candidate library picture identifier corresponding to a candidate library path from candidate library paths stored in the code library file, the search module is further configured to: selecting a library path naming rule which is the same as the alternative path naming rule from the library path naming rules; and taking the path corresponding to the library path naming rule which is the same as the alternative path naming rule as the candidate library path.
In an embodiment of the application, based on the foregoing solution, before searching for the target network path corresponding to the cache path in the network server, the search module is further configured to: acquiring an uploading path generated by uploading the designated picture to the network server through a browser plug-in; acquiring a replacement path naming rule corresponding to the target picture in the browser cache; and modifying the uploading path based on the alternative path naming rule to obtain the target network path.
In an embodiment of the present application, based on the foregoing solution, the detection module is configured to: acquiring a replaceable picture in the browser page; displaying the replaceable picture in an operation panel of the browser page; and responding to the map changing operation in the operation panel, and acquiring the replaceable picture aimed by the map changing operation as the target picture.
In an embodiment of the present application, based on the foregoing solution, the detection module is configured to: acquiring a replacement path naming rule corresponding to the browser page and used for representing that the picture can be replaced; and selecting a picture with a path meeting the alternative path naming rule from the browser page as the alternative picture.
In an embodiment of the application, based on the foregoing solution, before obtaining a cache path of the target picture in a browser cache, the detection module is configured to: acquiring a page white list corresponding to a browser plug-in installed at a client where a page is located; and if the browser page is in the page white list, detecting a target picture which needs to be replaced in the browser page.
According to an aspect of embodiments of the present application, there is provided a computer program storage medium storing computer program instructions which, when executed by a computer, cause the computer to perform the method of any one of the above.
According to an aspect of an embodiment of the present application, there is provided an electronic device including: a processor; a memory having computer-readable instructions stored thereon that, when executed by the processor, implement the method of any of the above.
According to an aspect of embodiments herein, there is provided a computer program product or computer program comprising 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 cause the computer device to perform the methods provided in the various alternative embodiments described above.
The technical scheme provided by the embodiment of the application can have the following beneficial effects:
in the technical solutions provided by some embodiments of the present application, a target picture to be replaced in a browser page is detected, and a cache path of the target picture in a browser cache is obtained; searching a target network path corresponding to the cache path in the network server, wherein the target network path is a storage path of a specified picture for replacing the target picture in the network server; replacing a cache path with a target network path to store in a browser cache to obtain an updated browser cache; updating the browser page based on the updated browser cache to replace the target picture by the designated picture and replace the update file by the update path, wherein the capacity occupied by the bytes recording the path is generally smaller than the capacity occupied by the target picture, so that the updated content can be less, and the time spent on updating the browser page is less.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the application.
FIG. 1 shows a schematic diagram of an exemplary system architecture to which aspects of embodiments of the present application may be applied;
FIG. 2 schematically illustrates a flow diagram of a browser page update method according to one embodiment of the present application;
FIG. 3 is a schematic diagram illustrating a browser plug-in resource mapping process according to an embodiment of the present application;
FIG. 4 schematically illustrates a browser page update timing diagram in one embodiment of the present application;
FIG. 5 schematically illustrates a process diagram of a browser page update method according to one embodiment of the present application;
FIG. 6 is a schematic diagram illustrating an interface for uploading pictures on a static resource platform according to an embodiment of the present application;
FIG. 7 schematically illustrates an interface diagram with an operator panel according to an embodiment of the present application;
FIG. 8 schematically illustrates an interface diagram for selecting a library branch according to one embodiment of the present application;
FIG. 9 schematically illustrates a process diagram for path replacement according to an embodiment of the present application;
FIG. 10 schematically illustrates a block diagram of a browser page updating apparatus according to an embodiment of the present application;
FIG. 11 is a hardware diagram illustrating an electronic device according to an example embodiment.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the subject matter of the present application can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the application.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
Fig. 1 shows a schematic diagram of an exemplary system architecture 100 to which the technical solutions of the embodiments of the present application can be applied.
As shown in fig. 1, system architecture 100 may include clients 101, network 102, and server 103. Network 102 serves as a medium for providing communication links between clients 101 and servers 103. Network 102 may include various types of connections, such as wired communication links, wireless communication links, and so forth, which are not limiting in this application.
It should be understood that the number of clients 101, networks 102, and servers 103 in fig. 1 is merely illustrative. There may be any number of clients 101, networks 102, and servers 103, as desired for implementation. For example, the server 103 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like. The client 101 may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, and the like.
In an embodiment of the present application, when the task execution time is reached, the server 103 detects a target picture that needs to be replaced in a browser page (Web page), and obtains a cache path of the target picture in a browser cache; searching a target network path corresponding to the cache path in the network server, wherein the target network path is a storage path of a specified picture for replacing the target picture in the network server; replacing a cache path with a target network path to store in a browser cache to obtain an updated browser cache; updating the browser page based on the updated browser cache to replace the target picture by the designated picture and replace the update file by the update path, wherein the capacity occupied by the bytes recording the path is generally smaller than the capacity occupied by the target picture, so that the updated content can be less, and the time spent on updating the browser page is less.
It should be noted that the browser page updating method provided in the embodiment of the present application is generally executed by the server 103, and accordingly, the browser page updating apparatus is generally disposed in the server 103. However, in other embodiments of the present application, the client 101 may also have a similar function as the server 103, so as to execute the browser page updating method provided in the embodiments of the present application.
The implementation details of the technical solution of the embodiment of the present application are set forth in detail below:
fig. 2 schematically shows a flowchart of a browser page updating method according to an embodiment of the present application, where an execution subject of the browser page updating method may be a server, such as the server 103 shown in fig. 1.
Referring to fig. 2, the browser page updating method at least includes steps S210 to S240, which are described in detail as follows:
in step S210, a target picture that needs to be replaced in a browser page is detected, and a cache path of the target picture in a browser cache is obtained.
In one embodiment of the application, a replaceable picture in a browser page may be obtained; displaying the replaceable picture in an operation panel of the browser page; and responding to the picture changing operation in the operation panel, and acquiring the replaceable picture aimed by the picture changing operation as the target picture.
In an embodiment of the application, a substitute path naming rule corresponding to a browser page and used for indicating that a picture can be replaced can be obtained; and selecting the picture with the path according with the name rule of the alternative path from the browser page as the alternative picture.
In an embodiment of the present application, the replaceable picture identifier may be obtained, the replaceable picture identifier may form a replaceable picture list, and the replaceable picture list is displayed on an operation panel of the browser page, and may also be formed by the replaceable picture itself.
In an embodiment of the application, a click operation or a touch operation in an operation panel may be detected, and coordinates corresponding to the click operation or the touch operation may be obtained to determine an alternative picture for which the map changing operation is directed.
In one embodiment of the application, the browser page is generated from a file in a browser cache that is synchronized with a static resource file (SRS JSON) in a codebase (Git), and the browser cache may be updated based on the static resource file (SRS JSON).
In an embodiment of the application, before a cache path of a target picture in a browser cache is obtained, a page white list corresponding to a browser plug-in installed at a client where a page is located can be obtained; if the browser page is in the page white list, the target picture needing to be replaced in the browser page is detected, if the browser page is not in the page white list, the target picture needing to be replaced in the browser page is not detected, and the browser page updating method stops executing, so that illegal replacing operation can be effectively prevented.
In an embodiment of the application, a plug-in identifier of a browser plug-in installed in a client may be obtained, and a page white list corresponding to the browser plug-in may be searched based on the plug-in identifier. The correspondence between the browser plug-in and the page white list may be set in advance.
In step S220, a target network path corresponding to the cache path in the network server is searched, where the target network path is a storage path of the specified picture in the network server for replacing the target picture.
In an embodiment of the application, a name rule of a replacement path corresponding to a target picture in a browser cache can be acquired; acquiring a target picture identifier from a cache path based on a replacement path naming rule; and searching a network path corresponding to the target picture identifier in the network server based on the target picture identifier to be used as a target network path.
In an embodiment of the application, before searching for a target network path corresponding to a cache path in a network server, an upload path generated by uploading a designated picture to the network server through a browser plug-in may be obtained; acquiring a replacement path naming rule corresponding to a target picture in a browser cache; and modifying the uploading path based on the alternative path naming rule to obtain a target network path so that the target network path meets the alternative path naming rule, thereby modifying the uploading path to be the same as the cache path, and conveniently determining a target picture corresponding to the target network path according to the target network path.
In one embodiment of the present application, the alternate path naming convention may be the same as the static resource platform naming convention.
In one embodiment of the present application, the alternate path naming convention may be determined as: SRS _ { md5_ a } _{ md5_ B }, where SRS is an identification prefix of a static resource file, md5_ a is an update identifier of a file updated each time, and md5_ B is a unique identifier of the file in SRS JSON, and is used for identification judgment.
In one embodiment of the present application, the target network path may be a CDN address specifying a picture in a network server.
In step S230, the target network path is stored in the browser cache instead of the cache path, so as to obtain an updated browser cache.
In an embodiment of the application, if there are multiple target pictures in the browser page, the target picture information of the multiple target pictures may be obtained, the multiple target pictures are sorted based on the target picture information of each target picture, and the pictures are replaced according to the sorting.
In an embodiment of the application, when a plurality of target pictures are sequenced, the similarity between every two target pictures can be calculated based on the target picture information, and the target pictures with similar similarities are arranged together, so that the replacement is convenient.
In one embodiment of the present application, the target picture information may include display characteristics such as picture format, presentation position, color, pattern, and the like; the target picture information can also comprise intention characteristics, and the target picture can be input into a machine learning model to determine the intention characteristics of the target picture; the target picture information may also include behavioral characteristics, such as historical click times of pictures.
In one embodiment of the application, target pictures with similar intended characteristics can be arranged together, so that replacement is convenient.
In an embodiment of the application, target pictures with high historical click times can be arranged in front of the target pictures to replace common pictures quickly.
In other embodiments of the present application, multiple target pictures may be replaced simultaneously using multiple threads.
In other embodiments of the present application, when multiple threads replace multiple target pictures at the same time, if the maximum replacement number is smaller than the number of the target pictures, a picture may be selected from the target pictures with similarity greater than the set similarity for replacement, so that the target pictures with larger differences are replaced first, and thus multiple pictures can be replaced at the same time.
In step S240, the browser page is updated based on the updated browser cache to replace the target picture by the specified picture.
In an embodiment of the application, content corresponding to a changed path in a browser cache may be acquired, and a specified picture is loaded to a browser page based on the changed path of a target network cache, so as to update the browser page. In other embodiments of the present application, the entire content of the corresponding browser page in the browser cache may be loaded to update the browser page.
In the embodiment of fig. 2, a target picture to be replaced in a browser page is detected, and a cache path of the target picture in a browser cache is obtained; searching a target network path corresponding to the cache path in the network server, wherein the target network path is a storage path of a specified picture for replacing the target picture in the network server; replacing a cache path with a target network path to store in a browser cache to obtain an updated browser cache; updating the browser page based on the updated browser cache to replace the target picture by the designated picture and replace the update file by the update path, wherein the capacity occupied by the bytes recording the path is generally smaller than the capacity occupied by the target picture, so that the updated content can be less, and the time spent on updating the browser page is less.
In an embodiment of the application, after a target network path corresponding to a cache path in a network server is searched, a code library file corresponding to a browser page in a code library can be obtained; acquiring a library path corresponding to the cache path stored in the code library file; the target network path is stored in the library file instead of the library path to update the code library.
In one embodiment of the application, a specified code branch of a browser page corresponding to a code base can be obtained; and acquiring a static resource file (SRS JSON) stored in the specified code branch as a code library file corresponding to the browser page.
In one embodiment of the present application, the browser page corresponds to a specified code branch of the code base, and may be specified by a browser developer, or may be selected by a browser page updater from a plurality of branches specified by the browser developer.
In an embodiment of the application, a replacement path naming rule corresponding to a target picture in a browser cache and a library path naming rule corresponding to a code library can be obtained; acquiring a target picture identifier from a cache path based on a replacement path naming rule; based on a library path naming rule, acquiring candidate library picture identifications corresponding to candidate library paths from the candidate library paths stored in the code library file; and taking the candidate library path corresponding to the candidate library picture identifier which is the same as the target picture identifier as the library path corresponding to the cache path.
In an embodiment of the application, there may be a plurality of library path naming rules, and before acquiring a candidate library picture identifier corresponding to a candidate library path from candidate library paths stored in a code library file, a library path naming rule the same as a replacement path naming rule may be selected from the plurality of library path naming rules; and taking the path corresponding to the library path naming rule which is the same as the alternative path naming rule as a candidate library path.
In an embodiment of the present application, a library path different from the alternative path naming rule may be modified to make the library path conform to the alternative path naming rule, so as to conveniently determine a candidate library path corresponding to a candidate library picture identifier identical to the target picture identifier.
In an embodiment of the present application, a browser plug-in may perform resource mapping on a file and a library file in a browser cache, and fig. 3 schematically illustrates a resource mapping process diagram of the browser plug-in according to an embodiment of the present application, where as shown in fig. 3, the browser plug-in may search a replaceable picture in a browser page (Web page) in a traversal manner, analyze a replaceable picture identifier that meets a naming rule of a static resource platform based on a picture path of the replaceable picture in the browser cache, and find a candidate library picture identifier corresponding to the replaceable picture identifier in a code library by pulling SRS JSON resources on a Git branch and matching the identifier, so as to complete a mapping relationship of resources, and complete picture path replacement of the Web according to an interaction requirement.
The application provides online quick replacement and complete Git submission management: the submission of the Git warehouse can be completed only by finding the target picture on the Web page by the demand side for direct replacement, and direct preview can be performed under the condition of asynchronous environment, so that the development efficiency is improved. Fig. 4 schematically shows a timing chart of browser page update in an embodiment of the present application, and as can be seen from fig. 4, development departments do not need to be involved in the departments for browser page update design, and compared with the prior art in which a developer needs to replace a file, participation of the developer is avoided, and a flow is simplified, so that intermediate flow roles can be reduced, communication cost is saved, and a period is shortened. As shown in fig. 4, a product worker searches a page, searches a file in the page to find a target picture, sends the file to a designer for design, the designer sends an updated update file, i.e., a designated picture, to the product worker, the product worker performs local experience on the update file through a browser plug-in, generates a change sheet for recording the update and sends the change sheet to a tester, and the tester performs a test environment and then performs online.
As can be seen from the embodiment of fig. 4, the browser page updating method of the present application visually and quickly places the engineering code modification process on the Web browser in a browser plug-in manner, so as to reduce the multi-role and multi-process development operations required in the conventional development process, i.e., ensure the development efficiency, also ensure the development security, reduce the communication cost, and greatly improve the development efficiency when replacing pictures in large quantities.
In an embodiment of the present application, an execution flow of the browser page updating method of the present application is provided, and fig. 5 schematically illustrates a process schematic diagram of the browser page updating method according to an embodiment of the present application, as shown in fig. 5, implementation steps of the browser page updating method include steps S510 to S540, which are described in detail as follows:
in step S510, the picture resource is uploaded.
In an embodiment of the application, the specified picture can be uploaded to a network server through a browser plug-in, resources in the network server serve as browser plug-in cache resources, and the browser plug-in covers browser page resources according to the plug-in cache resources so as to replace a cache path of the target picture with a target network path of the specified picture and generate the Web page.
In an embodiment of the present application, a specified picture uploading may be initiated on a static resource platform, and the picture is uploaded to the CDN by the platform and stored in an SRS JSON file of Git, where JSON is stored in the following structure:
Figure BDA0003245626280000111
a corresponding JSON example is
{
"srsimg_3258cdadc90e430a17484ae63a10d7d4":{
"tag":"nl/index",
"path":"https://wwcdn.weixin.qq.com/node/wework/images/srsimg_3258cdadc90e430a17484ae63a10d7d4_3258cdadc90e430a17484ae63a10d7d4.png"
}
The static resource ID is a variable value used by a developer, and is presented in a real path of a picture in a Web page. Fig. 6 schematically illustrates an interface diagram for uploading pictures on a static resource platform according to an embodiment of the present application, and as shown in fig. 6, local pictures may be displayed in an uploading interface, and a developer may select a specific picture from the local pictures to upload. In the interface shown in fig. 6, a difference button may be further included, and the difference button may be used to check a difference between the selected specified picture and the target picture, so that a developer can conveniently determine which local picture is uploaded to the static resource platform as the specified picture.
In an embodiment of the application, after a user initiates uploading of a specified picture through a browser plug-in, the browser plug-in can read a Git branch resource and modify the Git branch resource according to the uploading, so that synchronization between a browser cache and a static resource file in a Git branch is realized.
In step S520, the target user accesses the browser page.
In one embodiment of the application, the target user pre-installs the browser plug-in and then accesses the browser page in the plug-in white list. The plug-in will inject an operation panel into the browser page, traverse all picture resources of the page, automatically screen picture resources that meet the naming rules, as replaceable pictures, listed on the right side of the page as in fig. 7, fig. 7 schematically shows an interface schematic diagram with an operation panel according to an embodiment of the present application, and of course, the replaceable pictures may also be displayed in other positions of the browser page. When the modify button in fig. 7 is clicked, the browser page may jump to the interface shown in fig. 6 to select a specific picture.
In step S530, a picture replacement preview is performed.
In one embodiment of the present application, the picture replacement preview may be performed based on a target network path in a browser cache.
In one embodiment of the present application, previews may be made based on the Git branches. When a user selects a Git branch on an operation panel, the plug-in will pull the corresponding SRS JSON from Git and replace the pictures with the same identifier in the page to implement the capability of quick preview, and fig. 8 schematically shows an interface diagram for selecting a library branch according to an embodiment of the present application. The branch in fig. 8 may be a library branch corresponding to a preset browser page, when there are a plurality of library branches corresponding to the browser page, the interface for selecting a library branch may further display a branch pull-down button, and a developer may select from the plurality of library branches corresponding to the browser page through the branch pull-down button.
In step S540, picture replacement is performed.
In one embodiment of the present application, the picture replacement may be performed based on the target network path in the browser cache.
In an embodiment of the present application, replacement may be performed based on a Git branch, when a user selects to click a picture on an operation panel, and initiates a picture replacement interaction, a browser plug-in may use a CDN address uploaded by the picture as a target network path, and find a corresponding path in SRS JSON based on a target picture identifier to complete replacement of the path in a browser cache, and fig. 9 schematically illustrates a process diagram of path replacement according to an embodiment of the present application.
The following describes embodiments of an apparatus of the present application, which may be used to execute a browser page updating method in the foregoing embodiments of the present application. For details that are not disclosed in the embodiments of the apparatus of the present application, please refer to the embodiments of the browser page updating method described above in the present application.
Fig. 10 schematically shows a block diagram of a browser page updating apparatus according to an embodiment of the present application.
Referring to fig. 10, a browser page updating apparatus 1000 according to an embodiment of the present application includes a detection module 1001, a lookup module 1002, a replacement module 1003, and an update module 1004.
According to an aspect of the embodiment of the present application, based on the foregoing scheme, the detection module 1001 is configured to detect a target picture that needs to be replaced in a browser page, and acquire a cache path of the target picture in a browser cache; the searching module 1002 is configured to search for a target network path corresponding to the cache path in the network server, where the target network path is a storage path of a specified picture used for replacing the target picture in the network server; the replacing module 1003 is configured to use the target network path to replace the cache path to be stored in the browser cache, so as to obtain an updated browser cache; the update module 1004 is configured to update the browser page based on the updated browser cache to replace the target picture with the specified picture.
In an embodiment of the present application, based on the foregoing solution, the lookup module 1002 is configured to: acquiring a replacement path naming rule corresponding to a target picture in a browser cache; acquiring a target picture identifier from a cache path based on a replacement path naming rule; and searching a network path corresponding to the target picture identifier in the network server based on the target picture identifier to be used as a target network path.
In an embodiment of the present application, based on the foregoing solution, after finding the target network path corresponding to the cache path in the network server, the finding module 1002 is configured to: acquiring a code library file corresponding to a browser page in a code library; acquiring a library path corresponding to a cache path stored in a code library file; the target network path is stored in the library file instead of the library path.
In an embodiment of the present application, based on the foregoing solution, the lookup module 1002 is configured to: acquiring a replacement path naming rule corresponding to a target picture in a browser cache and a library path naming rule corresponding to a code library; acquiring a target picture identifier from a cache path based on a replacement path naming rule; based on a library path naming rule, acquiring candidate library picture identifications corresponding to candidate library paths from the candidate library paths stored in the code library file; and taking the candidate library path corresponding to the candidate library picture identifier which is the same as the target picture identifier as the library path corresponding to the cache path.
In an embodiment of the present application, based on the foregoing solution, there are a plurality of library path naming rules, and before obtaining the candidate library picture identifier corresponding to the candidate library path from the candidate library paths stored in the code library file, the searching module 1002 is further configured to: selecting a library path naming rule which is the same as the substitute path naming rule from the plurality of library path naming rules; and taking the path corresponding to the library path naming rule which is the same as the alternative path naming rule as a candidate library path.
In an embodiment of the present application, based on the foregoing solution, before searching for the target network path corresponding to the cache path in the network server, the searching module 1002 is further configured to: acquiring an uploading path generated by uploading a designated picture to a network server through a browser plug-in; acquiring a replacement path naming rule corresponding to a target picture in a browser cache; and modifying the uploading path based on the alternative path naming rule to obtain a target network path.
In an embodiment of the present application, based on the foregoing solution, the detection module 1001 is configured to: acquiring a replaceable picture in a browser page; displaying the replaceable picture in an operation panel of the browser page; and responding to the picture changing operation in the operation panel, and acquiring the replaceable picture aimed by the picture changing operation as the target picture.
In an embodiment of the application, based on the foregoing solution, before obtaining a cache path of the target picture in the browser cache, the detection module is configured to: acquiring a page white list corresponding to a browser plug-in installed at a client where a page is located; and if the browser page is in the page white list, detecting a target picture which needs to be replaced in the browser page.
As will be appreciated by one skilled in the art, aspects of the present application may be embodied as a system, method or program product. Accordingly, various aspects of the present application may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 1100 according to this embodiment of the present application is described below with reference to fig. 11. The electronic device 1100 shown in fig. 11 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 11, electronic device 1100 is embodied in the form of a general purpose computing device. The components of the electronic device 1100 may include, but are not limited to: the at least one processing unit 1110, the at least one memory unit 1120, a bus 1130 connecting different system components (including the memory unit 1120 and the processing unit 1110), and a display unit 1140.
Wherein the storage unit stores program code, which can be executed by the processing unit 1110, so that the processing unit 1110 performs the steps according to various exemplary embodiments of the present application described in the section "example methods" above in this specification.
The storage unit 1120 may include readable media in the form of volatile storage units, such as a random access memory unit (RAM) 1121 and/or a cache memory unit 1122, and may further include a read-only memory unit (ROM) 1123.
The storage unit 1120 may also include a program/utility 1124 having a set (at least one) of program modules 1125, such program modules 1125 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 1130 may be representative of one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 1100 may also communicate with one or more external devices (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 1100, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 1100 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 1150. Also, the electronic device 1100 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the internet) via the network adapter 1160. As shown, the network adapter 1160 communicates with the other modules of the electronic device 1100 over a bus 1130. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the 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, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, and may also be implemented by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to make a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) execute the method according to the embodiments of the present application.
There is also provided, in accordance with an embodiment of the present application, a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, various aspects of the present application may also be implemented in the form of a program product comprising program code for causing a terminal device to perform the steps according to various exemplary embodiments of the present application described in the "exemplary methods" section above of this specification, when the program product is run on the terminal device.
According to one embodiment of the present application, a program product for implementing the above method may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The 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 electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the present application, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (10)

1. A browser page updating method is characterized by comprising the following steps:
detecting a target picture to be replaced in a browser page, and acquiring a cache path of the target picture in a browser cache;
searching a target network path corresponding to the cache path in a network server, wherein the target network path is a storage path of a specified picture used for replacing the target picture in the network server;
replacing the cache path with the target network path to store in the browser cache to obtain an updated browser cache;
updating the browser page based on the updated browser cache to replace the target picture by the designated picture.
2. The method for updating a browser page according to claim 1, wherein the searching for the target network path corresponding to the cache path in the network server includes:
acquiring a replacement path naming rule corresponding to the target picture in the browser cache;
acquiring a target picture identifier from the cache path based on the alternative path naming rule;
and searching a network path corresponding to the target picture identifier in the network server based on the target picture identifier to be used as the target network path.
3. The browser page updating method according to claim 1, wherein after finding a target network path in a network server corresponding to the cache path, the method comprises:
acquiring a code library file corresponding to the browser page in a code library;
acquiring a library path corresponding to the cache path and stored in the code library file;
using the target network path in place of the library path to store in the library file.
4. The method for updating a browser page according to claim 3, wherein said obtaining a library path stored in the code library file and corresponding to the cache path includes:
acquiring a replacement path naming rule corresponding to the target picture in the browser cache and a library path naming rule corresponding to the code library;
acquiring a target picture identifier from the cache path based on the alternative path naming rule;
based on the library path naming rule, acquiring a candidate library picture identifier corresponding to the candidate library path from the candidate library path stored in the code library file;
and taking the candidate library path corresponding to the candidate library picture identifier which is the same as the target picture identifier as the library path corresponding to the cache path.
5. The method for updating a browser page according to claim 4, wherein there are a plurality of library path naming rules, and before obtaining the candidate library picture identifier corresponding to the candidate library path from the candidate library paths stored in the code library file, the method further includes:
selecting a library path naming rule which is the same as the alternative path naming rule from the library path naming rules;
and taking the path corresponding to the library path naming rule which is the same as the alternative path naming rule as the candidate library path.
6. The browser page updating method according to claim 1, wherein before finding a target network path in a network server corresponding to the cache path, the method further comprises:
acquiring an uploading path generated by uploading the designated picture to the network server through a browser plug-in;
acquiring a replacement path naming rule corresponding to the target picture in the browser cache;
and modifying the uploading path based on the alternative path naming rule to obtain the target network path.
7. The method for updating a browser page according to claim 1, wherein the detecting a target picture in a browser page comprises:
acquiring a replaceable picture in the browser page;
displaying the replaceable picture in an operation panel of the browser page;
and responding to the map changing operation in the operation panel, and acquiring the replaceable picture aimed by the map changing operation as the target picture.
8. The method for updating a browser page according to claim 7, wherein said obtaining a replaceable picture in the browser page comprises:
acquiring a replacement path naming rule corresponding to the browser page and used for representing that the picture can be replaced;
and selecting a picture with a path meeting the alternative path naming rule from the browser page as the alternative picture.
9. The browser page updating method according to claim 1, wherein before obtaining the cache path of the target picture in the browser cache, the method comprises:
acquiring a page white list corresponding to a browser plug-in installed at a client where a page is located;
and if the browser page is in the page white list, detecting a target picture which needs to be replaced in the browser page.
10. A browser page updating apparatus, comprising:
the detection module is configured to detect a target picture needing to be replaced in a browser page and acquire a cache path of the target picture in a browser cache;
the searching module is configured to search a target network path corresponding to the cache path in a network server, wherein the target network path is a storage path of a specified picture used for replacing the target picture in the network server;
the replacing module is configured to use the target network path to replace the cache path to be stored in the browser cache to obtain an updated browser cache;
and the updating module is configured to update the browser page based on the updated browser cache so as to replace the target picture by the specified picture.
CN202111036063.9A 2021-09-03 2021-09-03 Browser page updating method and device Pending CN115757996A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111036063.9A CN115757996A (en) 2021-09-03 2021-09-03 Browser page updating method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111036063.9A CN115757996A (en) 2021-09-03 2021-09-03 Browser page updating method and device

Publications (1)

Publication Number Publication Date
CN115757996A true CN115757996A (en) 2023-03-07

Family

ID=85332748

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111036063.9A Pending CN115757996A (en) 2021-09-03 2021-09-03 Browser page updating method and device

Country Status (1)

Country Link
CN (1) CN115757996A (en)

Similar Documents

Publication Publication Date Title
CN110337641B (en) Determining application test results using screen shot primitive data
US10175954B2 (en) Method of processing big data, including arranging icons in a workflow GUI by a user, checking process availability and syntax, converting the workflow into execution code, monitoring the workflow, and displaying associated information
EP3882791A1 (en) Method, apparatus for content recommendation, electronic device and storage medium
CN112182359A (en) Feature management method and system of recommendation model
KR20140121832A (en) Filtering redundant consumer transaction rules
US20150379112A1 (en) Creating an on-line job function ontology
CN109409419B (en) Method and apparatus for processing data
CN109542757A (en) Interface testing environment determines method, apparatus, electronic equipment and storage medium
CN115329131A (en) Material label recommendation method and device, electronic equipment and storage medium
CN113687825B (en) Method, device, equipment and storage medium for constructing software module
CN107330087B (en) Page file generation method and device
CN113094287A (en) Page compatibility detection method, device, equipment and storage medium
CN112364185A (en) Method and device for determining characteristics of multimedia resource, electronic equipment and storage medium
CN111857803A (en) Page updating method, device, server and storage medium
CN116661936A (en) Page data processing method and device, computer equipment and storage medium
JP2020123321A (en) Method and apparatus for search processing based on clipboard data
US20220164377A1 (en) Method and apparatus for distributing content across platforms, device and storage medium
CN115860877A (en) Product marketing method, device, equipment and medium
CN115757996A (en) Browser page updating method and device
CN114527993A (en) Application deployment method, device, equipment and medium
CN110309315B (en) Template file generation method and device, computer readable medium and electronic equipment
CN113608737A (en) Page generation method, device, equipment and medium
CN112148461A (en) Application scheduling method and device
CN111831277A (en) Virtual data generation method, device, equipment and computer readable storage medium
CN112308074A (en) Method and device for generating thumbnail

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40083178

Country of ref document: HK