Data processing methods, apparatus, electronic devices, storage media, and software products
By recording the relative position data of drawing points in the e-reader, responding to document update operations, and obtaining drawing style parameters, the system achieves linked updates between drawing points and document data. This solves the problem that marked content is no longer displayed after document content is updated, and provides flexible document data updates and re-viewing capabilities.
Patent Information
- Application Number
- CN202510013300.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2045-01-03
AI Technical Summary
The existing e-readers have a problem where, after the document content is updated, the marked content is no longer displayed or is no longer associated with the expected document content.
By displaying the first document data of the target document in the reader, recording the relative position data of multiple drawing points, responding to data update operations, obtaining drawing style parameters, and drawing the second drawing point in the reader based on the updated document data and drawing point position data, the linkage update of drawing points and document data is realized.
It enables flexible linkage and updating of drawing points and document data when document data changes, ensuring that the marked content remains associated with the updated document content and solving the problem of marked content no longer being displayed. It provides flexible document data updates and the ability to view the data again.
Smart Images

Figure CN119940309B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer processing technology, and more particularly to a data processing method, apparatus, electronic device, storage medium, and program product. Background Technology
[0002] In document reading scenarios, it's necessary to mark certain document content to aid understanding or memorization, or to save it as bookmarks. Although some e-readers support marking the presented content, their marking methods are limited by the characteristics of the e-reader. Once the document content is reformatted, the marked content of the target document will no longer be displayed, or the markings will no longer be associated with the expected document content. Summary of the Invention
[0003] This disclosure provides a data processing method, apparatus, electronic device, storage medium, and program product to achieve the effect of data linkage and updating between drawing points and target documents.
[0004] In a first aspect, embodiments of this disclosure provide a data processing method, the method comprising:
[0005] The first document data of the target document is displayed in the reader; wherein the target document is associated with document drawing data; the document drawing data includes first document position data of multiple drawing points relative to the target document; the multiple drawing points are used to mark the target document;
[0006] In response to a data update operation for the target document, second document data to be displayed in the reader is determined based on the data update operation, and the second document data is displayed in the reader; and,
[0007] If a first drawing point associated with the second document data exists among multiple drawing points, the drawing style parameters of the first drawing point are obtained, and a second drawing point is drawn in the reader according to the drawing style parameters, the second document data, and the first document position data of the first drawing point.
[0008] Secondly, embodiments of this disclosure also provide a data processing apparatus, the apparatus comprising:
[0009] A document data display module is used to display first document data of a target document in a reader; wherein, the target document is associated with document drawing data; the document drawing data includes first document position data of multiple drawing points relative to the target document; the multiple drawing points are used to mark the target document;
[0010] A document data update module is configured to, in response to a data update operation for the target document, determine second document data to be displayed in the reader based on the data update operation, and display the second document data in the reader; and...
[0011] The drawing data restoration module is used to obtain the drawing style parameters of the first drawing point when there is a first drawing point associated with the second document data among multiple drawing points, and draw the second drawing point in the reader according to the drawing style parameters, the second document data and the first document position data of the first drawing point.
[0012] Thirdly, embodiments of this disclosure also provide an electronic device, the electronic device comprising:
[0013] One or more processors;
[0014] Storage device for storing one or more programs.
[0015] When the one or more programs are executed by the one or more processors, the one or more processors implement the data processing method as described in any of the embodiments of this disclosure.
[0016] Fourthly, embodiments of this disclosure also provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the data processing method as described in any of the embodiments of this disclosure.
[0017] Fifthly, embodiments of this disclosure also provide a computer program product, including a computer program that, when executed by a processor, implements the data processing method as described in any of the embodiments of this disclosure.
[0018] The technical solution of this disclosure, by displaying the first document data of the target document in a reader, allows for intuitive and convenient viewing of the first document data of the target document. It is applicable to scenarios where the target document is associated with document drawing data. Furthermore, since the document drawing data includes the first document position data of multiple drawing points relative to the target document, it achieves document drawing data generation by recording the relative positions between the drawing points and the target document. This differs from the method of recording the screen drawing coordinates of the drawing points, and provides data basis for restoring the relative display effect of the drawing points and document data during drawing. Moreover, the target document can be marked using multiple drawing points. Then, in response to a data update operation for the target document, the second document data to be displayed in the reader is determined based on the data update operation, and the second document data is displayed in the reader. This allows for simple interactive operation of the document data. The system allows for flexible updates; and, in the case where a first drawing point associated with the second document data exists among multiple drawing points, it obtains the drawing style parameters of the first drawing point, and draws a second drawing point in the reader based on the drawing style parameters, the second document data, and the first document position data of the first drawing point. This enables the display of the second drawing point corresponding to the second document data when the document data of the target document is updated from the first document data to the second document data, truly realizing flexible marking of the target document and re-viewing of the document drawing data. It also presents the relative display effect of the second drawing point and the second document data during drawing, solving the problem in related technologies where the marked content of the target document is no longer displayed or no longer associated with the expected document content due to document content updates. This achieves the technical effect of linking the updating of drawing points and document data when the data of the target document changes. Attached Figure Description
[0019] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0020] Figure 1A A flowchart illustrating a data processing method provided in an embodiment of this disclosure;
[0021] Figure 1B This is a schematic diagram illustrating the effect of linking and updating document drawing data with document data in a data processing method provided in this embodiment of the present disclosure.
[0022] Figure 2 A flowchart illustrating another data processing method provided in an embodiment of this disclosure;
[0023] Figure 3A A flowchart illustrating another data processing method provided in an embodiment of this disclosure;
[0024] Figure 3B A schematic diagram illustrating a document location data recording method for a data processing method according to an embodiment of this disclosure;
[0025] Figure 4A This is a schematic diagram of the region drawing position data of multiple touch points recorded in an optional example of a data processing method for an embodiment of the present disclosure.
[0026] Figure 4B A schematic diagram illustrating the relative positional relationship between touch points and characters in an optional example of a data processing method for an embodiment of this disclosure;
[0027] Figure 5 This is a schematic diagram of the structure of a data processing apparatus provided in an embodiment of the present disclosure;
[0028] Figure 6 This is a schematic diagram of the structure of an electronic device for implementing an embodiment of the present disclosure. Detailed Implementation
[0029] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0030] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0031] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0032] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0033] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0034] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0035] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0036] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0037] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0038] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0039] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0040] Figure 1AThis is a flowchart illustrating a data processing method provided in an embodiment of this disclosure. This embodiment is applicable to scenarios where document drawing data is flexibly added to a target document. The method can be executed by a data processing device, which can be implemented in software and / or hardware, optionally through an electronic device, such as a mobile terminal, PC, or server. Figure 1A As shown, the method in this embodiment may specifically include:
[0041] S110. Display first document data of the target document in the reader; wherein, the target document is associated with document drawing data; the document drawing data includes first document position data of multiple drawing points relative to the target document; the multiple drawing points are used to mark the target document.
[0042] In this embodiment of the disclosure, a reader can be understood as a container for displaying document data of a target document for a user to read. Specifically, a reader can be a component deployed on a webpage or application for displaying document data of an electronic document. The reader can be presented in a portion of the webpage or application page or fill the entire area. The document data displayed in the reader can be all or part of the document data of the target document. The target document is an electronic document that can be displayed in the reader. Exemplarily, the target document can at least include an ebook. In addition, the target document can also include electronic newspapers and / or electronic magazines, etc.
[0043] Document data can include multiple characters from a document. Characters can be text and / or symbols. Document data in a target document can be displayed in a reader based on the document's layout. Layout data typically defines the detailed data defining the layout and format of the target document's document data in the reader. Layout data determines the visual presentation of a document or publication. The document data of a target document can include data presented in the form of text, images, and tables. Layout data can include, but is not limited to, one or more page display parameters such as font, font size, line spacing, paragraph alignment, margins, headers and footers, page numbers, image position and size, etc. The same target document will display differently in a reader under different layout data.
[0044] In this embodiment of the disclosure, document drawing data can be understood as data drawn for a target document, or drawing data received when at least a portion of the document data of the target document is presented in the reader. More specifically, the document drawing data includes drawing data of multiple drawing points. The multiple drawing points are used to mark the target document. For example, when the target document is an e-book, the document drawing data can be the underlined data in the e-book. That is, notes can be added to the target document by adding underlined data, and the document drawing data is obtained by recording the data of multiple trajectory points (drawing points) corresponding to the underlined data.
[0045] The first document location data can be understood as the position of multiple drawing points relative to the target document during drawing, or the relative display position of multiple drawing points relative to the document data in the target document during drawing.
[0046] As an optional technical solution in this embodiment, the first document location data may include the target document data in the target document, the target arrangement position data of the target document data in the target document, and the relative position of the drawing point to the target document data. The document data of the target document includes multiple characters, and the target document data may be a target character in the target document. Specifically, the first document location data includes target character location data and character relative position data. The target character location data may specifically include the character arrangement position data of the target character associated with the drawing point in the target document. For example, the target character location data may be data indicating which character the target character is in the target document. The character relative position may specifically include the position offset data of the drawing point relative to the target character. Optionally, the first document location data may also include the target character in the target document associated with the target document data, such as the target character associated with the drawing point, so as to achieve rapid positioning of the document drawing data through the target document data.
[0047] For example, the target character position data may include at least one of the following: identification data indicating the chapter (chapter identifier), identification data indicating the paragraph (paragraph identifier), identification data indicating the line (line identifier), and character offset data indicating the target character relative to its chapter, paragraph, or line. The character offset data indicates which character the target character is within its chapter, paragraph, or line. For instance, the target character position data may include a chapter identifier, a paragraph identifier, and character offset data indicating the target character relative to its paragraph. The relative character position may include position offset data of the drawing point relative to the target point of the character frame corresponding to the target character in at least one preset direction. The target point may be a vertex or center point of the character frame; specifically, the target point may be a vertex located at the bottom edge of the character frame.
[0048] Optionally, displaying the first document data of the target document in the reader includes: a data display request for the target document, determining the first document data in the target document based on the data display request, and displaying the first document data in the reader. The data display request for the target document can be generated based on a display trigger operation for the target document or based on a preset trigger event. For example, the display trigger operation for the target document may include, but is not limited to, at least one of the following operations: receiving a document identifier selection operation for the target document, dragging the target document into the reader, and receiving a data switching operation that switches the document data displayed in the reader to the document data of the target document. The preset trigger event may include, but is not limited to, at least one of the following events: reaching a preset document display time for the target document, receiving the target document, and receiving a document display notification message sent through a preset interface.
[0049] S120. In response to a data update operation for the target document, determine second document data to be displayed in the reader based on the data update operation, and display the second document data in the reader.
[0050] In this embodiment of the disclosure, the data update operation for the target document can be understood as an operation for updating the display information of document data in the reader, or as an operation for updating the first document data in the reader to the second document data. Exemplarily, the data update operation for the target document may include a document data switching operation for switching the displayed document data of the target document and / or a document layout adjustment operation for the layout data of the target document's document data in the reader. For example, the document data switching operation may be a sliding operation on the reader, or a control trigger operation on a content switching control (e.g., a chapter table of contents) corresponding to the target document, etc. The document layout adjustment operation may at least include an operation for adjusting the display size and / or display spacing of the document data. For example, in the case where the document data of the target document includes multiple text lines, each text line including at least one character, the document layout adjustment operation may be an operation for adjusting the character size and / or an operation for adjusting the line spacing between text lines, etc. After performing the data update operation, the second document data displayed in the reader may be the same as or different from the first document data.
[0051] As an optional implementation of this disclosure, when the data update operation includes a document layout adjustment operation, the step of determining the second document data to be displayed in the reader based on the data update operation may specifically include: obtaining first layout data before performing the document layout adjustment operation on the target document; determining second layout data based on the document layout adjustment operation and the first layout data; determining the data adjustment amount between the first layout data and the second layout data; and determining the second document data to be displayed in the reader based on the data adjustment amount and the first document data.
[0052] As another optional implementation of this disclosure, when the data update operation includes a document data switching operation, the step of determining the second document data to be displayed in the reader based on the data update operation may specifically include: in response to a directory triggering operation for the document directory of the target document, determining the second document data to be displayed in the reader based on the directory triggering operation and the document directory; or, in response to a sliding operation applied to the reader, determining the sliding operation and the first document data to determine the second document data to be displayed in the reader.
[0053] S130. If a first drawing point associated with the second document data exists among multiple drawing points, obtain the drawing style parameters of the first drawing point, and draw the second drawing point in the reader according to the drawing style parameters, the second document data, and the first document position data of the first drawing point.
[0054] In this embodiment of the disclosure, the first drawing point associated with the second document data can be understood as a drawing point among a plurality of drawing points to be associated with and displayed with the second document data, or, in other words, a drawing point among a plurality of drawing points whose position relative to the target document is adjacent to the second document data. For example, specifically, the first document position data corresponding to the plurality of drawing points may include the drawing point of the target document position data corresponding to the second document data.
[0055] As an optional implementation of this disclosure, after determining the second document data to be displayed in the reader according to the data update operation, and before drawing the second drawing point in the reader based on the second document data and the first document position data of the first drawing point, the method further includes: determining the document display area corresponding to the second document data according to the corresponding data layout position of the second document data in the target document; and determining the first drawing point associated with the second document data from the plurality of drawing points according to the document display area and the first document position data of the plurality of drawing points. Using this technical solution, the first drawing point associated with the second document data can be quickly and accurately determined from the text drawing data associated with the target document, without needing to recalculate the drawing position of drawing points unrelated to the second document data, thus saving the amount of data computation during the redrawing of drawing points and effectively improving the drawing efficiency of drawing points.
[0056] The target layout position data corresponding to the second document data in the target document may include at least one of the following: the chapter, paragraph, and text line where the second document data is located. For example, if the target layout position data of the target document data in the first document position data of the drawing point matches the target layout position data of the second document data in the target document, the drawing point is determined as the first drawing point associated with the second document data. Specifically, the first document position data of multiple drawing points associated with the target document are queried based on the target layout position data corresponding to the second document data; the first drawing point associated with the second document data is determined from the queried data including the target layout position data corresponding to the second document data.
[0057] In this embodiment of the disclosure, the drawing style parameter of the first drawing point can be understood as the drawing style parameter used when drawing the first drawing point. The drawing style parameter can be understood as the parameter used to determine the style of the drawing point when drawing the trajectory. The drawing style parameter can be a default parameter or a style parameter configured according to parameter configuration operations to present the drawing point. Configuring the drawing style parameter allows the drawn trajectory to present a preset effect.
[0058] When there is a first drawing point associated with the second document data among multiple drawing points, the first drawing point can be redrawn in the reader for associated display with the second document data. In order to restore as much as possible the relative display effect between the first drawing point and the second document data during drawing, the regional drawing position data of the first drawing point in the reader can be determined according to the second document data and the first document position data of the first drawing point, that is, the first regional position data of the first drawing point relative to the reader is determined, and then the first drawing point is drawn at the target position corresponding to the regional drawing position data in the reader according to the drawing style parameter to obtain a second drawing point.
[0059] As Figure 1B shown, taking the target document as a document including poem data as an example, the first document data can be the content of the poem "Prelude to Water Melody - When Will the Moon Be Clear and Bright". The multiple drawing points associated with this poem displayed in the reader are the multiple drawing points of the first track corresponding to "Ragged rocks pierce the sky, waves pound on the shore, rolling up thousands of heaps of snow.", and the multiple drawing points of the second track corresponding to "With a plume fan in hand and silk kerchief on head,谈笑间,樯橹灰飞烟灭." After updating the first document data to the content of the poem "The River All Red" as the second document data, the multiple drawing points displayed in the reader can be updated to the multiple drawing points of the third track corresponding to "Thirty years of fame are like dust and soil, eight thousand miles of journey like cloud and moon." and the multiple drawing points of the fourth track corresponding to "Don't idle away your time, in vain will youth turn white, grief will fill your heart!" That is, when the document data is updated, the document drawing data associated with the document data will be updated following the update of the document data.
[0060] The technical solution of this disclosure, by displaying the first document data of the target document in a reader, allows for intuitive and convenient viewing of the first document data of the target document. It is applicable to scenarios where the target document is associated with document drawing data. Furthermore, since the document drawing data includes multiple drawing points relative to the first document position data of the target document, it achieves document drawing data generation by recording the relative positions between the drawing points and the target document. This differs from recording the screen drawing coordinates of the drawing points, providing data basis for restoring the relative display effect of the drawing points and document data during drawing. Moreover, the target document can be marked using multiple drawing points. Then, in response to a data update operation for the target document, the second document data to be displayed in the reader is determined based on the data update operation, and the second document data is displayed in the reader. This allows for document data to be viewed through simple interactive operations. The system enables flexible updating of data; and, in the case where a first drawing point associated with the second document data exists among multiple drawing points, it obtains the drawing style parameters of the first drawing point, and draws a second drawing point in the reader based on the drawing style parameters, the second document data, and the first document position data of the first drawing point. This allows the display of the second drawing point corresponding to the second document data when the document data of the target document is updated from the first document data to the second document data, truly realizing flexible marking of the target document and re-viewing of the document drawing data. It also presents the relative display effect of the second drawing point and the second document data during drawing, solving the problem in related technologies where the marked content of the target document is no longer displayed or no longer associated with the expected document content due to document content updates. This achieves the technical effect of linking the updating of drawing points and document data when the data of the target document changes.
[0061] Figure 2 This is a flowchart illustrating another data processing method provided in this embodiment. Based on the above embodiments, the technical solution of this embodiment refines the drawing method of the second drawing point. Optionally, drawing the second drawing point in the reader according to the drawing style parameters, the second document data, and the first document position data of the first drawing point includes: determining the first region position data of the first drawing point relative to the reader based on the second document data and the first document position data of the first drawing point; and drawing the second drawing point in the reader according to the drawing style parameters and the first region position data when the first region position data is located in the reader. For detailed implementation, please refer to the description of this embodiment. Technical features that are the same as or similar to those in the foregoing embodiments will not be repeated here. Figure 2 As shown, the method in this embodiment may specifically include:
[0062] S210. Display first document data of the target document in the reader; wherein, the target document is associated with document drawing data; the document drawing data includes first document position data of multiple drawing points relative to the target document; the multiple drawing points are used to mark the target document.
[0063] S220. In response to a data update operation for the target document, determine second document data to be displayed in the reader based on the data update operation, and display the second document data in the reader.
[0064] S230. If there is a first drawing point associated with the second document data among multiple drawing points, obtain the drawing style parameters of the first drawing point, and determine the first region position data of the first drawing point relative to the reader based on the second document data and the first document position data of the first drawing point.
[0065] The first region location data can be understood as the drawing position data of the first drawing point relative to the reader, used to characterize where the first drawing point is to be drawn on the reader. The location corresponding to the first region location data may be a location within the reader or a location outside the reader.
[0066] As an optional implementation of this disclosure, determining the first region position data of the first drawing point relative to the reader based on the second document data and the first document position data of the first drawing point may specifically include: determining the second document position data based on the data update operation and the first document position data of the first drawing point, and determining the first region position data of the first drawing point relative to the reader based on the second document data and the second document position data.
[0067] Optionally, if the data update operation does not include a document layout adjustment operation, that is, if the layout data corresponding to the second document data is the same as that corresponding to the first document data, the first position data of the first drawing point is the second document position data. In this case, determining the first region position data of the first drawing point relative to the reader based on the second document data and the second document position data includes: determining the target document data corresponding to the first drawing point in the second document data; and determining the first region position data of the first drawing point relative to the reader based on the display position data of the target document data on the reader and the second document position data of the first drawing point (position offset data of the first drawing point relative to the target document data).
[0068] Optionally, when the data update operation includes a document layout adjustment operation, i.e., when at least some data of the layout data corresponding to the second document data is different (not completely the same) from that of the first document data, determining the second document position data based on the data update operation and the first document position data of the first drawing point includes: obtaining the first layout data before performing the document layout adjustment operation on the target document; determining the second layout data based on the document layout adjustment operation and the first layout data; determining the data adjustment amount between the first layout data and the second layout data; and determining the second document position data based on the data adjustment amount and the first document position data of the first drawing point. The advantage of this technical solution is that it can update the display position data of the first drawing point relative to the target document based on the layout data, so that after drawing the second drawing point corresponding to the first drawing point in the reader, the relative display effect of the second drawing point and the second document data is similar to or the same as the display effect of the first drawing point relative to the second document data when it is drawn on the target document.
[0069] Specifically, determining the second document position data based on the data adjustment amount and the first document position data of the first drawing point includes: adjusting the position offset data in the first document position data of the first drawing point based on the data adjustment amount, and determining the second document position data based on the display position data of the target document data in the reader and the adjusted position offset data.
[0070] For example, taking a scenario where the target document includes multiple text lines, and each text line includes at least one document character, assume that the first layout data may include the first character size of the document character and / or the first line spacing between the text lines; the position offset data in the first drawing position data of the first drawing point is (first direction offset, second direction offset), where the first direction is the arrangement direction of the document character in the text line, and the second direction is the direction perpendicular to the first direction; the second layout data includes the second character size of the document character and / or the second line spacing between the text lines. In this case, the first direction offset in the position offset data of the first drawing position data of the first drawing point is obtained by multiplying the quotient of the first character size divided by the second character size by the first direction offset; the first direction offset in the position offset data of the first drawing position data of the first drawing point is obtained by multiplying the quotient of the first line spacing divided by the second line spacing by the second direction offset.
[0071] As mentioned above, the first document location data includes target character location data and character relative location data. Based on this, determining the first drawing point's location relative to the reader's first area based on the second document data and the first document location data of the first drawing point may include: determining the target character's relative area position data relative to the reader based on the target character location data; and determining the first drawing point's location relative to the reader's first area based on the relative area position data and the character relative location data. In short, the position of the drawing point relative to the display area can be determined by first determining the relative position of the target character relative to the reader, and then combining this with the relative position between the drawing point and the target character. Using this technical solution, the location of the first drawing point on the reader can be determined quickly and accurately.
[0072] Specifically, determining the relative position data of the target character associated with the drawing point relative to the reader based on the target character position data includes: determining the target character associated with the first drawing point based on the target character position data, and determining the relative position data of the target character relative to the reader based on the second document data.
[0073] As an optional implementation of this disclosure, when the target character position data includes a chapter identifier, a paragraph identifier, and character offset data representing the target character relative to its paragraph, the step of determining the target character associated with the drawing point based on the target character position data may specifically include: first determining the target chapter in the target document that includes the target character based on the chapter identifier in the target character position data; then determining the target paragraph in the target chapter that includes the target character based on the paragraph identifier in the target character position data; and then determining the target character associated with the drawing point from the target paragraph based on the character offset data in the target character position data. This allows for rapid positioning of the target character based on the target character position data without needing to identify the character content.
[0074] As another alternative embodiment of the present disclosure, when the first document position data includes a target character and the target character position data includes a chapter identifier and a paragraph identifier, determining the target character associated with the first drawing point according to the target character position data may specifically include first determining a target chapter in the target document that includes the target character according to the chapter identifier in the target character position data, then determining a target paragraph in the target chapter that includes the target character according to the paragraph identifier in the target character position data, and then searching for candidate characters identical to the target character in the target paragraph, and determining the target character from the candidate characters.
[0075] It can be understood that when the number of candidate characters is one, the candidate character is determined as the target character. When the number of candidate characters is multiple, that is, when there are multiple characters identical to the target character corresponding to the drawing point in the same paragraph, the target character corresponding to the drawing point can be determined according to the target characters corresponding to other drawing points located on the same trajectory as the drawing point. That is, the target character of the drawing point is determined by comparing the target characters corresponding to multiple drawing points with the document data. For example, continuing Figure 1B , taking the target character of the drawing point as "thousand" as an example, both "All men of note through the ages" and "Roll up a thousand heaps of waves" include "thousand". Since the characters before and after "thousand" are different in different sentences, it is possible to determine which "thousand" corresponds to the drawing point by whether the other drawing points correspond to "rise", "heap" or "ancient".
[0076] In order to be able to locate the target character conveniently and accurately, multiple drawing points located on the same trajectory can be stored as a set of data, or rather, multiple drawing points presenting as a continuous trajectory can be stored as a set of data. That is, multiple drawing points are grouped and stored, and multiple drawing points in each group are used to represent a continuous trajectory. In this way, when redrawing the drawing points, the target character corresponding to them can be accurately determined according to the first document position data corresponding to multiple drawing points on the same trajectory.
[0077] S240. When the first area position data is located in the reader, draw a second drawing point in the reader according to the drawing style parameter and the first area position data.
[0078] In the disclosed embodiment, the display manner of the target document in the reader can be adjusted as needed. Therefore, it is possible that due to a data update operation, the area drawing position of the redetermined drawing point exceeds the reader. In this case, the drawing operation can no longer be performed on these drawing points that exceed the reader to save performance.
[0079] As an optional technical solution in this embodiment, after determining the position data of the first drawing point relative to the first region of the reader, and before drawing the second drawing point in the reader according to the drawing style parameters and the first region position data, the first region position data can be compared with the region boundary data of the reader to determine whether the first region position data is located in the reader. Then, if the first region position data is located in the reader, the drawing operation of the drawing point is performed.
[0080] Specifically, drawing a second drawing point in the reader according to the drawing style parameters and the first area position data includes: drawing a drawing point, i.e., the second drawing point, at the position in the reader corresponding to the first area position data using the drawing style parameters.
[0081] The technical solution of this disclosure, by determining the first drawing point's position data relative to the reader's first region based on the second document data and the first document position data of the first drawing point, can transform the position of the first drawing point from the document coordinate system to the reader's local coordinate system based on the updated document data and the first document position data, thereby determining the position data of the first drawing point in the reader's local coordinate system and thus determining whether the first drawing point will be displayed in the reader; then, by drawing a second drawing point in the reader based on the drawing style parameters and the first region position data when the first region position data is located in the reader, the first drawing point that needs to be displayed in the reader can be drawn, reducing the performance consumption caused by drawing drawing points that do not need to be displayed in the reader, and improving the drawing efficiency of the second drawing point associated with the second document data while ensuring the visualization display effect.
[0082] Figure 3A This is a flowchart illustrating another data processing method provided in this embodiment. Based on the above embodiments, this embodiment further refines the method of drawing and recording drawing points in the target document. Optionally, after displaying the first document data of the target document in the reader, the method further includes: responding to a trajectory drawing operation input in the reader, obtaining drawing style parameters corresponding to the trajectory drawing operation, determining region drawing position data based on the touch point of the trajectory drawing operation; drawing at least one drawing point in the reader based on the region drawing position data and the drawing style parameters, and recording the first document position data of each drawing point relative to the target document. For detailed implementation, please refer to the description of this embodiment. Technical features that are the same as or similar to those in the foregoing embodiments will not be repeated here. Figure 3A As shown, the method in this embodiment may specifically include:
[0083] S310. Display the first document data of the target document in the reader.
[0084] S320. In response to a trajectory drawing operation input in the reader, obtain drawing style parameters corresponding to the trajectory drawing operation, and determine area drawing position data based on the touch point of the trajectory drawing operation.
[0085] In this embodiment of the disclosure, the trajectory drawing operation can be understood as an operation that draws a trajectory through a preset interaction method. For example, the trajectory drawing operation can be an operation of drawing a trajectory in the reader through touch operation, such as touching the touch screen displaying the reader with a finger or using a stylus to move the cursor within the reader on the touch screen; or it can be by dragging the cursor and moving it within the reader, etc.
[0086] As an optional technical solution of this disclosure embodiment, before obtaining the drawing style parameters corresponding to the trajectory drawing operation, the method further includes: displaying a parameter configuration item for at least one preset style parameter; wherein the preset style parameter is associated with the display style of the drawing point; in response to a parameter configuration operation for at least one of the parameter configuration items, determining the drawing style parameters for drawing the drawing point according to the preset style parameter and the parameter configuration operation. The preset style parameter can be understood as a parameter used to set the display style of the drawing point. Exemplarily, the preset style parameter may include, but is not limited to, at least one of parameters such as drawing color parameters, drawing size parameters, and drawing type parameters. The drawing color parameter can be understood as a parameter used to set the color of the drawing point in the reader. The drawing size parameter can be understood as a parameter used to set the size of the drawing point in the reader, such as the radius or major and minor axes of the drawing point. The drawing type parameter can be understood as a parameter used to set the shape type of one or more drawing points in the reader. The drawing parameter type can be represented by the drawn drawing point. For example, the drawing type parameter can be represented by the type of brush used, such as one or more types such as a brush, pen, crayon, and watercolor pen. Parameter configuration items can be understood as information items that allow for the interactive editing of preset style parameters. Parameter configuration operations for these items may include selecting the preset style parameter and / or configuring the specific attribute values of the selected preset style parameter. For example, selecting a brush type as a calligraphy brush, or, in addition to selecting a calligraphy brush, selecting the brush model (e.g., related to the brush tip and diameter).
[0087] For example, at least one preset style parameter identifier can be displayed; in response to an identifier configuration operation for the style parameter identifier, the preset style parameter corresponding to the most recently selected style parameter identifier at the current time is obtained to determine the drawing style parameter for drawing the drawing point.
[0088] In this embodiment of the disclosure, by configuring at least one preset style parameter parameter, and then determining the drawing style parameter for drawing the drawing point based on the preset style parameter and the parameter configuration operation, it is possible not only to support the differentiated drawing requirements of document drawing data, but also to intuitively and effectively distinguish different document content through document drawing data associated with document data. Especially when a large amount of document data in the target document is associated with document drawing data, it can effectively avoid the situation where a large amount of document data uses a single style of drawing trajectory, making it difficult to intuitively distinguish different document data, thereby improving the marking and viewing experience of the target document.
[0089] As an optional technical solution in this disclosure, determining the region drawing position data based on the touch point of the trajectory drawing operation may include: obtaining the coordinate data of the touch point of the trajectory drawing operation according to the touch sampling frequency, so as to obtain the region drawing position data corresponding to the touch point. The touch sampling frequency may be a preset touch sampling frequency of an electronic device displaying a reader, or a touch sampling frequency set specifically for the trajectory drawing operation, etc.
[0090] S330. Draw at least one drawing point in the reader according to the region drawing position data and the drawing style parameters, and record the first document position data of each drawing point relative to the target document.
[0091] After obtaining the region drawing position data and the drawing style parameters, the drawing points can be drawn in the reader at the target positions corresponding to the region drawing position data according to the drawing style parameters. This allows for a direct view of the drawing effect of the drawing points. To enable further viewing of the drawing points and ensure their relative display effect with the target document, it is also necessary to record the relative display position of each drawing point relative to the target document, i.e., the first document position data.
[0092] As an optional implementation of this disclosure, recording the first document position data of each drawing point relative to the target document may specifically include: determining the target character associated with the first drawing point in the target document based on the region drawing position, determining the character layout position data of the target character in the target document, recording the character layout position data to obtain target character position data; and determining the region-relative position data of the target character relative to the reader, determining the position offset data of the drawing point relative to the target character based on the region-relative position data and the region drawing position data, recording the position offset data to obtain character relative position data. By adopting this technical solution, by recording the position of the target character in the document and the relative position of the drawing point and the target character, the relative display data between the drawing point and the document data can be effectively recorded. This ensures that when the document data is viewed again, the effect of the document drawing data and the document data presented is the same as when it was drawn, presenting a visual effect of the document drawing data drawn in the target document.
[0093] It is understood that the character layout position data of the target character in the target document is determined based on the layout data of the target document, and is unrelated to which document data is displayed by the reader. The regional relative position data of the target character relative to the reader is determined based on the number of documents displayed in the reader. The target character may or may not be displayed in the reader, but regardless of whether it is displayed in the reader, the regional relative position data of the target character relative to the reader can be determined based on the document data displayed in the reader.
[0094] As an optional implementation of this disclosure, determining the target character associated with the first drawing point in the target document based on the region drawing position may include: determining character frames of multiple characters in the target document, determining a reference line corresponding to the region drawing position data, and determining the target character associated with the drawing point based on the relative positional relationship between the reference line and the character frames. The reference line extends in a direction perpendicular to the line extension direction of the text lines in the target document. The line extension direction can be understood as the arrangement direction of the document characters in the text lines. The character frame of a character can be understood as a border surrounding the character, or the character's bounding box. Typically, there is no overlap between the character frames of two characters.
[0095] Optionally, determining the target character associated with the drawing point according to the relative positional relationship between the reference line and the character box includes: in the case where there is a character box intersecting with the reference line, determining the document character in the character box that intersects with the reference line and is closest to the area drawing position as the target character associated with the drawing point. Optionally, determining the target character associated with the drawing point according to the relative positional relationship between the reference line and the character box includes: in the case where there is no character box intersecting with the reference line, determining the position data range corresponding to the drawing point in the direction perpendicular to the reference line according to the area drawing position data and a preset variation amount, and determining the target character in the character box that first falls into the position data range as the target character associated with the drawing point. Further, in the case where there are multiple character boxes that first fall into the position data range, a character in a randomly selected character box from the multiple character boxes can be determined as the target character associated with the drawing point, or a character in the character box located in the preset direction of the drawing point among the multiple character boxes can be determined as the target character associated with the drawing point, etc.
[0096] Exemplarily, as Figure 3B shown, taking the row extension direction as the X direction and the direction perpendicular to the X direction as the Y direction, when determining the target character associated with the drawing point A on the trajectory 102 drawn in the reader 10, a perpendicular line can be drawn along the Y direction through the drawing point A, that is, the reference line 103. The character in the character box 101 that intersects with the reference line 103 and is the closest is "满", so "满" is the target character associated with the drawing point A. When determining the target character associated with the drawing point B, a perpendicular line can be drawn along the Y direction through the drawing point B, that is, the reference line 104. At this time, no character box intersecting with the reference line 104 is obtained. Then, the coordinate data of the drawing point B in the X direction can be determined, and a preset value can be gradually added to and / or subtracted from this coordinate data to obtain a coordinate range such that the coordinate data of the vertex of a certain character box in the X direction falls into this coordinate range. The character in the character box corresponding to the vertex that falls into this coordinate range is determined as the character associated with the drawing point B. For example, by gradually adding the preset value to this coordinate data, it can be determined that the target character associated with the drawing point B is "江", and by gradually subtracting the preset value from this coordinate data, it is determined that the target character associated with the drawing point B is "满". By gradually adding the preset value and subtracting the preset value to this coordinate data and expanding the search range towards both ends simultaneously, the character in the character box that first falls into this coordinate range can be determined as the target character associated with the drawing point B, which is "满".
[0097] As an optional implementation manner of the embodiments of the present disclosure, the relative position data of the region includes the position data of multiple vertices of the character box. Further, determining the position offset data of the drawing point relative to the target character according to the relative position data of the region and the drawing position data of the region may include: determining the relative position of the drawing point relative to the target character according to the relative position data of the region and the position data of the vertex on the preset orientation of the character box. For example, it may be the position data of the vertex on the lower border of the character box. Taking a rectangular character box as an example, the position data of the vertex on the preset orientation of the character box may be the position data of the vertex at the lower left corner of the character box or the position data of the vertex at the lower right corner of the character box.
[0098] Continuing to use Figure 3B , the relative position of the drawing point A relative to the target character "满" can be determined by the coordinate data of the drawing point A and the position offset data dx in the X direction and the position offset data dy in the Y direction of the vertex at the lower left corner of the character box 101. That is, the relative position of the drawing point relative to the target character is (dx, dy).
[0099] S340. In response to a data update operation for the target document, determine second document data to be displayed in the reader according to the data update operation, and display the second document data in the reader.
[0100] S350. In the case where there is a first drawing point associated with the second document data among multiple drawing points, obtain the drawing style parameters of the first drawing point, and draw a second drawing point in the reader according to the drawing style parameters, the second document data, and the first document position data of the first drawing point.
[0101] The technical solution of this disclosure, in response to a trajectory drawing operation input in the reader, obtains drawing style parameters corresponding to the trajectory drawing operation, and determines region drawing position data based on the touch point of the trajectory drawing operation. This enables flexible drawing of trajectory data for the target document's document data in the reader, and determines the drawing style and display position in the reader based on the touch point of the trajectory drawing operation, providing data basis for the presentation and recording of drawing points. Then, by drawing at least one drawing point in the reader based on the region drawing position data and the drawing style parameters, and recording the first document position data of each drawing point relative to the target document, the drawing points corresponding to the trajectory drawing operation can be accurately presented in the reader based on the region drawing position data and the drawing style parameters, and the relative position of each drawing point to the target document can be accurately recorded through the first document position data, so as to enable the re-viewing of the drawing points.
[0102] To facilitate a clear and intuitive understanding of the data processing method provided in this disclosure, we will use a reader as an example, focusing on a scenario involving highlighting content in an electronic document, to illustrate the data processing method provided in this disclosure. The implementation process of the data processing method in this example may specifically include the following:
[0103] First, the freehand drawing mode can be enabled or disabled as needed to enable free drawing on the target document. When enabled, lines can be drawn on the content of the target document displayed on the terminal device's screen, and multiple drawing points on the lines can be recorded. To enrich the presentation of the drawn data, the pen type, pen color, and pen size (used to represent line thickness) can be set according to the drawing parameter settings. The device receives trajectory drawing operations via the screen, such as touch operations on a touchscreen. The coordinate data of the touch point is obtained through the terminal device's operating system's preset data interface. Then, the graphics drawing interface is used to draw the touch point (drawing point) at the coordinates corresponding to the touch point on the device screen. The style of the drawing point depends on the pen configuration, such as pen color (affecting the color of the drawing point), pen thickness (affecting the radius of the drawing point), and pen type (affecting the color and radius of the drawing point). For example, when the pen type is a pen, the pen's drawing point is a solid, perfectly circular, uniformly colored point, and is generally thin. When the brush type is a calligraphy brush, the brushstroke point is an ellipse with uneven color (e.g., some parts are colored, some are blank, some are dark or some are light), and it is generally thicker. Then, you can move the brush on the device screen, at which point it will draw lines of the specified style according to the coordinates (x, y) of the touch point. While swiping, the coordinate sequence of the touch point during the movement is recorded.
[0104] like Figure 4A As shown, during the line drawing process, multiple trajectory points (drawing points) along the line are recorded. For example, the drawing point at the start of the line with screen coordinates (400, 30) can be recorded, followed by the drawing point at screen coordinates (600, 35), and then the drawing point at the end of the line with screen coordinates (850, 40), and so on. In other words, the screen touch coordinates of the touch points are recorded, which is the area drawing position data of the touch points in the reader. It can be understood that the number of recorded drawing points depends on the screen touch sampling rate (touch sampling frequency) of the terminal device. For example, if the screen touch sampling rate is 60 Hz, 60 touch point coordinates will be recorded within 1 second during continuous line drawing. In addition to recording the screen touch coordinates of multiple points (i.e., drawing points) on the line, the pen type, pen color, and pen thickness configuration selected for drawing the line are also recorded.
[0105] Next, the recorded multiple drawing points need to be formatted and recorded to reconstruct the drawn lines using the recorded data. Specifically, when drawing lines, in addition to recording the trajectory of the pen (multiple drawing points), it is also necessary to record the text content matched by each drawing point, as follows: First, determine the border (character box) surrounding each character. Then, with the text line layout direction as the horizontal direction (generally parallel or perpendicular to the border of the reader displaying the text content), draw a vertical line perpendicular to the horizontal direction through each drawing point on the device screen at (x, y), and find the character box where the vertical line intersects with the content. Then, record the position of the text within the character box in the document, represented by (chapter identifier, paragraph identifier, paragraph offset data). Next, record the vertical distance and horizontal distance of the drawing point from the bottom border of the character box, represented by (dx, dy). Calculate the coordinates (chapter identifier, paragraph identifier, paragraph offset data) of the target text corresponding to multiple drawing points, and then save the offset position data (dx, dy) of the drawing point relative to the target character. It is also necessary to save the layout data of the target document, including at least the text size and line spacing information.
[0106] Because text is never continuous, there may be spaces within sentences or spaces outside the layout area. In such cases, the vertical coordinates of certain points on the line may not fall on a specific character, requiring special calculation. Specifically, if no text box intersects with the vertical line is found, that is, if the vertical coordinates of a certain drawn point cannot fall on the target character, the coordinate data of that drawn point can be expanded horizontally to both sides according to a preset step size to find the intersection point until the target character is found.
[0107] like Figure 4B As shown, for example, if the x-coordinate of the drawn point is 550, the right coordinate of the text on the left is 530, and the left coordinate of the text on the right is 570, then the coordinates of the point are gradually expanded to both sides to become a range. First, increase by 1 to become [549, 551]. There is no matching text. Then increase to [548, 552], until it increases to [530, 570], which can match the text on the left. Then the text information matched by this point is the text on the left. Then, in the same way as before, the horizontal distance dx and the vertical distance dy of the drawn point from the bottom border of the character box are calculated.
[0108] Finally, after the target document is reformatted (e.g., by performing one or more operations such as changing fonts, line spacing, switching between portrait and landscape modes, or changing devices), the drawn content will be restored according to the following steps: The content of the target document is updated based on the reformatted layout data. After the target document content is updated, the chapter containing the text displayed on the device screen is determined. The underline data for that chapter is retrieved from the document drawing data stored for the target document, based on the chapter and paragraph identifiers corresponding to the drawing points. The text coordinates (chapter identifier, paragraph identifier, paragraph offset, etc.) matched to each drawing point are used to find the reformatted target document that matches each drawing point. The system calculates a new offset distance (dx', dy') between the target text and the marked text, based on the recorded offset position data (dx, dy) between the drawing point and its matching target text, as well as the layout data used for re-layout (including text size and line spacing). Then, based on the position of the character box and the distance (dx', dy') between the pixel and the character box, it obtains the new line coordinates (x', y'). Finally, using the recorded pen configuration, it draws a point at (x', y') to ensure that the drawing point on the device screen adapts to changes in text size and line spacing, accurately restoring the distance between the line and the text. By traversing all drawing points on the line and drawing all points, the system can accurately restore the style and position of the line at its creation. It's important to note that if a drawing point exceeds the layout area due to re-layout during line restoration, it will not be drawn again.
[0109] It is understandable that, regardless of the pattern or line type being drawn, the trajectory can be recorded by capturing multiple drawing points during the drawing process. Therefore, the technical solution disclosed herein is applicable to scenarios involving the drawing of dashed lines, double horizontal lines, and various other types of lines. It can fully meet the differentiated drawing needs of different users.
[0110] The technical solution of this disclosure embodiment realizes free drawing in the target document, and provides logic for parsing, locating and storing free drawing and matching text in the reflow, so that when viewing electronic documents in a reader, one can achieve the same free drawing experience as in traditional paper books.
[0111] Figure 5 This is a schematic diagram of the structure of a data processing apparatus provided in an embodiment of the present disclosure, as shown below. Figure 5 As shown, the data processing device includes a document data display module 510, a document data update module 520, and a drawing data restoration module 530. Specifically, the document data display module 510 is used to display first document data of a target document in a reader; wherein, the target document is associated with document drawing data; the document drawing data includes first document position data of multiple drawing points relative to the target document; the multiple drawing points are used to mark the target document; the document data update module 520 is used to determine second document data to be displayed in the reader according to the data update operation in response to the data update operation of the target document, and display the second document data in the reader; and the drawing data restoration module 530 is used to obtain the drawing style parameters of the first drawing point when there is a first drawing point associated with the second document data among the multiple drawing points, and draw the second drawing point in the reader according to the drawing style parameters, the second document data, and the first document position data of the first drawing point.
[0112] The technical solution of this embodiment displays the first document data of a target document in a reader through a document data display module 510. This allows for intuitive and convenient viewing of the first document data of the target document, and is applicable to scenarios where the target document is associated with document drawing data. Furthermore, since the document drawing data includes the first document position data of multiple drawing points relative to the target document, it achieves document drawing data generation by recording the relative positions between the drawing points and the target document. This differs from recording the screen drawing coordinates of the drawing points, and provides data basis for restoring the relative display effect of the drawing points and document data during drawing. Moreover, the target document can be marked using multiple drawing points. Then, in response to a data update operation for the target document, the document data update module 520 determines the second document data to be displayed in the reader based on the data update operation and displays the second document data in the reader. This can be achieved through simple interactive operations. The system allows for flexible updating of document data. Furthermore, when a first drawing point associated with the second document data exists among multiple drawing points via the drawing data restoration module 530, the drawing style parameters of the first drawing point are obtained. Based on these parameters, the second document data, and the first document position data of the first drawing point, a second drawing point is drawn in the reader. This enables the display of the second drawing point corresponding to the second document data when the document data of the target document is updated from the first document data to the second document data. This truly achieves flexible marking of the target document and allows for re-viewing of the document drawing data. It also presents the relative display effect of the second drawing point and the second document data during drawing. This solves the problem in related technologies where updated document content causes the marked content of the target document to no longer be displayed or no longer associated with the expected document content. It achieves the technical effect of linked updating of drawing points and document data even when the data of the target document changes.
[0113] Based on any optional technical solution in the embodiments of this disclosure, the drawing data restoration module may optionally include a region position conversion unit and a drawing point drawing unit. The region position conversion unit is used to determine the first region position data of the first drawing point relative to the reader based on the second document data and the first document position data of the first drawing point; the drawing point drawing unit is used to draw a second drawing point in the reader based on the drawing style parameters and the first region position data, provided that the first region position data is located in the reader.
[0114] Based on any optional technical solution in the embodiments of this disclosure, the region position conversion unit is specifically used to: determine second document position data according to the data update operation and the first document position data of the first drawing point, and determine the first region position data of the first drawing point relative to the reader according to the second document data and the second document position data.
[0115] Optionally, based on any optional technical solution in the embodiments of this disclosure, the data update operation includes a document layout adjustment operation. Further, the document data update module includes a layout data determination unit and a document position adjustment unit. The layout data determination unit is used to acquire first layout data before performing the document layout adjustment operation on the target document, and determine second layout data based on the document layout adjustment operation and the first layout data; the document position adjustment unit is used to determine the data adjustment amount between the first layout data and the second layout data, and determine second document position data based on the data adjustment amount and the first document position data of the first drawing point.
[0116] Based on any optional technical solution in the embodiments of this disclosure, optionally, the first document position data includes target character position data and character relative position data; the target character position data may include the character arrangement position data of the target character associated with the drawing point in the target document; the character relative position includes the position offset data of the drawing point relative to the target character.
[0117] Based on any optional technical solution in the embodiments of this disclosure, the region position conversion unit optionally includes a character position determination subunit and a drawing position determination subunit. The character position determination subunit is used to determine the region-relative position data of the target character associated with the drawing point relative to the reader based on the second document data and the target character position data; the drawing position determination subunit is used to determine the first region position data of the first drawing point relative to the reader based on the region-relative position data and the character-relative position data.
[0118] Optionally, based on any optional technical solution in the embodiments of this disclosure, the data processing device further includes a document update location determination module and an associated drawing point determination module. The document update location determination module is used to determine the document display area corresponding to the second document data based on the corresponding data arrangement position of the second document data in the target document, after determining the second document data to be displayed in the reader according to the data update operation and before drawing the second drawing point in the reader based on the second document data and the first document location data of the first drawing point. The associated drawing point determination module is used to determine a first drawing point associated with the second document data from among the multiple drawing points based on the document display area and the first document location data of the multiple drawing points.
[0119] Optionally, based on any of the optional technical solutions in the embodiments of this disclosure, the data processing device further includes a trajectory drawing module and a drawing point recording module. The trajectory drawing module is configured to, after displaying the first document data of the target document in the reader, respond to a trajectory drawing operation input in the reader, acquire drawing style parameters corresponding to the trajectory drawing operation, and determine region drawing position data based on the touch point of the trajectory drawing operation; the drawing point recording module is configured to draw at least one drawing point in the reader based on the region drawing position data and the drawing style parameters, and record the first document position data of each drawing point relative to the target document.
[0120] Optionally, based on any of the optional technical solutions in the embodiments of this disclosure, the data processing device further includes a drawing parameter configuration module and a drawing parameter determination module. The drawing parameter configuration module is used to display at least one preset style parameter configuration item before obtaining the drawing style parameters corresponding to the trajectory drawing operation; wherein the preset style parameter is associated with the display style of the drawing point; the drawing parameter determination module is used to determine the drawing style parameters for drawing the drawing point based on the preset style parameter and the parameter configuration operation, in response to a parameter configuration operation for at least one of the parameter configuration items.
[0121] Based on any optional technical solution in the embodiments of this disclosure, optionally, the first document position data includes target character position data and character relative position data. Further, the drawing point recording module may include a character document position recording unit and a character relative position recording unit. The character document position recording unit is used to determine the target character associated with the first drawing point in the target document based on the region drawing position, determine the character arrangement position data of the target character in the target document, and record the character arrangement position data to obtain target character position data; and the character relative position recording unit is used to determine the region relative position data of the target character relative to the reader, determine the position offset data of the drawing point relative to the target character based on the region relative position data and the region drawing position data, and record the position offset data to obtain character relative position data.
[0122] Based on any optional technical solution in the embodiments of this disclosure, optionally, the target document includes multiple text lines; the text line includes at least one character; further, the document position recording unit can be specifically used to: determine character boxes of multiple characters in the target document, determine a reference line corresponding to the region drawing position data, and determine the target character associated with the drawing point according to the relative position relationship between the reference line and the character box; wherein, the straight line extension direction of the reference line includes the line extension direction perpendicular to the text line of the target document.
[0123] The data processing apparatus provided in this disclosure can execute the data processing method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects for executing the data processing method.
[0124] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of this disclosure.
[0125] The following is for reference. Figure 6 The diagram illustrates a structural schematic of an electronic device (e.g., a terminal device or a server) 600 suitable for implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0126] like Figure 6 As shown, electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 601, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 602 or a program loaded from storage device 608 into random access memory (RAM) 603. RAM 603 also stores various programs and data required for the operation of electronic device 600. Processing device 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.
[0127] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, magnetic tapes, hard disks, etc.; and communication devices 609. Communication device 609 allows electronic device 600 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 An electronic device 600 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0128] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, it performs the functions defined in the methods of embodiments of this disclosure.
[0129] This disclosure provides a computer storage medium storing a computer program that, when executed by a processor, implements the data processing method provided in the above embodiments.
[0130] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0131] According to one or more embodiments of this disclosure, [Example 1] provides a data processing method, including: displaying first document data of a target document in a reader; wherein the target document is associated with document drawing data; the document drawing data includes first document position data of a plurality of drawing points relative to the target document; the plurality of drawing points are used to mark the target document; in response to a data update operation for the target document, determining second document data to be displayed in the reader according to the data update operation, and displaying the second document data in the reader; and, if a first drawing point associated with the second document data exists among the plurality of drawing points, obtaining drawing style parameters of the first drawing point, and drawing a second drawing point in the reader according to the drawing style parameters, the second document data, and the first document position data of the first drawing point.
[0132] According to one or more embodiments of this disclosure, [Example 2] provides the method of Example 1, which further includes: optionally, drawing a second drawing point in the reader according to the drawing style parameters, the second document data, and the first document position data of the first drawing point includes: determining a first region position data of the first drawing point relative to the reader according to the second document data and the first document position data of the first drawing point; and drawing a second drawing point in the reader according to the drawing style parameters and the first region position data when the first region position data is located in the reader.
[0133] According to one or more embodiments of this disclosure, [Example 3] provides the method of Example 2, which further includes: optionally, determining the first region position data of the first drawing point relative to the reader based on the second document data and the first document position data of the first drawing point includes: determining the second document position data based on the data update operation and the first document position data of the first drawing point, and determining the first region position data of the first drawing point relative to the reader based on the second document data and the second document position data.
[0134] According to one or more embodiments of this disclosure, [Example 4] provides the method of Example 3, which further includes: optionally, determining the first region position data of the first drawing point relative to the reader based on the second document data and the first document position data of the first drawing point includes: determining the second document position data based on the data update operation and the first document position data of the first drawing point, and determining the first region position data of the first drawing point relative to the reader based on the second document data and the second document position data.
[0135] According to one or more embodiments of this disclosure, [Example 5] provides the method of Example 1 or Example 3, further comprising: optionally, the first document position data includes target character position data and character relative position data; the target character position data includes the character arrangement position data of the target character associated with the drawing point in the target document; the character relative position includes the position offset data of the drawing point relative to the target character.
[0136] According to one or more embodiments of this disclosure, Example Six provides the method of Example Five, which further includes: Optionally, determining the first region position data of the first drawing point relative to the reader based on the second document data and the first document position data of the first drawing point includes: determining the region-relative position data of the target character associated with the drawing point relative to the reader based on the second document data and the target character position data; and determining the first region position data of the first drawing point relative to the reader based on the region-relative position data and the character-relative position data.
[0137] According to one or more embodiments of this disclosure, Example 7 provides the method of Example 1, which further includes: Optionally, after determining the second document data to be displayed in the reader according to the data update operation, and before drawing the second drawing point in the reader according to the second document data and the first document position data of the first drawing point, the method further includes: determining the document display area corresponding to the second document data according to the corresponding data layout position of the second document data in the target document; and determining the first drawing point associated with the second document data from the plurality of drawing points according to the document display area and the first document position data of the plurality of drawing points.
[0138] According to one or more embodiments of this disclosure, Example 8 provides the method of Example 1, which further includes: optionally, after determining the second document data to be displayed in the reader according to the data update operation, and before drawing the second drawing point in the reader according to the second document data and the first document position data of the first drawing point, the method further includes: determining the document display area corresponding to the second document data according to the corresponding data layout position of the second document data in the target document; and determining the first drawing point associated with the second document data from the plurality of drawing points according to the document display area and the first document position data of the plurality of drawing points.
[0139] According to one or more embodiments of this disclosure, [Example Nine] provides the method of Example Eight, which further includes: optionally, before obtaining the drawing style parameter corresponding to the trajectory drawing operation, it further includes: displaying a parameter configuration item of at least one preset style parameter; wherein the preset style parameter is associated with the display style of the drawing point; in response to a parameter configuration operation for at least one of the parameter configuration items, determining the drawing style parameter for drawing the drawing point according to the preset style parameter and the parameter configuration operation.
[0140] According to one or more embodiments of this disclosure, Example 10 provides the method of Example 8, which further includes: optionally, the first document position data includes target character position data and character relative position data; the recording of the first document position data of each drawing point relative to the target document includes: determining a target character in the target document associated with the first drawing point based on the region drawing position, determining the character layout position data of the target character in the target document, recording the character layout position data to obtain target character position data; and determining the region relative position data of the target character relative to the reader, determining the position offset data of the drawing point relative to the target character based on the region relative position data and the region drawing position data, recording the position offset data to obtain character relative position data.
[0141] According to one or more embodiments of this disclosure, Example 11 provides the method of Example 10, which further includes: optionally, the target document includes multiple text lines; the text lines include at least one character; the step of determining the target character in the target document associated with the first drawing point based on the region drawing position includes: determining character frames of multiple characters in the target document, determining a reference line corresponding to the region drawing position data, and determining the target character associated with the drawing point based on the relative positional relationship between the reference line and the character frames; wherein, the straight line extension direction of the reference line includes the line extension direction perpendicular to the text lines of the target document.
[0142] According to one or more embodiments of this disclosure, [Example Twelve] provides a data processing apparatus, including: a document data display module for displaying first document data of a target document in a reader; the target document is associated with document drawing data; the document drawing data includes first document position data of a plurality of drawing points relative to the target document; a document data update module for determining second document data to be displayed in the reader based on the data update operation in response to a data update operation for the target document, and displaying the second document data in the reader; and a drawing data restoration module for obtaining drawing style parameters of the first drawing point when there is a first drawing point associated with the second document data among the plurality of drawing points, and drawing a second drawing point in the reader based on the drawing style parameters, the second document data, and the first document position data of the first drawing point.
[0143] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0144] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0145] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: display first document data of a target document in a reader; wherein the target document is associated with document drawing data; the document drawing data includes first document position data of a plurality of drawing points relative to the target document; in response to a data update operation for the target document, determine second document data to be displayed in the reader based on the data update operation, and display the second document data in the reader; and, if a first drawing point associated with the second document data exists among the plurality of drawing points, obtain drawing style parameters of the first drawing point, and draw a second drawing point in the reader based on the drawing style parameters, the second document data, and the first document position data of the first drawing point.
[0146] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0147] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0148] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The names of the units are not necessarily limiting in certain circumstances; for example, a document data display module can also be described as "a module that displays first document data of a target document".
[0149] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0150] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0151] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0152] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0153] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A data processing method, characterized by, The method comprises: displaying first document data of a target document in a reader; wherein the target document is associated with document drawing data; the document drawing data comprises first document position data of a plurality of drawing points relative to the target document; the plurality of drawing points are used to mark the target document; the first document position data is the relative display position between the plurality of drawing points and the document data in the target document when drawing; in response to a data update operation on the target document, determining second document data to be displayed in the reader according to the data update operation, and displaying the second document data in the reader; and, in the case that there is a first drawing point associated with the second document data in the plurality of drawing points, obtaining drawing style parameters of the first drawing point, and drawing a second drawing point in the reader according to the drawing style parameters, the second document data and the first document position data of the first drawing point.
2. The data processing method according to claim 1, characterized in that, The drawing of the second drawing point in the reader according to the drawing style parameters, the second document data and the first document position data of the first drawing point comprises: determining first area position data of the first drawing point relative to the reader according to the second document data and the first document position data of the first drawing point; in the case that the first area position data is in the reader, drawing a second drawing point in the reader according to the drawing style parameters and the first area position data.
3. The data processing method according to claim 2, characterized in that, The determination of the first area position data of the first drawing point relative to the reader according to the second document data and the first document position data of the first drawing point comprises: determining second document position data according to the data update operation and the first document position data of the first drawing point, and determining first area position data of the first drawing point relative to the reader according to the second document data and the second document position data.
4. The data processing method according to claim 3, characterized in that, The data update operation comprises a document layout adjustment operation; the determination of the second document position data according to the data update operation and the first document position data of the first drawing point comprises: obtaining first layout data before the document layout adjustment operation is performed on the target document, and determining second layout data according to the document layout adjustment operation and the first layout data; determining a data adjustment amount between the first layout data and the second layout data, and determining second document position data according to the data adjustment amount and the first document position data of the first drawing point.
5. The data processing method according to claim 1 or 2, characterized by, The first document position data comprises target character position data and character relative position data; the target character position data comprises character arrangement position data of a target character associated with the drawing point in the target document; and the character relative position data comprises position offset data of the drawing point relative to the target character.
6. The data processing method according to claim 5, characterized in that, The first region position data of the first drawing point relative to the reader is determined according to the second document data and the first document position data of the first drawing point, comprising: The target character relative position data of the target character associated with the first drawing point relative to the reader is determined according to the second document data and the target character position data; The first region position data of the first drawing point relative to the reader is determined according to the target character relative position data and the character relative position data.
7. The data processing method of claim 1, wherein, After the second document data to be displayed in the reader is determined according to the data update operation, before the second drawing point is drawn in the reader according to the second document data and the first document position data of the first drawing point, it further comprises: The document display area corresponding to the second document data is determined according to the corresponding data arrangement position of the second document data in the target document; The first drawing point associated with the second document data is determined from a plurality of drawing points according to the document display area and the first document position data of a plurality of drawing points.
8. The data processing method of claim 1, wherein, After the first document data of the target document is displayed in the reader, it further comprises: In response to the trajectory drawing operation input in the reader, the drawing style parameter corresponding to the trajectory drawing operation is obtained, and the region drawing position data is determined according to the touch point of the trajectory drawing operation; At least one drawing point is drawn in the reader according to the region drawing position data and the drawing style parameter, and the first document position data of each drawing point relative to the target document is recorded.
9. The data processing method according to claim 8, characterized in that, Before the drawing style parameter corresponding to the trajectory drawing operation is obtained, it further comprises: Display at least one parameter configuration item of the preset style parameter; wherein the preset style parameter is associated with the display style of the drawing point; In response to the parameter configuration operation of at least one parameter configuration item, the drawing style parameter of the drawing point is determined according to the preset style parameter and the parameter configuration operation.
10. The data processing method according to claim 8, characterized in that, The first document position data includes target character position data and character relative position data; recording the first document position data of each drawing point relative to the target document comprises: According to the region drawing position, the target character associated with the first drawing point in the target document is determined, the character arrangement position data of the target character in the target document is determined, the character arrangement position data is recorded to obtain the target character position data; and, The target character relative position data of the target character relative to the reader is determined, the position offset data of the drawing point relative to the target character is determined according to the target character relative position data and the region drawing position data, and the position offset data is recorded to obtain the character relative position data.
11. The data processing method according to claim 10, characterized in that, The target document includes a plurality of text lines; the text line includes at least one character; the target character associated with the first drawing point in the target document is determined according to the region drawing position, comprising: Determine a character box of a plurality of characters in the target document, determine a reference straight line corresponding to the region drawing position data, and determine a target character associated with the drawing point according to a relative position relationship between the reference straight line and the character box; wherein a straight line extension direction of the reference straight line includes a line extension direction perpendicular to a text line of the target document.
12. A data processing apparatus, characterized by Comprise: A document data display module is configured to display first document data of a target document in a reader; wherein the target document is associated with document drawing data; the document drawing data comprises first document position data of a plurality of drawing points relative to the target document; the plurality of drawing points are used to mark the target document; and the first document position data is a relative display position between the plurality of drawing points and the document data in the target document when drawing; A document data update module is configured to, in response to a data update operation for the target document, determine second document data to be displayed in the reader according to the data update operation, and display the second document data in the reader; and A drawing data restoration module is configured to, in a case where there is a first drawing point associated with the second document data in the plurality of drawing points, obtain a drawing style parameter of the first drawing point, and draw a second drawing point in the reader according to the drawing style parameter, the second document data, and the first document position data of the first drawing point.
13. An electronic device, comprising: The electronic device comprises: One or more processors; A storage device configured to store one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the data processing method as claimed in any one of claims 1-11.
14. A storage medium containing computer-executable instructions, wherein: The computer executable instructions, when executed by a computer processor, are configured to perform the data processing method as claimed in any one of claims 1-11.
15. A computer program product comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the data processing method as claimed in any one of claims 1-11.
Citation Information
Patent Citations
Electronic text generation method and device, equipment and medium
CN113515928A