Editing information change tracking method and system based on rich text editor

By capturing input events in a rich text editor, creating change IDs and objects, and inserting them into nodes, real-time tracking and recording of document editing changes is achieved, and the problem of insufficient document change tracking mechanism in the existing technology is solved, and the transparency and traceability of documents are enhanced.

CN119903819APending Publication Date: 2025-04-29FOUNDER INT(WUHAN)TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411957113.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-29
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

Existing rich text editors lack effective change tracking mechanisms when editing documents, resulting in confusion in document structure and difficulty for users to track modification history and modification sources, especially when handling text insertion and deletion operations, they cannot accurately reflect the user's intentions.

Method used

By capturing the input events of the user operating the rich text editor, creating a change ID and determining the change type, determining the character processing rules based on the change type, data processing of the input events to obtain change information, creating a change object and associated with the change ID, and inserting the change information into the node to realize editing information change tracking.

Benefits of technology

Real-time recording and displaying changes in text editing are realized, which enhances the transparency and traceability of documents, and solves the problem that users have difficulty tracking the document modification history.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119903819A_ABST
    Figure CN119903819A_ABST
Patent Text Reader

Abstract

The invention discloses an editing information change tracking method and system based on a rich text editor, and the method comprises the steps: capturing an input event that a user operates the rich text editor, creating a change ID according to the input event, and determining a change type corresponding to the input event; determining a character processing rule corresponding to the input event according to the change type; performing data processing on the input event based on the character processing rule to obtain change information, creating a change object based on the change information, and establishing association between the change ID and the change object; and inserting the change information into the node, and realizing editing information change tracking through the node. According to the method and the device, the change ID is associated with the change object, and then the change information is inserted into the node, so that the change in text editing is recorded and displayed in real time, and the transparency and the traceability of the document are enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer software technology, and in particular relates to a method and system for tracking edit information changes based on a rich text editor. Background Art

[0002] Existing rich text editors often lack an effective change tracking mechanism when editing documents. The processing logic for adjacent change nodes is complex, which not only easily leads to a chaotic document structure, but also makes it difficult for users to track the modification history and modification source of the document. In addition, when processing text insertion and deletion operations, existing systems often cannot accurately reflect the user's intentions when processing complex formats. Therefore, how to effectively track change information has become a technical problem that needs to be solved urgently.

[0003] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention

[0004] The main purpose of the present invention is to provide a method and system for tracking edit information changes based on a rich text editor, aiming to solve the technical problem of how to effectively track change information.

[0005] To achieve the above object, the present invention provides a method for tracking edit information changes based on a rich text editor, the method for tracking edit information changes based on a rich text editor comprising:

[0006] Capturing an input event of a user operating a rich text editor, creating a change ID according to the input event, and determining a change type corresponding to the input event;

[0007] Determining a character processing rule corresponding to the input event according to the change type;

[0008] Performing data processing on the input event based on the character processing rule to obtain change information, creating a change object based on the change information, and associating the change ID with the change object;

[0009] The change information is inserted into a node, and editing information change tracking is implemented through the node.

[0010] Optionally, the step of determining the change type corresponding to the input event includes:

[0011] Identify a function key according to the input event;

[0012] The change type is determined according to the function key, and the change type includes a delete key, a line feed key, and an insert key.

[0013] Optionally, the step of determining a character processing rule corresponding to the input event according to the change type includes:

[0014] Identify character keys according to the input event, and determine character operation modes according to the function keys and the character keys, wherein the character operation modes include regular node operation modes and special node operation modes, and the special node operation modes include comment node operation modes, phonetic node operation modes, delete node operation modes, and foreign word node operation modes;

[0015] A character processing rule corresponding to the character operation mode is determined based on the change type.

[0016] Optionally, after the step of inserting the change information into the node, the method further includes:

[0017] The style of the changed label is set according to the change type to distinguish different change types.

[0018] Optionally, after the step of setting the style of the changed label according to the change type, the step further includes:

[0019] After detecting that the change is complete, updating the document structure according to the change information, and identifying the current cursor position;

[0020] After detecting that the document structure is updated, the current cursor position is reset.

[0021] Optionally, the step of resetting the current cursor position includes:

[0022] Determine a cursor event corresponding to the current cursor position, wherein the cursor event includes a mousedown event, a mouseup event, a keyup event, a keydown event, a keypress event, a document change event, a window change event, and a selection change event;

[0023] Determine a cursor processing rule according to the cursor event;

[0024] The current cursor position is reset according to the cursor processing rule.

[0025] In addition, to achieve the above-mentioned purpose, the present invention also proposes an editing information change tracking system based on a rich text editor, and the editing information change tracking system based on a rich text editor comprises:

[0026] A creation module is used to capture input events of a user operating a rich text editor, create a change ID according to the input event, and determine a change type corresponding to the input event;

[0027] A determination module, used to determine a character processing rule corresponding to the input event according to the change type;

[0028] A processing module, configured to perform data processing on the input event based on the character processing rule to obtain change information, and to create a change object based on the change information, wherein the change ID is associated with the change object;

[0029] The tracking module is used to insert the change information into the node and implement editing information change tracking through the node.

[0030] In addition, to achieve the above-mentioned purpose, the present invention also proposes an editing information change tracking device based on a rich text editor, the device comprising: a memory, a processor, and an editing information change tracking program based on a rich text editor stored on the memory and executable on the processor, the editing information change tracking program based on the rich text editor being configured to implement the steps of the editing information change tracking method based on a rich text editor as described above.

[0031] In addition, to achieve the above-mentioned purpose, the present invention also proposes a storage medium, on which is stored an editing information change tracking program based on a rich text editor. When the editing information change tracking program based on a rich text editor is executed by a processor, the steps of the editing information change tracking method based on a rich text editor as described above are implemented.

[0032] The present invention first captures the input event of the user operating the rich text editor, creates a change ID according to the input event, and determines the change type corresponding to the input event, then determines the character processing rule corresponding to the input event according to the change type, and then performs data processing on the input event based on the character processing rule to obtain change information, and creates a change object based on the change information, and associates the change ID with the change object, and finally inserts the change information into the node, and implements editing information change tracking through the node. The present invention associates the change ID with the change object, and then inserts the change information into the node to achieve real-time recording and display of changes in text editing, thereby enhancing the transparency and traceability of the document. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 It is a structural diagram of an editing information change tracking device based on a rich text editor in a hardware operating environment involved in an embodiment of the present invention;

[0034] Figure 2 It is a flowchart of a first embodiment of a method for tracking edit information changes based on a rich text editor of the present invention;

[0035] Figure 3This is a structural block diagram of the first embodiment of the editing information change tracking system based on the rich text editor of the present invention.

[0036] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0037] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0038] Reference Figure 1 , Figure 1 The present invention is a schematic diagram of the structure of an editing information change tracking device based on a rich text editor in the hardware operating environment involved in the embodiment of the present invention.

[0039] like Figure 1 As shown, the editing information change tracking device based on the rich text editor may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM), or a stable non-volatile memory (Non-VolatileMemory, NVM), such as a disk storage. The memory 1005 may also be a storage system independent of the aforementioned processor 1001.

[0040] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the editing information change tracking device based on the rich text editor, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.

[0041] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and an editing information change tracking program based on a rich text editor.

[0042] exist Figure 1In the editing information change tracking device based on a rich text editor shown, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the editing information change tracking device based on a rich text editor of the present invention can be set in the editing information change tracking device based on a rich text editor, and the editing information change tracking device based on a rich text editor calls the editing information change tracking program based on a rich text editor stored in the memory 1005 through the processor 1001, and executes the editing information change tracking method based on a rich text editor provided in an embodiment of the present invention.

[0043] The embodiment of the present invention provides a method for tracking edit information changes based on a rich text editor. Figure 2 , Figure 2 It is a flowchart diagram of the first embodiment of the editing information change tracking method based on a rich text editor of the present invention.

[0044] In this embodiment, the editing information change tracking method based on the rich text editor includes the following steps:

[0045] Step S10: Capturing an input event of a user operating a rich text editor, creating a change ID according to the input event, and determining a change type corresponding to the input event.

[0046] It is easy to understand that the execution subject of this embodiment can be an editing information change tracking system based on a rich text editor with functions such as data processing, network communication and program running, or it can be other computer devices with similar functions, etc. This embodiment is not limited.

[0047] In this embodiment, the input event may be an event input by the user via the keyboard (ie, monitoring keyboard pressing, lifting, and inputting characters), or an event input via a non-keyboard method.

[0048] It should also be noted that a change ID corresponding to the input event is generated through a preset ID generation strategy according to the operation type (ie, deletion, insertion or line break), operation element, operation attribute and value.

[0049] It should also be understood that the change type of the input event may be a deletion type, an insertion type, a line break type, or the like.

[0050] Furthermore, a function key may be identified according to an input event, and the function key may be a function key corresponding to a specific change type for presetting, and then the corresponding change type may be determined after the user operates the function key.

[0051] Step S20: determining a character processing rule corresponding to the input event according to the change type.

[0052] Furthermore, character keys are identified according to input events, and character operation modes are determined according to function keys and character keys. Character operation modes include regular node operation modes and special node operation modes. Special node operation modes include comment node operation modes, phonetic node operation modes, deletion node operation modes and foreign word node operation modes. Character processing rules corresponding to the character operation modes are determined based on the change type.

[0053] The normal node operation mode and special node operation mode corresponding to the delete operation, the normal node operation mode corresponding to the line break operation, and the normal node operation mode and special node operation mode corresponding to the insert operation can be determined respectively according to the function keys and character keys.

[0054] In the specific implementation, the character processing rules corresponding to the regular node operation mode of deletion: the deletion operation includes the regular focus backspace deletion, and also performs range deletion according to the mouse selection. Special nodes (i.e. the special node operation mode corresponding to the deletion operation) may be encountered during the deletion operation, which need to be processed to protect the special elements in them.

[0055] Character processing rules for comment nodes: When users operate comment elements in the system, side effects are handled by removing the style of the comment node and removing the corresponding comment synchronously outside the editor. Character processing rules for Zhuyin nodes: Nodes similar to Chinese pinyin in Japanese are used in the editor <ruby>Tag wrapping, side effect processing: skip the phonetic node, and destroy the phonetic node after the phonetic text node is deleted. Character processing rules corresponding to the deleted node: the user can view the past deleted content nodes in the change history, side effect processing: skip the phonetic node, and destroy the phonetic node after the phonetic text node is deleted. Character processing rules corresponding to foreign characters: special characters inserted by the user in the editor, characters that require specific support and additional character sets to display, side effect processing: calculate the selection length according to the foreign character encoding method, and delete the foreign characters in the selection.

[0056] It should also be noted that when processing these special nodes, the side effects after deletion will be eliminated based on the identified deletion results.

[0057] Furthermore, the character processing rules corresponding to the line break general node operation mode are as follows: the line break operation will split the paragraph, and the selection will move to the next line, wherein the format of the new paragraph will inherit the previous selection.

[0058] Furthermore, the insert operation is divided into two types, one is the regular input by the user through typing, and the other is the special input through the specific tools provided by the editor.

[0059] Conventional input: Display input content in real time and maintain cursor position. Input method key combinations may cause undo and undo functions to fail, so special processing is required for input method key combinations.

[0060] Special input: Special input uses the tools provided by the editor combined with the user's regular input to insert a specific node. The insertion mode rules for special nodes are as follows:

[0061] Comment node: After the mouse selection is confirmed, click the comment tool and the text in the selection will change to the comment node.

[0062] Zhuyin node: After the mouse selection is confirmed, click the Zhuyin tool, complete the form in the pop-up window, and the text in the selection will change the Zhuyin node.

[0063] Foreign word dots: Click the Foreign Word Tool, complete the form in the pop-up window, and add foreign word dots and characters after the cursor.

[0064] Step S30: performing data processing on the input event based on the character processing rule to obtain change information, and creating a change object based on the change information, and associating the change ID with the change object.

[0065] Change information includes user information, basic information and metadata information. User information includes information recording the person who performed the change operation. User identification includes ID, authority, and role. The operation context includes the operation environment, operation time, and operation source. Basic information includes change type, change content, and change location. Metadata information includes operation time, operation user, and change reason.

[0066] It should also be understood that the change object includes basic information and metadata information.

[0067] Step S40: inserting the change information into a node, and implementing editing information change tracking through the node.

[0068] In the specific implementation, the change information is inserted into the node for easy retrieval and tracking.

[0069] Furthermore, the change type is determined according to the change information; and the style of the changed label is set according to the change type to distinguish different change types.

[0070] After detecting that the change is complete, the document structure is updated according to the change information, and the current cursor position is identified; after detecting that the document structure is updated, the current cursor position is reset.

[0071] The processing method for resetting the current cursor position is: determine the cursor event corresponding to the current cursor position, the cursor events include mousedown event, mouseup event, keyup event, keydown event, keypress event, document change event, window change event and selection change event; determine the cursor processing rule according to the cursor event; reset the current cursor position according to the cursor processing rule.

[0072] In the specific implementation, after the change is confirmed, the cursor position needs to be repositioned. For the confirmed changes, the cursor is located at the end of the reserved content. For the rejected changes, the cursor returns to the position before the change.

[0073] Update document structure: After executing the change confirmation, the new content is added to the document, the document structure is updated with the saved information, and then the cursor position is reset;

[0074] Reset cursor position: handle mousedown and mouseup events, handle keyboard keyup, keydown and keypress events, monitor document, window and selection changes, and handle three special cases as follows:

[0075] Empty content handling: detect if the node contains only empty characters, insert zero-width space (​;) as a placeholder, and use empty text to maintain the structure;

[0076] Cross-node selection processing: The key steps are divided into three steps: selection analysis, node segmentation, and cursor reconstruction, among which:

[0077] Selection analysis: determine the starting and ending positions of the selection and obtain all nodes within the selection range;

[0078] Node splitting: split the start node and the end node, and process all the complete nodes in the middle; Cursor reconstruction: restore and rebuild the cursor position by using the saved change information;

[0079] Cursor position processing when merging adjacent changed nodes: This step requires complex cursor position maintenance, and the main steps are as follows: 1. Check adjacent inserted nodes and merge the continuous inserted content of the same user; 2. After saving the original cursor content, perform the cursor merge operation. During the merge process, it is necessary to detect the adjacent node type to verify whether it can be merged. If it can be merged, calculate the cursor offset, update the cursor position and apply it to the selection; 3. Restore the cursor position and clear the redundant marks. Through these mechanisms, it can be ensured that the cursor position can be correctly maintained in various complex situations.

[0080] In this embodiment, the input event of the user operating the rich text editor is first captured, a change ID is created according to the input event, and the change type corresponding to the input event is determined, and then the character processing rule corresponding to the input event is determined according to the change type, and then the input event is processed based on the character processing rule to obtain change information, and a change object is created based on the change information, and the change ID is associated with the change object, and finally the change information is inserted into the node, and the editing information change tracking is realized through the node. This embodiment associates the change ID with the change object, and then inserts the change information into the node to realize real-time recording and display of changes in text editing, thereby enhancing the transparency and traceability of the document.

[0081] Reference Figure 3 , Figure 3 This is a structural block diagram of the first embodiment of the editing information change tracking system based on the rich text editor of the present invention.

[0082] like Figure 3 As shown, the editing information change tracking system based on the rich text editor proposed in the embodiment of the present invention includes:

[0083] A creation module 3001 is used to capture an input event of a user operating a rich text editor, create a change ID according to the input event, and determine a change type corresponding to the input event;

[0084] A determination module 3002, configured to determine a character processing rule corresponding to the input event according to the change type;

[0085] The processing module 3003 is used to perform data processing on the input event based on the character processing rule to obtain change information, and create a change object based on the change information, and associate the change ID with the change object;

[0086] The tracking module 3004 is used to insert the change information into the node and implement editing information change tracking through the node.

[0087] Other embodiments or specific implementations of the editing information change tracking system based on the rich text editor of the present invention can refer to the above-mentioned method embodiments, which will not be repeated here.

[0088] It should be noted that, in this article, the term "includes", "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0089] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0090] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0091] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.< / ruby>

Claims

1. A method for tracking edit information changes based on a rich text editor, characterized in that: The editing information change tracking method based on the rich text editor comprises the following steps: Capturing an input event of a user operating a rich text editor, creating a change ID according to the input event, and determining a change type corresponding to the input event; Determining a character processing rule corresponding to the input event according to the change type; Performing data processing on the input event based on the character processing rule to obtain change information, creating a change object based on the change information, and associating the change ID with the change object; The change information is inserted into a node, and editing information change tracking is implemented through the node.

2. The method according to claim 1, characterized in that The step of determining the change type corresponding to the input event includes: Identify a function key according to the input event; The change type is determined according to the function key, and the change type includes a delete key, a line feed key, and an insert key.

3. The method according to claim 2, characterized in that The step of determining the character processing rule corresponding to the input event according to the change type includes: Identify character keys according to the input event, and determine character operation modes according to the function keys and the character keys, wherein the character operation modes include regular node operation modes and special node operation modes, and the special node operation modes include comment node operation modes, phonetic node operation modes, delete node operation modes, and foreign word node operation modes; A character processing rule corresponding to the character operation mode is determined based on the change type.

4. The method according to claim 3, characterized in that After the step of inserting the change information into the node, the method further includes: The style of the changed label is set according to the change type to distinguish different change types.

5. The method according to claim 4, characterized in that After the step of setting the style of the changed label according to the change type, the method further includes: After detecting that the change is complete, updating the document structure according to the change information, and identifying the current cursor position; After detecting that the document structure is updated, the current cursor position is reset.

6. The method according to claim 5, characterized in that The step of resetting the current cursor position includes: Determine a cursor event corresponding to the current cursor position, wherein the cursor event includes a mousedown event, a mouseup event, a keyup event, a keydown event, a keypress event, a document change event, a window change event, and a selection change event; Determine a cursor processing rule according to the cursor event; The current cursor position is reset according to the cursor processing rule.

7. An editing information change tracking system based on a rich text editor, characterized in that: The editing information change tracking system based on the rich text editor includes: A creation module is used to capture input events of a user operating a rich text editor, create a change ID according to the input event, and determine a change type corresponding to the input event; A determination module, used to determine a character processing rule corresponding to the input event according to the change type; A processing module, configured to perform data processing on the input event based on the character processing rule to obtain change information, and to create a change object based on the change information, wherein the change ID is associated with the change object; The tracking module is used to insert the change information into the node and implement editing information change tracking through the node.