CN111460345B - Electronic book loading display method, electronic equipment and storage medium - Google Patents

Electronic book loading display method, electronic equipment and storage medium Download PDF

Info

Publication number
CN111460345B
CN111460345B CN202010235644.4A CN202010235644A CN111460345B CN 111460345 B CN111460345 B CN 111460345B CN 202010235644 A CN202010235644 A CN 202010235644A CN 111460345 B CN111460345 B CN 111460345B
Authority
CN
China
Prior art keywords
chapter
target
html file
content
page turning
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.)
Active
Application number
CN202010235644.4A
Other languages
Chinese (zh)
Other versions
CN111460345A (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.)
Ireader Technology Co Ltd
Original Assignee
Ireader 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 Ireader Technology Co Ltd filed Critical Ireader Technology Co Ltd
Priority to CN202010235644.4A priority Critical patent/CN111460345B/en
Publication of CN111460345A publication Critical patent/CN111460345A/en
Application granted granted Critical
Publication of CN111460345B publication Critical patent/CN111460345B/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/9577Optimising the visualization of content, e.g. distillation of HTML documents

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)
  • User Interface Of Digital Computer (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses an electronic book loading and displaying method, electronic equipment and a storage medium, wherein the method comprises the following steps: reading an electronic book to be loaded, determining a target chapter to be loaded, and acquiring a target HTML file corresponding to the target chapter; extracting target chapter content corresponding to the target chapter from the target HTML file, and writing the target chapter content into a specified variable of the target HTML file in a character string mode; loading a target HTML file, and inserting a specified variable into a target container of the target HTML file; and performing paging rendering on the content in the specified variable in the target container by utilizing the browser kernel to complete paging display of the content of the target chapter in the electronic book. The content of the target chapters of the electronic books is written into the designated variable of the target HTML file, the browser kernel is used for loading and page rendering, the accuracy and the normalization of page display of the electronic books can be guaranteed, different electronic books can be processed in a compatible mode, the display effect of the electronic books is improved, and the cost consumption is reduced.

Description

Electronic book loading display method, electronic equipment and storage medium
Technical Field
The invention relates to the field of electronic book application, in particular to an electronic book loading display method, electronic equipment and a storage medium.
Background
The electronic books can be convenient for a user to read at any time and any place, after the user reads the content of the current page, the content of the next page can be read continuously through manual page turning, or the user can jump to the page where the appointed directory is located to read in a directory jumping mode, and the like, and various reading convenience is provided for the user through different reading modes. With the popularization of electronic books, the electronic books are analyzed and rendered based on self-development software or third-party plug-ins at first, but the technology cannot be applied to the existing electronic books, and has more problems in technology and cost, so that the electronic books cannot be provided with a good display effect, and the reading experience of users is influenced. Therefore, a method for paging an electronic book well is needed to achieve a precise display effect of the electronic book.
Disclosure of Invention
In view of the above problems, the present invention has been made to provide an electronic book loading presentation method, an electronic device, and a storage medium that overcome or at least partially solve the above problems.
According to one aspect of the present invention, there is provided an electronic book loading and displaying method, which includes:
reading, namely reading the electronic book to be loaded, determining a target chapter to be loaded, and acquiring a target HTML file corresponding to the target chapter;
a writing step, namely extracting target chapter content corresponding to a target chapter from a target HTML file, and writing the target chapter content into a specified variable of the target HTML file in a character string mode;
a loading step, loading a target HTML file, and inserting a specified variable into a target container of the target HTML file;
and paging, namely paging and rendering contents in the designated variables in the target container by utilizing the browser kernel to complete paging display of the contents of the target chapters in the electronic book.
According to another aspect of the present invention, there is provided an electronic apparatus including: the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the following operations:
reading, namely reading the electronic book to be loaded, determining a target chapter to be loaded, and acquiring a target HTML file corresponding to the target chapter;
a writing step, namely extracting target chapter content corresponding to a target chapter from a target HTML file, and writing the target chapter content into a specified variable of the target HTML file in a character string mode;
a loading step, loading a target HTML file, and inserting a specified variable into a target container of the target HTML file;
and paging, namely paging and rendering contents in the designated variables in the target container by utilizing the browser kernel to complete paging display of the contents of the target chapters in the electronic book.
According to yet another aspect of the present invention, there is provided a computer storage medium having at least one executable instruction stored therein, the executable instruction causing a processor to:
reading, namely reading the electronic book to be loaded, determining a target chapter to be loaded, and acquiring a target HTML file corresponding to the target chapter;
a writing step, namely extracting target chapter content corresponding to a target chapter from a target HTML file, and writing the target chapter content into a specified variable of the target HTML file in a character string mode;
a loading step, loading a target HTML file, and inserting a specified variable into a target container of the target HTML file;
and paging, namely paging and rendering contents in the designated variables in the target container by utilizing the browser kernel to complete paging display of the contents of the target chapters in the electronic book.
According to the electronic book loading and displaying method, the electronic equipment and the storage medium, provided by the invention, the electronic book to be loaded is read, the target chapter to be loaded is determined, and the target HTML file corresponding to the target chapter is obtained; extracting target chapter content corresponding to the target chapter from the target HTML file, and writing the target chapter content into a specified variable of the target HTML file in a character string mode; loading a target HTML file, and inserting a specified variable into a target container of the target HTML file; and performing paging rendering on the content in the specified variable in the target container by utilizing the browser kernel to complete paging display of the content of the target chapter in the electronic book. The method has the advantages that the target chapter content of the electronic books is written into the designated variable of the target HTML file, the browser kernel is used for loading and page rendering, the accuracy and the normalization of page display of the electronic books can be guaranteed, different electronic books can be compatibly processed, the display effect of the electronic books is improved, the display problem of the prior art when the electronic books are displayed is solved, and the cost consumption is reduced.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a flow chart of an electronic book loading and displaying method according to an embodiment of the invention;
FIG. 2 is a flowchart illustrating an electronic book loading display method according to another embodiment of the present invention;
FIG. 3 is a flowchart illustrating an electronic book loading and displaying method according to another embodiment of the present invention;
FIG. 4 is a flowchart illustrating an electronic book loading display method according to another embodiment of the present invention;
FIG. 5 shows a schematic view of a second coordinate axis;
fig. 6 shows a schematic structural diagram of an electronic device according to an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Example one
Fig. 1 is a schematic flow chart of an electronic book loading and displaying method according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step S101, reading the electronic book to be loaded, determining the target chapter to be loaded, and acquiring the target HTML file corresponding to the target chapter.
The method and the device can be executed on the client side, so that the user can conveniently and directly perform paging rendering on the electronic books to be loaded when reading the electronic books on the client side, the server side does not need to be accessed, and the reading experience of the user is improved.
In this embodiment, the electronic book may be, for example, an epub electronic book, or an electronic book with other formats, and is not limited herein. Reading the electronic book to be loaded from the client, and acquiring the recorded reading identification information of the electronic book to be loaded by the user from the client while reading the electronic book. The reading identification information can record the reading progress of the user, record read chapters, record read text labels, record read page numbers and the like in a percentage mode. And calculating and determining the target chapter to be loaded of the electronic book to be loaded according to the reading identification information. According to different reading identification information, different calculation modes can be adopted, for example, the corresponding read chapters are obtained by calculating the whole electronic book according to the percentage of the reading progress information and are used as target chapters to be loaded; or, directly determining a target chapter to be loaded according to the recorded read chapter; or determining the corresponding target chapter to be loaded according to the record read character label and the record read page number.
And after the target section to be loaded is determined, determining a target HTML file corresponding to the target section for the target section. The target HTML file may be generated by a pre-established HTML file template. And if the target section to be loaded is determined, establishing a corresponding target HTML file for the target section to be loaded, and displaying the target section to be loaded by utilizing the target HTML file.
Further, when the target HTML file is created, the target chapter may include one chapter or may include a plurality of chapters. That is, one target HTML file may contain one chapter or a plurality of chapters. If the target section contains the first section, the target HTML file contains the target section content of the first section; the target chapters comprise a first chapter, a second chapter and a third chapter, and the target HTML file comprises target chapter contents of the first chapter, the second chapter and the third chapter. The implementation can be specifically set according to implementation conditions, and is not limited herein. The electronic book may be composed of a plurality of target HTML files, each target HTML file may include chapter contents of one chapter, and may also include chapter contents of a plurality of chapters, which is not limited herein.
And step S102, extracting the target chapter content corresponding to the target chapter from the target HTML file, and writing the target chapter content into a specified variable of the target HTML file in a character string mode.
After the target chapter is determined, the content of the target chapter corresponding to the target chapter, such as characters, pictures and other elements under the target chapter, needs to be extracted from the electronic book. The extracted target chapter content can be written into a designated variable of a target HTML file corresponding to the target chapter in a character string mode. If the designated variable of the preset set target HTML file is a CHAPTER _ HTML variable, the characters and the pictures (information such as picture loading links and picture storage addresses) are stored by utilizing the CHAPTER _ HTML variable.
Furthermore, different display modes may be available for different electronic books, for example, a display mode from left to right is generally adopted when displaying electronic books in chinese; in general, in an arabic electronic book, a display style from right to left is used for display. When different display styles are configured on different languages of the electronic books of different languages, or different display styles are configured on different electronic books, the style file of the electronic book can be acquired, and the style file is inserted into the head of the target HTML file, so that the display of the target HTML file and the electronic books are guaranteed. The style file comprises a language identifier dir ═ rtl (the language to be displayed from right to left), and the like, and can realize multi-language adaptive display of the electronic book.
Step S103, loading the target HTML file and inserting the specified variable into the target container of the target HTML file.
When the target HTML file is loaded, the target HTML file may be loaded by using a browser kernel, and the browser kernel may be loaded by using, for example, a browser kernel built in the terminal device. While loading the target HTML file, a specified variable needs to be inserted into the target container of the target HTML file, so as to complete the display of the target chapter contents in the target HTML file. When inserting the specified variable into the target container of the target HTML file, the specified variable may be inserted into the target container of the target HTML file, such as a div container, using, for example, a script file, such as a js file, and the target container, such as the div container, may be set in the body of the target HTML file, such as a body tag container, etc.
And step S104, performing paging rendering on the content in the designated variable in the target container by using the browser kernel, and completing paging display of the target chapter content in the electronic book.
In the prior art, when an electronic book is displayed, the electronic book is generally rendered by adopting self development software or a third-party plug-in, on one hand, more cost is needed, on the other hand, the electronic book is not suitable for the existing development trend of the electronic book, and more display problems exist.
In this embodiment, content in a specified variable in the target container may be rendered in a paging manner based on a browser kernel built in the terminal device. And when the page rendering is carried out, the browser kernel carries out page rendering according to the layout attribute information of the target HTML file. The layout attribute information can be recorded by utilizing a css (cs cascading style sheet) file, and the content in the specified variable in the target container can be subjected to page rendering by utilizing a browser kernel according to the layout attribute information in the css file, such as column attribute, so that the target chapter content is subjected to page display.
When the page is displayed, the loading condition of the content in the specified variable in the target container can be monitored, the monitoring comprises monitoring the loading condition of the picture element of the content in the specified variable in the target container, and the client is informed whether the loading and displaying of the target chapter content are completed according to whether the loading of the picture element is completed. The monitoring of the loading condition of the picture element includes, for example, monitoring that the picture element is successfully loaded or unsuccessfully loaded, and at this time, when the loading of the picture element is completed, it may be fed back that the content of the current target chapter has been completed with paging loading, and paging page display is performed.
Optionally, when the electronic book is displayed in a paging mode, the marked information in the electronic book can be acquired. The marked information includes, for example, line drawing information including line drawing information for characters in the contents of a target chapter in the electronic book. When the electronic book is displayed in a paging mode, the marked information can be obtained and marked in the electronic book. During labeling, the elements in the corresponding target chapter content need to be labeled according to the labeled information and the layout attribute information of the target HTML file. If the layout attribute information sets that the characters are displayed from the top to the bottom in a vertical row, the corresponding positions of the characters are marked by drawing lines, such as the marks on the right sides of the characters, and the like. The specific label is set according to the implementation situation, and is not limited herein.
According to the electronic book loading and displaying method provided by the invention, the electronic book to be loaded is read, the target chapter to be loaded is determined, and the target HTML file corresponding to the target chapter is obtained; extracting target chapter content corresponding to the target chapter from the target HTML file, and writing the target chapter content into a specified variable of the target HTML file in a character string mode; loading a target HTML file, and inserting a specified variable into a target container of the target HTML file; and performing paging rendering on the content in the specified variable in the target container by utilizing the browser kernel to complete paging display of the content of the target chapter in the electronic book. The method has the advantages that the target chapter content of the electronic books is written into the designated variable of the target HTML file, the browser kernel is used for loading and page rendering, the accuracy and the normalization of page display of the electronic books can be guaranteed, different electronic books can be compatibly processed, the display effect of the electronic books is improved, the display problem of the prior art when the electronic books are displayed is solved, and the cost consumption is reduced.
Example two
Fig. 2 is a schematic flow chart of an electronic book loading and displaying method according to another embodiment of the present invention, as shown in fig. 2, the method includes the following steps:
step S201, reading the electronic book to be loaded, determining the target chapter to be loaded, and acquiring the target HTML file corresponding to the target chapter.
Step S202, extracting the target chapter content corresponding to the target chapter from the target HTML file, and writing the target chapter content into the designated variable of the target HTML file in a character string form.
Step S203, loading the target HTML file and inserting the specified variable into the target container of the target HTML file.
And step S204, performing paging rendering on the content in the specified variable in the target container by using the browser kernel, and completing paging display of the target chapter content in the electronic book.
The above steps refer to the description of steps S101-S104 in the first embodiment of fig. 1, and are not described again here.
Step S205, receiving a page turning request triggered by a user, and performing page turning processing according to the page turning request.
When a user finishes reading a current page and turns pages backwards or forwards, or the user directly clicks a hyperlink of a certain section from a directory page, or the user directly jumps to a certain page according to a bookmark in an electronic book, and the like, the user can receive a page turning request triggered by the user and needs to perform corresponding page turning processing aiming at the page turning request.
Specifically, it is first determined whether the chapter content corresponding to the page turning is located in the target HTML file according to the page turning request, that is, whether the chapter content corresponding to the page turned is already in the current target HTML file. Here, whether the chapter content corresponding to the page turning is located in the target HTML file is determined according to the target chapter content contained in the current target HTML file and the chapter content corresponding to the page turning request. If the page turning request triggered by the user is a page turning request triggered by the last page of the current target HTML file, the chapter content corresponding to page turning can be determined not to be located in the target HTML file; or, if the target chapter content contained in the current target HTML file is the target chapter content of the second chapter, and the chapter content corresponding to the page turning request is the target chapter content of the third chapter, determining that the chapter content corresponding to the page turning is not located in the target HTML file, and the like.
After the chapter content corresponding to the page turning is judged to be located in the target HTML file, the corresponding page number can be calculated according to the page turning identification information carried by the page turning request, and the page turning process is completed by directly skipping to the page number. The page turning identification information includes, for example, reading progress information, bookmark information, labeling information, chapter anchor information, hyperlink information, page number information, and the like. For the reading progress information, the corresponding page number can be obtained by calculating according to the percentage of the reading progress information; for the bookmark information and the label information, the corresponding page number can be obtained by determining the position corresponding to the character and calculating according to the character contained in the bookmark information or the character contained in the label information, and the corresponding page number can also be determined according to the position of the bookmark information or the position of the label information; for the chapter anchor information, the corresponding page number can be directly determined according to the position of the chapter anchor; for the hyperlink information, the page number of the corresponding chapter of the page turning of the hyperlink information can be determined; for the page number information, the corresponding page number or the like can be directly determined. The above are all illustrations, and particularly, when the page number is calculated according to the page turning identification information, the setting may be performed according to an actual implementation situation, which is not limited herein.
After judging that the chapter content corresponding to the page turning is not located in the target HTML file, determining a target chapter to be loaded corresponding to the chapter content corresponding to the page turning according to the page turning request, executing steps S201-S204, reading the target chapter to be loaded corresponding to the page turning in the electronic book, loading and rendering pages of the target chapter, and completing page display of the chapter content corresponding to the page turning. Meanwhile, after loading and page rendering, corresponding page numbers are calculated according to the page turning identification information for positioning, and page turning is carried out to the page numbers corresponding to the page turning requests.
According to the electronic book loading and displaying method provided by the invention, after a target HTML file is displayed in a paging mode, when a page turning request triggered by a user is received, whether chapter content corresponding to page turning is located in the target HTML file or not is judged according to the page turning request, if yes, a corresponding page number is calculated according to page turning identification information carried by the page turning request, and page turning is finished by skipping to the page number; if not, determining a target chapter to be loaded corresponding to the chapter content corresponding to page turning, processing the target chapter to be loaded, and completing paging display of the chapter content corresponding to page turning so as to respond to a page turning request triggered by a user in time. By judging the page turning request, whether a new target chapter to be loaded needs to be loaded again can be quickly determined, and when the new target chapter to be loaded does not need to be loaded, the page can be quickly turned by directly positioning according to the calculated page number; when a new target chapter to be loaded needs to be loaded, the browser kernel is used for loading and page rendering, so that the page display accuracy and normalization of the electronic book are guaranteed, the chapter content is quickly positioned, and the corresponding page turning request is responded and completed.
EXAMPLE III
Fig. 3 is a flowchart illustrating an electronic book loading and displaying method according to another embodiment of the present invention, as shown in fig. 3, the method includes the following steps:
step S301, reading the electronic book to be loaded, determining the target chapter to be loaded, and acquiring the target HTML file corresponding to the target chapter.
Step S302, extracting the target chapter content corresponding to the target chapter from the target HTML file, and writing the target chapter content into the designated variable of the target HTML file in a character string form.
Step S303 loads the target HTML file, and inserts the specified variable into the target container of the target HTML file.
And step S304, performing paging rendering on the content in the designated variable in the target container by using the browser kernel, and completing paging display of the target chapter content in the electronic book.
The above steps refer to the description of steps S101-S104 in the first embodiment of fig. 1, and are not described again here.
Step S305, when the layout attribute information of the target HTML file is monitored to be changed, the reloaded target HTML file is subjected to re-paging processing.
When a user adjusts the layout attribute information of the electronic book, such as adjusting the font display size, the font style, the paragraph display style, the layout format, and the like, the target HTML file after page rendering needs to be re-paged when reloading.
When it is monitored that the layout attribute information of the target HTML file is changed, for the reloaded target HTML file, the page number of the target HTML file before reloading needs to be determined according to the reading progress information of the target HTML file, and the first element of the page corresponding to the page number of the target chapter content is obtained. The elements include text, pictures, etc. The first element of the page number may be a picture or a text, and the text is generally the first text of the page corresponding to the page number (if the target HTML document is displayed from left to right, the first text in the upper left corner).
After determining the first element, the position data of the first element is further determined. The position data is position data of the element in the lateral coordinates of the first coordinate system. The first coordinate system is established by taking the first element position of a first page of a target HTML file displayed by the terminal as an origin. If the leftmost character of the first page of the target HTML file is the origin (according to the first character in the first character node in the target HTML file being the origin, the character node is the node whose content in the container in the target HTML file is the character, i.e., < div > XXXX < div > is the character node), the horizontal coordinate axis is the coordinate axis consistent with the page turning direction of the electronic book, and if the page turning direction is the page turning to the right, the horizontal coordinate axis is the coordinate axis in the left-right direction. The position data of the first element is determined from the lateral coordinates of the first element on the lateral coordinate axes of the first coordinate system. And for the picture with the first element, acquiring the position data of the picture, wherein the position data of the picture can pass through a target HTML file, and acquiring the position data of the picture in the HTML file according to the attribute information of the HTML file. Alternatively, the position data may also be acquired as described above. For the first element being a text, the position data of the text can be obtained in the above manner. Here, the electronic book is displayed in a target HTML file manner, so that the position data of the first element can be conveniently acquired, and the subsequent re-paging processing according to the position data of the first element is also facilitated.
And according to the position data and the layout attribute information of the first element, performing paging rendering again, and determining the page number of the reloaded first element. Specifically, according to the position data x of the first element, the layout attribute information includes, for example, the width y of the displayable element corresponding to the terminal screen, and it is determined that the page number after reloading the first element is rounded up (x/y), so as to obtain the page number after reloading the first element, and complete the re-paging processing of the target HTML file.
According to the electronic book loading and displaying method provided by the invention, when the change of the layout attribute information of the target HTML file is monitored, the re-paging processing is carried out on the newly loaded target HTML file according to the attribute of the target HTML file. The electronic book is displayed by adopting the target HTML file, so that the position data of the first element can be conveniently obtained, the subsequent re-paging processing according to the position data of the first element is also facilitated, and the target HTML file can be quickly and accurately re-paged during re-loading.
Example four
Fig. 4 is a flowchart illustrating an electronic book loading and displaying method according to another embodiment of the present invention, as shown in fig. 4, the method includes the following steps:
step S401, reading the electronic book to be loaded, determining a target chapter to be loaded, and acquiring a target HTML file corresponding to the target chapter.
Step S402, extracting the target chapter content corresponding to the target chapter from the target HTML file, and writing the target chapter content into the designated variable of the target HTML file in a character string manner.
Step S403, load the target HTML file, and insert the specified variable into the target container of the target HTML file.
And S404, performing paging rendering on the content in the designated variable in the target container by using the browser kernel, and completing paging display of the target chapter content in the electronic book.
The above steps refer to the description of steps S101-S104 in the first embodiment of fig. 1, and are not described again here.
In step S405, a plurality of chapter anchors included in the target HTML file are sequentially acquired.
For the problem that a target HTML file contains a plurality of chapter anchors and the chapter anchors are nested, the prior art cannot accurately position the nested chapter anchors and determine the corresponding chapter anchors.
In this embodiment, the method and the device can be applied to a scenario where, when a user reads an electronic book, a corresponding chapter read by the user needs to be marked in a directory. When the target HTML file contains the target chapter contents of a plurality of chapters, the target HTML file contains a plurality of chapter anchors, which results in that the chapter currently read by the user cannot be determined. Therefore, determination of position data for a plurality of chapter anchors is required to determine whether or not chapter contents are within the display range of the terminal screen. Here, it is assumed that the chapter contents that have been read are not in the display range of the terminal screen, and that the chapter contents that are being read or the chapter contents that are located after the chapter contents that are being read are in the display range of the terminal screen.
For a plurality of chapter anchors, a plurality of chapter anchors contained in the target HTML file are sequentially acquired according to the sequence of the chapter anchors. Each chapter anchor has a unique anchor id, and the anchor ids can be stored in a preset array in sequence.
In step S406, anchor point position data of a plurality of chapter anchors is calculated.
For a plurality of chapter anchors, anchor point position data of each chapter anchor is calculated. The anchor point position data is recorded in a second coordinate system. The second coordinate system is established by taking the first element position of the page displayed by the terminal as an origin (for example, the first character of the page displayed by the current terminal is taken as the origin), and the transverse coordinate axis is the coordinate axis consistent with the page turning direction of the electronic book. As shown in fig. 5, a horizontal coordinate axis consistent with the page turning direction of the electronic book is established with the first element of the page displayed by the terminal as the origin.
The anchor point position data is the sum of the position data of the first element of the chapter content to which the chapter anchor belongs and the total width data of all elements of the chapter content to which the chapter anchor belongs. The position data of the first element is position data of the first element in the lateral coordinate of the second coordinate system. As shown in fig. 5, the position data of the first element is located to the left of the origin, and its value is assumed to be-300. And the total width data is coordinate length data occupied by all elements of the chapter contents belonging to the chapter anchor points in the transverse coordinates of the second coordinate system. If all elements in the chapter contents occupy two pages in the horizontal coordinate axis of the second coordinate system as shown in fig. 5, the total width data is 600 from-300 coordinates to 300 coordinates. And calculating anchor point position data of-300 +600 of 300. Here, the anchor position data may indicate whether chapter contents of a chapter to which the chapter anchor belongs are within a display range of the terminal screen. As shown in fig. 5, the anchor point position data of the chapter anchor in the figure is 300, which is greater than 0, and as shown in fig. 5, part of the content of the chapter to which the chapter anchor belongs is located on the page displayed by the terminal, that is, the chapter content of the chapter to which the chapter anchor belongs is located in the display range of the terminal screen. And calculating the position data of the anchor points of the plurality of chapter anchors according to the mode. When the anchor position data is greater than or equal to 0, the chapter content of the chapter to which the chapter anchor belongs is indicated to be within the display range of the terminal screen, and when the anchor position data is less than 0, namely, when the anchor position data is a negative value, the chapter content of the chapter to which the chapter anchor belongs is considered not to be within the display range of the terminal screen.
Step S407, performing reverse traversal on the anchor position data of the plurality of chapter anchors according to the chapter anchor sequence until determining the first chapter anchor whose anchor position data is a negative value.
And performing reverse-order traversal on the anchor point position data of the plurality of chapter anchor points according to the chapter anchor point sequence, namely sequentially traversing from the last chapter anchor point forward, judging whether the value of the anchor point position data of each chapter is a negative value, namely judging whether the chapter content of the chapter to which each chapter anchor point belongs is not in the display range of the terminal screen, and finding the first chapter anchor point of which the anchor point position data is a negative value, namely finding the chapter anchor point of which the first chapter content is not in the display range of the terminal screen.
Step S408, judging whether the position data of the first element of the content of the chapter of the next chapter anchor of the chapter anchor is a negative value.
After the first chapter anchor point with the anchor point position data being a negative value is determined, if the first chapter anchor point with the anchor point position data being a negative value is the chapter anchor point of chapter 4, that is, the chapter content of chapter 4 is not in the display range of the terminal screen, the chapter content of chapter 5 is in the display range of the terminal screen, it is further necessary to determine whether the position data of the first element of the chapter content of the chapter anchor point of the next chapter of the chapter anchor point is a negative value. That is, the position data of the first element of the chapter anchor of chapter 5 is determined, whether the lateral coordinate of the first element of the chapter anchor of chapter 5 in the second coordinate system is a negative value is determined, when the lateral coordinate of the first element of the chapter anchor of chapter 5 in the second coordinate system is determined to be a negative value, it is determined that the first element of chapter 5 is not in the page displayed by the terminal, but the chapter 5 is in the display range of the terminal screen, which indicates that the user is currently reading chapter 5, it is determined that chapter 5 is the target chapter, and step S409 is executed. When it is determined that the lateral coordinate of the first element of the chapter anchor point of chapter 5 in the second coordinate system is not a negative value, it indicates that some elements in the chapter content of chapter 4 still remain in the page displayed by the terminal, i.e., the chapter 4 is currently being read by the user, and then the chapter 4 is determined to be the target chapter, and step S410 is executed.
Step S409, the chapter where the next chapter anchor is located is taken as the target chapter.
And if the position data of the first element of the content of the chapter to which the anchor point of the next chapter of the anchor point of the chapter is judged to be a negative value, taking the chapter to which the anchor point of the next chapter as the target chapter.
In step S410, the chapter where the chapter anchor is located is taken as the target chapter.
And if the position data of the first element of the content of the chapter of the next chapter anchor of the chapter anchor is judged not to be a negative value, taking the chapter of the chapter anchor as a target chapter.
In step S411, the target chapter is marked.
The marking process for the target chapter includes, for example, marking a red font, setting it to a reading state, and the like.
Further, in this embodiment, if the anchor position data of the plurality of chapter anchors are traversed in the reverse order according to the chapter anchor sequence and no negative chapter anchor is found, the chapter where the first chapter anchor is located is taken as the target chapter, and the marking processing is performed, that is, all chapters are located in the display range of the terminal screen, and reading is started from the first chapter.
In this embodiment, the method can be applied to a scenario where, when a user is reading an electronic book, a corresponding chapter read by the user needs to be marked in a directory. When the chapter currently read by the user is judged to be chapter 4, that is, the target chapter is chapter 4, the information of chapter 4 in the directory is marked as the reading state.
According to the electronic book loading and displaying method provided by the invention, the problem that a plurality of chapter anchors are nested in a target HTML file can be effectively solved, and the chapter content where the chapter anchors are located is determined to be in the display range of a terminal screen by calculating the anchor position data of the chapter anchors. And performing reverse-order traversal on the anchor position data of the plurality of chapter anchors according to the chapter anchor sequence, determining the first chapter anchor which is not in the display range of the terminal screen, and judging the next chapter anchor of the chapter anchor so as to accurately obtain the target chapter anchor and finish marking the target chapter anchor.
EXAMPLE five
An embodiment five of the present application provides a non-volatile computer storage medium, where the computer storage medium stores at least one executable instruction, and the computer executable instruction may execute the electronic book loading and displaying method in any of the above method embodiments.
The executable instructions may be specifically configured to cause the processor to:
reading, namely reading the electronic book to be loaded, determining a target chapter to be loaded, and acquiring a target HTML file corresponding to the target chapter; a writing step, namely extracting target chapter content corresponding to a target chapter from a target HTML file, and writing the target chapter content into a specified variable of the target HTML file in a character string mode; a loading step, loading a target HTML file, and inserting a specified variable into a target container of the target HTML file; and paging, namely paging and rendering contents in the designated variables in the target container by utilizing the browser kernel to complete paging display of the contents of the target chapters in the electronic book.
In an alternative embodiment, the executable instructions further cause the processor to: reading an electronic book to be loaded and reading identification information; and calculating to obtain the corresponding target chapter to be loaded according to the reading identification information.
In an alternative embodiment, the executable instructions further cause the processor to: loading a target HTML file by utilizing a browser kernel; using the script file, the specified variables are inserted into the target container of the target HTML file.
In an alternative embodiment, the executable instructions further cause the processor to: performing page rendering on the content in the specified variable in the target container by using a browser kernel according to the layout attribute information of the target HTML file; monitoring the loading condition of the content in the specified variable in the target container to complete the paging display of the target chapter content in the electronic book; the listening includes listening for loading of picture elements of content in specified variables in the target container.
In an alternative embodiment, the executable instructions further cause the processor to: and acquiring a style file of the electronic book, and inserting the style file into the head of the target HTML file.
In an alternative embodiment, the executable instructions further cause the processor to: and receiving a page turning request triggered by a user, and performing page turning processing according to the page turning request.
In an alternative embodiment, the executable instructions further cause the processor to: judging whether the chapter content corresponding to page turning is located in the target HTML file or not according to the page turning request; if so, calculating a corresponding page number according to page turning identification information carried by the page turning request, and skipping to the page number to complete page turning processing; if not, determining the target chapter to be loaded corresponding to the chapter content corresponding to the page turning, and executing the writing step, the loading step and the paging step to complete paging display of the chapter content corresponding to the page turning.
In an alternative embodiment, the page turning identification information includes reading progress information, bookmark information, annotation information, chapter anchor information, hyperlink information, and/or page number information.
In an alternative embodiment, the executable instructions further cause the processor to: and when the change of the layout attribute information of the target HTML file is monitored, performing re-paging processing on the reloaded target HTML file.
In an alternative embodiment, the executable instructions further cause the processor to: determining the page number of the target HTML file before reloading according to the reading progress information, and acquiring a first element of the target chapter content on a page corresponding to the page number; the elements comprise characters and/or pictures; determining location data for the first element; the position data is the position data of the transverse coordinate of the element in the first coordinate system; a first coordinate system is established by taking the first element position of a first page of a target HTML file displayed by a terminal as an origin, and a transverse coordinate axis is a coordinate axis consistent with the page turning direction of the electronic book; and performing paging rendering again according to the position data and the layout attribute information of the first element, and determining the page number of the reloaded first element to finish the re-paging processing of the target HTML file.
In an alternative embodiment, the executable instructions further cause the processor to: and acquiring a target HTML file corresponding to a target chapter containing at least one chapter.
In an alternative embodiment, the executable instructions further cause the processor to: acquiring a plurality of chapter anchors contained in a target HTML file in sequence; calculating anchor point position data of a plurality of chapter anchor points; the anchor point position data is the sum of the position data of the first element of the chapter content to which the chapter anchor point belongs and the total width data of all elements of the chapter content to which the chapter anchor point belongs; the position data of the first element is the position data of the transverse coordinate of the first element in the second coordinate system; the total width data is coordinate length data occupied by transverse coordinates of all elements in a second coordinate system; a second coordinate system is established by taking the first element position of a page displayed by the terminal as an origin, and a transverse coordinate axis is a coordinate axis consistent with the page turning direction of the electronic book; performing reverse-order traversal on the anchor position data of the plurality of chapter anchors according to the chapter anchor sequence until the first chapter anchor with the anchor position data being negative is determined; judging whether the position data of the first element of the chapter content of the next chapter anchor of the chapter anchor is a negative value; if so, taking the chapter where the anchor point of the next chapter as a target chapter; if not, taking the chapter where the chapter anchor point is as a target chapter; and marking the target chapter.
In an alternative embodiment, the executable instructions further cause the processor to: acquiring marked information in the electronic book; the marked information comprises marking information; and marking the elements in the corresponding target chapter content according to the marked information and the layout attribute information of the target HTML file.
In an alternative embodiment, the ebook is an epub book.
EXAMPLE six
Fig. 6 is a schematic structural diagram of an electronic device according to a sixth embodiment of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the electronic device.
As shown in fig. 6, the electronic device may include: a processor (processor)602, a communication Interface 604, a memory 606, and a communication bus 608.
Wherein:
the processor 602, communication interface 604, and memory 606 communicate with one another via a communication bus 608.
A communication interface 604 for communicating with network elements of other devices, such as clients or other servers.
The processor 602 is configured to execute the program 610, and may specifically execute relevant steps in the above-described electronic book loading display method embodiment.
In particular, program 610 may include program code comprising computer operating instructions.
The processor 602 may be a central processing unit CPU or an application Specific Integrated circuit asic or one or more Integrated circuits configured to implement embodiments of the present invention. The server comprises one or more processors, which can be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 606 for storing a program 610. Memory 606 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 610 may specifically be configured to cause the processor 602 to perform the following operations: reading, namely reading the electronic book to be loaded, determining a target chapter to be loaded, and acquiring a target HTML file corresponding to the target chapter; a writing step, namely extracting target chapter content corresponding to a target chapter from a target HTML file, and writing the target chapter content into a specified variable of the target HTML file in a character string mode; a loading step, loading a target HTML file, and inserting a specified variable into a target container of the target HTML file; and paging, namely paging and rendering contents in the designated variables in the target container by utilizing the browser kernel to complete paging display of the contents of the target chapters in the electronic book.
In an alternative embodiment, the program 610 is configured to cause the processor 602 to read the ebook to be loaded and read the identification information; and calculating to obtain the corresponding target chapter to be loaded according to the reading identification information.
In an alternative embodiment, program 610 is operative to cause processor 602 to load a target HTML file using a browser kernel; using the script file, the specified variables are inserted into the target container of the target HTML file.
In an alternative embodiment, the program 610 is configured to enable the processor 602 to perform page rendering on the content in the specified variable in the target container by using the browser kernel according to the layout attribute information of the target HTML file; monitoring the loading condition of the content in the specified variable in the target container to complete the paging display of the target chapter content in the electronic book; the listening includes listening for loading of picture elements of content in specified variables in the target container.
In an alternative embodiment, program 610 is configured to cause processor 602 to retrieve a style file for an ebook and insert the style file into the header of a target HTML file.
In an alternative embodiment, the program 610 is configured to enable the processor 602 to receive a page turning request triggered by a user, and perform a page turning process according to the page turning request.
In an alternative embodiment, the program 610 is configured to enable the processor 602 to determine whether chapter content corresponding to page turning is located in a target HTML file according to a page turning request; if so, calculating a corresponding page number according to page turning identification information carried by the page turning request, and skipping to the page number to complete page turning processing; if not, determining the target chapter to be loaded corresponding to the chapter content corresponding to the page turning, and executing the writing step, the loading step and the paging step to complete paging display of the chapter content corresponding to the page turning.
In an alternative embodiment, the page turning identification information includes reading progress information, bookmark information, annotation information, chapter anchor information, hyperlink information, and/or page number information.
In an alternative embodiment, the program 610 is configured to enable the processor 602 to perform a re-paging process on the reloaded target HTML file after detecting that the layout attribute information of the target HTML file is changed.
In an alternative embodiment, the program 610 is configured to enable the processor 602 to determine, according to the reading progress information, a page number before the target HTML file is reloaded, and obtain a first element of the target chapter content on a page corresponding to the page number; the elements comprise characters and/or pictures; determining location data for the first element; the position data is the position data of the transverse coordinate of the element in the first coordinate system; a first coordinate system is established by taking the first element position of a first page of a target HTML file displayed by a terminal as an origin, and a transverse coordinate axis is a coordinate axis consistent with the page turning direction of the electronic book; and performing paging rendering again according to the position data and the layout attribute information of the first element, and determining the page number of the reloaded first element to finish the re-paging processing of the target HTML file.
In an alternative embodiment, program 610 is configured to cause processor 602 to obtain a target HTML file corresponding to a target chapter that includes at least one chapter.
In an alternative embodiment, the program 610 is configured to cause the processor 602 to sequentially acquire a plurality of chapter anchors included in the target HTML file; calculating anchor point position data of a plurality of chapter anchor points; the anchor point position data is the sum of the position data of the first element of the chapter content to which the chapter anchor point belongs and the total width data of all elements of the chapter content to which the chapter anchor point belongs; the position data of the first element is the position data of the transverse coordinate of the first element in the second coordinate system; the total width data is coordinate length data occupied by transverse coordinates of all elements in a second coordinate system; a second coordinate system is established by taking the first element position of a page displayed by the terminal as an origin, and a transverse coordinate axis is a coordinate axis consistent with the page turning direction of the electronic book; performing reverse-order traversal on the anchor position data of the plurality of chapter anchors according to the chapter anchor sequence until the first chapter anchor with the anchor position data being negative is determined; judging whether the position data of the first element of the chapter content of the next chapter anchor of the chapter anchor is a negative value; if so, taking the chapter where the anchor point of the next chapter as a target chapter; if not, taking the chapter where the chapter anchor point is as a target chapter; and marking the target chapter.
In an alternative embodiment, the program 610 is configured to enable the processor 602 to obtain labeled information in an electronic book; the marked information comprises marking information; and marking the elements in the corresponding target chapter content according to the marked information and the layout attribute information of the target HTML file.
In an alternative embodiment, the ebook is an epub book.
For specific implementation of each step in the program 610, reference may be made to the corresponding description in the corresponding step in the above-mentioned electronic book loading display embodiment, which is not described herein again. It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described devices and modules may refer to the corresponding process descriptions in the foregoing method embodiments, and are not described herein again.
By the scheme provided by the embodiment, the electronic book to be loaded is read, the target chapter to be loaded is determined, and the target HTML file corresponding to the target chapter is obtained; extracting target chapter content corresponding to the target chapter from the target HTML file, and writing the target chapter content into a specified variable of the target HTML file in a character string mode; loading a target HTML file, and inserting a specified variable into a target container of the target HTML file; and performing paging rendering on the content in the specified variable in the target container by utilizing the browser kernel to complete paging display of the content of the target chapter in the electronic book. The method has the advantages that the target chapter content of the electronic books is written into the designated variable of the target HTML file, the browser kernel is used for loading and page rendering, the accuracy and the normalization of page display of the electronic books can be guaranteed, different electronic books can be compatibly processed, the display effect of the electronic books is improved, the display problem of the prior art when the electronic books are displayed is solved, and the cost consumption is reduced.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the claims, any of the claimed embodiments may be used in any combination.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.

Claims (39)

1. An electronic book loading display method, comprising:
reading, namely reading an electronic book to be loaded, determining a target chapter to be loaded, and acquiring a target HTML file corresponding to the target chapter;
a writing step, namely extracting target chapter content corresponding to the target chapter from the target HTML file, and writing the target chapter content into a specified variable of the target HTML file in a character string mode;
a loading step, loading the target HTML file, and inserting the specified variable into a target container of the target HTML file;
paging, namely paging and rendering contents in a specified variable in a target container by utilizing a browser kernel according to the layout attribute information of the target HTML file; monitoring the loading condition of the content in the specified variable in the target container to complete the paging display of the target chapter content in the electronic book; the monitoring includes monitoring loading of picture elements of content in specified variables in the target container.
2. The method of claim 1, wherein the reading step further comprises:
reading an electronic book to be loaded and reading identification information;
and calculating to obtain the corresponding target chapter to be loaded according to the reading identification information.
3. The method of claim 1, wherein the loading step further comprises:
loading the target HTML file by utilizing a browser kernel;
and inserting the specified variable into a target container of the target HTML file by using a script file.
4. The method of any of claims 1-3, wherein the writing step further comprises:
and acquiring a style file of the electronic book, and inserting the style file into the head of the target HTML file.
5. The method according to any one of claims 1-3, wherein the method further comprises:
and receiving a page turning request triggered by a user, and performing page turning processing according to the page turning request.
6. The method according to claim 5, wherein the receiving a page turning request triggered by a user, and the page turning processing according to the page turning request further comprises:
judging whether chapter content corresponding to page turning is located in the target HTML file or not according to the page turning request;
if so, calculating a corresponding page number according to page turning identification information carried by the page turning request, and skipping to the page number to complete page turning processing;
and if not, determining a target chapter to be loaded corresponding to the chapter content corresponding to the page turning, and executing the writing step, the loading step and the paging step to complete paging display of the chapter content corresponding to the page turning.
7. The method of claim 6, wherein the page turning identification information includes reading progress information, bookmark information, annotation information, chapter anchor information, hyperlink information, and/or page number information.
8. The method according to any one of claims 1-3, wherein the method further comprises:
and when the layout attribute information of the target HTML file is monitored to be changed, performing re-paging processing on the reloaded target HTML file.
9. The method of claim 8, wherein the re-paging the reloaded target HTML file after monitoring that the layout attribute information of the target HTML file is changed further comprises:
determining the page number of the target HTML file before reloading according to the reading progress information, and acquiring a first element of the target chapter content on a page corresponding to the page number; the elements comprise words and/or pictures;
determining location data for the first element; the position data is the position data of the transverse coordinate of the element in the first coordinate system; the first coordinate system is established by taking the first element position of a first page of a target HTML file displayed by the terminal as an origin, and the transverse coordinate axis is the coordinate axis consistent with the page turning direction of the electronic book;
and performing paging rendering again according to the position data and the layout attribute information of the first element, and determining the page number of the reloaded first element so as to complete the re-paging processing of the target HTML file.
10. The method of any of claims 1-3, wherein the reading step further comprises:
and acquiring a target HTML file corresponding to a target chapter containing at least one chapter.
11. The method according to any one of claims 1-3, wherein the method further comprises:
acquiring a plurality of chapter anchors contained in a target HTML file in sequence;
calculating anchor point position data of a plurality of chapter anchor points; the anchor point position data is the sum of the position data of the first element of the chapter content to which the chapter anchor point belongs and the total width data of all elements of the chapter content to which the chapter anchor point belongs; the position data of the first element is the position data of the transverse coordinate of the first element in a second coordinate system; the total width data is coordinate length data occupied by transverse coordinates of all elements in a second coordinate system; the second coordinate system is established by taking the first element position of the page displayed by the terminal as an origin, and the transverse coordinate axis is the coordinate axis consistent with the page turning direction of the electronic book;
performing reverse-order traversal on the anchor position data of the plurality of chapter anchors according to the chapter anchor sequence until a first chapter anchor with the anchor position data being a negative value is determined;
judging whether the position data of the first element of the chapter content of the next chapter anchor of the chapter anchor is a negative value;
if so, taking the chapter where the anchor point of the next chapter as a target chapter;
if not, taking the chapter where the chapter anchor point is as a target chapter;
and marking the target chapter.
12. The method according to any one of claims 1-3, wherein the method further comprises:
acquiring marked information in the electronic book; the marked information comprises marking information;
and marking the elements in the corresponding target chapter content according to the marked information and the layout attribute information of the target HTML file.
13. The method of any one of claims 1-3, wherein the Ebook is an epub book.
14. An electronic device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is configured to store at least one executable instruction that causes the processor to:
reading, namely reading an electronic book to be loaded, determining a target chapter to be loaded, and acquiring a target HTML file corresponding to the target chapter;
a writing step, namely extracting target chapter content corresponding to the target chapter from the target HTML file, and writing the target chapter content into a specified variable of the target HTML file in a character string mode;
a loading step, loading the target HTML file, and inserting the specified variable into a target container of the target HTML file;
paging, namely paging and rendering contents in a specified variable in a target container by utilizing a browser kernel according to the layout attribute information of the target HTML file; monitoring the loading condition of the content in the specified variable in the target container to complete the paging display of the target chapter content in the electronic book; the monitoring includes monitoring loading of picture elements of content in specified variables in the target container.
15. The electronic device of claim 14, the executable instructions further cause the processor to:
reading an electronic book to be loaded and reading identification information;
and calculating to obtain the corresponding target chapter to be loaded according to the reading identification information.
16. The electronic device of claim 14, the executable instructions further cause the processor to:
loading the target HTML file by utilizing a browser kernel;
and inserting the specified variable into a target container of the target HTML file by using a script file.
17. The electronic device of any of claims 14-16, the executable instructions further cause the processor to:
and acquiring a style file of the electronic book, and inserting the style file into the head of the target HTML file.
18. The electronic device of any of claims 14-16, the executable instructions further cause the processor to:
and receiving a page turning request triggered by a user, and performing page turning processing according to the page turning request.
19. The electronic device of claim 18, wherein the executable instructions further cause the processor to:
judging whether chapter content corresponding to page turning is located in the target HTML file or not according to the page turning request;
if so, calculating a corresponding page number according to page turning identification information carried by the page turning request, and skipping to the page number to complete page turning processing;
and if not, determining a target chapter to be loaded corresponding to the chapter content corresponding to the page turning, and executing the writing step, the loading step and the paging step to complete paging display of the chapter content corresponding to the page turning.
20. The electronic device of claim 19, wherein the page flip identification information comprises reading progress information, bookmark information, annotation information, chapter anchor information, hyperlink information, and/or page number information.
21. The electronic device of any of claims 14-16, the executable instructions further cause the processor to:
and when the layout attribute information of the target HTML file is monitored to be changed, performing re-paging processing on the reloaded target HTML file.
22. The electronic device of claim 21, the executable instructions further cause the processor to:
determining the page number of the target HTML file before reloading according to the reading progress information, and acquiring a first element of the target chapter content on a page corresponding to the page number; the elements comprise words and/or pictures;
determining location data for the first element; the position data is the position data of the transverse coordinate of the element in the first coordinate system; the first coordinate system is established by taking the first element position of a first page of a target HTML file displayed by the terminal as an origin, and the transverse coordinate axis is the coordinate axis consistent with the page turning direction of the electronic book;
and performing paging rendering again according to the position data and the layout attribute information of the first element, and determining the page number of the reloaded first element so as to complete the re-paging processing of the target HTML file.
23. The electronic device of any of claims 14-16, the executable instructions further cause the processor to:
and acquiring a target HTML file corresponding to a target chapter containing at least one chapter.
24. The electronic device of any of claims 14-16, the executable instructions further cause the processor to:
acquiring a plurality of chapter anchors contained in a target HTML file in sequence;
calculating anchor point position data of a plurality of chapter anchor points; the anchor point position data is the sum of the position data of the first element of the chapter content to which the chapter anchor point belongs and the total width data of all elements of the chapter content to which the chapter anchor point belongs; the position data of the first element is the position data of the transverse coordinate of the first element in a second coordinate system; the total width data is coordinate length data occupied by transverse coordinates of all elements in a second coordinate system; the second coordinate system is established by taking the first element position of the page displayed by the terminal as an origin, and the transverse coordinate axis is the coordinate axis consistent with the page turning direction of the electronic book;
performing reverse-order traversal on the anchor position data of the plurality of chapter anchors according to the chapter anchor sequence until a first chapter anchor with the anchor position data being a negative value is determined;
judging whether the position data of the first element of the chapter content of the next chapter anchor of the chapter anchor is a negative value;
if so, taking the chapter where the anchor point of the next chapter as a target chapter;
if not, taking the chapter where the chapter anchor point is as a target chapter;
and marking the target chapter.
25. The electronic device of any of claims 14-16, the executable instructions further cause the processor to:
acquiring marked information in the electronic book; the marked information comprises marking information;
and marking the elements in the corresponding target chapter content according to the marked information and the layout attribute information of the target HTML file.
26. The electronic device of any one of claims 14-16, the ebook being an epub book.
27. A computer storage medium having at least one executable instruction stored therein, the executable instruction causing a processor to:
reading, namely reading an electronic book to be loaded, determining a target chapter to be loaded, and acquiring a target HTML file corresponding to the target chapter;
a writing step, namely extracting target chapter content corresponding to the target chapter from the target HTML file, and writing the target chapter content into a specified variable of the target HTML file in a character string mode;
a loading step, loading the target HTML file, and inserting the specified variable into a target container of the target HTML file;
paging, namely paging and rendering contents in a specified variable in a target container by utilizing a browser kernel according to the layout attribute information of the target HTML file; monitoring the loading condition of the content in the specified variable in the target container to complete the paging display of the target chapter content in the electronic book; the monitoring includes monitoring loading of picture elements of content in specified variables in the target container.
28. The computer storage medium of claim 27, the executable instructions further causing the processor to:
reading an electronic book to be loaded and reading identification information;
and calculating to obtain the corresponding target chapter to be loaded according to the reading identification information.
29. The computer storage medium of claim 27, the executable instructions further causing the processor to:
loading the target HTML file by utilizing a browser kernel;
and inserting the specified variable into a target container of the target HTML file by using a script file.
30. The computer storage medium of any of claims 27-29, the executable instructions further causing the processor to:
and acquiring a style file of the electronic book, and inserting the style file into the head of the target HTML file.
31. The computer storage medium of any of claims 27-29, the executable instructions further causing the processor to:
and receiving a page turning request triggered by a user, and performing page turning processing according to the page turning request.
32. The computer storage medium of claim 31, wherein the executable instructions further cause the processor to:
judging whether chapter content corresponding to page turning is located in the target HTML file or not according to the page turning request;
if so, calculating a corresponding page number according to page turning identification information carried by the page turning request, and skipping to the page number to complete page turning processing;
and if not, determining a target chapter to be loaded corresponding to the chapter content corresponding to the page turning, and executing the writing step, the loading step and the paging step to complete paging display of the chapter content corresponding to the page turning.
33. The computer storage medium of claim 32, wherein the page turn identification information comprises reading progress information, bookmark information, annotation information, chapter anchor information, hyperlink information, and/or page number information.
34. The computer storage medium of any of claims 27-29, the executable instructions further causing the processor to:
and when the layout attribute information of the target HTML file is monitored to be changed, performing re-paging processing on the reloaded target HTML file.
35. The computer storage medium of claim 34, the executable instructions further causing the processor to:
determining the page number of the target HTML file before reloading according to the reading progress information, and acquiring a first element of the target chapter content on a page corresponding to the page number; the elements comprise words and/or pictures;
determining location data for the first element; the position data is the position data of the transverse coordinate of the element in the first coordinate system; the first coordinate system is established by taking the first element position of a first page of a target HTML file displayed by the terminal as an origin, and the transverse coordinate axis is the coordinate axis consistent with the page turning direction of the electronic book;
and performing paging rendering again according to the position data and the layout attribute information of the first element, and determining the page number of the reloaded first element so as to complete the re-paging processing of the target HTML file.
36. The computer storage medium of any of claims 27-29, the executable instructions further causing the processor to:
and acquiring a target HTML file corresponding to a target chapter containing at least one chapter.
37. The computer storage medium of any of claims 27-29, the executable instructions further causing the processor to:
acquiring a plurality of chapter anchors contained in a target HTML file in sequence;
calculating anchor point position data of a plurality of chapter anchor points; the anchor point position data is the sum of the position data of the first element of the chapter content to which the chapter anchor point belongs and the total width data of all elements of the chapter content to which the chapter anchor point belongs; the position data of the first element is the position data of the transverse coordinate of the first element in a second coordinate system; the total width data is coordinate length data occupied by transverse coordinates of all elements in a second coordinate system; the second coordinate system is established by taking the first element position of the page displayed by the terminal as an origin, and the transverse coordinate axis is the coordinate axis consistent with the page turning direction of the electronic book;
performing reverse-order traversal on the anchor position data of the plurality of chapter anchors according to the chapter anchor sequence until a first chapter anchor with the anchor position data being a negative value is determined;
judging whether the position data of the first element of the chapter content of the next chapter anchor of the chapter anchor is a negative value;
if so, taking the chapter where the anchor point of the next chapter as a target chapter;
if not, taking the chapter where the chapter anchor point is as a target chapter;
and marking the target chapter.
38. The computer storage medium of any of claims 27-29, the executable instructions further causing the processor to:
acquiring marked information in the electronic book; the marked information comprises marking information;
and marking the elements in the corresponding target chapter content according to the marked information and the layout attribute information of the target HTML file.
39. The computer storage medium of any one of claims 27-29, the ebook being an epub book.
CN202010235644.4A 2020-03-30 2020-03-30 Electronic book loading display method, electronic equipment and storage medium Active CN111460345B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010235644.4A CN111460345B (en) 2020-03-30 2020-03-30 Electronic book loading display method, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010235644.4A CN111460345B (en) 2020-03-30 2020-03-30 Electronic book loading display method, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111460345A CN111460345A (en) 2020-07-28
CN111460345B true CN111460345B (en) 2021-01-22

Family

ID=71683326

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010235644.4A Active CN111460345B (en) 2020-03-30 2020-03-30 Electronic book loading display method, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111460345B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112486398B (en) * 2020-12-18 2022-05-20 掌阅科技股份有限公司 Method for realizing page turning effect of handwriting, electronic equipment and storage medium
CN113946774B (en) * 2021-10-26 2022-04-08 掌阅科技股份有限公司 Book webpage skipping method, computing device and computer storage medium
CN114442897B (en) * 2021-12-24 2023-12-15 北京幻想纵横网络技术有限公司 Text processing method and device, electronic equipment and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
ES2328924T3 (en) * 2003-10-15 2009-11-19 Canon Kabushiki Kaisha PREVISUALIZATION AND SELECTIVE REVIEW OF DOCUMENTS OR SCHEMES CONTAINING VARIABLE DATA.
US9563714B2 (en) * 2011-06-16 2017-02-07 Microsoft Technology Licensing Llc. Mapping selections between a browser and the original file fetched from a web server
CN102945287B (en) * 2012-11-29 2015-09-09 南京睿恒智晟软件科技有限公司 JSP data automatic paging JSTL stamp methods
CN103336794B (en) * 2013-06-09 2018-07-06 百度在线网络技术(北京)有限公司 For providing the corresponding method and apparatus that information is presented in target pages
CN103761277A (en) * 2014-01-09 2014-04-30 北京掌阔技术有限公司 ePub electronic book loading method and system
CN104915461B (en) * 2015-07-10 2017-03-22 广州神马移动信息科技有限公司 Page presentation method and device

Also Published As

Publication number Publication date
CN111460345A (en) 2020-07-28

Similar Documents

Publication Publication Date Title
CN111460345B (en) Electronic book loading display method, electronic equipment and storage medium
CN103678631A (en) Page rendering method and device
CN112380824B (en) PDF document processing method, device, equipment and storage medium for automatically identifying columns
CN113961794A (en) Book recommendation method and device, computer equipment and storage medium
US20080282148A1 (en) Processing method for increasing speed of opening a word processing document
CN110969000B (en) Data merging processing method and device
CN112861481B (en) Paging processing method, paging processing device, electronic equipment and computer readable storage medium
US20140223291A1 (en) System and method for restructuring content on reorientation of a mobile device
CN111460764B (en) Electronic book labeling method, electronic equipment and storage medium
CN111914198A (en) Method, system and electronic equipment for realizing browser compatibility
CN109977873B (en) Handwriting-based note generation method, electronic equipment and storage medium
CN111460765A (en) Electronic book labeling processing method, electronic equipment and storage medium
CN109992182B (en) Electronic book batch page turning method, electronic equipment and computer storage medium
CN113177392B (en) Method for synchronizing row segment information in proofreading interface, computing device and storage medium
CN107766228B (en) Multi-language-based automatic testing method and device
JP5706306B2 (en) Method of rendering an electronic document with linked text boxes, computer readable storage medium and system including instructions for rendering
CN113934949B (en) Information page display method, electronic equipment and computer storage medium
CN113885763A (en) Electronic book page display method, electronic equipment and computer storage medium
EP1605366A1 (en) Data processing apparatus, data processing method, data processing program, and recording medium having recorded therein that program
CN105512100A (en) Layout analysis method and device
CN104572606A (en) E-book processing method and device
CN109857302B (en) Electronic book information repairing method, electronic equipment and computer storage medium
CN117032530A (en) Book detail page display method, electronic equipment and computer storage medium
CN112906347B (en) Character typesetting method, electronic equipment and storage medium
CN114217709B (en) Page display method, reader and computer 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
GR01 Patent grant
GR01 Patent grant