An interaction processing method for mentioning functions and related device

By storing the business data of the mentioned object in the rich text with custom attributes and restoring the default style attributes, the problem of fragmented data storage in the mentioned text block is solved, improving data consistency and editing experience, and simplifying development and maintenance.

CN121387091BActive Publication Date: 2026-06-02GUANGZHOU QIANJUN NETWORK TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU QIANJUN NETWORK TECH CO LTD
Filing Date
2025-12-24
Publication Date
2026-06-02

Smart Images

  • Figure CN121387091B_ABST
    Figure CN121387091B_ABST
Patent Text Reader

Abstract

The application provides an interaction processing method and related device for mentioning function, and relates to the technical field of software, which comprises the following steps: obtaining an input operation and determining the operation type of the input operation; in the case that the operation type is an insertion operation, inserting a rich text at the current cursor position, the rich text comprising a mentioning text block, the business data of a mentioned object in the mentioning text block being stored in the form of a custom attribute, and the custom attribute comprising a target style attribute; outputting the mentioning text block in the target style attribute, and restoring to a preset default style attribute after the output of the mentioning text block is completed. The application utilizes the custom attribute function of the rich text, directly stores the business data as metadata on the text interval, solves the problem of fragmented data storage, and resets the input style after the mentioning text block is inserted, thereby preventing style inheritance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of software technology, and in particular to an interactive processing method and related apparatus for mentioning functions. Background Technology

[0002] The mention feature can be triggered by the user entering a certain symbol (such as @). It is a feature that can automatically associate mentions with objects (such as other users, groups or topics) and generate mention text blocks (also known as interactive tags).

[0003] Currently, the industry practice is to store the display text of the mention text block and the business data of the mentioned object (such as user nickname and address) separately, and maintain the text position of the mention text block and the business data of the mentioned object using a mapping table. However, once the mention text block is edited (such as by inserting, deleting, or adding a newline), its text position will change, and the mapping table must be updated accordingly. This can easily lead to complex development and maintenance due to the separation between the presentation layer and the data layer. Summary of the Invention

[0004] In view of the above problems, this application provides an interactive processing method and related apparatus for mention functions to solve the problem of the separation between the display layer and the data layer of the prompt function. The specific solution is as follows:

[0005] The first aspect of this application provides an interactive processing method for a mention function, the interactive processing method for the mention function comprising:

[0006] Obtain the input operation and determine the operation type of the input operation;

[0007] When the operation type is an insert operation, rich text is inserted at the current cursor position. The rich text includes a mention text block. The business data of the mentioned object in the mention text block is stored in the form of custom attributes, and the custom attributes include target style attributes.

[0008] The mentioned text block is output with the target style attribute, and the output is restored to the preset default style attribute after the mentioned text block is finished.

[0009] In one possible implementation, the interactive processing method for the mentioned function further includes:

[0010] Construct a data model corresponding to the rich text, wherein the data model includes the text content of the rich text, the mentioned object, and the custom attributes;

[0011] The data model is synchronized to the target storage object.

[0012] In one possible implementation, the interactive processing method for the mentioned function further includes:

[0013] When the operation type is a cursor movement operation, the target cursor position is determined, and the target cursor position is converted into the target text layout position under the rich text.

[0014] Obtain the text layout position range of the mentioned text block under the rich text;

[0015] If the target text layout position is within the text layout position range, the cursor will be forced to jump to the beginning or end of the mentioned text block;

[0016] If the target text layout position is not within the range of the text layout position, move the cursor to the target cursor position.

[0017] In one possible implementation, forcing the cursor to jump to the beginning or end of the mentioned text block includes:

[0018] Obtain the triggering method of the cursor movement operation;

[0019] When the triggering method is arrow key triggering, the cursor will jump to the beginning or end of the mentioned text block according to the cursor movement direction;

[0020] When the triggering method is a click operation, obtain the maximum and minimum text layout positions within the text layout position range;

[0021] If the target text layout position is closest to the maximum text layout position, jump the cursor to the end of the mentioned text block;

[0022] If the target text layout position is closest to the minimum text layout position, jump the cursor to the beginning of the mentioned text block.

[0023] In one possible implementation, the interactive processing method for the mentioned function further includes:

[0024] When the operation type is a deletion operation, the target text to be deleted in the rich text is determined;

[0025] If the target text does not belong to the mentioned text block, delete the target text.

[0026] If the target text belongs to the mentioned text block, obtain the current operation state of the mentioned text block;

[0027] If the current operation state is normal, the mentioned text block will be highlighted, and the current operation state will be changed from normal to highlighted.

[0028] If the current operation state is highlighted, delete the mentioned text block.

[0029] A second aspect of this application provides an interactive processing apparatus for a mention function, the interactive processing apparatus for the mention function comprising:

[0030] An operation acquisition module is used to acquire input operations and determine the operation type of the input operations;

[0031] The insertion module is used to insert rich text at the current cursor position when the operation type is an insertion operation. The rich text includes a mention text block, in which the business data of the mentioned object in the mention text block is stored in the form of a custom attribute, and the custom attribute includes a target style attribute. The mention text block is output with the target style attribute, and after the mention text block is output, it is restored to the preset default style attribute.

[0032] In one possible implementation, the interactive processing device for the mention function further includes:

[0033] The data synchronization module is used to construct a data model corresponding to the rich text, the data model including the text content of the rich text, the mentioned object, and the custom attributes; and to synchronize the data model to the target storage object.

[0034] A third aspect of this application provides a computer program product including computer-readable instructions that, when executed on an electronic device, cause the electronic device to perform an interactive processing method for the functions mentioned in the first aspect or any implementation thereof.

[0035] A fourth aspect of this application provides an electronic device, including at least one processor and a memory connected to the processor, wherein:

[0036] The memory is used to store computer programs;

[0037] The processor is used to execute the computer program to enable the electronic device to implement the interactive processing method of the functions mentioned in the first aspect or any implementation thereof.

[0038] The fifth aspect of this application provides a computer storage medium carrying one or more computer programs, which, when executed by an electronic device, enable the electronic device to perform an interactive processing method for the functions mentioned in the first aspect or any implementation thereof.

[0039] By employing the above technical solutions, this application provides an interactive processing method and related apparatus for a mention function, comprising: acquiring an input operation and determining the operation type of the input operation; when the operation type is an insertion operation, inserting rich text at the current cursor position, the rich text including a mention text block, wherein the business data of the mentioned object in the mention text block is stored in the form of custom attributes, and the custom attributes include a target style attribute; outputting the mention text block with the target style attribute, and restoring it to a preset default style attribute after the mention text block is output. In this application, when the input operation is an insertion operation, a mention text block is inserted at the current cursor position in the form of rich text. The business data of the mentioned object in the mention text block is attached to the corresponding text area for storage in the form of custom attributes, including a target style attribute. To avoid style pollution, the default style attribute is restored after the mention text block is output. Therefore, this application utilizes the custom attribute function of rich text to directly attach business data as metadata to the text area for storage, solving the problem of fragmented data storage, and resetting the input style after inserting the mention text block to prevent style inheritance. Attached Figure Description

[0040] 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.

[0041] Figure 1 A flowchart illustrating an interactive processing method for a mention function provided in an embodiment of this application;

[0042] Figure 2 This is a partial flowchart illustrating an interactive processing method for a mention function provided in an embodiment of this application;

[0043] Figure 3 This is another part of a flowchart illustrating an interactive processing method for a mention function provided in an embodiment of this application;

[0044] Figure 4 This is another part of the flowchart illustrating an interactive processing method for a mention function provided in an embodiment of this application;

[0045] Figure 5 A schematic diagram of the structure of an interactive processing device for mentioning functions provided in an embodiment of this application;

[0046] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0047] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.

[0048] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.

[0049] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.

[0050] The existing implementation stores the display text of the mention text block and the business data of the mentioned object separately. It requires an additional mapping table to maintain the relationship between text position and business data, resulting in complex implementation, high maintenance costs, and a high susceptibility to errors, making it difficult to guarantee data integrity and retrieval efficiency. In addition, after inserting a mention text block with a special style, subsequent input ordinary text will inherit that style, disrupting the overall visual consistency and degrading the editing experience.

[0051] To address the aforementioned problems, embodiments of this application provide an interactive processing method for a mention function. The interactive processing method for the mention function of this application embodiment will be described in detail below with reference to the accompanying drawings.

[0052] See Figure 1 , Figure 1 This is a flowchart illustrating an interactive processing method for a mention function provided in an embodiment of this application. Figure 1 As shown in the embodiment of this application, an interactive processing method for mention function may include steps S101 to S103, which are described in detail below.

[0053] S101, Obtain the input operation and determine the operation type of the input operation.

[0054] In this embodiment of the application, the user operates on the front end, and the front end can obtain the user's input operation and identify the operation type of the input operation. The operation type may include insertion operation, deletion operation and cursor movement operation.

[0055] S102, when the operation type is an insert operation, insert rich text at the current cursor position. The rich text includes a mention text block. The business data of the mentioned object in the mention text block is stored in the form of custom attributes, and the custom attributes include target style attributes.

[0056] In this application, when the operation type is an insert operation, the front end inserts the user's input text in the form of rich text at the current cursor position. The mention text block and ordinary text in the rich text are determined by recognizing the trigger symbol of the mention function (such as @). For example, if the rich text entered by the user is "Welcome @UserX back", it can be determined that the rich text contains three text intervals, namely text interval 1 "Welcome", text interval 2 "@UserX", and text interval 3 "Back", where "Welcome" and "Back" are ordinary text, and "@UserX" is the mention text block.

[0057] Furthermore, in this embodiment, for the mention text block in the rich text, the front end utilizes the custom attribute function of the rich text to directly attach and store the business data of the mentioned object as metadata to the text range. Continuing with the example of the rich text "Welcome @UserX back," the business data of the mentioned object "UserX" in the mention text block "@UserX" is stored as a custom attribute and attached to text range 2, without the need to maintain additional mapping tables.

[0058] Furthermore, when the business data of the mentioned object is stored as a custom attribute, its specified target style attribute can be maintained in the custom attribute. The front end can then output the mention text block using this target style attribute. Continuing with the rich text "Welcome @UserX back" as an example, the custom attribute attached to text segment 2 includes the target style attribute (such as font, color, font size, etc.) of the mentioned object "UserX". When the front end outputs the mention text block "@UserX", it can render and output it using this target style attribute.

[0059] S103, output the mention text block with the target style attributes, and restore the default style attributes after the mention text block output is finished.

[0060] In this embodiment, the front-end inputs a mention text block with a target style attribute. To prevent subsequent input of ordinary text from inheriting this style and affecting overall visual consistency, the default style attribute is restored after the mention text block is output. Continuing with the example of the rich text "Welcome @UserX back", the text is output with the default style attribute as the ordinary text "Welcome", then with the target style attribute as the mention text block "@UserX", and finally with the default style attribute as the ordinary text "Back".

[0061] In one possible implementation, to achieve data persistence and synchronization, embodiments of this application can also create a unified data model for synchronous updates. In this regard, an interactive processing method for a mentioned function provided by embodiments of this application may further include the following steps:

[0062] Construct a data model corresponding to the rich text, which includes the text content, references, and custom attributes of the rich text; synchronize the data model to the target storage object.

[0063] In this embodiment, after obtaining the rich text input by the user, a corresponding data model can be constructed. This data model includes the text content of the rich text, the reference object, and its custom attributes. Continuing with the example of the rich text "Welcome @UserX back," the data model includes the text "Welcome @UserX back," the reference object "UserX," and the custom attributes of the reference object "UserX" (i.e., business data, including target style attributes). After performing data validation and integrity checks on the data model, it is output in JSON format to the target storage object, such as a database or in-memory model.

[0064] Currently, when users edit input text, it's unavoidable that they insert the cursor inside a reference text block, causing the reference text block to be modified or destroyed, thus disrupting the consistency between the reference text block and business data. To address this, in this embodiment, when a user attempts to insert the cursor inside a reference text block, the front end automatically positions the cursor before or after the reference text block to prevent the user from directly editing or destroying it. See also... Figure 2 , Figure 2 This is a partial flowchart illustrating an interactive processing method for a mention function provided in an embodiment of this application. Figure 2 As shown in the embodiment of this application, the interactive processing method for mention function may further include steps S201 to S204, which will be described in detail below.

[0065] S201, when the operation type is cursor movement operation, determine the target cursor position and convert the target cursor position into the target text layout position under rich text.

[0066] In this embodiment, when the operation type is a cursor movement operation, the front end uses the screen coordinates of the cursor's expected location as the target cursor position. It then converts the target cursor position into a text layout position within the rich text editor (i.e., the target text layout position). This target text layout position can be the index of the text character at the cursor's expected location. Specifically, the screen coordinates of the first text character in the rich text editor can be used as a reference position. By comparing this reference position with the target cursor position, the target text layout position of the cursor is determined. For example, if the cursor's expected location is between the third and fourth text characters in the rich text editor, then the target text layout position is the index of the third text character in the rich text editor.

[0067] S202, Get the text layout position range of the mentioned text block under the rich text.

[0068] In this embodiment, the front end can determine the text layout position range corresponding to the mentioned text block based on the number of text characters it occupies in the rich text. This text layout position range includes the index of the text character at the beginning of the mentioned text block and the text length of the mentioned text block. Continuing with the example of the rich text "Welcome @UserX back", the text layout position range of the mentioned text block "@UserX" includes the index of "@" and the text length "9".

[0069] In addition, the front end can determine whether the target text layout position is within the text layout position range by comparing the target text layout position at the cursor's expected location with the text layout position range of the mentioned text block.

[0070] S203, If the target text layout position is within the text layout position range, force the cursor to jump to the beginning or end of the mentioned text block.

[0071] In this embodiment of the application, if the target text layout position is within the text layout position range, it can be determined that the cursor is about to be inserted into the mentioned text block. At this time, the front end can force the cursor to jump to the beginning or end of the mentioned text block to achieve cursor avoidance.

[0072] S204, If the target text layout position is not within the text layout position range, move the cursor to the target cursor position.

[0073] In this embodiment of the application, if the target text layout position is not within the text layout position range, it can be determined that the cursor will not be inserted into the mentioned text block. At this time, the front end moves the cursor to the target cursor position.

[0074] In one possible implementation, when the front-end performs cursor avoidance, it can dynamically choose to jump the cursor to the beginning or end of the mentioned text block based on how the user triggers the cursor movement. See also Figure 3 , Figure 3 This is another schematic flowchart illustrating an interactive processing method for a mention function provided in an embodiment of this application. For example... Figure 3 As shown in the embodiment of this application, an interactive processing method for a mention function is provided. In step S203, "forcibly jumping the cursor to the beginning or end of the mention text block" may include steps S301 to S305. These steps are described in detail below.

[0075] S301, Get the trigger method for cursor movement operation.

[0076] In this embodiment, there are multiple ways for a user to trigger cursor movement in rich text, such as clicking or using arrow keys. The front-end can then determine the triggering method of the cursor movement operation based on the user's actions.

[0077] S302, when triggered by the arrow keys, jump the cursor to the beginning or end of the mentioned text block according to the cursor movement direction.

[0078] In this embodiment, when the cursor movement operation is triggered by the arrow keys, the front end can jump the cursor to the beginning or end of the mentioned text block according to the cursor movement direction indicated by the arrow key that triggered the cursor movement operation. For example, if the user triggers the cursor movement operation using the left or up arrow key, the front end will jump the cursor to the beginning of the mentioned text block; if the user triggers the cursor movement operation using the right or down arrow key, the front end will jump the cursor to the end of the mentioned text block.

[0079] S303, when the triggering method is a click operation, obtain the maximum and minimum text layout positions within the text layout position range.

[0080] In this embodiment of the application, when the cursor movement operation is triggered by a click operation, the front end can determine the maximum and minimum layout positions of the mentioned text block in the rich text based on the text layout range. The maximum layout position is the index of the text character at the end of the mentioned text block, and the minimum text layout position is the index of the text character at the beginning of the mentioned text block.

[0081] S304, If the target text layout position is closest to the largest text layout position, jump the cursor to the end of the mentioned text block.

[0082] In this embodiment of the application, if the target text layout position is closest to the maximum text layout position, the front end will move the cursor to the end of the mentioned text block.

[0083] S305, If the target text layout position is closest to the smallest text layout position, jump the cursor to the beginning of the mentioned text block.

[0084] In this application, if the target text layout position is closest to the minimum text layout position, the front end will jump the cursor to the beginning of the mentioned text block.

[0085] Of course, if the target text layout position is equally close to the minimum and maximum text layout positions, the front end can randomly jump to the beginning or end of the mentioned text block.

[0086] Traditional deletion operations lack specific logic for mentioned text blocks, requiring users to press multiple keys or manually select a precise range to delete, resulting in a high rate of accidental operations and a poor user experience. To address this, this application provides a deletion interaction method for mentioned text blocks: the entire mentioned text block is highlighted on the first deletion attempt, and the entire mentioned text block is deleted on subsequent deletion attempts. See also... Figure 4 , Figure 4 This is another schematic flowchart illustrating an interactive processing method for a mention function provided in an embodiment of this application. For example... Figure 4 As shown in the embodiment of this application, the interactive processing method for mention function may further include steps S401 to S405, which will be described in detail below.

[0087] S401, when the operation type is deletion operation, determine the target text to be deleted in the rich text.

[0088] In this embodiment of the application, when the operation type is a deletion operation, the front end determines the target text to be deleted by the user in the rich text to determine whether the target text belongs to the mentioned text block.

[0089] S402, If the target text does not belong to the mentioned text block, delete the target text.

[0090] In this embodiment of the application, if the target text block does not belong to the mentioned text block, the target text can be determined to be ordinary text, and the front end deletes the target text.

[0091] S403, If the target text belongs to the mentioned text block, obtain the current operation status of the mentioned text block.

[0092] In this embodiment, if the target text belongs to a mentioned text block, the front end obtains the current operation state of the mentioned text block; if the current operation state is normal, it indicates that the mentioned text block has been deleted for the first time; if the current operation state is highlighted, it indicates that the mentioned text block has been deleted for the second time. In practical applications, the update of the current operation state can be implemented by a state machine.

[0093] S404, if the current operation state is normal, the mentioned text block will be highlighted, and the current operation state will be changed from normal to highlighted.

[0094] In this embodiment of the application, if the current operation state is normal, the front end will highlight the mentioned text block to adjust the current operation state from normal to highlighted.

[0095] S405, if the current operation state is highlighted, delete the mentioned text block.

[0096] In this embodiment, if the current operation state is highlighted, the front-end deletes the mentioned text block. Of course, the front-end also needs to synchronously update the rich text data model, updating the rich text content in the data model, deleting the mentioned object and its custom attributes, and synchronously updating the target storage object.

[0097] Based on the above description, the interactive processing method for a mention function provided in this application embodiment utilizes the custom attribute function of rich text to directly attach business data as metadata to the text area for storage, solving the problem of fragmented data storage. Furthermore, it resets the input style after inserting the mention text block to prevent style inheritance. Additionally, it forces the cursor to jump to a safe position (beginning or end) of the mention text block through cursor avoidance. Moreover, the text mention block uses a two-stage deletion logic: initial highlighting followed by secondary deletion.

[0098] The above describes an interactive processing method for a mention function provided by an embodiment of this application. The following describes an apparatus for performing the above interactive processing method for a mention function.

[0099] See Figure 5 , Figure 5 This is a schematic diagram of the structure of an interactive processing device for mentioning functions provided in an embodiment of this application. Figure 5 As shown in the embodiment of this application, an interactive processing device for a mention function includes:

[0100] The operation acquisition module 501 is used to acquire input operations and determine the operation type of the input operations;

[0101] The insertion module 502 is used to insert rich text at the current cursor position when the operation type is an insertion operation. The rich text includes a mention text block. The business data of the mentioned object in the mention text block is stored in the form of custom attributes, and the custom attributes include target style attributes. The mention text block is output with target style attributes, and after the mention text block is output, it is restored to the preset default style attributes.

[0102] In one possible implementation, the interactive processing device for the aforementioned functions further includes:

[0103] The data synchronization module is used to build a data model corresponding to the rich text, which includes the text content, references, and custom attributes of the rich text; and to synchronize the data model to the target storage object.

[0104] In one possible implementation, the interactive processing device for the aforementioned functions further includes:

[0105] The cursor avoidance module is used to determine the target cursor position and convert it into the target text layout position under the rich text when the operation type is cursor movement operation; obtain the text layout position range of the mentioned text block under the rich text; if the target text layout position is within the text layout position range, force the cursor to jump to the beginning or end of the mentioned text block; if the target text layout position is not within the text layout position range, move the cursor to the target cursor position.

[0106] In one possible implementation, the cursor avoidance module, used to force the cursor to jump to the beginning or end of the mentioned text block, is specifically used for:

[0107] Get the trigger method for cursor movement; if the trigger method is arrow key, jump the cursor to the beginning or end of the mentioned text block according to the cursor movement direction; if the trigger method is click operation, get the maximum and minimum text layout positions within the text layout position range; if the target text layout position is closest to the maximum text layout position, jump the cursor to the end of the mentioned text block; if the target text layout position is closest to the minimum text layout position, jump the cursor to the beginning of the mentioned text block.

[0108] In one possible implementation, the interactive processing device for the aforementioned functions further includes:

[0109] The deletion module is used to determine the target text to be deleted in the rich text when the operation type is deletion; if the target text does not belong to the mentioned text block, delete the target text; if the target text belongs to the mentioned text block, obtain the current operation status of the mentioned text block; if the current operation status is normal, highlight the mentioned text block and adjust the current operation status from normal to highlighted; if the current operation status is highlighted, delete the mentioned text block.

[0110] It should be noted that the detailed functions of each module in the embodiments of this application can be found in the corresponding disclosure of the interactive processing method embodiments of the functions mentioned above, and will not be repeated here.

[0111] This application also provides an electronic device in its embodiments. See also... Figure 6 , Figure 6This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device in this embodiment may include, but is not limited to, fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 6 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0112] like Figure 6 As shown, the electronic device may include a processing unit 601, which may be a central processing unit, a graphics processing unit, etc., and can perform various appropriate actions and processes according to a program stored in the read-only memory 602 or a program loaded from the storage device 608 into the random access memory 603. When the electronic device is powered on, the random access memory 603 also stores various programs and data required for the operation of the electronic device. The processing unit 601, the read-only memory 602, and the random access memory 603 are interconnected via a bus 604. An I / O interface 605 is also connected to the bus 604.

[0113] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, memory cards, hard drives, etc.; and communication devices 609. Communication device 609 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have instead.

[0114] This application also provides an interactive processing method that includes a computer program product, including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the mentioned functions provided in this application.

[0115] This application also provides a computer-readable storage medium that carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement the interactive processing method of any of the mentioned functions provided in this application.

[0116] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0117] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0118] In the above embodiments, the implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, in the form of a computer program product.

[0119] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. 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, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

Claims

1. An interactive processing method for mentioning a function, characterized in that, The interactive processing method for the mentioned function includes: Obtain the input operation and determine the operation type of the input operation; When the operation type is an insert operation, rich text is inserted at the current cursor position. The rich text includes a mention text block. The business data of the mentioned object in the mention text block is stored in the form of custom attributes. The custom attributes include target style attributes. The custom attributes are attached to the text range corresponding to the mention text block. The mentioned text block is output with the target style attribute, and the output is restored to the preset default style attribute after the mentioned text block is finished; When the operation type is a cursor movement operation, the target cursor position is determined, and the target cursor position is converted into the target text layout position under the rich text. Obtain the text layout position range of the mentioned text block under the rich text; If the target text layout position is within the text layout position range, the cursor will be forced to jump to the beginning or end of the mentioned text block; if the target text layout position is not within the text layout position range, the cursor will be moved to the target cursor position. Construct a data model corresponding to the rich text, the data model including the text content of the rich text, the mentioned object, and the custom attribute; synchronize the data model to the target storage object; When the operation type is a deletion operation, the target text to be deleted in the rich text is determined; If the target text does not belong to the mentioned text block, delete the target text. If the target text belongs to the mentioned text block, obtain the current operation state of the mentioned text block; If the current operation state is normal, the mentioned text block will be highlighted, and the current operation state will be changed from normal to highlighted. If the current operation state is highlighted, delete the mentioned text block and synchronously update the rich text data model. Update the text content of the rich text in the data model, delete the mentioned object and its custom attributes, and synchronously update the target storage object.

2. The interactive processing method for the mention function according to claim 1, characterized in that, The step of forcing the cursor to jump to the beginning or end of the mentioned text block includes: Obtain the triggering method of the cursor movement operation; When the triggering method is arrow key triggering, the cursor will jump to the beginning or end of the mentioned text block according to the cursor movement direction; When the triggering method is a click operation, obtain the maximum and minimum text layout positions within the text layout position range; If the target text layout position is closest to the maximum text layout position, jump the cursor to the end of the mentioned text block; If the target text layout position is closest to the minimum text layout position, jump the cursor to the beginning of the mentioned text block.

3. An interactive processing device for mentioning functions, characterized in that, The interactive processing device for the mentioned function includes: An operation acquisition module is used to acquire input operations and determine the operation type of the input operations; The insertion module is used to insert rich text at the current cursor position when the operation type is an insertion operation. The rich text includes a mention text block. The business data of the mentioned object in the mention text block is stored in the form of custom attributes, and the custom attributes include a target style attribute. The custom attributes are attached to the text range corresponding to the mention text block. The mention text block is output with the target style attribute, and after the mention text block is output, it is restored to the preset default style attribute. The cursor avoidance module is used to determine the target cursor position and convert it into the target text layout position under the rich text when the operation type is cursor movement operation; obtain the text layout position range of the mentioned text block under the rich text; if the target text layout position is within the text layout position range, force the cursor to jump to the beginning or end of the mentioned text block; if the target text layout position is not within the text layout position range, move the cursor to the target cursor position. The data synchronization module is used to construct a data model corresponding to the rich text, wherein the data model includes the text content of the rich text, the mentioned object, and the custom attributes; and to synchronize the data model to the target storage object. The deletion module is used to determine the target text to be deleted in the rich text when the operation type is deletion; if the target text does not belong to the mentioned text block, delete the target text; if the target text belongs to the mentioned text block, obtain the current operation status of the mentioned text block; if the current operation status is normal, highlight the mentioned text block and adjust the current operation status from normal to highlighted; if the current operation status is highlighted, delete the mentioned text block and synchronously update the data model of the rich text, update the text content of the rich text in the data model, delete the mentioned object and its custom attributes, and synchronously update the target storage object.

4. A computer program product, characterized in that, Includes computer-readable instructions that, when executed on an electronic device, cause the electronic device to perform an interactive processing method for the mentioned function as described in any one of claims 1 to 2.

5. An electronic device, characterized in that, It includes at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program to enable the electronic device to implement the interactive processing method of the mentioned function as described in any one of claims 1 to 2.

6. A computer storage medium, characterized in that, The storage medium carries one or more computer programs that, when executed by an electronic device, enable the electronic device to implement the interactive processing method of the mentioned functions as described in any one of claims 1 to 2.