CN111581555A - Document loading method, device, equipment and storage medium - Google Patents

Document loading method, device, equipment and storage medium Download PDF

Info

Publication number
CN111581555A
CN111581555A CN202010343769.9A CN202010343769A CN111581555A CN 111581555 A CN111581555 A CN 111581555A CN 202010343769 A CN202010343769 A CN 202010343769A CN 111581555 A CN111581555 A CN 111581555A
Authority
CN
China
Prior art keywords
document
loaded
position information
loading
language
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.)
Granted
Application number
CN202010343769.9A
Other languages
Chinese (zh)
Other versions
CN111581555B (en
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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202010343769.9A priority Critical patent/CN111581555B/en
Publication of CN111581555A publication Critical patent/CN111581555A/en
Application granted granted Critical
Publication of CN111581555B publication Critical patent/CN111581555B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/106Display of layout of documents; Previewing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the disclosure discloses a document loading method, a device, equipment and a storage medium, wherein the method comprises the following steps: responding to the detected document loading request, and acquiring document position information corresponding to the document loading request; calling a communication interface to send the document position information to a document rendering thread so that the document rendering thread calls a pre-loaded target document rendering module to obtain a document to be loaded according to the document position information and renders the document to be loaded to obtain document picture data; and receiving the document picture data sent by the document rendering thread, and displaying the document picture data through a display device. According to the method provided by the embodiment of the invention, the document to be loaded is rendered by calling the document rendering thread, so that the influence on other tasks in the current task thread is reduced when the document is loaded, the page performance is optimized, the page jamming is reduced, and the document loading speed is increased.

Description

Document loading method, device, equipment and storage medium
Technical Field
The embodiment of the disclosure relates to the technical field of computers, and in particular relates to a document loading method, a document loading device and a storage medium.
Background
When a user browses a file on a website, the file is usually rendered directly on the webpage. Currently, rendering files on web pages is typically done using a javascript (js) thread. In the modern webpage technology, the JS thread needs to be responsible for tasks including real-time updating of a page, interaction with a user, animation effects and the like, so that the JS thread can block rendering of the page when executing the task, the document loading speed is low, and in addition, due to the fact that the rendering file consumes running performance, when the user needs to browse a large file on the page, the page can be jammed.
Disclosure of Invention
The disclosure provides a document loading method, a document loading device and a storage medium, so as to improve the document loading speed and reduce the influence of the document loading process on other tasks.
In a first aspect, an embodiment of the present disclosure provides a document loading method, including:
responding to the detected document loading request, and acquiring document position information corresponding to the document loading request;
calling a communication interface to send the document position information to a document rendering thread so that the document rendering thread calls a pre-loaded target document rendering module to obtain a document to be loaded according to the document position information and renders the document to be loaded to obtain document picture data;
and receiving the document picture data sent by the document rendering thread, and displaying the document picture data through a display device.
In a second aspect, an embodiment of the present disclosure further provides a document loading apparatus, including:
the to-be-loaded document position module is used for responding to the detected document loading request and acquiring document position information corresponding to the document loading request;
the document data acquisition module is used for calling a communication interface to send the document position information to a document rendering thread so that the document rendering thread calls a pre-loaded target document rendering module to acquire a document to be loaded according to the document position information and render the document to be loaded to obtain document picture data;
and the document display module is used for receiving the document picture data sent by the document rendering thread and displaying the document picture data through a display device.
In a third aspect, an embodiment of the present disclosure further provides a computer device, where the computer device includes:
one or more processing devices;
storage means for storing one or more programs;
when the one or more programs are executed by the one or more processing devices, the one or more processing devices are caused to implement the document loading method provided by any embodiment of the invention.
In a fourth aspect, the disclosed embodiment further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the document loading method provided in any embodiment of the present invention.
The method and the device for loading the document in the embodiment of the disclosure respond to the detected document loading request to obtain the document position information corresponding to the document loading request; calling a communication interface to send the document position information to a document rendering thread so that the document rendering thread calls a pre-loaded target document rendering module to obtain a document to be loaded according to the document position information and renders the document to be loaded to obtain document picture data; and receiving the document picture data sent by the document rendering thread, displaying the document picture data through a display device, and rendering the document to be loaded by calling the document rendering thread, so that the influence on other tasks in the current task thread is reduced during document loading, the page performance is optimized, page jamming is reduced, and the document loading speed is increased.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
FIG. 1 is a flowchart of a document loading method according to an embodiment of the disclosure;
FIG. 2 is a flowchart of a document loading method provided in a second embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a document loading apparatus according to a third embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a computer device according to a fourth embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
In the following embodiments, optional features and examples are provided in each embodiment, and various features described in the embodiments may be combined to form a plurality of alternatives, and each numbered embodiment should not be regarded as only one technical solution.
Example one
Fig. 1 is a flowchart of a document loading method according to an embodiment of the present disclosure. The embodiment can be applied to the situation when the document is rendered and displayed in the webpage, and is particularly suitable for the situation when the portable document format document is rendered and displayed in the webpage. The method may be performed by a document loading apparatus, which may be implemented in software and/or hardware, for example, the document loading apparatus may be configured in a computer device. As shown in fig. 1, the method includes:
s110, responding to the detected document loading request, and acquiring document position information corresponding to the document loading request.
In this embodiment, the document loading request may be triggered by a user clicking a document display control in the web page content display interface, and is used to indicate a request for displaying a document. Optionally, the document loading request may include a document identifier of the document to be loaded, and the document loading device may analyze the document loading request, obtain the document identifier of the document to be loaded, and determine the document position information of the document to be loaded according to the document identifier of the document to be loaded. The document position information may be information such as a document acquisition path of the document to be loaded.
S120, calling the communication interface to send the document position information to the document rendering thread, so that the document rendering thread calls a pre-loaded target document rendering module to obtain a document to be loaded according to the document position information, and rendering the document to be loaded to obtain document picture data.
Optionally, the document to be loaded is a portable document format document. The Portable Document Format (PDF) is a file Format developed by Adobe Systems for file exchange in a manner independent of an application program, an operating system, and hardware. In the embodiment, the operation of rendering the PDF document can be realized by other threads besides the current thread, so as to improve the display speed of the PDF document and avoid page blockage.
In this embodiment, after the current thread acquires the document position information of the document to be loaded, the communication interface is called to send the document position information of the document to be loaded to the document rendering thread, so that the document to be loaded is rendered in the document rendering thread. Optionally, the document rendering thread may obtain the document to be loaded by calling the document rendering module loaded in advance and render the document to be loaded, so as to obtain document picture data corresponding to the document to be loaded, and after obtaining the document picture data, call the communication interface to send the rendered document picture data to the current thread. Optionally, the current thread is a JS thread.
It should be noted that, in this embodiment, the implementation language of the target document rendering module is not limited, and the implementation language of the target document rendering module may be a compiled language or a similar assembly language. The compiled language is a language in which the source code needs to be compiled to generate a machine language at first and then the machine runs the machine code (binary), such as C, C + +, or the like. The class assembly language is a low-level language used for an electronic computer, a microprocessor, a microcontroller or other programmable devices, and the class assembly language does not need to be compiled when being executed, and the execution efficiency of the program is high.
And S130, receiving the document picture data sent by the document rendering thread, and displaying the document picture data through a display device.
In this embodiment, after the current thread sends the document position information of the document to be loaded to the document loading thread, the document picture data returned by the document loading thread is acquired, and the acquired document picture data is displayed on the page, so as to complete the loading of the document to be loaded.
The method and the device for loading the document in the embodiment of the disclosure respond to the detected document loading request to obtain the document position information corresponding to the document loading request; calling a communication interface to send the document position information to a document rendering thread so that the document rendering thread calls a pre-loaded target document rendering module to obtain a document to be loaded according to the document position information and renders the document to be loaded to obtain document picture data; and receiving the document picture data sent by the document rendering thread, displaying the document picture data through a display device, and rendering the document to be loaded by calling the document rendering thread, so that the influence on other tasks in the current task thread is reduced during document loading, the page performance is optimized, page jamming is reduced, and the document loading speed is increased.
Example two
Fig. 2 is a flowchart of a document loading method according to a second embodiment of the disclosure. This embodiment may be combined with each of the alternatives in one or more of the embodiments described above. In this embodiment, the implementation language of the target document rendering module is embodied as a class assembly language. As shown in fig. 2, the method includes:
s210, obtaining an original document rendering module written based on the compiling type language, and converting the original document rendering module into a target document rendering module realized based on the class assembly language.
In this embodiment, the implementation language of the target document rendering module is embodied as a class assembly language, which has a higher running speed and can more quickly implement the rendering of the PDF document.
In an embodiment of the present invention, the converting the original document rendering module into a target document rendering module implemented based on a class assembly language includes: and compiling the original document rendering module into a target document rendering module realized based on the class assembly language through an Emscript compiler. An original document rendering module written based on a compiling type language can be converted into a target document rendering module realized based on a class assembly language by using an Emscript compiler. The embritten compiler can be understood as a compiler from a Low Level Virtual Machine (LLVM) to JavaScript, and by using the embritten compiler, a C language or a C + + language supported by the LLVM can be compiled into a programming language that can run on a browser or other platforms.
In one embodiment, the compiled language includes a C language or a C + + language, and the assembly-like language includes a WebAssembly language. WebAssembly is a low-level assembly-like language that has a compact binary format, can run with near native performance, and provides a compilation target for languages such as C/C + + so that they can run on web pages. In this embodiment, a program code file of an original document rendering module written in C language or C + + language is compiled into a program code file of a target document rendering module which is portable and can support intercommunication with JavaScript language, so that PDF rendering code written in C language or C + + language is converted into a format which can be run in WebAssembly, and thus the target document rendering module can be used in a browser, and rendering a to-be-loaded document by using the target document rendering module implemented based on WebAssembly improves the document rendering speed.
On the basis of the scheme, the method further comprises the following steps: and acquiring the storage position information of the target document rendering module, and configuring the document rendering module based on the storage position information. Optionally, after the target document rendering module is generated, the target document rendering module may be stored, and the storage location information of the target document rendering module is configured in the page, so that the target document rendering module is loaded and operated according to the configured storage location information when the page needs to call the target document rendering module. For example, after the target document rendering module is generated, the target document rendering module may be stored according to a storage path set by a user, and the storage path set by the user is used as storage location information of the target document rendering module, and the storage location information is configured in a web page.
In this embodiment, the target document rendering module may be loaded when the webpage is opened, or may be loaded when the document rendering request is detected. Preferably, the method further comprises: and responding to the detected document loading request, and loading the target document rendering module according to the pre-configured storage position information. When a document loading request is detected, the target document rendering module is obtained from the pre-configured storage position information and is loaded and operated, so that the influence of loading the target document rendering module on the webpage performance when no document rendering is required can be avoided.
S220, responding to the detected document loading request, and acquiring document position information corresponding to the document loading request.
And S230, calling the communication interface to send the document position information to the document rendering thread so that the document rendering thread calls a pre-loaded target document rendering module to obtain the document to be loaded according to the document position information, and rendering the document to be loaded to obtain document picture data.
And S240, receiving the document picture data sent by the document rendering thread, and displaying the document picture data through a display device.
According to the method and the device, the implementation language of the target document rendering module is embodied into the class assembly language, the original document rendering module written based on the compiling language is obtained and converted into the target document rendering module implemented based on the class assembly language, and the target document rendering module implemented based on the class assembly language is used for rendering the document to be loaded, so that the document rendering speed of the document to be loaded is increased, and further the document loading speed is increased.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a document loading apparatus according to a third embodiment of the present disclosure. The embodiment can be applied to the situation when the PDF text is loaded. The document loading apparatus may be implemented in software and/or hardware, for example, the document loading apparatus may be configured in a computer device. As shown in fig. 3, the document loading apparatus includes: a to-be-loaded document position module 310, a document data acquisition module 320, and a document display module 330. Wherein:
a to-be-loaded document location module 310, configured to respond to a detected document loading request, and obtain document location information corresponding to the document loading request;
the document data obtaining module 320 is configured to invoke a communication interface to send the document position information to a document rendering thread, so that the document rendering thread invokes a pre-loaded target document rendering module to obtain a document to be loaded according to the document position information, and renders the document to be loaded to obtain document picture data;
and the document display module 330 is configured to receive the document picture data sent by the document rendering thread, and display the document picture data through a display device.
The document position information corresponding to the document loading request is acquired by a document position module to be loaded in response to the detected document loading request; the document data acquisition module calls a communication interface to send the document position information to a document rendering thread so that the document rendering thread calls a pre-loaded target document rendering module to acquire a document to be loaded according to the document position information and render the document to be loaded to obtain document picture data; the document display module receives the document picture data sent by the document rendering thread, displays the document picture data through the display device, and renders the document to be loaded by calling the document rendering thread, so that the influence on other tasks in the current task thread is reduced when the document is loaded, the page performance is optimized, the page jamming is reduced, and the document loading speed is increased.
Optionally, on the basis of the above technical solution, the apparatus further includes a document rendering conversion module, configured to:
and before a communication interface is called to send the document position information to a document rendering thread, acquiring an original document rendering module written based on a compiling type language, and converting the original document rendering module into a target document rendering module realized based on a class assembly language.
Optionally, on the basis of the above technical solution, the document rendering conversion module is specifically configured to:
and compiling the original document rendering module into a target document rendering module realized based on the class assembly language through an Emscript compiler.
Optionally, on the basis of the above technical solution, the compiled language includes a C language or a C + + language, and the assembly-like language includes a WebAssembly language.
Optionally, on the basis of the above technical solution, the apparatus further includes:
and the document rendering configuration module is used for acquiring the storage position information of the target document rendering module and configuring the document rendering module based on the storage position information.
Optionally, on the basis of the above technical solution, the apparatus further includes:
and the document rendering and loading module is used for responding to the detected document loading request and loading the target document rendering module according to the pre-configured storage position information.
Optionally, on the basis of the above technical solution, the document to be loaded is a portable document format document.
The document loading device provided by the embodiment of the disclosure can execute the document loading method provided by the embodiment of the disclosure, and has corresponding functional modules and beneficial effects of the execution method.
It should be noted that, the units and modules included in the apparatus are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only used for distinguishing one functional unit from another, and are not used for limiting the protection scope of the embodiments of the present disclosure.
Example four
Referring now to FIG. 4, shown is a schematic block diagram of a computer device 400 suitable for use in implementing embodiments of the present disclosure. The computer device in the embodiments of the present disclosure may include, but is not limited to, devices such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like. The computer device shown in fig. 4 is only an example and should not bring any limitation to the function and scope of use of the embodiments of the present disclosure.
As shown in fig. 4, the computer device 400 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 401 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)402 or a program loaded from a storage means 406 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for the operation of the computer apparatus 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
Generally, the following devices may be connected to the I/O interface 405: input devices 406 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 407 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage devices 406 including, for example, magnetic tape, hard disk, etc.; and a communication device 409. The communication means 409 may allow the computer device 400 to communicate with other devices, either wirelessly or by wire, to exchange data. While fig. 4 illustrates a computer device 400 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 409, or from the storage means 406, or from the ROM 402. The computer program performs the above-described functions defined in the methods of the embodiments of the present disclosure when executed by the processing device 401.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: 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 the present disclosure, 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. In contrast, in the present disclosure, a computer readable signal medium may comprise 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 many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. 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: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText transfer protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the computer device; or may exist separately and not be incorporated into the computer device.
The computer readable medium carries one or more programs which, when executed by the computing device, cause the computing device to: responding to the detected document loading request, and acquiring document position information corresponding to the document loading request; calling a communication interface to send the document position information to a document rendering thread so that the document rendering thread calls a pre-loaded target document rendering module to obtain a document to be loaded according to the document position information and renders the document to be loaded to obtain document picture data; and receiving the document picture data sent by the document rendering thread, and displaying the document picture data through a display device.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to 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 type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of methods, apparatus, computer devices, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules and units described in the embodiments of the present disclosure may be implemented by software or hardware. For example, the document position to be loaded module may be further described as a "module for acquiring document position information corresponding to a document loading request in response to a detected document loading request", and the document display module may be further described as a "module for receiving document picture data sent by the document rendering thread and displaying the document picture data through a display device".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable 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. 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 portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, an example provides a document loading method, including:
responding to the detected document loading request, and acquiring document position information corresponding to the document loading request;
calling a communication interface to send the document position information to a document rendering thread so that the document rendering thread calls a pre-loaded target document rendering module to obtain a document to be loaded according to the document position information and renders the document to be loaded to obtain document picture data;
and receiving the document picture data sent by the document rendering thread, and displaying the document picture data through a display device.
According to one or more embodiments of the present disclosure, example two provides a document loading method, and on the basis of the document loading method of example one, before the communication interface is called to send the document location information to a document rendering thread, the method further includes:
the method comprises the steps of obtaining an original document rendering module written based on a compiling type language, and converting the original document rendering module into a target document rendering module realized based on a class assembly language.
According to one or more embodiments of the present disclosure, example three provides a document loading method, and on the basis of the document loading method of example two, the converting the original document rendering module into a target document rendering module implemented based on a class assembly language includes:
and compiling the original document rendering module into a target document rendering module realized based on the class assembly language through an Emscript compiler.
According to one or more embodiments of the present disclosure, example four provides a document loading method, and on the basis of the document loading method of example two, the compiled language includes a C language or a C + + language, and the assembly-like language includes a WebAssembly language.
According to one or more embodiments of the present disclosure, example five provides a document loading method, and on the basis of the document loading method of example one, the method further includes:
and acquiring the storage position information of the target document rendering module, and configuring the document rendering module based on the storage position information.
According to one or more embodiments of the present disclosure, example six provides a document loading method, and on the basis of the document loading method of example five, the method further includes:
and responding to the detected document loading request, and loading the target document rendering module according to the pre-configured storage position information.
According to one or more embodiments of the present disclosure, example seven provides a document loading method, and on the basis of the document loading method of any one of examples one to six, the document to be loaded is a portable document format document.
Example eight provides, in accordance with one or more embodiments of the present disclosure, a document loading apparatus, comprising:
the to-be-loaded document position module is used for responding to the detected document loading request and acquiring document position information corresponding to the document loading request;
the document data acquisition module is used for calling a communication interface to send the document position information to a document rendering thread so that the document rendering thread calls a pre-loaded target document rendering module to acquire a document to be loaded according to the document position information and render the document to be loaded to obtain document picture data;
and the document display module is used for receiving the document picture data sent by the document rendering thread and displaying the document picture data through a display device.
Example nine provides, in accordance with one or more embodiments of the present disclosure, a computer device comprising:
one or more processing devices;
storage means for storing one or more programs;
when executed by the one or more processing devices, cause the one or more processing devices to implement the document loading method of any of examples one to seven.
Example ten provides, according to one or more embodiments of the present disclosure, a computer-readable storage medium having stored thereon a computer program that, when executed by a processor, implements a document loading method as recited in any one of examples one to seven.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (10)

1. A document loading method, comprising:
responding to the detected document loading request, and acquiring document position information corresponding to the document loading request;
calling a communication interface to send the document position information to a document rendering thread so that the document rendering thread calls a pre-loaded target document rendering module to obtain a document to be loaded according to the document position information and renders the document to be loaded to obtain document picture data;
and receiving the document picture data sent by the document rendering thread, and displaying the document picture data through a display device.
2. The method of claim 1, wherein prior to invoking the communication interface to send the document location information to a document rendering thread, the method further comprises:
the method comprises the steps of obtaining an original document rendering module written based on a compiling type language, and converting the original document rendering module into a target document rendering module realized based on a class assembly language.
3. The method of claim 2, wherein converting the original document rendering module into a target document rendering module implemented based on a class assembly language comprises:
and compiling the original document rendering module into a target document rendering module realized based on the class assembly language through an Emscript compiler.
4. The method of claim 2, wherein the compiled language comprises a C language or a C + + language, and wherein the assembly-like language comprises a WebAssembly language.
5. The method of claim 1, further comprising:
and acquiring the storage position information of the target document rendering module, and configuring the document rendering module based on the storage position information.
6. The method of claim 5, further comprising:
and responding to the detected document loading request, and loading the target document rendering module according to the pre-configured storage position information.
7. The method according to any one of claims 1 to 6, wherein the document to be loaded is a portable document format document.
8. A document loading apparatus, comprising:
the to-be-loaded document position module is used for responding to the detected document loading request and acquiring document position information corresponding to the document loading request;
the document data acquisition module is used for calling a communication interface to send the document position information to a document rendering thread so that the document rendering thread calls a pre-loaded target document rendering module to acquire a document to be loaded according to the document position information and render the document to be loaded to obtain document picture data;
and the document display module is used for receiving the document picture data sent by the document rendering thread and displaying the document picture data through a display device.
9. A computer device, characterized in that the computer device comprises:
one or more processing devices;
storage means for storing one or more programs;
when executed by the one or more processing devices, cause the one or more processing devices to implement the document loading method of any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the document loading method according to any one of claims 1 to 7.
CN202010343769.9A 2020-04-27 2020-04-27 Document loading method, device, equipment and storage medium Active CN111581555B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010343769.9A CN111581555B (en) 2020-04-27 2020-04-27 Document loading method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010343769.9A CN111581555B (en) 2020-04-27 2020-04-27 Document loading method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111581555A true CN111581555A (en) 2020-08-25
CN111581555B CN111581555B (en) 2023-09-15

Family

ID=72122772

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010343769.9A Active CN111581555B (en) 2020-04-27 2020-04-27 Document loading method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111581555B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112001151A (en) * 2020-08-10 2020-11-27 青岛海尔科技有限公司 Method, device and equipment for document display
CN112073307A (en) * 2020-09-10 2020-12-11 北京字跳网络技术有限公司 Mail processing method and device, electronic equipment and computer readable medium
CN112558933A (en) * 2020-12-09 2021-03-26 北京字节跳动网络技术有限公司 Component rendering method and device, readable medium and electronic equipment
CN112650714A (en) * 2020-12-22 2021-04-13 微民保险代理有限公司 Document display method, device, equipment and computer readable medium
CN113760252A (en) * 2020-11-16 2021-12-07 北京沃东天骏信息技术有限公司 Data visualization method, device, computer system and readable storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090254807A1 (en) * 2008-04-02 2009-10-08 Microsoft Corporation Progressive Page Loading
CN102622439A (en) * 2012-03-06 2012-08-01 奇智软件(北京)有限公司 Method and device for displaying document in browser
US20130097520A1 (en) * 2011-10-18 2013-04-18 Research In Motion Limited Method of rendering a user interface
US8914813B1 (en) * 2010-04-09 2014-12-16 Google Inc. Interfaces to enable cross-browser extensions and applications thereof
CN104965848A (en) * 2015-02-12 2015-10-07 腾讯科技(深圳)有限公司 Front-end resource loading method and apparatus
CN106775225A (en) * 2016-12-02 2017-05-31 西安电子科技大学 The method that across document seamless roam browses PDF maps
CN107015871A (en) * 2016-12-07 2017-08-04 阿里巴巴集团控股有限公司 A kind of data processing method and device
US20200057660A1 (en) * 2017-03-08 2020-02-20 Alibaba Group Holding Limited Method and system for rendering user interfaces
CN110928543A (en) * 2019-11-04 2020-03-27 北京小米移动软件有限公司 Page processing method and device and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090254807A1 (en) * 2008-04-02 2009-10-08 Microsoft Corporation Progressive Page Loading
US8914813B1 (en) * 2010-04-09 2014-12-16 Google Inc. Interfaces to enable cross-browser extensions and applications thereof
US20130097520A1 (en) * 2011-10-18 2013-04-18 Research In Motion Limited Method of rendering a user interface
CN102622439A (en) * 2012-03-06 2012-08-01 奇智软件(北京)有限公司 Method and device for displaying document in browser
CN104965848A (en) * 2015-02-12 2015-10-07 腾讯科技(深圳)有限公司 Front-end resource loading method and apparatus
CN106775225A (en) * 2016-12-02 2017-05-31 西安电子科技大学 The method that across document seamless roam browses PDF maps
CN107015871A (en) * 2016-12-07 2017-08-04 阿里巴巴集团控股有限公司 A kind of data processing method and device
US20200057660A1 (en) * 2017-03-08 2020-02-20 Alibaba Group Holding Limited Method and system for rendering user interfaces
CN110928543A (en) * 2019-11-04 2020-03-27 北京小米移动软件有限公司 Page processing method and device and storage medium

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112001151A (en) * 2020-08-10 2020-11-27 青岛海尔科技有限公司 Method, device and equipment for document display
CN112001151B (en) * 2020-08-10 2023-12-19 青岛海尔科技有限公司 Method, device and equipment for displaying document
CN112073307A (en) * 2020-09-10 2020-12-11 北京字跳网络技术有限公司 Mail processing method and device, electronic equipment and computer readable medium
CN112073307B (en) * 2020-09-10 2023-11-14 北京字跳网络技术有限公司 Mail processing method, mail processing device, electronic equipment and computer readable medium
US11929973B2 (en) 2020-09-10 2024-03-12 Beijing Zitiao Network Technology Co., Ltd. Mail processing method and apparatus, and electronic device, and computer readable medium
CN113760252A (en) * 2020-11-16 2021-12-07 北京沃东天骏信息技术有限公司 Data visualization method, device, computer system and readable storage medium
CN112558933A (en) * 2020-12-09 2021-03-26 北京字节跳动网络技术有限公司 Component rendering method and device, readable medium and electronic equipment
CN112650714A (en) * 2020-12-22 2021-04-13 微民保险代理有限公司 Document display method, device, equipment and computer readable medium
CN112650714B (en) * 2020-12-22 2024-04-05 微民保险代理有限公司 Document display method, device, equipment and computer readable medium

Also Published As

Publication number Publication date
CN111581555B (en) 2023-09-15

Similar Documents

Publication Publication Date Title
CN111581555B (en) Document loading method, device, equipment and storage medium
US11144711B2 (en) Webpage rendering method, device, electronic apparatus and storage medium
CN111581563B (en) Page response method and device, storage medium and electronic equipment
CN111338623B (en) Method, device, medium and electronic equipment for developing user interface
CN111580879A (en) Applet running method and device, electronic equipment and computer storage medium
CN111367516B (en) Application interface generation method and device and electronic equipment
CN111443909B (en) Method and device for generating page
CN111324376B (en) Function configuration method, device, electronic equipment and computer readable medium
CN111309304B (en) Method, device, medium and electronic equipment for generating IDL file
CN111400068B (en) Interface control method and device, readable medium and electronic equipment
CN111857658A (en) Method, device, medium and electronic equipment for rendering dynamic component
CN112416303A (en) Software development kit thermal restoration method and device and electronic equipment
CN113391860A (en) Service request processing method and device, electronic equipment and computer storage medium
CN111752644A (en) Interface simulation method, device, equipment and storage medium
CN111324835A (en) Method and device for rendering user interface component, electronic equipment and storage medium
CN111309323B (en) Parameter initialization method and device and electronic equipment
CN111258582B (en) Window rendering method and device, computer equipment and storage medium
CN111290812B (en) Display method, device, terminal and storage medium of application control
CN109669720B (en) Chain type asynchronous request processing method and device based on Promise and electronic equipment
CN113778566A (en) Native application calling method and device, electronic equipment and computer readable medium
CN111796865A (en) Byte code file modification method and device, terminal equipment and medium
CN111984888A (en) Page rendering method and device, electronic equipment and computer readable medium
CN112445517B (en) Inlet file generation method, device, electronic equipment and computer readable medium
CN110099122B (en) Method and apparatus for sending network request
CN111562913B (en) Method, device and equipment for pre-creating view component and computer readable 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
GR01 Patent grant
GR01 Patent grant