Artificial intelligence-based rich text processing method and device, equipment and medium

CN121723978BActive Publication Date: 2026-08-21BEIJING VOLCANO ENGINE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511935421.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-19
Publication Date
2026-08-21
Estimated Expiration
2045-12-19

AI Technical Summary

Technical Problem

[0003]然而,一些富文本编辑器仅支持嵌入式地插入非文本内容,无法灵活、轻量地插入外部的第三方组件

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121723978B_ABST
    Figure CN121723978B_ABST
Patent Text Reader

Abstract

One or more embodiments of the present disclosure provide an artificial intelligence-based rich text processing method and device, equipment and medium, the artificial intelligence-based rich text processing method comprising: receiving a first operation in an editing interface of a rich text editor; in response to the first operation matching a component node, determining a first component associated with the first operation, the component node being associated with a plurality of third-party components, the component node being used to add one third-party component in the plurality of third-party components, the plurality of third-party components including the first component; and rendering the first component in the editing interface according to rendering information of the first component. The component node provided by the rich text editor for adding the third-party component corresponds to the plurality of third-party components, and unified rendering logic is provided for the plurality of third-party components through one component node, without the need to separately configure nodes and separately implement rendering logic for each third-party component, facilitating efficient modification and configuration of the plurality of supported third-party components by developers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of this disclosure relate to an AI-based rich text processing method, an AI-based rich text processing apparatus, an electronic device, and a computer-readable storage medium. Background Technology

[0002] Rich text can be understood as a special data representation method. Rich text can embed multimedia elements such as formatting, styles, images, and links, and is widely used in various document editing, web design, email sending and other scenarios.

[0003] However, some rich text editors only support embedding non-text content, and cannot flexibly and lightweightly insert external third-party components. Summary of the Invention

[0004] This summary section is provided to briefly introduce the concepts, which will be described in detail in the detailed description section below. This summary section is not intended to identify key or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0005] At least one embodiment of this disclosure provides an artificial intelligence-based rich text processing method, comprising: receiving a first operation in the editing interface of a rich text editor; in response to the first operation matching a component node, determining a first component associated with the first operation, wherein the component node is associated with a plurality of third-party components, the component node is used to add one of the plurality of third-party components, the plurality of third-party components including the first component; and rendering the first component in the editing interface according to the rendering information of the first component.

[0006] At least another embodiment of this disclosure provides an artificial intelligence-based rich text processing apparatus, comprising: a communication module configured to: receive a first operation in an editing interface of a rich text editor; a determination module configured to: determine a first component associated with the first operation in response to a matching of the first operation with a component node, wherein the component node is associated with a plurality of third-party components, the component node being used to add one of the plurality of third-party components, the plurality of third-party components including the first component; and a rendering module configured to: render the first component in the editing interface according to rendering information of the first component.

[0007] At least one further embodiment of this disclosure provides an electronic device, including: a processing device; and a storage device including one or more computer program instructions; wherein the one or more computer program instructions are executed by the processing device to perform the artificial intelligence-based rich text processing method provided in at least one embodiment of this disclosure.

[0008] At least one further embodiment of this disclosure provides a computer-readable storage medium for non-transitory storage of computer-readable instructions, wherein the computer-readable instructions, when executed by a processor, implement the AI-based rich text processing method provided in at least one embodiment of this disclosure.

[0009] At least one embodiment of this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the AI-based rich text processing method provided in at least one embodiment of this disclosure. Attached Figure Description

[0010] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.

[0011] Figure 1 This illustration schematically depicts an application scenario of a rich text editor provided in at least one embodiment of the present disclosure;

[0012] Figure 2 The illustration shows a flowchart of an artificial intelligence-based rich text processing method provided in at least one embodiment of the present disclosure;

[0013] Figure 3 The illustration shows a schematic diagram of the editing interface of a rich text editor provided in at least one embodiment of the present disclosure;

[0014] Figure 4 The schematic diagram illustrates the structure of an artificial intelligence-based rich text processing device according to at least one embodiment of the present disclosure; and

[0015] Figure 5 The schematic diagram illustrates a structure suitable for implementing at least one embodiment of the present disclosure of an electronic device. Detailed Implementation

[0016] One or more embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0017] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0018] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.

[0019] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.

[0020] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0021] The names of the messages or information exchanged between the various devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of these messages or information.

[0022] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition, use, storage or deletion of the data) shall comply with the requirements of relevant laws, regulations and related provisions.

[0023] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, relevant users should be informed of the type, scope of use, and usage scenarios of the information involved in this disclosure through appropriate means in accordance with relevant laws and regulations, and authorization should be obtained from the relevant users. Among them, relevant users may include any type of rights holder, such as individuals, enterprises, and groups.

[0024] For example, in response to receiving an active request from a user, a prompt message is sent to the relevant user to clearly indicate that the operation requested by the user will require obtaining and using the user's information. This allows the relevant user to choose whether to provide information to the software or hardware such as the electronic device, application, server, or storage medium that performs the operation of any embodiment of the present disclosure based on the prompt message.

[0025] As an optional but non-restrictive implementation, in response to a user's active request, a prompt message can be sent to the user, such as a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide information to the electronic device.

[0026] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.

[0027] Plain text can be understood as a basic data representation method. Plain text only includes text content and limited character encoding information. It cannot directly express complex formats and styles, nor does it support non-text content (such as images, audio, video, etc.). For example, plain text can be files stored with extensions such as txt, md, json, xml, etc.

[0028] Rich text can be understood as a special data representation method. Rich text has diverse formats, supporting various fonts, colors, sizes, alignments, and other formats to enhance the expression of content. In addition, rich text supports non-text content, and can embed multimedia elements such as images, videos, audio, links, and tables. Furthermore, it can display consistent effects on different devices and platforms, has cross-platform compatibility, and is widely used in various document editing, web design, email sending, and other scenarios.

[0029] A rich text editor can be understood as a software tool used to create and edit rich text content. Unlike ordinary plain text editors, rich text editors allow users to add various formats and styles, such as font, font size, color, bold, italics, underline, paragraph formatting, etc. At the same time, rich text editors also support users to add rich text content, such as lists, tables, images, links, etc.

[0030] However, some rich text editors only support static content rendering, limiting interactivity. For example, some rich text editors only support embedding non-text content. For instance, if a user adds non-text content such as a video to a rich text editor, it needs to be done through the video's uniform resource locator (URL). Essentially, it's inserting a fixed URL into the rich text, and the rendering logic is also fixed in the rich text editor's underlying code. However, for third-party components whose business data changes in real time (such as weather forecast components, stock card components, etc.), since the business data of these components changes in real time, it cannot be represented by a fixed URL like non-text content such as videos and maps. Therefore, it is difficult to embed these "real-time changing business data" and "data-driven" third-party components into rich text editors, lacking a lightweight, flexible, and unified integration solution for such components.

[0031] Furthermore, some rich text editors lack the ability to understand and generate non-text content. For example, some rich text editors only handle non-text content (such as images and videos) in a basic manner, such as displaying, scaling, and cropping. They lack the ability to understand the content itself. Users need to manually analyze or rely on external tools to analyze the non-text content and then manually input descriptive text. This process is fragmented and inefficient.

[0032] To at least partially solve the above-mentioned technical problems, at least one embodiment of this disclosure provides a rich text processing method based on artificial intelligence. The method includes: receiving a first operation in the editing interface of a rich text editor; in response to the first operation matching a component node; determining a first component associated with the first operation; the component node being associated with multiple third-party components; the component node being used to add one of the multiple third-party components, the multiple third-party components including the first component; and rendering the first component in the editing interface according to the rendering information of the first component.

[0033] In a rich text processing method based on artificial intelligence provided in at least one embodiment of this disclosure, the rich text editor provides component nodes for adding third-party components. In the form of nodes natively supported by the rich text editor's framework, users can add and render the required third-party components in the editing interface. Furthermore, the component node corresponds to multiple third-party components, providing a concise and unified rendering logic for multiple third-party components through a single component node. This eliminates the need for developers to configure nodes and implement rendering logic separately for each third-party component, facilitating efficient modification and configuration of the supported multiple third-party components by developers.

[0034] Based on the AI-based rich text processing method provided in at least one embodiment of this disclosure, at least one embodiment of this disclosure also provides an AI-based rich text processing apparatus, electronic device, computer-readable storage medium, and computer program product.

[0035] The following detailed description, with reference to the accompanying drawings, describes one or more embodiments of the present disclosure and some examples thereof.

[0036] Figure 1 The illustration shows an application scenario diagram of a rich text editor provided by at least one embodiment of the present disclosure.

[0037] like Figure 1 As shown, the application scenarios provided in this embodiment may include a rich text editor 10. One or more embodiments of this disclosure do not limit the implementation of the rich text editor 10. For example, the rich text editor 10 may be implemented based on existing open-source editor frameworks (such as Lexical, Slate.js, ProseMirror, etc.).

[0038] One or more embodiments of this disclosure do not limit the form in which the rich text editor 10 provides services. In some embodiments, the rich text editor 10 can be a standalone software system. For example, the rich text editor 10 can provide rich text editing services as a standalone application (APP). In other embodiments, the rich text editor 10 can also be integrated into other systems as a functional module of other systems to provide rich text editing services. For example, the rich text editor 10 can be integrated into an office collaboration system as a plugin, cloud service (e.g., cloud document service) to provide rich text editing services in the office collaboration system.

[0039] Users can interact with the rich text editor 10. For example, users can use a terminal device, such as a mobile phone, tablet, portable computer, desktop computer, smart wearable device, smart home appliance, or smart vehicle terminal, etc. The terminal device displays the editing interface of the rich text editor 10, and users can interact with the rich text editor 10 through the editing interface of the rich text editor 10.

[0040] The rich text editor 10 can connect to external resources 11, that is, the rich text editor 10 can communicate with external resources 11. For example, the rich text editor 10 can call external resources 11. External resources 11 may include third-party component libraries 111 and artificial intelligence models 112. The third-party component library 111 may include multiple third-party components, such as multiple user interface (UI) components. The artificial intelligence model 112 may include any one or a combination of multiple large language models, large visual models, large audio models, and large multimodal models. The artificial intelligence model 112 may be a model built on a transformer architecture, a model built on a recurrent neural network, a model built on an attention mechanism, etc. Alternatively, the artificial intelligence model 112 may also be a model obtained by improving on the transformer architecture, such as a mixture of experts (MoE) model.

[0041] In some embodiments, the rich text editor 10 may include a third-party component rendering module 101, which can be used to render third-party components in the rich text editor 10. For example, the third-party component rendering module 101 may include a component node creator 1011, a component registry 1012, a syntax parser 1013, and a component renderer 1014.

[0042] Developers can create component nodes through component node creator 1011. In one or more embodiments of this disclosure, component nodes can be associated with multiple third-party components in third-party component library 111. Component nodes can be used to add one of the multiple third-party components.

[0043] For example, a component node can be associated with a component registry 1012, which can include the mapping relationship between each third-party component and its corresponding component information. In other words, by maintaining a component registry 1012 and using a single component node, the mapping relationship between multiple different third-party components and their corresponding component information can be configured, allowing a single component node to be used to add multiple different third-party components.

[0044] By configuring custom component nodes in the rich text editor 10, when the user uses the rich text editor 10, the rich text editor 10 can receive the first operation in the editing interface of the rich text editor. The syntax parser 1013 can determine whether the first operation matches the component node. In response to the first operation matching the component node, the first component associated with the first operation is determined from the third-party component library 111. The component renderer 1014 can render the first component in the editing interface according to the rendering information of the first component.

[0045] Thus, Rich Text Editor 10 provides a lightweight, flexible, and seamless integration solution with other rich text editors, enabling users to render dynamic third-party components that change in real time with business data within Rich Text Editor 10, thereby enhancing the expressiveness and interactivity of Rich Text Editor 10.

[0046] In other embodiments, the rich text editor 10 may also include a non-text content understanding module 102, which can be used to automatically understand non-text content added to the rich text editor 10. For example, the non-text content understanding module 102 may include a non-text content selection detector 1021, a descriptive text inserter 1022, and an AI service caller 1023.

[0047] When the editing interface of the rich text editor 10 displays first non-text content, the non-text content selection detector 1021 can continuously detect selection operations on the non-text content. In response to the non-text content selection detector 1021 detecting a second operation on the first non-text content, the description text inserter 1022 can display the description text of the first non-text content at the position associated with the first non-text content in the editing interface of the rich text editor 10.

[0048] For example, the AI ​​service caller 1023 can call the artificial intelligence model 112 and use the non-text content understanding ability of the artificial intelligence model 112 to generate a descriptive text of the first non-text content.

[0049] In this way, users can achieve in-depth understanding and automatic annotation of non-text content without leaving the editing interface of the rich text editor 10, thereby improving the production efficiency of rich text content.

[0050] The following will combine Figures 2 to 3 A rich text processing method based on artificial intelligence is described in detail according to at least one embodiment of the present disclosure.

[0051] Figure 2 The illustration shows a flowchart of an artificial intelligence-based rich text processing method provided in at least one embodiment of the present disclosure.

[0052] like Figure 2 As shown, the AI-based rich text processing method of this embodiment includes steps S201 to S203. In some embodiments, the executing entity of the AI-based rich text processing method can be a rich text editor, such as an electronic device equipped with a rich text editor; one or more embodiments of this disclosure do not limit this. The AI-based rich text processing method includes:

[0053] Step S201: In the editing interface of the rich text editor, receive the first operation.

[0054] In one or more embodiments of this disclosure, the editing interface of the rich text editor can be understood as the editing environment or preview state of the rich text editor. Users can perform rich text editing in the editing interface of the rich text editor, such as adding, modifying, and deleting rich text. Furthermore, the rich text content presented in the editing interface of the rich text editor is consistent with the rich text content finally output by the rich text editor (such as a rich text document or rich text page). That is, users can preview the rich text editing operation in real time in the editing interface of the rich text editor, and what they see is what they get.

[0055] The first operation can be understood as any operation triggered by the user in the editing interface of the rich text editor. For example, the first operation can be a text input operation, an image addition operation, a table adjustment operation, etc., triggered in the editing interface.

[0056] During the process of a user editing rich text in the rich text editor's editing interface, the system detects the first operation triggered by the user and executes the corresponding operation in the editing interface based on the node indicated by the first operation.

[0057] Step S202: In response to the first operation matching the component node, determine the first component associated with the first operation.

[0058] In one or more embodiments of this disclosure, a component node can be understood as a custom node natively supported by the rich text editor's framework, and a third-party component can be understood as a UI component provided externally to the rich text editor. For example, a third-party component can be a dynamic component whose business data changes in real time.

[0059] A component node can be associated with multiple third-party components, and can be used to add one of these components. In other words, in one or more embodiments of this disclosure, a unified component node is provided within the rich text editor for multiple third-party components. Users can use this component node to add different types of third-party components to the editing interface based on their actual rich text editing needs. Thus, based on the component node, the overall process of parsing, transforming, rendering, and serializing multiple different third-party components is achieved.

[0060] The first operation matching the component node can be understood as the first operation being used to trigger the component node to add a third-party component to the editing interface. In other words, when the first operation matches the component node, it means that the user has indicated a rich text editing need to render a certain third-party component in the editing interface by triggering the first operation.

[0061] Multiple third-party components can include the first component. The first component associated with the first operation can be understood as the third-party component that the first operation points to and needs to be added in the editing interface. In other words, when the first operation matches a component node, it indicates that a certain third-party component needs to be added based on the component node. Therefore, the first component corresponding to the first operation is identified so that the first component can be added in the editing interface later.

[0062] In some embodiments, a component node may be associated with a component registry, which may include a mapping relationship between each third-party component and its corresponding component information.

[0063] In other words, a component node has a corresponding component registry. The component registry is used to maintain the mapping relationship between each third-party component and its corresponding component information. On the one hand, it enables the establishment of a mapping relationship between third-party components and their corresponding component information, so that the corresponding component information can be determined at the same time after the third-party component is determined. On the other hand, by using a component registry to maintain the component information of multiple third-party components at the same time, a component node can be associated with multiple third-party components at the same time.

[0064] For users, the rich text editor allows them to trigger component nodes through a unified first operation that matches the component node, flexibly adding different third-party components to the editing interface without needing to trigger different third-party components through different operations. For developers, by defining component nodes and associating them with the component registry, a declarative and low-intrusion custom node extension solution is provided. Developers do not need to delve into the rich text editor kernel; they can quickly add, delete, or modify multiple third-party components associated with component nodes simply by modifying the mapping relationships in the component registry, reducing development and maintenance costs.

[0065] Different first operations can correspond to different methods of determining whether the first operation matches a component node. In some possible implementations, the first operation can be a trigger operation on a control provided in the editing interface. In this case, when the first operation is a trigger operation on a component node control, it indicates that the first operation matches the component node. After triggering the first operation, multiple third-party components associated with the component node can be provided. For example, a component list of multiple third-party components associated with the component node can be presented in the editing interface, and the user can select from the component list. The selected third-party component is the first component associated with the first operation.

[0066] In other possible implementations, a specific text format can be configured for the component node, which can serve as the component node's declarator. For example, in the editing interface of a rich text editor, a first text input is received, and in response to the first text input matching the text format corresponding to the component node, the first component associated with the first text input is determined.

[0067] In other words, by parsing the first text input, if the first text input meets the text format corresponding to the component node, it indicates that the user has added a third-party component in the editing interface through text input. In this case, the third-party component indicated by the first text input is the first component associated with the first operation.

[0068] In this way, users can embed complex dynamic third-party components through simple text input operations in the rich text editor's editing interface. This makes the rich text editor no longer limited to static non-text content, but can display dynamic third-party components in rich text content, thus expanding the application boundaries of the rich text editor.

[0069] In some embodiments, the text format corresponding to the component node is a first regular expression. The first regular expression may include a first field for indicating the identifier of a third-party component. In this case, the first text input is matched with the first regular expression to determine the regular expression matching result of the first text input. In response to the regular expression matching result indicating that the first text input matches the first regular expression, the field value of the first field is identified from the first text input, and the third-party component corresponding to the field value of the first field is identified as the first component.

[0070] In other words, the text format corresponding to a component node can be in the form of a regular expression. By performing a regular expression match between the user's first input and the first regular expression, it can be determined whether the first input text matches the first regular expression, i.e., whether the first text input is used to trigger the component node and thus create a third-party component. Simultaneously, the first regular expression includes a first field indicating the identifier of the third-party component (e.g., the name of the third-party component). Therefore, when the first text input matches a component node, by identifying the value of the first field in the first text input, the first component associated with the first text input can be determined.

[0071] In this way, users can declare and add the first component in the rich text editor by inputting text using the syntax rules of the first regular expression. By converting the text node of the first text input into a component node (for example, by converting between different types of nodes through the NodeTransform function), the creation of the component node can be triggered by text input.

[0072] In some embodiments, the first component may include multiple component objects; that is, the first component contains multiple different component objects that can be rendered. For example, when the first component is a weather forecast component, the component objects may be locations; when the first component is a stock card component, the component objects may be stock codes. In this case, the first regular expression may also include a second field for indicating the component object, and the field value of the second field may be identified from the first text input.

[0073] In other words, when a third-party component comprises multiple component objects, when triggering a component node, in addition to specifying the first component to be added via the first text input, it is also necessary to specify the specific component object within that first component to be rendered via the first text input. Thus, the first text input includes various component attributes related to the third-party component to be added, so that the third-party component that meets the user's needs can be rendered subsequently in the rich text editor.

[0074] For example, the text format corresponding to a component node can be ":${name}[${payload}]", where name is the first field used to indicate the identifier of the third-party component, and payload is the second field used to indicate the component object. The second field can be a stringified configuration parameter. For example, when the third-party component is a weather forecast component, the value of the second field can be the JSON string "city":"Beijing".

[0075] It should be noted that one or more embodiments of this disclosure do not limit the text format corresponding to the above-mentioned component nodes. For example, the text format corresponding to the component nodes can also be a character combination pattern that can be recognized by regular expressions or parsers, such as "@${name}{${payload}}" or "#${name}(${payload})".

[0076] In this way, by detecting the first text input in real time in the rich text editor, the first text input is matched with the text format (such as the first regular expression) corresponding to the component node. When the match is successful, the first component is determined so that the first component can be rendered subsequently. When the match is unsuccessful, the first text input is processed as an ordinary text node.

[0077] Step S203: Render the first component in the editing interface according to the rendering information of the first component.

[0078] After determining the first component associated with the first operation, the first component can be rendered in the editing interface based on its rendering information. In this way, the rich text content added in the rich text editor can include dynamic third-party components.

[0079] As mentioned earlier, when the first component includes multiple component objects, the component object corresponding to the field value of the second field in the first component can also be rendered in the editing interface based on the rendering information of the first component. In this way, the specific component object of the third-party component is presented in the editing interface, such as the weather forecast of a certain location or the stock card of a certain stock code.

[0080] In some possible implementations, the component registry maintains a mapping relationship between third-party components and their corresponding component information. The component information may include a rendering method for rendering the third-party component. In this case, the rendering method for rendering the first component is determined from the mapping relationship between the first component and its corresponding component information in the component registry, the rendering method for rendering the first component is executed, and the first component is rendered in the editing interface.

[0081] In other words, the rendering method used to render the third-party component is maintained in the component registry along with the third-party component as component information. When rendering the third-party component, the rendering method corresponding to the first component is searched in the component registry. By executing the rendering method, the first component is rendered in the editing interface, thus realizing the function of adding the first component as rich text content to the editing interface.

[0082] One or more embodiments of this disclosure do not limit the rendering method. For example, the rendering method for third-party components can be implemented based on frameworks such as React and Vue, or the rendering method for rendering third-party components can also be implemented using native Web Components or JavaScript / DOM manipulation.

[0083] In this way, by defining component nodes associated with multiple third-party components, when users are editing rich text in the rich text editor, they can trigger the component node through the first operation that matches the component node, create the component node of the first component in the editing interface of the rich text editor, and render the first component as rich text content, thus enriching the rich text content supported by the rich text editor.

[0084] Furthermore, the rich text editor can also support a dual-modal view. That is, in addition to providing an editing interface for users to edit rich text while previewing the rich text content in real time, the rich text editor can also provide a code interface for users to view the specific code structure of the rich text content. For example, the code interface can present the text structure of the text content, the rendering logic of non-text content, etc.

[0085] For example, after the first component is rendered in the editing interface, in response to receiving a mode switching operation, the editing interface of the rich text editor can be switched to the code interface of the rich text editor, in which the code corresponding to the first component is presented.

[0086] In other words, the rich text editor provides a dual-modal view switching function. For example, the rich text editor provides a mode switching control for mode switching. By switching modes, such as triggering the mode switching control, the rich text editor switches to the code interface for display. Furthermore, the code presented in the code interface is consistent with the rich text content presented in the editing interface, realizing unified state management of various rich text contents in the rich text editor and ensuring the consistency of rich text content under dual-modal views.

[0087] In some possible implementations, in response to the first operation matching the component node, the code editor is invoked to generate a code node, and the code corresponding to the first component is generated in the code node so as to present the code corresponding to the first component in the code interface of the rich text editor.

[0088] In other words, in at least one embodiment of this disclosure, the code corresponding to the third-party component presented in the code interface of the rich text editor is implemented based on an external code editor. Since third-party components are diverse in type and have different code formats, directly presenting the code of third-party components using the code nodes natively provided by the rich text editor is ineffective. Therefore, by calling an external code editor, and utilizing a more comprehensive and feature-rich code editor to generate code nodes, the code nodes can more reasonably present the code corresponding to the third party.

[0089] Furthermore, in one or more embodiments of this disclosure, the rich text editor may also support automatic understanding of non-text content. For example, the editing interface of the rich text editor displays first non-text content, and in response to a second operation on the first non-text content, descriptive text of the first non-text content is displayed at a position associated with the first non-text content in the editing interface of the rich text editor, the second operation being used to generate and display the descriptive text of the non-text content.

[0090] The second operation can be understood as an operation that performs AI understanding on non-text content. One or more embodiments of this disclosure do not limit the second operation. For example, the second operation can be an operation that triggers an AI understanding control, or it can be an operation that clicks on non-text content.

[0091] The location associated with the first non-text content can be understood as a location in the editing interface that is related to the location of the first non-text content. For example, the location associated with the first non-text content could be to the left or right of the location of the first non-text content.

[0092] By triggering a second operation on the first non-text content, the content of the first non-text content is understood, and the descriptive text of the first non-text content is automatically presented in the editing interface. For example, the descriptive text of an image is presented, or the descriptive text of a video is presented.

[0093] Thus, for non-text content within rich text content, users no longer need to manually describe the non-text content, nor do they need to call external content understanding services to the rich text editor and then manually add the descriptive text generated by the external content understanding service to the editing interface. Users can complete in-depth understanding of non-text content and automatic annotation of descriptive text without leaving the rich text editor, reducing operation steps and context switching, and improving the production efficiency of rich text content.

[0094] In some embodiments, the first non-text content is presented at a first position in the editing interface of the rich text editor. In this case, a text node is added at a second position adjacent to the first position in the editing interface of the rich text editor, and descriptive text of the first non-text content is added to the text node.

[0095] In other words, on the one hand, in one or more embodiments of this disclosure, the descriptive text of the first non-text content is automatically inserted by adding text nodes; on the other hand, the second position where the text node is located is adjacent to the first position where the first non-text content is located. For example, the second position where the text node is located can be located directly below the first position where the first non-text content is located. In this way, the descriptive text of the non-text content is displayed together with the non-text content in adjacent positions, so that users can quickly obtain the descriptive text of the non-text content.

[0096] Figure 3 The illustration shows a schematic diagram of the editing interface of a rich text editor provided in at least one embodiment of the present disclosure.

[0097] like Figure 3 As shown, the editing interface 300 of the rich text editor may include a control presentation area 301 and a rich text content presentation area 302. The control presentation area 301 presents various types of controls provided by the rich text editor, such as controls related to modifying text format and controls for adding non-text content.

[0098] The rich text content presentation area 302 can be used to present the rich text content generated after the user triggers a rich text editing operation in the rich text editor. Figure 3 In the rich text content presentation area 302, a first non-text content 3021 is presented. For example, the first non-text content 3021 can be an image, video, audio, etc. Below the first non-text content 3021, a descriptive text 3022 of the first non-text content is presented.

[0099] Thus, for non-text content added by the user in the editing interface 300 of the rich text editor, the second operation is triggered to automatically generate and present descriptive text for the non-text content, thereby achieving automatic content understanding of the non-text content. The entire process is implemented in the editing environment of the rich text editor.

[0100] One or more embodiments of this disclosure do not limit the method of generating the descriptive text of the first non-text content. In some embodiments, the descriptive text of the first non-text content can be generated by calling a visual application programming interface (API), such as an image recognition API or a video recognition API.

[0101] In other embodiments, the content understanding capabilities of the artificial intelligence model can also be utilized to generate descriptive text for the first non-textual content. For example, a first prompt word can be generated, sent to the artificial intelligence model, and the descriptive text for the first non-textual content returned by the artificial intelligence model can be received.

[0102] In generative tasks, prompts can be used to guide AI models to produce specific outputs. By configuring prompts, AI models can understand the context and requirements of the task, enabling them to handle different types of processing tasks without retraining, thus increasing the scalability and flexibility of the AI ​​model.

[0103] The first prompt word may include: identification information of the first non-text content and prompt information for indicating the generation of the first non-text content. For example, the identification information of the first non-text content may be the base64 encoding of the first non-text content or a URL.

[0104] By sending the first prompt word to the artificial intelligence model, the model can obtain the first non-text content through the identification information of the first non-text content, understand the content of the first non-text content, generate descriptive text of the first non-text content, and then output the descriptive text of the first non-text content, for example, in the form of structured text.

[0105] Based on the AI-based rich text processing method provided in at least one embodiment of this disclosure, at least one embodiment of this disclosure also provides an AI-based rich text processing apparatus. The following will be combined with... Figure 4 This AI-based rich text processing device is described in detail.

[0106] Figure 4The illustration shows a schematic diagram of the structure of an artificial intelligence-based rich text processing device provided in at least one embodiment of the present disclosure.

[0107] like Figure 4 As shown, the AI-based rich text processing device 400 of this embodiment includes a communication module 401, a determination module 402, and a presentation module 403. For example, the communication module 401, determination module 402, and presentation module 403 can be implemented using hardware (e.g., circuit) modules or software modules. The following embodiments are similar and will not be described again. For example, the communication module 401, determination module 402, and presentation module 403 can be implemented using a central processing unit (CPU), a general-purpose graphics processor (GPGPU), a graphics processing unit (GPU), a tensor processor (TPU), a field-programmable gate array (FPGA), or other processing units with data processing capabilities and / or instruction execution capabilities, along with corresponding computer instructions.

[0108] The communication module 401 is configured to receive the first operation in the editing interface of the rich text editor. For example, the communication module 401 can be configured to execute step S201 described above. The specific implementation principle can be referred to the relevant description of step S201, which will not be repeated here.

[0109] The determining module 402 is configured to: in response to the first operation matching a component node, determine a first component associated with the first operation, wherein the component node is associated with multiple third-party components, and the component node is used to add one of the multiple third-party components, the multiple third-party components including the first component. For example, the determining module 402 can be configured to execute step S202 described above; its specific implementation principle can be found in the relevant description of step S202, and will not be repeated here.

[0110] The rendering module 403 is configured to render the first component in the editing interface according to the rendering information of the first component. For example, the rendering module 403 can be configured to execute step S203 as described above; its specific implementation principle can be found in the relevant description of step S203, and will not be repeated here.

[0111] In at least one embodiment of this disclosure, the communication module 401 is further configured to: receive a first text input in the editing interface of the rich text editor; the determination module 402 is further configured to: determine a first component associated with the first text input in response to a match between the first text input and the text format corresponding to the component node.

[0112] In at least one embodiment of this disclosure, the text format corresponding to the component node is a first regular expression, the first regular expression including a first field for indicating a third-party component identifier, and the determining module 402 is further configured to: perform regular expression matching on the first text input and the first regular expression to determine the regular expression matching result of the first text input; in response to the regular expression matching result indicating that the first text input matches the first regular expression, identify the field value of the first field from the first text input; and determine the third-party component corresponding to the field value of the first field as the first component.

[0113] In at least one embodiment of this disclosure, the first component includes a plurality of component objects, the first regular expression further includes a second field for indicating the component object, and the determining module 402 is further configured to: in response to the regular expression matching result indicating that the first text input matches the first regular expression, identify the field value of the second field from the first text input; the rendering module 403 is further configured to: render the component object corresponding to the field value of the second field in the first component in the editing interface according to the rendering information of the first component.

[0114] In at least one embodiment of this disclosure, the component node is associated with a component registry, which includes a mapping relationship between each of the plurality of third-party components and its corresponding component information.

[0115] In at least one embodiment of this disclosure, the component information includes a rendering method for rendering the third-party component, and the presentation module 403 is further configured to: determine a rendering method for rendering the first component from the mapping relationship between the first component and the corresponding component information in the component registry; execute the rendering method for rendering the first component, and render the first component in the editing interface.

[0116] In at least one embodiment of this disclosure, the editing interface of the rich text editor presents first non-text content, and the presentation module 403 is further configured to: in response to a second operation on the first non-text content, present descriptive text of the first non-text content at a position associated with the first non-text content in the editing interface of the rich text editor, wherein the second operation is used to generate and present the descriptive text of the non-text content.

[0117] In at least one embodiment of this disclosure, the first non-text content is presented at a first position in the editing interface of the rich text editor, and the presentation module 403 is further configured to: add a text node at a second position adjacent to the first position in the editing interface of the rich text editor; and add descriptive text of the first non-text content to the text node.

[0118] In at least one embodiment of this disclosure, the descriptive text of the first non-text content is generated in the following manner: generating a first prompt word, wherein the first prompt word includes: identification information of the first non-text content and prompt information for indicating the generation of the descriptive text of the first non-text content; sending the first prompt word to an artificial intelligence model, and receiving the descriptive text of the first non-text content returned by the artificial intelligence model.

[0119] In at least one embodiment of this disclosure, the presentation module 403 is further configured to: in response to receiving a mode switching operation, switch the editing interface of the rich text editor to the code interface of the rich text editor; and present the code corresponding to the first component in the code interface of the rich text editor.

[0120] In at least one embodiment of this disclosure, the presentation module 403 is further configured to: in response to the first operation matching a component node, invoke a code editor to generate a code node; generate code corresponding to the first component in the code node, so as to present the code corresponding to the first component in the code interface of the rich text editor.

[0121] It should be noted that, for clarity and brevity, at least one embodiment of this disclosure does not show all the constituent units of the AI-based rich text processing device 400. To achieve the necessary functions of the AI-based rich text processing device 400, those skilled in the art can provide and set other constituent units (not shown) according to specific needs, and one or more embodiments of this disclosure do not limit this.

[0122] At least one embodiment of this disclosure also provides an electronic device, including a processing device and a storage device, the storage device including one or more computer program modules; wherein the one or more computer program modules are stored in the storage device and configured to be executed by the processing device, the one or more computer program modules being used to implement the AI-based rich text processing method provided in any embodiment of this disclosure.

[0123] For example, the processing device may be a processor, such as a central processing unit (CPU), digital signal processor (DSP), image processor (GPU), general-purpose graphics processor (GPGPU), or other form of processing unit with data processing capabilities and / or instruction execution capabilities. It may be a general-purpose processor or a dedicated processor and may control other components in the electronic device to perform the desired functions.

[0124] For example, the storage device may be a memory, which may include one or more computer program products. These computer program products may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may, for example, include random access memory (RAM) and / or cache memory. The non-volatile memory may, for example, include read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and a processing device may execute these program instructions to implement the functions (implemented by the processing device) in at least one embodiment of this disclosure and / or other desired functions. Various application programs and various data may also be stored in the computer-readable storage medium, which is not limited by one or more embodiments of this disclosure.

[0125] The following is for reference. Figure 5 The diagram illustrates a structural schematic of an electronic device (e.g., a terminal device or a server) 500 suitable for implementing at least one embodiment of the present disclosure. The terminal device in at least one embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of at least one embodiment of this disclosure.

[0126] like Figure 5 As shown, electronic device 500 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 502 or a program loaded from storage device 508 into random access memory (RAM) 503. RAM 503 also stores various programs and data required for the operation of electronic device 500. Processing unit 501, ROM 502, and RAM 503 are interconnected via bus 504. Input / output (I / O) interface 505 is also connected to bus 504.

[0127] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic device 500 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 An electronic device 500 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0128] In particular, according to one or more embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, one or more embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, it performs the functions defined in the methods of at least one embodiment of this disclosure.

[0129] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0130] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0131] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0132] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the aforementioned AI-based rich text processing method.

[0133] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0134] One or more embodiments of this disclosure also provide a computer program product comprising one or more computer instructions. When the computer instructions are loaded and executed on a computing device, all or part of the processes or functions described in any embodiment of this disclosure are generated.

[0135] The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, or data center to another website, computer, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0136] When the computer program product is executed by a computer, the computer executes any of the aforementioned AI-based rich text processing methods. The computer program product can be a software installation package; when any of the aforementioned AI-based rich text processing methods is required, the computer program product can be downloaded and executed on the computer.

[0137] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0138] The units or modules described in at least one embodiment of this disclosure can be implemented in software or hardware. The names of the units or modules do not necessarily constitute a limitation on the unit or module itself.

[0139] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.

[0140] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0141] According to one or more embodiments of this disclosure, Example 1 provides an artificial intelligence-based rich text processing method, including:

[0142] The first operation is received in the rich text editor's editing interface;

[0143] In response to the first operation matching a component node, a first component associated with the first operation is determined, wherein the component node is associated with multiple third-party components, and the component node is used to add one of the multiple third-party components, the multiple third-party components including the first component;

[0144] The first component is rendered in the editing interface based on the rendering information of the first component.

[0145] According to one or more embodiments of this disclosure, Example 2 provides the editing interface of the rich text editor in Example 1, receiving a first operation, including:

[0146] The rich text editor receives the first text input in its editing interface;

[0147] The step of responding to the first operation and matching it with a component node to determine the first component associated with the first operation includes:

[0148] In response to the first text input matching the text format corresponding to the component node, the first component associated with the first text input is determined.

[0149] According to one or more embodiments of this disclosure, Example 3 provides that the text format corresponding to the component node in Example 2 is a first regular expression, the first regular expression including a first field for indicating a third-party component identifier, and the step of determining the first component associated with the first text input in response to the first text input matching the text format corresponding to the component node includes:

[0150] Perform regular expression matching between the first text input and the first regular expression to determine the regular expression matching result of the first text input;

[0151] In response to the regular expression matching result indicating that the first text input matches the first regular expression, the field value of the first field is identified from the first text input;

[0152] The third-party component corresponding to the field value of the first field is identified as the first component.

[0153] According to one or more embodiments of this disclosure, Example 4 provides that the first component in Example 3 includes a plurality of component objects, and the first regular expression further includes a second field for indicating the component objects, in response to the regular expression matching result indicating that the first text input matches the first regular expression, the method further includes:

[0154] Identify the field value of the second field from the first text input;

[0155] Rendering the first component in the editing interface based on the rendering information of the first component includes:

[0156] Based on the rendering information of the first component, the component object corresponding to the field value of the second field in the first component is rendered in the editing interface.

[0157] According to one or more embodiments of this disclosure, Example 5 provides that the component node in Example 1 is associated with a component registry, the component registry including: a mapping relationship between each of the plurality of third-party components and the corresponding component information.

[0158] According to one or more embodiments of this disclosure, Example Six provides the component information in Example Five, including a rendering method for rendering the third-party component. The step of rendering the first component in the editing interface based on the rendering information of the first component includes:

[0159] The rendering method for rendering the first component is determined from the mapping relationship between the first component and the corresponding component information in the component registry.

[0160] The rendering method for rendering the first component is executed, and the first component is rendered in the editing interface.

[0161] According to one or more embodiments of this disclosure, Example 7 provides an editing interface for a rich text editor in any of Examples 1 to 6 that displays first non-text content, and the method further includes:

[0162] In response to a second operation on the first non-text content, descriptive text of the first non-text content is presented at a location associated with the first non-text content in the editing interface of the rich text editor, wherein the second operation is used to generate and present the descriptive text of the non-text content.

[0163] According to one or more embodiments of this disclosure, Example 8 provides a first position in the editing interface of the rich text editor where the first non-text content of Example 7 is presented, wherein the position in the editing interface of the rich text editor associated with the first non-text content presents descriptive text of the first non-text content, including:

[0164] In the editing interface of the rich text editor, a text node is added at a second position adjacent to the first position;

[0165] At the text node, add descriptive text for the first non-text content.

[0166] According to one or more embodiments of this disclosure, Example 9 provides that the descriptive text of the first non-textual content in Example 7 is generated in the following manner:

[0167] Generate a first prompt word, wherein the first prompt word includes: identification information of the first non-text content and prompt information for indicating the generation of descriptive text of the first non-text content;

[0168] The first prompt word is sent to the artificial intelligence model, and the descriptive text of the first non-text content returned by the artificial intelligence model is received.

[0169] According to one or more embodiments of this disclosure, Example 10 provides that, after the first component is rendered in the editing interface, the method further includes:

[0170] In response to receiving a mode switching operation, the editing interface of the rich text editor is switched to the code interface of the rich text editor;

[0171] The code interface of the rich text editor displays the code corresponding to the first component.

[0172] According to one or more embodiments of this disclosure, Example 11 provides the code interface of the rich text editor in Example 10, which presents the code corresponding to the first component, including:

[0173] In response to the first operation matching the component node, the code editor is invoked to generate a code node;

[0174] At the code node, the code corresponding to the first component is generated, so that the code corresponding to the first component is presented in the code interface of the rich text editor.

[0175] According to one or more embodiments of this disclosure, Example Twelve provides an artificial intelligence-based rich text processing apparatus, comprising:

[0176] The communication module is configured to receive the first operation in the rich text editor's editing interface;

[0177] The determination module is configured to: in response to a first operation matching a component node, determine a first component associated with the first operation, wherein the component node is associated with multiple third-party components, and the component node is used to add one of the multiple third-party components, the multiple third-party components including the first component;

[0178] The rendering module is configured to render the first component in the editing interface based on the rendering information of the first component.

[0179] According to one or more embodiments of this disclosure, Example Thirteen provides an electronic device, including:

[0180] Processing device; and

[0181] Storage device, including one or more computer program instructions;

[0182] The one or more computer program instructions are executed by the processing device to perform the rich text processing method based on artificial intelligence provided in at least one embodiment of the present disclosure.

[0183] According to one or more embodiments of the present disclosure, Example Fourteen provides a computer-readable storage medium that non-transitory stores computer-readable instructions, wherein the computer-readable instructions, when executed by a processor, implement the AI-based rich text processing method provided in at least one embodiment of the present disclosure.

[0184] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0185] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0186] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A rich text processing method based on artificial intelligence, comprising: The first operation is received in the rich text editor's editing interface; In response to the first operation matching a component node, a first component associated with the first operation is determined, wherein the component node is associated with multiple different types of third-party components, the component node is used to add one of the multiple different types of third-party components, the multiple different types of third-party components include the first component, the component node is associated with a component registry, the component registry includes: a mapping relationship between each of the multiple different types of third-party components and the corresponding component information; Render the first component in the editing interface according to the rendering information of the first component; The step of receiving a first operation in the editing interface of the rich text editor includes: receiving a first text input in the editing interface of the rich text editor; the step of determining a first component associated with the first operation in response to a matching of the first operation and a component node includes: determining a first component associated with the first text input in response to a matching of the text format of the first text input and the corresponding text format of the component node. The text format corresponding to the component node is a first regular expression, which includes a first field indicating a third-party component identifier. The step of determining the first component associated with the first text input in response to a match between the first text input and the text format corresponding to the component node includes: performing a regular expression match on the first text input and the first regular expression to determine the regular expression matching result of the first text input; in response to the regular expression matching result indicating a match between the first text input and the first regular expression, identifying the field value of the first field from the first text input; and determining the third-party component corresponding to the field value of the first field as the first component.

2. The method according to claim 1, wherein, The first component includes multiple component objects, and the first regular expression also includes a second field for indicating the component objects. In response to the regular expression matching result indicating that the first text input matches the first regular expression, the method further includes: Identify the field value of the second field from the first text input; Rendering the first component in the editing interface based on the rendering information of the first component includes: Based on the rendering information of the first component, the component object corresponding to the field value of the second field in the first component is rendered in the editing interface.

3. The method according to claim 1, wherein, The component information includes rendering methods used to render the third-party component. Rendering the first component in the editing interface based on the rendering information of the first component includes: The rendering method for rendering the first component is determined from the mapping relationship between the first component and the corresponding component information in the component registry. The rendering method for rendering the first component is executed, and the first component is rendered in the editing interface.

4. The method according to any one of claims 1 to 3, wherein, The rich text editor's editing interface displays a first non-text content, and the method further includes: In response to a second operation on the first non-text content, descriptive text of the first non-text content is presented at a location associated with the first non-text content in the editing interface of the rich text editor, wherein the second operation is used to generate and present the descriptive text of the non-text content.

5. The method according to claim 4, wherein, The first non-text content is displayed in the first position of the rich text editor's editing interface. The description text of the first non-text content is presented at the position associated with the first non-text content in the editing interface of the rich text editor, including: In the editing interface of the rich text editor, a text node is added at a second position adjacent to the first position; At the text node, add descriptive text for the first non-text content.

6. The method according to claim 4, wherein, The descriptive text for the first non-text content is generated in the following way: Generate a first prompt word, wherein the first prompt word includes: identification information of the first non-text content and prompt information for indicating the generation of descriptive text of the first non-text content; The first prompt word is sent to the artificial intelligence model, and the descriptive text of the first non-text content returned by the artificial intelligence model is received.

7. The method according to any one of claims 1 to 3, wherein, After rendering the first component in the editing interface, the method further includes: In response to receiving a mode switching operation, the editing interface of the rich text editor is switched to the code interface of the rich text editor; The code interface of the rich text editor displays the code corresponding to the first component.

8. The method according to claim 7, wherein, The code interface of the rich text editor displays the code corresponding to the first component, including: In response to the first operation matching the component node, the code editor is invoked to generate a code node; At the code node, the code corresponding to the first component is generated, so that the code corresponding to the first component is presented in the code interface of the rich text editor.

9. A rich text processing device based on artificial intelligence, comprising: The communication module is configured to receive the first operation in the rich text editor's editing interface; The determination module is configured to: in response to the first operation matching a component node, determine the first component associated with the first operation, wherein the component node is associated with multiple different types of third-party components, the component node is used to add one of the multiple different types of third-party components, the multiple different types of third-party components include the first component, the component node is associated with a component registry, the component registry includes: a mapping relationship between each of the multiple different types of third-party components and the corresponding component information; The rendering module is configured to render the first component in the editing interface based on the rendering information of the first component; The communication module is further configured to: receive first text input in the editing interface of the rich text editor; the step of determining the first component associated with the first operation in response to the first operation matching with the component node includes: determining the first component associated with the first text input in response to the first text input matching with the text format corresponding to the component node; The text format corresponding to the component node is a first regular expression, which includes a first field indicating a third-party component identifier. The communication module is further configured to: perform regular expression matching on the first text input and the first regular expression to determine the regular expression matching result of the first text input; in response to the regular expression matching result indicating that the first text input matches the first regular expression, identify the field value of the first field from the first text input; and determine the third-party component corresponding to the field value of the first field as the first component.

10. An electronic device, comprising: Processing device; as well as Storage device, including one or more computer program instructions; The one or more computer program instructions are executed by the processing device to perform the method according to any one of claims 1 to 8.

11. A computer-readable storage medium for non-transitory storage of computer-readable instructions, wherein, The method of any one of claims 1 to 8 is implemented when the computer-readable instructions are executed by a processor.

Citation Information

Patent Citations

  • Rich text editor processing method, system and equipment and medium

    CN117313674A

  • Auxiliary editing method and system based on rich text editor

    CN119558283A