Cursor control method and related device

By inserting placeholders in the document to record the cursor position, the problem of cursor position rollback is solved, enabling accurate cursor positioning and prompting in online documents, which is suitable for online documents edited collaboratively by multiple devices.

CN110209308BActive Publication Date: 2026-06-26TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2018-03-13
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

In existing technologies, the cursor position may revert to the starting position after the document is updated, making it difficult for users to accurately determine the location of the content being edited in the document, especially when multiple devices are collaboratively editing online documents.

Method used

Insert placeholders into the document. The placeholders record the cursor position and change as the document content changes. By finding the placeholders, you can determine the exact position of the cursor in the document and display the cursor.

Benefits of technology

Ensure the cursor always appears at the user's most recently edited position, providing accurate document editing location hints to adapt to multi-device collaborative editing scenarios for online documents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110209308B_ABST
    Figure CN110209308B_ABST
Patent Text Reader

Abstract

The application provides a cursor control method applied to a target device. After receiving a document display instruction, the method finds a placeholder associated with the target device in a first target document, wherein the placeholder indicates a position of a cursor after the target device processes the first target document last time, displays the first target document and displays the cursor at the position of the first target document, so that the user can be obviously prompted about a position of content in the document processed last time. In addition, the application further provides a device and a related storage medium to ensure application and implementation of the method in practice.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer control technology, and more specifically, to cursor control methods and related equipment. Background Technology

[0002] One form of document is the online document, which is stored on a cloud server. Multiple computer devices with access permissions can access the online document and process it simultaneously or at different times. Updates to the online document's content on any computer device are synchronized to other computer devices to ensure consistency across all devices.

[0003] It's important to note that when a computer device processes a document, it displays a cursor within the document. The cursor indicates the location of the content being edited. Currently, for a given computer device, the cursor will be at a specific location within the document while processing an online document. However, if the device receives updates to the online document from other computer devices, the cursor will revert to its original position at the beginning of the document. Summary of the Invention

[0004] In view of this, this application provides a cursor control method for controlling the cursor position in a document when refreshing the document.

[0005] To achieve the aforementioned objective, the technical solution provided in this application is as follows:

[0006] In a first aspect, this application provides a cursor control method applied to a target device, the method comprising:

[0007] Upon receiving the document display instruction, the first target document is obtained;

[0008] Locate a first placeholder in the first target document that is associated with the target device, wherein the first placeholder represents the position of the cursor after the target device last processed the first target document;

[0009] Determine the target position of the first placeholder in the first target document;

[0010] Display the first target document and show the cursor at the target location.

[0011] Secondly, this application provides a cursor control method applied to a target device, the method comprising:

[0012] Display the target document on the target device;

[0013] When a close and / or save operation of the target document is detected, the current position of the cursor in the target document is determined, a first placeholder is inserted at the current position, and the position is saved; and

[0014] The target document containing the first placeholder, along with the location information of the first placeholder, is sent to other cloud devices that are processing the target document.

[0015] Thirdly, this application provides a cursor control device applied to a target device, the device comprising:

[0016] The first document acquisition unit is used to acquire the first target document after receiving a document display instruction;

[0017] The first placeholder lookup unit is used to find a first placeholder associated with the target device in the first target document, wherein the first placeholder represents the position of the cursor after the target device last processed the first target document;

[0018] The first position determination unit is used to determine the target position of the first placeholder in the first target document;

[0019] The first cursor display unit is used to display the first target document and display the cursor at the target position.

[0020] Fourthly, this application provides a cursor control device applied to a target device, the device comprising:

[0021] The first target document display unit is used to display the target document on the target device;

[0022] The first placeholder saving unit is configured to, when a close and / or save operation of the target document is detected, determine the current position of the cursor in the target document, insert a first placeholder at the current position, and save the position; and

[0023] The first target document sending unit is used to send the target document containing the first placeholder, along with the location information of the first placeholder, to other cloud devices that are processing the target document.

[0024] Fifthly, this application provides a target device, comprising:

[0025] The processor is configured to, upon receiving a document display instruction, obtain a first target document; locate a first placeholder associated with the target device in the first target document, wherein the first placeholder represents the cursor position after the target device last processed the first target document; and determine the target position of the first placeholder in the first target document.

[0026] A display is used to show the first target document and to display a cursor at the target location.

[0027] Sixthly, this application provides a target device, comprising:

[0028] A display, used to show the target document on the target device;

[0029] The processor is configured to, upon detecting a close and / or save operation of the target document, determine the current position of the cursor in the target document, insert a first placeholder at the current position, and save the position; and

[0030] The communication module is used to send the target document containing the first placeholder, along with the location information of the first placeholder, to other cloud devices that are processing the target document.

[0031] In a seventh aspect, this application provides a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any cursor control method.

[0032] As can be seen from the above technical solutions, this application provides a cursor control method applied to a target device. After receiving a document display instruction, the method searches for a placeholder associated with the target device in the first target document. The placeholder indicates the position of the cursor after the target device last processed the first target document. By displaying the first target document and displaying the cursor at the aforementioned position in the first target document, the user can be clearly prompted to see where the most recently processed content in the document is located. Attached Figure Description

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

[0034] Figure 1 A flowchart of the cursor control method provided in this application;

[0035] Figure 2 An example diagram illustrating a scenario for updating the online documentation provided in this application;

[0036] Figure 3 Another flowchart of the cursor control method provided in this application;

[0037] Figures 4A to 4F Six scenario diagrams illustrating the cursor control method provided in this application;

[0038] Figure 5 Another flowchart of the cursor control method provided in this application;

[0039] Figure 6 A schematic diagram of the cursor control device provided in this application;

[0040] Figure 7 Another schematic diagram of the cursor control device provided in this application;

[0041] Figure 8 A schematic diagram of the hardware structure of the target device provided in this application;

[0042] Figure 9 Another hardware structure diagram of the target device provided in this application. Detailed Implementation

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

[0044] When editing a document on a computer, a cursor is displayed to indicate the location of the content being edited. However, in some situations, even if it is not the user's own editing action, the cursor position may change due to other operations, making it impossible for the current user to accurately determine which part of the content they are editing.

[0045] For example, one scenario is that the cursor is at a position other than the starting position before the document is closed, but returns to the starting position after the document is reopened. This prevents the user from being shown the position of the content being edited before the document was closed. This occurs because current computer devices use a storage unit to record the cursor position and an algorithm to calculate the new cursor position. For instance, the cursor position displayed on the computer device is stored in this storage unit. After the user inputs two characters through the computer device's input device, the computer retrieves the cursor position from this storage unit and adds 2 to get the latest cursor position. It's important to note that the value stored in the storage unit exists in memory simultaneously with the document; the value is lost when the document is closed. This type of document can be either offline or online.

[0046] Another scenario involves online documents. Online documents are documents that can be edited simultaneously or not by multiple computer devices. They are stored on a cloud server, and any computer device with access can download and process the document from the cloud server. Changes to the document content can be synchronized to other computer devices via the cloud server. In this scenario, a document on one computer device contains a cursor. After the document is updated, the cursor position may return to its initial position. Alternatively, after updating the document, the computer device may use the aforementioned algorithm to calculate the cursor position based on the updated content. For example, if the storage unit records the cursor's current position as after the 10th character, and the computer device parses the updated content and finds that two characters have been added before the 9th character, the computer device will perform a 10+2 calculation, resulting in the cursor being after the 12th character.

[0047] The cursor's position in a document can indicate the location of content to be processed by the user. However, in current cursor control methods, the cursor position may return to the starting position in some cases, thus losing its prompting function. Alternatively, the cursor position may need to be stored in a storage unit outside the document, which exists in memory and disappears after the document is closed, and cannot be permanently stored.

[0048] To address the aforementioned technical problems, this application provides a cursor control method that inserts placeholders into the document, the position of which indicates the cursor position. The placeholders are stored in the document and are saved as part of the document content when the document is saved. Furthermore, the placeholders are part of the document content and automatically change along with changes to other content in the document. It should be noted that the document can be any type of secondary text document.

[0049] See Figure 1 This illustrates the flow of a cursor control method provided in this application. This method is applied to a specific device, which can be referred to as the target device to distinguish it from other devices. Figure 1 As shown, the cursor control method may specifically include steps S101 to S104.

[0050] S101: After receiving the document display instruction, obtain the first target document.

[0051] When a target device needs to display a document, it receives a document display instruction. This instruction can be generated by the target device itself, or it can be based on instructions generated on the target device or from other devices. Different operations can correspond to different application scenarios.

[0052] For example, a user wants to open a document, whether it's an offline document or an online document stored in the cloud. The user can enter an open command on the target device, which will then generate a document display command and send it to the module within the target device that executes this method.

[0053] For example, if a target device can display online documents, and after receiving document updates from other devices, it needs to update the documents and display the updated documents, it can generate document display instructions.

[0054] For example, when the target device opens an online document using a browser, the user can refresh the document displayed in the browser. The refresh operation can trigger the target device to generate a document display command.

[0055] After receiving the document display instruction, the target device first obtains the document associated with the instruction. To distinguish it from the updated document described below, this document can be referred to as the first target document. It should be noted that this document can be an online document stored on a cloud server or an offline document stored locally on the target device.

[0056] S102: Locate the first placeholder associated with the target device in the first target document, where the first placeholder represents the position of the cursor after the target device last processed the first target document.

[0057] The first target document contains placeholders, each associated with a specific device. This device association indicates which device the placeholder represents. This device-placeholder mapping is particularly advantageous when the first target document is an online document. Online documents stored on cloud servers may be processed by multiple devices, each potentially handling the document differently. Therefore, different placeholders can represent the content processed by different devices, requiring each placeholder to be associated with a different device. To easily distinguish it from placeholders associated with other devices, the placeholder associated with the target device can be called the first placeholder.

[0058] It's important to note that placeholders are contained within the first target document; they are character tags within the document, but these tags are not displayed. For example, a document might contain a Enter key character tag, which is not displayed in the document when it's set to hidden mode. However, the Enter key character tag is included in the document and can be saved along with the document. The purpose of placeholders is to mark the cursor position, more specifically, to mark the cursor position after the device last processed the document. Because the first placeholder is associated with the target device, it records the cursor position after the target device last processed the first target document. In other words, the position of the first placeholder in the first target document represents the last position of the cursor.

[0059] One specific form of placeholder is the HyperText Markup Language (HTML) tag, for example, the placeholder is... The `` tag. Placeholders can be associated with devices in several ways, such as by including device information within the placeholder itself. When the placeholder is an HTML tag, the device information is contained within the placeholder's inline attributes, for example... <span data-user-info=”usera”> In this case, one way to find the first placeholder is to look for a placeholder tag containing device information for the target device in the first target document.

[0060] The first placeholder, as a character contained within the document, will change its position whenever any change in document content causes a movement in the cursor position. For example, deleting or adding content will change the cursor position, and consequently, the position of the first placeholder will also change. However, replacing content with the same number of characters will not change the cursor position, and therefore, the position of the first placeholder will remain unchanged. The first placeholder records the cursor position in real time; whenever the cursor position changes, the position of the first placeholder in the document also changes. Therefore, the first placeholder can represent the cursor position after the target device last processed the first target document.

[0061] It should be noted that the device associated with the placeholder can include a user. Specifically, the device information contained within the placeholder can include user information, and more specifically, the user information can be a user identifier such as the user's account on a cloud server. In this case, after the target device receives the document display instruction, it identifies the target user and searches for the placeholder associated with the target user in the first target document. One specific way to identify the target user is to determine which user is logged into the target device and then identify that user as the target user.

[0062] S103: Determine the target position of the first placeholder in the first target document.

[0063] The first placeholder is contained within the first target document, and it has its own location within that document. Once the first placeholder is located in the first target document, its position within that document can be directly determined; for ease of description, this position can be referred to as the target position.

[0064] S104: Display the first target document and show the cursor at the target location.

[0065] After displaying the first target document, a cursor can be added to it. Unlike existing technologies, this method does not directly add the cursor to the first position, but instead determines the target position based on the first placeholder and then displays the cursor at that target position.

[0066] As can be seen from the above technical solutions, this application provides a cursor control method applied to a target device. After receiving a document display instruction, the method searches for a placeholder associated with the target device in the first target document. The placeholder indicates the position of the cursor after the target device last processed the first target document. By displaying the first target document and displaying the cursor at the aforementioned position in the first target document, the user can be clearly prompted to see where the most recently processed content in the document is located.

[0067] In the above Figure 1 Based on the flow of the control method shown, the following steps A1 to A3 may also be included.

[0068] A1: Process the first target document according to the document display instructions to obtain the second target document.

[0069] As mentioned earlier, the document display instruction can be for offline documents or online documents. If it's for an offline document, the offline document will not be modified by other devices, and its content will not change. Therefore, processing the first target document according to the document display instruction can be specifically done by directly using the first target document as the second target document. If it's for an online document, since the content of the online document may change due to operations by other devices, processing the first target document according to the document display instruction can be specifically done by processing the first target document based on the changes made by other devices as indicated by the document display instruction, and then referring to the processed first target document as the second target document.

[0070] After receiving changes to the content of the first target document from other devices, the target device can treat these changes as its own changes to the first target document and directly add them to the first target document. Content changes mainly include three scenarios: adding, deleting, or modifying content in the first target document. Correspondingly, the processing of the first target document mainly involves adding, deleting, or modifying content within it. It should be noted that the online document processing procedure can be found in the following embodiments, which will not be elaborated upon here.

[0071] It should be noted that this step is not limited to being executed after step S102; it can also be executed before step S102, or simultaneously with step S102.

[0072] A2: Determine the target location of the first placeholder in the second target document.

[0073] In this context, the first placeholder represents its position in the first target document. However, the content of the first target document may or may not change when the second target document is created. If the first target document is directly used as the second target document, then the position of the first placeholder in the first target document can be directly used as its position in the second target document. If the first target document needs to be modified to become the second target document, and this modification may cause a change in the cursor position, then the position of the first placeholder in the second target document may change, requiring accurate determination of its position. For ease of description, the position of the first placeholder in the second target document can be referred to as the target position.

[0074] When the primary target document is an online document, changes made to it by other devices mainly fall into three categories: adding, deleting, or modifying the content of the primary target document. It is understood that if the added or deleted content follows the first placeholder associated with the target device, the position of the first placeholder will not change; if the added or deleted content precedes the first placeholder associated with the target device, the position of the first placeholder will change; if the modified content precedes the first placeholder associated with the target device and the number of characters in the modified content is different from the original, the position of the first placeholder will change; if the modified content follows the first placeholder associated with the target device and the number of characters in the modified content is the same as the original, the position of the first placeholder will not change.

[0075] In response to the various scenarios where the position of the first placeholder changes, it is necessary to determine the position of the first placeholder in the second target document after the change, based on the changes made to other devices. The specific determination method can be found in the following embodiments, which will not be elaborated here.

[0076] A3: Displays the second target document and shows the cursor at the target location.

[0077] Displaying a second target document in the application can also be considered as displaying the first target document with updated content. For example, if the second target document is the first target document, displaying the second target document means directly opening the first target document. Alternatively, if the second target document is a document with updated content based on the first target document, displaying the second target document could mean adding the updated content to the displayed first target document, or simply displaying the second target document directly.

[0078] After displaying the second target document, a cursor is displayed at the target location in the second target document to indicate the position of the content to be processed within the document. It should be noted that a placeholder is a hidden character tag in the document; the cursor can appear either before or after this character tag.

[0079] As can be seen from the above technical solutions, this application provides a cursor control method applied to a target device. Upon receiving a document display instruction, the method searches for a placeholder associated with the target device in a first target document. This placeholder indicates the cursor position after the target device last processed the first target document. The cursor position indicates the location of the content to be processed in the first target document. The first target document is processed to obtain a second target document, and the position of the placeholder is determined in the second target document. The determined position indicates the location of the content to be processed in the first target document within the second target document. Displaying the second target document and placing the cursor at the specified position in the second target document indicates the location of the content to be processed in the original document within the new document.

[0080] The following details the application scenarios for online documents. For example... Figure 2 As shown, the cloud server is connected to multiple user devices. The target document is stored on the cloud server. Any user device can download the target document from the cloud server, update the content of the target document, and upload the updated content to the cloud server. The cloud server can then forward the updated content to other user devices.

[0081] See Figure 3 This illustrates a flow chart of a cursor control method provided in this application, which is applied to any user device, which may be referred to as the target device. Figure 3 As shown, the process can specifically include steps S301 to S305.

[0082] S301: After receiving the document display instruction, obtain the first target document.

[0083] The target device can display a first target document and receive content updates to the first target document from other devices via a cloud server. The target device can receive these content updates and use the instructions containing them as document display instructions. Upon receiving the document display instructions, the target device can retrieve the first target document according to the instructions.

[0084] Alternatively, the user can input an open command for the first target document on the target device. The target device then generates a document display command based on this command and obtains the first target document pointed to by the open command. It should be noted that an open command can take many forms. For example, opening the first target document on a specific page is one form of open command; opening another first target document on a different page while simultaneously opening one first target document on another page is also a form of open command; refreshing a page containing an open first target document can also be considered a form of open command.

[0085] The target device may have a first target document pre-stored locally. The first target document may be obtained from the target device or downloaded from a cloud server.

[0086] S302: Locate the first placeholder associated with the target device in the first target document, where the first placeholder represents the position of the cursor after the target device last processed the first target document.

[0087] For details regarding this step, please refer to the above. Figure 1 The explanations in the text are not repeated here.

[0088] S303: If the document display instruction contains content change information for the first target document, then update the first target document according to the content change information to obtain the second target document.

[0089] The document display instruction can be generated by the target device based on content update information sent by other devices. The document display instruction can contain content change information. Therefore, this step can extract the content change information in the document display instruction and use the content change information to update the first target document.

[0090] Specifically, content change information refers to any changes made to the first target document by other devices. These changes can include additions, deletions, and modifications.

[0091] For example Figure 4AAs shown, the first target document displayed on the target device contains the content ABCDEFGH, a total of 8 characters. Other devices can also display the first target document. If other devices delete the characters AB and send the deletion of characters AB to the target device in the content change information, the target device will delete the characters AB and obtain the second target document.

[0092] For example Figure 4B As shown, the first target document displayed on the target device is... Figure 4A Similarly, if another device enters the number 7 before the character A and sends the added character to the target device, the target device will add the number 7 before the character A in the first target document to obtain the second target document.

[0093] For example Figure 4C As shown, the first target document displayed on the target device is... Figure 4A Similarly, if another device enters the number 7 after the character H and sends the entered number to the target device, the target device will add the number 7 after the character H in the first target document to obtain the second target document.

[0094] For example Figure 4D As shown, the first target document displayed on the target device is... Figure 4A Similarly, if another device replaces the character EF with the character MM and sends the replacement character to the target device, the target device will replace the character EF with the character MM in the first target document to obtain the second target document.

[0095] For example Figure 4E As shown, the first target document displayed on the target device is... Figure 4A Similarly, if another device replaces the character EF with the character GOOD and sends the replacement character to the target device, the target device will replace the character EF with the character GOOD in the first target document to obtain the second target document.

[0096] For example Figure 4F As shown, the first target document displayed on the target device is... Figure 4A Similarly, if another device replaces the character EF with the character G and sends the replacement character to the target device, the target device will replace the character EF in the first target document with the character G to obtain the second target document.

[0097] It should be noted that the above Figures 4A to 4F In the center, the vertical line represents the cursor. Furthermore, the above examples are merely illustrations; other existing change methods can also be used, and this is not a specific limitation.

[0098] Therefore, when the target device modifies the first target document based on the content change information, the change can be regarded as a change input from its own input device. The first target document can be modified in the same way as a change input from its own input device.

[0099] S304: Determine the position of the changed content contained in the content change information in the first target document, and determine the target position of the first placeholder in the second target document based on the relationship between the position of the changed content and the position of the first placeholder.

[0100] Specifically, determining the location of the changed content within the first target document, as contained in the content change information, can be achieved by having the target device directly extract that location from the content change information if the content change information contains the location of the changed content within the first target document. For example, as described above... Figure 4A In this context, other devices can add location information 1 and 2 to the content change information to indicate the positions of the deleted characters A and B; as mentioned above. Figure 4B In this context, other devices can add location information 1 to the content change information to indicate the position of the added number 7; as mentioned above. Figure 4C In this context, other devices can add location information 8 to the content change information to indicate the position of the added number 7; as mentioned above. Figure 4D , 4E In addition to 4F, other devices can add position information 5 and 6 to the content change information to indicate the position of the replaced character.

[0101] Once the location of the changed content in the first target document is determined, the location of the first placeholder in the second target document can be determined based on the relationship between the location of the changed content and the location of the first placeholder. For ease of description, this location can be referred to as the target location.

[0102] Specifically, the position of the first placeholder is the cursor position in the first target document. The position of the changed content may be before, after, or at the same position as the first placeholder. These three cases are explained in detail below.

[0103] In the first scenario, if the changed content includes target changed content located before the first placeholder, the position of the first placeholder is changed according to the target changed content to obtain the target position of the first placeholder in the second target document. Specifically, the changed content may contain multiple changed content items, which may be located in multiple different positions, such as adding two items in the first paragraph and two in the second paragraph. For ease of description, the changed content located before the first placeholder can be referred to as the target changed content. If the content change information sent by other devices contains the target changed content, the position of the first placeholder can be changed according to the target changed content. The method of changing the first placeholder may also differ depending on the specific form of the target changed content.

[0104] For example, if the target change is to delete several characters, then the position of the first placeholder will be shifted forward by the distance of those several characters, such as... Figure 4A In the scenario shown, the first placeholder (represented by the dashed box in the illustration) is moved forward two positions. Similarly, if the target change is to add several characters, the first placeholder is moved backward by the distance of those characters. Figure 4B In the scenario shown, the first placeholder (represented by the dashed box in the illustration) is moved one position to the right. Similarly, if the target change is to replace several characters, the position of the first placeholder is moved based on the number of characters before and after the replacement. Figure 4D In the scenario shown, the position of the first placeholder (represented by the dashed box in the illustration) remains unchanged, as follows: Figure 4E In the scenario shown, the first placeholder (represented by the dashed box in the illustration) is moved two positions to the right, as follows: Figure 4F In the scenario shown, the position of the first placeholder (represented by the dashed box in the illustration) is moved forward by one position.

[0105] In the second scenario, if the changed content includes content following the position of the first placeholder, then the position of the first placeholder in the first target document will be directly used as its position in the second target document. This same treatment applies regardless of whether the changed content involves deletion, addition, or replacement. For example... Figure 4C In the scenario shown, the position of the first placeholder (represented by the dashed box in the illustration) remains unchanged.

[0106] In the third case, if the content includes changes that occur after the first placeholder, the position of the changes can be determined first as before or after the first placeholder, and then processed according to the first or second method described above.

[0107] S305: Display the second target document and show the cursor at the target location.

[0108] For details regarding this step, please refer to [link / reference]. Figure 1 The explanation of step A3 is not repeated here.

[0109] As can be seen from the above technical solutions, this embodiment details the case where the first target document is an online document. Specifically, the target device can receive changes to the first target document sent by other devices. If the position of the changed content is before the position of the first placeholder, the position of the first placeholder in the first target document is changed. This is because the position of the first placeholder represents the position of the cursor added by the target device in the first target document. If the changes made by other devices to the content of the first target document are before this position, the position of the cursor will inevitably change. Therefore, it is necessary to redetermine the position of the first placeholder based on the changed content and redisplay the cursor based on this position. The cursor displayed in the changed first target document (i.e., the second target document) can indicate to the user where the previous processing position was, thus facilitating the user to continue processing at that position.

[0110] When the document is an online document, the target device can display not only its cursor position after its most recent processing of the document, but also the positions of processing operations performed by other devices on the document. See [link / reference]. Figure 5 This illustrates another step in the cursor control method provided in this application, which is... Figure 3 Based on the method embodiment shown, steps S306 to S308 may also be included. It should be noted that the following description only addresses the method with respect to... Figure 3 The different steps in the method embodiments shown are described above. For the same steps, please refer to the description in the above method embodiments, which will not be repeated here. In addition, steps S306 to S308 are not limited to after step S305, and can also be performed after step S303.

[0111] S306: If the content change information contains a second placeholder associated with another device, determine the target position of the second placeholder in the second target document; wherein the second placeholder represents the position of the cursor after the other device last processed the first target document.

[0112] The content change information uploaded by other devices to the cloud server may also include a placeholder associated with that other device. To distinguish it from the first placeholder, this placeholder can be called the second placeholder. Other devices also process the first target document, and the second placeholder is identical to the first, representing the cursor position after the most recent processing of the first target document. However, the difference is that the second placeholder is associated with other devices, thus representing the cursor position after the most recent processing of the first target document by those other devices. It should be noted that "most recent" can also refer to the time when the content change information is sent; therefore, the second placeholder can also be considered to represent the cursor position after the last change processed within the content change information.

[0113] For example, the changes included in the content change information sent by other devices include... Figure 4A The deleted characters A and B in the text also include Figure 4C In the example, enter the number 7 after the character H. If the target device performs the first change first and then the second change, the second placeholder will be positioned after the number 7; if the target device performs the second change first and then the first change, the second placeholder will be positioned before the character C. It should be noted that these are merely two illustrative examples. The changes performed by other devices can be other changes in the prior art, and the cursor position will be set accordingly, as will the position of the second placeholder.

[0114] The content change information sent by other devices may include a second placeholder. After receiving the content change information, the target device can extract the placeholder and determine which other device the placeholder is associated with based on the device information associated with the placeholder. Therefore, in this way, the target device can identify the placeholder in the content change information and its associated other devices.

[0115] After obtaining the second placeholder, the target device needs to determine its position within the second target document. Specifically, the second placeholder represents the cursor position after the most recent processing of the first target document by other devices. The processing content of the first target document by other devices, including the most recent processing content, is sent to the target device. The target device then modifies the first target document based on this processing content, resulting in the second target document. The second target document obtained by the target device is identical to the document processed by other devices on the first target document. Therefore, the position represented by the second placeholder can be directly used as its position within the second target document.

[0116] by Figure 4A Taking the example given, if the second placeholder is located before the character 'C', then that location can be directly determined as the position of the second placeholder in the second target document. Figure 4B and Figure 4C Taking the example given, if the second placeholder is recorded after the number 7, then that position can be directly determined as the location of the second placeholder in the second target document. Figure 4D Taking the example given, if the position of the second placeholder is after the character MM, then that position can be directly determined as the position of the second placeholder in the second target document. Figure 4E Taking the example given, if the position recorded by the second placeholder is after the character GOOD, then this position can be directly determined as the position of the second placeholder in the second target document. Figure 4F In the example given, if the position of the second placeholder is after the character G, then that position can be directly determined as the position of the second placeholder in the second target document.

[0117] S307: Generate device display elements for other devices.

[0118] Among them, the corresponding device display elements are determined for other devices. The device display elements are used to indicate to the user which device the other device is. Therefore, the device display elements include the device information of the other device, such as the device name of the other device, or the account of the user logged in on the other device, or the avatar of the user logged in on the other device, etc.

[0119] S308: Display device display elements according to the target position of the second placeholder.

[0120] The second placeholder indicates the cursor's position in the document. If the device display element is directly placed at the cursor's location, it may obscure the document content behind the cursor. For example, if the device display element is a user avatar, the target position of the second placeholder would be... Figure 4A If the user's avatar is displayed at the cursor position before the character C, the area occupied by the user's avatar may obscure the character C or even the subsequent document content.

[0121] Therefore, the location of the device display element can be determined based on the target position of the second placeholder. One method is to offset the target position towards a blank space in the document, such as moving it above or below the document content, until it reaches the blank space between two lines of content, thus obtaining the location of the device display element. The device display element is then displayed at the determined location to indicate to the user of the target device which part of the document other devices are currently processing.

[0122] The following details how to add placeholders in a document. Both the first and second placeholders can be added in the following way. Specifically:

[0123] If no placeholder exists in the document, the cursor position is determined, and a device-associated placeholder is added immediately after the cursor. If a placeholder exists in the document and the cursor position changes, a device-associated placeholder is added immediately after the cursor, depending on the type of cursor position change. The position of the first placeholder in the document represents the cursor position.

[0124] Specifically, the device can listen for input events. If the input event is one that changes the cursor position, such as deletion, addition, character count change replacement, or selection, it first checks if a placeholder exists in the document. If not, it adds a placeholder to the document based on the input event. If a placeholder exists, it modifies its position based on the input event. It should be noted that modifying the placeholder's position can also be considered a specific way of adding a placeholder.

[0125] If no placeholders exist in the document (which may be a newly opened document), one way to add placeholders is to first determine the cursor position in the document, and then add the placeholder after the cursor. For example, if the cursor is after the first character of the first paragraph, the placeholder can be added at the position of the second character of the first paragraph. However, it should be noted that the placeholder is hidden, so the user will not see it in the document.

[0126] If the cursor position changes and placeholders exist in the document, and this document has been opened and an operation allowing cursor position changes has been performed, then it's necessary to determine the type of cursor position change and add a placeholder immediately after the changed position in the document. Specifically, cursor position change types can include two categories: a blinking cursor and a cursor when document content is selected. For the first type, simply add a placeholder after the cursor. For the second type, determine the start and end positions of the selected content, add a placeholder before the start position, and add another placeholder after the end position, forming a placeholder pair.

[0127] It should be noted that, following the above method, multiple placeholders may be added in a document. In order to distinguish each placeholder, the addition time of the placeholder can be recorded at the same time. When displaying the cursor position according to the placeholder, the cursor can be displayed at the position of the placeholder based on the addition time. For example, the placeholder with the latest addition time can be identified, and the cursor can be displayed at the position of the placeholder with the latest addition time.

[0128] However, the above method retains a large number of placeholders, resulting in more redundant data in the document and occupying more storage space. To further address this technical issue, existing placeholders can be deleted when a new placeholder is added. Specifically, before adding a placeholder immediately after the cursor changes position, existing placeholders are deleted. In this method, every time a new placeholder is added, the existing one is deleted, ensuring that there is always one placeholder in the document.

[0129] The added placeholders are associated with the device. Specifically, device information can be obtained, an association can be established between the device information and the placeholder, and this association can be saved in the document. One specific form of a placeholder is a placeholder tag, and correspondingly, one specific way to establish an association between device information and a placeholder is to add device information to the inline attributes of the placeholder tag.

[0130] When a placeholder is added, it is stored in the document when the document is saved. The position of the placeholder in the document is used to indicate the position of the cursor in the document. In this way, after the placeholder is saved as part of the document, the placeholder will have a natural position in the document. This position is used to record the position of the cursor in the document before the document is closed. So when the document is opened again by this device or by another device, the cursor in the document can be restored or restored according to the position of the placeholder in the document.

[0131] In practical applications, this application also provides a cursor control method applied to a target device. First, the method displays a target document on the target device and listens for any closing and / or saving operations on the target document. If a closing and / or saving operation on the first target document is detected, the current position of the cursor in the target document is determined, and a first placeholder is inserted at the current position and its position is saved. Then, the target document containing the first placeholder, along with the position information of the first placeholder, is sent to other cloud devices processing the target document, so that the other cloud devices can display the cursor based on the position information of the first placeholder in the target document. For specific display methods, please refer to the above. Figure 1 The descriptions in the embodiments are not repeated here.

[0132] The target document can be an online document, and both the target device and other cloud devices can edit and process it. The target device can insert placeholders into the target document, and other cloud devices may also insert placeholders. The placeholders inserted by the target device can be referred to as the first placeholders, and the placeholders inserted by other cloud devices can be referred to as the second placeholders.

[0133] Other cloud devices can send information about the inserted second placeholder, such as its position in the target document and its insertion time, to the target device. Once the target device receives this information, it can further determine the order in which the first and second placeholders were inserted, and based on this order, determine the order in which the target device and other cloud devices edited the target document.

[0134] If the first placeholder is inserted before the second placeholder, it indicates that after the target device edited the target document, other cloud devices also edited the target document. Therefore, the position of the first placeholder is updated based on the position of the second placeholder in the target document. Specifically, if the second placeholder is before the first placeholder, the target document is updated based on the content change information corresponding to the second placeholder sent by other cloud devices, and the position of the first placeholder in the updated target document is determined. The specific implementation process can be found in the above explanation and will not be repeated here. If the second placeholder is after the first placeholder, the position of the first placeholder remains unchanged.

[0135] If the first placeholder is inserted later than the second placeholder, it means that other cloud devices edited the target document earlier than the target device, and the position of the first placeholder remains unchanged.

[0136] In practical applications, this application also provides a cursor control method. This method is applied to a target device. First, a first target document is displayed. Then, it listens for content change events related to the first target document. If a change event is detected, the current cursor position is determined, and a placeholder containing information about the target device is added to the current cursor position. For details regarding document content change events and cursor positions, please refer to the description of the placeholder generation process above; it will not be repeated here. When preset conditions are met, such as when the upload time requirement is met or when the user triggers the upload button, the target device sends the content change event containing the placeholder to other devices processing the first target document. Broadcasting the content change event to other devices associated with the target device is part of the document's content change mechanism. That is, after the document content changes, it needs to be synchronized to other devices processing the document. The content change event includes a placeholder, and since adding a placeholder to the document is also part of the content change event, the document naturally includes the placeholder in the content change event and broadcasts it to other devices. The specific requirement that this application mainly addresses is that the position of the last processed document can be reproduced after the document is reprocessed. For example, if a document is closed and reopened on the same device, the cursor can be restored to its most recently processed position. Or, if a document being processed on one device needs to be displayed on another device, the position of the document being processed can be displayed on the other device in real time.

[0137] Application scenarios with this specific need can be varied, including but not limited to code development. In code development, multiple people typically collaborate on the process. Each participant processes the relevant documents, and the processed documents are then broadcast to other participants' devices via a server. To prevent duplicate editing, each participant needs to understand the current editing position within the document, requiring real-time broadcasting of their editing location. To meet this need, this application uses the cursor position, which in turn is represented by placeholders within the document. These placeholders, as part of the document content update, are broadcast to other devices during the content update broadcast mechanism. Once other participants' devices locate the placeholders in the content update, they can determine the cursor position based on the placeholder's location within the document, displaying the cursor at that position to indicate the current editing location.

[0138] It should be noted that the documents in this application are not limited to being processed by users; they can also be processed by artificial intelligence. Therefore, the entire process of editing the documents and controlling the cursor can be achieved by artificial intelligence.

[0139] See Figure 6 It illustrates the structure of a cursor control device provided in this application, which is applied to a target device, such as... Figure 6 The device shown includes: a first document acquisition unit 601, a first placeholder search unit 602, a first position determination unit 603, and a first cursor display unit 604.

[0140] The first document acquisition unit 601 is used to acquire the first target document after receiving a document display instruction;

[0141] The first placeholder lookup unit 602 is used to look up a first placeholder associated with the target device in the first target document, wherein the first placeholder represents the position of the cursor after the target device last processed the first target document;

[0142] The first position determination unit 603 is used to determine the target position of the first placeholder in the first target document;

[0143] The first cursor display unit 604 is used to display the first target document and display the cursor at the target position.

[0144] In one example, the cursor control device further includes: a second document generation unit, a second position determination unit, and a second cursor display unit.

[0145] The second document generation unit is used to update the first target document according to the content change information when it is detected that the document display instruction contains content change information of the first target document, so as to obtain the second target document.

[0146] The second position determination unit is used to determine the target position of the first placeholder in the second target document; and

[0147] The second cursor display unit is used to display the second target document and display the cursor at the target position in the second target document.

[0148] In one example, the second position determination unit includes: a content change position determination subunit and a second position determination subunit.

[0149] The content change location determination subunit is used to determine the location of the changed content contained in the content change information in the first target document;

[0150] The second position determination subunit is used to determine the target position of the first placeholder in the second target document based on the relationship between the position of the changed content and the position of the first placeholder in the first target document.

[0151] In one example, the second position determination subunit includes: a second position determination submodule.

[0152] The second position determination submodule is used to change the position of the first placeholder according to the target change content if the changed content contains target changed content located before the position of the first placeholder, so as to obtain the target position of the first placeholder in the second target document.

[0153] In one example, the cursor control device may further include: a second placeholder determination unit, a display element determination unit, and a display element display unit.

[0154] The second placeholder determination unit is configured to determine the target position of the second placeholder in the second target document if the content change information contains a second placeholder associated with other devices; wherein the second placeholder represents the cursor position after the other device last processed the first target document;

[0155] A display element determination unit is used to generate device display elements for the other devices; and

[0156] The display element display unit is used to display the device display element according to the target position of the second placeholder.

[0157] In one example, the cursor control device may also include a first placeholder generation unit.

[0158] The first placeholder generation unit is used to generate the first placeholder in the first target document;

[0159] The first placeholder generation unit specifically includes: a first adding subunit, a second adding subunit, and a storage subunit.

[0160] The first adding subunit is used to determine the position of the cursor in the first target document if the first placeholder does not exist in the first target document, and add the first placeholder associated with the target device in the first target document at a position immediately after the cursor.

[0161] The second adding subunit is used to add the first placeholder associated with the target device in the first target document immediately after the cursor changes, based on the type of cursor position change, if a first placeholder exists in the first target document and the cursor position changes.

[0162] The storage subunit is used to store the first placeholder in the first target document when storing or closing the first target document.

[0163] In one example, the first placeholder generation unit further includes a deletion subunit.

[0164] Before adding the first placeholder associated with the target device in the first target document immediately after the cursor change, the existing first placeholder is identified and deleted.

[0165] See Figure 7 This application also provides a cursor control device applied to a target device. For example... Figure 7 As shown, the device specifically includes: a first target document display unit 701, a first placeholder storage unit 702, and a first target document sending unit 703.

[0166] The first target document display unit 701 is used to display the target document on the target device;

[0167] The first placeholder saving unit 702 is used to determine the current position of the cursor in the target document when a close and / or save operation of the target document is detected, insert a first placeholder at the current position, and save the position; and

[0168] The first target document sending unit 703 is used to send the target document containing the first placeholder, along with the location information of the first placeholder, to other cloud devices that are processing the target document.

[0169] In one example Figure 7 The cursor control device shown may further include: a second placeholder receiving unit and a first placeholder updating unit.

[0170] The second placeholder receiving unit is used to receive second placeholder information of the target document sent by the other cloud device. The second placeholder information includes at least the position of the second placeholder in the target document and the insertion time.

[0171] The first placeholder update unit is used to update the position of the first placeholder according to the position of the second placeholder in the target document when the insertion time of the first placeholder is earlier than the insertion time of the second placeholder.

[0172] In one example, the cursor control device described above may further include: a first placeholder maintaining unit.

[0173] The first placeholder maintenance unit is used to maintain the position of the first placeholder when the insertion time of the first placeholder is later than the insertion time of the second placeholder.

[0174] The hardware structure of the target device provided in this application is described below. Figure 7 A schematic diagram of the hardware structure of the target device provided in this application. See Figure 8 The device may include: a processor 801, a memory 802, a display 803, and a communication bus 804.

[0175] The processor 801, memory 802, and display 803 communicate with each other via the communication bus 804.

[0176] Processor 801 is used to execute programs, which may include program code, including operation instructions for the processor. Specifically, the program may be used for:

[0177] Upon receiving a document display instruction, a first target document is obtained; a first placeholder associated with the target device is located in the first target document, wherein the first placeholder represents the cursor position after the target device last processed the first target document; and the target position of the first placeholder in the first target document is determined.

[0178] The processor 801 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.

[0179] Memory 802 is used to store programs; memory 802 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage.

[0180] Display 803 is used to display the first target document and display a cursor at the target location.

[0181] Figure 9 A schematic diagram of another hardware structure for the target device provided in this application. See Figure 9 The device may include: a display 901, a memory 902, a processor 903, a communication module 904, and a communication bus 905.

[0182] The display 901, memory 902, processor 903, and communication module 904 communicate with each other via communication bus 905.

[0183] Display 901 is used to display the target document on the target device.

[0184] Processor 903 is used to execute programs, which may include program code, including operation instructions for the processor. Specifically, the program may be used for:

[0185] When a close and / or save operation of the target document is detected, the current position of the cursor in the target document is determined, a first placeholder is inserted at the current position, and the position is saved.

[0186] The processor 903 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.

[0187] Memory 902 is used to store programs; memory 902 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage.

[0188] The communication module 904 is used to send the target document containing the first placeholder, along with the location information of the first placeholder, to other cloud devices that are processing the target document.

[0189] This application also provides a readable storage medium storing a plurality of instructions adapted for loading by a processor to execute the steps related to the above-described cursor control method.

[0190] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

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

[0192] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A cursor control method, characterized in that, Applied to a target cloud device, the method includes: Displays the first online document stored in the cloud, which is code developed collaboratively by multiple people and includes multiple characters; Listen for input events; when the input event is an event that changes the cursor position, If there is no placeholder in the first online document, then according to the input event, add the first placeholder associated with the target cloud device in the first online document at the position immediately adjacent to the cursor; If the first placeholder exists in the first online document, the position of the first placeholder is modified according to the input event. The input event includes at least one of the following: deleting a character, adding a character, replacing a character with a change in the number of characters, and selecting a character. When a character is selected, a placeholder is added before the start position and another placeholder is added after the end position. When storing the first online document, the first placeholder is saved as a hidden character tag in the first online document, so that the first placeholder has a position in the first online document, which is used to record the position of the cursor before closing the first online document; When the document-based content update broadcast mechanism triggers an upload, the first placeholder is used as the first content update information and broadcast to other cloud devices through the cloud server. The system also receives content change information for the first online document sent by the other cloud devices. The content change information includes the position and insertion time of the second placeholder associated with the other cloud devices. Based on the content change information, update the first online document to obtain the second online document; Display the second online document and show the cursor at the target position of the first placeholder; For the other cloud devices, generate device display elements; and, Move the second placeholder to the blank space between the two lines of content to obtain the location of the device display element, and display the device display element to indicate to the user of the target cloud device which part of the first online document the other cloud device is currently processing.

2. A cursor control device, characterized in that, Applied to a target cloud device, the device includes: The first document acquisition unit is used to display the first online document stored in the cloud. The first online document is code developed collaboratively by multiple people and includes multiple characters. The first placeholder lookup unit is used to listen for input events. When the input event is an event that changes the cursor position, if there is no placeholder in the first online document, then according to the input event, a first placeholder associated with the target cloud device is added in the first online document at a position immediately adjacent to the cursor. If there is a first placeholder in the first online document, then according to the input event, the position of the first placeholder is modified. The input event includes at least one of: deleting a character, adding a character, replacing a character with a change in the number of characters, and selecting a character. When selecting a character, a placeholder is added before the start position and another placeholder is added after the end position. When storing the first online document, the first placeholder is saved as a hidden character tag in the first online document, so that the first placeholder has a position in the first online document, which is used to record the cursor position before closing the first online document. The first target document sending unit is used to broadcast the first placeholder as the first content update information to other cloud devices through the cloud server when the upload is triggered by the document-based content update broadcast mechanism. The second placeholder receiving unit is used to receive content change information of the first online document sent by the other cloud device, wherein the content change information includes the position and insertion time of the second placeholder associated with the other cloud device; The second document generation unit is used to update the first online document according to the content change information to obtain the second online document; The second cursor display unit is used to display the second online document and display the cursor at the target position of the first placeholder; The display element determination unit is used to generate device display elements for the other cloud devices; and, The display element unit is used to move the position of the second placeholder to the blank space between two lines of content to obtain the position of the device display element, and display the device display element to prompt the user of the target cloud device which part of the first online document the other cloud device is currently processing.

3. A cloud device, characterized in that, include: The processor is used to listen for input events. When the input event is an event that changes the cursor position, if there is no placeholder in the first online document, then according to the input event, a first placeholder associated with the cloud device is added in the first online document at a position adjacent to the cursor. The first online document is code developed collaboratively by multiple people and includes multiple characters. If the first placeholder exists in the first online document, the position of the first placeholder is modified according to the input event, which includes at least one of: deleting a character, adding a character, replacing characters with varying numbers of occurrences, and selecting a character. Specifically, when a character is selected, a placeholder is added before the start position and another placeholder is added after the end position. When storing the first online document, the first placeholder is saved as a hidden character tag within the document, ensuring that the first placeholder has a position within the document. This position is used to record the cursor position before closing the first online document. When an upload is triggered by a document-based content update broadcast mechanism, the first placeholder is used as the first content update information and broadcast to other cloud devices via the cloud server. The system also receives content change information for the first online document from the other cloud devices, where the content change information includes the position and insertion time of the second placeholder associated with the other cloud device. Based on the content change information, the first online document is updated to obtain a second online document. A device display element is generated for the other cloud devices. Finally, the position of the second placeholder is moved to a blank space between two lines of content to obtain the position of the device display element. A display is used to show the first online document; to show the second online document and to show a cursor at the target position of the first placeholder; and to show the device display element to indicate to the user of the cloud device which part of the first online document the other cloud device is currently processing.

4. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the cursor control method as described in claim 1.