Background technology
Along with the development of science and technology, on the mobile apparatus reading electronic book, become the primary selection of a lot of people.For streaming document, typesetting again automatically can be carried out according to the present case of mobile device.Such as ePub is one common electronics book format on the mobile apparatus, and it is the XML collection of metadata using XHTML as content displaying form, just defines ePub formatted file after all pagefiles compress by employing zip form.
Reader on common mobile terminal, is mainly divided into two kinds of modes to show ePub file: nonpageable and paging.In nonpageable mode, using each pagefile in ePub file as chapters and sections, the disposable display of each chapters and sections is complete.During with this kind of method display, redirect can only be carried out between concrete chapters and sections, chapters and sections inside not paging, also just not know where to begin and carry out the redirect of accurately location in chapters and sections inside; In paging mode, the ePub page of streaming can be carried out paging according to current screen and selected font size, simulation format document shows in such a mode, will there is the problem of page jump.User can carry out redirect on a progress bar between chapters and sections inside and chapters and sections.Because ePub itself is streaming document, paging is simulation mode out just, carries out redirect, just need to resolve all content of pages, construct paging information between the simulation page out.Parse documents full content needs the regular hour, how can respond the operation of user fast, solves this problem with regard to needing a kind of method of the user's of acceleration redirect speed.
Way conventional at present has following several:
A) prepaging is done on backstage
Rear display current page opened by document, start a prepaging thread on backstage simultaneously, prepaging is done according to current screen size and pantograph ratio, which chapters and sections analyzes total page number is in advance in each simulation page, like this when carrying out page number redirect, the chapters and sections not needing to resolve can be skipped, directly resolve page number place chapters and sections, and then accelerate redirect speed.After user changes pantograph ratio, re-start paging.After closing books, paging information is destroyed from internal memory, again does prepaging when next time opens.
B) paging information is stored on equipment
The method is on the basis of a kind of upper method, by paging information persistence, leave on equipment in the mode of file or database, using file unique identifier as the unique mapping between file and paging information, relative recording when starting reader in local paging information under locating file and corresponding pantograph ratio and screen size, no longer can carry out background paging after taking-up, when user carries out redirect, direct parsing corresponding page place chapters and sections, promote redirect speed.Such benefit is apparent, the paging information under the multiple condition of multiple file can be recorded, but problem also exists, as application program unload and reset postscript record likely disappear, the file of same identifier representative likely upgrades in terms of content, the paging information stored before causing does not conform to the file after renewal, and file copy to other equipment also needs to re-start paging activity etc.
C) paging information is stored in server end
The method is also a kind of persistence solution based on first method, with the equipment that is stored in local unlike, paging information is stored on the server, uniquely indicate according to books when books opened by reader and search related content on the server with corresponding screen message and pantograph ratio, the advantage done like this is a paging, can share by multi-client, inferior position also clearly, must be networked and just can use.
Therefore, need a kind of new technical scheme, can directly use prepaging information to carry out document segmentation, thus reduce unnecessary resolving, the redirect speed of speed up document, and when document be transferred, be copied to other equipment time, still can guarantee the validity of prepaging information.
Embodiment
In order to more clearly understand above-mentioned purpose of the present invention, feature and advantage, below in conjunction with the drawings and specific embodiments, the present invention is further described in detail.It should be noted that, when not conflicting, the feature in the embodiment of the application and embodiment can combine mutually.
Set forth a lot of detail in the following description so that fully understand the present invention, but the present invention can also adopt other to be different from other modes described here and implement, and therefore, the present invention is not limited to the restriction of following public specific embodiment.
Fig. 1 shows the block diagram of the disposal system of document redirect according to an embodiment of the invention.
Whether as shown in Figure 1, the disposal system 100 of document redirect according to an embodiment of the invention, comprising: detecting unit 102, be unlocked for detecting document; Information searching unit 104, for when described detecting unit 102 detects that described document is unlocked, searches in described document or the packet residing for described document whether there is prepaging information; Processing unit 106, for when there is described prepaging information, respond according to described prepaging information the document jump instruction that user sends, otherwise real-time paging process is carried out to described document, and the paging information obtained is stored in the packet residing for described document or described document.
In this technical scheme, by the prepaging information of document is stored in the packet residing for document or document, thus on the one hand without the need to the real-time analysis of equipment to document, thus avoid causing delay, blocking the experience of timing; On the other hand, because prepaging information is in the packet (the document data bag of such as ePub form) residing for document (such as the document of TXT form) or document, even if then document or the packet residing for document are transferred or are copied in other equipment, directly can use prepaging information wherein equally, and equipment is without the need to interconnection network, prepaging information can be used, thus reduce the hardware requirement to equipment or external network.In addition, because prepaging information and document (or the packet residing for document) are stored together, instead of store respectively after setting up mapping relations between document and prepaging information, then there will not be due to the side in document or prepaging information be removed, covering etc., and cause the opposing party cannot by situation about using.
In technique scheme, preferably, the predetermined display parameter information corresponding to described prepaging information is also stored in described document or the packet residing for described document; Described information searching unit 104 also for: obtain the display parameter information of present terminal, and inquire about the predetermined display parameter information whether existing in described document or the packet residing for described document and match; And described processing unit 106 also for: when exist match predetermined display parameter information time, obtain the prepaging information that this predetermined display parameter information is corresponding, for the document jump instruction that response user sends, otherwise carry out real-time paging process to described document, and by the display parameter information association store of the paging information that obtains and described present terminal in the packet residing for described document or described document.
In this technical scheme, because distinct device has different resolution, even if same equipment also has different pantograph ratios, these all may cause the current display parameter information of equipment to change, thus for same document, the page number as corresponding in total page number, each chapters and sections of its correspondence is interval etc. can change.Therefore, in order to make equipment can correctly according to the skip operation of prepaging information and executing user, display parameter information corresponding with it for prepaging information can be carried out association store, thus when current device needs open document and carry out redirect (such as user drags progress bar), then can process according to the prepaging information corresponding with the current display parameter information of current device, or when there is not corresponding prepaging information, real-time paging process is carried out to document, and by the current display parameter information association store of the paging information that obtains and equipment in the packet residing for document or document, so that next time uses.
In technique scheme, preferably, described detecting unit 102 also for: whether the display parameter information detecting described present terminal changes; Described information searching unit 104 also for: when described display parameter information changes, again search the prepaging information of display parameter information after corresponding to change; Described processing unit 106 also for: if exist, then obtain this prepaging information and for responding the document jump instruction that user sends, otherwise carry out real-time paging process to described document, and by the packet residing for the display parameter information association store after the paging information that obtains and described change to described document or described document.
In this technical scheme, when user just opening document time, the prepaging information corresponding to the current display parameter information of equipment may be there is in document or the packet residing for document; And when user changes reading method, such as equipment is become horizontal screen from erecting screen, or change the pantograph ratio of equipment, then display parameter information will change, prepaging information originally will not re-use.Therefore, by the Real-Time Monitoring to display parameter information, thus the prepaging information that real-time searching is corresponding, to guarantee that the jump instruction of equipment to user realizes correct response all the time.
In technique scheme, preferably, described display parameter information comprises the length breadth ratio of described present terminal and/or the pantograph ratio of described document.
In technique scheme, preferably, described document is streaming document.Particularly, such as TXT form, ePub form etc.
In technique scheme, preferably, the page number residing for each chapters and sections that described prepaging information comprises in total page number of described document and described document is interval, then described processing unit 106 responds according to described prepaging information the document jump instruction that user sends and comprises: determine the chapters and sections belonging to described document jump instruction, and the page number that chapters and sections are corresponding according to described prepaging information analysis is interval, to represent the document data after parsing.
In this technical scheme, by the chapters and sections residing for the jump target of only resolving user, thus reduce the parsing amount of equipment, also shorten the response time of equipment to user instruction.
Fig. 2 shows the process flow diagram of the disposal route of document redirect according to an embodiment of the invention.
As shown in Figure 2, the disposal route of document redirect according to an embodiment of the invention, comprising: step 202, when detecting that document is unlocked, in the packet residing for described document or described document, searches prepaging information; Step 204, judges whether to there is prepaging information; Step 206, if exist, then responds according to described prepaging information the document jump instruction that user sends; Step 208, if do not exist, then carries out real-time paging process to described document, and is stored to by the paging information obtained in the packet residing for described document or described document.
In this technical scheme, by the prepaging information of document is stored in the packet residing for document or document, thus on the one hand without the need to the real-time analysis of equipment to document, thus avoid causing delay, blocking the experience of timing; On the other hand, because prepaging information is in the packet (the document data bag of such as ePub form) residing for document (such as the document of TXT form) or document, even if then document or the packet residing for document are transferred or are copied in other equipment, directly can use prepaging information wherein equally, and equipment is without the need to interconnection network, prepaging information can be used, thus reduce the hardware requirement to equipment or external network.In addition, because prepaging information and document (or the packet residing for document) are stored together, instead of store respectively after setting up mapping relations between document and prepaging information, then there will not be due to the side in document or prepaging information be removed, covering etc., and cause the opposing party cannot by situation about using.
In technique scheme, preferably, the predetermined display parameter information corresponding to described prepaging information is also stored in described document or the packet residing for described document, then described disposal route also comprises: the display parameter information obtaining present terminal, and inquire about the predetermined display parameter information whether existing in described document or the packet residing for described document and match, if exist, then obtain the prepaging information that this predetermined display parameter information is corresponding, for the document jump instruction that response user sends, otherwise real-time paging process is carried out to described document, and by the display parameter information association store of the paging information that obtains and described present terminal in the packet residing for described document or described document.
In this technical scheme, because distinct device has different resolution, even if same equipment also has different pantograph ratios, these all may cause the current display parameter information of equipment to change, thus for same document, the page number as corresponding in total page number, each chapters and sections of its correspondence is interval etc. can change.Therefore, in order to make equipment can correctly according to the skip operation of prepaging information and executing user, display parameter information corresponding with it for prepaging information can be carried out association store, thus when current device needs open document and carry out redirect (such as user drags progress bar), then can process according to the prepaging information corresponding with the current display parameter information of current device, or when there is not corresponding prepaging information, real-time paging process is carried out to document, and by the current display parameter information association store of the paging information that obtains and equipment in the packet residing for document or document, so that next time uses.
In technique scheme, preferably, also comprise: if the display parameter information of described present terminal changes, then again search the prepaging information of the display parameter information after corresponding to change, if exist, then obtain this prepaging information and for responding the document jump instruction that user sends, otherwise real-time paging process is carried out to described document, and by the display parameter information association store after the paging information that obtains and described change in the packet residing for described document or described document.
In this technical scheme, when user just opening document time, the prepaging information corresponding to the current display parameter information of equipment may be there is in document or the packet residing for document; And when user changes reading method, such as equipment is become horizontal screen from erecting screen, or change the pantograph ratio of equipment, then display parameter information will change, prepaging information originally will not re-use.Therefore, by the Real-Time Monitoring to display parameter information, thus the prepaging information that real-time searching is corresponding, to guarantee that the jump instruction of equipment to user realizes correct response all the time.
In technique scheme, preferably, described display parameter information comprises the length breadth ratio of described present terminal and/or the pantograph ratio of described document.
In technique scheme, preferably, described document is streaming document.Particularly, such as TXT form, ePub form etc.
In technique scheme, preferably, the page number residing for each chapters and sections that described prepaging information comprises in total page number of described document and described document is interval, then the described step responding the document jump instruction that user sends according to described prepaging information comprises: determine the chapters and sections belonging to described document jump instruction, and the page number that chapters and sections are corresponding according to described prepaging information analysis is interval, to represent the document data after parsing.
In this technical scheme, by the chapters and sections residing for the jump target of only resolving user, thus reduce the parsing amount of equipment, also shorten the response time of equipment to user instruction.
Fig. 3 shows the particular flow sheet of perform document redirect according to an embodiment of the invention.
As shown in Figure 3, the idiographic flow of perform document redirect according to an embodiment of the invention comprises:
Step 302, opens ePub books.Certainly, the present invention is not limited to the document of this form of ePub, is only illustrated in that format herein.Meanwhile, user opens these books (specifically refer to and the data that these books are corresponding namely do not generate prepaging data) first, also likely not, the difference for two kinds of situations is described below.
Step 304, obtains paging condition.This paging condition refers to that the display of current device arranges environment, such as particularly, backstage obtains the wide and high of current screen, and the pantograph ratio adopted (wide and high is the physical size of device screen, unit can be inch etc., adds that equipment dpi calculates by screen pixels, can the length of frame of horizontal direction be specifically wide, the length of the frame of vertical direction is high, wide and highly changes when user's roller blind).
Step 306, reads the paging information in books.
Step 308, judges whether to there is the paging information with paging Condition Matching.Now there are three kinds of situations:
The first, user opens these books first, then wherein there is not prepaging information, thus also just cannot obtain the paging information with paging Condition Matching herein.
The second, user is non-opens these books first, can read paging information, but display corresponding to this paging information arranges environment arranges environment with current display and do not mate, and the paging information thus obtained also does not mate with paging condition.
The third, user is non-opens these books first, and the paging information read and paging matching criteria.
Step 310, resolves pandect content.
Step 312, obtains the maximum page number of each chapter and the minimum page number.As:
Such as obtaining screen wide is 720 pixels, and height is 1280 pixels, and dpi is 320, and calculating known screen wide is 2.25(inches), height is 4(inches), pantograph ratio is 1, namely in 100% ratio display page.Call analytics engine and carry out background paging (resolving whole chapters and sections), total page number is 826 pages, initial display the 1st page, and as shown in Figure 5, the paging information generated then as shown in Figure 6 for the display schematic diagram of the document.
By recording above-mentioned information, then when user dragging redirect on a progress bar, as long as judge the page number of redirect will belong to which chapters and sections, just directly can go resolve page number place chapters and sections and show, and skipping the chapters and sections not needing parsing.
Step 314, is added into paging information in ePub file.Particularly, Fig. 4 shows the schematic diagram of the file comprised in the packet of ePub file.Therefore, paging information can be generated corresponding file and pack in the packet of ePub file, such as generate pageinfo.xml file as shown in Figure 7.
By step 310 to step 314, paging information is packed in the packet of ePub file, then when later again to run into identical display and arrange environment, then remove the resolving to document content from.
Step 316, resolves current chapters and sections.
Step 318, the page number information of display current page and current page.
Detecting the paging information that whether there is corresponding screen message when again opening this ePub file, finding exist, without the need to carrying out background paging.Concrete as step 320:
Step 320, if there is prepaging information in current file, then directly reads paging information, and quick position is to the chapters and sections at current page place.
As shown in Figure 8, now drag redirect progress bar and carry out redirect, as jumped to 158 pages, corresponding chapters and sections are chapter 3 to ratio, call analytics engine and resolve corresponding these chapters and sections (skipping the parsing to chapter 2).Then directly step 316 and step 318 is performed.
Step 322, judges whether to occur that the impact such as convergent-divergent or roller blind display arranges the operation of environment, if occur, then returns step 304, otherwise terminate current process.
" convergent-divergent " is operated:
Assuming that as shown in Figure 9, be amplified to full-sized 1.6 times to the page, it is constant that paging condition becomes screen size, and pantograph ratio becomes 1.6.Reader does not get current paging condition, again carries out paging according to new parameter on backstage, generates paging information as shown in Figure 10, and jumps to the current location place page number and show.Meanwhile, also new paging information is added in the pageinfo.xml in write ePub file.
" roller blind " is operated:
Assuming that as shown in figure 11, Rotation screen is horizontal screen, and pantograph ratio becomes 1 simultaneously.Reader does not get current paging condition, again carries out paging (width=4, height=2.25, scale=1) according to new parameter on backstage, generates paging information as shown in figure 12, and jumps to the current location place page number and show.Meanwhile, also new paging information is added in the pageinfo.xml in write ePub file.
By that analogy, by the paging information under whole screen parameters of collecting on this equipment in pageinfo.xml, in either case open afterwards, do not need to do background paging again, the speed with redirect is opened in lifting.And on this file copy to miscellaneous equipment after, the paging information that distinct device creates can be shared, as long as wide consistent with height just can multiplexing before data.
More than be described with reference to the accompanying drawings technical scheme of the present invention, consider in correlation technique, due to prepaging information is stored in equipment or high in the clouds, make in the not situation such as networking or document copy, possibly cannot use prepaging information, therefore, the present invention proposes a kind of disposal system of document redirect and a kind of disposal route of document redirect, prepaging information can be directly used to carry out document segmentation, thus reduce unnecessary resolving, the redirect speed of speed up document, and when document is transferred, when being copied to other equipment, still the validity of prepaging information can be guaranteed.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.