Window partial refresh method, electronic device and storage medium
By identifying and modifying paragraph node labels between the editing and preview windows of the e-book, partial refresh of the e-book is achieved, which solves the problem of low rendering efficiency of the e-book when the zoom ratio changes, and improves the reading experience.
Patent Information
- Application Number
- CN202010953277.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-11
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2040-09-11
AI Technical Summary
Existing e-books are affected by the layout format when reading, resulting in a poor reading experience, especially when the zoom ratio changes. The e-book needs to be streamed to adapt to different display sizes, but this process is time-consuming. It is long, especially when there are many chapters and paragraphs, rendering in full will take more time.
Provides a window partial refresh method, by identifying the first and last paragraphs between the editing window and the preview window, obtaining and modifying node labels, and only partially refreshing the affected parts, reducing the rendering time of the entire document.
It improves the rendering efficiency, reduces the time spent on rendering the entire e-book chapters and paragraphs, and improves the reading experience.
Smart Images

Figure CN112100977B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of electronic books, and in particular to a window local refresh method, electronic equipment and storage medium. Background Art
[0002] E-books can directly and conveniently help readers obtain corresponding resources for reading, providing readers with the convenience of reading anytime and anywhere. There are many types of e-books, such as PDF electronic documents, epub electronic documents, etc. However, electronic documents in layout and typesetting formats such as PDF electronic documents are always displayed in the original edited layout during the entire reading process due to the influence of their own typesetting format. For readers, the reading experience is not good. In order to improve the reading experience of readers, it is necessary to process such e-books and process them into streaming typesetting to adapt to the adaptive layout size at different zoom ratios for display, providing readers with a better experience.
[0003] The e-books with layout can be processed by proofreading tools to generate e-books with streaming layout that are easy for readers to read. In order to facilitate the proofreaders to see the effects of the e-books before and after processing at a glance, the operation synchronization method can be used to display the e-books with layout layout and the e-books with streaming layout in two windows of the proofreading tool respectively. When the e-book in the layout window is operated, the content of the e-book changes, and the e-book in the corresponding streaming window will be re-rendered and refreshed. However, under this operation method, especially when the e-book contains many chapters and paragraphs, all chapters and paragraphs are re-rendered, which is time-consuming. Summary of the invention
[0004] In view of the above problems, the present invention is proposed to provide a window partial refresh method, electronic device and storage medium that overcome the above problems or at least partially solve the above problems.
[0005] According to one aspect of the present invention, a method for partially refreshing a window is provided, wherein a user interface comprises: an editing window displaying a first electronic book and a preview window displaying a second electronic book, wherein the first electronic book and the second electronic book have the same content but different formats, and the method comprises:
[0006] receiving an editing operation on a first editing content object of a first electronic book triggered by a user in an editing window;
[0007] Determining whether the first edit content object is located between the first and last paragraphs of the first electronic book, and whether the edit operation is associated with paragraph modification;
[0008] If yes, obtain the node labels of the first and last sections of the second electronic book corresponding to the first and last sections of the first electronic book in the preview window and the node label of the second content object corresponding to the first edited content object;
[0009] The node labels of the first and last sections of the second electronic book and the node label of the second content object are modified according to the editing operation, and the partial refresh of the preview window is completed according to the modified node labels.
[0010] According to another aspect of the present invention, there is provided an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;
[0011] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute an operation corresponding to any one of the above-mentioned window partial refresh methods.
[0012] According to another aspect of the present invention, a computer storage medium is provided, in which at least one executable instruction is stored, and the executable instruction enables a processor to execute operations corresponding to any one of the above-mentioned window partial refresh methods.
[0013] According to the window partial refresh method, electronic device and storage medium provided by the present invention, the editing operation of the editing window in the user interface is judged. When it is judged that the position of the first editing content object is between the first and last paragraphs of the first electronic book, and the editing operation is associated with paragraph modification, the node labels of the first and last paragraphs of the second electronic book corresponding to the first and last paragraphs of the first electronic book in the preview window and the node label of the second content object corresponding to the first editing content object are correspondingly obtained, the node labels of the first and last paragraphs of the second electronic book and the node label of the second content object are modified according to the editing operation, and the partial refresh of the preview window is completed by partially refreshing the modified node labels, thereby reducing the time spent on rendering each chapter, paragraph, etc. of the entire second electronic book, and improving the rendering efficiency.
[0014] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0016] Figure 1 A schematic flow chart of a window partial refresh method according to an embodiment of the present invention is shown;
[0017] Figure 2 A schematic diagram of a user interface is shown;
[0018] Figure 3a A schematic diagram showing an editing window displaying a first electronic book is shown;
[0019] Figure 3b A schematic diagram showing a preview window displaying a second electronic book is shown;
[0020] Figure 4 A schematic diagram showing a second electronic book modified according to an editing operation of a first electronic book according to an embodiment of the present invention;
[0021] Figure 5 A schematic diagram showing a modified second electronic book in a preview window according to an embodiment of the present invention is shown;
[0022] Figure 6 A schematic flow chart of a window partial refresh method according to another embodiment of the present invention is shown;
[0023] Figure 7 A schematic diagram showing a modified second electronic book in a preview window according to another embodiment of the present invention is shown;
[0024] Figure 8 A schematic structural diagram of an electronic device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0025] Embodiment 1
[0026] Figure 1 FIG. 4 shows a flow chart of a method for partially refreshing a window according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0027] Step S101: receiving an editing operation on a first editing content object of a first electronic book triggered by a user in an editing window.
[0028] When a user (a proofreader of the first electronic book, hereinafter referred to as the user) performs an editing operation on the first electronic book, the user interface used includes an editing window displaying the first electronic book and a preview window displaying the second electronic book. The first electronic book and the second electronic book have the same content but different formats. The first electronic book is a typesetting electronic book, such as a PDF electronic book, and the second electronic book is a streaming typesetting electronic book, such as an epub electronic book. The first electronic book and the second electronic book display the same content using different typesetting formats.
[0029] like Figure 2As shown, the editing window on the left displays the first electronic book, and the preview window on the right displays the second electronic book. The preview window can generate the second electronic book for display using a language such as HTML. Specifically, before the user edits the first electronic book, each content object contained in the first electronic book is parsed, and a node label of the second content object of the second electronic book is generated based on the first content object of the first electronic book. At the same time, the correspondence between the first content object of the first electronic book and the second content object of the second electronic book is recorded. The first content object and the second content object include content objects such as titles, paragraphs, pictures, text annotations, figure captions and captions (picture titles, picture annotations, etc.). For the second electronic book, different second content objects correspond to different node labels. For example, the title uses the h node label, the paragraph uses the p node label, the picture uses the img node label, etc., which are not limited here.
[0030] In addition to generating a node label for the second content object of the second electronic book based on the first content object of the first electronic book, the first content object in the first electronic book needs to be processed for the convenience of readers. Figure 3aIn the editing window shown, the first content object 122 in the first electronic book is a paragraph, the first content objects 123-125 are annotations, the first content object 128 is a picture, the first content object 129 is a caption, and the first content object 130 is a paragraph. When actually reading the first electronic book, the paragraph corresponding to 122 and the paragraph corresponding to 130 should be the front and back parts of the same paragraph, but they are separated by other content objects in the first electronic book, affecting the coherence of the reader's reading; or, when the front and back parts of a paragraph in the first electronic book are located on two adjacent pages due to page layout, they are displayed as different paragraphs in the first electronic book; or, when the first electronic book is displayed in a column manner, the front and back parts of a paragraph are located in different columns, and are displayed as different paragraphs in the first electronic book. Generating the second electronic book directly according to the display mode of the first electronic book will result in the front and back parts of a paragraph being displayed as different paragraphs, affecting the integrity of the paragraph. Therefore, it is also necessary to identify each paragraph in the first electronic book to determine whether the two adjacent paragraphs in the first electronic book are the first paragraph and the last paragraph respectively. The first paragraph starts with a normal paragraph and ends with a non-normal paragraph, and the last paragraph starts with a non-normal paragraph and ends with a normal paragraph. The beginning of a normal paragraph includes the beginning indentation of the paragraph, such as the beginning of the first line of a normal paragraph is indented by two characters, etc. The end of a normal paragraph includes the end punctuation and the end indentation of the paragraph. The end punctuation includes a period, a question mark, an exclamation mark, a quotation mark, etc. The end of the last line of a normal paragraph ends with the end punctuation, and the end of the paragraph will have an end indentation that is different from the length of a normal line of text in the paragraph. According to the above first and last paragraph features, according to the order of each paragraph in the first electronic book, it is determined whether the paragraph in the first electronic book is the first paragraph. If it is determined that the paragraph is not the first paragraph, then the next paragraph is determined to be the first paragraph according to the order of the paragraphs, until it is determined that all paragraphs in the first electronic book are not the first paragraph, or a paragraph in the first electronic book is determined to be the first paragraph. If it is determined that all paragraphs in the first electronic book are not the first paragraph, it is determined that there are no first and last paragraphs in the first electronic book; if it is determined that a certain paragraph in the first electronic book is the first paragraph, it is necessary to determine whether the next paragraph of the paragraph is the last paragraph; if so, it is determined that the two adjacent paragraphs in the first electronic book are the first paragraph and the last paragraph respectively. Further, the editing window and the preview window can be used to display the corresponding electronic book in chapters, so as to facilitate processing in chapters, narrow the scope of editing operations, so that the impact of editing operations is within one chapter and does not affect the content of other chapters. When judging whether a paragraph in the first electronic book is the first paragraph or the last paragraph, the paragraph in the current chapter of the first electronic book currently displayed in the editing window can be judged, narrowing the judgment range and improving processing efficiency.
[0031] For the convenience of readers, the contents of the corresponding first and last paragraphs are merged in the second electronic book displayed in the preview window, and the contents of the last paragraph are merged to the end of the contents of the first paragraph to display them as a complete paragraph, such as Figure 3bThe paragraph selected by the box is Figure 3a The merged paragraph in the second electronic book is arranged according to the position of the first paragraph in the first electronic book, and other content objects between the first paragraph and the last paragraph, such as the first content objects 123-125, the first content object 128, and the first content object 129 in the first electronic book, are arranged after the merged paragraph according to their positions in the first electronic book. Figure 3b shown.
[0032] After obtaining the second electronic book, the first electronic book is displayed in the editing window, and the second electronic book is displayed in the preview window. The user can perform editing operations on the first content object in the first electronic book in the editing window, and the editing operation will affect the display of the second electronic book in the preview window. In order to reduce the time for the preview window to display the second electronic book as a whole after refreshing, this embodiment partially refreshes some content objects of the second electronic book affected by the editing operation to reduce the time consumed by refreshing. Specifically, an editing operation on a first editing content object of the first electronic book triggered by the user in the editing window is received. The first editing content object is the first content object selected by the user in the editing window, and the editing operation is performed on the first editing content object.
[0033] Step S102: determining whether the first edit content object is located between the first and last paragraphs of the first electronic book, and whether the edit operation is associated with paragraph modification.
[0034] For the first edited content object, first determine whether its position is between the first and last sections of the first electronic book, where the first and last sections include the first section and the last section. Figure 3aAs shown, the first content objects 123-125, the first content object 128, and the first content object 129 are located between the first and last paragraphs in the first electronic book. Specifically, two paragraphs of the content objects adjacent to the first edited content object in the first electronic book can be obtained, and it is determined whether the two paragraphs are the first paragraph and the last paragraph respectively. The specific judgment method refers to the description of step S101; or, when step S101 determines that the two paragraphs are the first paragraph and the last paragraph respectively, the corresponding marked paragraphs are the first paragraph and the last paragraph, and it is determined whether the two paragraphs adjacent to the first edited content object are the first paragraph and the last paragraph respectively according to the mark, which is not limited here. If it is determined that the two paragraphs adjacent to the first edited content object are the first paragraph and the last paragraph respectively, it is necessary to continue to determine whether the first edited content object is a text annotation or a figure caption, and whether the editing operation is to set the content object as the main text. Because the text annotation or the figure caption is not the main text, unlike the paragraph, the node label in the second electronic book is different from the node label of the paragraph, and the display method is different. Setting the text annotation or the figure caption as the main text will result in an increase in paragraphs, that is, the editing operation can be associated with paragraph modification. When the first edited content object is located between the first and last paragraphs in the first electronic book, setting it as the main text results in an additional paragraph. In the second electronic book, the first and last paragraphs cannot be directly merged again, and the display of the first and last paragraphs needs to be considered to be affected by the additional paragraph.
[0035] When it is determined that the first edit content object is located between the first and last paragraphs of the first electronic book, and the edit operation is associated with paragraph modification, step S103 is executed.
[0036] Step S103: Obtain node labels of the first and last sections of the second electronic book corresponding to the first and last sections of the first electronic book in the preview window and node labels of the second content object corresponding to the first edited content object.
[0037] According to the correspondence between the first content object of the first electronic book and the second content object of the second electronic book, the node labels of the first and last sections of the second electronic book corresponding to the first and last sections of the first electronic book in the preview window and the node label of the second content object corresponding to the first edited content object can be obtained accordingly.
[0038] Step S104: modify the node labels of the first and last sections of the second electronic book and the node labels of the second content object according to the editing operation, and complete a partial refresh of the preview window according to the modified node labels.
[0039] According to the editing operation, first modify the node label of the second content object corresponding to the first edited content object, and change it to the node label corresponding to the paragraph to add a new paragraph. At the same time, it is also necessary to split the contents of the merged first paragraph and last paragraph in the second e-book. For the first paragraph, modify the content in the node label corresponding to the first paragraph, which no longer contains the content of the merged last paragraph; for the last paragraph, it is necessary to add a node label corresponding to the last paragraph to record the content of the last paragraph. After modifying the node label of the second e-book, it is also necessary to set the position of the modified node label in the second e-book according to the positions of the first paragraph, the first edited content object and the last paragraph in the first e-book, and complete a partial refresh of the preview window according to the modified node label. Specifically, Figure 4 As shown, in the editing window on the left, the first content object 123 of the first electronic book is located between the first and last paragraphs of the first electronic book. The first content object 123 (note) is set as the main text, so that the associated paragraph is modified. Correspondingly, the preview window on the right modifies the second electronic book, and the second electronic book re-splits the content of the original first and last paragraphs. Figure 3b The paragraph selected in the box is the combination of the paragraph corresponding to 122 and the paragraph corresponding to 130. Figure 5 The paragraph corresponding to 122 and the paragraph corresponding to 130 are no longer merged, a node label is generated for the paragraph corresponding to 130, and the content of the paragraph corresponding to 130 is recorded. Then, the positions of the node labels in the second electronic book are set according to the positions of the first content objects 122, 123, and 130 in the first electronic book, and the partial refresh of the second electronic book in the preview window is completed according to the modified node labels. When refreshing, the refresh can be based on the node labels in the second electronic book. If the second electronic book is generated using the HTML language, the tree structure of HTML can be used. After determining the node labels of the second electronic book, the determined node labels can be directly modified, added, deleted, etc., and the node labels after the processing are refreshed according to the tree structure, so as to avoid rendering and refreshing all node labels, thereby greatly saving refresh time. The above is an example, and the specific implementation can be set according to the implementation situation, which is not limited here.
[0040] Furthermore, the first content object included between the first and last sections of the first electronic book also includes a first non-editing content object in addition to the first editing content object. Figure 4As shown, the first and last segments of the first electronic book in the editing window on the left are the first segment corresponding to 122 and the last segment corresponding to 130. Between the first and last segments, in addition to the first editing content object 123, the first content objects 124, 125, 128, and 129 are also included. These first content objects are first non-editing content objects. According to the correspondence between the first content object of the first electronic book and the second content object of the second electronic book, in addition to obtaining the node labels of the first and last segments of the second electronic book corresponding to the first and last segments of the first electronic book in the preview window and the node labels of the second content objects corresponding to the first editing content objects of the first electronic book, it is also necessary to obtain the node labels of the second content objects corresponding to the first non-editing content objects contained between the first and last segments of the first electronic book in the preview window. According to the editing operation, the node label of the second content object corresponding to the first editing content object is modified, and the merged first and last segments of the second electronic book are split, the node label corresponding to the first segment is modified, and the node label corresponding to the last segment is added. The position of the modified node label in the second electronic book is set according to the position of the first paragraph, the first editable content object, the first non-editable content object and the last paragraph in the first electronic book, and a partial refresh of the preview window is completed according to the modified node label. Figure 5 As shown, the positions of the node labels in the second electronic book are set and refreshed according to the positions of the first content objects 122, 123, 124, 125, 128, 129, and 130 in the first electronic book.
[0041] According to the partial window refresh method provided by the present invention, the editing operation of the editing window in the user interface is judged. When it is judged that the position of the first editing content object is between the first and last paragraphs of the first electronic book, and the editing operation is associated with paragraph modification, the node labels of the first and last paragraphs of the second electronic book corresponding to the first and last paragraphs of the first electronic book in the preview window and the node label of the second content object corresponding to the first editing content object are correspondingly obtained, the node labels of the first and last paragraphs of the second electronic book and the node label of the second content object are modified according to the editing operation, and the partial refresh of the preview window is completed by partially refreshing the modified node labels, thereby reducing the time spent on rendering each chapter, paragraph, etc. of the entire second electronic book, and improving the rendering efficiency.
[0042] Embodiment 2
[0043] Figure 6 FIG. 4 shows a flow chart of a window partial refresh method according to another embodiment of the present invention. Figure 6 As shown, the method comprises the following steps:
[0044] Step S601: receiving an editing operation on a first editing content object of a first electronic book triggered by a user in an editing window.
[0045] The editing operation includes deleting a content object, modifying the style of a content object, setting a content object as text, etc. Specifically, deleting a content object means deleting the first edited content object in the first electronic book; modifying the style of a content object means modifying the font, font size, and image style of the first edited content object in the first electronic book; setting a content object as text means changing the type of the first edited content object in the first electronic book and modifying it to a new paragraph.
[0046] Step S602: determine whether the first edit content object is located between the first and last paragraphs of the first electronic book, and whether the edit operation is associated with paragraph modification.
[0047] The position of the first edited content object in the first electronic book is determined to determine whether it is located between the first and last sections of the first electronic book. If not, the editing operation of the first edited content object will not affect the change of the first and last sections, and other first content objects do not need to be changed. Only the node label of the second content object corresponding to the first edited content object can be processed, and step S603 is executed.
[0048] If it is determined that the position of the first edited content object is between the first and last paragraphs of the first electronic book, it is further determined whether the edit operation is associated with paragraph modification. If the edit operation is content object deletion or content object style modification, the edit operation only modifies the first edited content object during modification, does not affect other first content objects, and does not add paragraphs, then it is determined that the edit operation is not associated with paragraph modification, and step S603 is executed.
[0049] Step S603: obtaining a node label of a second content object corresponding to the first edited content object in the preview window, deleting and / or modifying the node label, and completing a partial refresh of the preview window according to the modified node label.
[0050] According to the correspondence between the first content object of the first electronic book and the second content object of the second electronic book, a node label of the second content object corresponding to the first edited content object in the preview window is obtained.
[0051] It is determined that the first edited content object is not located between the first and last sections of the first electronic book. The editing operation on the first edited content object is irrelevant to the first and last sections that have been merged in the second electronic book, and there is no need to process the node labels of other second content objects in the second electronic book. The node labels of the second content objects can be processed directly according to the editing operation. For example, if the editing operation is content object deletion, the node label of the second content object is deleted; or, if the editing operation is content object style modification, the node label of the second content object is modified according to the style required by the editing operation; or, if the editing operation is content setting as text, the node label of the second content object is modified. A partial refresh of the preview window is completed according to the modified node label.
[0052] It is determined that the first edited content object is located between the first and last paragraphs of the first electronic book, but the editing operation is not associated with paragraph modification. The editing operation on the first edited content object will not cause the merged first and last paragraphs of the second electronic book to be split again, and there is no need to process the node labels of other second content objects in the second electronic book. The node labels of the second content objects can be processed directly according to the editing operation. If the editing operation is content object deletion, the node label of the second content object is deleted; or if the editing operation is content object style modification, the node label of the second content object is modified according to the style required by the editing operation. Complete a partial refresh of the preview window according to the modified node label.
[0053] Specifically, if the user triggers an editing operation to modify the content object style of the first content object (picture) 128 of the first electronic book in the editing window, and sets it to be centered 100%, the first content object 128 is located between the first and last paragraphs of the first electronic book, but the editing operation is not associated with paragraph modification, the node label of the second content object corresponding to the first content object 128 can be directly obtained for modification, such as Figure 7The second electronic book in the preview window shown sets the image to be centered 100%, without affecting other second content objects. In addition to the above examples, the editing operation of the first editing content object of the first electronic book triggered by the user in the editing window may also include, if the first editing content object is not located between the first and last paragraphs of the first electronic book, performing editing operations such as deleting the content of the image, annotation, title, and caption, modifying the content object style of the image, annotation, title, and caption, setting the annotation, title, and caption as the main text, etc., or, if the first editing content object is located between the first and last paragraphs of the first electronic book, performing editing operations such as deleting the content object of the image, deleting the content of the annotation, title, and caption, modifying the content object style of the annotation, title, and caption, etc., the editing operation of the first editing content object triggered above may directly obtain the node label of the second content object corresponding to the first editing content object in the preview window, delete and / or modify the node label, and complete the partial refresh of the preview window according to the modified node label.
[0054] According to the window partial refresh method provided by the present invention,
[0055] Embodiment 3
[0056] Embodiment 3 of the present application provides a non-volatile computer storage medium, wherein the computer storage medium stores at least one executable instruction, and the computer executable instruction can execute the window partial refresh method in any of the above method embodiments.
[0057] The user interface includes: an editing window displaying a first electronic book and a preview window displaying a second electronic book, the first electronic book and the second electronic book have the same content but different formats, and the executable instructions can be specifically used to enable the processor to perform the following operations: receiving an editing operation on a first editing content object of the first electronic book triggered by a user in the editing window; determining whether the position of the first editing content object is located between the first and last paragraphs of the first electronic book, and whether the editing operation is associated with paragraph modification; if so, obtaining the node labels of the first and last paragraphs of the second electronic book corresponding to the first and last paragraphs of the first electronic book in the preview window and the node label of the second content object corresponding to the first editing content object; modifying the node labels of the first and last paragraphs of the second electronic book and the node label of the second content object according to the editing operation, and completing a partial refresh of the preview window according to the modified node labels.
[0058] In an optional implementation, the executable instructions further cause the processor to perform the following operations: parsing the first electronic book, generating a node label of a second content object of the second electronic book according to the first content object of the first electronic book, and recording the corresponding relationship between the first content object of the first electronic book and the second content object of the second electronic book; generating the second electronic book in HTML language in the preview window; the first content object and the second content object include a title, a paragraph, a picture, a text annotation and / or a caption, and different content objects in the second content object correspond to different node labels; identifying each paragraph in the first electronic book, and determining whether two adjacent paragraphs in the first electronic book are the first paragraph and the last paragraph respectively; the first and last paragraphs include the first paragraph and the last paragraph; the first paragraph starts with a normal paragraph and ends with an abnormal paragraph; the last paragraph starts with an abnormal paragraph and ends with a normal paragraph; the normal paragraph start includes a paragraph start indent; the normal paragraph end includes an end punctuation and a paragraph end indent; the end punctuation includes: a period, a question mark, an exclamation mark and / or a quotation mark; if so, merging the first paragraph and the last paragraph in the second electronic book displayed in the preview window.
[0059] In an optional implementation, the executable instructions further cause the processor to perform the following operations: determine in order of the paragraphs in the first electronic book whether the paragraph is the first paragraph; if so, determine whether the next paragraph of the paragraph is the last paragraph; if so, determine that the two adjacent paragraphs in the first electronic book are the first paragraph and the last paragraph respectively.
[0060] In an optional implementation, the executable instructions further cause the processor to perform the following operations: merging the content of the last paragraph to the end of the content of the first paragraph in the preview window.
[0061] In an optional implementation, the editing operation includes: deleting the content object, modifying the style of the content object, and / or setting the content object as the main text; the executable instructions further cause the processor to perform the following operations: obtaining two paragraphs adjacent to the first edited content object in the first electronic book, and determining whether the two paragraphs are the first paragraph and the last paragraph, respectively; if so, determining whether the first edited content object is a text annotation and / or a figure caption, and whether the editing operation is to set the content object as the main text; if so, determining that the editing operation is associated with paragraph modification.
[0062] In an optional implementation, the executable instructions further cause the processor to perform the following operations: based on the correspondence between the first content object of the first electronic book and the second content object of the second electronic book, obtain the node labels of the first and last segments of the second electronic book corresponding to the first and last segments of the first electronic book in the preview window and the node label of the second content object corresponding to the first edited content object; based on the editing operation, modify the node label of the second content object corresponding to the first edited content object, split the merged first and last segments in the second electronic book, modify the node label corresponding to the first segment, and add the node label corresponding to the last segment; set the position of the modified node label in the second electronic book according to the corresponding position of the first segment, the first edited content object and the last segment in the first electronic book, and complete the partial refresh of the preview window according to the modified node label.
[0063] In an optional implementation, the first content object included between the first and last sections of the first electronic book also includes a first non-editable content object in addition to the first editable content object; the executable instructions further cause the processor to perform the following operations: according to the correspondence between the first content object of the first electronic book and the second content object of the second electronic book, obtain the node labels of the first and last sections of the second electronic book corresponding to the first and last sections of the first electronic book in the preview window and the node label of the second content object corresponding to the first content object included between the first and last sections of the first electronic book; according to the editing operation, modify the node label of the second content object corresponding to the first editable content object, split the merged first and last sections in the second electronic book, modify the node label corresponding to the first section, and add the node label corresponding to the last section; according to the corresponding positions of the first section, the first editable content object, the first non-editable content object and the last section in the first electronic book, set the position of the modified node label in the second electronic book, and complete the partial refresh of the preview window according to the modified node label.
[0064] In an optional embodiment, the executable instructions further cause the processor to perform the following operations: if it is determined that the position of the first editing content object is not between the first and last paragraphs of the first electronic book, or if it is determined that the editing operation is not associated with a paragraph modification, then obtain the node label of the second content object corresponding to the first editing content object in the preview window, delete and / or modify the node label, and complete a partial refresh of the preview window based on the modified node label.
[0065] Embodiment 4
[0066] Figure 8 A schematic structural diagram of an electronic device according to a fourth embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the electronic device.
[0067] like Figure 8As shown, the electronic device may include: a processor (processor) 802 , a communication interface (Communications Interface) 804 , a memory (memory) 806 , and a communication bus 808 .
[0068] in:
[0069] The processor 802 , the communication interface 804 , and the memory 806 communicate with each other via a communication bus 808 .
[0070] The communication interface 804 is used to communicate with other devices such as clients or other servers.
[0071] The processor 802 is used to execute the program 810, and specifically can execute the relevant steps in the above-mentioned embodiment of the window partial refresh method.
[0072] Specifically, the program 810 may include program codes, which include computer operation instructions.
[0073] The processor 802 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiment of the present invention. The one or more processors included in the server may be processors of the same type, such as one or more CPUs, or processors of different types, such as one or more CPUs and one or more ASICs.
[0074] The memory 806 is used to store the program 810. The memory 806 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0075] The user interface includes: an editing window displaying a first electronic book and a preview window displaying a second electronic book, the first electronic book and the second electronic book have the same content but different formats, and the program 810 can be specifically used to enable the processor 802 to perform the following operations: receiving an editing operation on a first editing content object of the first electronic book triggered by a user in the editing window; determining whether the position of the first editing content object is located between the first and last paragraphs of the first electronic book, and whether the editing operation is associated with paragraph modification; if so, obtaining the node labels of the first and last paragraphs of the second electronic book corresponding to the first and last paragraphs of the first electronic book in the preview window and the node label of the second content object corresponding to the first editing content object; modifying the node labels of the first and last paragraphs of the second electronic book and the node label of the second content object according to the editing operation, and completing a partial refresh of the preview window according to the modified node labels.
[0076] In an optional implementation, the program 810 is used to enable the processor 802 to parse the first electronic book, generate a node label of the second content object of the second electronic book according to the first content object of the first electronic book, and record the corresponding relationship between the first content object of the first electronic book and the second content object of the second electronic book; the preview window generates the second electronic book in HTML language; the first content object and the second content object include a title, a paragraph, a picture, a text annotation and / or a caption, and different content objects in the second content object correspond to different node labels; each paragraph in the first electronic book is identified to determine whether two adjacent paragraphs in the first electronic book are the first paragraph and the last paragraph respectively; the first and last paragraphs include the first paragraph and the last paragraph; the first paragraph starts with a normal paragraph and ends with an abnormal paragraph; the last paragraph starts with an abnormal paragraph and ends with a normal paragraph; the normal paragraph start includes a paragraph start indent; the normal paragraph end includes an end punctuation and a paragraph end indent; the end punctuation includes: a period, a question mark, an exclamation mark and / or a quotation mark; if so, the first paragraph and the last paragraph are merged in the second electronic book displayed in the preview window.
[0077] In an optional implementation, program 810 is used to enable processor 802 to determine whether a paragraph is the first paragraph in the order of the paragraphs in the first electronic book; if so, determine whether the next paragraph of the paragraph is the last paragraph; if so, determine that the two adjacent paragraphs in the first electronic book are the first paragraph and the last paragraph respectively.
[0078] In an optional implementation, the program 810 is used to enable the processor 802 to merge the content of the last paragraph into the end of the content of the first paragraph in the preview window.
[0079] In an optional embodiment, the editing operation includes: deleting the content object, modifying the style of the content object and / or setting the content object as the main text; the program 810 is used to enable the processor 802 to obtain two paragraphs adjacent to the first edited content object in the first electronic book, and determine whether the two paragraphs are the first paragraph and the last paragraph respectively; if so, determine whether the first edited content object is a text annotation and / or a figure caption, and whether the editing operation is to set the content object as the main text; if so, determine that the editing operation is associated with paragraph modification.
[0080] In an optional implementation, the program 810 is used to enable the processor 802 to obtain, according to the correspondence between the first content object of the first electronic book and the second content object of the second electronic book, the node labels of the first and last segments of the second electronic book corresponding to the first and last segments of the first electronic book in the preview window and the node label of the second content object corresponding to the first edited content object; modify the node label of the second content object corresponding to the first edited content object according to the editing operation, split the merged first and last segments in the second electronic book, modify the node label corresponding to the first segment, and add the node label corresponding to the last segment; set the position of the modified node label in the second electronic book according to the position of the first segment, the first edited content object and the last segment in the first electronic book, and complete the partial refresh of the preview window according to the modified node label.
[0081] In an optional implementation, the first content object included between the first and last sections of the first electronic book also includes a first non-editable content object in addition to the first editable content object; the program 810 is used to enable the processor 802 to obtain, according to the correspondence between the first content object of the first electronic book and the second content object of the second electronic book, the node labels of the first and last sections of the second electronic book corresponding to the first and last sections of the first electronic book in the preview window and the node label of the second content object corresponding to the first content object included between the first and last sections of the first electronic book; modify, according to the editing operation, the node label of the second content object corresponding to the first editable content object, split the merged first and last sections in the second electronic book, modify the node label corresponding to the first section, and add the node label corresponding to the last section; set the position of the modified node label in the second electronic book according to the corresponding position of the first section, the first editable content object, the first non-editable content object and the last section in the first electronic book, and complete the partial refresh of the preview window according to the modified node label.
[0082] In an optional embodiment, program 810 is used to enable processor 802 to obtain the node label of the second content object corresponding to the first editing content object in the preview window if it determines that the position of the first editing content object is not between the first and last paragraphs of the first electronic book, or if it determines that the editing operation is not associated with a paragraph modification, delete and / or modify the node label, and complete a partial refresh of the preview window based on the modified node label.
[0083] The specific implementation of each step in program 810 can refer to the corresponding description of the corresponding steps in the above-mentioned window partial refresh embodiment, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above-mentioned method embodiment, which will not be repeated here.
[0084] Through the solution provided by this embodiment, the editing operation of the editing window in the user interface is judged. When it is judged that the position of the first editing content object is between the first and last paragraphs of the first electronic book, and the editing operation is associated with paragraph modification, the node labels of the first and last paragraphs of the second electronic book corresponding to the first and last paragraphs of the first electronic book in the preview window and the node label of the second content object corresponding to the first editing content object are correspondingly obtained, and the node labels of the first and last paragraphs of the second electronic book and the node label of the second content object are modified according to the editing operation. By partially refreshing the modified node labels, the partial refresh of the preview window is completed, thereby reducing the time spent on rendering each chapter, paragraph, etc. of the entire second electronic book, and improving the rendering efficiency.
[0085] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0086] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the intention that the claimed invention requires more features than those expressly recited in each claim. Rather, as reflected in the claims, inventive aspects lie in less than all of the features of the individual embodiments previously disclosed. Therefore, the claims that follow the detailed description are hereby expressly incorporated into the detailed description, with each claim itself serving as a separate embodiment of the present invention.
[0087] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0088] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims, any one of the claimed embodiments may be used in any combination.
[0089] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets should not be constructed as a limitation to the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention can be implemented by means of hardware including a number of different elements and by means of a suitably programmed computer. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.
Claims
1. A window partial refresh method, wherein: The user interface includes: an editing window displaying a first electronic book and a preview window displaying a second electronic book, the first electronic book and the second electronic book have the same content but different formats, and the method includes: receiving an editing operation on a first editing content object of a first electronic book triggered by a user in an editing window; Determining whether the first edit content object is located between the first and last paragraphs of the first electronic book, and whether the edit operation is associated with paragraph modification; If so, obtaining the node labels of the first and last paragraphs of the second electronic book corresponding to the first and last paragraphs of the first electronic book and the node label of the second content object corresponding to the first edited content object in the preview window; modifying the node labels of the first and last paragraphs of the second electronic book according to the editing operation, and changing the node label of the second content object corresponding to the first edited content object to the node label corresponding to the paragraph, and completing a partial refresh of the preview window according to the modified node labels; If it is determined that the position of the first editing content object is not between the first and last paragraphs of the first electronic book, or if it is determined that the editing operation is not associated with paragraph modification, the node label of the second content object corresponding to the first editing content object in the preview window is obtained, the node label is deleted and / or modified, and a partial refresh of the preview window is completed according to the modified node label.
2. The method according to claim 1, wherein: Before receiving an editing operation triggered by a user in the editing window on the first editing content object of the first electronic book, the method further includes: Parsing the first electronic book, generating a node label of a second content object of the second electronic book according to the first content object of the first electronic book, and recording a corresponding relationship between the first content object of the first electronic book and the second content object of the second electronic book; the preview window generates the second electronic book in HTML language; the first content object and the second content object include titles, paragraphs, pictures, text annotations and / or figure captions, and different content objects in the second content object correspond to different node labels; Identify each paragraph in the first electronic book, and determine whether two adjacent paragraphs in the first electronic book are the first paragraph and the last paragraph respectively; the first and last paragraphs include the first paragraph and the last paragraph; the first paragraph starts with a normal paragraph and ends with an abnormal paragraph; the last paragraph starts with an abnormal paragraph and ends with a normal paragraph; the normal paragraph start includes a paragraph start indent; the normal paragraph end includes an end punctuation and a paragraph end indent; the end punctuation includes: a period, a question mark, an exclamation mark and / or a quotation mark; If so, the first paragraph and the last paragraph are merged in the second electronic book displayed in the preview window.
3. The method according to claim 2, wherein: The identifying of each paragraph in the first electronic book and determining whether two adjacent paragraphs in the first electronic book are the first paragraph and the last paragraph respectively further includes: According to the order of each paragraph in the first electronic book, determine whether the paragraph is the first paragraph; If so, determine whether the next paragraph of the paragraph is the last paragraph; If so, it is determined that the two adjacent paragraphs in the first electronic book are the first paragraph and the last paragraph respectively.
4. The method according to claim 2, wherein: The step of merging the first paragraph and the last paragraph in the second electronic book displayed in the preview window further comprises: In the preview window, the content of the last paragraph is merged to the end of the content of the first paragraph.
5. The method according to any one of claims 1 to 4, wherein: The editing operation includes: deleting the content object, modifying the content object style and / or setting the content object as the main text; The determining whether the first edit content object is located between the first and last paragraphs of the first electronic book, and whether the edit operation is associated with paragraph modification further includes: Acquire two paragraphs in the first electronic book that are adjacent to the first edited content object, and determine whether the two paragraphs are the first paragraph and the last paragraph respectively; If yes, determining whether the first edited content object is a text annotation and / or a caption, and whether the edit operation is to set the content object as the main text; If so, it is determined that the editing operation is associated with a paragraph modification.
6. The method according to any one of claims 1 to 4, wherein: The step of obtaining the node labels of the first and last sections of the second electronic book corresponding to the first and last sections of the first electronic book in the preview window and the node label of the second content object corresponding to the first edited content object; According to the editing operation, modifying the node labels of the first and last paragraphs of the second electronic book, and changing the node label of the second content object corresponding to the first edited content object to the node label corresponding to the paragraph, and completing the partial refresh of the preview window according to the modified node label further includes: According to the correspondence between the first content object of the first electronic book and the second content object of the second electronic book, obtaining the node labels of the first and last sections of the second electronic book corresponding to the first and last sections of the first electronic book in the preview window and the node label of the second content object corresponding to the first edited content object; According to the editing operation, modify the node label of the second content object corresponding to the first edited content object, split the merged first and last paragraphs in the second electronic book, modify the node label corresponding to the first paragraph, and add the node label corresponding to the last paragraph; The position of the modified node label in the second electronic book is set according to the positions of the first paragraph, the first edited content object and the last paragraph in the first electronic book, and a partial refresh of the preview window is completed according to the modified node label.
7. The method according to claim 6, wherein: The first content object included between the first and last sections of the first electronic book further includes a first non-editing content object in addition to the first editing content object; The step of obtaining the node labels of the first and last sections of the second electronic book corresponding to the first and last sections of the first electronic book in the preview window and the node label of the second content object corresponding to the first edited content object; According to the editing operation, modifying the node labels of the first and last paragraphs of the second electronic book, and changing the node label of the second content object corresponding to the first edited content object to the node label corresponding to the paragraph, and completing the partial refresh of the preview window according to the modified node label further includes: According to the correspondence between the first content object of the first electronic book and the second content object of the second electronic book, obtaining the node labels of the first and last sections of the second electronic book corresponding to the first and last sections of the first electronic book in the preview window and the node labels of the second content objects corresponding to the first content objects included between the first and last sections of the first electronic book; According to the editing operation, modify the node label of the second content object corresponding to the first edited content object, split the merged first and last paragraphs in the second electronic book, modify the node label corresponding to the first paragraph, and add the node label corresponding to the last paragraph; The position of the modified node label in the second electronic book is set according to the positions of the first paragraph, the first editable content object, the first non-editable content object and the last paragraph in the first electronic book, and a partial refresh of the preview window is completed according to the modified node label.
8. An electronic device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the window partial refresh method according to any one of claims 1 to 7.
9. A computer storage medium, wherein at least one executable instruction is stored in the storage medium, and wherein the executable instruction enables a processor to execute an operation corresponding to the window partial refresh method according to any one of claims 1 to 7.
