CN116204749A - Page loading method and device, electronic equipment and storage medium - Google Patents

Page loading method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116204749A
CN116204749A CN202310127165.4A CN202310127165A CN116204749A CN 116204749 A CN116204749 A CN 116204749A CN 202310127165 A CN202310127165 A CN 202310127165A CN 116204749 A CN116204749 A CN 116204749A
Authority
CN
China
Prior art keywords
page
address
target
determining
image element
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
CN202310127165.4A
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.)
Jingdong Technology Holding Co Ltd
Original Assignee
Jingdong Technology Holding 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 Jingdong Technology Holding Co Ltd filed Critical Jingdong Technology Holding Co Ltd
Priority to CN202310127165.4A priority Critical patent/CN116204749A/en
Publication of CN116204749A publication Critical patent/CN116204749A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/986Document structures and storage, e.g. HTML extensions
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a page loading method, a page loading device, electronic equipment and a storage medium, wherein the method comprises the following steps: determining a target address hash value corresponding to the page loading request based on the received page loading request; determining address data associated with the target address hash value based on a predetermined mapping relation, and acquiring and storing target image elements based on the address data; a target page corresponding to the page load request is determined based on the storage address storing the target image element and the rendering text corresponding to the page load request. The technical scheme provided by the embodiment of the disclosure realizes that the corresponding relation between each image element and the address data is established in advance, so that after the target address hash value corresponding to the page loading request is determined, the corresponding address data can be determined based on the corresponding relation, and then the corresponding image element is called and stored, and further the technical effect of rendering the image element in the page is realized.

Description

Page loading method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of page rendering, in particular to a page loading method and device, electronic equipment and a storage medium.
Background
In order to improve the page effect of the display page, a large number of images are included in the display page. Some dynamically displayed images, such as carousel images, are downloaded by a native application program before a webpage request, and after the webpage is loaded, image data are transmitted to the webpage through corresponding tools and displayed.
The inventors found that when implementing the present technical solution based on the above-described mode, the following problems exist:
the images in the page are downloaded in advance, but when the version of the application program is updated, that is, the images in the webpage are changed, the stored images cannot be updated in time, so that the problem of disordered content exists when the page is rendered, and further, the problems of high labor cost and poor universality are caused by the fact that developers corresponding to the original application program are required to process the images.
Disclosure of Invention
The invention provides a page loading method, a page loading device, electronic equipment and a storage medium.
In a first aspect, an embodiment of the present invention provides a page loading method, where the method includes:
determining a target address hash value corresponding to a page loading request based on the received page loading request;
Determining address data associated with the target address hash value based on a predetermined mapping relation, and acquiring and storing target image elements based on the address data;
determining a target page corresponding to the page loading request based on a storage address storing the target image element and a rendering text corresponding to the page loading request.
Further, the determining a target address hash value corresponding to the page load request includes:
determining a target page address corresponding to the page loading request;
and carrying out hash operation on the target page address to obtain a target address hash value corresponding to the page loading request.
Further, the determining address data associated with the target address hash value based on a predetermined mapping relationship includes:
determining at least one address to be selected associated with the target address hash value from a pre-established mapping relation table, and acquiring an image address, an image identifier and a background picture address associated with each address to be selected;
the mapping relation table is determined by analyzing the image elements in at least one page to be displayed.
Further, the acquiring and storing the target image element based on the address data includes:
invoking at least one thread to acquire an image element corresponding to the picture address and the picture identifier and a background element corresponding to the background picture address;
and taking the image element and the background element as the target image element and storing the target image element locally.
Further, the determining, based on the storage address storing the target image element and the rendering text corresponding to the page loading request, a target page corresponding to the page loading request includes:
and when the rendering of the rendering text is detected to be completed, calling a target script to backfill the storage address into the rendering page so as to render the target page based on a target image element corresponding to the storage address.
Further, the determining, based on the storage address storing the target image element and the rendering text corresponding to the page loading request, a target page corresponding to the page loading request includes:
in the process of rendering the page based on the rendering text, acquiring whether a storage space corresponding to the storage address comprises a target image element or not;
If yes, backfilling the storage address into a rendering page to render the target page based on the target image element corresponding to the storage address.
Further, the method further comprises:
determining at least one page to be displayed and a page address hash value thereof corresponding to a target application program;
determining an image address and an image identifier of an image component in a current page to be displayed and a background picture address of a block layout element aiming at each page to be displayed;
and determining a mapping relation based on the page address hash value, the corresponding image address, the image identifier and the background picture address, so as to render the target image based on the mapping relation.
In a second aspect, an embodiment of the present invention further provides a page loading device, where the device includes:
the hash value determining module is used for determining a target address hash value corresponding to a page loading request based on the received page loading request;
the image element storage module is used for determining address data associated with the target address hash value based on a predetermined mapping relation, acquiring a target image element based on the address data and storing the target image element;
And the target page rendering module is used for determining a target page corresponding to the page loading request based on the storage address for storing the target image element and the rendering text corresponding to the page loading request.
In a third aspect, an embodiment of the present invention further provides an electronic device, including:
one or more processors;
storage means for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement a page loading method according to any one of the embodiments of the present invention.
In a fourth aspect, embodiments of the present invention also provide a storage medium containing computer-executable instructions which, when executed by a computer processor, are used to perform a page loading method according to any of the embodiments of the present invention.
According to the technical scheme, when the page loading request is received, the target address hash value corresponding to the request is determined, address data corresponding to the target address hash value is determined based on the mapping relation, image elements are acquired based on the address data and are stored locally, the target page is determined based on the locally stored image elements and the rendering text corresponding to the page loading request, the corresponding relation between each image element and the address data is established in advance, after the target address hash value corresponding to the page loading request is determined, the corresponding address data can be determined based on the corresponding relation, the corresponding image elements are further called and stored, the technical effect of rendering the image elements in the page is achieved, and the problems that in the prior art, the image is prestored, the version of an application program is changed and is not updated in time, the page rendering is wrong and the like are solved.
Drawings
In order to more clearly illustrate the technical solution of the exemplary embodiments of the present invention, a brief description is given below of the drawings required for describing the embodiments. It is obvious that the drawings presented are only drawings of some of the embodiments of the invention to be described, and not all the drawings, and that other drawings can be made according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a page loading method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a mapping relationship according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of a page loading method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a page loader according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Before describing the technical scheme provided by the embodiment of the invention, an application scenario may be illustrated. In order to further improve the rendering efficiency of the images in the pages, the webpage images related to the current application program version can be stored in advance, so that after a page rendering request is received, page rendering can be performed based on the stored images, at this time, a plurality of image elements need to be stored in advance, and after the version of the application program is upgraded, the image elements associated with each page need to be updated in time, if the image elements are not updated in time, and when page rendering is performed, problems such as page rendering disorder may exist. Based on the above problems, after the development of the application program is completed, the page used by the application program can be packaged, and the package file is uploaded to a corresponding platform to be analyzed, so that the image addresses of all the image elements in the page can be determined, and a corresponding relation is established, so that after the version of the application program is updated, the corresponding image elements in the phase image addresses can be modified, and the effect of page rendering is facilitated.
It should be noted that, the technical solution provided by the embodiments of the present disclosure may be deployed in any application program that may use an H5 page. After the user triggers the application program to acquire the corresponding webpage, the image in the webpage can be loaded based on the scheme provided by the embodiment of the disclosure, so that the image loading efficiency is improved.
Fig. 1 is a schematic flow chart of a page loading method provided by the embodiment of the present invention, where the embodiment is applicable to preloading image elements in a page to achieve the situation of rendering a target page, the method may be performed by a page loading device, the device may be implemented in the form of software and/or hardware, the hardware may be an electronic device, and the electronic device may be a mobile terminal or a PC end, etc.
As shown in fig. 1, the method includes:
s110, determining a target address hash value corresponding to the page loading request based on the received page loading request.
It should be noted that, the user may trigger any control in the application program, and may invoke a corresponding web page based on the triggered control. The request generated after triggering the page fetch control is used as a page load request. The page address corresponding to the fetched web page may be determined based on the page load request. The page address may be encrypted using a hash algorithm to obtain the target address hash value. That is, a corresponding page address may be determined based on the page load request, and a target address hash value corresponding to the page load request may be obtained after the page address is encrypted.
Optionally, determining the target address hash value corresponding to the page load request includes: determining a target page address corresponding to the page loading request; and carrying out hash operation on the target page address to obtain a target address hash value corresponding to the page loading request.
The target page address is a web page address corresponding to the page loading request. The target hash value is a value obtained by hashing the target page address.
In this embodiment, determining at least one page to be displayed and a hash value of a page address thereof corresponding to a target application program; determining an image address and an image identifier of an image component in a current page to be displayed and a background picture address of a block layout element aiming at each page to be displayed; and determining a mapping relation based on the page address hash value, the corresponding image address, the image identifier and the background picture address, so as to render the target image based on the mapping relation.
For front-end developers, after the application program development is completed, the web pages can be packaged to obtain packaged files, and then the packaged files are uploaded to the intelligent deployment platform. The web page may be a page used in an application. After the intelligent deployment platform receives the uploaded deployment package, any parsing tool can be used for parsing html/htm of the webpage file in the deployment package so as to obtain at least one image component and a corresponding background image address in the webpage. The image component may be a control in the web page that carries images. The image component includes an image address (src) and an image element identification (id). Meanwhile, a hash algorithm can be adopted to process the webpage address to obtain a webpage address hash value (webHash). The web page address hash value may be used as a key, i.e., the root node of the tree diagram, and the image component and the background image address may be used as leaf nodes associated with the web page address hash value to obtain the correspondence relationship shown in fig. 2.
It is understood that each page in the application program is taken as a page to be displayed. The page to be displayed has a corresponding page address, hash operation can be carried out on the page address to obtain a hash value corresponding to the page to be displayed, and the hash value is used as the page address hash value. Further, each page to be presented may include a plurality of hierarchies, and each hierarchy may include at least one image element therein. Based on this, an image address, an image identifier, and a background picture address of the tile layout element corresponding to each image element can be determined. And (3) obtaining a corresponding md5 value by calculating the address md5, namely replacing the image address with the corresponding md5 value. The mapping relation among the page address hash value, the image address, the image identifier and the background picture address can be established, and optionally, the mapping relation can be a table, a tree diagram and the like.
In the embodiment of the invention, the establishment of the corresponding relation has the advantages that no matter whether the version program is updated or not, the corresponding image elements can be obtained only by updating the addresses in the corresponding mapping relation and rendered into the display page for display, so that the problem of high cost caused by the fact that the rendering of the page requires the participation of developers is avoided.
And S120, determining address data associated with the target address hash value based on a predetermined mapping relation, and acquiring and storing target image elements based on the address data.
The mapping relationship is mainly a corresponding relationship between a page address hash value and at least one picture component and a background image element in a page. For example, the page address 1 includes ten images, each of which is located at a different level in the page frame, i.e., different images correspond to different address data, and a correspondence relationship between the page address and at least one address data may be established, as shown in fig. 2. The image element consistent with the address data is taken as the target image element. That is, the corresponding image element may be invoked based on the target address for rendering onto the display interface. And taking the image element corresponding to the address data associated with the target address hash value as a target image element.
Specifically, after determining the target hash address, at least one address data associated with the target hash address may be determined based on the mapping relationship. The corresponding target image element may be retrieved based on the address data and stored locally.
In this embodiment, the benefit of storing locally is that the corresponding image element can be directly obtained in the page rendering process, so that the problem of long waiting time caused by obtaining the corresponding image element from the server is avoided.
It should be further noted that the mapping relationship table is determined by parsing the image elements in at least one page to be displayed.
The page to be displayed may be a page that may be displayed after the application program is triggered. Each page to be displayed can have a corresponding image or not, and if the corresponding image is included, a corresponding relation between the page address hash value and the address data of the image can be established.
Based on the technical scheme, acquiring and storing the target image element based on the address data comprises the following steps: invoking at least one thread to acquire an image element corresponding to the picture address and the picture identifier and a background element corresponding to the background picture address; and taking the image element and the background element as the target image element and storing the target image element locally.
Wherein the number of at least one thread may be one or more. The threads are primarily used to perform tasks corresponding to page load requests. In order to improve the efficiency of acquiring the image elements, the number of threads corresponding to the page loading request can be determined, optionally, the page loading request corresponds to a page n, and the corresponding number of threads is determined according to the number of the image elements in the page n. The method can further comprise the steps of presetting at least one thread to be used, and after receiving the page loading request, executing the task of loading the image elements based on the number of the remaining threads to be used so as to call the target image elements. The storage space may be local storage, for example, stored in a buffer space corresponding to the current terminal device, or may be a storage space corresponding to a preset designated path, for example, preset that the storage space may be stored under a certain folder of a certain disk as long as the storage space is loaded into an image element, and after the storage space is loaded into a target image element, the target image element may be stored according to the designated path.
It can be understood that after determining address data corresponding to each image element to be rendered on the target page, at least one thread may be called to obtain the image element and the background element corresponding to each address data, and the image element and the background element are used as target image elements, and the target image elements are locally stored, so that page rendering is performed based on the locally stored target image elements in the process of rendering the target page, and the target page including the image elements is obtained.
S130, determining a target page corresponding to the page loading request based on a storage address of the storage target image element and a rendering text corresponding to the page loading request.
Wherein the storage address is an address where the target image element is stored locally. The rendering text can be understood as that one page not only comprises an image but also comprises a corresponding text, and the text can be firstly rendered to obtain a page frame corresponding to the target page because the image rendering is slower and the text rendering is faster, so that a user can determine the page content of the target page, and further, the image rendering in the page can be performed based on the target image elements stored in the storage address to obtain the final target page. At this time, the target page includes not only the image but also the text.
Specifically, in the process of rendering the text, whether the downloaded target image element is stored or not can be determined based on the storage address, and if the downloaded target image element exists, the target page can be determined based on the target image element and the corresponding rendering text.
In this embodiment, the determining, based on the storage address storing the target image element and the rendering text corresponding to the page load request, a target page corresponding to the page load request includes: and when the rendering of the rendering text is detected to be completed, calling a target script to backfill the storage address into the rendering page so as to render the target page based on a target image element corresponding to the storage address.
The target script may be a script processing method execumejavascript () to backfill the storage address into the rendering page. If the storage space corresponding to the storage address includes a corresponding target image element, the target image element may be displayed in the target page to obtain the target page including the target image element. The rendered page corresponds to the target page, and the name implies that the rendered page is the page corresponding to the target page before the rendering of the target page is not completed.
It can be understood that after the text in the target page is rendered, the storage address can be backfilled into the rendered page by using a script processing method, so as to render the target page based on the target image elements stored in the storage space corresponding to the storage address. Of course, when the text in the target page is not rendered, the target image element may be stored first, so that after the text is rendered, the target image element may be called to perform page rendering.
On the basis of the above technical solution, it should be further noted that, in order to further improve the image rendering efficiency, the webview of the H5 container may perform the judgment of completion of the webpage description in the webpage rendering process, may determine whether the storage address stores the target image element, and if so, backfill the storage address into the rendering page based on the target script, so as to render the target page based on the target image element.
The above steps can be understood as: the determining, based on the storage address storing the target image element and the rendering text corresponding to the page load request, a target page corresponding to the page load request includes: in the process of rendering the page based on the rendering text, acquiring whether a storage space corresponding to the storage address comprises a target image element or not; if yes, backfilling the storage address into a rendering page to render the target page based on the target image element corresponding to the storage address.
That is, in the process of page rendering, it may be determined whether the storage space corresponding to the storage address includes the target image element, and if so, the storage address may be backfilled to the rendered page, thereby rendering the target page including the target image element.
According to the technical scheme, when the page loading request is received, the target address hash value corresponding to the request is determined, address data corresponding to the target address hash value is determined based on the mapping relation, image elements are acquired based on the address data and are stored locally, the target page is determined based on the locally stored image elements and the rendering text corresponding to the page loading request, the corresponding relation between each image element and the address data is established in advance, after the target address hash value corresponding to the page loading request is determined, the corresponding address data can be determined based on the corresponding relation, the corresponding image elements are further called and stored, the technical effect of rendering the image elements in the page is achieved, and the problems that in the prior art, the image is prestored, the version of an application program is changed and is not updated in time, the page rendering is wrong and the like are solved.
As an alternative embodiment of the foregoing embodiment, fig. 3 is a schematic flow chart of a page loading method provided by the embodiment of the present invention, where on the basis of the foregoing embodiment, the method may be divided into three processes, a first process is a web page packing uploading process, a second process is a decomposition publishing process, and a third process is an obtaining display process. The following can be understood with reference to fig. 3, that is, the technical solution provided by the embodiment of the present invention is explained based on the three processes in turn.
The first webpage packing and uploading process specifically can be as follows: for front-end developers, the webpage development and packaging modes are the same as the existing modes, namely after the development of the application program is completed, webpage pages associated with the application program can be packaged and uploaded to the intelligent deployment platform.
It should be noted that, the intelligent deployment platform is only a name interpretation, and its function is mainly to parse the package file to obtain the corresponding relationship between the page address and the image element in the page, that is, whichever platform can be implemented, as long as the function can be implemented.
The second decomposition release process may specifically be: with continued reference to fig. 3, any parsing tool such as Jsoup may be used to parse html/htm of a web page file (page to be displayed) in the deployment package, and disassemble an image address and an image identifier of each image element (image component), and each background picture address ((bgImg)). Carrying out hash operation on the page address of the page to be displayed to obtain a page address hash value (webHash), and storing the disassembled data by taking the page address hash value as a key to obtain the corresponding relation shown in fig. 2.
It should be noted that, for the image element, the image address is directly set in the track element, so that it is necessary to record id to mark which image element the image address corresponds to, so as to facilitate backfilling; the background picture addresses are set in a class (class) mode, namely, a plurality of divs can use the same class (class), and the background picture addresses in the class can be directly replaced during backfilling. It should be further noted that, after the disassembly is completed, the image address in the web page may be replaced with the corresponding md5 value, so as to replace and avoid the web page from requesting to download the image during backfilling, and meanwhile, the processed web page is saved for the H5 container request.
The third process is a display acquisition process, which may specifically be: with continued reference to FIG. 3, when a user triggers a control on the client to obtain a web page, a page load request may be generated. The page-based loading request may be a page address, and a hash operation is adopted to obtain a hash value (webHash) of a target address corresponding to the page loading request. At this time, the H5 container requests address-related data required by the web page through the universal request interface Function taking webHash as an entry. The address association data includes an image address and a background picture address. Then, multithreading is enabled according to image address downloading to simultaneously download image data, and the downloaded image data (image elements) are stored locally (in a local cache space), and meanwhile, a local image address, namely a local storage address, is acquired. Judging whether rendering of the page is completed, if yes, backfilling the storage address into the webpage by using a script processing method execueejavascript (), otherwise, continuing to cache the image elements.
Another embodiment may be that WebView of the H5 container performs the method onPageFinished after the page rendering is completed; in onPageFinised, whether a cached target image element exists or not is judged, if so, an address is backfilled into a webpage by using a script processing method execueJavascript () to render a target page comprising the target image element.
The data backfilling time through JS can be basically ignored, so that the display time of images can be shortened by downloading image elements in advance through multithreading, and the user experience is improved. That is, the web page with a substitute stream image address is downloaded at this time, and the web page can be directly displayed after being downloaded, so that the image display efficiency is improved. According to the technical scheme, when the page loading request is received, the target address hash value corresponding to the request is determined, address data corresponding to the target address hash value is determined based on the mapping relation, image elements are acquired based on the address data and are stored locally, the target page is determined based on the locally stored image elements and the rendering text corresponding to the page loading request, the corresponding relation between each image element and the address data is established in advance, after the target address hash value corresponding to the page loading request is determined, the corresponding address data can be determined based on the corresponding relation, the corresponding image elements are further called and stored, the technical effect of rendering the image elements in the page is achieved, and the problems that in the prior art, the image is prestored, the version of an application program is changed and is not updated in time, the page rendering is wrong and the like are solved.
Fig. 4 is a schematic structural diagram of a page loading device according to an embodiment of the present invention, as shown in fig. 4, where the device includes: hash value determination module 310, image element storage module 320, and target page rendering module 330.
The hash value determining module 310 is configured to determine, based on a received page load request, a hash value of a target address corresponding to the page load request; an image element storage module 320, configured to determine address data associated with the target address hash value based on a predetermined mapping relationship, and acquire and store a target image element based on the address data; a target page rendering module 330, configured to determine a target page corresponding to the page loading request based on a storage address storing the target image element and a rendering text corresponding to the page loading request.
On the basis of the technical scheme, the hash value determining module comprises:
an address obtaining unit, configured to determine a target page address corresponding to the page loading request;
and the hash value determining unit is used for carrying out hash operation on the target page address to obtain a target address hash value corresponding to the page loading request.
On the basis of the technical scheme, the image element storage module is further used for: determining at least one address to be selected associated with the target address hash value from a pre-established mapping relation table, and acquiring an image address, an image identifier and a background picture address associated with each address to be selected; the mapping relation table is determined by analyzing the image elements in at least one page to be displayed.
On the basis of the technical scheme, the image element storage module comprises: the element calling unit is used for calling at least one thread to obtain image elements corresponding to the picture address and the picture identifier and background elements corresponding to the background picture address;
and the storage unit is used for taking the image element and the background element as the target image element and locally storing the image element and the background element.
On the basis of the technical scheme, the target page rendering module is further used for: and when the rendering of the rendering text is detected to be completed, calling a target script to backfill the storage address into the rendering page so as to render the target page based on a target image element corresponding to the storage address.
On the basis of the technical scheme, the target page rendering module is further used for: in the process of rendering the page based on the rendering text, acquiring whether a storage space corresponding to the storage address comprises a target image element or not;
if yes, backfilling the storage address into a rendering page to render the target page based on the target image element corresponding to the storage address.
On the basis of the technical scheme, the device further comprises: the page analysis module is used for determining at least one page to be displayed and a page address hash value thereof corresponding to the target application program;
the address analysis module is used for determining an image address and an image identifier of an image component in the current page to be displayed and a background picture address of the block layout element aiming at each page to be displayed;
and the mapping relation determining module is used for determining a mapping relation based on the page address hash value, the corresponding image address, the image identifier and the background picture address so as to render the target image based on the mapping relation.
According to the technical scheme, when the page loading request is received, the target address hash value corresponding to the request is determined, address data corresponding to the target address hash value is determined based on the mapping relation, image elements are acquired based on the address data and are stored locally, the target page is determined based on the locally stored image elements and the rendering text corresponding to the page loading request, the corresponding relation between each image element and the address data is established in advance, after the target address hash value corresponding to the page loading request is determined, the corresponding address data can be determined based on the corresponding relation, the corresponding image elements are further called and stored, the technical effect of rendering the image elements in the page is achieved, and the problems that in the prior art, the image is prestored, the version of an application program is changed and is not updated in time, the page rendering is wrong and the like are solved.
The page loading device provided by the embodiment of the invention can execute the page loading method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
It should be noted that each unit and module included in the above apparatus are only divided according to the functional logic, but not limited to the above division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the embodiments of the present invention.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. Fig. 5 shows a block diagram of an exemplary electronic device 50 suitable for use in implementing the embodiments of the present invention. The electronic device 50 shown in fig. 5 is merely an example and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 5, the electronic device 50 is embodied in the form of a general purpose computing device. Components of electronic device 50 may include, but are not limited to: one or more processors or processing units 501, a system memory 502, and a bus 503 that connects the various system components (including the system memory 502 and processing units 501).
Bus 503 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 50 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by electronic device 50 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 502 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 504 and/or cache memory 505. Electronic device 50 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 506 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, commonly referred to as a "hard disk drive"). Although not shown in fig. 5, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 503 through one or more data medium interfaces. Memory 502 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of embodiments of the invention.
A program/utility 508 having a set (at least one) of program modules 507 may be stored, for example, in memory 502, such program modules 507 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 507 typically perform the functions and/or methods of the described embodiments of the invention.
The electronic device 50 may also communicate with one or more external devices 509 (e.g., keyboard, pointing device, display 510, etc.), one or more devices that enable a user to interact with the electronic device 50, and/or any device (e.g., network card, modem, etc.) that enables the electronic device 50 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 511. Also, the electronic device 50 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through a network adapter 512. As shown, the network adapter 512 communicates with other modules of the electronic device 50 over the bus 503. It should be appreciated that although not shown in fig. 5, other hardware and/or software modules may be used in connection with electronic device 50, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 501 executes various functional applications and data processing by running programs stored in the system memory 502, for example, implementing the page loading method provided by the embodiment of the present invention.
Embodiments of the present invention also provide a storage medium containing computer-executable instructions for performing a page loading method when executed by a computer processor.
The method comprises the following steps:
determining a target address hash value corresponding to a page loading request based on the received page loading request;
determining address data associated with the target address hash value based on a predetermined mapping relation, and acquiring and storing target image elements based on the address data;
determining a target page corresponding to the page loading request based on a storage address storing the target image element and a rendering text corresponding to the page loading request.
The computer storage media of embodiments of the invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, 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. In this document, a computer 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 computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either 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 of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer 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 computer 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.
Computer program code for carrying out operations for embodiments of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ 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 computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (10)

1. A method for loading a page, comprising:
determining a target address hash value corresponding to a page loading request based on the received page loading request;
determining address data associated with the target address hash value based on a predetermined mapping relation, and acquiring and storing target image elements based on the address data;
determining a target page corresponding to the page loading request based on a storage address storing the target image element and a rendering text corresponding to the page loading request.
2. The method of claim 1, wherein the determining a destination address hash value corresponding to the page load request comprises:
determining a target page address corresponding to the page loading request;
and carrying out hash operation on the target page address to obtain a target address hash value corresponding to the page loading request.
3. The method of claim 1, wherein the determining address data associated with the destination address hash value based on a predetermined mapping relationship comprises:
determining at least one address to be selected associated with the target address hash value from a pre-established mapping relation table, and acquiring an image address, an image identifier and a background picture address associated with each address to be selected;
the mapping relation table is determined by analyzing the image elements in at least one page to be displayed.
4. A method according to claim 3, wherein said obtaining and storing target image elements based on said address data comprises:
invoking at least one thread to acquire an image element corresponding to the picture address and the picture identifier and a background element corresponding to the background picture address;
And taking the image element and the background element as the target image element and storing the target image element locally.
5. The method of claim 1, wherein the determining a target page corresponding to the page load request based on a storage address storing the target image element and rendered text corresponding to the page load request comprises:
and when the rendering of the rendering text is detected to be completed, calling a target script to backfill the storage address into the rendering page so as to render the target page based on a target image element corresponding to the storage address.
6. The method of claim 1, wherein the determining a target page corresponding to the page load request based on a storage address storing the target image element and rendered text corresponding to the page load request comprises:
in the process of rendering the page based on the rendering text, acquiring whether a storage space corresponding to the storage address comprises a target image element or not;
if yes, backfilling the storage address into a rendering page to render the target page based on the target image element corresponding to the storage address.
7. The method as recited in claim 2, further comprising:
determining at least one page to be displayed and a page address hash value thereof corresponding to a target application program;
determining an image address and an image identifier of an image component in a current page to be displayed and a background picture address of a block layout element aiming at each page to be displayed;
and determining a mapping relation based on the page address hash value, the corresponding image address, the image identifier and the background picture address, so as to render the target image based on the mapping relation.
8. A page loading apparatus, comprising:
the hash value determining module is used for determining a target address hash value corresponding to a page loading request based on the received page loading request;
the image element storage module is used for determining address data associated with the target address hash value based on a predetermined mapping relation, acquiring a target image element based on the address data and storing the target image element;
and the target page rendering module is used for determining a target page corresponding to the page loading request based on the storage address for storing the target image element and the rendering text corresponding to the page loading request.
9. An electronic device, the electronic device comprising:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the page loading method of any of claims 1-7.
10. A storage medium containing computer executable instructions which, when executed by a computer processor, are for performing the page loading method of any of claims 1-7.
CN202310127165.4A 2023-02-02 2023-02-02 Page loading method and device, electronic equipment and storage medium Pending CN116204749A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310127165.4A CN116204749A (en) 2023-02-02 2023-02-02 Page loading method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310127165.4A CN116204749A (en) 2023-02-02 2023-02-02 Page loading method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116204749A true CN116204749A (en) 2023-06-02

Family

ID=86507287

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310127165.4A Pending CN116204749A (en) 2023-02-02 2023-02-02 Page loading method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116204749A (en)

Similar Documents

Publication Publication Date Title
CN108037961B (en) Application program configuration method, device, server and storage medium
CN111381852A (en) Application dynamic updating method and device based on Flutter, storage medium and electronic equipment
CN111680253B (en) Page application data packet generation method and device, computer equipment and storage medium
US11979300B2 (en) Standardized format for containerized applications
CN109194606B (en) Attack detection system, method, computer device and storage medium
CN111740948B (en) Data packet issuing method, dynamic updating method, device, equipment and medium
KR101557211B1 (en) Software application delivery and launching system
US9325717B1 (en) Web-store restriction of external libraries
CN107798064B (en) Page processing method, electronic device and computer readable storage medium
CN113761412B (en) Application page display method and device, electronic equipment, medium and application system
CN112905179A (en) Mobile terminal H5 page generation method and device, electronic equipment and storage medium
US10594764B2 (en) Request cache to improve web applications performance
CN110688174A (en) Container starting method, storage medium and electronic device
CN112149035A (en) Website static resource processing method and device
CN115982491A (en) Page updating method and device, electronic equipment and computer readable storage medium
US8191041B2 (en) Javascript pre-processing framework
CN111562929A (en) Method, device and equipment for generating patch file and storage medium
CN109101429B (en) Method and device for debugging browser page of set top box
CN114153462B (en) Client source code processing method and device, storage medium and electronic equipment
CN116204749A (en) Page loading method and device, electronic equipment and storage medium
WO2022028046A1 (en) Image configuration method, device and system, and storage medium
US8793663B2 (en) Smart cache for a server test environment in an application development tool
CN114489698A (en) Application program installation method and device
CN113687880A (en) Method, device, equipment and medium for calling component
CN113761419A (en) Display method and device of topological information, electronic equipment and storage medium

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