A text processing method and related device

By setting the editable area in the text editor and adjusting the editing status according to the input focus position, the problems of misoperation and inefficiency in text writing are solved, and the text content is carefully protected and efficiently edited.

CN114626344BActive Publication Date: 2025-05-27TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011359515.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-27
Publication Date
2025-05-27
Estimated Expiration
2040-11-27

AI Technical Summary

Technical Problem

When writing text through the editor, it is easy to cause misoperation, resulting in incorrect modification of the correct content or editing parts that should not be edited, affecting the efficiency of text writing and reducing file security.

Method used

By setting an editable area in the text content of the target file and monitoring the focus position of the input focus, adjust the editor's status to an editable or non-editable state, ensuring that editing is only done in the areas the user wants to edit.

Benefits of technology

It realizes protection of text content outside the editable area, reduces the time required to troubleshoot files, avoids misoperation, and improves text writing efficiency and file security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114626344B_ABST
    Figure CN114626344B_ABST
Patent Text Reader

Abstract

An embodiment of the present application discloses a text processing method, which includes: opening the text content corresponding to the target file through an editor; determining an editable area in the text content according to the editing tags corresponding to the target file, where the editable area is a part of the text area in the text content; identifying the focus position of the input focus in the text content; if it is determined that the focus position is in the editable area, adjusting the state of the editor to an editable state; if it is determined that the focus position is not in the editable area, adjusting the state of the editor to a non-editable state. The present application can set an editable area in the text content of the target file, and only adjust the state of the editor to an editable state when the user wants to edit the text content in the editable area, thereby realizing the protection of the text content outside the editable area, and at the same time eliminating the need to check the text content outside the editable area in other processes, improving the file security and text processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of text processing, and in particular, to a text processing method and related devices. Background Art

[0002] Editors, such as code editors, are often used for writing text. Through an editor, functions such as input, generation, and editing of text, such as code, can be achieved.

[0003] When writing text through an editor, all completed text is editable, which may lead to incorrect operations or editing of parts that should not be edited, such as incorrectly modifying some correct content or editing an originally correct code template.

[0004] These operations will have an unnecessary impact on text writing, require a lot of time to troubleshoot, and reduce the efficiency of text writing. Summary of the Invention

[0005] To solve the above technical problems, this application provides a text processing method. In the text content of a target file, editable regions can be set. When the user opens the target file, by monitoring the focus position of the input focus, the state of the editor is adjusted to an editable state only when the user wants to edit the text content in the editable regions, thereby protecting the text content outside the editable regions. At the same time, it also eliminates the need to troubleshoot the text content outside the editable regions in other processes, improving file security and text processing efficiency.

[0006] The embodiments of this application disclose the following technical solutions:

[0007] In a first aspect, the embodiments of this application provide a text processing method, which includes:

[0008] Open the text content corresponding to the target file through an editor;

[0009] Determine the editable regions in the text content according to the edit tags corresponding to the target file, where the editable regions are a part of the text regions in the text content;

[0010] Identify the focus position of the input focus in the text content;

[0011] If it is determined that the focus position is within the editable regions, adjust the state of the editor to an editable state;

[0012] If it is determined that the focus position is not within the editable regions, adjust the state of the editor to a non-editable state.

[0013] In a second aspect, an embodiment of the present application provides a text processing device, which includes an opening unit, a first determination unit, an identification unit, a first adjustment unit, and a second adjustment unit:

[0014] The opening unit is configured to open the text content corresponding to the target file through an editor;

[0015] The first determination unit is configured to determine an editable area in the text content according to the editing tag corresponding to the target file, and the editable area is a part of the text area in the text content;

[0016] The identification unit is configured to identify the focus position of the input focus in the text content;

[0017] The first adjustment unit is configured to adjust the state of the editor to an editable state if it is determined that the focus position is in the editable area;

[0018] The second adjustment unit is configured to adjust the state of the editor to a non-editable state if it is determined that the focus position is not in the editable area.

[0019] In a third aspect, an embodiment of the present application provides a computer device, which is characterized in that the device includes a processor and a memory:

[0020] The memory is used to store program codes and transmit the program codes to the processor;

[0021] The processor is configured to execute the text processing method described in the first aspect according to the instructions in the program codes.

[0022] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which is used to store a computer program, and the computer program is used to execute the text processing method described in the first aspect.

[0023] As can be seen from the above technical solution, when writing a target file, an editable area can be set in the text content of the target file according to requirements. After opening the text content corresponding to the target file through an editor, the editable area in the text content can be determined according to the editing tags corresponding to the target file. The editable area is a part of the text area in the text content, and this part of the text area allows editing through the editor. The editor provides an input focus for text editing. The user can perform text editing at the position indicated by the input focus. When opening the target file through the editor for editing, the focus position of the input focus in the text content is recognized. If it is determined that the focus position is within the editable area, the state of the editor is adjusted to the editable state, thereby allowing the user to edit the text content in the editable area; if it is determined that the focus position is not within the editable area, the state of the editor is adjusted to the non-editable state, thereby preventing the user from editing the text content outside the editable area, and thus effectively controlling the editing of the text content in the target file and realizing the protection of the text content outside the editable area. When troubleshooting the target file, only the content in the editable area needs to be reviewed, which reduces the time required for file troubleshooting to a certain extent and avoids misoperations on non-editable content, improving the efficiency of text writing. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0025] Figure 1 Schematic diagram of a text processing method in an actual application scenario provided by an embodiment of the present application;

[0026] Figure 2 Flowchart of a text processing method provided by an embodiment of the present application;

[0027] Figure 3 Schematic diagram of a text processing method provided by an embodiment of the present application;

[0028] Figure 4 Schematic diagram of a text processing method provided by an embodiment of the present application;

[0029] Figure 5 Schematic diagram of a text processing method provided by an embodiment of the present application;

[0030] Figure 6A flowchart of a text processing method provided by an embodiment of the present application in an actual application scenario;

[0031] Figure 7 A structural block diagram of a text processing device provided by an embodiment of the present application;

[0032] Figure 8 A structural diagram of a computer device provided by an embodiment of the present application;

[0033] Figure 9 A structural diagram of a server provided by an embodiment of the present application. Detailed implementation manners

[0034] The embodiments of the present application will be described below with reference to the accompanying drawings.

[0035] Electronic files are one of the things often encountered in life and work. In the text content corresponding to a file, usually a part of the text content needs to be protected. If this part of the text content is modified, certain risks may be brought. In the related art, after opening a file, usually all the text content of the file can be edited, and it is impossible to protect a part of the text content.

[0036] To solve the above technical problems, the present application provides a text processing method. An editable area can be set in the text content of a target file. When a user opens the target file, by monitoring the focus position of the input focus, the state of the editor is adjusted to an editable state only when the user wants to edit the text content in the editable area, thereby realizing the protection of the text content outside the editable area. At the same time, it also makes it unnecessary to check the text content outside the editable area in other processes, improving file security and text processing efficiency.

[0037] It can be understood that this method can be applied to a processing device, and the processing device is a processing device with text processing functions. For example, it can be a terminal device or a server with text processing functions. This method can run independently on the terminal device or the server, or can be applied to a network scenario where the terminal device and the server communicate and run in cooperation with the terminal device and the server. Among them, the terminal device can be a mobile phone, a desktop computer, a personal digital assistant (Personal Digital Assistant, abbreviated as PDA), a tablet computer, etc. The server can be understood as an application server or a Web server. In actual deployment, the server can be an independent physical server or a server cluster or a distributed system composed of multiple physical servers. The terminal and the server can be directly or indirectly connected through wired or wireless communication methods, and the present application does not limit this here.

[0038] To facilitate the understanding of the technical solution of this application, a text processing method provided in an embodiment of this application will be introduced below in combination with an actual application scenario.

[0039] See Figure 1 , Figure 1 which is a schematic diagram of a text processing method in an actual application scenario provided in an embodiment of this application. In this actual application scenario, the processing device is the terminal device 101, and an editor for editing text files is installed in the terminal device 101.

[0040] When a user wants to edit a certain target file, an operation can be performed on the terminal device 101, and the terminal device 101 can open the text content corresponding to the target file through the editor. Among them, when creating the text content, the creator of the target file can set some of the text content to an uneditable state to protect it. For example, in a contract file, the contract writer can set only the parts that need to be filled in the contract, such as the signature of the partner and the signing time, as editable areas. After setting, an editing label corresponding to the target file can be generated, and the editing label is used to identify the editable areas in the target file.

[0041] After opening the text content, the terminal device 101 can determine the editable areas in the text content according to the editing label corresponding to the target file. The editable areas refer to the parts of the text content that allow users to edit. As Figure 1 shown, it can be a part of the text area in the text content. When the user browses the text content and has a need to edit the text content, the input focus can be moved to the position where the user wants to edit. The input focus is used to locate the position for editing in the target file. For example, when the user wants to delete a certain field in the text content, the input focus can be moved to the field for editing.

[0042] To protect the text content outside the editable area from being edited by the user, the terminal device 101 can identify the focus position of the input focus and, based on this focus position and the editable area, determine whether the focus position is within the editable area, so as to determine whether the position the user wants to edit is within the editable area. If it is determined that the focus position is within the editable area, it indicates that the content the user wants to edit is allowed to be edited. At this time, the terminal device 101 can adjust the state of the editor to the editable state. In this editable state, the user can edit the target file opened through this editor, such as deleting, modifying, adding, etc. If it is determined that the focus position is not within the editable area, it indicates that the content the user wants to edit is not allowed to be edited. At this time, the terminal device 101 can adjust the state of the editor to the non-editable state. In this state, the user cannot edit the target file opened by this editor, thus realizing the protection of the text content outside the editable area.

[0043] As Figure 1 shown, in the Figure 1 text content on the left, the input focus is an input cursor, and this input cursor is located within the editable area, indicating that at this time the user wants to edit the text content that is allowed to be edited. The terminal device 101 can adjust this editor to the editable state, so that the user has the ability to edit the text content in this target file.

[0044] Since the terminal device 101 adjusts the state of the editor by identifying the focus position, during the process of the user editing the target file, as the focus position changes, the terminal device 101 can achieve dynamic switching of the editor state, so that the user can only edit within the editable area and cannot edit the text content outside the editable area. In the subsequent process, relevant personnel can only review the text content within the editable area, protecting the text content while improving the processing efficiency of the file.

[0045] Next, in combination with the accompanying drawings, a text processing method provided by an embodiment of the present application will be introduced.

[0046] See Figure 2 , Figure 2 which is a flowchart of a text processing method provided by an embodiment of the present application. The method includes:

[0047] S201: Open the text content corresponding to the target file through the editor.

[0048] Among them, the target file can be any one of the files that can be opened by the editor. The type of the target file is not limited to text files. To a certain extent, files that contain text content and can be opened by the editor can all be used as the target files in this application. For example, it can include code files, document files, slide files, etc. The text content can include various types of text content such as words, symbols, and numbers. The editor can be any program or application that can be used to edit the text content in the file. For example, it can be an editing software, etc.

[0049] In the text content of the target file, there may be some text content that does not need to be edited by the user. For example, there may be some text content with relatively high security requirements. If it is edited, it may bring greater risks, etc. For example, when the target file is a code file, the text content corresponding to the code file can be a code set. Some of the codes may involve the core part of the system and are the basic architecture of the system. This part of the code does not need to be edited. If it is edited, it may cause the system involved in the code to crash. Some codes may involve more personalized parts of the system. This part of the code can be edited based on the actual needs of the user and will not affect the normal operation of the system. Therefore, preventing the editing of some text content in the target file can play a key role in the security and reliability of the file.

[0050] Based on this, the embodiments of this application can design an editor to enable the editor to have the ability to control the user's editing permissions. In the embodiments of this application, the editor can include two states, namely the editable state and the non-editable state. When the editor is in the editable state, the user can edit the text content in the target file. When the editor is in the non-editable state, the user cannot edit the text content opened by the editor. Thus, the processing device can control the editor to achieve the editing control of the text content.

[0051] First, when the user browses the file, the user can control the processing device to open the text content corresponding to the target file through a certain operation instruction for processing. For example, when the processing device is a computer, the editor can be a computer software installed on the computer. The user can click on the target file and then select the way to open it with the editor to open the target file. In addition, in order to provide more convenient services for the user, the processing device can also automatically open the text content corresponding to the target file through the editor after meeting certain conditions. For example, the target file may correspond to a user list, and the users on the user list are users who have the permission to open the target file. After obtaining the user list, the processing device can automatically open the target file through the editor on the terminal device corresponding to the user list for the user to view and edit.

[0052] S202: Determine the editable area in the text content according to the edit label corresponding to the target file.

[0053] Before the processing device opens the target file, when the creator or other processor of the target file processes the target file, in order to protect part of the text content in the target file, the text content corresponding to the target file can be divided. In the embodiment of the present application, the text content can be divided into an editable area and an area outside the editable area, and the editable area is a part of the text area in the text content of the target file. Among them, the text content in the editable area is the text content that can be edited by the user. For example, it can be the time, partners, etc. that need to be filled in the contract file; the text content outside the editable area is the text content that does not allow the user to edit. For example, it can be the terms in the contract file, the core code in the code file, etc.

[0054] In order to be able to protect the text content of the target file in a targeted manner, after dividing the editable area, the processing device can generate an edit label corresponding to the target file based on the editable area, and the edit label is used to identify the editable area in the target file. The processing device can establish a mapping relationship between the edit label and the target file, or directly store the edit label in the target file. After opening the text content corresponding to the target file through the editor, the processing device can obtain the edit label and determine the editable area in the text content according to the edit label.

[0055] S203: Identify the focus position of the input focus in the text content.

[0056] In order to determine whether the user can edit the text content in the target file, in addition to determining the editable area corresponding to the target file, it is also necessary to determine the text position that the user wants to edit, so as to be able to judge whether to allow the user to edit. It can be understood that when the user wants to edit the text content, usually the input focus needs to be used to locate the input position first, so as to edit the text content at the required text position.

[0057] Among them, the form of the input focus can include various types. For example, it can be Figure 1 the input cursor shown, or it can be the double-click position of the user on the text content with the mouse, etc. The input focus is used to locate the position of the text to be edited when the text content needs to be edited. The embodiment of the present application does not limit the form and appearance of the input focus. In addition to the continuously displayed vertical line form similar to Figure 1 shown, it can also be in a flashing display form, or it can be a non-display form. In the case where the input focus is not displayed, the user can quickly locate the focus position of the input focus through simple editing operations.

[0058] When the user edits the text content, the editing process will be reflected in the text content corresponding to the focus position of the input focus. The focus position refers to the position corresponding to the input focus in the text content of the target file. For example, adding the content input by the user at the focus position of the input focus, or deleting the content on the left or right side of the focus position based on the input focus, etc.

[0059] By identifying the focus position of the input focus, the processing device can determine the position where the user wants to edit the text content, and thus can determine whether to allow the user to edit the text content by comparing the relationship between the focus position and the editable area.

[0060] S204: If it is determined that the focus position is within the editable area, adjust the state of the editor to the editable state.

[0061] If the processing device determines that the focus position is within the editable area when comparing the relationship between the focus position and the editable area, to a certain extent, it can indicate that the text content that the user currently wants to edit is the text content within the editable area. At this time, the processing device can allow the user to edit the text content. As mentioned above, the processing device can control the user's editing permission by adjusting the state of the editor. Therefore, in order to allow the user to edit the text content, the processing device can adjust the state of the editor to the editable state. In this editable state, the user can edit the entire text content corresponding to the target file. However, since the processing device will only adjust the state of the editor to the editable state when the focus position is within the editable area, by combining the judgment of the focus position, the processing device can protect the text content outside the editable area in the text content without separately setting permissions for each part of the text content, further simplifying the text processing flow.

[0062] S205: If it is determined that the focus position is not within the editable area, adjust the state of the editor to the non-editable state.

[0063] If the processing device determines that the focus position is not within the editable area when comparing the relationship between the focus position and the editable area, to a certain extent, it can indicate that the text content that the user currently wants to edit is the text content outside the editable area, and this part of the text content is not allowed to be edited by the user. At this time, the processing device can adjust the state of the editor to the non-editable state. In this non-editable state, all the text content in the target file is not allowed to be edited by the user.

[0064] Since the processing device can recognize the focus position of the input focus in real time, when the input focus of the user is moving continuously, the processing device can also dynamically adjust the state of the editor, so as to achieve precise protection of the text content. For example, when the input focus moves from the editable area to outside the editable area, the processing device can immediately adjust the state of the editor from the editable state to the non-editable state, so as to prevent the user from editing the text content outside the editable area; when the input focus moves from outside the editable area to inside the editable area, the processing device can adjust the state of the editor from the non-editable state to the editable state, so as to grant the user the permission to edit the text content.

[0065] It can be seen from the above technical solution that when writing a target file, an editable area can be set in the text content of the target file according to requirements. After opening the text content corresponding to the target file through an editor, the editable area in the text content can be determined according to the edit label corresponding to the target file. The editable area is a part of the text area in the text content, and this part of the text area allows editing through the editor. The editor provides an input focus for text editing. The user can perform text editing at the position indicated by the input focus. When opening the target file for editing through the editor, the focus position of the input focus in the text content is recognized. If it is determined that the focus position is within the editable area, the state of the editor is adjusted to the editable state, so as to allow the user to edit the text content in the editable area; if it is determined that the focus position is not within the editable area, the state of the editor is adjusted to the non-editable state, so as to prevent the user from editing the text content outside the editable area, and thus effectively control the editing of the text content in the target file, achieving the protection of the text content outside the editable area. When checking the target file, only the content in the editable area needs to be reviewed, which reduces the time required for checking the file to a certain extent and avoids misoperations on non-editable content, improving the efficiency of text writing.

[0066] To enable users to more clearly know whether the text content in the target file is editable, when the processing device displays the text content to the user, it can also perform special processing on the editable area and the text content outside the editable area. For example, in a possible implementation, if the editor includes an editable area in the display area of the text content, the processing device can highlight the editable area to identify the area range of the editable area through the highlighting. Among them, the display area is the area of the text content that the user can see, and highlighting refers to a display method that can distinguish some text content from other text content, such as highlighter display, etc. Highlighter display means distinguishing some text content from other text content by a more distinct color. For example, the background color of some text content or the color of the text itself can be adjusted to a more distinct color, or a text box with a distinct color can be added to this part of the text content. When the display area includes an editable area, the processing device can only highlight this part of the editable area in the display area, or can highlight all the editable areas in the text content. As Figure 3 shown Figure 3 is a schematic diagram of highlighting the editable area. The "x" in this schematic diagram represents the text content. Among the text content displayed in this display area, the text content in lines 7-9 is the text content in the editable area. The processing device can highlight the text content in the editable area by adding a background color, so that the user can quickly find the editable area for editing. It can be understood that in addition to highlighter display, other methods that can be used to highlight the editable area can also achieve the above technical effects. For example, an underline can be added to the text content in the editable area, or the text content in the editable area can be made bold, etc.

[0067] In addition to being able to perform special processing on the editable area, the processing device can also process the text content outside the editable area. For example, in a possible implementation, when the user wants to edit the text content outside the editable area, the processing device can remind the user that this part of the text content cannot be edited. As mentioned above, the processing device can determine the user's editing position in the text content by identifying the focus position of the input focus. Therefore, if it is determined that the focus position is not in the editable area, it means that the user wants to edit the text content outside the editable area at this time. The processing device can display a non-editable prompt based on the focus position, and this prompt is used to prompt the user that the text content at the current position cannot be edited. Among them, the form of this prompt can include various types, such as text prompt, logo prompt, voice prompt, etc.

[0068] As Figure 4 shown Figure 4A schematic diagram of a non-editable prompt provided by an embodiment of this application. When the focus position is outside the editable area, the processing device can display a text box with the content "Cannot edit in read-only editor (Prohibited from editing in the read-only area)" at this focus position. The read-only area refers to the area outside the editable area where only reading by the user is allowed.

[0069] As mentioned above, the edit label corresponding to the target file can be used to identify the editable area in the text content. Among them, the way the edit label identifies the editable area can also include various types. It can be understood that the text content is usually arranged in rows. As Figure 3 and Figure 4 shown in the schematic diagram, the text content has corresponding line number markings. Through this line number marking, the processing device can determine a part of the text content in the text content as the text content in the editable area. For example, in Figure 3 the schematic diagram shown, the text content corresponding to lines 7-9 is the text content in the editable area.

[0070] Based on this, in a possible implementation manner, the edit label can include the start position identifier and the end position identifier of the editable area in the text content. The start position identifier is used to identify the start position of the editable area, and the end position identifier is used to identify the end position of the editable area. The processing device can determine the start line and the end line of the editable area in the text content according to the start position identifier and the end position identifier, and then determine the editable area according to the start line and the end line. Among them, the start position identifier and the end position identifier can be the line numbers themselves. At this time, the editable area is the line number range including the start line and the end line. For example, the start position identifier can be "Line 7", and the end position identifier can be "Line 9". At this time, the editable area includes the text content of lines 7-9.

[0071] It can be understood that when the processing device determines whether the focus position is in the editable area, for different ways of determining the editable area, the way the processing device determines can also be different. For example, in a possible implementation manner, if the editable area is determined by the start line and the end line, the processing device can first determine the line number of the line where the focus position is located, and then determine whether the line number is between the start line and the end line. As mentioned above, the processing device can determine the text area between the start line and the end line as the editable area. Therefore, if the line number is between the start line and the end line, it can be determined that the focus position is in the editable area; if not, it can be determined that the focus position is not in the editable area.

[0072] In addition, the start position identifier and the end position identifier can also be identifiers independent of the line number. The processing device can determine the start line and the end line by recognizing these identifiers. In one possible implementation, the start position identifier and the end position identifier can be set as text in the text content. When determining the editable region, the processing device can traverse the text corresponding to the start position identifier and the end position identifier in the text content, use the line where the text of the start position identifier is located as the start line, and use the line where the text of the end position identifier is located as the end line. For example, the start position identifier can be "TAG-START", and the end position identifier can be "TAG-END". The processing device can retrieve the document content of the target file. If the identifier "TAG-START" is detected, the line where this identifier is located can be determined as the start line; if the identifier "TAG-END" is detected, the line where this identifier is located can be determined as the end line.

[0073] It can be understood that, depending on the positions of the identifiers, the method of determining the editable region based on the identifiers is also different. For example, when the start position identifier and the end position are not on a separate line, the line where the start position identifier is located can be used as the start line, and the line where the end position identifier is located can be used as the end line. At this time, the editable region is the text region from the start line to the end line, including the start line and the end line. When the start position identifier and the end position identifier are on a separate line, the line where the start position identifier is located can also be used as the start line, and the line where the end position identifier is located can be used as the end line. At this time, in order to prevent the start position identifier and the end position identifier from being modified by the user, the processing device can determine the editable region as the text region from the start line to the end line, but not including the start line and the end line.

[0074] As Figure 5 shown, Figure 5 FIG. is a schematic diagram of a method for determining an editable region provided by an embodiment of the present application. In this schematic diagram, the start position identifier "TAG-START" and the end position identifier "TAG-END" are on a separate line. When the processing device traverses the text content, it can determine that the start position identifier is on the 6th line and the end position identifier is on the 10th line. Therefore Figure 5 the start line in is the 6th line, and the end line is the 10th line. At this time, the processing device can determine that the editable region is the text region from the 6th to the 10th line, but not including the 6th line and the 10th line.

[0075] By analyzing the above technologies, it can be known that under normal circumstances, the processing device can determine an editable area through a start position identifier and an end position identifier. Therefore, in the editing tags corresponding to the target file, the start position identifier and the end position identifier should be corresponding identifiers one by one. Based on this, in order to improve the security and reliability of the target file, the processing device can also check the editable area in the text content corresponding to the target file based on the start position identifier and the end position identifier.

[0076] In a possible implementation manner, since the start position identifier and the end position identifier correspond one by one, under normal circumstances, the number of the start position identifier and the end position identifier should be the same. When performing the check, the processing device can determine whether the number of the start position identifier and the end position identifier is the same. If they are the same, to a certain extent, it indicates that the editable areas in the target file are all in a normal state; if they are not the same, it indicates that there is a situation where the start position identifier or the end position identifier is missing in the editable areas of the target file, which may cause an abnormal situation when the processing device determines the editable area. For example, when there are only 7 start position identifiers "TAG-START" and 6 end position identifiers "TAG-END", it will cause a start position identifier to lack the corresponding end position identifier, which makes the processing device unable to correctly identify the editable area corresponding to the start position identifier. At this time, in order to enable the user to know the error situation and prevent the user from changing the text content outside the editable area, the processing device can generate an error event for indicating an error in the editable area and can display the error event to the user through the display area. Among them, various information related to the problematic editable area can be included in the error time, for example, it can inform the user of the missing identifier category, etc.

[0077] In addition to judging errors by quantity, the processing device can also judge whether there is a problem with the editable area by traversing the corresponding relationship between the start position identifier and the end position identifier, etc. For example, under normal circumstances, the start position identifier and the end position identifier in the target file appear in sequence. Therefore, if the processing device determines multiple consecutive start position identifiers or multiple consecutive end position identifiers during the process of traversing the text content, it can also indicate that there is a problem with the editable area; in addition, each pair of corresponding start position identifier and end position identifier can include a unique pairing identifier, such as "start position identifier 1", "end position identifier 1", "start position identifier 2", "end position identifier 2", etc. The processing device can detect whether the start position identifier and the end position identifier are corresponding identifiers one by one through the pairing identifier.

[0078] During the process of editing an editable region, the user may perform operations such as adding text, deleting text, adjusting text formatting and layout, etc. These operations may all affect the scope of the editable region. For example, when part of the text content in the editable region is deleted, the number of lines in the editable region may decrease; when a carriage return character is added, the number of lines in the editable region may increase. Since the processing device determines whether to allow the user to change the text content by comparing the scope of the editable region and the focus position of the input focus, when the scope of the editable region changes, in order to accurately adjust the user's editing permissions, the processing device can perform real-time detection and update of the scope of the editable region, so that after the scope of the editable region changes, it can promptly compare the updated editable region with the focus position, avoiding changes to the text content outside the editable region caused by changes in the scope of the editable region.

[0079] As mentioned above, in one possible implementation, the processing device can determine the starting line and ending line of the editable region through the starting position identifier and ending position identifier in the edit tag, and then determine the editable region through the starting line and ending line, that is, the scope of the editable region can be represented by the number of lines. Therefore, if the number of lines included in the editable region changes due to the user's editing operation, it will affect the scope of the editable region. Based on this, the processing device can first obtain the text editing operation for the editable region, and this text editing operation can include any editing operation that the user can perform on the text content, such as deletion, modification, addition, etc. Since the processing device can determine the number of lines corresponding to the editable region through the edit tag, such as the starting position identifier and ending position identifier in the edit tag, after obtaining this text editing operation, the processing device can determine whether the scope of the editable region has changed through the above action of determining the editable region in the text content according to the edit tag of the target file.

[0080] Specifically, in one possible implementation, when the processing device determines the editable region according to the edit tag, if it determines that the number of lines in the editable region has changed through this text editing operation, it can correspondingly update the region scope of the editable region. For example, when the edit tag includes the starting position identifier and ending position identifier set in the text content, after obtaining the text editing operation, the processing device can determine whether the number of lines corresponding to the starting position identifier and ending position identifier has changed through this text editing operation to determine whether the number of lines in the editable region has changed. If the number of lines has changed, the processing device can compare the updated editable region with the focus position, thereby to a certain extent avoiding the user editing the text content outside the editable region due to not updating the scope of the editable region, and improving the security and reliability of the target file.

[0081] In addition, when the user edits the text content of the target file, to improve the security of the edited content, the processing device can also provide a function to review the edited content. For example, in a possible implementation, the processing device can monitor the text content in the editable area in real time. If the text in the editable area changes, the processing device can generate a text change event, which is used to reflect information related to the text change. For example, it can include the text in the editable area, the change data corresponding to the text change, as well as information such as the initiator of the text change and the change time. The change data is used to identify the content of the text change for the text. For example, when the user deletes a certain paragraph of text in the editable area, the text change event generated by the processing device can include: the text content corresponding to the editable area, the deleted text content, the deletion time, the user who made the deletion operation, and other information.

[0082] After the relevant personnel or device obtains the text change event, they can review the text change event. If they agree to the text change made by the user, they can approve the text change event. At this time, the processing device can receive feedback information that the change has passed and accept the text change made by the user. If they do not agree, they can reject the text change event. At this time, the processing device can receive feedback information that the change has not passed and reject the text change made by the user through the editor. In addition, it can also prompt the user that the text change has not passed the review.

[0083] Next, a text processing method provided by an embodiment of the present application will be introduced in combination with an actual application scenario.

[0084] See Figure 6 , Figure 6 which is a flowchart of a text processing method in an actual application scenario provided by an embodiment of the present application. In this actual application scenario, the processing device is a computer capable of performing code editing operations, the editor is a code editing software in the computer, such as a Webide component, and the target file is a code file. The method includes:

[0085] S601: Obtain an editing label corresponding to the code file.

[0086] First, the user can operate the computer to open the text content in the code file through the code editing software. The text content can be a piece of code content. Subsequently, the computer can obtain an editing label corresponding to the code file to determine the editable area in the text content. As shown in the following code:

[0087] editableAreaMark = "editableAreaMark: ['TAG-BEGIN', 'TAG-END']"

[0088] Among them, editableAreaMark is an array of parameters that can be used to represent editing tags. TAG-BEGIN is the start position identifier, and TAG-END is the end position identifier.

[0089] S602: Traverse the text content of the code file to determine the editable area.

[0090] The computer can traverse the start position identifier and the end position identifier in the text content to determine the start line and the end line, thereby determining the editable area. In addition, the computer can also detect the number of start position identifiers and the number of end position identifiers in the text content to determine whether there is an abnormality in the editable area. For example, as shown in the following code, this code is a code for comparing the number of start position identifiers and the number of end position identifiers:

[0091]

[0092] Appear abnormally. For example, as shown in the following code, this code is a code for comparing the number of start position identifiers and the number of end position identifiers:

[0093] Through the first line of code, the computer can compare the number of identifiers; through the second to third lines of code, when the number of identifiers is inconsistent, the computer can send an error prompt of "code mark tampered" to the user.

[0094]

[0095] S603: Highlight the editable area.

[0096] The computer can highlight the text content of the editable area through the following code:

[0097] S604: Real-time identify the input focus.

[0098] In order to determine whether the text content allows the user to edit, the computer can real-time identify the input focus of the user in the text content.

[0099] S605: Determine the focus position.

[0100] S606: Determine whether it is editable.

[0101]

[0102] The computer can determine whether the user can edit the text content based on the focus position of the user input focus and the editable area. As shown in the following code:

[0103] As mentioned above, the computer can highlight the editable area. Therefore, if the computer determines through the code that the focus position is not in the highlighted area, it can continue with the recognition calculation; if it is in the highlighted area, that is, the area has markers such as a start position marker and an end position marker, it can be determined that the input focus is in the editable area.

[0104] S607: Adjust the editor status.

[0105]

[0106] The computer can adjust the status of the code editor based on the position of the input focus. As shown in the following code:

[0107] If the computer determines that the focus position (i.e., the location where the current event occurs) is in the editable area (i.e., the area where editing can occur), it can adjust the status of the editor to the editable state; if not, it can be adjusted to the non - editable state.

[0108] S608: Generate a text change event.

[0109]

[0110] If the user makes a text change to the text content in the code file through the computer, the computer can generate a text change event for sending to relevant personnel for review. As shown in the following code:

[0111] This code includes an array "editableAreaValueChange" for identifying the text change content. Through this array, relevant personnel can know the content of this text change.

[0112] Based on the text processing method provided in the above - mentioned embodiments, the embodiments of the present application also provide a text processing device. Refer to Figure 7 , Figure 7 which is a structural block diagram of a text processing device 700 provided by the embodiments of the present application. The device includes an opening unit 701, a first determination unit 702, an identification unit 703, a first adjustment unit 704, and a second adjustment unit 705:

[0113] The opening unit 701 is used to open the text content corresponding to the target file through the editor;

[0114] The first determination unit 702 is used to determine the editable area in the text content according to the editing label corresponding to the target file, and the editable area is a part of the text area in the text content;

[0115] The identification unit 703 is used to identify the focus position of the input focus in the text content;

[0116] A first adjustment unit 704, configured to adjust the state of the editor to an editable state if it is determined that the focus position is within the editable area.

[0117] A second adjustment unit 705, configured to adjust the state of the editor to a non - editable state if it is determined that the focus position is not within the editable area.

[0118] In a possible implementation, the device 700 further includes a display unit:

[0119] The display unit is configured to, if the display area of the editor for the text content includes the editable area, highlight the editable area to identify the area range of the editable area through the highlighting.

[0120] In a possible implementation, if it is determined that the focus position is not within the editable area, the device 700 further includes a display unit:

[0121] The display unit is configured to display a non - editable prompt based on the focus position.

[0122] In a possible implementation, the edit label includes a start position identifier and an end position identifier of the editable area in the text content. The first determination unit 702 is specifically configured to:

[0123] Determine the start line and the end line of the editable area in the text content according to the start position identifier and the end position identifier;

[0124] Determine the editable area according to the start line and the end line.

[0125] In a possible implementation, the start position identifier and the end position identifier are set as text in the text content. The first determination unit 702 is specifically configured to:

[0126] By traversing the text corresponding to the start position identifier and the end position identifier in the text content, use the line where the text of the start position identifier is located as the start line and the line where the text of the end position identifier is located as the end line.

[0127] In a possible implementation, the device 700 further includes a second determination unit, a third determination unit, a fourth determination unit, and a fifth determination unit:

[0128] The second determination unit is configured to determine the line number of the line where the focus position is located;

[0129] The third determination unit is configured to determine whether the line number is between the start line and the end line;

[0130] A fourth determination unit, configured to determine that the focus position is within the editable region if in a certain state;

[0131] A fifth determination unit, configured to determine that the focus position is not within the editable region if not in the certain state.

[0132] In a possible implementation, the apparatus 700 further includes a sixth determination unit and a first generation unit:

[0133] The sixth determination unit is configured to determine whether the number of the start position identifier and the end position identifier is consistent;

[0134] The first generation unit is configured to generate an error event indicating an error in the editable region if they are inconsistent.

[0135] In a possible implementation, the apparatus 700 further includes an acquisition unit:

[0136] The acquisition unit is configured to acquire a text editing operation for the editable region;

[0137] The first determination unit 702 is specifically configured to:

[0138] If it is determined that the number of lines of the editable region is changed by the text editing operation, correspondingly update the region range of the editable region.

[0139] In a possible implementation, the apparatus 700 further includes a second generation unit:

[0140] The second generation unit is configured to generate a text change event if the text in the editable region changes, where the text change event includes the text in the editable region and change data corresponding to the text change.

[0141] An embodiment of the present application further provides a computer device, which will be introduced below with reference to the accompanying drawings. Please refer to Figure 8 As shown, an embodiment of the present application provides a device, and the device may also be a terminal device, and the terminal device may be any intelligent terminal including a mobile phone, a tablet computer, a personal digital assistant (Personal Digital Assistant, abbreviated as PDA), a point of sales (Point of Sales, abbreviated as POS), an in-vehicle computer, etc. Taking the terminal device as a mobile phone as an example:

[0142] Figure 8 Shown is a block diagram of a part of the structure of a mobile phone related to the terminal device provided by an embodiment of the present application. Refer to Figure 8, the mobile phone includes components such as a Radio Frequency (RF) circuit 810, a memory 820, an input unit 830, a display unit 840, a sensor 850, an audio circuit 860, a wireless fidelity (WiFi) module 870, a processor 880, and a power supply 890. Those skilled in the art can understand that Figure 8 the mobile phone structure shown in

[0143] does not limit the mobile phone and may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements. Figure 8 The following specifically introduces each component of the mobile phone:

[0144] The RF circuit 810 can be used for receiving and sending signals during information reception or call processes. Specifically, after receiving the downlink information from the base station, it is given to the processor 880 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit 810 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, etc. In addition, the RF circuit 810 can also communicate with the network and other devices through wireless communication. The above wireless communication can use any communication standard or protocol, including but not limited to the Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.

[0145] The memory 820 can be used to store software programs and modules. The processor 880 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 820. The memory 820 may mainly include a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created according to the use of the mobile phone (such as audio data, phone book, etc.). In addition, the memory 820 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0146] The input unit 830 can be used to receive input digital or character information, and generate key signal inputs related to the user settings and function control of the mobile phone. Specifically, the input unit 830 may include a touch panel 831 and other input devices 832. The touch panel 831, also known as a touch screen, can collect touch operations of the user on or near it (such as operations of the user using a finger, a stylus, or any suitable object or accessory on or near the touch panel 831), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 831 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the touch orientation of the user, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 880, and can receive and execute commands sent by the processor 880. In addition, various types such as resistive, capacitive, infrared, and surface acoustic wave can be used to implement the touch panel 831. In addition to the touch panel 831, the input unit 830 may also include other input devices 832. Specifically, the other input devices 832 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, power on / off keys, etc.), a trackball, a mouse, a joystick, etc.

[0147] The display unit 840 can be used to display information input by the user or information provided to the user, as well as various menus of the mobile phone. The display unit 840 may include a display panel 841. Optionally, the display panel 841 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel 831 can cover the display panel 841. When the touch panel 831 detects a touch operation on or near it, it is transmitted to the processor 880 to determine the type of touch event. Subsequently, the processor 880 provides a corresponding visual output on the display panel 841 according to the type of touch event. Although in Figure 8 the touch panel 831 and the display panel 841 are implemented as two independent components to realize the input and input functions of the mobile phone, in some embodiments, the touch panel 831 and the display panel 841 can be integrated to realize the input and output functions of the mobile phone.

[0148] The mobile phone may further include at least one sensor 850, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. Among them, the ambient light sensor can adjust the brightness of the display panel 841 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 841 and / or the backlight when the mobile phone is moved to the ear. As a kind of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity, and can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor that the mobile phone can also be configured with, they will not be elaborated here.

[0149] The audio circuit 860, the speaker 861, and the microphone 862 can provide an audio interface between the user and the mobile phone. The audio circuit 860 can transmit the electrical signal converted from the received audio data to the speaker 861, and the speaker 861 converts it into a sound signal for output; on the other hand, the microphone 862 converts the collected sound signal into an electrical signal, which is received by the audio circuit 860 and converted into audio data. After the audio data is output to the processor 880 for processing, it is sent through the RF circuit 810 to, for example, another mobile phone, or the audio data is output to the memory 820 for further processing.

[0150] WiFi belongs to short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse the web, and access streaming media through the WiFi module 870. It provides users with wireless broadband Internet access. Although Figure 8The WiFi module 870 is shown, but it can be understood that it does not belong to the essential components of the mobile phone and can be completely omitted within the scope of not changing the essence of the invention as needed.

[0151] The processor 880 is the control center of the mobile phone, connecting various parts of the entire mobile phone through various interfaces and circuits. By running or executing software programs and / or modules stored in the memory 820, and by calling data stored in the memory 820, it executes various functions of the mobile phone and processes data. Optionally, the processor 880 may include one or more processing units; preferably, the processor 880 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, application programs, etc., and the modem processor mainly processes wireless communications. It can be understood that the above-mentioned modem processor may not be integrated into the processor 880 either.

[0152] The mobile phone also includes a power supply 890 (such as a battery) for supplying power to each component. Preferably, the power supply can be logically connected to the processor 880 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system.

[0153] Although not shown, the mobile phone may also include a camera, a Bluetooth module, etc., which will not be elaborated here.

[0154] In this embodiment, the processor 880 included in the terminal device further has the following functions:

[0155] Open the text content corresponding to the target file through an editor;

[0156] Determine the editable area in the text content according to the editing tags corresponding to the target file, and the editable area is a part of the text area in the text content;

[0157] Identify the focus position of the input focus in the text content;

[0158] If it is determined that the focus position is within the editable area, adjust the state of the editor to the editable state;

[0159] If it is determined that the focus position is not within the editable area, adjust the state of the editor to the non-editable state.

[0160] The embodiment of the present application also provides a server. Please refer to Figure 9 as shown Figure 9The following is a structural diagram of the server 900 provided by the embodiments of the present application. The server 900 may vary significantly due to different configurations or performances, and may include one or more central processing units (CPUs) 922 (for example, one or more processors) and a memory 932, and one or more storage media 930 (for example, one or more mass storage devices) for storing application programs 942 or data 944. Among them, the memory 932 and the storage media 930 may be transient storage or persistent storage. The program stored in the storage media 930 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Further, the central processing unit 922 may be configured to communicate with the storage media 930 and execute a series of instruction operations in the storage media 930 on the server 900.

[0161] The server 900 may further include one or more power supplies 926, one or more wired or wireless network interfaces 950, one or more input / output interfaces 958, and / or one or more operating systems 941, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, and so on.

[0162] In the above embodiments, the steps executed by the server may be based on Figure 9 the server structure shown.

[0163] The embodiments of the present application further provide a computer-readable storage medium for storing a computer program, and the computer program is used to execute any one of the text processing methods described in the foregoing embodiments.

[0164] Those of ordinary skill in the art can understand that all or part of the steps for implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program may be stored in a computer-readable storage medium, and when the program is executed, it executes the steps including the above method embodiments; and the foregoing storage medium may be at least one of the following media: read-only memory (abbreviation: ROM), RAM, magnetic disk, or optical disc, etc., which can store program codes.

[0165] It should be noted that the various embodiments in this specification are described in a progressive manner. For the same or similar parts among the various embodiments, reference can be made to each other, and the key point of each embodiment is to illustrate the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and reference can be made to the corresponding parts of the method embodiments for the relevant content. The device and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative efforts.

[0166] As described above, this is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A text processing method, characterized in that, the method includes: Obtaining a user list corresponding to the target file, where the users on the user list are users with the permission to open the target file, and the target file is a code file; If the currently used terminal device is the terminal device corresponding to the user list, automatically open the text content corresponding to the target file through an editor; By traversing the text corresponding to the start position identifier and the end position identifier in the text content, taking the line where the text of the start position identifier is located as the start line, and taking the line where the text of the end position identifier is located as the end line, and the start position identifier and the end position identifier are set as text in the text content; Determining the text area between the start line and the end line as the editable area in the text content; the start position identifier and the end position identifier are located on separate lines respectively; the editable area does not include the start line and the end line, and the editable area is a part of the text area in the text content; During the process of traversing the text content, under the indication of the first part of the code in the text content, determining whether the number of start position identifiers and the number of end position identifiers in the text content are consistent; under the indication of the second part of the code in the text content, if the numbers are inconsistent, generating an error event for indicating that the editable area is in error, and presenting the error event to the user, where the error event includes various information related to the problematic editable area; if they are consistent, determining that the editable area is in a normal state; and, If, during the process of traversing the text content, multiple consecutive start position identifiers or multiple consecutive end position identifiers are determined, determining that there is a problem with the editable area, generating the error event, and presenting the error event to the user; Identifying the focus position of the input focus in the text content; Through the third part of the code in the text content, if it is determined that the focus position is within the editable area, adjusting the state of the editor to an editable state; if it is determined that the focus position is not within the editable area, adjusting the state of the editor to a non-editable state; If, after obtaining a text editing operation for the editable area, it is determined that the lines corresponding to the start position identifier and the end position identifier of the editable area are changed by the text editing operation, correspondingly updating the range of the editable area; comparing the updated editable area with the focus position; and, If the text in the editable area undergoes a text change, generating a text change event, where the text change event includes the text in the editable area and the change data corresponding to the text change; sending the text change event to relevant personnel for review; if feedback information indicating that the text change event is approved is obtained, accepting the text change; if feedback information indicating that the text change event is not approved is obtained, rejecting the text change through the editor.

2. The method according to claim 1, It is characterized in that The method further includes: If the display area of the editor for the text content includes the editable area, highlighting the editable area to identify the area range of the editable area through the highlighting.

3. The method according to claim 1, It is characterized in that If it is determined that the focus position is not in the editable area, the method further includes: Displaying a non-editable prompt based on the focus position.

4. The method according to claim 1, It is characterized in that The method further includes: Determining the line number of the line where the focus position is located; Determining whether the line number is between the starting line and the ending line; If it is, determining that the focus position is in the editable area; If it is not, determining that the focus position is not in the editable area.

5. A text processing device, It is characterized in that The device includes an opening unit, a first determination unit, an identification unit, a first adjustment unit, a second adjustment unit, a sixth determination unit, a first generation unit, and a second generation unit: The opening unit is used to obtain the user list corresponding to the target file, and the users on the user list are users with the permission to open the target file, and the target file is a code file; If the currently used terminal device is the terminal device corresponding to the user list, automatically opening the text content corresponding to the target file through an editor; The first determination unit is used to traverse the text corresponding to the start position identifier and the end position identifier in the text content, use the line where the text of the start position identifier is located as the start line, use the line where the text of the end position identifier is located as the end line, and the start position identifier and the end position identifier are set in the text content as text; determining the text area between the start line and the end line as the editable area in the text content; the start position identifier and the end position identifier are respectively located on a separate line; the editable area does not include the start line and the end line, and the editable area is a part of the text area in the text content; The sixth determination unit is used to determine whether the number of start position identifiers and the number of end position identifiers in the text content are consistent under the indication of the first part of the code in the text content during the traversal of the text content; The first generation unit is used to, under the indication of the second part of the code in the text content, if the quantities are inconsistent, generate an error event for indicating an error in the editable area, and display the error event to the user, and the error event includes various information related to the problematic editable area; If they are consistent, determining that the editable area is in a normal state; And, The first generation unit is further used to, if multiple consecutive start position identifiers or multiple consecutive end position identifiers are determined during the traversal of the text content, determine that there is a problem with the editable area, generate the error event, and display the error event to the user; The identification unit is used to identify the focus position of the input focus in the text content; The first adjustment unit is configured to, by using the third part of the code in the text content, if it is determined that the focus position is within the editable area, adjust the state of the editor to the editable state; The second adjustment unit is configured to, if it is determined that the focus position is not within the editable area, adjust the state of the editor to the non-editable state; The first determination unit is further configured to, if a text editing operation on the editable area is obtained, determine that the line numbers corresponding to the start position identifier and the end position identifier of the editable area are changed by the text editing operation, and then correspondingly update the range of the editable area; The recognition unit is further configured to compare the updated editable area with the focus position; The second generation unit is configured to, if the text in the editable area undergoes a text change, generate a text change event, where the text change event includes the text in the editable area and the change data corresponding to the text change; The device further includes a module for performing the following steps: sending the text change event to relevant personnel for review; if feedback information indicating that the text change event is approved is obtained, accepting the text change; if feedback information indicating that the text change event is not approved is obtained, rejecting the text change through the editor.

6. The device according to claim 5, wherein, the device further includes a display unit: The display unit is configured to, if the display area of the editor for the text content includes the editable area, highlight the editable area to identify the range of the editable area through the highlighting.

7. The device according to claim 5, wherein, if it is determined that the focus position is not within the editable area, the device further includes a display unit: The display unit is configured to display a non-editable prompt based on the focus position.

8. The device according to claim 5, wherein, the device further includes a second determination unit, a third determination unit, a fourth determination unit, and a fifth determination unit: The second determination unit is configured to determine the line number of the row where the focus position is located; The third determination unit is configured to determine whether the line number is between the start line and the end line; The fourth determination unit is configured to, if it is, determine that the focus position is within the editable area; The fifth determination unit is configured to, if it is not, determine that the focus position is not within the editable area.

9. A computer device, wherein, the device includes a processor and a memory: The memory is configured to store program code and transmit the program code to the processor; The processor is configured to execute the text processing method according to any one of claims 1-4 according to the instructions in the program code.

10. A computer-readable storage medium, wherein, the computer-readable storage medium is configured to store a computer program, and the computer program is configured to execute the text processing method according to any one of claims 1-4.

Citation Information

Patent Citations

  • Document processing method and device and electronic equipment

    CN110659526A

  • Permission setting method and device for online document, terminal and storage medium

    CN111767563A