Method for adding annotations and related device

By integrating the handwritten SDK module in the application, the problem of inconsistent annotation data format in different applications is solved, and the cross-application sharing and editing of annotation data is realized, improving the user experience.

CN119538883APending Publication Date: 2025-02-28HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311131827.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-08-29
Filing Date
2023-09-01
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

In the prior art, the format of the annotation data added by users in different applications is inconsistent, resulting in the inability to display or edit in other applications, affecting the user experience.

Method used

By integrating the handwritten SDK module, a method is provided that enables users to add comments in the first application and view and edit these comments in the second application. The method includes detecting user actions, obtaining and storing annotation data, and displaying and editing annotations in appropriate applications.

Benefits of technology

It realizes cross-application sharing and editing of annotation data, improves the user experience, and enables users to view and modify previously added annotations in other applications in any application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119538883A_ABST
    Figure CN119538883A_ABST
Patent Text Reader

Abstract

The invention discloses an annotation adding method and a related device. In the method, a first user interface of a first application is displayed in the electronic device 100, and target content is displayed in the first user interface. When an operation Q1 that a user adds a first annotation on the target content is detected, the electronic device 100 can display and save the first annotation. The electronic device 100 can display the first target content and the second target content in the second application when an operation Q2 that the user opens the target content including the first annotation in the second application is detected, and the electronic device 100 adjusts the first annotation or adds the second annotation in the second application when an operation Q3 of the user is detected. By implementing the technical scheme provided by the invention, the user can view and secondarily edit the annotations in the application integrated with the handwritten SDK module. Other applications which are not integrated with the handwritten SDK module can also be checked and secondarily edited and annotated after the handwritten SDK module is downloaded subsequently.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a method for adding annotations and related devices. Background Art

[0002] Currently, electronic devices such as tablet computers and laptops can provide users with an annotation function. Users can add annotations to the currently viewed document or picture using a stylus, hand, watch, etc.

[0003] However, the current annotation function is implemented by the application itself or with the help of the annotation function provided by the system. When the application implements the annotation function by itself, the data format of the annotation function of different applications may be different. In this way, if the user adds an annotation to a document or picture in application A, application B may not be able to display the annotation. When the application uses the annotation function provided by the system, the user cannot enter an annotation at any location, or cannot edit the annotation in the document saved by the user again. This affects the user experience. Summary of the invention

[0004] This application provides a method for adding annotations, through which users can view and re-edit annotations in applications that have integrated the handwriting SDK module. Other applications that have not integrated the handwriting SDK module can also view and re-edit annotations after subsequently downloading the handwriting SDK module.

[0005] In a first aspect, the present application provides a method for adding annotations, which can be applied to an electronic device. The method may include: detecting an operation of a user opening a first file in a first application, and displaying the first file in the first application; detecting an operation of a user adding a first batch of annotations to the first file in the first application, and acquiring and storing annotation data of the first batch of annotations; detecting an operation of a user opening the first file in a second application, and displaying the file content and the first batch of annotations of the first file in the second application.

[0006] The first file may include any one of a text document, a PDF document, and a picture.

[0007] In this way, through the method provided in the first aspect, the first application can store the first batch of annotated data in any location. Moreover, the user can view the annotation added in the first application in the second application, thereby improving the user experience.

[0008] In one possible implementation, the first batch of annotations can continue to be edited in the second application. After the file content of the first file and the first batch of annotations are displayed in the second application, the method may further include: detecting a user's operation of modifying the first batch of annotations in the second application, modifying the first batch of annotations, and displaying the modified first batch of annotations.

[0009] In this way, the user can also modify the first batch of annotations added by the user in the first application in the second application.

[0010] In a possible implementation, after displaying the file content and the first annotation of the first file in the second application, the method may further include: detecting an operation by a user to add a second annotation to the first file in the second application, and displaying the file content and the second annotation of the first file in the second application.

[0011] In this way, the user can continue to add annotations in the second application.

[0012] In a possible implementation, the format of the annotation data of the first batch of annotations stored by the first application is byte format. In this way, the format of the annotation data is not a format specific to the first application, so that other applications can also open and display the annotation data of the first batch of annotations.

[0013] In a possible implementation, the first batch of annotation data stored in the first application includes a data header, and the data header is used to indicate the format of the annotation data. In this way, the electronic device can identify the type of the data according to the data header and determine that the data is annotation data.

[0014] In one possible implementation, the data header includes one or more of a data header size field, a creation time field, a modification time field, and a reserved field. The data header size field is used to indicate the size of the data header part, the creation time field is used to indicate the creation time of the first batch of annotations, the modification time field is used to indicate the modification time of the first batch of annotations, and the reserved field is reserved for future use.

[0015] In a possible implementation, the stored annotation data of the first batch of annotations also includes data content, where the data includes one or more of the width, length, and color of the first batch of annotations.

[0016] In a possible implementation, obtaining and storing the annotation data of the first batch of annotations includes: storing the annotation data of the first batch of annotations in a first file, wherein the file format of the first file after the annotation data of the first batch of annotations is saved is the same as the file format of the first file before the annotation data of the first batch of annotations is saved. In this way, adding the annotations will not change the file format of the first file.

[0017] In a possible implementation, after the first batch of annotated annotation data is stored in the first file, the file content of the first file is unchanged and the storage location of the file content in the first file is unchanged. In this way, the annotations added by the user to the file will not affect and change the file content of the file.

[0018] In a possible implementation, the method may further include: storing the first file and the first batch of annotated annotation data as data in a picture format. In this way, an application that is not integrated with a handwriting SDK (or called a handwriting SDK module) can also view files and annotations in picture format.

[0019] In a possible implementation, the annotation data of the first batch of annotations includes the relative position of the first batch of annotations and the first file.

[0020] In a possible implementation, after the file content and the first batch of annotations of the first file are displayed in the second application, the method may further include: the electronic device detects the user's operation of scrolling the first file, refreshes and displays the file content and the first batch of annotations of the first file, the relative position of the first batch of annotations to the first file does not change, and when the refreshed user interface does not display the file content at the position of the first batch of annotations, the refreshed user interface does not display the first batch of annotations. In this way, the content of the first batch of annotations will also change with the change of the content position of the first file.

[0021] In a possible implementation, after displaying the file content and the first batch of annotations of the first file in the second application, the method may further include: detecting a user operation of zooming in and out of the first file, zooming in and out of the first batch of annotations according to the zoom ratio of the first file, and refreshing and displaying the first batch of annotations. In this way, the first batch of annotations will zoom in and out as the first file is zoomed in and out.

[0022] In one possible implementation, after detecting the user's second operation of adding the first batch of annotations to the first file in the first application, the method may further include: displaying a toolbar control, the toolbar control including one or more of a variety of brush controls, an eraser control, and a lasso control; the variety of brush controls are used to provide brushes with different textures and transparencies; the eraser control is used to erase pixels or strokes, the lasso control is used to adjust the first batch of annotations, and adjusting the first batch of annotations includes one or more of moving the first control, copying the first batch of annotations, scaling the first batch of annotations, shearing the first batch of annotations, and rotating the first control.

[0023] In a possible implementation, the first application and the second application specifically support the handwriting software development kit SDK for adding and viewing annotations. In this way, the handwriting SDK provides a control that encapsulates handwriting capabilities to the application. The application implements the functions of adding and viewing annotations and secondary editing of annotations through the handwriting SDK.

[0024] In a possible implementation, the method may further include: when the third application does not include the handwriting SDK, displaying a prompt box in the third application, the prompt box being used to prompt the user to select to download the handwriting SDK.

[0025] In a possible implementation, the method may further include: when the third application does not include the handwriting SDK, upgrading the third application, so that the upgraded third application includes the handwriting SDK.

[0026] In this way, even if the initial version of the application does not have the handwriting SDK, the SDK can be included after downloading or upgrading.

[0027] In a second aspect, an electronic device is provided, which may include one or more processors, one or more memories, and a transceiver; wherein the transceiver, one or more memories are coupled to one or more processors, and the one or more memories are used to store computer program code, and the computer program code includes computer instructions, and when the one or more processors execute the computer instructions, the first electronic device executes a method in any possible implementation of the first aspect mentioned above.

[0028] In a third aspect, a computer-readable storage medium stores instructions, and when the instructions are executed on a computer, the computer executes a method in any possible implementation of any of the above aspects.

[0029] In a fourth aspect, a chip is provided for use in electronic devices, characterized in that it includes a processing circuit and an interface circuit, the interface circuit is used to receive code instructions and transmit them to the processing circuit, and the processing circuit is used to run the code instructions to execute a method as described in any possible implementation of the first aspect above.

[0030] According to a fifth aspect, a computer program product is provided. When the computer program product is run on a computer, the computer is enabled to execute the method in any possible implementation of any of the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1-Figure 13 is a set of user interface schematic diagrams provided in an embodiment of the present application;

[0032] Fig.14 It is a schematic diagram of interaction of adding annotations and secondary loading annotations provided in an embodiment of the present application;

[0033] Fig.15 is an interactive schematic diagram of zoom annotation provided in an embodiment of the present application;

[0034] Fig.16 It is an interactive schematic diagram of viewing an annotated target file saved in target application 1 in target application 2 provided in an embodiment of the present application;

[0035] Fig.17 It is a flowchart of a method for adding annotations provided in an embodiment of the present application;

[0036] Fig.18 It is a flowchart of a method for adding annotations provided in an embodiment of the present application;

[0037] Fig.19 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0038] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more listed items.

[0039] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.

[0040] The term "user interface (UI)" in the following embodiments of the present application refers to a medium interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface is a source code written in a specific computer language such as Java and extensible markup language (XML). The interface source code is parsed and rendered on an electronic device, and finally presented as content that can be recognized by the user. The commonly used form of user interface is a graphical user interface (GUI), which refers to a user interface related to computer operation displayed in a graphical manner. It can be a visual interface element such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. displayed on the display screen of an electronic device.

[0041] An embodiment of the present application provides a method for adding annotations, which may include: first, a first user interface of a first application is displayed in the electronic device 100, and the first target content is displayed in the first user interface. Then, an operation Q1 of a user adding a first batch of annotations on the first target content is detected, and the electronic device 100 may display the first batch of annotations and save the first batch of annotations. Then, an operation Q2 of a user opening the first target content containing the first batch of annotations in a second application is detected, and the electronic device 100 displays a second user interface of a second application, and the first target content and the first target content are displayed in the second user interface. An operation Q3 of the user is detected, and the electronic device 100 adjusts the first batch of annotations or adds a second annotation in the second user interface.

[0042] The first target content may include but is not limited to a word document, a portable document format (PDF) document, a picture, a TXT format document, etc. The embodiment of the present application does not limit the specific format of the first target content.

[0043] The first and second annotations may include, but are not limited to, text, patterns, etc. Text may include, but are not limited to, numbers, Chinese characters, letters, and text in other languages, etc. Patterns may include, but are not limited to, graphics, lines, symbols, etc. Graphics may include regular geometric images and irregular geometric figures. The embodiments of the present application do not limit the specific form of the annotations added by the user (such as the first and second annotations).

[0044] The electronic device 100 may be a tablet computer, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a mobile phone, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a smart TV, etc. The embodiment of the present application does not limit the specific type of the electronic device 100. For ease of explanation, the electronic device 100 of the present application is illustrated by taking a tablet computer as an example.

[0045] The following describes in detail with reference to the accompanying drawings how a user can add annotations to the first target content in the first application of the electronic device 100 and how a user can modify the first annotation or add a second annotation in the second application.

[0046] Figure 1-2G The following is a schematic diagram of an interface showing a user adding annotations to first target content in a first application.

[0047] Figure 1The desktop 10 of the electronic device 100 is shown as an example. Figure 1 As shown, the desktop 10 may display icons of multiple applications, for example, an icon 101 for a reading application, an icon 102 for a Zhihu application, an icon 103 for a gallery application, an icon 104 for a WPS application, an icon 105 for a note application, an icon 106 for a memo application, and an icon 107 for a browser application.

[0048] It is understandable that the desktop 10 of the electronic device 100 can also be called a main interface, or a main user interface. Figure 1 The desktop 10 shown in the figure is only an example. The desktop 10 may include more or fewer interface elements, which is not limited in the embodiment of the present application.

[0049] In response to operation Q4 in which the user clicks the icon 101 of the reading application, the electronic device 100 may display the user interface 20 .

[0050] It is understandable that after detecting operation Q4 in which the user clicks on the icon 101 of the reading application, the electronic device 100 can also detect operation Q5 in which the user opens the document 1, and then, in response to operation Q4 and operation Q5, the electronic device 100 can display the user interface 20.

[0051] Figure 2A The user interface 20 of the electronic device 100 is shown as an example. Figure 2A As shown, the user interface 20 may display controls 201, 202, 203, 204, and document 205. Control 201 may be used to return to the previous interface. Control 203 may be used to delete (or clear) all annotations in the document displayed in the user interface 20, for example, clear all annotations in document 205. Control 204 may be used to save the document displayed in the user interface 20. Control 202 may be used to enable a toolbar control that provides visual brush switching, color selection, and other capabilities. The toolbar control may be, for example, Figure 2C Toolbar control 206 is shown.

[0052] like Figure 2B As shown, the user may click on the control 202 , and in response to the user operation Q6 , the electronic device 100 may display a toolbar control 206 in the user interface 20 .

[0053] like Figure 2CAs shown, the user interface 20 may display a toolbar control 206. The toolbar control 206 may include a brush control 2061A, a brush control 2061B, a brush control 2061C, a brush control 2061D, a lasso control 2061E, an eraser control 2061F, an undo control 2062A, a redo control 2062B, a color control 2063A, a color control 2063B, a color control 2063C, a color control 2063D, a color control 2063E, a color control 2063F, a color control 2063G, a color control 2063I, a control 2064, and a control 2065. Among them, the brush control 2061A may be used to provide a ballpoint pen brush effect. The brush control 2061B may be used to provide a fountain pen brush effect. The brush control 2061C may be used to provide a pencil brush effect. Brush control 2061D can be used to provide the brush effect of a marker or a highlighter. Lasso control 2061E can be used to provide the ability to select, move, cut, copy, delete, paste, drag across pages, rotate, and scale. Eraser control 2061F can be used for stroke erasing and pixel erasing. Undo control 2062A can be used to undo annotations added by the user. Redo control 2062B can be used to redo annotations selected by the user. Color control 2063A can be used to provide a visual color palette, color ring, and color value. Users can select different colors through color control 2063A. Color control 2063B can be used to provide red. Color control 2063C can be used to provide yellow. Color control 2063D can be used to provide green. Color control 2063E can be used to provide cyan. Color control 2063F can be used to provide blue. Color control 2063G can be used to provide purple. Color control 2063I can be used to provide black. Control 2064 may be used to provide other functions, such as adding a photo from a gallery, or a photo, adding a table, etc. Control 1605 may be used to scale the toolbar control 206 .

[0054] The user can also click on brush control 2061A, brush control 2061B, brush control 2061C, and brush control 2061D to select different pen widths.

[0055] like Figure 2C As shown, the user can add annotations to the document 205 after selecting the brush control 2061A and the color control 2063I.

[0056] like Figure 2D As shown, the user can use the brush effect of a ballpoint pen and a black brush color to add annotations 207 and 208 in the document 205. Annotation 207 can be a long, unclosed curve. Annotation 208 can be a circular curve.

[0057] like Figure 2EAs shown, the user can click on the control 2065, and in response to the user operation Q7, the electronic device 100 can display a reduced toolbar control.

[0058] like Figure 2F As shown, the electronic device 100 can display a reduced toolbar control 210 in the user interface 20. The user can also continue to add an annotation 209 to the document 205 in the user interface 20. The annotation 209 can be an ellipse shape.

[0059] like Figure 2G As shown, after the user has added annotations, the user can click control 204 to save the document with the annotations added.

[0060] Combine the following Figure 3-Figure 4 Describes how documents with annotations added to this application are saved.

[0061] like Figure 3 As shown in (a) of FIG. 1 , the user interface 30A shows an identifier 301 of the document 1 after adding annotations. The identifier 301 may include document information 302 and document information 303. The document information 302 may include the name of the document (e.g., Document 1) and the format (e.g., the format is PDF). The document information 303 may include the save time of Document 1 (e.g., 2023 / 08 / 02) and the document size (e.g., 166.87k).

[0062] like Figure 3 As shown in (b) of FIG. 30B , the user interface 30B shows an identifier 304 of the document 1 without adding annotations. The identifier 304 may include document information 305 and document information 306. The document information 305 may include the name of the document (e.g., Document 1) and the format (e.g., the format is PDF). The document information 306 may include the save time of Document 1 (e.g., 2023 / 08 / 01) and the document size (e.g., 166.01k).

[0063] from Figure 3 As can be seen from Figures (a) and (b) in the example of the present application, after the document in the embodiment of the present application is annotated, the saved format remains unchanged. The annotation data will be saved in the document together with the document data. Therefore, the document after the annotation is added will be larger than the document before the annotation.

[0064] In addition, in this application, annotations added to a document do not change the content of the document. Figure 4 As shown in Figure (a) in FIG, before the annotation data is added to the document 1, the content of the document 1 can be stored in the content space 1. Figure 4As shown in Figure (b), after the annotation data is added to Document 1, the content of Document 1 is still stored in Content Space 1, and the annotation data is stored in the extended memory space of Memory Space 1, i.e., Extended Memory Space 1. The annotation data does not change the storage location and storage order of the content in Document 1.

[0065] In the present application, an annotation is added to a document 1 in an application 1 (e.g., a reading application) of an electronic device 100, and then the user can also display the document 1 with the annotation 1 added in an application 2 (e.g., a memo application) of the electronic device 100, which can display not only the content of the document 1 but also the annotation 1. Furthermore, the user can also adjust the annotation 1 and add annotation 2 in application 2.

[0066] Figure 5-11C It is exemplarily shown that a document annotated by the user in a reading application is displayed in a memo application, and the user can also adjust the annotations added by the user in the reading application in the memo, and the user can continue to add annotations to the document in the memo.

[0067] like Figure 5 As shown, the electronic device 100 can detect the user's operation Q8 of selecting the document 1 in the user interface 30A (for example, long pressing the mark 301 ), and the electronic device 100 can display the function option box 308 .

[0068] like Figure 6 As shown, the electronic device 100 displays a function option box 308 in the user interface 30A. The function option box may include multiple function options, for example, function option 308A, function option 308B, function option 308C, function option 308D, and function option 308E. Function option 308A may be used for the document selected by the user. Function option 308B may be used to copy the document selected by the user. Function option 308C may be used to move the document selected by the user to other folders of the electronic device 100. Function option 308D may be used to delete the document selected by the user. Function option 308E may be used to display more function options.

[0069] For example, the user may click on the function option 308E, and in response to the user operation Q9, the electronic device 100 may display more function options. Figure 7 As shown, the more function options may include function option 308F. Function option 308F may be used to select other applications to open the document selected by the user.

[0070] Exemplarily, the user can click on the function option 308F. Figure 8As shown, in response to the user operation Q10, an option box 309 may be displayed in the user interface 30A of the electronic device 100. The option box 309 may include multiple application icons, for example, an icon 3091 of a memo application.

[0071] The user can choose to use the memo to open the selected document. The electronic device 100 can detect the user's operation of clicking the icon 3091 of the memo application, start the memo application, and display the document selected by the user in the memo application.

[0072] like Fig. 9 As shown, in response to the user Figure 8 In the illustrated user interface 30A, in operation Q10 of clicking the icon 3091, the electronic device 100 may display the user interface 40A. The user interface 40A may display the document 205 to which annotations (eg, annotations 207, 208, and 209) are added.

[0073] Optionally, in a possible implementation, the user can also slide the document 205 up and down in the user interface 40A to view more document content. Fig. 9 As shown, the electronic device 100 can detect an operation Q11 of the user sliding upward, and in response to the operation Q11, the electronic device 100 can display the user interface 40B.

[0074] like Fig. 10A As shown, the user interface 40B shows that the content of the document and the position of the annotation in the document 205 have changed. That is, the annotation in the document will scroll as the content of the document itself scrolls. The relative position of the annotation and the corresponding content in the document will not change due to the scrolling of the document content.

[0075] Optionally, in a possible implementation, the user can also zoom in and out on the document 205 displayed in the memo application. The annotations on the document 205 will be zoomed in and out as the document 205 is zoomed in and out. Fig. 10B As shown, the document 205 is displayed in a reduced size, and the annotations 207, 208 and 209 on the document 205 are also reduced in the same proportion.

[0076] Optionally, in a possible implementation, the user can continue to add comments to the document 205 in the memo application. Fig.11A As shown, the user can continue to add annotations 401 to the document 205. That is, the electronic device 100 can detect the user's operation of continuing to add annotations and display the annotations 401 in the user interface 40A.

[0077] Optionally, in a possible implementation, the user can also adjust the existing annotations in the document 205 in the memo application. Fig. 11B As shown, the user can delete the annotation 207. For example, Fig. 11C As shown, the user can adjust the position of the annotation 208. The following first introduces an exemplary electronic device 100 provided by an embodiment of the present application.

[0078] It is understandable that the step of the electronic device 100 displaying the document with the annotation added in the memo application may not be limited to the above steps. Figure 6-Figure 8 The electronic device 100 may also start the memo application in response to the user operation, and then open and display the document with the annotation in the memo application.

[0079] Optionally, in another possible implementation, the user can share the annotated document in the electronic device 100 with the electronic device 200. Then, the electronic device 200 can display the annotated document in a reading application or other application that can view documents. Fig.12 As shown, the user can click on the function option 308A in the user interface 30A. In response to the user operation, the electronic device 100 can Fig.12 The document 1 with annotations added shown in FIG. 1 is shared with the electronic device 200 .

[0080] It is understandable that, in some examples, when the user clicks on the function option 308A, the electronic device 100 may be shared with the electronic device 200 by default. Optionally, in other examples, after the electronic device 100 detects the user's operation of clicking on the function option 308A, it also detects the user's operation of selecting the electronic device 200, and the electronic device 100 shares the document 1 with the annotation added to the electronic device 200. The embodiments of the present application do not limit the specific operation steps.

[0081] After the electronic device 200 receives the document 1 with annotations, the document 1 with annotations can be opened in a reading application or other application in the electronic device 200. The embodiment of the present application does not limit the specific operation steps of how the user opens the document 1 with annotations in the electronic device 200. Fig.13 As shown, the electronic device 200 displays a user interface 50, and the user interface 50 may include a document 205 to which annotations 207, 208, and 209 are added. The user interface 50 may refer to the above Figure 2F The description in will not be repeated here.

[0082] Optionally, the user of the electronic device 200 can also adjust the existing annotations in the document 205 or add new annotations in the user interface 50. The user can scroll, zoom in, or reduce the document 205 in the user interface 50. For details, please refer to the relevant description of adjusting the existing annotations in the document 205 or adding new annotations in the user electronic device 100, which will not be repeated here.

[0083] The specific process of a method for adding annotations provided in an embodiment of the present application will be described below in conjunction with the accompanying drawings.

[0084] Fig.14 The diagram exemplarily shows the interaction between multiple modules in the electronic device 100 when adding handwritten annotations and reloading handwritten annotations.

[0085] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the system is divided into four layers, from top to bottom: application layer, application framework layer, runtime layer, Fig.14 not shown) and system libraries ( Fig.14 ), and the kernel layer ( Fig.14 not shown).

[0086] The application layer may include a series of application packages. Fig.14 As shown, the application package may include target application 1. The application package may also include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications (also referred to as applications). The embodiment of the present application does not specifically limit the number and type of application packages in the application layer of the electronic device 100.

[0087] The target application 1 may include an application interface control management module 1401 , a handwriting software development kit (SDK) module 1402 , and an application data management module 1403 .

[0088] Among them, the application interface control management module 1401 can be used to display the content of the application, and detect the specific controls or interface elements corresponding to the user's operations in the user interface of the application, so as to perform tasks corresponding to the user operations (for example, zooming, scrolling the user interface or files displayed in the user interface, etc.).

[0089] The handwriting SDK module can be used to provide controls that encapsulate handwriting capabilities to applications, and to encapsulate handwritten annotation data into a unified format and provide it to applications.

[0090] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0091] like Fig.14 As shown, the application framework layer may include a stylus service module, which includes a brush service module, an eraser service module, a lasso service module, a rendering management service module, and a handwriting data management service module.

[0092] The brush service module can be used to provide a variety of brushes. The texture and transparency of handwritten annotations using a variety of brushes are different. Brushes can be divided into ballpoint pens, fountain pens, pencils, markers, etc. according to the handwritten texture and transparency of the brushes. The embodiment of the present application does not limit the number and types of brushes that can be provided by the brush service module. For example, the electronic device 100 can detect that the user is in a toolbar control (e.g. Figure 2C The toolbar control 206 shown in FIG. 20A selects the brush operation to pull up the brush service.

[0093] The eraser service module can be used to provide stroke erasure and pixel erasure. Figure 2C The toolbar control 206 shown in FIG. 200 selects the eraser operation to pull up the eraser service.

[0094] The lasso service can be used to provide services such as selecting, moving, cutting, copying, deleting, pasting, dragging across pages, rotating, and scaling annotations. Figure 2C The toolbar control 206 shown in FIG. 10 selects the lasso operation to pull up the lasso service.

[0095] The rendering management service module can be used to render the data (eg, multiple coordinate values ​​and pressure sensitivity values) transmitted by the handwriting data management module into displayable annotation content (eg, continuous line segments, text, etc.).

[0096] The handwriting data management service module can be used to convert the annotation content input by the user into storable byte data. Then, the handwriting data management service module can also be used to convert the byte data into annotation data that can be used for rendering.

[0097] like Fig.14 As shown, the electronic device 100 may include the following steps of adding annotations to the target application and saving the annotations based on the user operation:

[0098] ①-③Add comments

[0099] ①. The application interface control management module 1401 can pass the handwriting range to the handwriting SDK module 1402.

[0100] The application interface control management module 1401 of the electronic device 100 may display a user interface 1 of a target application 1. The user interface 1 may display a target content 1. The target application 1 includes a handwriting SDK module 1402. The target application 1 may edit or view the target content. For example, the target application 1 may be Figure 1 The target application 1 is not limited in this embodiment of the application.

[0101] The target content may be any one of a word document, a PDF document, a web document, a text document, a picture, etc. For example, the target content may be as follows: Figure 2A Document 205 is shown.

[0102] The application interface control management module 1401 may detect an input event 1 , and in response to the input event 1 , the application interface control management module 1401 may transfer the handwriting range to the handwriting SDK module 1402 .

[0103] The input event 1 can be a control that the user clicks to enter the annotation mode, for example, Figure 2B The user shown in FIG. 2 clicks on control 202 .

[0104] The input event 1 may also be a control that the user clicks to enter the annotation mode, and then selects an area in the user interface 1 that can be used to edit the annotation.

[0105] That is, the handwriting range passed by the application interface control management module 1401 to the handwriting SDK module can be the default area of ​​the target application 1, or it can be selected by the user, and this embodiment of the present application does not limit this. The handwriting range passed by the application interface control management module 1401 to the handwriting SDK module can be the coordinates of four vertices (for example, the upper left vertex (x1, y1), the upper right vertex (x2, y2), the lower left vertex (x3, y3), and the lower right vertex (x4, y4)). Optionally, the handwriting range passed by the application interface control management module 1401 to the handwriting SDK module can be the upper left corner coordinates of the area where annotations can be added, as well as the length and width values ​​of the area, for example, the upper left vertex (x1, y1), the length value L1, and the width value W1). This application does not limit this.

[0106] The handwriting-enabled range may also be referred to as a handwriting area, or an area where annotations can be added.

[0107] The input event 1 detected by the electronic device 100 can be input by the user's finger on the display screen of the electronic device 100, or by the user through a stylus or mouse, or by the user through a voice command. The embodiment of the present application does not limit the input method of the input event 1.

[0108] When input event 1 is input via a stylus or mouse, the electronic device 100 may establish a connection with the stylus or mouse. For example, the electronic device 100 may establish a connection with the stylus or mouse via Bluetooth or a data connection line. The specific manner in which the electronic device 100 establishes a connection with the stylus or mouse is not limited in the embodiment of the present application.

[0109] ②. The handwriting SDK module 1402 can send the handwriting control to the application interface control management module 1401.

[0110] After the handwriting SDK module 1402 receives the handwriting range sent by the application interface control management module 1401, the handwriting SDK module 1402 can send the handwriting control to the application interface control management module. The application interface control management module 1401 can place the handwriting control in the user interface 1. The handwriting control can be a layer that accommodates and displays the annotation content. The layer may not be visible to the user, but the annotation content displayed by the layer is visible to the user. The layer can be called an annotation layer. The annotation layer can be located above the layer used to display the target file 1 in the application interface control management module 1401.

[0111] Optionally, the annotation layer may also include a toolbar control, which may be used to process or edit attribute parameters (e.g., color, thickness, texture, transparency, etc.) of the annotation content. Figure 2C Toolbar control 206 is shown in FIG.

[0112] ③. The handwriting SDK module 1402 performs handwriting annotation.

[0113] The handwriting SDK module 1402 may perform handwriting annotations including: the application interface control management module 1401 of the electronic device 100 may detect the user's annotation operation 1. In response to the user operation, the application interface control management module 1401 may pass the annotation operation 1 to the SDK module 1402. The handwriting SDK module 1402 may obtain the coordinates and pressure information in the annotation operation 1, and simulate the coordinates and pressure information into a model of a graphical point. Then, the handwriting SDK module 1402 may simulate and send the obtained points to the rendering management service module and the handwriting data management module. The rendering management service module may render annotations (e.g., strokes, or text, etc.) based on the coordinate points of the annotation operation 1 and the brush type, color, and thickness provided by the brush service. Then, the rendering management service module may display the rendered annotations. Finally, the annotation may be displayed on the handwriting control and visible to the user.

[0114] The rendering management service module can render annotations (for example, lines, or text, etc.) based on the coordinate points of the annotation operation 1 and the brush type, color, and thickness provided by the brush service. Specifically, the rendering management service module can execute different interpolation algorithms in combination with the brush type in the brush service. The interpolation algorithm uses a certain algorithm to fill the gaps between the points corresponding to the two input events, and fill a series of points between the points corresponding to the two input events to form a continuous line segment. Then, the rendering management service module can call the system interface in the electronic device 100 (for example, the open graphics library (OpenGL)) to render the annotations and display them on the handwriting control.

[0115] The handwriting data management service module can record the points sent by the handwriting SDK module 1402 .

[0116] The application interface control management module 1401 can determine that the annotation operation 1 is used to add an annotation based on the location where the annotation operation 1 acts (for example, acting on a handwriting control). The annotation operation 1 can be a user drawing a line or writing on a handwriting control after selecting a brush, color, and stroke thickness in a toolbar control. The annotation operation 1 can also be a user drawing a line or writing on a handwriting control according to a default brush, color, and stroke thickness. The embodiment of the present application does not limit the specific form of the annotation operation.

[0117] It is understandable that the default brush, color, and stroke thickness may be set by the electronic device 100 system, or may be set by the user in the toolbar control, or the default brush, color, and stroke thickness may be the brush, color, and stroke thickness selected by the user in the toolbar control last time. This embodiment of the present application is not limited to this.

[0118] The annotation operation 1 can be input by the user through any method such as finger, mouse, stylus, voice, etc. The embodiment of the present application does not limit the method in which the user performs the annotation operation 1.

[0119] ④-⑥Save comments

[0120] ④. The handwriting SDK module 1402 sends a request to obtain annotation data to the handwriting data management service module.

[0121] After the user has finished editing the annotation on the target file 1, the user may choose to save the target file 1 with the annotation added. The application interface control management module may detect the user's operation of saving the target file 1 (for example, Figure 2G In response to this operation, the application interface control management module may instruct the handwriting SDK module 1402 to send a request to obtain annotation data to the handwriting data management service module.

[0122] ⑤. The handwriting data management service module returns the annotation data to the handwriting SDK module 1402.

[0123] The annotation data in the handwriting data management service module may be the points corresponding to the user's annotation operation 1 sent by the handwriting SDK module 1402 . The handwriting data management service module may save the recorded points as byte data, and then send the byte data to the handwriting SDK module 1402 .

[0124] In a possible implementation, the byte data is structured data, wherein the byte data may include a data header and a data content portion.

[0125] Table 1

[0126] Data header formatheader Data content

[0127] As shown in Table 1, the byte-format annotation data saved by the handwriting data management service module may include a data header and data content. The specific format of the data header can be seen in Table 2 below.

[0128] Table 2

[0129]

[0130] As shown in Table 2, the data header may include one or more of a data header size field, a creation time field, a modification time field, and a reserved field. The specific formats and meanings of the data header size field, the creation time field, the modification time field, and the reserved field can be found in Table 3 below.

[0131] Table 3

[0132] Field Name Format Field meaning Header size headsize field int integer data Header size Creation time createtimestamp field int64, 64-bit integer data The time the annotation was created Modify time modifytimestamp field int64, 64-bit integer data The modification time of the comment Reserved fields Array 8 bytes

[0133] As shown in Table 3, the headsize field can be an integer data, which can be used to indicate the size of the data header. Optionally, the size of the data header is 12 bytes. The createtimestamp field can be a 64-bit integer data, which can be used to indicate the creation time of the annotation. The modifytimestamp field can be a 64-bit integer data, which can be used to indicate the modification time of the file annotation. The data header can also include an 8-byte reserved field for future use.

[0134] The embodiment of the present application does not limit the type and number of fields contained in the data header.

[0135] The data content part may include specific annotation content, for example, information such as the width, length, color, etc. of the stroke, which is not limited in the embodiment of the present application.

[0136] ⑥. The handwriting SDK module 1402 provides annotation data to the application data management module 1403.

[0137] The handwriting SDK module 1402 may send the acquired annotation data to the application data management module 1403. The data management module 1403 may save the target file 1 and the annotation data together in a folder of the file management of the local storage file of the electronic device 100 (for example, Figure 3 Specifically, the data of the folder is stored in the memory space of the memory of the electronic device 100. For details, please refer to the above Figure 3 and Figure 4 The description in will not be repeated here.

[0138] Optionally, the application data management module 1403 may save the target file 1 and the annotation data together in a cloud server.

[0139] It is understandable that the annotation data saved by the application data management module 1403 may include relative position information between the annotation data and the target file 1 .

[0140] Optionally, the annotation data in the embodiment of the present application can also be saved as a picture. In this way, an application that does not have the handwriting SDK module 1402 can also view the annotation data.

[0141] Optionally, in an embodiment of the present application, when the application does not have a handwriting SDK module, a prompt may pop up on the user interface of the application, prompting the user to choose to download the handwriting SDK module. After downloading the handwriting SDK module, the user may view the target file 1 with the annotation data added in the application.

[0142] Optionally, in an embodiment of the present application, the application may be automatically upgraded, and the upgraded application may include a handwriting SDK module.

[0143] like Fig.14 As shown, the electronic device 100 may include the following steps of secondary loading annotations in the target application based on user operations:

[0144] 1. The handwriting SDK module 1402 obtains the target file 1 with annotation data added thereto from the application data management module 1403 and parses the annotation data.

[0145] When the electronic device 100 detects the operation of opening the target file 1 with the annotation data added in the target application 1, the electronic device 100 can notify the handwriting SDK module 1402 to obtain the target file 1 with the annotation data added from the application data management module 1403 and parse out the annotation data. Since the file content and the annotation content in the target file 1 with the annotation data added are saved in the same file, the handwriting SDK module 1402 needs to extract the annotation data part from the target file 1 with the annotation data added.

[0146] 2. The handwriting SDK module 1402 passes the annotation data to the handwriting data management service module.

[0147] The handwriting SDK module 1402 may extract the annotation data portion from the target file 1 to which the annotation data is added and send it to the handwriting data management service module.

[0148] 3. The handwriting data management service module can send the annotation data to the rendering management service module.

[0149] The handwriting data management service module needs to parse the annotation data in byte format into multiple points and attribute information (color, brush) corresponding to each point, and then send the multiple points and the attribute information corresponding to each point to the rendering management service module.

[0150] 4. The rendering management service module can redraw the rendered annotation and pass it to the handwriting SDK module 1402.

[0151] The rendering management service module can redraw the multiple points and the attribute information corresponding to each point into annotations. Then the rendering management service module can pass the redrawn annotations to the handwriting SDK module 1402, or notify the handwriting SDK module 1402 to refresh the display.

[0152] 5. The handwriting SDK module 1402 can display the redrawn and rendered annotation on the handwriting control in the application interface control management module 1401.

[0153] The handwriting SDK module 1402 can refresh and display the redrawn and rendered annotation on the handwriting control in the application interface control management module 1401. Or the application interface control management module 1401 is notified to refresh the display, so that the target file 1 with the annotation added can be displayed.

[0154] It is understandable that when the handwriting SDK module 1402 obtains the annotation data from the target file 1 with the annotation, it can also pass the content part of the target file 1 to the application interface control management module 1401, and the application interface control management module 1401 displays the content of the target file 1.

[0155] In some feasible examples, after the user adds an annotation to the target file 1, the user may also scroll or zoom the target file. In response to the user operation, the electronic device 100 may refresh and display the annotation data. Fig.15 The following is a schematic diagram of the interaction process of the electronic device 100 refreshing and displaying the annotation data as the target file 1 is refreshed. Fig.15 As shown, when the target file 1 is scaled or scrolled up and down, or the page is turned, the electronic device 1 refreshes and displays the annotation data, which may include the following steps:

[0156] ①. The application interface control management module 1401 sends the zoom ratio and position information to the handwriting SDK module 1402 based on the user's zoom operation.

[0157] ②. The handwriting SDK module 1402 sends the updated position information and scaling ratio to the rendering management service module.

[0158] ③. The rendering management service module returns the redrawing result at the new position and scale to the handwriting SDK module 1402.

[0159] ④. The handwriting SDK module 1402 notifies the application interface control management module 1401 to refresh the displayed annotation data.

[0160] When the application interface control management module 1401 detects a user zoom operation, the application interface control management module 1401 may send the zoom ratio and the position information of the zoomed annotation to the handwriting SDK module 1402. Then, the handwriting SDK module 1402 may send the updated position information and the zoom ratio to the rendering management service module. Next, the rendering management service module may redraw the annotation data based on the zoom ratio and the new position information, and then return the redrawing result under the new position and ratio to the handwriting SDK module 1402. The handwriting SDK module 1402 may notify the application interface control management module 1401 to refresh the displayed annotation data.

[0161] When the user scrolls the target file or turns the page of the target file, the application interface control management module 1401 can also send the position information of the annotation data after scrolling or the position information of the annotation data in the current page after turning the page to the rendering management service module through the handwriting SDK module 1402. The rendering management service module redraws the rendering and notifies the application interface control management module 1401 to refresh the display through the handwriting SDK module 1402.

[0162] In the embodiment of the present application, an annotation is added to the target file 1 in the target application 1 and the target file 1 with the annotation is saved. Then, the user can display the target file 1 with the annotation in the target application 2 and can display the annotation. The user can not only modify the original annotation but also add a new annotation.

[0163] Fig.16 The specific steps for the target application 2 to open and display the target file 1 with the annotation are shown by way of example. The target application 2 may include an application interface control management module 1601, a handwriting SDK module 1602, and an application data management module 1603. The target application 2 may be an application in the electronic device 100 that is different from the target application 1. For example, the target application 1 is a reading application, and the target application 2 is a memo application. The target application 2 may also be the same application as the target application 1 in the electronic device 200, or a different application. For example, the target application 1 is a reading application in the electronic device 100, and the target application 2 is a reading application or a memo application in the electronic device 200. The embodiments of the present application do not limit the target application 1 and the target application 2.

[0164] Regarding the application interface control management module 1601, the handwriting SDK module 1602, and the application data management module 1603, please refer to the description of the application interface control management module 1401, the handwriting SDK module 1402, and the application data management module 1403 above, which will not be repeated here.

[0165] like Fig.16 As shown, the target application 2 opens and displays the target file 1 with the annotation added, which may include the following steps:

[0166] 1. The application interface control management module 1601 can pass the handwriting range to the handwriting SDK module 1402.

[0167] The application interface control management module 1601 may detect an input event 2 , and in response to the input event 2 , the application interface control management module 1601 may transfer the handwriting range to the handwriting SDK module 1602 .

[0168] The input event 2 may be an operation of a user opening the target file 1 with annotations in the target application 2 . The present application does not specifically limit the input event 2 .

[0169] This step 1 can refer to Fig.14 The description of step ① in the above will not be repeated here.

[0170] 2. The application data management module 1603 obtains the stored target file data and annotation data.

[0171] Case ①: Target application 2 is an application in electronic device 100, that is, target application 2 and target application 1 are installed in the same electronic device, but belong to different applications. Application data management module 1603 can obtain the target file data and annotation data from the local file management of electronic device 100.

[0172] Case ②: Target application 2 is an application in electronic device 200. Application data management module 1603 can obtain the target file data and annotation data from the cloud service. The target file data and annotation data can be uploaded to the cloud server by application data management module 1403 of target application 1.

[0173] 3. The handwriting SDK module 1602 obtains the annotation data.

[0174] The handwriting SDK module 1602 can obtain the file data and annotation data from the application data management module 1603, and obtain the annotation data from the file storing the file data and annotation data. The handwriting SDK module 1602 can distinguish the file data and annotation data based on the data storage format. The annotation data is a structure data with a data header, which is byte data.

[0175] 4. The handwriting SDK module 1602 transmits the annotation data to the handwriting data management service module.

[0176] The handwriting SDK module 1602 can send the acquired annotation data to the handwriting data management service module. In addition, the handwriting SDK module 1602 can also send the file data to the application interface control management module 1601.

[0177] 5. The handwriting data management service module sends the parsed annotation data to the rendering management service module.

[0178] The handwriting data management service module needs to parse the annotation data in byte format into multiple points and attribute information (color, brush) corresponding to each point, and then send the multiple points and the attribute information corresponding to each point to the rendering management service module.

[0179] 6. The rendering management service module notifies the handwriting SDK module 1602 to display the annotation data.

[0180] The rendering management service module can redraw the multiple points and the attribute information corresponding to each point into annotations. Then the rendering management service module can pass the redrawn annotations to the handwriting SDK module 1602, or notify the handwriting SDK module 1602 to refresh the display.

[0181] 7. The handwriting SDK module 1602 notifies the application interface control management module 1601 to display the annotation data.

[0182] The handwriting SDK module 1602 can refresh and display the redrawn and rendered annotation on the handwriting control in the application interface control management module 1601. Or the application interface control management module 1601 is notified to refresh the display, so that the target file 1 with the annotation added can be displayed.

[0183] The user can also modify existing annotations in the target application 2, for example, delete or move them. When the user deletes an annotation in the target application 2, the application interface control management module 1401 in the target application 2 can detect the user operation, and pass the corresponding position information and operation type to the rendering management service module through the handwriting SDK module 1602. The rendering management service module can re-render the annotation according to the corresponding position information and operation type, thereby notifying the application interface control management module 1601 to refresh the display through the handwriting SDK module 1602. When the user moves an annotation in the target application 2, the application interface control management module 1601 in the target application 2 can detect the user operation, and pass the position information before and after the move to the rendering management service module through the handwriting SDK module 1602. The rendering management service module can re-render the annotation according to the position information before and after the move, thereby notifying the application interface control management module 1601 to refresh the display through the handwriting SDK module 1602. Here, the user can also modify the existing annotations in the target application 2. For details, please refer to Fig.15 The description shown in FIG. 1 shows that the user zooms in on the target file 1 to which the annotation is added in the target application 1, which will not be described in detail here.

[0184] The user can also add comments to the target file in the target application 2. The specific process of adding comments can be found in Fig.14 The process of the electronic device 100 adding annotations to the target file 1 based on user operations described in the above will not be repeated here.

[0185] Fig.17 A method for adding annotations provided by an embodiment of the present application is shown. Fig.17 As shown, a method for adding annotations provided in an embodiment of the present application may include the following steps:

[0186] S1701 , the electronic device 100 starts the target application 1 .

[0187] The electronic device 100 may detect a user operation of opening the target application 1, for example, clicking an icon of the target application 1. In response to the user operation, the electronic device 100 may start the target application 1.

[0188] S1702. The target application 1 of the electronic device 100 defines a location for adding annotations.

[0189] Step S1702 can refer to Fig.14 The description of step ① in the above will not be repeated here.

[0190] S1703. The target application 1 of the electronic device 100 launches a handwriting control through the handwriting SDK module.

[0191] Step S1703 can refer to Fig.14 The description of step ② in is not repeated here.

[0192] S1704. The electronic device 100 determines whether to exit adding annotations. If so, execute step S1705; if not, execute step S1707.

[0193] The electronic device 100 may confirm whether to exit adding annotations based on the user operation. For example, the electronic device 100 may detect the user's operation for closing annotations or exiting annotations, and in response to the operation, the electronic device 100 determines to exit adding annotations, and then the electronic device 100 may execute step S1705. Optionally, when the electronic device 100 is in the annotation mode and does not detect the user's operation of adding annotations within a preset time, the electronic device 100 may determine to exit the operation.

[0194] When the electronic device 100 detects that the user is adding an annotation, the electronic device 100 may determine not to exit the adding annotation and may execute step S1707.

[0195] S1705 . The electronic device 100 provides annotation data to the target application 1 .

[0196] S1706. The target application 1 of the electronic device 100 stores the annotation data in a custom storage path.

[0197] The target application 1 of the electronic device 100 can obtain the annotation data stored in the handwriting data management service module through the handwriting SDK module, and save the annotation data in a custom storage location, for example, a folder of the system's file management application. The embodiment of the present application does not limit the custom storage location of the target application 1.

[0198] The above steps S1705 and S1706 can refer to Fig.14 The descriptions of step ④, step ⑤, and step ⑥ are not repeated here.

[0199] S1707: The electronic device 100 adds annotations to the target file.

[0200] Step S1707 can be parameter Fig.14 The description of step ③ in is not repeated here.

[0201] Through a method for adding annotations provided by an embodiment of the present application, the handwriting SDK provides a control (which may be called a handwriting control) that encapsulates the ability to add annotations to the application. When the application needs to perform handwriting annotations at a specified location, the location information is passed to the handwriting SDK, and the handwriting SDK returns a handwriting control of the corresponding location size. When the application scrolls or zooms, the zoom ratio and new location information are synchronously passed to the handwriting SDK, and the handwriting SDK scales and redraws the handwritten content according to the new ratio. When exiting handwriting, the handwriting SDK encapsulates the handwriting data into a unified format and provides it to the application, which stores it to the location it needs as needed.

[0202] Fig.18 A method for adding annotations provided by an embodiment of the present application is shown. Fig.18 As shown, a method for adding annotations provided in an embodiment of the present application may include the following steps:

[0203] S1801 . In response to a user annotating a target file 1 in a target application 1 , the target application 1 of the electronic device 100 displays the annotation 1 .

[0204] The electronic device 100 may display the annotation 1 in the target application 1 in response to the user annotating the target file 1 in the target application 1. For details on how the electronic device 100 adds annotations to the target file 1 in the target application 1, please refer to the above Fig.14 The description of steps ① to ③ in the above description will not be repeated here.

[0205] S1802 . In response to the user's operation of saving annotation 1 in target application 1 , target application 1 of electronic device 100 acquires and saves annotation data corresponding to annotation 1 .

[0206] Step S1802 can refer to the above Fig.14 The description of steps ④ to ⑥ in the above description will not be repeated here.

[0207] S1803 . In response to the user's operation of opening the target file 1 in the target application 2 , the electronic device 100 displays the content of the target file 1 and the annotation 1 in the target application 2 .

[0208] How the electronic device 100 displays the content and annotations of the target file 1 in the target application 2 can be referred to Fig.16 The description in will not be repeated here.

[0209] Through a method for adding annotations provided by an embodiment of the present application, the electronic device 100 can implement handwriting drawing with brushes of various brush effects (fountain pen, pencil, ballpoint pen, highlighter) at any position in the application, and can also support the application's own content scrolling, and the handwritten drawing content can follow the anchor without misalignment after zooming. In addition, the electronic device 100 can also support the application itself to save handwritten data, and support the application to select any save location, and can support the intercommunication of handwritten data between different applications with multiple integrated handwriting SDKs. In this way, users can view annotations and re-edit annotations in any application, which can provide a better user experience.

[0210] In the embodiment of the present application, the electronic device may be the electronic device 100 or the electronic device 200. The first application may be the target application 1, a reading application. The second application may be the target application 2, a memo application. The first annotation may be annotation 1, or may be Figure 2G The second annotation may be Fig.11A Annotation 401 is shown in FIG.

[0211] Fig.19 It is a schematic diagram of the structure of the electronic device 100 provided in an embodiment of the present application.

[0212] The embodiment is described in detail below by taking the electronic device 100 as an example. It should be understood that the electronic device 100 may have more or fewer components than those shown in the figure, may combine two or more components, or may have different component configurations. The various components shown in the figure may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and / or application specific integrated circuits.

[0213] The electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194 and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0214] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0215] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0216] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0217] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0218] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0219] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0220] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0221] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0222] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

[0223] As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrases "upon determining..." or "if (the stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)", depending on the context.

[0224] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media integration. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.

[0225] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.

Claims

1. A method for adding annotations, characterized in that: include: In response to detecting an operation of a user opening a first file in a first application, displaying the first file in the first application; According to an operation of adding a first batch of annotations to the first file by a user in the first application, acquiring and storing annotation data of the first batch of annotations; An operation of opening the first file by a user in a second application is detected, and the file content of the first file and the first batch of annotations are displayed in the second application.

2. The method according to claim 1, characterized in that The first batch of annotations can continue to be edited in the second application, and after displaying the file content of the first file and the first batch of annotations in the second application, the method further includes: An operation of modifying the first batch of annotations by a user in the second application is detected, the first batch of annotations is modified, and the modified first batch of annotations is displayed.

3. The method according to any one of claims 1 or 2, characterized in that: After displaying the file content of the first file and the first batch of annotations in the second application, the method further includes: An operation of adding a second annotation to the first file by a user in the second application is detected, and the file content of the first file and the second annotation are displayed in the second application.

4. The method according to claim 3, characterized in that The annotation data format of the first batch of annotations stored is a byte format.

5. The method according to claim 4, characterized in that The first batch of stored annotation data includes a data header, and the data header is used to indicate a format of the annotation data.

6. The method according to claim 5, characterized in that The data header includes one or more of a data header size field, a creation time field, a modification time field, and a reserved field. The data header size field is used to indicate the size of the data header part, the creation time field is used to indicate the creation time of the first batch of annotations, the modification time field is used to indicate the modification time of the first batch of annotations, and the reserved field is reserved for future use.

7. The method according to claim 5, characterized in that The stored annotation data of the first batch of annotations also includes data content, and the data includes one or more of the width, length and color of the first batch of annotations.

8. The method according to claim 7, characterized in that Acquiring and storing the first batch of annotation data, including: The first batch of annotated annotation data is stored in the first file, and the file format of the first file after the first batch of annotated annotation data is saved is the same as the file format of the first file before the first batch of annotated annotation data is saved.

9. The method according to claim 7, characterized in that: After the first batch of annotated annotation data is stored in the first file, the file content of the first file is not changed and the storage position of the file content in the first file is not changed.

10. The method according to claim 3, characterized in that The method further comprises: The first file and the first batch of annotated annotation data are stored as data in a picture format.

11. The method according to claim 9, characterized in that The annotation data of the first batch of annotations includes the relative positions of the first batch of annotations and the first file.

12. The method according to any one of claims 10 or 11, characterized in that: After displaying the file content of the first file and the first batch of annotations in the second application, the method further includes: Upon detecting a user's operation of scrolling the first file, the file content of the first file and the first batch of annotations are refreshed and displayed, and the relative position of the first batch of annotations to the first file does not change. If the refreshed user interface does not display the file content at the position where the first batch of annotations are located, the refreshed user interface does not display the first batch of annotations.

13. The method according to claim 12, characterized in that After displaying the file content of the first file and the first batch of annotations in the second application, the method further includes: An operation of zooming in or out of the first file by a user is detected, the first batch of annotations are zoomed in or out according to the zoom ratio of the first file, and the first batch of annotations are refreshed and displayed.

14. The method according to claim 1, characterized in that After detecting the second operation of the user adding a first batch of annotations to the first file in the first application, the method further includes: Display a toolbar control, wherein the toolbar control includes one or more of a variety of brush controls, an eraser control, and a lasso control; the various brush controls are used to provide brushes with different textures and transparencies; the eraser control is used to erase pixels or strokes, and the lasso control is used to adjust the first batch of annotations, and the adjustment of the first batch of annotations includes one or more of moving the first control, copying the first batch of annotations, scaling the first batch of annotations, shearing the first batch of annotations, and rotating the first control.

15. The method according to any one of claims 1 to 14, characterized in that: The first application and the second application specifically support a handwriting software development kit SDK for adding annotations and viewing annotations.

16. The method according to claim 15, characterized in that The method further comprises: In the case that the third application does not include the handwriting SDK, a prompt box is displayed in the third application, and the prompt box is used to prompt the user to choose to download the handwriting SDK.

17. The method according to claim 15, characterized in that The method further comprises: When the third application does not include the handwriting SDK, the third application is upgraded, and the upgraded third application includes the handwriting SDK.

18. An electronic device, characterized in that: It includes one or more processors, one or more memories, and a transceiver; wherein the transceiver, the one or more memories are coupled to the one or more processors, the one or more memories are used to store computer program codes, and the computer program codes include computer instructions. When one or more processors execute the computer instructions, the electronic device executes the method as described in any one of claims 1 to 17.

19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed on a computer, the computer is enabled to execute the method according to any one of claims 1 to 17.

20. A chip, applied to electronic equipment, characterized in that: The method comprises a processing circuit and an interface circuit, wherein the interface circuit is used to receive code instructions and transmit the code instructions to the processing circuit, and the processing circuit is used to run the code instructions to execute the method according to any one of claims 1 to 17.

21. A computer program product, characterized in that The method comprises a computer program, and when the computer program is run on a computer, the method according to any one of claims 1 to 17 is executed.