Canvas erasing method and device based on large model, equipment and storage medium

By analyzing user erasing needs using a natural language processing algorithm based on a large model, intelligent granular judgment and data view synchronization of Canvas erasing technology are achieved, solving the problems of insufficient intelligent judgment and cumbersome operation in existing technologies, and improving erasing efficiency and creation smoothness.

CN121746533APending Publication Date: 2026-03-27SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-22
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing Canvas erasing technology lacks intelligent judgment capabilities, cannot automatically select the optimal erasing granularity, separates element data from pixel representation, and makes switching between multiple granularities cumbersome, affecting creation efficiency and smoothness.

Method used

It employs a large-model-based natural language processing algorithm to parse user erasure requests, determine the target erasure mode and region parameters, and achieve intelligent switching between element erasure and pixel erasure. It also leverages the semantic understanding capabilities of the large model and Vue3's reactive data management to synchronize data and views.

Benefits of technology

It improves the efficiency and accuracy of Canvas erasing, solves the problem of separating element data from pixel representation, simplifies the switching between multi-granularity operations, and enhances the smoothness of creation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121746533A_ABST
    Figure CN121746533A_ABST
Patent Text Reader

Abstract

The invention discloses a canvas erasing method and device based on a large model, equipment and a storage medium, is applied to a Vue3 component, and relates to the technical field of graphic processing. Analyzing the acquired image erasing requirement for the canvas to be processed by using a natural language processing algorithm in a preset large model to obtain an instruction analysis result; determining a target erasing mode based on a granularity field in the instruction analysis result, and extracting a target region parameter and a target threshold corresponding to the target erasing mode from the instruction analysis result; the target erasing mode comprises element erasing and pixel erasing; the target threshold value is an erasing range corresponding to the target area parameter; and determining a target erasure area on the canvas to be processed based on the target area parameter and the target threshold, and performing erasure processing on the target erasure area. In this way, the erasing efficiency and accuracy in a complex canvas scene can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of graphics processing technology, and in particular to a method, apparatus, device, and storage medium for erasing canvases based on large models. Background Technology

[0002] In current applications of Canvas (the container object used to host UI components in the Unity engine) erasure technology, the following limitations exist: First, the system generally lacks intelligent judgment capabilities, failing to automatically select the optimal erasure granularity based on user commands and contextual semantics, resulting in low operational efficiency and an unnatural user experience. Second, there is a significant separation between element data and pixel representation—after deleting an element node, the original local pixel modification traces are often lost; conversely, after performing erasure operations at the pixel level, the underlying element data structure is difficult to update synchronously, causing inconsistencies between data and view state. Furthermore, the switching mechanism between multi-granularity erasure operations is usually cumbersome, requiring users to frequently switch between different tools, severely disrupting the continuity and smoothness of the creation process.

[0003] Therefore, improving the efficiency and accuracy of canvas erasure is a problem that needs to be solved. Summary of the Invention

[0004] In view of this, the purpose of this invention is to provide a method, apparatus, device, and storage medium for erasing canvases based on large models, which can significantly improve the erasing efficiency and accuracy in complex canvas scenarios. The specific solution is as follows:

[0005] Firstly, this application discloses a canvas erasure method based on a large model, applied to Vue 3 components, including:

[0006] Load the local preset large model, and use the natural language processing algorithm in the preset large model to parse the obtained image erasure requirements for the canvas to be processed, so as to obtain the instruction analysis results.

[0007] The target erasure mode is determined based on the granularity field in the instruction analysis results, and the target region parameters and target threshold corresponding to the target erasure mode are extracted from the instruction analysis results; the target erasure mode includes element erasure and pixel erasure; the target threshold is the erasure range corresponding to the target region parameters;

[0008] Based on the target region parameters and the target threshold, the target erasure region is determined on the canvas to be processed, and the target erasure region is erased using the preset large model.

[0009] Optionally, loading a locally preset large model includes:

[0010] Build a Vue3 project locally using Vite and run the npm install command to configure the large model SDK in the Vue3 project;

[0011] In the Vue3 project, the Canvas DOM element is obtained to initialize the canvas to be processed, and the local preset large model is loaded in the Vue3 project based on the large model SDK.

[0012] Optionally, the step of using the natural language processing algorithm in the preset large model to parse the obtained image erasure requirements for the canvas to be processed, in order to obtain the instruction analysis results, includes:

[0013] The image erasure request sent by the user to the canvas to be processed is obtained based on the preset interactive interface; the image erasure request is a natural language command.

[0014] The image erasure request is input into the preset large model, and the natural language processing algorithm in the preset large model is used to extract key information from the image erasure request to obtain the instruction analysis result; the key information includes the erasure target, erasure granularity and target attributes.

[0015] Optionally, determining the target erasure mode based on the granularity field in the instruction analysis result, and extracting the target region parameters and target threshold corresponding to the target erasure mode from the instruction analysis result, includes:

[0016] The confidence level of the instruction analysis results is checked to obtain the decision confidence level;

[0017] Determine whether the decision confidence level is greater than a preset confidence threshold;

[0018] If the decision confidence level is less than the preset confidence threshold, a supplementary prompt for erasing instructions is generated based on a preset visualization window so that the user can supplement the image erasing requirement based on the supplementary prompt for erasing instructions.

[0019] If the decision confidence level is greater than or equal to the preset confidence threshold, the granularity field in the instruction analysis result determines the target erasure mode, and the target region parameters and target threshold corresponding to the target erasure mode are extracted from the instruction analysis result.

[0020] Optionally, if the target erasure mode is element erasure, then determining the target erasure region on the canvas to be processed based on the target region parameters and the target threshold, and performing erasure processing on the target erasure region using the preset large model, includes:

[0021] Based on the target region parameters, and by using the target attribute to traverse the target element list of the canvas to be processed, the type of each element is determined.

[0022] If the element is a node type element, then a deletion operation is performed on the node and all its associated connections based on the target threshold;

[0023] If the element is a line-type element, then the deletion operation is performed directly on the element based on the target threshold.

[0024] Optionally, if the target erasure mode is pixel erasure, then determining the target erasure region on the canvas to be processed based on the target region parameters and the target threshold, and performing erasure processing on the target erasure region using the preset large model, includes:

[0025] Bind a mouse movement event to the canvas to be processed to initiate pixel erasure mode;

[0026] Obtain the coordinate position of the mouse on the canvas to be processed, and determine whether the coordinate position is located within the target erasure area based on the target area parameter and the target threshold;

[0027] If the coordinate position is located within the target erasure area, the mouse is controlled by the preset large model to perform an erasure operation on the target erasure area.

[0028] Optionally, after determining whether the coordinate position is within the target erasure area based on the target area parameters and the target threshold, the method further includes:

[0029] If the coordinate position is not within the target erasure area, then proceed to the step of determining the target erasure mode based on the granularity field in the instruction analysis result, so as to obtain the new target area parameters and the target threshold.

[0030] Secondly, this application discloses a canvas erasing device based on a large model, applied to Vue 3 components, including:

[0031] The requirement analysis module is used to load a local preset large model and use the natural language processing algorithm in the preset large model to parse the obtained image erasure requirements for the canvas to be processed, so as to obtain the instruction analysis results.

[0032] The target region determination module is used to determine the target erasure mode based on the granularity field in the instruction analysis result, and extract the target region parameters and target threshold corresponding to the target erasure mode from the instruction analysis result; the target erasure mode includes element erasure and pixel erasure; the target threshold is the erasure range corresponding to the target region parameters;

[0033] The canvas erasure module is used to determine the target erasure area on the canvas to be processed based on the target area parameters and the target threshold, and to perform erasure processing on the target erasure area using the preset large model.

[0034] Thirdly, this application discloses an electronic device, including:

[0035] Memory, used to store computer programs;

[0036] A processor for executing the computer program to implement the aforementioned large-model-based canvas erasure method.

[0037] Fourthly, this application discloses a computer-readable storage medium for storing a computer program, which, when executed by a processor, implements the aforementioned canvas erasure method based on a large model.

[0038] As can be seen, in this application, a local preset large model is loaded, and the natural language processing algorithm in the preset large model is used to parse the obtained image erasure requirements for the canvas to be processed, so as to obtain the instruction analysis results; the target erasure mode is determined based on the granularity field in the instruction analysis results, and the target region parameters and target threshold corresponding to the target erasure mode are extracted from the instruction analysis results; the target erasure mode includes element erasure and pixel erasure; the target threshold is the erasure range corresponding to the target region parameters; the target erasure region is determined on the canvas to be processed based on the target region parameters and target threshold, and the target erasure region is erased using the preset large model. In this way, by utilizing the semantic understanding capability of the large language model and the reactive data management of Vue3, the problems of lack of intelligent judgment capability, separation of element data and pixel representation, and complexity of multi-granularity operation switching in traditional canvas erasure technology can be solved. Attached Figure Description

[0039] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0040] Figure 1 This application discloses a flowchart of a canvas erasure method based on a large model.

[0041] Figure 2 This is a schematic diagram of a specific Vue3 project initialization code disclosed in this application;

[0042] Figure 3 This is a schematic diagram of a specific large-scale model semantic parsing code disclosed in this application;

[0043] Figure 4 This is a schematic diagram of a specific large-scale model decision result parsing code disclosed in this application;

[0044] Figure 5 This is a schematic diagram of a specific element-level erasure execution code disclosed in this application;

[0045] Figure 6 This is a schematic diagram of a specific pixel-level erasure execution code disclosed in this application;

[0046] Figure 7 This is a schematic diagram of a canvas erasing device based on a large model disclosed in this application;

[0047] Figure 8 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation

[0048] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0049] Current Canvas erasing technology has limitations: it lacks intelligent granularity judgment and cannot automatically select the best erasing method based on context; element data and pixel representation are separated, making it difficult to maintain data consistency with the view after the operation. Figure 1 The cumbersome switching between multiple granularities and the disruption to the creative process caused by manually switching tools. Therefore, this application will specifically introduce a canvas erasing method based on a large model, which can solve the above problems.

[0050] See Figure 1 As shown in the figure, this application discloses a canvas erasing method based on a large model, applied to Vue3 components, including:

[0051] Step S11: Load the local preset large model, and use the natural language processing algorithm in the preset large model to parse the obtained image erasure requirements for the canvas to be processed, so as to obtain the instruction analysis results.

[0052] In this embodiment, loading the locally pre-set large model includes: building a Vue3 project locally using Vite and executing `npm install` to configure the large model SDK in the Vue3 project; obtaining the Canvas DOM element in the Vue3 project to initialize the canvas to be processed, and loading the locally pre-set large model in the Vue3 project based on the large model SDK. That is, using Vite to build the Vue3 project meets the performance requirements of high-frequency Canvas operations. `npm install` completes dependency installation, integrates the large model SDK (Software Development Kit), and configures model parameters. An `index.vue` component is created, the Canvas DOM element is obtained through Vue3's `ref`, a dual Canvas layer is initialized (the lower layer stores the original drawing data, and the upper layer is used for real-time rendering), the target image is loaded, and the canvas size is bound for responsive updates. Then, in Vue3's `onMounted` lifecycle hook, a lightweight NLP large model is loaded. It should be noted that the large model uses a local front-end loading mode to avoid network latency affecting the interactive experience, and after warm-up, it continuously listens for user input and canvas operation events. Specifically, such as Figure 2 As shown, the Canvas is first initialized, and then the large model parameters, including the model path, confidence threshold, and maximum input length, are configured. Next, the lightweight NLP (Natural Language Processing) model is loaded and warmed up. The loaded model is then assigned to a global variable, and finally, the model readiness status information is output to the console.

[0053] In this embodiment, the step of using the natural language processing algorithm in the preset large model to parse the obtained image erasure request for the canvas to be processed to obtain the instruction analysis result includes: obtaining the image erasure request sent by the user terminal for the canvas to be processed based on the preset interactive interface; the image erasure request is a natural language instruction; inputting the image erasure request into the preset large model, so as to use the natural language processing algorithm in the preset large model to extract key information from the image erasure request to obtain the instruction analysis result; the key information includes erasure target, erasure granularity, and target attributes. User natural language instructions are collected through the input box (supporting speech-to-text) or shortcut button of the Vue3 component. Specifically, as shown... Figure 3 As shown, the system first listens for changes in user input. When a new instruction is received, it undergoes preprocessing, specifically removing irrelevant characters and punctuation, splitting the instruction into a word array by spaces, and filtering out keywords related to the erasure operation. The processed instruction is then passed to the larger model for inference and analysis.

[0054] Step S12: Determine the target erasure mode based on the granularity field in the instruction analysis result, and extract the target region parameter and target threshold corresponding to the target erasure mode from the instruction analysis result; the target erasure mode includes element erasure and pixel erasure; the target threshold is the erasure range corresponding to the target region parameter.

[0055] In this embodiment, determining the target erasure mode based on the granularity field in the instruction analysis result and extracting the target region parameters and target threshold corresponding to the target erasure mode from the instruction analysis result includes: performing a confidence check on the instruction analysis result to obtain a decision confidence level; determining whether the decision confidence level is greater than a preset confidence threshold; if the decision confidence level is less than the preset confidence threshold, generating a supplementary erasure instruction prompt based on a preset visualization window so that the user can supplement the image erasure requirement based on the supplementary erasure instruction prompt; if the decision confidence level is greater than or equal to the preset confidence threshold, determining the target erasure mode based on the granularity field in the instruction analysis result and extracting the target region parameters and target threshold corresponding to the target erasure mode from the instruction analysis result. That is, the preprocessed instruction is input into a large model, and the model uses an NLP algorithm to parse the core intent and identify key information: erasure target (circle, line, pixel region), erasure granularity (element level / pixel level), and target attributes (position, size, identifier). Based on the "instruction-erasure request" mapping relationship in the training data, a structured decision result is output through semantic similarity calculation and entity recognition. When the confidence level is below 0.7, the user is prompted to provide additional instructions. Specifically, for example... Figure 4As shown, the Canvas is first initialized, and then the large model parameters are configured, including the model path, confidence threshold, and input length limit. Next, the lightweight NLP model is loaded and warmed up, the loaded model is assigned to a global variable, and finally, the model readiness status information is output to the console.

[0056] Step S13: Based on the target region parameters and the target threshold, determine the target erasure region on the canvas to be processed, and use the preset large model to perform erasure processing on the target erasure region.

[0057] In this embodiment, if the target erasure mode is element erasure, the step of determining the target erasure region on the canvas to be processed based on the target region parameters and the target threshold, and using the preset large model to perform erasure processing on the target erasure region, includes: based on the target region parameters, traversing the target element list of the canvas to be processed using the target attribute to determine the type of each element; if the element is a node type element, then performing a deletion operation on the node and all its associated connections based on the target threshold; if the element is a connection type element, then directly performing the deletion operation on the element based on the target threshold. That is, parsing the structured results output by the large model, matching the corresponding erasure mode (element-level / pixel-level) according to the granularity field, and extracting the target parameters and threshold. Specifically, as shown... Figure 5 As shown, the target element list is traversed, and the type of each element is determined: if it is a node, the node and all its associated connections are deleted from the canvas state; if it is a connection, only the connection is deleted. Then, based on the threshold parameters provided by the large model, the element erasure is synchronized to the corresponding pixel area, and finally, the operation history is saved and the canvas is re-rendered.

[0058] In this embodiment, if the target erasure mode is pixel erasure, the step of determining the target erasure area on the canvas to be processed based on the target area parameters and the target threshold, and using the preset large model to perform erasure processing on the target erasure area, includes: binding a mouse movement event to the canvas to be processed to start the pixel erasure mode; obtaining the coordinate position of the mouse on the canvas to be processed, and determining whether the coordinate position is located within the target erasure area based on the target area parameters and the target threshold; if the coordinate position is located within the target erasure area, then using the preset large model to control the mouse to perform an erasure operation on the target erasure area. That is, the large model automatically recommends eraser parameters (size, hardness, shape) based on descriptions such as "fine" and "large area" in the user's instructions, which the user can manually fine-tune to perform pixel-level erasure and record the trajectory. Specifically, as shown below... Figure 6As shown, firstly, a mouse movement event is bound to the canvas to initiate pixel erase mode. When the erase event is triggered, it first checks if the image is in an erase state; otherwise, it exits directly. Next, it obtains the mouse's coordinates on the canvas and verifies if the point is within the valid area of ​​the image. Then, it reads the eraser's size, hardness, and shape parameters from the configuration and adjusts the actual size according to the display ratio. A temporary canvas is created and its size is set to match the image display size, and historical erase data is drawn onto the temporary canvas. Finally, based on the set shape (circle or rectangle) and parameters, an erase area with a specified transparency is drawn at the mouse coordinate position. In this way, the eraser parameters are dynamically adapted, avoiding repeated user adjustments, and a threshold judgment is used to intelligently switch between pixel erase and element erase.

[0059] In this embodiment, after determining whether the coordinate position is within the target erasure area based on the target area parameters and the target threshold, the method further includes: if the coordinate position is not within the target erasure area, then proceeding to the step of determining the target erasure mode based on the granularity field in the instruction analysis result, to obtain new target area parameters and the target threshold. That is, during element-level erasure, the threshold output by the large model is used to control the pixel area cleanup range; during pixel-level erasure, exceeding the threshold triggers the large model to re-identify the target element, achieving bidirectional synchronization between data and view. In this way, based on the large model's judgment of "erasure rationality," the disconnect between element data and pixel representation can be avoided. Finally, execute `npm run dev` to start the front-end page, open a browser to access the corresponding address, input natural language instructions, and verify the semantic parsing accuracy, erasure mode matching accuracy, and data synchronization effect of the large model. Pixel-level erasure is achieved using the Canvas composition mode, supporting adjustments to the eraser shape, size, hardness, and feathering parameters. Pixel erasure trajectories are recorded for undoing or application to similar elements. In addition, when an element node is deleted, the corresponding pixel area is cleaned up simultaneously. When pixel erasure exceeds the threshold, it automatically prompts to switch to element deletion, maintains a unified operation history, and supports undo / redo across granularities.

[0060] As can be seen, in this embodiment, a local preset large model is loaded, and the natural language processing algorithm in the preset large model is used to parse the obtained image erasure requirements for the canvas to be processed, so as to obtain the instruction analysis results; the target erasure mode is determined based on the granularity field in the instruction analysis results, and the target region parameters and target threshold corresponding to the target erasure mode are extracted from the instruction analysis results; the target erasure mode includes element erasure and pixel erasure; the target threshold is the erasure range corresponding to the target region parameters; the target erasure region is determined on the canvas to be processed based on the target region parameters and target threshold, and the target erasure region is erased using the preset large model. In this way, by utilizing the semantic understanding capability of the large language model and the reactive data management of Vue3, the problems of lack of intelligent judgment capability, separation of element data and pixel representation, and complexity of multi-granularity operation switching in traditional canvas erasure technology can be solved.

[0061] refer to Figure 7 The present application also discloses a canvas erasing device based on a large model, applied to Vue3 components, including:

[0062] The requirement analysis module 11 is used to load a local preset large model and use the natural language processing algorithm in the preset large model to parse the obtained image erasure requirements for the canvas to be processed, so as to obtain the instruction analysis results.

[0063] The target region determination module 12 is used to determine the target erasure mode based on the granularity field in the instruction analysis result, and extract the target region parameters and target threshold corresponding to the target erasure mode from the instruction analysis result; the target erasure mode includes element erasure and pixel erasure; the target threshold is the erasure range corresponding to the target region parameters;

[0064] The canvas erasure module 13 is used to determine the target erasure area on the canvas to be processed based on the target area parameters and the target threshold, and to perform erasure processing on the target erasure area using the preset large model.

[0065] As can be seen, in this embodiment, by utilizing the semantic understanding capabilities of the large language model and the reactive data management of Vue3, the problems of lack of intelligent judgment, separation of element data and pixel representation, and complexity of multi-granularity operation switching in traditional Canvas erasing technology can be solved.

[0066] In some specific embodiments, the requirements analysis module 11 may specifically include:

[0067] The project creation unit is used to build a Vue3 project locally via Vite and execute the npm install operation to configure the large model SDK in the Vue3 project;

[0068] The model loading unit is used in the Vue3 project to obtain the Canvas DOM element to initialize the canvas to be processed, and to load the local preset large model in the Vue3 project based on the large model SDK.

[0069] In some specific embodiments, the requirements analysis module 11 may specifically include:

[0070] The instruction acquisition unit is used to acquire the image erasure request sent by the user terminal for the canvas to be processed based on a preset interactive interface; the image erasure request is a natural language instruction.

[0071] An information extraction unit is used to input the image erasure request into the preset large model, so as to use the natural language processing algorithm in the preset large model to extract key information in the image erasure request to obtain instruction analysis results; the key information includes erasure target, erasure granularity and target attributes.

[0072] In some specific embodiments, the target region determination module 12 may specifically include:

[0073] The confidence level acquisition unit is used to perform a confidence level check on the instruction analysis results to obtain the decision confidence level.

[0074] A confidence level determination unit is used to determine whether the decision confidence level is greater than a preset confidence threshold.

[0075] The prompt generation unit is used to generate a supplementary prompt for the erasure instruction based on a preset visualization window if the decision confidence level is less than the preset confidence threshold, so that the user terminal can supplement the image erasure requirement based on the supplementary prompt for the erasure instruction;

[0076] The erasure pattern determination unit is used to determine the target erasure pattern from the granularity field in the instruction analysis result if the decision confidence level is greater than or equal to the preset confidence threshold, and to extract the target region parameters and target threshold corresponding to the target erasure pattern from the instruction analysis result.

[0077] In some specific embodiments, the canvas erasing module 13 may specifically include:

[0078] The parameter traversal unit is used to traverse the list of target elements of the canvas to be processed based on the target region parameters and using the target attribute, so as to determine the type of each element.

[0079] The first element deletion unit is used to perform a deletion operation on the node and all its associated connections based on the target threshold if the element is a node type element.

[0080] The second element deletion unit is used to directly perform the deletion operation on the element based on the target threshold if the element is a line-type element.

[0081] In some specific embodiments, the canvas erasing module 13 may specifically include:

[0082] The erase mode activation unit is used to bind a mouse movement event to the canvas to be processed in order to activate the pixel erase mode.

[0083] The region determination unit is used to obtain the coordinate position of the mouse on the canvas to be processed, and determine whether the coordinate position is located within the target erasure area based on the target region parameter and the target threshold.

[0084] The region erasure unit is used to control the mouse to perform an erasure operation on the target erasure region using the preset large model if the coordinate position is located within the target erasure region.

[0085] In some specific embodiments, the large-model-based canvas erasing device may further include:

[0086] The step jump module is used to jump to the step of determining the target erasure mode based on the granularity field in the instruction analysis result if the coordinate position is not within the target erasure area, so as to obtain the new target area parameters and the target threshold.

[0087] Furthermore, embodiments of this application also disclose an electronic device, Figure 8 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.

[0088] Figure 8 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the large-model-based canvas erasing method disclosed in any of the foregoing embodiments. Alternatively, the electronic device 20 in this embodiment may specifically be a computer.

[0089] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0090] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0091] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the large-model-based canvas erasing method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks.

[0092] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned canvas erasing method based on a large model. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.

[0093] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0094] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0095] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0096] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0097] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A canvas erasing method based on a large model, characterized in that, Applied to Vue 3 components, including: Load the local preset large model, and use the natural language processing algorithm in the preset large model to parse the obtained image erasure requirements for the canvas to be processed, so as to obtain the instruction analysis results. The target erasure mode is determined based on the granularity field in the instruction analysis results, and the target region parameters and target threshold corresponding to the target erasure mode are extracted from the instruction analysis results; the target erasure mode includes element erasure and pixel erasure; the target threshold is the erasure range corresponding to the target region parameters; Based on the target region parameters and the target threshold, the target erasure region is determined on the canvas to be processed, and the target erasure region is erased using the preset large model.

2. The canvas erasure method based on a large model according to claim 1, characterized in that, The loading of the locally preset large model includes: Build a Vue3 project locally using Vite and run the npm install command to configure the large model SDK in the Vue3 project; In the Vue3 project, the Canvas DOM element is obtained to initialize the canvas to be processed, and the local preset large model is loaded in the Vue3 project based on the large model SDK.

3. The canvas erasure method based on a large model according to claim 1, characterized in that, The method utilizes the natural language processing algorithm within the preset large model to parse the obtained image erasure requirements for the canvas to be processed, thereby obtaining instruction analysis results, including: The image erasure request sent by the user to the canvas to be processed is obtained based on the preset interactive interface; the image erasure request is a natural language command. The image erasure request is input into the preset large model, and the natural language processing algorithm in the preset large model is used to extract key information from the image erasure request to obtain the instruction analysis result; the key information includes the erasure target, erasure granularity and target attributes.

4. The canvas erasure method based on a large model according to any one of claims 1 to 3, characterized in that, The step of determining the target erasure mode based on the granularity field in the instruction analysis result, and extracting the target region parameters and target threshold corresponding to the target erasure mode from the instruction analysis result, includes: The confidence level of the instruction analysis results is checked to obtain the decision confidence level; Determine whether the decision confidence level is greater than a preset confidence threshold; If the decision confidence level is less than the preset confidence threshold, a supplementary prompt for erasing instructions is generated based on a preset visualization window so that the user can supplement the image erasing requirement based on the supplementary prompt for erasing instructions. If the decision confidence level is greater than or equal to the preset confidence threshold, the granularity field in the instruction analysis result determines the target erasure mode, and the target region parameters and target threshold corresponding to the target erasure mode are extracted from the instruction analysis result.

5. The canvas erasure method based on a large model according to claim 4, characterized in that, If the target erasure mode is element erasure, then determining the target erasure region on the canvas to be processed based on the target region parameters and the target threshold, and using the preset large model to perform erasure processing on the target erasure region, includes: Based on the target region parameters, and by using the target attribute to traverse the target element list of the canvas to be processed, the type of each element is determined. If the element is a node type element, then a deletion operation is performed on the node and all its associated connections based on the target threshold; If the element is a line-type element, then the deletion operation is performed directly on the element based on the target threshold.

6. The canvas erasure method based on a large model according to claim 4, characterized in that, If the target erasure mode is pixel erasure, then determining the target erasure region on the canvas to be processed based on the target region parameters and the target threshold, and performing erasure processing on the target erasure region using the preset large model, includes: Bind a mouse movement event to the canvas to be processed to initiate pixel erasure mode; Obtain the coordinate position of the mouse on the canvas to be processed, and determine whether the coordinate position is located within the target erasure area based on the target area parameter and the target threshold; If the coordinate position is located within the target erasure area, the mouse is controlled by the preset large model to perform an erasure operation on the target erasure area.

7. The canvas erasure method based on a large model according to claim 6, characterized in that, After determining whether the coordinate position is within the target erasure area based on the target area parameters and the target threshold, the method further includes: If the coordinate position is not within the target erasure area, then proceed to the step of determining the target erasure mode based on the granularity field in the instruction analysis result, so as to obtain the new target area parameters and the target threshold.

8. A canvas erasing device based on a large model, characterized in that, Applied to Vue 3 components, including: The requirement analysis module is used to load a local preset large model and use the natural language processing algorithm in the preset large model to parse the obtained image erasure requirements for the canvas to be processed, so as to obtain the instruction analysis results. The target region determination module is used to determine the target erasure mode based on the granularity field in the instruction analysis result, and extract the target region parameters and target threshold corresponding to the target erasure mode from the instruction analysis result; the target erasure mode includes element erasure and pixel erasure; the target threshold is the erasure range corresponding to the target region parameters; The canvas erasure module is used to determine the target erasure area on the canvas to be processed based on the target area parameters and the target threshold, and to perform erasure processing on the target erasure area using the preset large model.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the large-model-based canvas erasure method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, Used to store a computer program, which, when executed by a processor, implements the canvas erasure method based on a large model as described in any one of claims 1 to 7.