Graphic element state management method and device and electronic equipment

By assigning group identifiers to graphic elements on the graphic canvas and managing them uniformly during state transitions, the problem of high memory consumption of the graphic canvas is solved, and efficient resource utilization is achieved.

CN121832816APending Publication Date: 2026-04-10BEIJING YIZHEN XUESI EDUCATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511974210.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-24
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

In existing technologies, the memory consumption of a graphic canvas is relatively large when switching graphic element states. This is because graphic elements in each preset state are pre-created and stored, resulting in resource waste.

Method used

By assigning the same group identifier to the annotation content and annotation selection identifier under the same batch, the graphic elements in the old state are deleted uniformly when the state changes, and new graphic elements are created and displayed according to the target state, retaining only the elements in one state.

Benefits of technology

It effectively reduces the memory consumption of the graphics canvas, reduces the storage of invalid hidden data, and improves resource utilization efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121832816A_ABST
    Figure CN121832816A_ABST
Patent Text Reader

Abstract

The invention provides a graphic element state management method and device and electronic equipment. On the basis of the type of the annotation and the source information of the target image, the same group identifier is allocated to the annotation content under the same annotation and the graphic elements on the graphic canvas corresponding to the annotation selected identifier, and when the state switching operation for any current graphic element is detected, the current graphic element is switched according to the group identifier of the current graphic element. Removing the graphic elements belonging to the old state and corresponding to the group of identifiers; furthermore, at least one graphic element of a target element state corresponding to the state switching operation is created and displayed on the graphic canvas, and the group identifier of the created graphic element is set as the target group identifier, so that the graphic element corresponding to the same annotation in the new state is still created and associated as a logic whole, and the operation is simplified. Memory occupation caused by coexistence of multi-state graphic elements is avoided, and memory consumption is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of dynamic interface state management technology, and in particular to methods, apparatus and electronic devices for managing the state of graphical elements. Background Technology

[0002] In real-world scenarios, such as online education and other interactive applications involving graphical annotations, users typically need to add composite annotations containing various graphical elements (such as wavy lines, arrows, comment boxes, etc.) to specific content on a graphical canvas. These graphical elements can switch between various preset states (such as marked state, selected state, accepted state, etc.).

[0003] In related technologies, corresponding graphic elements are usually created in advance for each preset state of the same annotation, stored in the graphic canvas, and the graphic elements in the current effective state that need to be displayed are switched by showing / hiding. This method consumes a lot of memory resources of the graphic canvas. Summary of the Invention

[0004] In view of this, this application provides a method, apparatus and electronic device for managing the state of graphical elements, so as to reduce the memory consumption of the graphical canvas.

[0005] The technical solution provided in this application is as follows: According to an embodiment of the first aspect of this application, a method for managing the state of a graphical element is provided, the method comprising: If a state switching operation is detected on the current graphic element on the graphic canvas, the target group identifier of the current graphic element is obtained; wherein, the current graphic element corresponds to the first batch of annotation content or the first batch of annotation selection identifier for any batch of annotations on the target image, and the annotation selection identifier is used to indicate the annotated data content in the target image; the graphic elements on the graphic canvas corresponding to the annotation content and annotation selection identifier under the same batch of annotations have the same group identifier; the group identifier of the graphic element corresponding to the annotation content or annotation selection identifier under any batch of annotations is determined based on the type of annotation and the source information of the target image; Find and remove all graphic elements in the graphic canvas that have the same identifier as the target group; Based on the state switching operation, at least one graphic element corresponding to the target element state of the state switching operation is created on the graphic canvas and displayed, and the group identifier of the created graphic element is set to the target group identifier; the created graphic element includes the graphic element corresponding to the first batch annotation content, and / or the graphic element corresponding to the first batch annotation selection identifier.

[0006] Optionally, the method further includes: If no graphic element exists on the graphic canvas, then upon detecting an initial element creation instruction for any annotation, at least one graphic element is created on the graphic canvas based on the initial element creation instruction. The created at least one graphic element includes a graphic element corresponding to the annotation content of the annotation and / or a graphic element corresponding to the annotation selection identifier of the annotation. The state of the created at least one graphic element matches the initial element creation instruction. The group identifier of the created at least one graphic element is determined based on the type of the annotation and the source information of the target image.

[0007] Optionally, the graphic element corresponding to any selected annotation is also associated with a corresponding base identifier; the base identifier is used to indicate the total number of all selected annotations in the annotation to which the selected annotation belongs, divided according to a set division principle; the base identifier is determined based on the type of the annotation to which the selected annotation belongs, the source information of the target image, and the total number. Each group of selected annotations is divided into corresponding graphic elements on the graphic canvas, and the group identifiers of the corresponding graphic elements on the graphic canvas are the same; the current graphic element corresponds to one of the groups of selected annotations in the first batch.

[0008] Optionally, the method further includes: After detecting that all graphic elements corresponding to all selected annotations of any batch on the graphic canvas have been deleted, the system searches for and removes other graphic elements in the graphic canvas that have the same group identifier as the deleted graphic element.

[0009] Optionally, any graphic element on the graphic canvas has a corresponding element identifier; wherein, the element identifier is determined based on the source information of the target image, the element description information of the graphic element, the annotation selection identifier corresponding to the graphic element, or the annotation type of the annotation to which the annotation content belongs; the method further includes: Upon receiving an update instruction for any graphic element on the graphic canvas, the graphic element is updated, and the element identifier of the graphic element is regenerated based on the source information of the target image, the annotation selection identifier or annotation type to which the annotation content belongs, and the element description information of the updated graphic element.

[0010] Optionally, if a graphic element corresponds to one of the selected portions of a batch of annotations, then the element description information of the graphic element shall at least include the specific location of the annotated data content in the target image indicated by that portion within the target image. If a graphic element corresponds to a batch annotation, then the element description information of the graphic element shall at least include the batch annotation. If a graphic element corresponds to a part of a related graphic between batch annotation content and batch annotation selection identifier, then the element description information of the graphic element shall at least include the identifier of the related graphic and the position of the part in the related graphic.

[0011] Optionally, any graphic element on the graphic canvas has a status identifier, which is used to indicate the current status of the graphic element; After creating at least one graphic element corresponding to the target element state of the state switching operation on the graphic canvas, the state identifier of the newly created graphic element is further updated to the target element state.

[0012] According to an embodiment of a second aspect of this application, a graphical element state management device is provided, the device comprising: The obtaining unit is configured to obtain the target group identifier of the current graphic element if a state switching operation is detected on the current graphic element on the graphic canvas; wherein, the current graphic element corresponds to the first batch of annotation content or the first batch of annotation selection identifier for any batch of annotations on the target image, and the annotation selection identifier is used to indicate the annotated data content in the target image; the graphic elements on the graphic canvas corresponding to the annotation content and annotation selection identifier under the same batch of annotations have the same group identifier; the group identifier of the graphic element corresponding to the annotation content or annotation selection identifier under any batch of annotations is determined based on the type of annotation and the source information of the target image; A removal unit is used to find and remove all graphic elements in the graphic canvas that are identical to the target group identifier; A creation unit is configured to create and display at least one graphic element corresponding to the target element state of the state switching operation on the graphic canvas according to the state switching operation, and set the group identifier of the created graphic element to the target group identifier; the created graphic element includes a graphic element corresponding to the first batch annotation content, and / or a graphic element corresponding to the first batch annotation selection identifier.

[0013] Optionally, the creation unit is further configured to: If no graphic element exists on the graphic canvas, then upon detecting an initial element creation instruction for any annotation, at least one graphic element is created on the graphic canvas based on the initial element creation instruction. The created at least one graphic element includes a graphic element corresponding to the annotation content of the annotation and / or a graphic element corresponding to the annotation selection identifier of the annotation. The state of the created at least one graphic element matches the initial element creation instruction. The group identifier of the created at least one graphic element is determined based on the type of the annotation and the source information of the target image. And / or, the graphic element corresponding to any selected annotation is also associated with a corresponding base identifier; the base identifier is used to indicate the total number of all selected annotations in the annotation to which the selected annotation belongs, divided according to a set division principle; the base identifier is determined based on the type of the annotation to which the selected annotation belongs, the source information of the target image, and the total number; Each group of selected annotations is divided into corresponding graphic elements on the graphic canvas, and the group identifiers of the corresponding graphic elements on the graphic canvas are the same; the current graphic element corresponds to one of the groups of selected annotations in the first batch.

[0014] And / or, the removal unit is further configured to: After detecting that all graphic elements corresponding to all selected annotations of any batch on the graphic canvas have been deleted, the graphic canvas is searched for and other graphic elements with the same group identifier as the deleted graphic element are removed. And / or, any graphic element on the graphic canvas has a corresponding element identifier; wherein, the element identifier is determined based on the source information of the target image, the element description information of the graphic element, the annotation selection identifier corresponding to the graphic element, or the annotation type of the annotation to which the annotation content belongs; the creation unit is further configured to include: Upon receiving an update instruction for any graphic element on the graphic canvas, the graphic element is updated, and the element identifier of the graphic element is regenerated based on the source information of the target image, the annotation selection identifier or annotation type of the annotation content corresponding to the graphic element, and the element description information of the updated graphic element. And / or, if a graphic element corresponds to one of the selected portions of a batch of annotations, then the element description information of the graphic element includes at least the specific location of the annotated data content in the target image indicated by that portion in the target image. If a graphic element corresponds to a batch annotation, then the element description information of the graphic element shall at least include the batch annotation. If a graphic element corresponds to a part of an associated graphic between a batch annotation content and a batch annotation selection identifier, then the element description information of the graphic element shall at least include the identifier of the associated graphic and the position of the part in the associated graphic. And / or, any graphic element on the graphic canvas has a status identifier, which is used to indicate the current status of the graphic element; After creating at least one graphic element corresponding to the target element state of the state switching operation on the graphic canvas, the state identifier of the newly created graphic element is further updated to the target element state.

[0015] According to an embodiment of a third aspect of this application, an electronic device is provided, comprising: a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor; the processor is configured to execute the machine-executable instructions to implement the method described in the first aspect.

[0016] As can be seen from the above technical solutions, this application assigns the same group identifier to the graphic elements on the graphic canvas corresponding to the annotation content and annotation selection identifier under the same annotation, based on the type of annotation and the source information of the target image. When a state switching operation is detected for any current graphic element, the graphic element belonging to the old state corresponding to the group identifier of the current graphic element is removed according to the group identifier of the current graphic element. Furthermore, at least one graphic element of the target element state corresponding to the state switching operation is created on the graphic canvas and displayed, and the group identifier of the created graphic element is set to the target group identifier, so that the graphic elements corresponding to the same annotation in the new state are still created and associated as a logical whole, avoiding memory occupation caused by the coexistence of graphic elements in multiple states and reducing memory consumption. Attached Figure Description

[0017] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this application and, together with the specification, serve to explain the principles of this application.

[0018] Figure 1 A schematic diagram illustrating annotation information for student essays provided in an embodiment of this application; Figure 2 This is a schematic flowchart of a graphical element state management method provided in an embodiment of this application; Figure 3 This application provides a schematic diagram of creating a wavy line in a selected state, as shown in an embodiment. Figure 4 This is a structural diagram of the image correction device provided in the embodiments of this application; Figure 5 This is a schematic diagram of an electronic device structure provided in an embodiment of this application. Detailed Implementation

[0019] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of this application, and to make the above-mentioned objectives, features and advantages of the embodiments of this application more apparent and understandable, the technical solutions in the embodiments of this application will be further described in detail below with reference to the accompanying drawings.

[0020] In real-world scenarios, such as online education and other interactive applications involving graphical annotations, users typically need to add composite annotations containing multiple graphical elements to specific content in a target image on a graphical canvas, and these graphical elements can switch between multiple preset states.

[0021] Specifically, when using AI to grade students' essays, the annotation for a paragraph in the essay can include a variety of graphic elements.

[0022] Please refer to Figure 1 , Figure 1 This is a schematic diagram of annotation information for student essays provided in an embodiment of this application.

[0023] like Figure 1 As shown, a comment on a student's essay includes various graphic elements, such as wavy lines to indicate the text being commented, arrows pointing from the text to the comment, and the specific comment content (i.e., the remarks).

[0024] Furthermore, these graphical elements can switch between multiple preset states based on user actions. For example, they can include preset states such as marked state, selected state, and accepted state.

[0025] The marked state can be the initial prompt state, such as displaying only a gray dashed wavy line below the annotated text to initially indicate that there is an annotation here. The comments and arrows on the right are not displayed. The marked state can only serve as a prompt and does not take up too much visual space.

[0026] When a user clicks on any of the marked gray wavy lines, the annotation is switched to the selected state. The selected state highlights the annotation currently being viewed. At this time, the original gray dashed wavy line is removed, and a red solid wavy line is created in the same position to highlight the currently viewed text. Simultaneously, a detailed comment box appears on the right side of the graphics canvas to display the complete comment content. A red solid arrow can be created pointing from the red solid wavy line to the comment box to indicate the relationship between the two. Figure 1 This can be a sample of a selected neutral annotation.

[0027] Once the user confirms acceptance of the comment suggestion in the selected state (e.g., by clicking the "Accept" button), the comment can switch to the final accepted state. For example, the original red wavy line and arrow are removed. A green double underline is created below the original text to indicate that the suggestion has been formally accepted. Simultaneously, a more formal comment box can be generated, such as with different border colors and backgrounds, to indicate that the commenting process is complete.

[0028] In related technologies, corresponding graphic elements are typically created in advance for each preset state of the same annotation and stored in the graphic canvas. The graphic elements in the current effective state to be displayed are switched by showing / hiding them. For example, all graphic elements in the marked state, selected state, and adopted state are created in advance and stored in the graphic canvas. After determining the target state of the current annotation, the graphic elements corresponding to the target state are displayed, and the graphic elements corresponding to other states are hidden.

[0029] Obviously, this method consumes a lot of memory resources for the graphics canvas.

[0030] Based on this, this application proposes a graphical element state management method to reduce invalid hidden data in the graphical canvas and reduce memory consumption.

[0031] Please refer to Figure 2 , Figure 2 This is a schematic flowchart of a graphical element state management method provided in an embodiment of this application.

[0032] In this embodiment, the method can be applied to an HTML5 Canvas technology platform, and is preferably implemented through a high-level graphics library such as Fabric.js. This application does not impose any limitations on this.

[0033] like Figure 2 As shown, the method may include the following steps: Step 201: If a state switching operation is detected on the current graphic element on the graphic canvas, the target group identifier of the current graphic element is obtained.

[0034] In this embodiment, annotations on the data content in the target image can be displayed by creating graphic elements on a graphic canvas.

[0035] It should be noted that, in this embodiment, the annotations for the target image can be generated by AI. For example, the target image is input into a pre-trained AI essay correction model, which extracts the text content of the student's essay, and then performs in-depth analysis on its content, structure and techniques to identify the highlights or modifiable parts of the text and automatically generate structured annotation information.

[0036] The structured annotation information here can include the annotation type, the annotation content, the annotation selection indicator, and the source information of the target image.

[0037] by Figure 1 Taking the student essay image as an example (the target image is only the original essay image), Figure 1This refers to the effect after graphic elements have been generated on the graphic canvas. By inputting the target image into the AI ​​model, annotations can be obtained for specified content in the target image. The annotation information can include the following: Annotation types: Annotation types can include multiple major categories, and each major category can include several subcategories. For example, if the annotation is determined to belong to the subcategory "Deepening Emotion Methods" under the major category "Writing Techniques", then the annotation type can be recorded as a structured description such as type: 2 (the second major category, assuming 2 represents "Writing Techniques"), subType: 6 (the sixth subcategory, assuming 6 represents "Deepening Emotion Methods").

[0038] Annotation content: This refers to the comment text generated by the AI ​​model, corresponding to... Figure 1 The blue text on the right can be recorded as a structured description: "correctText": "This part uses the 'peeling the onion' method to deepen the emotion. Using this method we learned in class can better demonstrate the moving effect."

[0039] Annotation selection indicator: Used to indicate the data content to be annotated in the target image. Figure 1 In the image, the selected annotation can be defined as a region within the target image. Its information can be recorded as: "positions": [ {"linePositions": [{"x": 102,"y": 826},{"x": 1189,"y": 826}, ],},{"linePositions": [{"x": 15,"y": 865}, {"x": 1200,"y": 865},],},{"linePositions": [{"x": 16,"y": 902}, {"x": 1198,"y": 902}. This region contains three lines, each represented by "linePositions," specifically the starting and ending coordinates of that line. The entire region formed by these lines corresponds to the essay paragraph region indicated by the red wavy line in the image.

[0040] Source information of the target image: used to uniquely identify the assignment image. Specifically, it can be the URL address where the assignment image is stored on the server, for example, recorded in a structured description as: "url": "https: / / hw.xesimg.com / app6_1689909828676.jpg".

[0041] Through the above process, for the target image, the AI ​​correction model can output one or more JSON objects with similar structures, each object corresponding to a comment. For example, for... Figure 1A comment in the document can have the following structured comment information: const data = {"type": 2,"subType": 6,"correctText": "This part uses the 'peeling the onion' method to deepen the emotion. Using this method we learned in class can better reflect the moving effect,"url":"https: / / hw.xesimg.com / app6_1689909828676.jpg","positions":[ {"linePositions":[{"x": 102,"y": 826},{"x": 1189,"y": 826}, ],},{"linePositions": [{"x": 15,"y": 865}, {"x": 1200,"y": 865},],},{"linePositions": [{"x": 16,"y": 902}, {"x": 1198,"y": 902},],}, ],}.

[0042] In this embodiment, the annotation information of an annotation can include the above basic data content, where type indicates the major type to which the comment belongs, subType indicates the minor type to which the comment belongs within the major type (specifically, the 6th minor type within the 2nd major type), correctText is the evaluation language, url is the image address of the assignment, and positions indicates the area in the essay where the annotated content is located, specifically including multiple line segments linePositions, each line segment linePositions containing the starting and ending coordinates of the line segment.

[0043] In this embodiment, the graphic elements that need to be created on the graphic canvas can be determined from the annotation information of each annotation. Each annotation can correspond to at least one graphic element on the graphic canvas. A graphic element can represent the annotation content or annotation selection mark of any annotation.

[0044] In this embodiment, the annotation content corresponding to the current graphic element can be recorded as the first batch of annotation content; the annotation selection mark corresponding to the current graphic element can be recorded as the first batch of annotation selection mark.

[0045] If a state switching operation is detected on the current graphic element on the graphic canvas, the target group identifier of the current graphic element is obtained.

[0046] As one example, the current graphic element on the graphic canvas is subjected to a state switching operation, which may be clicking on the graphic element in the marked state to switch it to the selected state, or accepting the graphic element in the selected state to switch it to the accepted state, etc. This application does not limit this.

[0047] In this embodiment, to avoid storing graphic elements in all states in the graphic canvas, this application proposes that when a state switching operation is performed on the current graphic element, all graphic elements under the annotation to which the current graphic element belongs are uniformly deleted (that is, all graphic elements on the graphic canvas corresponding to the annotation to which the current graphic element belongs that belong to the old state), and the graphic elements in the target state after the switch are regenerated to ensure that only one state of graphic elements exists in the graphic canvas at the same time.

[0048] Considering the need to uniformly delete elements under the annotation to which the current graphic element belongs, in this embodiment, the same group identifier is assigned to the graphic elements corresponding to the annotation content and annotation selection identifier under the same annotation. In order to determine the target group identifier of the current graphic element when the state switching operation of the current graphic element on the graphic canvas is detected, and to find and remove all graphic elements with the same target group identifier in the graphic canvas, that is, to remove all current graphic elements in the old state.

[0049] In this embodiment, the group identifier of the graphic element corresponding to the annotation content or annotation selection mark under any batch of annotations is determined based on the type of the annotation and the source information of the target image. This ensures that all graphic elements corresponding to the annotation content and annotation selection mark under the same batch of annotations have the same group identifier, facilitating unified management of all graphic elements corresponding to the annotation content and annotation selection mark under the same batch of annotations through the group identifier. It should be noted that the group identifier can be generated when creating the graphic elements in the current state.

[0050] As an example, the group identifier can be denoted as group_id, Figure 1 Taking the annotation in the image as an example, its group identifier `group_id` can be: `https: / / hw.xesimg.com / app6_1689909828676.jpg+2+6`. Here, `https: / / hw.xesimg.com / app6_1689909828676.jpg` represents the source information of the target image, and 2 and 6 represent the annotation type (the 2nd major category and the 6th subcategory).

[0051] This concludes the description of step 201. We will now proceed to step 202.

[0052] Step 202: Locate and remove all graphic elements in the graphic canvas that are identical to the target group identifier.

[0053] In this embodiment, when it is determined that the current graphic element on the graphic canvas has been subjected to a state switching operation, all graphic elements in the graphic canvas that are the same as the target group identifier can be found according to the target group identifier of the current graphic element obtained in step 201, and all graphic elements that are the same as the target group identifier in the current state before the state switching operation are uniformly removed.

[0054] This concludes the description of step 202. We will now proceed to step 203.

[0055] Step 203: Based on the state switching operation, create and display at least one graphic element corresponding to the target element state of the state switching operation on the graphic canvas, and set the group identifier of the created graphic element to the target group identifier.

[0056] In this embodiment, after finding and removing all graphic elements with the same target group identifier in the graphic canvas through step 202, at least one graphic element corresponding to the target element state of the state switching operation can be created and displayed on the graphic canvas according to the state switching operation.

[0057] The graphic elements created here may include the graphic elements corresponding to the first batch of annotation content, and / or the graphic elements corresponding to the first batch of annotation selection identifiers.

[0058] In order to manage the graphic elements of the target element state in a unified manner when performing state switching operations in the future, when creating at least one graphic element of the target element state corresponding to the state switching operation, a group identifier can be assigned to the newly created graphic element according to the type of annotation to which the graphic element belongs and the source information of the target image, so as to manage the graphic elements in the target element state through the group identifier.

[0059] It should be noted that since the annotation type and the source information of the target image are the same for the same annotation, the group identifier of the newly created graphic element here is also the target group identifier mentioned above.

[0060] In this embodiment, after creating at least one graphic element of the target element state, each graphic element of the target element state can be displayed on the graphics canvas. At this time, for the same annotation, the graphics canvas only stores each graphic element of that annotation in the target element state, greatly reducing the memory usage of the graphics canvas.

[0061] This concludes the description of step 203.

[0062] In this embodiment, the above method describes the process of uniformly deleting graphic elements in the old state and creating graphic elements in the new state by means of group identifiers when switching states.

[0063] As an example, if no graphic element exists on the graphic canvas, then upon detecting an initial element creation instruction for any annotation, at least one graphic element is created on the graphic canvas based on the initial element creation instruction. The created at least one graphic element includes a graphic element corresponding to the annotation content of the annotation and / or a graphic element corresponding to the annotation selection identifier of the annotation. The state of the created at least one graphic element matches the initial element creation instruction. The group identifier of the created at least one graphic element is determined based on the type of the annotation and the source information of the target image.

[0064] In this embodiment, when creating a graphic element for any annotation for the first time, there is no graphic element corresponding to the annotation on the graphic canvas. At this time, there is no need to perform the above-mentioned step of deleting the graphic element in the old state according to the group identifier. The graphic element in the target element state can be created directly.

[0065] As an example, the graphic element corresponding to the selected annotation in any batch is also associated with a corresponding base identifier; the base identifier is used to indicate the total number of all selected annotations in the annotation to which the selected annotation belongs, divided according to a set division principle; the base identifier is determined based on the type of the annotation to which the selected annotation belongs, the source information of the target image, and the total number. Each selected annotation is divided into segments, and each segment has a corresponding graphic element on the graphic canvas. The group identifiers of the corresponding graphic elements on the graphic canvas are the same. The current graphic element corresponds to one of the segments divided by the first selected annotation.

[0066] In this embodiment, considering that the same batch of selected annotations is often divided into multiple parts, such as using multiple wavy lines to indicate the content being annotated, with each row of wavy lines representing one part of the selected annotation, for ease of management, the graphic elements corresponding to the selected annotations are also associated with corresponding basic identifiers. Each part of any batch of selected annotations has a corresponding graphic element on the graphic canvas, and the group identifiers of the corresponding graphic elements in each part on the graphic canvas are identical.

[0067] As an example, the base identifier can be denoted as base_id, Figure 1 For example, the base_id of the annotation in the image is https: / / hw.xesimg.com / app6_1689909828676.jpg+2+6+positions+3.

[0068] In this context, https: / / hw.xesimg.com / app6_1689909828676.jpg represents the source information of the target image, 2 and 6 represent the type of annotation (the second major category and the sixth minor category), and positions+3 indicates that the number of wavy lines is 3, which is used to indicate that the annotation selection marker (wavy line area) of this annotation is divided into 3 parts, i.e., 3 wavy lines.

[0069] It should be noted that annotation selection markers can be used to identify a continuous stream of annotated data content in a target image, such as consecutive sentences or paragraphs. In this embodiment, an annotation may also include multiple annotation selection markers. For example, if the comments for the first and third paragraphs of an essay are both "there are typos," then the area belonging to the first paragraph can be identified as the annotated data content indicated by the first annotation selection marker, and the area belonging to the third paragraph can be identified as the annotated data content indicated by the second annotation selection marker. These two annotation selection markers belong to the same annotation and correspond to the same annotation content, "there are typos."

[0070] In this case, the total number of records in the basic identifier refers to the number of the first annotation selected identifier divided into, plus the number of the second annotation selected identifier divided into. For example, if the first annotation selected identifier is divided into 3 and the second annotation selected identifier is divided into 2, then the total number of records in the basic identifier of any image element corresponding to any one of the annotation selected identifiers in this annotation is 5.

[0071] For example, a comment about "echoing the beginning and the end" might be related to both the beginning and the end of the essay. In this case, each of the two paragraphs would have a corresponding comment selection icon.

[0072] In this embodiment, the basic identifier can be used as a reference value when deleting graphic elements to determine whether all graphic elements in the current state need to be deleted.

[0073] Specifically, after detecting that all graphic elements corresponding to all selected annotations of any batch on the graphic canvas have been deleted, the system searches for and removes other graphic elements in the graphic canvas that have the same group identifier as the deleted graphic element.

[0074] Specifically, for example, after detecting a manual deletion operation of any graphic element corresponding to any selected label in any batch of annotations (such as a teacher manually deleting an incorrect wavy line), update the total number M of graphic elements corresponding to all selected labels in the annotations to which the selected label belongs that were manually deleted. If the updated M is equal to the number N that the selected annotation identifier is divided into according to the set division principle, then find and remove other graphic elements that have the same group identifier as the deleted graphic element.

[0075] In this embodiment, when creating a graphic element for the annotation for the first time, the system selects an annotation marker (e.g., based on the annotation information) according to the annotation selection marker. Figure 1 The `positions` parameter determines the number N of the selected annotation markers, for example, N=2 (meaning this annotation includes two wavy lines), and records this number N in `base_id`. Simultaneously, the system maintains a deletion counter M with an initial value of 0 for this annotation, used to accumulate the total number of times the corresponding graphic elements in each selected annotation marker on the graphic canvas are deleted.

[0076] When a user manually deletes a corresponding graphic element in the annotation, such as a red wavy line, due to personal preference (e.g., finding the red wavy line distracting), the system listens for the deletion event, retrieves the base_id of the deleted wavy line, and its initial count N. Subsequently, the system increments the deletion counter M associated with that group_id by 1.

[0077] Compare the updated counter value M with the initial quantity N recorded in base_id.

[0078] If the comparison result is M = N, it indicates that the user has manually deleted all the wavy lines of the annotation. At this point, the system determines that the annotation selection indicator no longer exists, and continuing to retain other associated graphic elements (such as comment boxes and arrows) is meaningless and would cause interface clutter. Therefore, an automatic cleanup process is performed, which involves traversing all graphic elements in the graphic canvas based on the group_id of the deleted wavy lines, and finding and removing all remaining graphic elements (including any existing comment boxes and arrows) whose group_id attribute matches.

[0079] As one embodiment, any graphic element on the graphic canvas has a corresponding element identifier; wherein, the element identifier is determined based on the source information of the target image, the element description information of the graphic element, and the annotation type of the annotation to which the corresponding annotation content belongs; the method further includes: Upon receiving an update instruction for any graphic element on the graphic canvas, the graphic element is updated, and the element identifier of the graphic element is regenerated based on the source information of the target image, the annotation selection flag or annotation type to which the annotation content belongs, and the element description information of the updated graphic element.

[0080] In this embodiment, when creating graphic elements, the system can also generate a globally unique element identifier for each element according to predetermined rules. This identifier consists of three parts: the source information of the target image, the type of annotation, and the element description information. Here, the annotation type refers to the annotation type of the annotation selected by the graphic element, or the annotation type of the annotation content corresponding to the graphic element.

[0081] The element description information is used to distinguish different graphic elements under the same annotation.

[0082] Specifically, if a graphic element corresponds to one of the selected portions of a batch of annotations, then the element description information of the graphic element shall at least include the specific location of the annotated data content in the target image indicated by that portion within the target image. If a graphic element corresponds to a batch annotation, then the element description information of the graphic element shall at least include the batch annotation. If a graphic element corresponds to a part of a related graphic between a batch annotation content and a batch annotation selected identifier, then the element description information of the graphic element shall at least include the identifier of the related graphic and the position of the part in the related graphic.

[0083] In this embodiment, the element identifier can be recorded as element id. If the graphic element corresponds to one of the divisions of the batch annotation selection identifier, for example, if the annotation selection identifier is multiple wavy lines and one of the divisions is a wavy line, the wavy line element id can include the job address information (i.e., the source information of the target image), the major type and minor type to which the annotation belongs (i.e., the type of annotation), the annotation selection identifier sequence number to which the wavy line belongs, and the position of the wavy line in the annotation selection identifier (i.e., it is the first division in the annotation selection identifier, such as the first row of wavy lines).

[0084] It should be noted that, considering that an annotation may include multiple annotation selection identifiers, for the graphic element corresponding to one of the annotation selection identifiers, its element ID can also include the annotation selection identifier number to which the graphic element belongs, in order to distinguish which annotation selection identifier the graphic element is part of.

[0085] If a graphic element corresponds to a batch of annotation content, then the element description information of the graphic element must at least include the annotation content. Taking the element ID of the annotation content as an example, its corresponding element ID can include the address information of the job (i.e., the source information of the target image), the major type and minor type to which the annotation belongs (i.e., the type of annotation), and the content information of the comment (i.e., the annotation content itself).

[0086] Considering that in some states, such as the selected state, there may be some related graphics between the annotation content and the annotation selection mark, such as an arrow pointing from the annotation selection mark to the annotation content, which is used to indicate which part of the data content the annotation content is for, such related graphics, such as arrows, are usually composed of multiple graphic elements.

[0087] In this case, the element description information of the graphic element includes at least the identifier of the associated graphic and the position of the part in the associated graphic.

[0088] Taking the arrow mentioned above as an example, this arrow is composed of multiple graphic elements. For instance, a related graphic arrow can be formed by using points, lines, and triangles as graphic elements. In this case, the element ID of a point consists of the address information of the task, the major and minor types of the suggestion, the arrow to which the point belongs, and the vertex information of the arrow. The element ID of a line consists of the address information of the task, the major and minor types of the suggestion, the arrow to which the line belongs, and the line information of the arrow. The element ID of a triangle consists of the address information of the task, the major and minor types of the suggestion, the arrow to which the triangle belongs, and the top triangle information of the arrow.

[0089] In this embodiment, if an update instruction for any graphic element is received, the graphic element is updated, and the element identifier of the graphic element is regenerated based on the source information of the target image, the annotation selection identifier or annotation type of the annotation content corresponding to the graphic element, and the element description information of the updated graphic element.

[0090] As an example, any graphic element on the graphic canvas has a status identifier, which is used to indicate the current state of the graphic element; After creating at least one graphic element on the graphic canvas corresponding to the target element state of the state switching operation, the state identifier of the newly created graphic element is further updated to the target element state.

[0091] In this embodiment, each graphic element can also be assigned a status flag to indicate its current element status, so as to facilitate viewing the current element status of the graphic element.

[0092] Please refer to Figure 3 , Figure 3 This is a schematic diagram illustrating the creation of a selected wavy line according to an embodiment of this application.

[0093] like Figure 3 As shown, when a wavy line is created, a corresponding group identifier group_id, base_id, and the element ID of the wavy line itself are generated for the wavy line, and the current element state of the wavy line is marked as "marked".

[0094] The group_id and base_id have been described in detail above and will not be repeated here.

[0095] For the element ID of the wavy line itself, https: / / hw.xesimg.com / app6_1689909828676.jpg is the source information of the target image, 2 and 6 are the annotation types (the second major category and the sixth minor category), posi+1 means that the current graphic element belongs to the first annotation selection identifier in the annotation (i.e., the annotation selection identifier number is 1), and line+1 means that the wavy line is the first wavy line in the annotation selection identifier.

[0096] This concludes the discussion on... Figure 3 The description.

[0097] This concludes the discussion on... Figure 1 Description of the methods for managing graphic elements in Chinese.

[0098] Based on the annotation type and the source information of the target image, this application assigns the same group identifier to the graphic elements on the graphic canvas corresponding to the annotation content and annotation selection identifier under the same annotation. When a state switching operation is detected for any current graphic element, the graphic element belonging to the old state corresponding to the current graphic element is removed according to the group identifier of the current graphic element. Furthermore, at least one graphic element of the target element state corresponding to the state switching operation is created on the graphic canvas and displayed, and the group identifier of the created graphic element is set as the target group identifier. This ensures that the graphic elements corresponding to the same annotation in the new state are still created and associated as a logical whole, avoiding memory occupation caused by the coexistence of graphic elements in multiple states and reducing memory consumption.

[0099] Please refer to Figure 4 , Figure 4 This is a structural diagram of a graphical element state management device proposed in an embodiment of this application. Figure 4 As shown, the device may include an acquisition unit 401, a removal unit 402, and a creation unit 403. Specifically, the device includes: The obtaining unit 401 is used to obtain the target group identifier of the current graphic element if a state switching operation is detected to be performed on the current graphic element on the graphic canvas; wherein, the current graphic element corresponds to the first batch of annotation content or the first batch of annotation selection identifier for any batch of annotations for the target image, and the annotation selection identifier is used to indicate the annotated data content in the target image; the graphic elements on the graphic canvas corresponding to the annotation content and annotation selection identifier under the same batch of annotations have the same group identifier; the group identifier of the graphic element corresponding to the annotation content or annotation selection identifier under any batch of annotations is determined based on the type of annotation and the source information of the target image; Removal unit 402 is used to find and remove all graphic elements in the graphic canvas that are the same as the target group identifier; The creation unit 403 is used to create and display at least one graphic element of the target element state corresponding to the state switching operation on the graphic canvas according to the state switching operation, and set the group identifier of the created graphic element to the target group identifier; the created graphic element includes the graphic element corresponding to the first batch annotation content, and / or the graphic element corresponding to the first batch annotation selection identifier.

[0100] Optionally, creating unit 403 is also used for: If no graphic element exists on the graphic canvas, then upon detecting an initial element creation instruction for any annotation, at least one graphic element is created on the graphic canvas based on the initial element creation instruction. The created at least one graphic element includes the graphic element corresponding to the annotation content of the annotation and / or the graphic element corresponding to the annotation selection identifier of the annotation. The state of the created at least one graphic element matches the initial element creation instruction. The group identifier of the created at least one graphic element is determined based on the type of the annotation and the source information of the target image. And / or, the graphic element corresponding to any selected annotation is also associated with a corresponding base annotation; the base annotation is used to indicate the total number of all selected annotations in the annotation to which the selected annotation belongs, divided according to the set division principle; the base annotation is determined based on the type of the annotation to which the selected annotation belongs, the source information of the target image, and the total number. Each selected annotation is divided into segments, and each segment has a corresponding graphic element on the graphic canvas. The group identifiers of the corresponding graphic elements on the graphic canvas are the same. The current graphic element corresponds to one of the segments divided by the first selected annotation.

[0101] And / or, the removal unit 402 is also used for: After detecting that all graphic elements corresponding to all selected annotations of any group on the graphic canvas have been deleted, search the graphic canvas for and remove other graphic elements with the same group identifier as the deleted graphic element. And / or, any graphic element on the graphic canvas has a corresponding element identifier; wherein, the element identifier is determined based on the source information of the target image, the element description information of the graphic element, the annotation selection identifier corresponding to the graphic element, or the annotation type of the annotation to which the annotation content belongs; the creation unit is further configured to include: Upon receiving an update instruction for any graphic element on the graphic canvas, the graphic element is updated, and the element identifier of the graphic element is regenerated based on the source information of the target image, the annotation selection identifier or annotation type of the annotation content corresponding to the graphic element, and the element description information of the updated graphic element. And / or, if a graphic element corresponds to one of the selected portions of a batch of annotations, then the element description information of the graphic element shall at least include the specific location of the annotated data content in the target image indicated by that portion in the target image. If a graphic element corresponds to a batch annotation, then the element description information of the graphic element shall at least include the batch annotation. If a graphic element corresponds to a part of a related graphic between a batch annotation content and a batch annotation selection identifier, then the element description information of the graphic element shall at least include the identifier of the related graphic and the position of the part in the related graphic. And / or, any graphic element on the graphic canvas has a status flag, which is used to indicate the current state of the graphic element; After creating at least one graphic element on the graphic canvas corresponding to the target element state of the state switching operation, the state identifier of the newly created graphic element is further updated to the target element state.

[0102] This concludes the process. Figure 4 Description of the graphic element status management device.

[0103] This application also provides embodiments that... Figure 4 Hardware structure description of the illustrated device. This hardware structure is... Figure 5 The structure in the illustrated electronic device. Please refer to [link / reference]. Figure 5 , Figure 5 This is a structural diagram of an electronic device provided in an embodiment of this application. Figure 5 As shown, the hardware structure may include: a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor; the processor is used to execute the machine-executable instructions to implement the method disclosed in the above example of this application.

[0104] Based on the same concept as the above method, this application also provides a machine-readable storage medium storing a plurality of computer instructions, which, when executed by a processor, can implement the method disclosed in the above examples of this application.

[0105] For example, the aforementioned machine-readable storage medium can be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, etc. For instance, machine-readable storage media can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid-state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or combinations thereof.

[0106] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of this application should be included within the scope of the claims of this application. The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method of managing the state of a graphical element, characterized by, The method includes: If a state switching operation is detected on the current graphic element on the graphic canvas, the target group identifier of the current graphic element is obtained; wherein, the current graphic element corresponds to the first batch of annotation content or the first batch of annotation selection identifier for any batch of annotations on the target image, and the annotation selection identifier is used to indicate the annotated data content in the target image; the graphic elements on the graphic canvas corresponding to the annotation content and annotation selection identifier under the same batch of annotations have the same group identifier; the group identifier of the graphic element corresponding to the annotation content or annotation selection identifier under any batch of annotations is determined based on the type of annotation and the source information of the target image; Find and remove all graphic elements in the graphic canvas that have the same identifier as the target group; Based on the state switching operation, at least one graphic element corresponding to the target element state of the state switching operation is created on the graphic canvas and displayed, and the group identifier of the created graphic element is set to the target group identifier; the created graphic element includes the graphic element corresponding to the first batch annotation content, and / or the graphic element corresponding to the first batch annotation selection identifier.

2. The method of claim 1, wherein, The method also includes: If no graphic element exists on the graphic canvas, then upon detecting an initial element creation instruction for any annotation, at least one graphic element is created on the graphic canvas based on the initial element creation instruction. The created at least one graphic element includes a graphic element corresponding to the annotation content of the annotation and / or a graphic element corresponding to the annotation selection identifier of the annotation. The state of the created at least one graphic element matches the initial element creation instruction. The group identifier of the created at least one graphic element is determined based on the type of the annotation and the source information of the target image.

3. The method according to claim 1, characterized in that, Each selected annotation graphic element is also associated with a corresponding base identifier; the base identifier is used to indicate the total number of all selected annotations in the annotation to which the selected annotation belongs, divided according to a set division principle; the base identifier is determined based on the type of the annotation to which the selected annotation belongs, the source information of the target image, and the total number. Each group of selected annotations is divided into corresponding graphic elements on the graphic canvas, and the group identifiers of the corresponding graphic elements on the graphic canvas are the same; the current graphic element corresponds to one of the groups of selected annotations in the first batch.

4. The method according to claim 3, characterized in that, The method also includes: After detecting that all graphic elements corresponding to all selected annotations of any batch on the graphic canvas have been deleted, the system searches for and removes other graphic elements in the graphic canvas that have the same group identifier as the deleted graphic element.

5. The method according to claim 1, characterized in that, Each graphic element on the graphic canvas has a corresponding element identifier; wherein, the element identifier is determined based on the source information of the target image, the element description information of the graphic element, and the annotation selection identifier or annotation type to which the annotation content belongs; the method further includes: Upon receiving an update instruction for any graphic element on the graphic canvas, the graphic element is updated, and the element identifier of the graphic element is regenerated based on the source information of the target image, the annotation selection identifier or annotation type to which the annotation content belongs, and the element description information of the updated graphic element.

6. The method according to claim 5, characterized in that, If a graphic element corresponds to one of the selected portions of a batch of annotations, then the element description information of the graphic element shall at least include the specific location of the annotated data content in the target image indicated by that portion within the target image. If a graphic element corresponds to a batch annotation, then the element description information of the graphic element shall at least include the batch annotation. If a graphic element corresponds to a part of a related graphic between batch annotation content and batch annotation selection identifier, then the element description information of the graphic element shall at least include the identifier of the related graphic and the position of the part in the related graphic.

7. The method according to claim 1, characterized in that, Each graphic element on the graphic canvas has a status identifier, which is used to indicate the current status of the graphic element. After creating at least one graphic element corresponding to the target element state of the state switching operation on the graphic canvas, the state identifier of the newly created graphic element is further updated to the target element state.

8. A graphical element state management device, characterized in that, The device includes: The obtaining unit is configured to obtain the target group identifier of the current graphic element if a state switching operation is detected on the current graphic element on the graphic canvas; wherein, the current graphic element corresponds to the first batch of annotation content or the first batch of annotation selection identifier for any batch of annotations on the target image, and the annotation selection identifier is used to indicate the annotated data content in the target image; the graphic elements on the graphic canvas corresponding to the annotation content and annotation selection identifier under the same batch of annotations have the same group identifier; the group identifier of the graphic element corresponding to the annotation content or annotation selection identifier under any batch of annotations is determined based on the type of annotation and the source information of the target image; A removal unit is used to find and remove all graphic elements in the graphic canvas that are identical to the target group identifier; A creation unit is configured to create and display at least one graphic element corresponding to the target element state of the state switching operation on the graphic canvas according to the state switching operation, and set the group identifier of the created graphic element to the target group identifier; the created graphic element includes a graphic element corresponding to the first batch annotation content, and / or a graphic element corresponding to the first batch annotation selection identifier.

9. The apparatus according to claim 8, characterized in that, The creation unit is also used for: If no graphic element exists on the graphic canvas, then upon detecting an initial element creation instruction for any annotation, at least one graphic element is created on the graphic canvas based on the initial element creation instruction. The created at least one graphic element includes the graphic element corresponding to the annotation content of the annotation and / or the graphic element corresponding to the annotation selection identifier of the annotation. The state of at least one created graphic element matches the initial element creation instruction; the group identifier of the at least one created graphic element is determined based on the type of the annotation and the source information of the target image; And / or, the graphic element corresponding to any selected annotation is also associated with a corresponding base identifier; the base identifier is used to indicate the total number of all selected annotations in the annotation to which the selected annotation belongs, divided according to a set division principle; the base identifier is determined based on the type of the annotation to which the selected annotation belongs, the source information of the target image, and the total number; Each group of selected annotations is divided into corresponding graphic elements on the graphic canvas, and the group identifiers of the corresponding graphic elements on the graphic canvas are the same; the current graphic element corresponds to one of the groups of selected annotations in the first batch. And / or, the removal unit is further configured to: After detecting that all graphic elements corresponding to all selected annotations of any batch on the graphic canvas have been deleted, the graphic canvas is searched for and other graphic elements with the same group identifier as the deleted graphic element are removed. And / or, any graphic element on the graphic canvas has a corresponding element identifier; wherein, the element identifier is determined based on the source information of the target image, the element description information of the graphic element, the annotation selection identifier corresponding to the graphic element, or the annotation type of the annotation to which the annotation content belongs; the creation unit is further configured to include: Upon receiving an update instruction for any graphic element on the graphic canvas, the graphic element is updated, and the element identifier of the graphic element is regenerated based on the source information of the target image, the annotation selection identifier or annotation type of the annotation content corresponding to the graphic element, and the element description information of the updated graphic element. And / or, if a graphic element corresponds to one of the selected portions of a batch of annotations, then the element description information of the graphic element includes at least the specific location of the annotated data content in the target image indicated by that portion in the target image. If a graphic element corresponds to a batch annotation, then the element description information of the graphic element shall at least include the batch annotation. If a graphic element corresponds to a part of an associated graphic between a batch annotation content and a batch annotation selection identifier, then the element description information of the graphic element shall at least include the identifier of the associated graphic and the position of the part in the associated graphic. And / or, any graphic element on the graphic canvas has a status identifier, which is used to indicate the current status of the graphic element; After creating at least one graphic element corresponding to the target element state of the state switching operation on the graphic canvas, the state identifier of the newly created graphic element is further updated to the target element state.

10. An electronic device, characterized in that, include: A processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor; The processor is configured to execute machine-executable instructions to implement the method according to any one of claims 1 to 7.