CN114564665A - Electronic book typesetting style adapting method, device, equipment and storage medium - Google Patents

Electronic book typesetting style adapting method, device, equipment and storage medium Download PDF

Info

Publication number
CN114564665A
CN114564665A CN202210187575.3A CN202210187575A CN114564665A CN 114564665 A CN114564665 A CN 114564665A CN 202210187575 A CN202210187575 A CN 202210187575A CN 114564665 A CN114564665 A CN 114564665A
Authority
CN
China
Prior art keywords
electronic book
identifier
browser
standard
style
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210187575.3A
Other languages
Chinese (zh)
Inventor
于刚
孙上斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhangyue Technology Co Ltd
Original Assignee
Zhangyue 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 Zhangyue Technology Co Ltd filed Critical Zhangyue Technology Co Ltd
Priority to CN202210187575.3A priority Critical patent/CN114564665A/en
Publication of CN114564665A publication Critical patent/CN114564665A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/106Display of layout of documents; Previewing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/109Font handling; Temporal or kinetic typography

Abstract

The disclosure relates to a method, a device, equipment and a storage medium for adapting typesetting style of an electronic book. Receiving a first reading request sent by a browser, wherein the first reading request comprises a first identifier of an electronic book and a second identifier of the browser; searching and obtaining a target electronic book file corresponding to the first identifier from the electronic book files corresponding to the browser based on the first identifier and the second identifier, wherein the typesetting style of the browser contained in the target electronic book file is the same as the standard typesetting style of the electronic book; the target electronic book file is sent to the browser, so that the browser displays the electronic book in a standard typesetting style, the typesetting style of the electronic book can be adapted to different browsers, the display effect of the typesetting style of the electronic book in the browser is the same as that in electronic book reading application, and the reading experience of a user is improved.

Description

Electronic book typesetting style adapting method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for adapting a typesetting style of an electronic book.
Background
With the continuous development of science and technology and society, the electronic book gradually replaces the traditional paper book, and various electronic products such as smart phones, tablet computers, electronic readers and the like support the installation of electronic reading applications and have the electronic book reading function. Epub is a formal standard of International Digital Publishing Forum (IDPF), and is a mainstream format of an electronic book because Epub supports various complex typesetting and is adaptive to a device screen.
At present, in order to provide more convenient electronic reading, many electronic book manufacturers develop an electronic book reading application of the manufacturers and an Epub electronic book matched with the electronic book reading application of the manufacturers, the electronic book reading application can display the typesetting styles of the Epub electronic book, if the Epub electronic book of the manufacturers is placed in a browser for display, some typesetting styles cannot be displayed by the browser, so that the display effect of some typesetting styles of the Epub electronic book in the electronic book reading application of the manufacturers is good, but the display effect in the browser is poor.
Disclosure of Invention
In order to solve the technical problem, the present disclosure provides a method, an apparatus, a device and a storage medium for adapting a typesetting style of an electronic book.
A first aspect of the disclosed embodiments provides an electronic book layout style adaptation method, including:
receiving a first reading request sent by a browser, wherein the first reading request comprises a first identifier of an electronic book and a second identifier of the browser;
searching and obtaining a target electronic book file corresponding to the first identifier from the electronic book files corresponding to the browser based on the first identifier and the second identifier, wherein the typesetting style of the browser contained in the target electronic book file is the same as the standard typesetting style of the electronic book;
and sending the target electronic book file to the browser so that the browser displays the electronic book in a standard typesetting style.
A second aspect of the embodiments of the present disclosure provides an apparatus for adapting a layout style of an electronic book, the apparatus including:
the receiving module is used for receiving a first reading request sent by the browser, wherein the first reading request comprises a first identifier of an electronic book and a second identifier of the browser;
the searching module is used for searching and obtaining a target electronic book file corresponding to the first identifier from the electronic book file corresponding to the browser based on the first identifier and the second identifier, wherein the typesetting style of the browser contained in the target electronic book file is the same as the standard typesetting style of the electronic book;
and the sending module is used for sending the target electronic book file to the browser so that the browser displays the electronic book in a standard typesetting style.
A third aspect of the embodiments of the present disclosure provides a computer device, which includes a memory and a processor, where the memory stores a computer program, and when the computer program is executed by the processor, the method for adapting electronic book layout styles of the first aspect is implemented.
A fourth aspect of the embodiments of the present disclosure provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the method for adapting electronic book layout styles of the first aspect is implemented.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages:
according to the method, the device, the equipment and the storage medium for adapting the typesetting style of the electronic book, provided by the embodiment of the disclosure, a first reading request sent by a browser is received, wherein the first reading request comprises a first identifier of the electronic book and a second identifier of the browser; searching and obtaining a target electronic book file corresponding to the first identifier from the electronic book files corresponding to the browser based on the first identifier and the second identifier, wherein the typesetting style of the browser contained in the target electronic book file is the same as the standard typesetting style of the electronic book; the target electronic book file is sent to the browser, so that the browser displays the electronic book in a standard typesetting style, the typesetting style of the electronic book can be adapted to different browsers, the display effect of the typesetting style of the electronic book in the browser is the same as that in electronic book reading application, and the reading experience of a user is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the embodiments or technical solutions in the prior art description will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
Fig. 1 is a flowchart of an electronic book layout style adapting method provided by an embodiment of the present disclosure;
FIG. 2 is a flowchart illustrating another method for adapting a layout style of an electronic book according to an embodiment of the present disclosure;
FIG. 3 is a flowchart illustrating another method for adapting the layout style of an electronic book according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an electronic book layout style adapting device according to an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The electronic book typesetting style adapting method provided by the embodiment of the disclosure can be executed by a computer device, which can be understood as any device with processing capability and computing capability, and can be a server with software and hardware integration, and the computer device can include but is not limited to mobile terminals such as smart phones, notebook computers, Personal Digital Assistants (PDAs), tablet computers (PADs), Portable Multimedia Players (PMPs), wearable devices, and the like, and fixed electronic devices such as digital TVs, desktop computers, smart home devices, and the like.
The layout style of the electronic book in the embodiment of the present disclosure may be understood as a display manner of each text data in the electronic book, which tells the computer device how to display the content therein, for example, how to process characters, how to arrange pictures, how to display pictures, and font display attributes such as fonts, font sizes, font colors, and the like.
Aiming at the defects of the related technology in the aspect of displaying the electronic book typesetting style, the embodiment of the disclosure provides a method, a device, equipment and a storage medium for adapting the electronic book typesetting style, which can adapt the electronic book typesetting style to different browsers, so that the display effect of the electronic book typesetting style in the browsers is the same as that in electronic book reading application, and the reading experience of users is improved.
In order to better understand the inventive concept of the embodiments of the present disclosure, the following describes technical solutions of the embodiments of the present disclosure with reference to exemplary embodiments.
Fig. 1 is a flowchart of an electronic book layout style adapting method according to an embodiment of the present disclosure, where the embodiment of the present disclosure is applicable to a scenario where an electronic book layout style adapting device and a reading resource server are integrated in a computer device, as shown in fig. 1, the electronic book layout style adapting method according to the embodiment includes the following steps:
step 101, receiving a first reading request sent by a browser, where the first reading request includes a first identifier of an electronic book and a second identifier of the browser.
The first identifier of the electronic Book in the embodiment of the present disclosure may be understood as identifier information that can uniquely identify the electronic Book, and may include information such as an International Standard of Book Number (ISBN) of the electronic Book.
A browser in the disclosed embodiments may be understood as an application used to retrieve, present, and communicate internet information resources. Internet information resources are tagged by Uniform Resource Identifiers (URIs), which may be a web page, a picture, a video or any content presented on the internet. A user may browse information on the internet through a browser by means of Hyperlinks (Hyperlinks).
The second identifier of the browser in the embodiment of the present disclosure may be understood as a name, a version number, a memory serial number, an IP Address (Internet Protocol Address), a network card MAC Address (Media Access Control Address), and other identification information that can uniquely identify the browser.
In the embodiment of the disclosure, a user clicks an electronic book in a browser, the browser generates and sends a first reading request to a computer device, the first reading request includes a first identifier of the electronic book and a second identifier of the browser, and the computer device receives the first reading request sent by the browser.
And 102, searching and obtaining a target electronic book file corresponding to the first identifier from the electronic book file corresponding to the browser based on the first identifier and the second identifier, wherein the typesetting style of the browser contained in the target electronic book file is the same as the standard typesetting style of the electronic book.
The Electronic book file in the embodiment of the present disclosure may be understood as an Electronic book file in an Electronic publishing format (Epub), an Electronic book file conforming to a standard format specification, or an Electronic book file conforming to a format specification in a specific Electronic book reading application. The text data in the Epub file may be displayed in a manner most suitable for reading based on the layout style according to the characteristics of the reading device.
In the embodiment of the disclosure, the electronic book file includes a resource management file and a plurality of resource files, and each resource file corresponds to one file type. The resource files may include a directory file, a chapter file, an image file, and a layout style file, among others.
The resource management file is a file named content with a suffix name of OPF, and is used for storing various resource management information in the Epub electronic book. The resource management information may include at least one of book basic information, a resource manifest (manifest), and spine information (spine). The book basic information may include at least one of a title (title) of the book, a accountant (creator), a subject word (subject), a content description (description), a contributor (distributor), a publication date (date), a type (type), a format (format), an identifier (identifier), a source (source), a language (language), related information (relationship), a coverage (coverage), a rights description (rights), and other extensible information, and is embodied in the form of Metadata (Metadata). In the resource management file, the resource manifest lists the storage locations and file format types of all resource files included in the Epub electronic book. The spine information is used to store the linear reading order of the Epub e-books.
The directory file is a file named toc followed by a suffix name of. ncx, which is used to store a directory table of Epub electronic books. Directory tables typically employ a hierarchical structure that may include nested content, chapters and sections.
Chapter files are files stored in a Text folder, usually suffixed with html or xhtml. The chapter file stores the body content of the Epub electronic book.
The image files are files in various possible image formats stored in the Images folder, and various Images required by the Epub electronic book are stored in the image files.
The layout style file is usually a file with a suffix of cs, and layout style information of various text data of the Epub electronic book is stored in the layout style file, and may include at least one of a character size, a character font, a file layout, and the like.
The standard layout style in the embodiments of the present disclosure may be understood as a layout style displayed in a vendor electronic book reading application.
In the embodiment of the disclosure, the computer device searches and obtains a target electronic book file corresponding to the first identifier from the electronic book files corresponding to the browser based on the received first identifier of the electronic book and the second identifier of the browser, wherein a typesetting style of the browser contained in the target electronic book file is the same as a standard typesetting style of the electronic book.
In some embodiments of the present disclosure, based on the first identifier and the second identifier, the step of searching for the target electronic book file corresponding to the first identifier from the electronic book files corresponding to the browser may include steps 10211-10212:
step 10211, searching for an electronic book file corresponding to the browser based on the second identifier.
In the embodiment of the disclosure, a first identifier of an electronic book, a second identifier of a browser, browser information, and an electronic book file corresponding to the browser may be stored in a computer device, where the second identifier corresponds to the browser information one to one, and the first identifier corresponds to the electronic book file one to one. The computer device can search and obtain the e-book file corresponding to the browser in the stored e-book files corresponding to the browser based on the second identifier of the browser; and if the stored electronic book files corresponding to the browser do not have the electronic book files corresponding to the browser, the computer equipment feeds back an error response message to the browser.
Step 10212, based on the first identifier, searching for an electronic book file corresponding to the first identifier from the electronic book files corresponding to the browser as a target electronic book file.
In the embodiment of the disclosure, after the computer device searches for and obtains the electronic book file corresponding to the browser, the computer device may search for and obtain the electronic book file corresponding to the first identifier from the obtained electronic book file corresponding to the browser as the target electronic book file based on the first identifier of the electronic book.
In other embodiments of the present disclosure, based on the first identifier and the second identifier, the step of searching for the target electronic book file corresponding to the first identifier from the electronic book files corresponding to the browser may include steps 10221-10224:
and step 10221, searching for a standard electronic book file of the obtained electronic book based on the first identifier.
In the embodiment of the disclosure, a first identifier of an electronic book, a standard electronic book file of the electronic book, a second identifier of a browser, browser information, and an electronic book file corresponding to the browser may be stored in the computer device, where the first identifier corresponds to the standard electronic book file one to one, the second identifier corresponds to the browser information one to one, and the electronic book file corresponding to the browser includes a plurality of electronic book files of a same electronic book with different typesetting styles, that is, in the electronic book file corresponding to the browser, the electronic book files corresponding to the first identifier are multiple, and the typesetting styles of the electronic book files are different, and in the electronic book file corresponding to the browser, the typesetting style corresponds to the electronic book file one to one, for example, a is one electronic book, a in the electronic book file corresponding to the browser, there are three electronic book files a, b, c, and c in the electronic book file corresponding to the browser, b. And c, performing the following steps. The computer equipment searches for a standard electronic book file of the obtained electronic book in the stored standard electronic book files of the electronic book based on the first identification of the electronic book; and if the standard electronic book file corresponding to the electronic book does not exist in the stored standard electronic book files of the electronic book, the computer equipment feeds back an error response message to the browser.
Step 10222, determining a standard layout style of the electronic book based on the standard electronic book file.
In the embodiment of the disclosure, after obtaining a standard electronic book file of an electronic book, a computer device decompresses the standard electronic book file according to the standard electronic book file to obtain a layout style file in the standard electronic book file, and determines a standard layout style of the electronic book according to the layout style file.
Step 10223, based on the first identifier and the second identifier, searching for an electronic book file corresponding to the electronic book from the electronic book file corresponding to the browser.
In the embodiment of the disclosure, the computer device may search for and obtain an electronic book file corresponding to the browser from stored electronic book files corresponding to the browser based on the second identifier of the browser, and then the computer device may search for and obtain a plurality of electronic book files with different typesetting styles corresponding to the first identifier from the obtained electronic book files corresponding to the browser based on the first identifier of the electronic book; and if the electronic book file corresponding to the electronic book does not exist in the electronic book files corresponding to the browser stored in the computer equipment, the computer equipment feeds back an error response message to the browser.
Step 10224, based on the standard typesetting style of the electronic book, determining the electronic book file with the typesetting style being the standard typesetting style from the electronic book files of the electronic book obtained by searching as a target electronic book file.
In the embodiment of the present disclosure, based on the multiple electronic book files with different typesetting styles obtained in step 10223, the computer device decompresses a first electronic book file of the multiple electronic book files to obtain a typesetting style file of the electronic book file, determines the typesetting style of the electronic book file according to the typesetting style file, and determines the electronic book file as a target electronic book file if the typesetting style of the electronic book file is a standard typesetting style;
if the typesetting style of the electronic book file is not the standard typesetting style, continuously decompressing the second electronic book file to obtain the typesetting style file in the electronic book file, determining the typesetting style of the electronic book file, judging whether the typesetting style of the electronic book file is the standard typesetting style or not until the typesetting style in the electronic book file after decompression processing is the standard typesetting style, and determining the electronic book file of which the typesetting style is the standard typesetting style as the target electronic book file. And if the electronic book files with the standard typesetting style do not exist in the electronic book files with the typesetting styles stored in the computer equipment, the computer equipment feeds back an error response message to the browser.
In further embodiments of the present disclosure, based on the first identifier and the second identifier, searching for a target electronic book file corresponding to the first identifier from the electronic book files corresponding to the browser may include steps 10231 and 10234:
and 10231, searching for a standard electronic book file of the obtained electronic book based on the first identifier.
In the embodiment of the disclosure, a first identifier of an electronic book, a standard electronic book file of the electronic book, a second identifier of a browser, and a typesetting style code library of the electronic book corresponding to the browser may be stored in the computer device, where the first identifier corresponds to the electronic book file one to one, and the second identifier of the browser corresponds to the typesetting style code library of the electronic book corresponding to the browser one to one. The computer equipment searches for a standard electronic book file of the electronic book in the standard electronic book files of the stored electronic book based on the first identification of the electronic book; and if the standard electronic book file corresponding to the electronic book does not exist in the stored standard electronic book files of the electronic book, the computer equipment feeds back an error response message to the browser.
The layout style code base of the electronic book corresponding to the browser may be pre-constructed in the computer device, and the construction method may be steps S11-S13:
step S11, obtaining a plurality of standard e-book files and second identifiers of different browsers, where the standard typesetting styles of the plurality of standard e-book files are different.
In the embodiment of the disclosure, a plurality of standard electronic book files are obtained, the plurality of standard electronic book files are decompressed, standard typesetting style files in each standard electronic book file can be obtained, and standard typesetting styles of each standard electronic book file can be obtained according to the standard typesetting style files in each standard electronic book file.
And step S12, acquiring codes for realizing the standard typesetting style in various browsers based on the standard typesetting style and the second identifier of the browser.
In the embodiment of the disclosure, after the standard layout style of each standard e-book file is obtained, the actual layout style of the standard layout style in the browser is obtained based on the standard layout style and the second identifier of the browser, the difference between the actual layout style of the standard layout style in the browser and the standard layout style is determined based on the actual layout style of the standard layout style and the standard layout style in the browser, the code of the difference in the browser is modified, so that the actual layout style of the standard layout style in the browser is the same as the standard layout style, and finally the code for realizing the standard layout style in various browsers is obtained.
And step S13, combining the codes in different browsers corresponding to various different standard typesetting styles into a typesetting style code base of the electronic book corresponding to the browser.
In the embodiment of the disclosure, after obtaining codes for realizing standard typesetting styles in various browsers, the codes of different standard typesetting styles in the same browser are combined to generate a typesetting style code library of an electronic book corresponding to the browser, and the typesetting style code library is stored in computer equipment. And the second identifier of the browser corresponds to the typesetting style code base of the electronic book corresponding to the browser one by one.
And step 10232, determining a standard typesetting style of the electronic book based on the standard electronic book file.
For the embodiments of the present disclosure, reference may be made to the content of step 10222, which is not described herein again.
And step 10233, searching and obtaining the typesetting style code with the corresponding typesetting style being the standard typesetting style from the typesetting style code corresponding to the browser as the target code based on the standard typesetting style and the second identifier.
The typesetting style code in the embodiment of the disclosure can be understood as a source file of the typesetting style of the electronic book written by a programmer in a language supported by a development tool, and is a set of definite rule system for representing information in a discrete form by characters, symbols or signal code elements.
In the embodiment of the disclosure, the computer device may search, based on the obtained standard layout style of the electronic book and the second identifier of the browser, a layout style code, of which the corresponding layout style is the standard layout style, from a layout style code library corresponding to the browser to obtain the standard layout style as the target code. And if the typesetting style code of the standard typesetting style does not exist in the typesetting style code library stored in the computer equipment, the computer equipment feeds back an error response message to the browser.
And 10234, replacing the typesetting style codes in the standard electronic book file with target codes to obtain a target electronic book file.
In the embodiment of the disclosure, the standard electronic book file includes a standard typesetting style code, and the computer device replaces the typesetting style code in the standard electronic book file with the target code to obtain the target electronic book file.
And 103, sending the target electronic book file to the browser so that the browser displays the electronic book in a standard typesetting style.
In the embodiment of the disclosure, after the target electronic book file is generated, the computer device may send the target electronic book file to the browser, and after the browser receives the target electronic book file, the browser decompresses the target electronic book file to obtain a standard layout style of the electronic book, and then displays the electronic book in the standard layout style.
According to the embodiment of the disclosure, a first reading request sent by a browser is received, wherein the first reading request comprises a first identifier of an electronic book and a second identifier of the browser; searching and obtaining a target electronic book file corresponding to the first identifier from the electronic book files corresponding to the browser based on the first identifier and the second identifier, wherein the typesetting style of the browser contained in the target electronic book file is the same as the standard typesetting style of the electronic book; the target electronic book file is sent to the browser, so that the browser displays the electronic book in a standard typesetting style, the typesetting style of the electronic book can be adapted to different browsers, the display effect of the typesetting style of the electronic book in the browser is the same as that in electronic book reading application, and the reading experience of a user is improved.
Fig. 2 is a flowchart of another electronic book layout style adapting method according to an embodiment of the present disclosure, where the electronic book layout style adapting apparatus according to the embodiment of the present disclosure is integrated in a browser, the browser runs in a computer device, and a reading resource server is independent of a scene outside the computer device, as shown in fig. 2, the electronic book layout style adapting method according to the embodiment includes the following steps:
step 201, sending a second reading request to the reading resource server, where the second reading request includes the first identifier of the electronic book.
In the embodiment of the present disclosure, the reading resource server may be understood as a server storing electronic book resources, where the electronic book resources may include a first identifier of an electronic book, a standard electronic book file of the electronic book, a second identifier of a browser, browser information, and an electronic book file corresponding to the browser, where the first identifier corresponds to the standard electronic book file one to one, and the second identifier corresponds to the browser information one to one, the reading resource server may be independent of a computer device, the browser runs in the computer device, and the computer device may perform data transmission with the reading resource server.
In the embodiment of the disclosure, a user clicks an electronic book in a browser, the browser generates a second reading request, the second reading request may include a first identifier of the electronic book, the browser sends the second reading request to a computer device, and the computer device sends the second reading request to a reading resource server after receiving the second reading request.
Step 202, receiving standard electronic book files of the electronic book fed back by the reading resource server based on the first identifier.
In the embodiment of the disclosure, after receiving a second reading request sent by a computer device, a reading resource server searches a standard electronic book file of an electronic book corresponding to a first identifier from stored electronic book resources based on the first identifier of the electronic book, and sends the searched standard electronic book file of the electronic book to the computer device, and the computer device receives the standard electronic book file of the electronic book fed back by the reading resource server; and if the standard electronic book file of the electronic book corresponding to the first identifier does not exist in the electronic book resources stored by the reading resource server, feeding back an error response message to the computer equipment.
Step 203, determining a standard typesetting style of the electronic book based on the standard electronic book file.
In the embodiment of the disclosure, after obtaining the standard electronic book file of the electronic book, the browser may decompress the standard electronic book file according to the standard electronic book file to obtain the layout style file in the standard electronic book file, and determine the standard layout style of the electronic book according to the layout style file.
And step 204, searching and obtaining the electronic book file corresponding to the electronic book from the electronic book file corresponding to the browser based on the first identifier and the second identifier.
In the embodiment of the disclosure, the browser may send a first search request to the reading resource server based on the second identifier of the browser and the first identifier of the electronic book, the reading resource server searches the electronic book files corresponding to the browser from the stored electronic book files corresponding to the browser, then may search a plurality of electronic book files with different typesetting styles corresponding to the first identifier from the electronic book files corresponding to the browser based on the first identifier of the electronic book, and send the plurality of electronic book files with different typesetting styles to the browser, and the browser obtains the plurality of electronic book files with different typesetting styles corresponding to the electronic book.
Step 205, based on the standard typesetting style of the electronic book, determining the electronic book file with the typesetting style being the standard typesetting style from the electronic book files of the electronic book obtained by searching as the target electronic book file.
In this disclosure, based on the multiple electronic book files with different typesetting styles obtained in step 204, the browser decompresses the first electronic book file of the multiple electronic book files to obtain a typesetting style file of the electronic book file, determines the typesetting style of the electronic book file according to the typesetting style file, and determines the electronic book file as a target electronic book file if the typesetting style of the electronic book file is a standard typesetting style;
if the typesetting style of the electronic book file is not the standard typesetting style, continuously decompressing the second electronic book file to obtain the typesetting style file in the electronic book file, determining the typesetting style of the electronic book file, judging whether the typesetting style of the electronic book file is the standard typesetting style or not until the typesetting style in the electronic book file after decompression processing is the standard typesetting style, and determining the electronic book file with the typesetting style being the standard typesetting style as the target electronic book file. And if the electronic book files with the standard typesetting style do not exist in the electronic book files with the typesetting styles stored in the browser, the browser feeds back an error response message to the user.
And step 206, displaying the electronic book in the standard typesetting style in the target electronic book file by the browser.
In the embodiment of the disclosure, after the browser obtains the target electronic book file, decompression processing may be performed on the target electronic book file to obtain a standard layout style of the electronic book, and the electronic book is displayed in the standard layout style.
According to the embodiment of the disclosure, a second reading request is sent to the reading resource server, and the second reading request comprises a first identifier of an electronic book; receiving a standard electronic book file of the electronic book fed back by the reading resource server based on the first identifier; determining a standard typesetting style of the electronic book based on the standard electronic book file; searching and obtaining an electronic book file corresponding to the electronic book from the electronic book file corresponding to the browser based on the first identifier and the second identifier; determining an electronic book file with a standard typesetting style as a target electronic book file from electronic book files of the electronic book obtained by searching based on the standard typesetting style of the electronic book; the browser displays the electronic book in a standard typesetting style in the target electronic book file, so that the typesetting style of the electronic book can be adapted to different browsers, the display effect of the typesetting style of the electronic book in the browser is the same as that in electronic book reading application, and the reading experience of a user is improved.
Fig. 3 is a flowchart of another electronic book layout style adapting method according to an embodiment of the present disclosure, where the electronic book layout style adapting apparatus according to the embodiment of the present disclosure is integrated in a browser, the browser runs in a computer device, and a reading resource server is independent of a scene outside the computer device, as shown in fig. 3, the electronic book layout style adapting method according to the embodiment includes the following steps:
step 301, sending a second reading request to the reading resource server, where the second reading request includes the first identifier.
Step 302, receiving a standard electronic book file of the electronic book fed back by the reading resource server based on the first identifier.
The steps 301-302 in the embodiment of the present disclosure can refer to the steps 201-202, which are not described herein again.
Step 303, determining a standard typesetting style of the electronic book based on the standard electronic book file.
In the embodiment of the disclosure, the reading resource server may store a first identifier of an electronic book, a standard electronic book file of the electronic book, a second identifier of a browser, and a composition style code library of the electronic book corresponding to the browser, where the first identifier corresponds to the electronic book file one to one, and the second identifier of the browser corresponds to the composition style code library of the electronic book corresponding to the browser one to one.
The step S11-S13 may be referred to as a layout style code base of the electronic book corresponding to the browser, and details are not repeated here.
In the embodiment of the disclosure, after obtaining the standard electronic book file of the electronic book, the browser may decompress the standard electronic book file according to the standard electronic book file to obtain the layout style file in the standard electronic book file, and determine the standard layout style of the electronic book according to the layout style file.
And step 304, based on the standard typesetting style and the second identifier, searching and obtaining typesetting style codes with the corresponding typesetting style being the standard typesetting style from the typesetting style codes corresponding to the browser as target codes.
In the embodiment of the disclosure, the browser may send a second search request to the reading resource server based on the obtained standard layout style of the electronic book and the second identifier of the browser, the reading resource server searches a layout style code corresponding to the standard layout style from a stored layout style code library corresponding to the browser, sends the layout style code corresponding to the standard layout style in the browser to the browser, and determines the layout style code corresponding to the standard layout style in the browser as the object code after the browser obtains the layout style code corresponding to the standard layout style in the browser.
And 305, replacing the typesetting style codes in the standard electronic book file with target codes to obtain a target electronic book file.
In the embodiment of the disclosure, the standard electronic book file includes the standard typesetting style code, and the browser may replace the typesetting style code in the standard electronic book file with the target code to obtain the target electronic book file.
Step 306, the browser displays the electronic book in the standard typesetting style in the target electronic book file.
The step 206 may be referred to in the embodiments of the present disclosure, and details are not repeated here.
According to the embodiment of the disclosure, a second reading request is sent to the reading resource server, and the second reading request comprises a first identifier of an electronic book; receiving a standard electronic book file of the electronic book fed back by the reading resource server based on the first identifier; determining a standard typesetting style of the electronic book based on the standard electronic book file; searching and obtaining a typesetting style code with a corresponding typesetting style being a standard typesetting style from the typesetting style code corresponding to the browser as a target code based on the standard typesetting style and the second identifier; replacing the typesetting style codes in the standard electronic book file with target codes to obtain a target electronic book file; the browser displays the electronic book in the standard typesetting style in the target electronic book file, so that the typesetting style of the electronic book can be adapted to different browsers, the display effect of the typesetting style of the electronic book in the browser is the same as that in electronic book reading application, and the reading experience of a user is improved.
Fig. 4 is a schematic structural diagram of an apparatus for adapting a layout style of an electronic book according to an embodiment of the present disclosure, where the apparatus may be understood as the computer device or a part of functional modules in the computer device. As shown in fig. 4, the electronic book layout style adaptation apparatus 400 includes:
a receiving module 410, configured to receive a first reading request sent by a browser, where the first reading request includes a first identifier of an electronic book and a second identifier of the browser;
a searching module 420, configured to search, based on the first identifier and the second identifier, an electronic book file corresponding to the first identifier from electronic book files corresponding to the browser to obtain a target electronic book file corresponding to the first identifier, where a typesetting style of the browser included in the target electronic book file is the same as a standard typesetting style of the electronic book;
a sending module 430, configured to send the target electronic book file to the browser, so that the browser displays the electronic book in the standard typesetting style.
Optionally, the searching module 420 includes:
the first searching sub-module is used for searching and obtaining the electronic book file corresponding to the browser based on the second identifier;
and the second searching sub-module is used for searching and obtaining the electronic book file corresponding to the first identifier from the electronic book file corresponding to the browser based on the first identifier and taking the electronic book file corresponding to the first identifier as a target electronic book file.
Optionally, the searching module 420 includes:
the third searching sub-module is used for searching and obtaining a standard electronic book file of the electronic book based on the first identifier;
the first determining sub-module is used for determining a standard typesetting style of the electronic book based on the standard electronic book file;
the fourth searching sub-module is used for searching and obtaining the electronic book file corresponding to the electronic book from the electronic book file corresponding to the browser based on the first identifier and the second identifier;
and the second determining sub-module is used for determining the electronic book file with the typesetting style being the standard typesetting style as the target electronic book file from the electronic book files of the electronic book obtained by searching based on the standard typesetting style of the electronic book.
Optionally, the searching module 420 includes:
the fifth searching sub-module is used for searching and obtaining a standard electronic book file of the electronic book based on the first identifier;
the third determining sub-module is used for determining a standard typesetting style of the electronic book based on the standard electronic book file;
a sixth search submodule, configured to search for a layout style code, of which a corresponding layout style is a standard layout style, from the layout style code corresponding to the browser based on the standard layout style and the second identifier, as a target code;
and the replacing submodule is used for replacing the typesetting style codes in the standard electronic book file with the target codes to obtain the target electronic book file.
Optionally, a search sub-module in any one of the third search sub-module and the fifth search sub-module includes:
the sending subunit is configured to send a second reading request to the reading resource server, where the second reading request includes the first identifier;
and the receiving subunit is used for receiving the standard electronic book file of the electronic book fed back by the reading resource server based on the first identifier.
The electronic book layout style adapting device provided by the embodiment can execute the method described in any one of the embodiments, and the execution mode and the beneficial effect are similar, and are not described herein again.
An embodiment of the present disclosure provides a computing device, where the device includes a memory and a processor, where the memory stores a computer program, and when the computer program is executed by the processor, the method according to any of the foregoing embodiments may be implemented, and an execution manner and beneficial effects of the method are similar, and are not described herein again.
The embodiments of the present disclosure provide a computer-readable storage medium, where a computer program is stored in the storage medium, and when the computer program is executed by a processor, the method according to any of the embodiments above may be implemented, and the execution manner and the beneficial effects are similar, and are not described herein again.
The computer-readable storage medium described above may take any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer programs described above may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages, for performing the operations of embodiments of the present disclosure. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server.
The previous description is only for the purpose of describing particular embodiments of the present disclosure, so as to enable those skilled in the art to understand or implement the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for adapting typesetting style of an electronic book, which is characterized by comprising the following steps:
receiving a first reading request sent by a browser, wherein the first reading request comprises a first identifier of an electronic book and a second identifier of the browser;
based on the first identifier and the second identifier, searching and obtaining a target electronic book file corresponding to the first identifier from the electronic book file corresponding to the browser, wherein the typesetting style of the browser contained in the target electronic book file is the same as the standard typesetting style of the electronic book;
and sending the target electronic book file to the browser so that the browser displays the electronic book in the standard typesetting style.
2. The method of claim 1, wherein the searching for the target electronic book file corresponding to the first identifier from the electronic book files corresponding to the browser based on the first identifier and the second identifier comprises:
searching and obtaining an electronic book file corresponding to the browser based on the second identifier;
and searching and obtaining the electronic book file corresponding to the first identifier from the electronic book file corresponding to the browser as a target electronic book file based on the first identifier.
3. The method of claim 1, wherein the searching for the target electronic book file corresponding to the first identifier from the electronic book files corresponding to the browser based on the first identifier and the second identifier comprises:
searching for and obtaining a standard electronic book file of the electronic book based on the first identifier;
determining a standard typesetting style of the electronic book based on the standard electronic book file;
searching and obtaining an electronic book file corresponding to the electronic book from the electronic book file corresponding to the browser based on the first identifier and the second identifier;
and determining the electronic book file with the typesetting style of the standard typesetting style as a target electronic book file from the electronic book files of the electronic book obtained by searching based on the standard typesetting style of the electronic book.
4. The method of claim 1, wherein the searching for the target electronic book file corresponding to the first identifier from the electronic book files corresponding to the browser based on the first identifier and the second identifier comprises:
searching for and obtaining a standard electronic book file of the electronic book based on the first identifier;
determining a standard typesetting style of the electronic book based on the standard electronic book file;
searching and obtaining a typesetting style code with a corresponding typesetting style being the standard typesetting style from the typesetting style code corresponding to the browser as a target code based on the standard typesetting style and the second identifier;
and replacing the typesetting style codes in the standard electronic book file with the target codes to obtain a target electronic book file.
5. The method according to any one of claims 3 or 4, wherein the finding to obtain a standard e-book file of the e-book based on the first identifier comprises:
sending a second reading request to a reading resource server, wherein the second reading request comprises the first identifier;
and receiving standard electronic book files of the electronic book fed back by the reading resource server based on the first identification.
6. An electronic book layout style adapting apparatus, the apparatus comprising:
the device comprises a receiving module, a processing module and a display module, wherein the receiving module is used for receiving a first reading request sent by a browser, and the first reading request comprises a first identifier of an electronic book and a second identifier of the browser;
a searching module, configured to search and obtain a target electronic book file corresponding to the first identifier from the electronic book files corresponding to the browser based on the first identifier and the second identifier, where a typesetting style of the browser included in the target electronic book file is the same as a standard typesetting style of the electronic book;
and the sending module is used for sending the target electronic book file to the browser so as to enable the browser to display the electronic book in the standard typesetting style.
7. The apparatus of claim 6, wherein the lookup module comprises:
the first searching sub-module is used for searching and obtaining the electronic book file corresponding to the browser based on the second identifier;
and the second searching sub-module is used for searching and obtaining the electronic book file corresponding to the first identifier from the electronic book file corresponding to the browser as a target electronic book file based on the first identifier.
8. The apparatus of claim 6, wherein the lookup module comprises:
a third searching sub-module, configured to search for a standard e-book file of the e-book based on the first identifier;
the first determining sub-module is used for determining a standard typesetting style of the electronic book based on the standard electronic book file;
a fourth searching sub-module, configured to search, based on the first identifier and the second identifier, an electronic book file corresponding to the electronic book from the electronic book files corresponding to the browser;
and the second determining sub-module is used for determining the electronic book file with the typesetting style being the standard typesetting style as a target electronic book file from the electronic book files of the electronic book obtained by searching based on the standard typesetting style of the electronic book.
9. A computer device, comprising:
a memory and a processor, wherein the memory has stored therein a computer program which, when executed by the processor, implements the electronic book layout style adaptation method of any one of claims 1-5.
10. A computer-readable storage medium, characterized in that the storage medium has stored therein a computer program which, when executed by a processor, implements the electronic book layout style adaptation method according to any one of claims 1 to 5.
CN202210187575.3A 2022-02-28 2022-02-28 Electronic book typesetting style adapting method, device, equipment and storage medium Pending CN114564665A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210187575.3A CN114564665A (en) 2022-02-28 2022-02-28 Electronic book typesetting style adapting method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210187575.3A CN114564665A (en) 2022-02-28 2022-02-28 Electronic book typesetting style adapting method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114564665A true CN114564665A (en) 2022-05-31

Family

ID=81716747

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210187575.3A Pending CN114564665A (en) 2022-02-28 2022-02-28 Electronic book typesetting style adapting method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114564665A (en)

Similar Documents

Publication Publication Date Title
JP6040293B2 (en) Web page content annotation
US8812737B2 (en) Context-specific unicode characters in shortened URLs
US8014011B2 (en) Method of printing web page and apparatus therefor
CN107704615B (en) Webpage font display method and system based on Chinese font subset
US20140331124A1 (en) Method for maintaining common data across multiple platforms
CN109815430B (en) Request processing method and device, data processing server and readable storage medium
EP1690199A1 (en) System and method of retrieving and presenting partial (skipped) document content
WO2009129009A1 (en) Inserting a multimedia file through a web-based desktop productivity application
US20080028307A1 (en) Image forming system and image forming method
US20150026304A1 (en) System for maintaining common data across multiple platforms
WO2023179329A1 (en) Method and apparatus for generating typesetting style codes of electronic book, and device and storage medium
US9043343B2 (en) Identifier assigning method, identifier parsing method, and multimedia reading
CN107391535B (en) Method and device for searching document in document application
US8195762B2 (en) Locating a portion of data on a computer network
US10116726B2 (en) Methods for bundling images and devices thereof
CN110750958A (en) Text display method and device, electronic equipment and medium
US9576065B2 (en) Method for maintaining common data across multiple platforms
CN113360106B (en) Webpage printing method and device
US20050050516A1 (en) Framework for providing and using schema data for markup languages
CN111367606A (en) Application page display method, device, terminal and medium
US9648381B2 (en) Method and system for managing display of web-based content on portable communication devices
CN109086304B (en) Electronic bookmark updating method, device and storage medium
CN114564665A (en) Electronic book typesetting style adapting method, device, equipment and storage medium
KR101724076B1 (en) System and method for html control using user server
CN111444448B (en) Data processing method, server and system

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