Content continuous writing method and device, equipment and storage medium
By dynamically acquiring and executing continuation content during the writing process, the problem of neglecting user initiative in existing technologies is solved, thereby enhancing user creativity and writing experience.
Patent Information
- Application Number
- CN202410902105.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-05
- Publication Date
- 2026-01-06
AI Technical Summary
Existing assisted writing methods request large AI models to generate all the content the user needs before writing, ignoring the user's subjective initiative during the writing process and reducing the user's creativity.
A content continuation writing method is provided, which dynamically obtains continuation content and display instructions based on the target content being processed and the continuation writing position, and executes the content continuation writing task at the continuation writing position to dynamically generate content to cooperate with the user's writing process.
It enhances users' initiative and creativity in the writing process, allowing them to process content while referring to and continuing existing content, dynamically generating content to meet their writing needs.
Smart Images

Figure CN121279263A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a content continuation method, apparatus, device, and storage medium. Background Technology
[0002] With the rapid development of artificial intelligence (AI) technology, large-scale AI models are experiencing explosive growth. Currently, these models offer diverse functions and can be applied to various fields, such as writing, video production, and art. In writing, large-scale AI models can be used for writing assistance, such as in official document writing, copywriting, and novel writing. Utilizing large-scale AI models for writing assistance can help users improve writing efficiency, reduce writing pressure, and stimulate their writing ideas.
[0003] Current assisted writing methods require users to first summarize the content theme, structure, and any specific requirements. These are then input into a corresponding input box in an AI model, which generates the desired content. Users can then paste this content into their personal document. Therefore, current assisted writing methods request the AI model to generate all the required content before writing begins. However, this pre-generated content ignores the user's active role in the writing process, limiting their thinking to the pre-generated content and reducing their creativity. Summary of the Invention
[0004] This application provides a content continuation method, apparatus, device, and storage medium to address the problem that existing assisted writing methods request large artificial intelligence models to generate all the content needed by the user before writing, ignoring the user's subjective initiative during the writing process.
[0005] To address the aforementioned technical problems, the technical solution of this application is provided through the following embodiments:
[0006] This application provides a content continuation writing method, including: obtaining continuation writing content and display instructions corresponding to the target content at the continuation writing position based on the target content currently being processed and the continuation writing position; obtaining the continuation writing content corresponding to the continuation writing position based on the display instructions; and performing a content continuation writing task at the continuation writing position based on the continuation writing content corresponding to the continuation writing position.
[0007] The step of obtaining the continuation content and display instruction corresponding to the continuation position of the target content based on the currently being processed target content and the continuation position includes: when the target content changes, obtaining the continuation content and display instruction corresponding to the continuation position of the changed target content based on the changed target content and the continuation position.
[0008] Wherein, when the target content changes, based on the changed target content and the continuation position, obtaining the continuation content and display instruction corresponding to the changed target content at the continuation position includes: obtaining first information generated based on the target content processed at a first time; generating second information based on the target content processed at a second time; wherein the first time is earlier than the second time; if the first information and the second information are different, determining that the target content has changed, and obtaining the continuation content and display instruction corresponding to the changed target content at the continuation position based on the changed target content and the continuation position.
[0009] Specifically, when the target content changes, the method for obtaining the continuation content and display instructions corresponding to the continuation position of the changed target content, based on the changed target content and the continuation position, includes: detecting content processing operations and cursor change events during the processing of the target content; generating content processing operation information based on the content processing operation and its operation object for each detected content processing operation; generating continuation position information based on the continuation position corresponding to the cursor change event for each detected cursor change event; and obtaining the continuation content and display instructions corresponding to the continuation position of the target content based on the content processing operation information and / or the continuation position information.
[0010] Specifically, for each detected content processing operation, content processing operation information is generated based on the content processing operation and its target, including: when the content processing operation is detected as a deletion operation, determining the content to be deleted in the target content and the start and end positions of the deleted content, and using the identifier corresponding to the deletion operation and the start and end positions of the deleted content as the content processing operation information; when the content processing operation is detected as an update operation, determining the updated content in the target content and the start and end positions of the updated content, and using the identifier corresponding to the update operation, the updated content, and the start and end positions of the updated content as the content processing operation information.
[0011] The step of obtaining the continuation content corresponding to the continuation position according to the display instruction includes: obtaining the cached continuation content corresponding to the continuation position according to the display instruction corresponding to the continuation position at the continuation position; or, obtaining the continuation content corresponding to the continuation position in real time according to the display instruction corresponding to the continuation position at the continuation position.
[0012] The step of obtaining the cached continuation content corresponding to the continuation position according to the display instruction corresponding to the continuation position includes: extracting the continuation position of the content continuation task to be executed from the display instruction; and obtaining the continuation content corresponding to the continuation position of the content continuation task to be executed from the cache space when the current continuation position is the same as the continuation position of the content continuation task to be executed.
[0013] The step of obtaining the continuation content corresponding to the continuation position in the cache includes: if the continuation content corresponding to the continuation position is not obtained in the cache space, waiting for the continuation content corresponding to the continuation position to be cached until the continuation content corresponding to the continuation position is obtained or a change in the continuation position is detected.
[0014] The step of obtaining the continuation content corresponding to the continuation position in the cache includes: if the continuation content corresponding to the continuation position is not obtained in the cache space, determining a target continuation position in the cache space that is before and closest to the continuation position, and obtaining the continuation content corresponding to the target continuation position; if the length of the content that can be accommodated between the continuation position and the target continuation position is less than the length of the continuation content, obtaining a first content located between the continuation position and the target continuation position and obtaining a second content located after the continuation position from the target content; if the first content matches the continuation content and the second content does not match the continuation content, extracting the content after the length of the content that can be accommodated from the continuation content as the continuation content corresponding to the continuation position.
[0015] Before obtaining the continuation content corresponding to the continuation position in the cache, the method further includes: for the continuation position, if the continuation content corresponding to the continuation position is already stored in the cache space, using the newly generated continuation content to overwrite the continuation content already stored in the cache space.
[0016] The method further includes: detecting a content processing operation before executing the content continuation task at the continuation position; determining the continuation position corresponding to the content processing operation after detecting the content processing operation; deleting the continuation content corresponding to the continuation position after the continuation position in the cache space; or, during the execution of the content continuation task at the continuation position, if a continuation cancellation event is detected, or if a continuation function closure request is received, stopping the execution of the content continuation task and deleting the continuation content corresponding to the continuation position after the continuation position in the cache space; or, after executing the content continuation task at the continuation position, deleting the continuation content corresponding to the continuation position after the continuation position in the cache space.
[0017] The step of obtaining the continuation content and display instruction corresponding to the continuation position of the target content includes: when a continuation trigger operation is detected, obtaining the continuation content and display instruction corresponding to the continuation position of the target content based on the target content currently being processed and the continuation position.
[0018] The step of obtaining the continuation content and display instruction corresponding to the continuation position of the target content based on the currently processed target content and the continuation position includes: obtaining preset type information; obtaining the continuation content and display instruction corresponding to the continuation position of the target content based on the currently processed target content, the continuation position and the type information; wherein the continuation content is generated according to the type information corresponding to the target content.
[0019] The step of generating continuation content and display instructions corresponding to the continuation position of the target content based on the currently processed target content and the continuation position includes: after receiving a continuation function start request, obtaining basic account information; determining the permission verification result based on the basic account information; and starting the continuation function if the permission verification result is successful. After the continuation function is started, obtaining the continuation content and display instructions corresponding to the continuation position of the target content is allowed based on the currently processed target content and the continuation position. If the permission verification result is a permission verification failure, obtaining the continuation content and display instructions corresponding to the continuation position of the target content is prohibited based on the currently processed target content and the continuation position, and a preset permission prompt message is displayed.
[0020] This application embodiment also provides a content continuation device, including: an acquisition module, configured to acquire continuation content and a display instruction corresponding to the target content at the continuation position based on the target content currently being processed and the continuation position; and a continuation module, configured to acquire the continuation content corresponding to the continuation position according to the display instruction and execute a content continuation task at the continuation position based on the continuation content corresponding to the continuation position.
[0021] This application embodiment also provides a content continuation device, including: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the processor is configured to execute a content continuation program stored in the memory to implement the content continuation method described above.
[0022] This application also provides a computer-readable storage medium storing computer-executable instructions, which are executed to implement the content continuation method described in any of the above claims.
[0023] Compared with the prior art, the technical solution provided in this application has the following advantages: The method provided in this application can obtain the continuation content and display instructions corresponding to the target content at the continuation position based on the currently processed target content and the continuation position; according to the display instructions, the continuation content corresponding to the continuation position is obtained, and the content continuation task is executed at the continuation position based on the continuation content corresponding to the continuation position. This application does not require users to generate all the required content using a separate artificial intelligence large model application, but provides a content continuation method that is dynamically executed during content processing. During content processing, the continuation content and display instructions are dynamically obtained based on the currently processed target content and the continuation position, and at the continuation position, the continuation content is dynamically obtained and the continuation task is executed based on the obtained display instructions. This better leverages the user's subjective initiative and enhances the user's creativity. Attached Figure Description
[0024] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0025] 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, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0027] Figure 1 This is a flowchart of a content continuation method according to an embodiment of this application;
[0028] Figure 2 This is a schematic diagram of a continuation button according to an embodiment of this application;
[0029] Figure 3 This is a schematic diagram of a floating frame according to an embodiment of this application;
[0030] Figure 4 This is a flowchart illustrating the steps of a content continuation method according to an embodiment of this application;
[0031] Figure 5 This is a structural diagram of a content continuation device according to an embodiment of this application;
[0032] Figure 6 This is a structural diagram of a content continuation device according to an embodiment of this application. Detailed Implementation
[0033] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, 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, 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.
[0034] The following disclosure provides numerous different embodiments or examples for implementing various structures of this application. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of this application. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0035] This application provides a method for content continuation writing. For example... Figure 1 The diagram shown is a flowchart of a content continuation method according to an embodiment of this application.
[0036] Step S110: Based on the target content currently being processed and the continuation position, obtain the continuation content and display instruction corresponding to the target content at the continuation position.
[0037] The target content currently being processed refers to the content located before and / or after the continuation position. Further, the type of target content includes, but is not limited to, the selected portion of the currently processed content, and content of a preset length before and / or after the continuation position. Content types include, but are not limited to, characters, text, images, etc. Furthermore, the target content can be content existing within a content carrier, such as a document, image, or application. The target content is content already existing within a content carrier, such as text in a document, images in a document, text in an image, or edited information in a session application.
[0038] The continuation position refers to: the cursor's pen placement position, the cursor's display position, the cursor's position, the position selected by the user, that is, the continuation position selected by the cursor.
[0039] Continuation content refers to content that is continuous with the target content and can be connected with the target content to form a coherent thought process.
[0040] The display command is used to indicate that, after the continuation position, the continuation content corresponding to the target content at the continuation position should be displayed.
[0041] In the embodiments of this application, the order in which the continuation content and the display instruction are obtained for the same continuation position is not limited. The continuation content can be obtained before the display instruction, and the display instruction can also be obtained before the continuation content. The continuation content and the display instruction can also be obtained simultaneously.
[0042] Step S120: According to the display instruction, obtain the continuation content corresponding to the continuation position and execute the content continuation task at the continuation position according to the continuation content corresponding to the continuation position.
[0043] After receiving the display instruction corresponding to the continuation position, it indicates that the continuation content corresponding to that position needs to be displayed. Thus, at the continuation position, based on the display instruction, the continuation instruction corresponding to that position is obtained, and the content continuation task is executed at that position.
[0044] In this embodiment, based on the currently processed target content and the continuation position, the continuation content and display instructions corresponding to the continuation position are obtained. Based on the display instructions, the continuation content corresponding to the continuation position is obtained, and the content continuation task is executed at the continuation position based on the continuation content. This embodiment eliminates the need for users to generate all the required content using a separate large-scale artificial intelligence application. Instead, it provides a content continuation method that dynamically executes during content processing. During content processing, the continuation content and display instructions are dynamically obtained based on the currently processed target content and the continuation position. Furthermore, at the continuation position, the continuation content is dynamically obtained based on the obtained display instructions, and the continuation task is executed. This allows users to process content while simultaneously referring to the continuation content, further enhancing user initiative and creativity.
[0045] To make the embodiments of this application clearer, the various steps of the embodiments of this application will be described in more detail below.
[0046] In this embodiment of the application, the content continuation method can be applied in a client.
[0047] In this embodiment, permissions can be set for content continuation, allowing the execution of the content continuation method of this embodiment only when the user has the necessary permissions. Specifically, after receiving a continuation function activation request, basic account information is obtained; permission verification is performed based on the basic account information, and the resulting permission verification result is determined; if the permission verification result is successful, the continuation function is activated; wherein, after the continuation function is activated, it is allowed to obtain the continuation content and display instructions corresponding to the target content at the current continuation position, based on the target content being processed and the continuation position; if the permission verification result is a permission verification failure, it is prohibited to obtain the continuation content and display instructions corresponding to the target content at the current continuation position, and a preset permission prompt message is displayed.
[0048] The continuation writing function activation request is used to request permission to continue writing content. Furthermore, a continuation writing button can be set in the user interface; after the continuation writing button is triggered, the continuation writing function activation request is sent. For example: Figure 2The diagram illustrates a continuation button according to an embodiment of this application. The continuation button is located in the function area of a text editing application. When a user needs to use the continuation function and obtains permission to continue writing content, they can click the continuation button. After detecting that the continuation button has been triggered, the client sends a continuation function activation request. Of course, this example is merely illustrative of an embodiment of this application and is not intended to limit the embodiment. For example, an AI button can be set in the function area. Clicking the AI button will pop up an AI function menu, which includes multiple menu items related to AI functions. The continuation function can be one of them. If the function menu item corresponding to the continuation function is detected to be triggered, a continuation function activation request is sent.
[0049] Basic account information includes, but is not limited to, account code. Furthermore, user codes with content rewriting permissions can be stored on the server side. If the basic account information matches the pre-stored account code, the permission verification result is successful; if the basic account information does not match the pre-stored account code, the permission verification result is unsuccessful.
[0050] The permission prompt message is used to indicate that the user does not currently have content continuation permission. Types of situations where content continuation permission is not granted include, but are not limited to: user basic information matching a pre-defined blacklist account, expired content continuation rights, and no existing content continuation rights. The content of the permission prompt message can correspond to the type of content continuation permission not granted. For example, when no content continuation rights are granted, the permission prompt message would be: "Please obtain content continuation permission first before starting content continuation."
[0051] After obtaining content continuation permissions, a preset continuation status interface can be displayed, showing the continuation status and continuation operation items. The continuation status includes, but is not limited to: continuation function disabled, continuation function enabled, and continuation rights expired. Continuation operation items include, but are not limited to: enabling and disabling the continuation function. Through the continuation status interface, users can understand the current status of the continuation function.
[0052] In this embodiment of the application, after obtaining the content continuation permission, the continuation content and display instruction corresponding to the continuation position of the target content can be obtained according to the target content currently being processed and the continuation position.
[0053] Specifically, in terms of the acquisition method, this application embodiment can generate, on the local end, the continuation content and display instruction corresponding to the continuation position of the target content based on the currently processed target content and the continuation position, and obtain the continuation content and display instruction corresponding to the continuation position of the target content. This application embodiment can also synchronize the currently processed target content and the current continuation position to the server; the server generates the continuation content and display instruction corresponding to the continuation position of the target content based on the currently processed target content and the current continuation position, and sends the continuation content and display instruction corresponding to the continuation position of the target content to the local end; the local end can receive and obtain the continuation content and display instruction corresponding to the continuation position of the target content returned by the server. Here, the server may or may not exist on the local end.
[0054] Therefore, it is clear that before obtaining the continuation content and display instructions, it is necessary to generate the continuation content and display instructions. Since the target content and the continuation position are constantly changing during content processing, in order to ensure the real-time nature of the content continuation process, it is necessary to generate the corresponding continuation content and display instructions at the current continuation position based on the currently processed target content and the changes in the continuation position.
[0055] In this embodiment, when the target content changes, the continuation content and display instructions corresponding to the continuation position are obtained based on the changed target content and the continuation position. This allows users to process content while referring to the continuation content, further enhancing their initiative and creativity.
[0056] Furthermore, to ensure the real-time nature of the content continuation process, whether the continuation content and display instructions are generated locally or on the server, it is necessary to generate the corresponding continuation content and display instructions at the current continuation position based on the target content and continuation position as the target content and continuation position change. This requires ensuring that the information used to generate the continuation content and display instructions remains synchronized with the currently processed target content and continuation position. To maintain synchronization, the embodiments of this application provide the following two methods. Of course, those skilled in the art should understand that the synchronization methods are not limited to these methods.
[0057] Method 1: Obtain first information generated based on target content processed at a first time; generate second information based on the target content processed at a second time; wherein the first time is earlier than the second time; if the first information and the second information are different, determine that the target content has changed; and obtain the continuation content and display instruction corresponding to the continuation position of the changed target content based on the changed target content and the continuation position. In other words, based on the changed target content and the continuation position, generate the continuation content and display instruction corresponding to the continuation position of the changed target content, and obtain the continuation content and display instruction corresponding to the continuation position of the changed target content.
[0058] The first information may be a hash value generated based on the target content processed in a first time. The second information may be a hash value generated based on the target content processed in a second time. This application does not limit the hash function used to calculate the hash value. For example, the hash function may be the MD5 Message-Digest Algorithm.
[0059] Furthermore, when the server generates continuation content and display instructions, the target text to be processed in the first instance is sent to the server so that the server can generate first information based on the target text; during the continued processing of the target text, the continuation position is synchronized with the server and the first information returned by the server is received; after receiving the first information, second information is generated for the target text to be processed in the second instance; if the first information and the second information are different, the target text to be processed in the second instance is sent to the server. Specifically, when the server generates continuation content and display instructions, the target content being processed is sent to the server after either establishing a new connection with the server or after re-establishing a connection with the server.
[0060] Method Two: During the processing of the target content, content processing operations and cursor change events are detected. For each detected content processing operation, content processing operation information is generated based on the operation and its object. For each detected cursor change event, continuation position information is generated based on the corresponding continuation position. Based on the content processing operation information and / or the continuation position information, the continuation content and display instructions corresponding to the target content at the continuation position are obtained. In other words, based on the content processing operation information and / or the continuation position information, the currently processed target content and its current coordinate position are updated. Based on the updated target content and coordinate position, the continuation content and display instructions corresponding to the target content at the continuation position are generated and obtained.
[0061] Further, the types of content processing operations include: deletion operations and update operations; a deletion operation is used to delete part of the content in the target content. An update operation is used to insert or modify part of the content in the target content. When the content processing operation is detected to be a deletion operation, the deleted content in the target content and the start and end positions of the deleted content are determined, and the identifier corresponding to the deletion operation and the start and end positions of the deleted content are used as the content processing operation information; when the content processing operation is detected to be an update operation, the updated content in the target content and the start and end positions of the updated content are determined, and the identifier corresponding to the update operation, the updated content, and the start and end positions of the updated content are used as the content processing operation information.
[0062] Furthermore, when the server generates continuation content and display instructions, each time a content processing operation is detected, content processing operation information is generated based on the content processing operation and its object, and reported to the server; each time a cursor change event is detected, continuation position information is generated based on the continuation position corresponding to the cursor change event, and reported to the server; in this way, the server can synchronize the currently processed target content and the current continuation position based on the content processing operation information and / or the continuation position information, and generate the continuation content and display instructions corresponding to the target content at the continuation position based on the updated target content and coordinate position, and return them to the local end, so that the local end can obtain the continuation content and display instructions corresponding to the target content at the continuation position.
[0063] By using the two methods described above, and by synchronizing the current target content and the current continuation position, it can be ensured that the target content and continuation position used when determining the continuation content and display instructions are the same as the current target content and the current continuation position.
[0064] In this embodiment, after synchronizing the current target content and the current continuation position, it is also necessary to determine whether there is a content continuation requirement. Only if there is a content continuation requirement is a display instruction and continuation content generated. Specifically, the continuation trigger operation can reflect the content continuation requirement. Thus, the display instruction is generated when a continuation trigger operation is detected at the continuation position. The continuation content is generated based on the target content corresponding to the continuation position when a continuation trigger operation is detected at the continuation position. Therefore, when a continuation trigger operation is detected, the continuation content and display instruction corresponding to the target content at the continuation position are generated based on the currently processed target content and the continuation position; when a continuation trigger operation is detected, the continuation content and display instruction corresponding to the target content at the continuation position are obtained based on the currently processed target content and the continuation position.
[0065] The continuation triggering operations include, but are not limited to: continuation position operations that meet preset triggering conditions, content processing operations, manual triggering operations, and information sending and receiving operations. Further, the continuation position operation includes, but is not limited to: the dwell time at the continuation position exceeding a preset dwell time threshold. The dwell time threshold is an empirical value or a value obtained through experimentation. For example, the dwell time threshold is 2 seconds. Content processing operations include, but are not limited to: content editing operations. Manual triggering operations include, but are not limited to: mouse triggering operations, keyboard triggering operations, and control triggering operations. Information sending and receiving operations include, but are not limited to: receiving continuation instructions and candidate content.
[0066] For example: if the user's cursor stays at the end of the text for more than 2 seconds, it is determined that a continuation writing trigger operation is triggered; if the user enters a comma while editing the text, it is determined that a continuation writing trigger operation is triggered; if a right-click operation is detected, it is determined that a continuation writing trigger operation is triggered; if a preset keyboard key (such as the Tab key) is detected, it is determined that a continuation writing trigger operation is triggered; if the continuation item in the floating menu control displayed after the continuation position is clicked, it is determined that a continuation writing trigger operation is triggered; if candidate content and continuation writing instructions are received from the server, it is determined that a continuation writing trigger operation is triggered.
[0067] In this embodiment of the application, when a continuation trigger operation is detected, a display instruction corresponding to the continuation position of the target content is generated, and the continuation content corresponding to the continuation position of the target content is generated based on the target content currently being processed using a preset large language model.
[0068] Furthermore, to make the generated continuation content more in line with user needs, type information for content continuation can be preset; when continuating content, the preset type information is obtained; based on the target content being processed, the continuation position, and the type information, the continuation content and display instructions corresponding to the target content at the continuation position are obtained; wherein, the continuation content is generated according to the type information corresponding to the target content.
[0069] Type information includes, but is not limited to: writing style information and user type information.
[0070] Behavioral style information is used to indicate the content style of the continuation. Types of behavioral style information include, but are not limited to: formal, humorous, formal, and colloquial. Furthermore, default behavioral style information can be set, such as: formal.
[0071] User type information is used to indicate the usage scenario of the continued content. Types of user type information include, but are not limited to: General, Teacher, Administrative, and Operations. Furthermore, default user type information can be set, such as: Administrative.
[0072] In this embodiment, after generating the continuation content and display instruction corresponding to the continuation position based on the currently processed target content and the continuation position, the continuation content and display instruction are output. The continuation content and display instruction can be output sequentially, or they can be output simultaneously.
[0073] In this embodiment, when a display command and continuation content are output sequentially, the continuation content corresponding to the continuation position can be cached after obtaining it. This allows the cached continuation content to be retrieved at the continuation position based on the display command corresponding to that position. Furthermore, if a continuation trigger operation is detected at the continuation position, the cached continuation content corresponding to that position can be retrieved at that position based on the display command.
[0074] Furthermore, since the continuation position may change at any time during content processing, after obtaining the continuation content and display instruction corresponding to the continuation position of the target content, in order to execute the content continuation task at the continuation position, the continuation position of the content continuation task to be executed can be extracted from the display instruction. If the current continuation position is the same as the continuation position of the content continuation task to be executed, the continuation content corresponding to the continuation position of the content continuation task to be executed is obtained from the cache space. Of course, if the current continuation position is different from the continuation position of the content continuation task to be executed, the continuation content corresponding to the current continuation position is not obtained temporarily. After the current continuation position detects a continuation trigger operation and obtains the display instruction corresponding to the current continuation position, the continuation content corresponding to the current continuation position is obtained. Alternatively, when the continuation position returns to the continuation position of the content continuation task to be executed, the continuation content corresponding to the continuation position of the content continuation task to be executed is obtained.
[0075] Furthermore, if the continuation content corresponding to the continuation position is not obtained in the cache space, the system waits to cache the continuation content corresponding to the continuation position until the continuation content corresponding to the continuation position is obtained or a change in the continuation position is detected.
[0076] Furthermore, if the continuation content corresponding to the continuation position is not obtained in the cache space, a target continuation position that is before and closest to the continuation position is determined in the cache space, and the continuation content corresponding to the target continuation position is obtained. If the length of the content that can be accommodated between the continuation position and the target continuation position is less than the length of the continuation content, a first piece of content located between the continuation position and the target continuation position and a second piece of content located after the continuation position are obtained from the target content. If the first piece of content matches the continuation content and the second piece of content does not match the continuation content, the content after the length of the content that can be accommodated is extracted from the continuation content and used as the continuation content corresponding to the continuation position. Wherein, when the content type is text, the length of the content that can be accommodated can be the number of characters in the text.
[0077] The matching of the first content with the continuation content means that the similarity between the first content and the first half of the continuation content is greater than a preset first similarity threshold. The length of the first half of the content is equal to the length of the content that can be contained.
[0078] The mismatch between the second content and the continuation content means that the similarity between the second content and the latter half of the continuation content is less than a preset second similarity threshold. The latter half of the content refers to the content of the continuation content excluding the first half. The second similarity threshold is less than a first similarity threshold. The length of the second content and the length of the latter half can be the same.
[0079] For example: In the cache space, query the continuation content corresponding to the nearest target continuation position before the current continuation position; determine that N characters (the length of the content that can be accommodated) can be accommodated between the current continuation position and the target continuation position; in the text being processed, determine the text content between the current continuation position and the target continuation position; determine whether the text content matches the first N characters of the continuation content; if the text content matches the first N characters of the continuation content, then determine whether the text in the text being processed after the current continuation position matches the content after the Nth character in the continuation content; if they match, then extract the content after the Nth character in the continuation content and use the content after the Nth character in the continuation content as the continuation content corresponding to the current continuation position.
[0080] In this embodiment of the application, when both the display instruction and the continuation content are output simultaneously, the continuation content corresponding to the continuation position can be obtained in real time according to the display instruction corresponding to the continuation position.
[0081] In this embodiment of the application, since it is necessary to ensure that the continuation content stored in the cache space corresponding to the continuation position is the latest continuation content, the cache space needs to be updated.
[0082] Furthermore, when caching the continuation content corresponding to the continuation position, if the continuation content corresponding to the continuation position is already stored in the cache space, the newly generated continuation content is used to overwrite the continuation content already stored in the cache space. This ensures that the continuation content stored in the cache space is always generated based on the latest target content, guaranteeing the real-time nature of content continuation.
[0083] Further, before executing the content continuation task at the specified continuation position, a content processing operation is detected; after detecting the content processing operation, the continuation position corresponding to the content processing operation is determined. In the cache space, the continuation content corresponding to the continuation position following the specified continuation position is deleted. This content processing operation includes deletion and update operations. The continuation content is generated based on the target content preceding the continuation position. Detecting a content processing operation means that the content being processed has changed, and the continuation content corresponding to the continuation position following the specified continuation position needs to be deleted.
[0084] Furthermore, during the execution of the content continuation task at the specified continuation position, if a continuation cancellation event is detected, or if a continuation function disabling request is received, the execution of the content continuation task is stopped, and the continuation content corresponding to the continuation position following the specified continuation position is deleted from the cache space. The continuation cancellation event can be triggered by canceling the candidate content option in the floating window. A continuation function disabling request can be issued by closing the continuation button located in the function area. For example: Figure 3 The figure shows a schematic diagram of a floating box according to an embodiment of the present application. In the figure, "Use this sentence to accompany writing" is equivalent to using candidate content, and "Abandon this sentence to accompany writing" is equivalent to canceling candidate content. Clicking can trigger a continuation cancellation event, and the corresponding operation item can be clicked as needed.
[0085] Furthermore, after performing the content continuation task at the stated continuation position, the continuation content corresponding to the continuation position following the stated continuation position is deleted from the cache space. After performing the content continuation task, the content being processed may change; for example, if the user selects candidate content, the continuation content corresponding to the continuation position following the current continuation position will no longer be accurate and needs to be deleted from the cache space.
[0086] Below is an example where the content type is text.
[0087] When the client generates display instructions and continuation content, the content continuation function is initiated; the target text being edited and the continuation position are monitored in real time; based on the target text being edited and the continuation position, it is detected whether a continuation trigger operation exists at the current continuation position; if a continuation trigger operation is detected at the continuation position, continuation content is generated for the continuation position based on the target text being edited, and a display instruction corresponding to the continuation position is generated, thereby obtaining the continuation content and the display instruction corresponding to the continuation position; at the continuation position, the continuation content corresponding to the continuation position is obtained based on the display instruction corresponding to the continuation position; based on the continuation content corresponding to the continuation position, the content continuation task is executed at the continuation position.
[0088] When the server generates display instructions and continuation content, such as Figure 4 The diagram shown is a flowchart of a content continuation method according to an embodiment of this application.
[0089] Step S410: The client starts the content continuation function.
[0090] Step S420: The client establishes a long connection with the server.
[0091] After disabling the content continuation feature, the client disconnects the persistent connection from the server.
[0092] In step S430, the client synchronizes the target text being edited and the continuation position with the server.
[0093] While the long connection remains open, the client continues to synchronize the target text being edited and the continuation position to the server, unaffected by subsequent steps.
[0094] The server checks whether a continuation trigger operation exists at the continuation position based on the target text being edited by the client and the continuation position. If yes, it generates continuation content for the continuation position based on the target text being edited and generates the corresponding display instruction for the continuation position. If no, it continues to check whether a continuation trigger operation exists at the continuation position based on the target text being edited by the client and the continuation position.
[0095] The server sends the continuation content corresponding to the continuation position and the display command corresponding to the continuation position to the client respectively.
[0096] In step S440, after receiving the display instruction returned by the server, the client extracts the continuation position of the content continuation task to be executed from the display instruction.
[0097] In step S450, if the current continuation position is the same as the continuation position of the continuation task to be executed, the client determines whether there is continuation content in the cache space corresponding to the continuation position of the continuation task to be executed; if yes, then proceed to step S460; if no, then proceed to step S470.
[0098] In step S460, the client retrieves the continuation content corresponding to the current continuation position from the cache space and executes the content continuation task.
[0099] After the content continuation task is completed, step S440 needs to be executed.
[0100] In step S470, the client waits for the server to return the continuation content corresponding to the continuation position of the continuation task to be executed and caches it, then proceeds to step S450.
[0101] In this embodiment, during text editing, the target text being edited and the continuation position are synchronized to the server. This allows the server to obtain the target text being edited and the continuation position on the client side, enabling it to determine in real time whether a text continuation requirement exists on the client side. If a text continuation requirement is determined, the server sends a display instruction and the continuation content to the client. Based on the received display instruction and continuation content, the client can execute the content continuation task. This allows text continuation to be performed on the text being edited by the user, eliminating the need for the user to manually organize the text to generate continuation content. Instead, the user can view the continuation content while editing the text, making it convenient to use the continuation content without limiting the user's imagination.
[0102] This application also provides a content continuation device. For example... Figure 5 The diagram shown is a structural diagram of a content continuation device according to an embodiment of this application.
[0103] The content continuation device includes:
[0104] The obtaining module 510 is used to obtain the continuation content and display instruction corresponding to the continuation position of the target content based on the target content currently being processed and the continuation position.
[0105] The continuation module 520 is used to obtain the continuation content corresponding to the continuation position according to the display instruction, and to perform the content continuation task at the continuation position according to the continuation content corresponding to the continuation position.
[0106] The functions of the apparatus described in this application embodiment have been described in the above method embodiments. Therefore, for any parts not detailed in the description of this embodiment, please refer to the relevant descriptions in the foregoing embodiments, which will not be repeated here.
[0107] This application also provides a content continuation device, such as... Figure 6 The diagram shown is a structural diagram of a content continuation device according to an embodiment of this application.
[0108] The content writing device includes a processor 610, a communication interface 620, a memory 630, and a communication bus 640. The processor 610, communication interface 620, and memory 630 communicate with each other via the communication bus 640.
[0109] The memory 630 is used to store computer programs.
[0110] In one embodiment of this application, the processor 610, when executing a program stored in the memory 630, implements the content continuation method provided in any of the foregoing method embodiments, including: obtaining continuation content and a display instruction corresponding to the target content at the continuation position based on the target content currently being processed and the continuation position; obtaining the continuation content corresponding to the continuation position based on the display instruction; and performing a content continuation task at the continuation position based on the continuation content corresponding to the continuation position.
[0111] The step of obtaining the continuation content and display instruction corresponding to the continuation position of the target content based on the currently being processed target content and the continuation position includes: obtaining first information generated based on the target content processed at a first time; generating second information based on the target content processed at a second time; wherein the first time is earlier than the second time; if the first information and the second information are different, determining that the target content has changed, and obtaining the continuation content and display instruction corresponding to the continuation position of the changed target content based on the changed target content and the continuation position.
[0112] The step of obtaining the continuation content and display instruction corresponding to the continuation position of the target content based on the currently being processed target content and the continuation position includes: during the processing of the target content, detecting content processing operations and cursor change events; generating content processing operation information based on the content processing operation and its operation object for each detected content processing operation; generating continuation position information based on the continuation position corresponding to the cursor change event for each detected cursor change event; and obtaining the continuation content and display instruction corresponding to the continuation position of the target content based on the content processing operation information and / or the continuation position information.
[0113] Specifically, for each detected content processing operation, content processing operation information is generated based on the content processing operation and its target, including: when the content processing operation is detected as a deletion operation, determining the content to be deleted in the target content and the start and end positions of the deleted content, and using the identifier corresponding to the deletion operation and the start and end positions of the deleted content as the content processing operation information; when the content processing operation is detected as an update operation, determining the updated content in the target content and the start and end positions of the updated content, and using the identifier corresponding to the update operation, the updated content, and the start and end positions of the updated content as the content processing operation information.
[0114] The step of obtaining the continuation content corresponding to the continuation position according to the display instruction includes: obtaining the cached continuation content corresponding to the continuation position according to the display instruction corresponding to the continuation position at the continuation position; or, obtaining the continuation content corresponding to the continuation position in real time according to the display instruction corresponding to the continuation position at the continuation position.
[0115] The step of obtaining the cached continuation content corresponding to the continuation position according to the display instruction corresponding to the continuation position includes: extracting the continuation position of the content continuation task to be executed from the display instruction; and obtaining the continuation content corresponding to the continuation position of the content continuation task to be executed from the cache space when the current continuation position is the same as the continuation position of the content continuation task to be executed.
[0116] The step of obtaining the continuation content corresponding to the continuation position in the cache includes: if the continuation content corresponding to the continuation position is not obtained in the cache space, waiting for the continuation content corresponding to the continuation position to be cached until the continuation content corresponding to the continuation position is obtained or a change in the continuation position is detected.
[0117] The step of obtaining the continuation content corresponding to the continuation position in the cache includes: if the continuation content corresponding to the continuation position is not obtained in the cache space, determining a target continuation position in the cache space that is before and closest to the continuation position, and obtaining the continuation content corresponding to the target continuation position; if the length of the content that can be accommodated between the continuation position and the target continuation position is less than the length of the continuation content, obtaining a first content located between the continuation position and the target continuation position and obtaining a second content located after the continuation position from the target content; if the first content matches the continuation content and the second content does not match the continuation content, extracting the content after the length of the content that can be accommodated from the continuation content as the continuation content corresponding to the continuation position.
[0118] Before obtaining the continuation content corresponding to the continuation position in the cache, the method further includes: for the continuation position, if the continuation content corresponding to the continuation position is already stored in the cache space, using the newly generated continuation content to overwrite the continuation content already stored in the cache space.
[0119] The method further includes: detecting a content processing operation before executing the content continuation task at the continuation position; determining the continuation position corresponding to the content processing operation after detecting the content processing operation; deleting the continuation content corresponding to the continuation position after the continuation position in the cache space; or, during the execution of the content continuation task at the continuation position, if a continuation cancellation event is detected, or if a continuation function closure request is received, stopping the execution of the content continuation task and deleting the continuation content corresponding to the continuation position after the continuation position in the cache space; or, after executing the content continuation task at the continuation position, deleting the continuation content corresponding to the continuation position after the continuation position in the cache space.
[0120] The step of obtaining the continuation content and display instruction corresponding to the continuation position of the target content includes: when a continuation trigger operation is detected, obtaining the continuation content and display instruction corresponding to the continuation position of the target content based on the target content currently being processed and the continuation position.
[0121] The step of obtaining the continuation content and display instruction corresponding to the continuation position of the target content based on the currently processed target content and the continuation position includes: obtaining preset type information; obtaining the continuation content and display instruction corresponding to the continuation position of the target content based on the currently processed target content, the continuation position and the type information; wherein the continuation content is generated according to the type information corresponding to the target content.
[0122] The step of generating continuation content and display instructions corresponding to the continuation position of the target content based on the currently processed target content and the continuation position includes: after receiving a continuation function start request, obtaining basic account information; determining the permission verification result based on the basic account information; and starting the continuation function if the permission verification result is successful. After the continuation function is started, obtaining the continuation content and display instructions corresponding to the continuation position of the target content is allowed based on the currently processed target content and the continuation position. If the permission verification result is a permission verification failure, obtaining the continuation content and display instructions corresponding to the continuation position of the target content is prohibited based on the currently processed target content and the continuation position, and a preset permission prompt message is displayed.
[0123] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the content continuation method provided in any of the foregoing method embodiments. Since the content continuation method has already been described in detail above, any omissions in the description of this embodiment can be found in the relevant descriptions in the foregoing embodiments, and will not be repeated here.
[0124] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0125] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0126] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also include the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.
[0127] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement 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 claimed herein.
Claims
1. A method of content continuation, characterized by, The method comprises the following steps: According to the target content currently being processed and the continuation position, the continuation content corresponding to the target content at the continuation position and display instructions are obtained; According to the display instructions, the continuation content corresponding to the continuation position is obtained and the content continuation task is performed at the continuation position according to the continuation content corresponding to the continuation position.
2. The method of claim 1, wherein, The method comprises the following steps: In the case where the target content is changed, the continuation content corresponding to the changed target content at the continuation position and display instructions are obtained according to the changed target content and the continuation position.
3. The method of claim 2, wherein, In the case where the target content is changed, the continuation content corresponding to the changed target content at the continuation position and display instructions are obtained according to the changed target content and the continuation position, which comprises the following steps: The first information generated according to the target content processed at the first time is obtained; The second information is generated according to the target content processed at the second time; wherein the first time is earlier than the second time; In the case where the first information is different from the second information, it is determined that the target content has been changed, and the continuation content corresponding to the changed target content at the continuation position and display instructions are obtained according to the changed target content and the continuation position.
4. The method of claim 2, wherein, In the case where the target content is changed, the continuation content corresponding to the changed target content at the continuation position and display instructions are obtained according to the changed target content and the continuation position, which comprises the following steps: In the process of processing the target content, the content processing operation and the cursor change event are detected; The content processing operation information is generated according to the content processing operation and its operation object every time the content processing operation is detected; The continuation position information is generated according to the continuation position corresponding to the cursor change event every time the cursor change event is detected; According to the content processing operation information and / or the continuation position information, the continuation content corresponding to the target content at the continuation position and display instructions are obtained.
5. The method of claim 4, wherein, The content processing operation information is generated according to the content processing operation and its operation object every time the content processing operation is detected, which comprises the following steps: In the case where the content processing operation is detected as a deletion operation, the deleted content in the target content and the start and end positions of the deleted content are determined, and the identification corresponding to the deletion operation and the start and end positions of the deleted content are taken as the content processing operation information; In the case where the content processing operation is detected as an update operation, the updated content in the target content and the start and end positions of the updated content are determined, and the identification corresponding to the update operation, the updated content and the start and end positions of the updated content are taken as the content processing operation information.
6. The method of claim 1, wherein, The continuation content corresponding to the continuation position is obtained according to the display instructions, which comprises the following steps: In the continuation position, the continuation content corresponding to the continuation position is obtained according to the display instructions corresponding to the continuation position; or, In the continuation position, according to the display instruction corresponding to the continuation position, the continuation content corresponding to the continuation position is obtained in real time.
7. The method of claim 6, wherein, The obtaining of the continuation content corresponding to the continuation position from the cache space comprises: The continuation position of the content continuation task to be executed is extracted from the display instruction; In the case that the current continuation position is the same as the continuation position of the content continuation task to be executed, the continuation content corresponding to the continuation position of the content continuation task to be executed is obtained from the cache space.
8. The method of claim 6, wherein, The obtaining of the continuation content corresponding to the continuation position from the cache space comprises: In the case that the continuation content corresponding to the continuation position is not obtained from the cache space, the continuation content corresponding to the continuation position is cached until the continuation content corresponding to the continuation position is obtained or a change in the continuation position is detected.
9. The method of claim 6, wherein, The obtaining of the continuation content corresponding to the continuation position from the cache space comprises: In the case that the continuation content corresponding to the continuation position is not obtained from the cache space, a target continuation position located before the continuation position and closest to the continuation position is determined in the cache space, and the continuation content corresponding to the target continuation position is obtained; In the case that the content length that can be accommodated between the continuation position and the target continuation position is less than the content length of the continuation content, a first content located between the continuation position and the target continuation position is obtained in the target content, and a second content located after the continuation position is obtained; In the case that the first content matches the continuation content and the second content does not match the continuation content, the content after the content length that can be accommodated is cut from the continuation content as the continuation content corresponding to the continuation position.
10. The method of claim 6, wherein, Before the obtaining of the continuation content corresponding to the continuation position from the cache space, the method further comprises: In the case that the continuation content corresponding to the continuation position has been stored in the cache space for the continuation position, the newly generated continuation content is used to replace the continuation content that has been stored in the cache space.
11. The method of claim 6, wherein, The method further comprises: Before the content continuation task is executed at the continuation position, a content processing operation is detected, after the content processing operation is detected, a continuation position corresponding to the content processing operation is determined, and the continuation content corresponding to the continuation position located after the continuation position is deleted in the cache space; or, During the execution of the content continuation task at the continuation position, in the case that a continuation cancellation event is detected or in the case that a continuation function closing request is received, the content continuation task is stopped and the continuation content corresponding to the continuation position located after the continuation position is deleted in the cache space; or, After the content continuation task is executed at the continuation position, the continuation content corresponding to the continuation position located after the continuation position is deleted in the cache space.
12. The method of claim 1, wherein, The obtaining of the continuation content corresponding to the continuation position of the target content and the display instruction comprises: In a case where a continuation writing trigger operation is detected, continuation content corresponding to the continuation writing position of the target content currently being processed and display instructions are obtained according to the target content currently being processed and the continuation writing position.
13. The method of claim 1, wherein, The obtaining of the continuation content corresponding to the continuation writing position of the target content currently being processed and the display instructions according to the target content currently being processed and the continuation writing position comprises: acquiring preset type information; obtaining the continuation content corresponding to the continuation writing position of the target content currently being processed and the display instructions according to the target content currently being processed, the continuation writing position and the type information, wherein the continuation content is generated according to the type information corresponding to the target content.
14. The method of claim 1, wherein, The obtaining of the continuation content corresponding to the continuation writing position of the target content currently being processed and the display instructions according to the target content currently being processed and the continuation writing position comprises: after receiving a continuation writing function starting request, acquiring account basic information; determining a permission verification result based on permission verification performed according to the account basic information; in a case where the permission verification result is permission verification success, starting the continuation writing function; wherein, after the continuation writing function is started, the continuation content corresponding to the continuation writing position of the target content currently being processed and the display instructions are obtained according to the target content currently being processed and the continuation writing position; in a case where the permission verification result is permission verification failure, the continuation content corresponding to the continuation writing position of the target content currently being processed and the display instructions are prohibited from being obtained according to the target content currently being processed and the continuation writing position, and preset permission prompt information is displayed.
15. A content continuation apparatus characterized by comprising: comprise: an obtaining module configured to obtain continuation content corresponding to a continuation writing position of target content currently being processed and display instructions according to the target content currently being processed and the continuation writing position; a continuation writing module configured to acquire the continuation content corresponding to the continuation writing position according to the display instructions and perform a content continuation writing task according to the continuation content corresponding to the continuation writing position at the continuation writing position.
16. A content continuation device, characterized by comprise: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; at least one memory connected to the at least one bus, wherein the processor is configured to execute a content continuation writing program stored in the memory to implement the content continuation writing method in any one of claims 1-14.
17. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer executable instructions, and the computer executable instructions are executed to implement the content continuation writing method in any one of claims 1-14.