A method, an apparatus and a system for controlling a data block, an electronic device, and a storage medium is provided. The method includes, receiving a target operation being performed on a first data block in a first document, the first data block having a reference relationship with a second document and the target operation including inserting, deleting, moving or replacing a sub-data block under the first data block; and updating the reference relationship between at least one data block in the first document and the second document on the basis of the target operation.
Legal claims defining the scope of protection, as filed with the USPTO.
. A method for controlling a data block, comprising:
. The method according to, wherein the updating the reference relationship between at least one data block in the first document and the second document on the basis of the target operation comprises: updating the reference relationship between the first data block and the second document on the basis of the target operation;
. The method according to, wherein the updating the reference relationship between the first data block and the second document on the basis of the target operation comprises:
. The method according to, wherein the determining the reference relationship between the second data block and the second document on the basis of the target operation comprises:
. The method according, further comprising:
. The method according to, wherein the re-determining the associated data block of the selected region on the basis of the target operation comprises:
. The method according to, wherein the re-determining the range of the selected region on the basis of the target operation comprises:
. The method according to, wherein the re-determining the associated data block and/or range of the selected region on the basis of the target operation comprises:
. The method according to, wherein
. The method according to, wherein the re-determining the associated data block and/or range of the selected region on the basis of the target operation comprises:
. The method according to, wherein the re-determining the associated data block and/or range of the selected region on the basis of the target operation comprises:
. The method according to, wherein the first operation instruction is used for deleting at least one sub-data block of the first data block, and the second operation instruction is used for inserting at least one sub-data block into other data blocks other than the first data block.
. The method according to, wherein the target operation comprises a dragging operation for data blocks.
. The method according to, wherein the range of the selected region has a left end point and a right end point, and the re-determining the range of the selected region on the basis of the target operation comprises:
. The method according to, wherein the re-determining the range of the selected region on the basis of the target operation comprises:
. The method according to, wherein the re-determining the associated data block and/or range of the selected region on the basis of the target operation comprises:
. The method according to, wherein the target operation comprises a column division operation.
. The method according to, further comprising:
-. (canceled)
. An electronic device, comprising:
. A non-transient computer-readable storage medium, wherein
Complete technical specification and implementation details from the patent document.
This application claims the priority of the Chinese patent application with the application number 202210515870.7 and the title of “METHOD, APPARATUS AND SYSTEM FOR CONTROLLING A DATA BLOCK, ELECTRONIC DEVICE AND STORAGE MEDIUM” filed by Patent Office of China on May 11, 2022, the entire contents of which are incorporated herein by reference.
The present disclosure relates to the field of computer technologies, and specifically relates to a method, apparatus and system for controlling a data block, an electronic device and a storage medium.
Relevant online document technology can provide real-time referencing function, that is, users can reference a continuous section of content from another online document in one online document, and when the referenced content is modified in the original document/reference document, it can also be updated in the corresponding reference document/original document. In this way, a section of content can appear in multiple documents and be synchronized in real-time, which can to some extent improve the utilization rate of the documents. However, the real-time referencing function provided by relevant online document technologies is not perfect, and it is easy to encounter the problem of losing the referenced parts, which brings inconvenience to users.
The section of summary of the invention to briefly introduce the concepts is provided, which will be described in detail in the detailed description later. The section of summary of the invention is not intended to identify the key or necessary features of the claimed technical solution for protection, nor is it intended to limit the scope of the claimed technical solution for protection.
In a first aspect, according to one or more embodiments of the present disclosure, a method of controlling a data block is provided. The method includes:
In a second aspect, according to one or more embodiments of the present disclosure, a method of controlling a data block is provided. The method includes:
In a third aspect, according to one or more embodiments of the present disclosure, a method for controlling a data block is provided. The method is applied to a client and includes:
In a fourth aspect, according to one or more embodiments of the present disclosure, an apparatus for controlling a data block is provided. The apparatus includes:
In a fifth aspect, according to one or more embodiments of the present disclosure, an apparatus for controlling a data block is provided. The apparatus includes:
In a sixth aspect, according to one or more embodiments of the present disclosure, an apparatus for controlling a data block is provided. The apparatus includes:
In a seventh aspect, according to one or more embodiments of the present disclosure, a system for controlling a data block is provided. The system includes:
In an eighth aspect, according to one or more embodiments of the present disclosure, an electronic device is provided. The electronic device includes: at least one memory and at least one processor. The memory is configured to store program codes, and the processor is configured to call the program codes stored in the memory to enable the electronic device to execute the method for controlling a data block provided by one or more embodiments of the present disclosure.
In a ninth aspect, according to one or more embodiments of the present disclosure, a non-transient computer storage medium is provided. Program codes are stored in the non-transient computer storage medium; and when the program codes are executed by a computer device, the computer device is enabled to execute the method for controlling a data block provided by one or more embodiments of the present disclosure.
Embodiments of the present disclosure are described in more detail below with reference to the drawings. Although certain embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be achieved in various forms and should not be construed as being limited to the embodiments described here. On the contrary, these embodiments are provided to understand the present disclosure more clearly and completely. It should be understood that the drawings and the embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
It should be understood that various steps recorded in the implementation modes of the method of the present disclosure may be performed according to different orders and/or performed in parallel. In addition, the implementation modes of the method may include additional steps and/or steps omitted or unshown. The scope of the present disclosure is not limited in this aspect.
The term “including” and variations thereof used in this article are open-ended inclusion, namely “including but not limited to”. The term “based on” refers to “at least partially based on”. The term “one embodiment” means “at least one embodiment”; the term “another embodiment” means “at least one other embodiment”; and the term “some embodiments” means “at least some embodiments.” The term “responsive to” and related terms refer to a signal or event being affected to a certain extent by another signal or event, but not necessarily completely or directly. If event x occurs in response to event y, then x can directly or indirectly respond to y. For example, the occurrence of y may ultimately lead to the occurrence of x, but there may be other intermediate events and/or conditions. In other cases, y may not necessarily lead to the occurrence of x, and even if y has not yet occurred, x may still occur. In addition, the term “responsive to” can also mean “at least partially responsive to.”
The term “determining” encompasses a wide range of actions, including acquiring, calculating, processing, deducting, researching, searching (e.g. searching in tables, databases, or other data structures), exploring, and similar actions. It may also include receiving (e.g. receiving information), accessing (e.g. accessing data in storage), and similar actions, as well as parsing, selecting, choosing, establishing, and similar actions. The relevant definitions of other terms will be provided in the following description. The relevant definitions of other terms will be provided in the following description.
It should be noted that concepts such as “first” and “second” mentioned in the present disclosure are only used to distinguish different apparatuses, modules or units, and are not intended to limit orders or interdependence relationships of functions performed by these apparatuses, modules or units.
It should be noted that modifications of “one” and “more” mentioned in the present disclosure are schematic rather than restrictive, and those skilled in the art should understand that unless otherwise explicitly stated in the context, it should be understood as “one or more”.
For the purpose of this disclosure, the phrase “A and/or B” means (A), (B), or (A and B).
The names of the messages or information exchanged between multiple devices in embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of these messages or information.
As shown in,shows a method for controlling a data block according to an embodiment of the present disclosure, the method including step Sand step S.
Step S: In response to a target operation being performed on a first data block in a first document, determining whether the first data block has a reference relationship with a second document, the target operation being used for inserting, deleting, moving or replacing a sub-data block under a data block.
In some embodiments, the data block (Block) is used as a basic unit for editing an online document and can be configured to display information such as character information, image information or multimedia information. One data block can be configured to display one or more paragraphs of text, and a plurality of data blocks can be the sub-data blocks of another data block.
In some embodiment, the second document is a document other than the first document. In one implementation, the second document can be any one or more online documents other than the first document. In another implementation, the second document can be one or more specific online documents other than the first document.
It is to be noted that unless otherwise specified, the reference relationship between the data block and the document in this embodiment includes that one or more sub-data blocks of this data block are referenced by this document, or one or more sub-data blocks of this data block are referenced from the document.
As shown in,shows a schematic diagram of an online document according to the embodiment of the present disclosure. In a first online document, data blocks,,,andsequentially display text information such as “text content A”, “text content A”, “text content B”, “text content C” and “text content B” respectively. The data blocks,andare sub-data blocks of the first data block, and the first data blockand the second data blockis a sub-data block of a data block. In addition, the data blockcan also be a sub-data block of other data blocks, which is not limited in this embodiment. A second online documentreferences the data blocksandof the first online document, that is, there is a reference relationship between the second online documentand the first data block.
shows a schematic diagram of a node relationship of data blocks according to an embodiment of the present disclosure. In, each node can correspond to one data block, and a root node R has nodes A, Band C, that is, the root node is a parent node of the nodes A, Band C; the node Ahas nodes Aand B, that is, the node Ais a parent node of the nodes Aand B; the node Ahas nodes A, Band C, that is, the node Ais a parent node of the nodes A, Band C; the node Ahas nodes Aand B, that is, the node Ais a parent node of the nodes Aand B; and the node Bhas a node C, that is, the node Bis a parent node of the node C.
In one specific implementation, the target operation can support inserting, deleting, moving or replacing items in a list, and shuffle (Shuffling) adjacent list items as required. For example, an instruction “{p:[path,idx], li:obj}” can be used for inserting an object “obj” before an item with an index of “idx” in the list; an instruction “{p:[path,idx], ld:obj}” can be used for deleting the object “obj” with the index of “idx” in the list; an instruction “{p:[path,key], oi:obj}” can be used for inserting the object “obj” into an object at [path]; and an instruction “{p:[path,key], od:before, oi:after}” can be used for replacing the object “before” with the object “after”.
is taken as an example for description. In response to deletion of the data block Bfrom the data block Aas required, an instruction {p:[“children”,1], ld:“B” }can be adopted; in response to insertion of the data block Dbetween the data block Aand the data block B, an instruction {p:[“children”,1], li:“D” }can be adopted; and in response to replacement of the data block Aand the data block Bby a data block Dand a data block E, an instruction {p:[path,key], od:before, oi:after}can be used.
Step S: In response to the first data block being determined to have the reference relationship with the second document, determining the reference relationship between at least one data block in the first document and the second document on the basis of the target operation.
In some embodiments, step Sincludes: updating the reference relationship between the first data block and the second document on the basis of the target operation. If the target operation is to move all or the largest number of referenced data blocks referenced by the second document under the first data block to the second data block in the first document, step Sfurther includes: determining the reference relationship between the second data block and the second document on the basis of the target operation.
In some embodiments, the reference relationship between the first data block and the second document can be updated on the basis of a relative position relationship between the data block targeted by the target operation and other sub-data blocks of the first data block under the first data block.
In some embodiments, the reference relationship between the second data block and the second document can be determined on the basis of the relative position relationship between the referenced data blocks moved to the second data block by the target operation and other sub-data blocks of the second data block.
Examples are provided below for description.
It is assumed that the data block Ain the first document has three sub-data blocks A, Band Cin sequence, the second document references the 2-3 sub-data blocks (Band C) under the data block A; if a user inserts or deletes one sub-data block after the C, the data block referenced by the second document is still the 2-3 sub-data blocks (Band C) under the data block A; if the user inserts 1 sub-data block before the B, the data block referenced by the second document is changed into the 3-4 fourth sub-data blocks (Band C) under the data block A; if the user deletes the sub-data block A, the data block referenced by the second document is changed into the 1-2 sub-data blocks (Band C) under the data block A; and if the user inserts 1 sub-data block Xbetween the Band the C, the data block referenced by the second document is changed into the 2-4 sub-data blocks (B, Xand C) under the data block A.
It is assumed that the sub-data blocks A, Band Cof the first data block Aof the first document are all referenced by the second document, and if the user drags the sub-data blocks Aand Bto be under the second data block Bof the first document, and drags the sub-data block Cto be under a third data block Cof the first document, a reference relationship between the second document and the second data block Bcan be created. Further, if the second data block Bdoes not have the sub-data blocks originally, the reference relationship can be further determined as the 1-2 data blocks under the referenced data block Bof the second document; if the second data block Bhas sub-data blocks Dand Eoriginally in sequence, and the referenced sub-data blocks Aand Bare dragged to be before the sub-data blocks Dand E, the reference relationship is further determined as the 1-2 data blocks under the referenced data block Bof the second document; if the sub-data blocks Aand Bare dragged to be after the original sub-data blocks Dand Eof the second data block B, the reference relationship is further determined as the 3-4 data blocks under the referenced data block Bof the second document; and if the sub-data blocks Aand Bare dragged to be between the sub-data blocks Dand E, the reference relationship is further determined as the 2-3 data blocks under the referenced data block Bof the second document.
As such, according to one or more embodiments of the present disclosure, in response to the target operation being performed on the first data block in the first document, whether the first data block has the reference relationship with the second document is determined; and in response to the first data block being determined to have the reference relationship with the second document, the reference relationship between the at least one data block in the first document and the second document is updated on the basis of the target operation, thus realizing the synchronous updating of the referenced data blocks.
According to one or more embodiments of the present disclosure, a method for controlling a data block is provided and includes:
Step S: In response to a target operation being performed on a first data block, determining whether the first data block is an associated data block of a selected region. The selected region is organized to describe a position and range of referenced data blocks through the associated data block of the selected region and the range of the selected region; and the referenced data block is a data block referenced by at least one online document.
Step S: In response to the first data block being the associated data block of the selected region, re-determining the associated data block and/or range of the selected region on the basis of the target operation.
According to one or more embodiments of the present disclosure, the selected region can be set to describe the position and range of the referenced data block.is taken as an example for schematic explanation, it is assumed that the indexes of the data blocks A, Band Care 0, 1 and 2 in sequence, and the data blocks Aand Bare the referenced data blocks, an associated data block (or an associated node) of a selected region S can be set as Aand the range of the selected region S can be set as [0, 1], which represents that data blocks corresponding to a node (the node A) with index of 0 under the node A, a sub-node (the node B) with index of “1” and sub-nodes (if any) between the node Aand the node Bare the referenced data blocks. “0” represents the start index, “1” represents the end index, and the range of the selected region is a closed interval.
It is to be noted that the range of the selected region can also be other numerical values, numerical value ranges and numerical value intervals, which is not limited here in this embodiment. The first data block in this embodiment can be located in the original document and can also be located in a reference document, and the reference document is an online document referencing one or more data blocks of the original document, which is not limited here in this embodiment.
In some embodiments, one selected region is configured to describe one data block or a set of consecutive data blocks. In some embodiments, if the target operation is to move all or the largest number of the referenced data blocks under the first data block to be under the second data block, the associated data block of the selected region is changed from the first data block to the second data block.
It is to be noted that unless otherwise specified, the “data block under/within the data block A” according to the present disclosure is the sub-data block of the data block A, and the “move the data block A to be under/within the data block B” according to the present disclosure is to move the data block A to be under/within the data block B to make the data block A as the sub-data block of the data block B.
In one specific implementation, for example, referring to, if the user drags referenced data blocksandunder the data blockto be under the data blockin the first online document, the associated data block of the selected region can be correspondingly modified from the original data blockto the data block. Referring, if the user drags the referenced data blocks corresponding to the nodes Aand Bto be under a data block corresponding to the node B, the associated data block (or associated node) of the selected region are modified from the original “A” to “B”.
Further, in some embodiments, on the basis of the relative position relationship between the referenced data block moved to be under the second data block by the target operation and other sub-data blocks of the second data block, the range of the selected region is re-determined.
In one specific implementation, referring, the associated data block of the selected region S is A, and the range is a closed interval [0, 1]. When the user drags the referenced data blocks Aand Bto be under the data block B, the associated data block (or an associated node) of the selected region is determined to be “B” from original “A”, and then the range of the selected region can be re-determined on the basis of the relative position relationship between the referenced data block under the data block Band other sub-data blocks of the data block B. In this embodiment, because the Bdoes not have other sub-data blocks originally, the range of the selected region can still be [0, 1].
In another specific implementation, if the data block Bhas other sub-data blocks such as the data block Doriginally, when the referenced data block corresponding to the data blocks Aand Bis dragged to be after the data block D, the left and right interval values of the range of the selected region can be correspondingly added by 1 and updated to be [1, 2], and the data blocks corresponding to a node (the dragged A) with the index of 1, a sub-node (the dragged A) with the index of 2 and a sub-node (if any) between the node Aand the sub-node Bunder the node Bare the referenced data blocks; when the referenced data block corresponding to the data blocks Aand Bis dragged to be before the data block corresponding to the data block D, namely the data blocks Aand Bare still located at the first two positions under the data block B, the range of the selected region can still be [0, 1].
In one specific implementation, if the user drags the referenced data blocks of the first data block into other different data blocks respectively, the dragged referenced data blocks with the largest number can be used as new associated data blocks of the selected region, and the range of the selected region is re-determined on the basis of the relative position relationship between the referenced data blocks under the new associated data blocks and other sub-data blocks. For example, if all sub-data blocks A, Band C(corresponding to indexes,andrespectively) of the first data block Aare the referenced data blocks, the associated data block of the selected region S can be A, and the range can be [0, 2]; when the user drags the sub-data blocks Aand Bto be under the second data block B, and drags the sub-data block Cto the third data block C, the associated data block of the selected region can be modified from the original first data block Ato the second data block B; if the second data block Bdoes not have sub-data blocks originally, the range of the selected region is [0, 1], that is, the first data block (the dragged sub-data block A) and the second data block (the dragged sub-data block B) under the second data block Bare the referenced data blocks; if the second data block Bhas sub-data blocks Dand Eoriginally, and the referenced sub-data blocks Aand Bare dragged to be before the sub-data blocks Dand E, the range of the selected region is still [0, 1], that is, the first two sub-data blocks under the second data block Bare the referenced data blocks; if the sub-data blocks Aand Bare dragged to be after the original sub-data blocks Dand Eof the second data block B, the corresponding values of the left and right selected regions in the range are added by 2 and updated to be [2, 3], that is, the third sub-data block and the fourth sub-data block under the second data block Bare the referenced data blocks; and if the sub-data blocks Aand Bare dragged to be between the sub-data blocks Dand E, the corresponding values of the left and right selected regions in the range are added by 1 and updated to be [1, 2], that is, the second and third sub-data blocks under the second data block Bare the referenced data blocks.
Unknown
October 9, 2025
Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.