CN115630245A - 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
CN115630245A
CN115630245A CN202211278858.5A CN202211278858A CN115630245A CN 115630245 A CN115630245 A CN 115630245A CN 202211278858 A CN202211278858 A CN 202211278858A CN 115630245 A CN115630245 A CN 115630245A
Authority
CN
China
Prior art keywords
file
page
thread
loading
page loading
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
CN202211278858.5A
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.)
Shuguang Zhisuan Information Technology Co ltd
Dawning Information Industry Beijing Co Ltd
Original Assignee
Shuguang Zhisuan Information Technology Co ltd
Dawning Information Industry Beijing 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 Shuguang Zhisuan Information Technology Co ltd, Dawning Information Industry Beijing Co Ltd filed Critical Shuguang Zhisuan Information Technology Co ltd
Priority to CN202211278858.5A priority Critical patent/CN115630245A/en
Publication of CN115630245A publication Critical patent/CN115630245A/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/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching

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 Transfer Between Computers (AREA)

Abstract

The invention discloses a page loading method, a page loading device, electronic equipment and a storage medium, wherein the page loading method comprises the following steps: in the loading process of the target page, loading a plurality of page elements corresponding to the target page through a page loading thread, and transmitting the identification information of the JS file to be quoted to a file quoting thread; acquiring a JS file corresponding to the target page according to the identification information through the file reference thread, and transmitting an acquisition result corresponding to the JS file to the page loading thread; rendering the multiple page elements according to the acquisition result corresponding to the JS file through a page loading thread so as to finish loading the target page. The technical scheme of the embodiment of the invention can improve the loading efficiency of the page and improve the use experience of a user on the software.

Description

Page loading method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a page loading method and apparatus, an electronic device, and a storage medium.
Background
With the development of computer technology, elements on a software page are more and more abundant, and the page development technology occupies more and more weight in the whole software development process.
In the existing page loading technology, in order to reduce the code amount of a page and optimize the smoothness of the page, a JavaScript (lightweight programming language, JS) file is usually introduced into a page loading function, and a rendering process of the page is completed by operating a service logic code in the JS file.
However, some JS files introduced in the page loading function belong to third-party files, and the introduction process of the JS files has high requirements on the network. Under the condition that the JS file is used on the top layer, if the software network is unstable, the JS file cannot be quoted or downloaded locally, so that the situation that the page is always blank can occur, and the use experience of the user on the software is reduced.
Disclosure of Invention
The invention provides a page loading method, a page loading device, electronic equipment and a storage medium, which can improve the page loading efficiency and improve the use experience of a user on software.
According to an aspect of the present invention, a page loading method is provided, including:
in the loading process of the target page, loading a plurality of page elements corresponding to the target page through a page loading thread, and transmitting the identification information of the JS file to be quoted to a file quoting thread;
acquiring a JS file corresponding to a target page according to the identification information through the file reference thread, and transmitting an acquisition result corresponding to the JS file to a page loading thread;
and rendering the multiple page elements according to the acquisition result corresponding to the JS file through the page loading thread so as to finish loading the target page.
Optionally, the obtaining result corresponding to the JS file is transmitted to the page loading thread, including:
judging whether the JS file is successfully acquired within a preset time period or not through the file reference thread;
and if yes, the successfully acquired JS file and a first business logic function corresponding to the JS file are transmitted to a page loading thread through the file reference thread.
Optionally, through the page loading thread, according to the obtaining result corresponding to the JS file, the multiple page elements are rendered, including:
and if the acquired result comprises a JS file and a first service logic function corresponding to the JS file, rendering the multiple page elements through the page loading thread according to the service logic code and the first service logic function in the JS file.
Optionally, after determining whether the JS file is successfully acquired within a preset time period by using the file reference thread, the method further includes:
and if not, transmitting the second service logic function corresponding to the JS file which fails to be obtained to a page loading thread through the file reference thread.
Optionally, through the page loading thread, according to the obtaining result corresponding to the JS file, the multiple page elements are rendered, including:
and if the acquisition result comprises a second service logic function corresponding to the JS file which fails to be acquired, rendering the multiple page elements through the page loading thread according to the second service logic function.
Optionally, by the file reference thread, the JS file that is successfully acquired and the first service logic function corresponding to the JS file are transferred to the page loading thread, including:
and transmitting the obtained JS file, the first service logic function corresponding to the JS file and the identification information of the JS file to a page loading thread through the file reference thread.
Optionally, after the file reference thread transmits the obtained successful JS file and the first service logic function corresponding to the JS file to the page loading thread, the method further includes:
updating the JS file into a local JS file matched with a target page development environment according to an execution file corresponding to the target page through the page loading thread;
through the page loading thread, according to the business logic code and the first business logic function in the JS file, rendering is carried out on the multiple page elements, and the method comprises the following steps:
and rendering the multiple page elements through the page loading thread according to the business logic code in the local JS file and a first business logic function.
According to another aspect of the present invention, there is provided a page loading apparatus, the apparatus including:
the identification transmission module is used for loading a plurality of page elements corresponding to the target page through the page loading thread in the loading process of the target page and transmitting the identification information of the JS file to be quoted to the file quoting thread;
the file acquisition module is used for acquiring the JS file corresponding to the target page according to the identification information through the file reference thread and transmitting an acquisition result corresponding to the JS file to the page loading thread;
and the page rendering module is used for rendering the multiple page elements according to the acquisition result corresponding to the JS file through the page loading thread so as to finish loading the target page.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the page loading method according to any of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the page loading method according to any embodiment of the present invention when the computer instructions are executed.
According to the technical scheme provided by the embodiment of the invention, in the loading process of the target page, the page loading thread loads multiple page elements corresponding to the target page, the identification information of the JS file to be quoted is transmitted to the file quoting thread, the JS file is obtained according to the identification information through the file quoting thread, the obtaining result corresponding to the JS file is transmitted to the page loading thread, the multiple page elements are rendered according to the obtaining result corresponding to the JS file through the page loading thread, so that the technical means for loading the target page is completed, the situation that the page displays a blank for a long time in the loading process of the target page can be avoided, under the condition that the JS file is quoted successfully or unsuccessfully, the page loading thread can process according to corresponding service logic, the situation that the JS file quoting is delayed to block the loading of the whole page is avoided, the time consumption for loading of the page is reduced, the loading efficiency of the page is improved, the corresponding service system in the page can be quickly rendered according to the identification information of the JS file, and the JS file is updated into a local file matched with the development environment of the target page, and the appearance of a card in the loading process of the page can be avoided.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a page loading method according to an embodiment of the present invention;
FIG. 2 is a flowchart of another page loading method provided in accordance with an embodiment of the present invention;
FIG. 3 is a flowchart of another page loading method provided in accordance with an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a page loading apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device implementing the page loading method according to the embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Fig. 1 is a flowchart of a page loading method according to an embodiment of the present invention, where the present embodiment is applicable to a case of loading a software interface, and the method may be executed by a page loading device, where the page loading device may be implemented in a form of hardware and/or software, and the page loading device may be configured in an electronic device (e.g., a terminal or a server) with a data processing function. As shown in fig. 1, the method includes:
and step 110, in the loading process of the target page, loading a plurality of page elements corresponding to the target page through the page loading thread, and transmitting the identification information of the JS file to be quoted to the file quoting thread.
In this embodiment, the target page may be a display interface of a software product. The software product may be an Application (APP) installed in the mobile smart device or software installed in a computer. Optionally, before the target page is loaded, a page loading thread and a file reference thread may be established in advance. The page loading thread is used for loading a plurality of page elements in the target page and rendering the plurality of page elements. And the file reference thread is used for referencing the JS file associated with the target page.
In a specific embodiment, the JS file may include business logic codes commonly used in the page rendering process. The thread can be understood as a control flow capable of performing operation scheduling in an operating system of the electronic equipment. The page elements can be characters, pictures, audio, animation, video and the like in the target page.
In this step, optionally, when the target page is loaded, multiple page elements may be loaded through the page loading thread according to a Document Object Model (DOM) interface, and at the same time, the identification information of the JS file (that is, the JS file to be referenced) associated with the target page is transmitted to the file referencing thread. Specifically, the identification information may be a file name of the JS file.
And step 120, acquiring a JS file corresponding to the target page according to the identification information through the file reference thread, and transmitting an acquisition result corresponding to the JS file to a page loading thread.
In this embodiment, after receiving the identification information of the JS file, the file reference thread may obtain the JS file corresponding to the target page according to the identification information and a preset obtaining instruction (for example, jquery.
If the JS file is successfully acquired by the file reference thread, the corresponding acquisition result can be the successfully acquired JS file; on the contrary, if the file reference thread fails to acquire the JS file, the acquisition result may be a failure instruction.
And step 130, rendering the multiple page elements according to the acquisition result corresponding to the JS file through the page loading thread so as to finish loading the target page.
In this embodiment, optionally, after receiving the acquisition result of the JS file, the page loading thread may render multiple page elements according to the preset service logic function matched with the acquisition result, so as to complete loading of the target page.
In a specific embodiment, if the obtained result is a JS file, rendering multiple page elements according to the business logic code in the JS file; and if the acquisition result is a failure instruction, rendering multiple page elements according to a preset service logic function matched with the failure instruction.
In the embodiment, by distributing the page rendering operation and the JS file reference operation on two different threads, the situation that a page is blank for a long time due to unstable network environment when the JS file is referred by a page loading thread in the prior art can be avoided; secondly, a plurality of page elements are rendered according to the acquisition result of the JS file through the page loading thread, so that the page loading thread can process according to corresponding service logic under the condition that the JS file is successfully or unsuccessfully quoted, the phenomenon that the loading of the whole page is blocked due to the delay of the quoting of the JS file is avoided, the time consumption of the loading of the page can be reduced, and the loading efficiency of the page is improved.
In the embodiment, in the loading process of the target page, the page loading thread loads multiple page elements corresponding to the target page, the identification information of the JS file to be quoted is transmitted to the file quote thread, the JS file is obtained through the file quote thread according to the identification information, the obtaining result corresponding to the JS file is transmitted to the page loading thread, and the multiple page elements are rendered according to the obtaining result corresponding to the JS file through the page loading thread, so that the technical means for loading the target page is completed, the situation that the page is displayed blank for a long time in the loading process of the target page can be avoided, the loading efficiency of the page can be improved, and the use experience of a user on software can be improved.
Fig. 2 is a flowchart of another page loading method according to an embodiment of the present invention, and as shown in fig. 2, the method includes:
step 210, in the loading process of the target page, loading multiple page elements corresponding to the target page through the page loading thread, and transmitting the identification information of the JS file to be referred to the file reference thread.
And step 220, acquiring the JS file corresponding to the target page according to the identification information through the file reference thread.
Step 230, judging whether the JS file is successfully acquired within a preset time period or not through the file reference thread, and if so, executing steps 240-250; if not, steps 260-270 are performed.
In this embodiment, after the file reference thread receives the identification information of the JS file, a corresponding timer may be set according to a preset duration, the timer is started, and then whether the JS file is successfully acquired is determined within a time period set by the timer.
The duration may be set to 5s, and the specific value may be preset according to an actual situation, which is not limited in this embodiment.
And step 240, transmitting the obtained JS file and the first service logic function corresponding to the JS file to a page loading thread through the file reference thread.
In this embodiment, if the JS file is successfully acquired within the preset time period by the file reference thread, the service logic (that is, the first service logic function) after the JS file is successfully referenced may be edited, and the obtained JS file and the first service logic function are transferred to the page loading thread.
The first business logic function is used for indicating the page loading thread to generate a page framework matched with each page element according to the JS file, such as the style, the display mode and the arrangement position of each element in the target page.
And 250, rendering the multiple page elements through the page loading thread according to the business logic code and the first business logic function in the JS file.
In this embodiment, if the acquired result received by the page loading thread includes the JS file and the first service logic function, the multiple page elements may be rendered by the page loading thread according to the service logic code in the JS file and the first service logic function.
In a specific embodiment, after receiving the JS file, the page loading thread may execute the business logic code and the first business logic function in the JS file to render multiple page elements.
And step 260, transmitting the second service logic function corresponding to the JS file with failure to the page loading thread through the file reference thread.
In this embodiment, if the file reference thread fails to acquire the JS file within the preset time period, the service logic (that is, the second service logic function) after the JS file reference fails may be edited, and the second service logic function is transferred to the page loading thread.
And the second service logic function is used for indicating the page loading thread to generate a page framework matched with each page element according to the processing logic in the second service logic function.
In a specific embodiment, in order to mark the acquisition result of the JS file, after the timer is set by the file reference thread, the state variable flag of the JS file may be set to false, and if the JS file is successfully acquired within the time period set by the timer, the variable flag is set to true; if the JS file acquisition fails within the time period set by the timer, the variable flag is kept false.
And 270, rendering the multiple page elements according to the second service logic function.
In this embodiment, if the acquisition result received by the page loading thread includes the second service logic function, the multiple page elements may be rendered by the page loading thread according to the second service logic function.
In a specific embodiment, after receiving the second service logic, the page loading thread may execute a second service logic function to render the multiple page elements.
In this embodiment, the corresponding service logic functions under different obtaining results of the JS file are edited through the file reference thread, and the page loading thread can be instructed to quickly obtain different page processing logics, so that the time consumed for loading the page can be reduced, and the page loading efficiency can be improved.
According to the technical scheme provided by the embodiment of the invention, a plurality of page elements corresponding to a target page are loaded through a page loading thread, identification information of a JS file to be quoted is transmitted to a file quoting thread, the JS file is obtained through the file quoting thread according to the identification information, whether the JS file is successfully obtained in a preset time period is judged, if yes, the JS file and a first business logic function which are successfully obtained are transmitted to the page loading thread through the file quoting thread, the plurality of page elements are rendered through the page loading thread according to business logic codes in the JS file and the first business logic function, and if not, a second business logic function is transmitted to the page loading thread through the file quoting thread, and the plurality of page elements are rendered according to the second business logic function.
Fig. 3 is a flowchart of another page loading method according to an embodiment of the present invention, and as shown in fig. 3, the method includes:
and 310, in the loading process of the target page, loading a plurality of page elements corresponding to the target page through the page loading thread, and transmitting the identification information of the JS file to be quoted to the file quoting thread.
And step 320, acquiring the JS file corresponding to the target page according to the identification information through the file reference thread.
Step 330, judging whether the JS file is successfully acquired within a preset time period or not through the file reference thread, and if so, executing steps 340-360; if not, steps 370-380 are performed.
And 340, transmitting the obtained JS file, the first service logic function corresponding to the JS file and the identification information of the JS file to a page loading thread through the file reference thread.
In this embodiment, if the JS file is successfully acquired within the preset time period by using the file reference thread, the JS file, the first service logic function, and the identification information of the JS file that are successfully acquired may be transmitted to the page loading thread. The identification information may be a system identification of the service system corresponding to the JS file.
In a specific embodiment, assuming that the JS file of the in-page bulletin system is acquired by the file reference thread, the identification information of the JS file may be set to "GongGao". The method has the advantages that the page loading thread can quickly render the corresponding business system in the page according to the identification information of the JS file, and further the loading efficiency of the page can be improved.
And step 350, updating the JS file into a local JS file matched with the development environment of the target page according to the execution file corresponding to the target page through the page loading thread.
In this embodiment, most of the JS files acquired by the file reference thread belong to third-party files, so that in order to avoid the page loading thread from jamming when the JS files are operated, the JS files can be updated to local JS files matched with the target page development environment through the page loading thread according to tags in the target page execution file (Script).
The Script file may be a page Script file written according to a certain format using a specific descriptive language.
The method has the advantages that the JS file is updated to the local JS file matched with the target page development environment, so that the jamming in the page loading process can be avoided, the time consumed for loading the page is reduced, and the page loading efficiency is improved.
And step 360, rendering the multiple page elements through the page loading thread according to the business logic code in the local JS file and a first business logic function.
In this step, after the page loading thread generates the local JS file, the service logic code and the first service logic function in the local JS file may be executed to render multiple page elements.
And step 370, transmitting the second service logic function corresponding to the JS file with the failure to obtain to the page loading thread through the file reference thread.
And 380, rendering the multiple page elements according to the second service logic function.
According to the technical scheme provided by the embodiment of the invention, a plurality of page elements corresponding to a target page are loaded through a page loading thread, identification information of a JS file to be quoted is transmitted to a file quoting thread, the JS file is obtained through the file quoting thread according to the identification information, whether the JS file is successfully obtained within a preset time period is judged, if yes, the JS file, a first business logic function and JS file identification information which are successfully obtained are transmitted to the page loading thread through the file quoting thread, a local JS file is generated through the page loading thread, the plurality of page elements are rendered according to a business logic code in the local JS file and the first business logic function, and if not, a second business logic function is transmitted to the page loading thread through the file quoting thread, and the plurality of page elements are rendered according to the second business logic function, so that the page loading efficiency can be improved, and the use experience of a user on software can be promoted.
Fig. 4 is a schematic structural diagram of a page loading apparatus according to an embodiment of the present invention, and as shown in fig. 4, the apparatus includes: a delivery module 410, a file acquisition module 420, and a page rendering module 430 are identified.
The identification transmission module 410 is configured to, in the loading process of the target page, load multiple page elements corresponding to the target page through a page loading thread, and transmit identification information of the JS file to be referenced to a file referencing thread;
the file obtaining module 420 is configured to obtain, according to the identification information, a JS file corresponding to the target page through the file reference thread, and transmit an obtaining result corresponding to the JS file to the page loading thread;
and the page rendering module 430 is configured to render the multiple page elements according to the acquisition result corresponding to the JS file through the page loading thread, so as to complete loading of the target page.
According to the technical scheme provided by the embodiment of the invention, in the loading process of the target page, the page loading thread loads multiple page elements corresponding to the target page, the identification information of the JS file to be quoted is transmitted to the file quoting thread, the JS file is obtained through the file quoting thread according to the identification information, the obtaining result corresponding to the JS file is transmitted to the page loading thread, and the multiple page elements are rendered according to the obtaining result corresponding to the JS file through the page loading thread so as to complete the technical means of loading the target page.
On the basis of the above embodiment, the file obtaining module 420 includes:
the judging unit is used for judging whether the JS file is successfully acquired within a preset time period or not through the file reference thread;
the first function transfer unit is used for transferring the JS file which is successfully acquired and a first service logic function corresponding to the JS file to a page loading thread when the JS file is successfully acquired by the file reference thread within a preset time period;
the second function transfer unit is used for transferring a second service logic function corresponding to the JS file failed to obtain to the page loading thread through the file reference thread when the JS file failed to obtain by the file reference thread within a preset time period;
the identification processing unit is used for transmitting the obtained JS file, the first service logic function corresponding to the JS file and the identification information of the JS file to a page loading thread through the file reference thread;
and the file updating unit is used for updating the JS file into a local JS file matched with the target page development environment according to the execution file corresponding to the target page through the page loading thread.
The page rendering module 430 includes:
the first rendering unit is used for rendering the multiple page elements through the page loading thread according to the business logic codes in the JS file and the first business logic function if the acquired result comprises the JS file and the first business logic function corresponding to the JS file;
a second rendering unit, configured to, if the acquisition result includes a second service logic function corresponding to the JS file that has failed to be acquired, render, by the page loading thread, the multiple page elements according to the second service logic function;
and the page element rendering unit is used for rendering the multiple page elements according to the service logic code in the local JS file and the first service logic function through the page loading thread.
The device can execute the methods provided by all the embodiments of the invention, and has corresponding functional modules and beneficial effects for executing the methods. For technical details which are not described in detail in the embodiments of the present invention, reference may be made to the methods provided in all the aforementioned embodiments of the present invention.
FIG. 5 illustrates a block diagram of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to the bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
Processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 11 performs the various methods and processes described above, such as the page load method.
In some embodiments, the page loading method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the page loading method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the page loading method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on 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 compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user may provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above, reordering, adding or deleting steps, may be used. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A page loading method is characterized by comprising the following steps:
in the loading process of the target page, loading multiple page elements corresponding to the target page through a page loading thread, and transmitting identification information of the JS file to be quoted to a file quote thread;
acquiring a JS file corresponding to a target page according to the identification information through the file reference thread, and transmitting an acquisition result corresponding to the JS file to a page loading thread;
and rendering the multiple page elements according to the acquisition result corresponding to the JS file through the page loading thread so as to finish loading the target page.
2. The method of claim 1, wherein passing the acquisition result corresponding to the JS file to a page loading thread comprises:
judging whether the JS file is successfully acquired within a preset time period or not through the file reference thread;
and if yes, the successfully acquired JS file and a first business logic function corresponding to the JS file are transmitted to a page loading thread through the file reference thread.
3. The method according to claim 2, wherein the rendering, by the page loading thread, the plurality of page elements according to the acquisition result corresponding to the JS file includes:
and if the acquired result comprises a JS file and a first service logic function corresponding to the JS file, rendering the multiple page elements through the page loading thread according to the service logic code and the first service logic function in the JS file.
4. The method according to claim 2, wherein after determining, by the file reference thread, whether the JS file is successfully acquired within a preset time period, the method further comprises:
and if not, transmitting the second service logic function corresponding to the JS file which fails to be obtained to a page loading thread through the file reference thread.
5. The method according to claim 4, wherein the rendering, by the page loading thread, the plurality of page elements according to the acquisition result corresponding to the JS file comprises:
and if the acquisition result comprises a second service logic function corresponding to the JS file failed to be acquired, the multiple page elements are rendered through the page loading thread according to the second service logic function.
6. The method of claim 2, wherein the passing, by the file reference thread, the obtained JS file and the first business logic function corresponding to the JS file to a page loading thread comprises:
and transmitting the obtained JS file, the first service logic function corresponding to the JS file and the identification information of the JS file to a page loading thread through the file reference thread.
7. The method of claim 3, further comprising, after passing, by the file reference thread, the JS file that was successfully obtained and the first business logic function corresponding to the JS file to a page load thread:
updating the JS file into a local JS file matched with a target page development environment according to an execution file corresponding to the target page through the page loading thread;
through the page loading thread, rendering the multiple page elements according to the business logic code and the first business logic function in the JS file, and comprising the following steps:
and rendering the multiple page elements through the page loading thread according to the business logic code in the local JS file and a first business logic function.
8. A page loading apparatus, comprising:
the identification transmission module is used for loading multiple page elements corresponding to the target page through the page loading thread in the loading process of the target page and transmitting the identification information of the JS file to be quoted to the file quote thread;
the file acquisition module is used for acquiring the JS file corresponding to the target page according to the identification information through the file reference thread and transmitting an acquisition result corresponding to the JS file to the page loading thread;
and the page rendering module is used for rendering the multiple page elements according to the acquisition result corresponding to the JS file through the page loading thread so as to finish loading the target page.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the page loading method of any of claims 1-7.
10. A computer-readable storage medium storing computer instructions for causing a processor to perform the page loading method of any one of claims 1-7 when executed.
CN202211278858.5A 2022-10-19 2022-10-19 Page loading method and device, electronic equipment and storage medium Pending CN115630245A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211278858.5A CN115630245A (en) 2022-10-19 2022-10-19 Page loading method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211278858.5A CN115630245A (en) 2022-10-19 2022-10-19 Page loading method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115630245A true CN115630245A (en) 2023-01-20

Family

ID=84906175

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211278858.5A Pending CN115630245A (en) 2022-10-19 2022-10-19 Page loading method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115630245A (en)

Similar Documents

Publication Publication Date Title
CN112988727B (en) Data annotation method, device, equipment, storage medium and computer program product
CN114138397B (en) Page display method and device, electronic equipment and storage medium
CN115630245A (en) Page loading method and device, electronic equipment and storage medium
CN116069497A (en) Method, apparatus, device and storage medium for executing distributed task
CN115437709A (en) Method and device for loading application home page splash screen resources
CN114722048A (en) Data processing method and device, electronic equipment and storage medium
CN114564149A (en) Data storage method, device, equipment and storage medium
CN113377295A (en) Data storage and reading method, device and equipment for multi-producer single-consumer
CN112887426A (en) Information flow pushing method and device, electronic equipment and storage medium
CN114860405B (en) Parameter updating method and device of multitask model and storage medium
CN112784997B (en) Annotation rechecking method, device, equipment, storage medium and program product
CN115600029A (en) Method, device, system, equipment and storage medium for displaying webpage
CN117032712A (en) Pipeline compiling and constructing method and device, electronic equipment and storage medium
CN118200405A (en) Data transmission method and device, electronic equipment and storage medium
CN115373659A (en) Business system construction method and device, electronic equipment and storage medium
CN115983222A (en) EasyExcel-based file data reading method, device, equipment and medium
CN116149875A (en) Scheduling method and device of cloud terminal, electronic equipment, storage medium and product
CN115801718A (en) Message processing method and device, electronic equipment and message processing system
CN117608798A (en) Workflow scheduling method, device, equipment and medium
CN115455289A (en) Push message determining method, device, equipment, storage medium and product
CN117061307A (en) Multi-instance type hybrid deployment scheduling system based on enterprise cloud and container
CN115481090A (en) File processing method and device, electronic equipment and storage medium
CN115640112A (en) Resource scheduling method, device, equipment and medium based on label
CN116233051A (en) Page sharing method, device and equipment for applet and storage medium
CN115718608A (en) Parameter updating method and device, 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