CN107479978B - Electronic book display method and device and mobile terminal - Google Patents

Electronic book display method and device and mobile terminal Download PDF

Info

Publication number
CN107479978B
CN107479978B CN201710765222.6A CN201710765222A CN107479978B CN 107479978 B CN107479978 B CN 107479978B CN 201710765222 A CN201710765222 A CN 201710765222A CN 107479978 B CN107479978 B CN 107479978B
Authority
CN
China
Prior art keywords
page
pixel information
page pixel
system memory
electronic book
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
CN201710765222.6A
Other languages
Chinese (zh)
Other versions
CN107479978A (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.)
Alibaba China Co Ltd
Original Assignee
Alibaba China 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 Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN201710765222.6A priority Critical patent/CN107479978B/en
Publication of CN107479978A publication Critical patent/CN107479978A/en
Application granted granted Critical
Publication of CN107479978B publication Critical patent/CN107479978B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • G06F3/1407General aspects irrespective of display type, e.g. determination of decimal point position, display with fixed or driving decimal point, suppression of non-significant zeros

Abstract

The embodiment of the invention provides an electronic book display method, an electronic book display device and a mobile terminal, wherein the electronic book display method comprises the following steps: acquiring corresponding page pixel information according to the content of the page of the electronic book to be displayed; distributing a system memory for the page pixel information, and storing the page pixel information in the distributed system memory; and displaying the page of the electronic book to be displayed according to the stored page pixel information. By the embodiment of the invention, the use overrun of the application memory is avoided, and application crash caused by the overrun of the application memory is further avoided.

Description

Electronic book display method and device and mobile terminal
Technical Field
The embodiment of the invention relates to the technical field of word processing, in particular to an electronic book display method and device and a mobile terminal.
Background
With the development of intelligent mobile terminal technology, people increasingly use electronic methods for reading. For example, reading using an e-book reading application in a cell phone or tablet computer, etc.
When the current electronic book reading application is used for displaying pages of an electronic book, the current electronic book reading application is mostly realized by creating corresponding pictures for the corresponding pages of the electronic book. Taking the ANDROID system as an example, it implements presentation of pages of an electronic book by creating BITMAP (BITMAP) objects. The ANDROID system divides the memory into a system memory related to the mobile terminal hardware equipment and an application memory related to the application, the system allocates a certain application memory for each application, and once the application memory used by the application exceeds the allocated memory, the application memory of the application is insufficient, and the application crashes. For the application of electronic book reading, because the picture occupies a large memory, if the display of the page of the electronic book cannot be well controlled, the application of electronic book reading is easily broken down.
Therefore, how to avoid the phenomenon that the application memory is over-used and the application is crashed due to the display of the page of the electronic book in the electronic book reading application as much as possible becomes a problem to be solved urgently.
Disclosure of Invention
In view of this, embodiments of the present invention provide an electronic book display method, an electronic book display device, and a mobile terminal, so as to solve the problem in the prior art that an application memory usage is over-limited due to displaying an electronic book page in an electronic book reading application, thereby causing application crash.
According to a first aspect of the embodiments of the present invention, there is provided an electronic book display method, including: acquiring corresponding page pixel information according to the content of the page of the electronic book to be displayed; distributing a system memory for the page pixel information, and storing the page pixel information in the distributed system memory; and displaying the page of the electronic book to be displayed according to the stored page pixel information.
According to a second aspect of an embodiment of the present invention, there is provided an electronic book display device including: the acquisition module is used for acquiring corresponding page pixel information according to the content of the page of the electronic book to be displayed; the distribution storage module is used for distributing a system memory for the page pixel information and storing the page pixel information in the distributed system memory; and the display module is used for displaying the page of the electronic book to be displayed according to the stored page pixel information.
According to a third aspect of the embodiments of the present invention, there is provided a mobile terminal, including: 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 used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the electronic book display method according to the first aspect.
According to a fourth aspect of embodiments of the present invention, there is provided a computer storage medium storing: the executable instruction is used for acquiring corresponding page pixel information according to the content of the page of the electronic book to be displayed; executable instructions for allocating a system memory for the page pixel information and storing the page pixel information in the allocated system memory; and executable instructions for displaying the e-book page to be displayed according to the stored page pixel information.
As can be seen from the above technical solutions, when the electronic book reading application in the embodiments of the present invention displays the pages of the electronic book, the application memory of the electronic book reading application does not store the bitmap corresponding to the page of the electronic book, but directly allocates the system memory according to the page pixel information corresponding to the page of the electronic book, stores the page pixel information in the allocated system memory, and further displays the page of the electronic book according to the page pixel information. By means of directly calling and using the system memory in the mobile terminal by the e-book reading application, page pixel information corresponding to the e-book page does not need to occupy the application memory of the current e-book reading application, so that the use of the application memory is saved, the use overrun of the application memory is avoided, and application breakdown caused by the overrun of the application memory is further avoided.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present invention, and it is also possible for a person skilled in the art to obtain other drawings based on the drawings.
Fig. 1 is a flowchart illustrating steps of an electronic book display method according to a first embodiment of the invention;
FIG. 2 is a flowchart illustrating steps of a method for displaying an electronic book according to a second embodiment of the present invention;
FIG. 3 is a block diagram of an electronic book display device according to a third embodiment of the present invention;
FIG. 4 is a block diagram illustrating an electronic book display device according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of a mobile terminal according to a fifth embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments of the present invention shall fall within the scope of the protection of the embodiments of the present invention.
The following further describes specific implementation of the embodiments of the present invention with reference to the drawings.
Example one
Referring to fig. 1, a flowchart illustrating steps of an electronic book display method according to a first embodiment of the present invention is shown.
The electronic book display method of the embodiment comprises the following steps:
step S102: and acquiring corresponding page pixel information according to the content of the page of the electronic book to be displayed.
When the page of the electronic book to be displayed is determined, the corresponding page pixel information can be obtained according to the content of the page of the electronic book.
The specific implementation manner of obtaining the content of the e-book page to be displayed and obtaining the corresponding page pixel information according to the content may be implemented by a person skilled in the art in an appropriate manner according to actual needs, which is not limited in the embodiment of the present invention. For example, a typesetting engine of an electronic book reading application or reader acquires content information, such as text information, of an electronic book page to be displayed, generates an SKBitmap object for determining the color and position of each text in the typesetting process, and then acquires page pixel information, such as a color array corresponding to the electronic book page, through the SKBitmap object. The SKBitmap object is an object in a ski rendering engine, and is different from the ANDROID BITMAP object in the package of the SKBitmap object, and the SKBitmap object and other processes except for display in the embodiment of the invention all run in an NDK layer, so that an application memory cannot be occupied.
Step S104: and distributing a system memory for page pixel information corresponding to the page of the electronic book to be displayed, and storing the page pixel information in the distributed system memory.
As mentioned above, the memory in the mobile terminal can be divided into a system memory and an application memory. The system Memory is a Memory related to a hardware device of the mobile terminal, and includes but is not limited to a RAM (Random Access Memory) and may be allocated from an operating system layer; the application memory is a memory related to applications installed in the mobile terminal, and each application corresponds to a corresponding application memory and can be distributed from an application layer. System memory is typically much larger than single application memory in terms of memory space.
Based on this, in the embodiment of the present invention, a system memory is allocated to page pixel information corresponding to a page of an electronic book to be displayed, and the allocated system memory is used to store the page pixel information. When allocating a system memory for the page pixel information, a person skilled in the art may allocate a sufficient system memory space for the page pixel information in an appropriate manner to sufficiently store the page pixel information. For example, enough system memory may be allocated to the page pixel information according to the display mode of the e-book page to be displayed, or a memory space allocation threshold may be preset, and when necessary, the system memory of the size indicated by the threshold is allocated to the page pixel information, so that the size of the threshold is enough to accommodate the page pixel information corresponding to the e-book page.
Step S106: and displaying the page of the electronic book to be displayed according to the page pixel information stored in the system memory.
The page pixel information is generated according to the content of the page of the electronic book, so that the content of the page of the electronic book can be reflected in the page pixel information, and the corresponding page of the electronic book to be displayed can be displayed according to the page pixel information.
According to the embodiment, when the electronic book reading application is used for displaying the pages of the electronic book, the bitmap corresponding to the pages of the electronic book is not stored in the application memory of the electronic book reading application, but the system memory is directly distributed according to the page pixel information corresponding to the pages of the electronic book, the page pixel information is stored in the distributed system memory, and then the pages of the electronic book are displayed according to the page pixel information. By means of directly calling and using the system memory in the mobile terminal by the e-book reading application, the page pixel information corresponding to the e-book page does not need to occupy the application memory of the current e-book reading application, so that the use of the application memory is saved, the application memory is prevented from being overrun, and application breakdown caused by the overrun of the application memory is further avoided.
The electronic book display method of the present embodiment may be executed by any suitable mobile terminal having data processing capability, including but not limited to: tablet computers, mobile phones, etc.
Example two
Referring to fig. 2, a flowchart illustrating steps of an electronic book display method according to a second embodiment of the present invention is shown.
The electronic book display method of the embodiment comprises the following steps:
step S202: and acquiring corresponding page pixel information according to the content of the page of the electronic book to be displayed.
Step S204: and distributing a system memory for the page pixel information.
In the embodiment of the invention, the page pixel information corresponding to the e-book page does not occupy the application memory of the e-book reading application any more, but allocates the system memory for the e-book page to use.
In a feasible manner, according to the display mode of the e-book page to be displayed, a system memory may be allocated to the page pixel information through an operating system layer. For example, if the e-book page to be displayed is set to be displayed in the display mode of ARGB8888, each pixel occupies 4 bytes; if the e-book page to be displayed is set to be displayed in the display mode of RGB565 or ARGB4444, each pixel occupies 2 bytes. Accordingly, the system memory can be allocated to the page pixel information according to the number of pixels in the page pixel information and the number of bytes occupied by each pixel. The embedded operating system can be divided into four layers, which are respectively: a hardware layer, a driver layer, an operating system layer, and an application layer. Wherein, the hardware layer mainly comprises a plurality of bottom hardware which is the basis of the whole embedded operating system; the driving layer drives the hardware of the hardware layer to work through a driving program; the operating system layer is mainly responsible for debugging of operating system tasks and management of disks and files; the application layer is more involved in developing or writing applications. Based on this, in the embodiment of the present invention, the ANDROID system based on the embedded operating system may allocate the system memory to the page pixel information corresponding to the e-book page through the operating system layer.
Further optionally, according to the display mode of the e-book page to be displayed, an application layer program language may be used to call an operating system layer program language, and a system memory may be allocated to the page pixel information through the operating system layer. For example, in the ANDROID system, a C language that can be run in an operating system layer of the ANDROID system may be called using a JAVA language of an application layer, and a system memory is allocated to the page pixel information through the C language. In one possible approach, the distribution of system memory may be achieved using NDK (Native Development Kit). NDK is a set of local development tools that can be used to make C and JAVA language calls to each other on the ANDROID system. In this step, the NDK protocol may be used to call the C language to apply for the system memory, for example, call the void _ malloc (size _ t size) function in the C language to apply for the system memory. However, it should be understood by those skilled in the art that the NDK is only an exemplary one, and in practical applications, those skilled in the art may use other similar tools or manners, such as SDK (Software Development Kit), to implement the allocation of the system memory.
According to the method for allocating the memory space of the system according to the display mode of the page of the electronic book to be displayed, enough space can be allocated for the pixel information of the page, and the waste of the memory space can be avoided. For the mode of using the application layer program language to call the operating system layer program language to distribute the system memory, on one hand, a convenient means is provided for developers to realize the system memory distribution of the page pixel information corresponding to the e-book page, and the development difficulty is reduced; on the other hand, the implementation cost of allocating the system memory for the page pixel information is also reduced.
But not limited to, the system memory is allocated according to the display mode of the page of the electronic book to be displayed, in practical applications, a person skilled in the art may also allocate the system memory with a fixed size to the page pixel information, and the space of the system memory is sufficient to store the page pixel information corresponding to most of the pages of the electronic book. Of course, a system memory with a size slightly larger than the display mode of the e-book page to be displayed may also be allocated to the page pixel information, so as to provide a relatively sufficient available space for the page pixel information.
Step S206: and storing the page pixel information in the allocated system memory.
Wherein the page pixel information may be stored in any suitable manner. Optionally, a color array may be created in the allocated system memory, and the page pixel information may be stored using the color array. The color array can be a fixed-length array, and elements in the color array correspond to pixel points in the page of the electronic book one by one; the color array may also be a variable-length array, and elements in the color array correspond to pixel regions in the page of the electronic book, or may correspond to both the pixel regions and the pixel points. Of course, in practical applications, those skilled in the art may also store the page pixel information through the color array in other suitable manners. The page pixel information is stored through the color array, the correspondence between the color array and the page pixel information is good, the implementation is simple, and the implementation cost is low. It should be noted that if the page pixel information is obtained through the SKBitmap object, the corresponding color array may be directly obtained, and the system memory is allocated and stored for the corresponding color array.
Optionally, when the page pixel information includes a number of pixels and a color value (such as an ARGB value or an RGB value or other color value) corresponding to the ebook page; when a color array is created in a distributed system memory, the number of elements of the color array to be created can be determined according to the number of the pixels, and the color value of the pixel corresponding to each element is determined; and creating a color array in the allocated system memory according to the number of the elements and the color values of the corresponding pixels. In turn, the page pixel information is stored using the created color array. In this way, the elements in the color array may correspond one-to-one to the pixels in the page of the e-book. For example, when the e-book page a has 100 × 50 ═ 5000 pixels, the color array may correspond to 5000 array elements, and the value of each array element is the color value of the corresponding pixel. During storage, the first 100 elements of the color array correspond to color values of 100 pixels in the first pixel row of the e-book page a, the 101 th and 200 th elements correspond to color values of 100 pixels in the second pixel row of the e-book page a, and so on, and the 4901 th and 5000 th elements correspond to color values of 100 pixels in the 50 th pixel row of the e-book page a. The method is simple to store, and no extra pixel point information such as identification information or coordinate information is needed to mark the pixel points. But not limited thereto, the page pixel information may further include identification information and/or coordinate information of the pixel to explicitly mark each pixel point, in which case, each element in the color array includes identification information and/or coordinate information of the pixel in addition to the color value of the pixel. By adopting the method, the page pixel information corresponding to the page of the electronic book can be rapidly displayed, and meanwhile, the subsequent positioning and operation of certain pixel points in the page of the electronic book are facilitated.
Step S208: and displaying the page of the electronic book to be displayed according to the stored page pixel information.
The corresponding ebook page may be displayed through the page pixel information.
In a feasible mode, the page pixel information can be acquired from a system memory through a graphical program interface and sent to a display card, and the page pixel information is displayed through the display card so as to display a corresponding electronic book page. The display card may be any suitable display card according to actual needs by those skilled in the art, including but not limited to a GPU (Graphics Processing Unit). The graphical program interface provides a convenient graphical image drawing mode, and can shield the complex realization of bottom layer hardware, so that the drawing of the page pixel information corresponding to the page of the electronic book is easier to realize, and the development difficulty and the realization cost are greatly reduced.
The graphical program interface includes, but is not limited to, OpenGL. OpenGL defines a specialized graphical program interface with a cross-programming language, cross-platform programming interface specification, which is hardware-independent and can conveniently render 2D or 3D graphical images. Through OpenGL, the drawing of page pixel information corresponding to the pages of the electronic book can be conveniently realized. But not limited to OpenGL, other approaches, such as Unity, etc., are equally applicable. For example, a color array of an e-book page to be displayed is obtained through a SKBitmap object at the bottom layer, and the color array is transmitted to a GPU (Graphics Processing Unit) through OpenGL and finally displayed on a screen, thereby avoiding the situation that information of the SKBitmap object needs to be copied to an application layer and occupies an application memory in a traditional e-book page display mode.
Through the process, the display of the page of the electronic book is realized, and the condition that the electronic book reading application is crashed because the bitmap occupies too much application memory is avoided.
Based on the above process, one skilled in the art can also perform the following optional operations of steps S210-S212.
Step S210: and acquiring a page pixel information identifier generated by a display card according to the page pixel information, and storing the corresponding relation between the page pixel information identifier and the page pixel information.
In the embodiment of the invention, the display card has a certain data processing function besides displaying the page pixel information corresponding to the page of the electronic book, so that the display card can display the corresponding page pixel information to realize the display of the page of the electronic book, and can also generate the page pixel information identifier corresponding to the page pixel information and feed the page pixel information identifier back to the electronic book reading application. After the e-book reading application obtains the page pixel information identifier generated by the display card, the e-book reading application can store the corresponding relationship between the page pixel information identifier and the page pixel information, so as to subsequently operate the corresponding e-book page or a partial region in the corresponding e-book page. Through the page pixel information identification, the information of the corresponding pixel can be determined and obtained more quickly and accurately, and the display speed and efficiency of the page of the electronic book are improved.
Step S212: determining that an operation instruction for indicating operation on an electronic book page is received, and acquiring page pixel information corresponding to the electronic book page to be operated according to the page pixel information identifier; and performing the operation indicated by the operation instruction on the e-book page to be operated according to the page pixel information.
Wherein the operation instruction includes but is not limited to: an instruction indicating a moving operation on an ebook page, an instruction indicating a modification to an ebook page (e.g., an image block replacing a partial region in an ebook page), an instruction indicating a page up, an instruction indicating a page down, an instruction indicating a jump to a certain page, and so on.
For example, a color array (or five groups of page pixel information) of page pixel information corresponding to five groups of pages of the electronic book is stored in the system memory, where the five groups of page pixel information are page pixel information a, page pixel information B, page pixel information C, page pixel information E, and page pixel information F, respectively. Setting page pixel information A of a currently displayed electronic book page P1, setting the next page of P1 as P2 and setting the next page of P2 corresponding to page pixel information B, wherein the display card has color arrays corresponding to the page pixel information A and the page pixel information B at the moment; setting page pixel information identification distributed by a display card for a color array of page pixel information A as ID-P1, setting page pixel information identification distributed for a color array of page pixel information B as ID-P2, and feeding back the page pixel information identification and the corresponding relation of the page pixel information identification and the color array to an electronic book reading application, wherein the electronic book reading application can determine corresponding page pixel information according to the page pixel information identification subsequently after obtaining the information, and then operate the electronic book page according to the page pixel information.
For example, when an instruction indicating to turn down a page is received, the corresponding page pixel information B can be determined by the page pixel information identifier ID-P2, and the e-book page P2 corresponding to the page pixel information B is displayed.
But not limited to this, the operation on the corresponding e-book page may also be implemented in other ways, for example, the page pixel information corresponding to the e-book page is determined according to the relevant information of the e-book page to be displayed, such as the page identifier, and then the operation is performed.
According to the embodiment, the page pixel information corresponding to the e-book page is directly read in the operating system layer through the NDK of the ANDROID system, the read page pixel information is directly transmitted to the display card through the OpenGL, and the read page pixel information is mapped to the screen of the mobile terminal through the display card and displayed to the user. Therefore, a BITMAP object or a BITMAP picture does not need to be directly created, and an application memory, such as a JAVA heap memory, does not need to be used, so that the application memory limit of the ANDROID system can be bypassed, more system memories can be called, the e-book reading application process is smoother, and the crash caused by the overflow of the application memory is not easy to occur. In addition, after OpenGL transmits the page pixel information to the display card, the e-book reading application can directly control the corresponding page pixel information and the e-book page corresponding to the page pixel information to perform various transformations on the display screen through the page pixel information identifier, and at this time, the page pixel information and the e-book page can be controlled even if no BIMAP object exists.
The electronic book display method of the present embodiment may be executed by any suitable mobile terminal having data processing capability, including but not limited to: tablet computers, mobile phones, etc.
EXAMPLE III
Referring to fig. 3, a block diagram of an electronic book display device according to a third embodiment of the present invention is shown.
The electronic book display device of the present embodiment includes: an obtaining module 302, configured to obtain corresponding page pixel information according to content of an electronic book page to be displayed; an allocation storage module 304, configured to allocate a system memory for the page pixel information, and store the page pixel information in the allocated system memory; and the display module 306 is configured to display an electronic book page to be displayed according to the stored page pixel information.
By the electronic book display device of the embodiment, when the electronic book reading application displays the pages of the electronic book, the bitmap corresponding to the pages of the electronic book is not stored in the application memory of the electronic book reading application, but the system memory is directly allocated according to the page pixel information corresponding to the pages of the electronic book, the page pixel information is stored in the allocated system memory, and then the pages of the electronic book are displayed according to the page pixel information. By means of directly calling and using the system memory in the mobile terminal by the e-book reading application, the page pixel information corresponding to the e-book page does not need to occupy the application memory of the current e-book reading application, so that the use of the application memory is saved, the application memory is prevented from being overrun, and application breakdown caused by the overrun of the application memory is further avoided.
Example four
Referring to fig. 4, a block diagram of an electronic book display device according to a fourth embodiment of the present invention is shown.
The electronic book display device of the present embodiment includes: an obtaining module 402, configured to obtain corresponding page pixel information according to content of an electronic book page to be displayed; an allocation storage module 404, configured to allocate a system memory for the page pixel information, and store the page pixel information in the allocated system memory; and the display module 406 is configured to display an electronic book page to be displayed according to the stored page pixel information.
Optionally, the allocating and storing module 404 is configured to allocate a system memory to the page pixel information through an operating system layer according to the display mode of the e-book page to be displayed, and store the page pixel information in the allocated system memory.
Optionally, the allocating and storing module 404 is configured to, according to the display mode of the e-book page to be displayed, use an application layer program language to call an operating system layer program language, allocate a system memory to the page pixel information through the operating system layer, and store the page pixel information in the allocated system memory.
Optionally, the allocating and storing module 404 is configured to allocate a system memory for the page pixel information, create a color array in the allocated system memory, and store the page pixel information using the color array.
Optionally, the page pixel information includes a number and a color value of pixels corresponding to pages of the electronic book; the allocation storage module 404 is configured to allocate a system memory for the page pixel information, determine the number of elements of a color array to be created according to the number of the pixels, and determine a color value of a pixel corresponding to each element; creating the color array in a distributed system memory according to the number of the elements and the color values of the corresponding pixels; storing the page pixel information using the created color array.
Optionally, the display module 406 is configured to obtain the page pixel information from the system memory through a graphical program interface and send the page pixel information to a display card, and display the page pixel information through the display card.
Optionally, the electronic book display device of this embodiment further includes: the identification module 408 is configured to, after the display module 406 displays the e-book page to be displayed according to the stored page pixel information, obtain a page pixel information identifier obtained by the display card according to the page pixel information, and store a corresponding relationship between the page pixel information identifier and the page pixel information.
Optionally, the electronic book display device of this embodiment further includes: an operation module 410, configured to determine that an operation instruction for instructing to operate an ebook page is received after the identification module 408 stores the correspondence between the page pixel information identifier and the page pixel information, and obtain page pixel information corresponding to the ebook page to be operated according to the page pixel information identifier of the page pixel information; and performing the operation indicated by the operation instruction on the e-book page to be operated according to the page pixel information.
The electronic book display device of the embodiment is used for implementing the corresponding electronic book display method in the foregoing method embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described herein again.
EXAMPLE five
Referring to fig. 5, a schematic structural diagram of a mobile terminal according to a fifth embodiment of the present invention is shown, and the specific embodiment of the present invention does not limit the specific implementation of the mobile terminal.
As shown in fig. 5, the mobile terminal may include: a processor (processor)502, a Communications Interface 504, a memory 506, and a communication bus 508.
Wherein:
the processor 502, communication interface 504, and memory 506 communicate with one another via a communication bus 508.
A communication interface 504 for communicating with other electronic devices, such as other mobile terminals or servers.
The processor 502 is configured to execute the program 510, and may specifically perform relevant steps in the above-described electronic book display method embodiment.
In particular, program 510 may include program code that includes computer operating instructions.
The processor 502 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement an embodiment of the invention. The one or more processors included in the mobile terminal may 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 506 for storing a program 510. The memory 506 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 510 may specifically be used to cause the processor 502 to perform the following operations: acquiring corresponding page pixel information according to the content of the page of the electronic book to be displayed; distributing a system memory for the page pixel information, and storing the page pixel information in the distributed system memory; and displaying the page of the electronic book to be displayed according to the stored page pixel information.
In an optional implementation manner, the program 510 is further configured to enable the processor 502 to allocate the system memory for the page pixel information through an operating system layer according to a display mode of the e-book page to be displayed when allocating the system memory for the page pixel information.
In an optional implementation manner, the program 510 is further configured to enable the processor 502, when allocating a system memory to the page pixel information through the operating system layer according to the display mode of the e-book page to be displayed, call an operating system layer program language using an application layer program language according to the display mode of the e-book page to be displayed, and allocate the system memory to the page pixel information through the operating system layer.
In an alternative embodiment, the program 510 is further configured to cause the processor 502 to create a color array in the allocated system memory when storing the page pixel information in the allocated system memory, and store the page pixel information using the color array.
In an optional implementation manner, the page pixel information includes a number and a color value of pixels corresponding to the e-book page; the program 510 is further configured to enable the processor 502 to create a color array in the allocated system memory, determine, according to the number of pixels when the page pixel information is stored in the color array, the number of elements of the color array to be created, and determine a color value of a pixel corresponding to each element; creating the color array in a distributed system memory according to the number of the elements and the color values of the corresponding pixels; storing the page pixel information using the created color array.
In an optional implementation manner, the program 510 is further configured to enable the processor 502 to, when displaying an electronic book page to be displayed according to the stored page pixel information, obtain the page pixel information from the system memory through a graphical program interface and send the page pixel information to a display card, and display the page pixel information through the display card.
In an optional implementation manner, the program 510 is further configured to enable the processor 502 to obtain a page pixel information identifier generated by the display card according to the page pixel information after displaying the e-book page to be displayed according to the stored page pixel information, and store a corresponding relationship between the page pixel information identifier and the page pixel information.
In an optional implementation manner, the program 510 is further configured to enable the processor 502 to determine that an operation instruction for instructing to operate an ebook page is received after the corresponding relationship between the page pixel information identifier and the page pixel information is saved, and obtain page pixel information corresponding to an ebook page to be operated according to the page pixel information identifier; and performing the operation indicated by the operation instruction on the e-book page to be operated according to the page pixel information.
For specific implementation of each step in the program 510, reference may be made to corresponding steps and corresponding descriptions in units in the above-described embodiment of the electronic book display method, which are 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 mobile terminal of the embodiment, when the e-book reading application displays the pages of the e-book, the bitmap corresponding to the page of the e-book is not stored in the application memory of the e-book reading application, but the system memory is directly allocated according to the page pixel information corresponding to the page of the e-book, the page pixel information is stored in the allocated system memory, and then the page of the e-book is displayed according to the page pixel information. By means of directly calling and using the system memory in the mobile terminal by the e-book reading application, the page pixel information corresponding to the e-book page does not need to occupy the application memory of the current e-book reading application, so that the use of the application memory is saved, the application memory is prevented from being overrun, and application breakdown caused by the overrun of the application memory is further avoided.
It should be noted that, according to the implementation requirement, each component/step described in the embodiment of the present invention may be divided into more components/steps, and two or more components/steps or partial operations of the components/steps may also be combined into a new component/step to achieve the purpose of the embodiment of the present invention.
The above-described method according to an embodiment of the present invention may be implemented in hardware, firmware, or as software or computer code storable in a recording medium such as a CD ROM, a RAM, a floppy disk, a hard disk, or a magneto-optical disk, or as computer code originally stored in a remote recording medium or a non-transitory machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the method described herein may be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware such as an ASIC or FPGA. It will be appreciated that the computer, processor, microprocessor controller, or programmable hardware includes memory components (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code that, when accessed and executed by the computer, processor, or hardware, implements the electronic book display methods described herein. Further, when a general-purpose computer accesses code for implementing the electronic book display method shown herein, execution of the code converts the general-purpose computer into a special-purpose computer for executing the electronic book display method shown herein.
Those of ordinary skill in the art will appreciate that the various illustrative elements and method steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present embodiments.
The above embodiments are only for illustrating the embodiments of the present invention and not for limiting the embodiments of the present invention, and those skilled in the art can make various changes and modifications without departing from the spirit and scope of the embodiments of the present invention, so that all equivalent technical solutions also belong to the scope of the embodiments of the present invention, and the scope of patent protection of the embodiments of the present invention should be defined by the claims.

Claims (18)

1. An electronic book display method, comprising:
acquiring corresponding page pixel information according to the content of the page of the electronic book to be displayed;
distributing a system memory for the page pixel information, and storing the page pixel information in the distributed system memory, wherein the system memory is a memory related to mobile terminal hardware equipment;
and displaying the page of the electronic book to be displayed according to the stored page pixel information.
2. The method of claim 1, wherein allocating system memory for the page pixel information comprises:
and distributing a system memory for the page pixel information through an operating system layer according to the display mode of the page of the electronic book to be displayed.
3. The method of claim 2, wherein allocating system memory for the page pixel information through an operating system layer according to a display mode of the e-book page to be displayed comprises:
and calling an operating system layer program language by using an application layer program language according to the display mode of the page of the electronic book to be displayed, and distributing a system memory for the page pixel information through the operating system layer.
4. The method of any of claims 1-3, wherein storing the page pixel information in the allocated system memory comprises:
creating a color array in the allocated system memory, and storing the page pixel information by using the color array.
5. The method of claim 4, wherein the page pixel information includes a color value and a number of pixels corresponding to the ebook page;
creating a color array in the allocated system memory, and using the color array to store the page pixel information, including:
determining the number of elements of a color array to be created according to the number of the pixels, and determining the color value of the pixel corresponding to each element;
creating the color array in the allocated system memory according to the number of the elements and the color value of the corresponding pixel;
storing the page pixel information using the created color array.
6. The method of any of claims 1-3, wherein displaying the ebook page to be displayed according to the stored page pixel information comprises:
and acquiring the page pixel information from the system memory through a graphical program interface and sending the page pixel information to a display card, and displaying the page pixel information through the display card.
7. The method of claim 6, wherein after displaying the ebook page to be displayed in accordance with the stored page pixel information, the method further comprises:
and acquiring a page pixel information identifier generated by the display card according to the page pixel information, and storing the corresponding relation between the page pixel information identifier and the page pixel information.
8. The method of claim 7, wherein after saving the correspondence of the page pixel information identifier to the page pixel information, the method further comprises:
determining that an operation instruction for indicating operation on an electronic book page is received, and acquiring page pixel information corresponding to the electronic book page to be operated according to the page pixel information identifier;
and performing the operation indicated by the operation instruction on the e-book page to be operated according to the page pixel information.
9. An electronic book display device comprising:
the acquisition module is used for acquiring corresponding page pixel information according to the content of the page of the electronic book to be displayed;
the distribution storage module is used for distributing a system memory for the page pixel information and storing the page pixel information in the distributed system memory, wherein the system memory is a memory related to mobile terminal hardware equipment;
and the display module is used for displaying the page of the electronic book to be displayed according to the stored page pixel information.
10. The apparatus of claim 9, wherein the allocating and storing module is configured to allocate a system memory to the page pixel information through an operating system layer according to a display mode of the e-book page to be displayed, and store the page pixel information in the allocated system memory.
11. The apparatus of claim 10, wherein the allocating storage module is configured to invoke an operating system layer program language using an application layer program language according to a display mode of the e-book page to be displayed, allocate a system memory to the page pixel information through an operating system layer, and store the page pixel information in the allocated system memory.
12. The apparatus according to any one of claims 9-11, wherein the allocation storage module is configured to allocate a system memory for the page pixel information, create a color array in the allocated system memory, and store the page pixel information using the color array.
13. The apparatus of claim 12, wherein the page pixel information includes a color value and a number of pixels corresponding to the ebook page;
the distribution storage module is used for distributing a system memory for the page pixel information, determining the number of elements of a color array to be created according to the number of the pixels, and determining the color value of the pixel corresponding to each element; creating the color array in the allocated system memory according to the number of the elements and the color value of the corresponding pixel; storing the page pixel information using the created color array.
14. The apparatus according to any one of claims 9-11, wherein the display module is configured to obtain the page pixel information from the system memory through a graphical program interface and send the page pixel information to a display card, and display the page pixel information through the display card.
15. The apparatus of claim 14, wherein the apparatus further comprises:
and the identification module is used for acquiring a page pixel information identification generated by the display card according to the page pixel information after the display module displays the page of the electronic book to be displayed according to the stored page pixel information, and storing the corresponding relation between the page pixel information identification and the page pixel information.
16. The apparatus of claim 15, wherein the apparatus further comprises:
the operation module is used for determining that an operation instruction for indicating the operation of the page of the electronic book is received after the corresponding relation between the page pixel information identifier and the page pixel information is stored in the identifier module, and acquiring the page pixel information corresponding to the page of the electronic book to be operated according to the page pixel information identifier; and performing the operation indicated by the operation instruction on the e-book page to be operated according to the page pixel information.
17. A mobile terminal, 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 used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the electronic book display method of any one of claims 1-8.
18. A computer storage medium, the computer storage medium having stored thereon: the executable instruction is used for acquiring corresponding page pixel information according to the content of the page of the electronic book to be displayed; executable instructions for allocating a system memory to the page pixel information and storing the page pixel information in the allocated system memory, wherein the system memory is a memory associated with a mobile terminal hardware device; and executable instructions for displaying the e-book page to be displayed according to the stored page pixel information.
CN201710765222.6A 2017-08-30 2017-08-30 Electronic book display method and device and mobile terminal Active CN107479978B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710765222.6A CN107479978B (en) 2017-08-30 2017-08-30 Electronic book display method and device and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710765222.6A CN107479978B (en) 2017-08-30 2017-08-30 Electronic book display method and device and mobile terminal

Publications (2)

Publication Number Publication Date
CN107479978A CN107479978A (en) 2017-12-15
CN107479978B true CN107479978B (en) 2020-11-03

Family

ID=60603328

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710765222.6A Active CN107479978B (en) 2017-08-30 2017-08-30 Electronic book display method and device and mobile terminal

Country Status (1)

Country Link
CN (1) CN107479978B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105302579A (en) * 2015-11-27 2016-02-03 北京奇虎科技有限公司 System memory occupying method and system memory occupying device
CN106056530A (en) * 2016-06-01 2016-10-26 腾讯科技(深圳)有限公司 Method and device for displaying picture content in application

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW561425B (en) * 2001-07-25 2003-11-11 Ulead Systems Inc Image special effect module interface device and its access method
US20100271378A1 (en) * 2009-04-24 2010-10-28 Yun Shon Low Rapid Activation Of A Device Having An Electrophoretic Display
CN105302415A (en) * 2015-10-19 2016-02-03 四川长虹电器股份有限公司 Image thumbnail generation method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105302579A (en) * 2015-11-27 2016-02-03 北京奇虎科技有限公司 System memory occupying method and system memory occupying device
CN106056530A (en) * 2016-06-01 2016-10-26 腾讯科技(深圳)有限公司 Method and device for displaying picture content in application

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"How is a bitmap"s memory managed on Android";SlowAndSteady;《Stack Overflow》;20170811;第1页 *
SlowAndSteady."How is a bitmap"s memory managed on Android".《Stack Overflow》.2017, *

Also Published As

Publication number Publication date
CN107479978A (en) 2017-12-15

Similar Documents

Publication Publication Date Title
US11344806B2 (en) Method for rendering game, and method, apparatus and device for generating game resource file
WO2020038441A1 (en) Map rendering method and apparatus, computer device and storage medium
US8803896B2 (en) Providing a coherent user interface across multiple output devices
US9715750B2 (en) System and method for layering using tile-based renderers
CN105955687B (en) Image processing method, device and system
CN103336816A (en) Canvas element rendering method and device realized on Android system based on GPU (Graphic Processing Unit)
EP3971818A1 (en) Picture processing method and apparatus
CN111737019B (en) Method and device for scheduling video memory resources and computer storage medium
CN110908762B (en) Dynamic wallpaper implementation method and device
CN110750664B (en) Picture display method and device
CN111400024B (en) Resource calling method and device in rendering process and rendering engine
CN111192352B (en) Map rendering method, map rendering device, computer equipment and storage medium
US10657678B2 (en) Method, apparatus and device for creating a texture atlas to render images
US20230386431A1 (en) System and method for causing graphical information to be rendered
CN106201255B (en) Information processing method and electronic equipment
US10593103B2 (en) Method and apparatus for managing graphics layers within a data processing system
CN111476858B (en) WebGL-based 2d engine rendering method, device and equipment
CN107479978B (en) Electronic book display method and device and mobile terminal
CN111324326A (en) Processing method and device for displaying software to one machine with multiple screens
EP4270321A1 (en) Graphic rendering method and apparatus, and storage medium
US8203567B2 (en) Graphics processing method and apparatus implementing window system
CN112988609B (en) Data processing method, device, storage medium and client
CN111198858A (en) File processing method and device, computer storage medium and terminal
CN111785229B (en) Display method, device and system
CN106937142B (en) Image display method, server and terminal

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200604

Address after: 310051 room 508, floor 5, building 4, No. 699, Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: Alibaba (China) Co.,Ltd.

Address before: 510627 Guangdong city of Guangzhou province Whampoa Tianhe District Road No. 163 Xiping Yun Lu Yun Ping square B radio tower 13 layer self unit 03

Applicant before: GUANGZHOU ALIBABA LITERATURE INFORMATION TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant