WO2023217074A1 - 控制数据块的方法、装置、系统、电子设备和存储介质 - Google Patents

控制数据块的方法、装置、系统、电子设备和存储介质 Download PDF

Info

Publication number
WO2023217074A1
WO2023217074A1 PCT/CN2023/092714 CN2023092714W WO2023217074A1 WO 2023217074 A1 WO2023217074 A1 WO 2023217074A1 CN 2023092714 W CN2023092714 W CN 2023092714W WO 2023217074 A1 WO2023217074 A1 WO 2023217074A1
Authority
WO
WIPO (PCT)
Prior art keywords
data block
selection
document
target operation
referenced
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2023/092714
Other languages
English (en)
French (fr)
Inventor
张恒宇
韦宗延
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to US18/864,817 priority Critical patent/US20250315597A1/en
Priority to JP2024566544A priority patent/JP2025516375A/ja
Publication of WO2023217074A1 publication Critical patent/WO2023217074A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/31Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/31Indexing; Data structures therefor; Storage structures
    • G06F16/316Indexing structures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/38Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/38Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/382Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using citations
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/0483Interaction with page-structured environments, e.g. book metaphor
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/0486Drag-and-drop

Definitions

  • the present disclosure relates to the field of computer technology, and specifically to a method, device, system, electronic device and storage medium for controlling data blocks.
  • Related online document technology can provide real-time citation function, that is, users can quote a continuous piece of content in another online document in one online document, and when the cited content is modified in the original text/citation, it will be updated in the corresponding citation. /The original text can also be updated accordingly. In this way, a piece of content can appear in multiple documents and be synchronized in real time, which can improve document utilization to a certain extent.
  • the real-time citation function provided by related online document technology is not perfect, and the referenced part is prone to be lost, causing inconvenience to users.
  • a method of controlling data blocks including:
  • the reference relationship between at least one data block in the first document and the second document is updated based on the target operation.
  • a method of controlling data blocks including:
  • a method of controlling data blocks including:
  • the constituency update information is determined by the server based on the following steps: in response to the first data block being executed a target operation, determining whether the first data block is an associated data block of the constituency; in response to If it is determined that the first data block is an associated data block of the selection area, then the associated data block and/or range of the selection area is re-determined based on the target operation; the determination is based on the re-determined associated data block and/or range of the selection area.
  • Selection update information wherein the selection is organized to describe the location and range of the referenced data block through the associated data block of the selection and the range of the selection; the referenced data block is a data block referenced by at least one online document;
  • the selection area is updated based on the selection update information.
  • a device for controlling data blocks including:
  • Determining unit configured to respond to a target operation being performed on the first data block in the first document and determine whether the first data block has a reference relationship with the second document; wherein the target operation is used to insert under the data block , delete, move or replace sub-data blocks;
  • An update unit configured to, in response to determining that the first data block and the second document have a reference relationship, update the reference relationship between at least one data block in the first document and the second document based on the target operation.
  • a device for controlling data blocks including:
  • the referenced data block determination unit is used to determine the referenced data block in the first document, and the referenced data block has a reference relationship with the second document;
  • a position changing unit configured to change the position of the referenced data block in the first document in response to the referenced data block being executed with a target operation
  • a reference unit configured to maintain a reference relationship between the second document and the referenced block in response to changing the location of the referenced data block in the first document.
  • a device for controlling data blocks including:
  • An information receiving unit configured to receive the constituency update information sent by the server; the constituency update information is determined by the server based on the following steps: in response to the target operation being performed on the first data block, determining whether the first data block is a constituency. Associated data blocks; in response to determining that the first data block is an associated data block of the selection area, re-determining the associated data block and/or range of the selection area based on the target operation; based on the re-determined associated data of the selection area The block and/or range determines the selection update information; wherein the selection is organized to describe the location and range of the referenced data block through the associated data block of the selection and the range of the selection; the referenced data block is a referenced data block that is used by at least one online The data block referenced by the document;
  • a selection updating unit is used to update the selection based on the selection update information.
  • a system for controlling data blocks including:
  • a server having a device for controlling data blocks provided in the fourth aspect.
  • At least one terminal having a device for controlling data blocks provided in the sixth aspect.
  • an electronic device including: at least one memory and at least one processor; wherein the memory is used to store program code, and the processor is used to call The program code stored in the memory enables the electronic device to execute the method of controlling a data block provided according to one or more embodiments of the present disclosure.
  • a non-transitory computer storage medium stores program code, and when the program code is executed by a computer device, such that The computer device executes a method for controlling a data block provided according to one or more embodiments of the present disclosure.
  • Figure 1 is a flow chart of a method for controlling data blocks according to an embodiment of the present disclosure
  • Figure 2 is a schematic diagram of an online document provided according to an embodiment of the present disclosure
  • Figure 3 is a schematic diagram of an online document provided according to another embodiment of the present disclosure.
  • Figure 4 is a schematic diagram of node relationships of data blocks provided according to an embodiment of the present disclosure.
  • Figure 5 is a flow chart of a method for controlling data blocks according to an embodiment of the present disclosure
  • Figure 6 is a flowchart of a method for determining the range of a selection based on a target operation according to an embodiment of the present disclosure
  • Figure 7 is a flow chart of a method for determining the range of a selection based on a target operation according to an embodiment of the present disclosure
  • Figure 8 is a schematic diagram of columns provided according to an embodiment of the present disclosure.
  • Figure 9 is a flow chart of a method for controlling data blocks according to yet another embodiment of the present disclosure.
  • Figure 10 is a flow chart of a method for controlling data blocks according to yet another embodiment of the present disclosure.
  • Figure 11 is a schematic structural diagram of a device for controlling data blocks according to an embodiment of the present disclosure.
  • Figure 12 is a schematic structural diagram of a device for controlling data blocks according to another embodiment of the present disclosure.
  • FIG. 13 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
  • the term “include” and its variations are open-ended, ie, "including but not limited to.”
  • the term “based on” means “based at least in part on.”
  • the term “one embodiment” means “at least one embodiment”; the term “another embodiment” means “at least one additional embodiment”; and the term “some embodiments” means “at least some embodiments”.
  • the term “responsive to” and related terms means that one signal or event is affected by another signal or event to some extent, but not necessarily completely or directly. If event x occurs "in response to" event y, x may respond to y, directly or indirectly. For example, the occurrence of y may eventually lead to the occurrence of x, but there may be other intermediate events and/or conditions. In other cases, y may not necessarily cause x to occur, and x may occur even if y has not yet occurred. Furthermore, the term “responsive to” may also mean “responsive at least in part to.”
  • the term "determine” broadly encompasses a wide variety of actions, which may include retrieving, calculating, calculating, processing, deriving, investigating, looking up (e.g., in a table, database, or other data structure), exploring, and similar actions, Also included may be receiving (e.g., receiving information), accessing (e.g., accessing data in memory), and similar actions, as well as parsing, selecting, selecting, creating, and similar actions, and the like. Relevant definitions of other terms will be given in the description below. Relevant definitions of other terms will be given in the description below. Relevant definitions of other terms will be given in the description below.
  • phrase "A and/or B” means (A), (B) or (A and B).
  • Figure 1 shows a method for controlling data blocks provided by an embodiment of the present disclosure, including step S12 and step S14.
  • Step S12 In response to a target operation being performed on the first data block in the first document, determine whether the first data block has a reference relationship with the second document; wherein the target operation is used to insert or delete under the data block. , move or replace sub-data blocks.
  • a data block serves as a basic unit for editing online documents, and a data block can be used to display information such as text information, image information, or multimedia information.
  • a data block can be used to display one or more paragraphs of text, and multiple data blocks can be sub-data blocks of another data block.
  • the second document is a document other than the first document.
  • the second document may be any one or more online documents other than the first document.
  • the second document may be one or more specific online documents other than the first document.
  • the reference relationship between a data block and a document in this embodiment includes one or more sub-data blocks of the data block being referenced by the document, or one or more sub-data of the data block.
  • the block is quoted from this document.
  • Figure 2 shows a schematic diagram of an online document according to an embodiment of the present disclosure.
  • the number Data blocks 10, 11, 12, 13 and 20 respectively display text information such as "text content A1", “text content A2", “text content B2", “text content C2" and "text content B1".
  • data blocks 11, 12 and 13 are sub-data blocks of the first data block 10
  • the first data block 10 and the second data block 20 are sub-data blocks of the data block 30.
  • the data block 30 can also be a sub-data block of other data blocks, which is not limited in this embodiment.
  • the second online document 220 references the data blocks 11 and 12 of the first online document 210 , that is, there is a reference relationship between the second online document 220 and the first data block 10 .
  • FIG. 4 shows a schematic diagram of node relationships of data blocks provided according to an embodiment of the present disclosure.
  • each node can correspond to a data block.
  • node A0 is the parent node of nodes A1 and B1; there are nodes A2, B2 and C2 under node A1, which means that node A1 is the parent node of nodes A2, B2 and C2; there are nodes A3 and B3 under node A2, which means that the node A2 is the parent node of nodes A3 and B3; node B2 has node C3 under it, which means that node B2 is the parent node of node C3.
  • the target operation can support inserting, deleting, moving or replacing items in the list, and shuffling adjacent list items as needed.
  • the instruction “ ⁇ p:[path,idx],li:obj ⁇ ” can be used to insert the object "obj" before the item at index "idx” in the list;
  • the instruction “ ⁇ p:[path,idx] ,ld:obj ⁇ ” can be used to delete the object "obj” with the index value "idx” in the list;
  • the instruction “ ⁇ p:[path,key],oi:obj ⁇ ” can be used to insert the object "obj” into the object at [path];
  • the instruction “ ⁇ p:[path,key],od:before,oi:after ⁇ ” can be used to replace the object "before” with the object "after”.
  • Step S14 In response to determining that the first data block has a reference relationship with the second document, based on the target operation, determine a reference relationship between at least one data block in the first document and the second document.
  • step S14 includes: updating the reference relationship between the first data block and the second document based on the target operation. If the target operation causes all or the largest number of referenced data blocks under the first data block that are referenced by the second document to be moved under the second data block in the first document, step S14 further The method includes: determining a reference relationship between the second data block and the second document based on the target operation.
  • the relationship between the first data block and the first data block may be updated based on the relative positional relationship between the data block targeted by the target operation under the first data block and other sub-data blocks of the first data block.
  • the reference relationship of the second document may be updated based on the relative positional relationship between the data block targeted by the target operation under the first data block and other sub-data blocks of the first data block.
  • the third data block may be determined based on the relative positional relationship between the referenced data block moved under the second data block by the target operation and other sub-data blocks of the second data block. The reference relationship between the two data blocks and the second document.
  • the second document refers to the 2-3 sub-data blocks (i.e., B2 and C2) under the data block A1. If the user is in C2 If a sub-data block is inserted or deleted later, the data block referenced by the second document is still the 2nd-3rd sub-data block under data block A1 (i.e.
  • the sub-data blocks A2, B2 and C2 of the first data block A1 of the first document are all referenced by the second document. If the user drags the sub-data blocks A2 and B2 to the second data block B1 of the first document, By dragging the sub-data block C2 under the third data block C1 of the first document, a reference relationship between the second document and the second data block B1 can be created.
  • the reference relationship can be further determined as the 1-2 data blocks under the second document reference data block B1; if the second data block B1 originally has sub-data blocks in sequence Data blocks D4 and E4, and the referenced sub-data blocks A2 and B2 are dragged to sub-data blocks D4, Before E4, the reference relationship can be further determined as the 1-2th data block under the second document reference data block B1; if sub-data blocks A2 and B2 are dragged to the original sub-data blocks D4 and B1 of the second data block B1, After E4, the reference relationship can be further determined as the 3rd to 4th data block under the second document reference data block B1; if sub-data blocks A2 and B2 are dragged between sub-data blocks D4 and E4, then the reference The relationship can be further determined as the 2nd-3rd data block under the second document referencing data block B1.
  • the target operation in response to the first data block in the first document, determining whether the first data block has a reference relationship with the second document, and in response to determining If the first data block has a reference relationship with the second document, then based on the target operation, the reference relationship between at least one data block in the first document and the second document is updated, so that the referenced data block can be realized synchronized updates.
  • a method of controlling data blocks including:
  • Step S120 In response to the target operation being performed on the first data block, determine whether the first data block is an associated data block of the selection. Wherein, the selection is organized to describe the location and range of the referenced data block through the associated data block of the selection and the range of the selection; the referenced data block is a data block referenced by at least one online document;
  • Step S140 In response to determining that the first data block is an associated data block of the selection area, re-determine the associated data block and/or range of the selection area based on the target operation.
  • the location and range of the referenced data block may be described by setting a selection area.
  • Figure 4 Take Figure 4 as an example for schematic explanation. Assume that the index values of data blocks A2, B2 and C2 are 0, 1, 2 in order, and data blocks A2 and B2 are referenced data blocks, then the associated data of the selection S can be set.
  • the block (or associated node) is A1 and the range of the selection S is [0,1], which represents the node with an index value of 0 (i.e. node A2) under node A1 and the child node with an index value of "1" (i.e. node The data block corresponding to B2) and the child nodes between them (if any) is the referenced data block.
  • "0" is the starting index value
  • "1" is the ending index value
  • the range of the selection is a closed interval.
  • the range of the selection area can also adopt other numerical values, numerical ranges and numerical intervals, which are not limited in this embodiment.
  • the first data block in this embodiment may be located in the original text or in a citation, where the citation is an online document that references one or more data blocks of the original text. This embodiment is not limited here.
  • a selection is used to describe a data block or a group of contiguous data blocks. In some embodiments, if the target operation moves all or the largest number of referenced data blocks under the first data block to the second data block, the associated data blocks of the selection are moved from the The first data block is changed to the second data block.
  • data block under/within data block A refers to the sub-data block of data block A
  • moving data block A to data block mentioned in this disclosure
  • Under/inside B refers to moving data block A to under/inside data block B so that data block A becomes a sub-data block of data block B.
  • the selected area can be The associated data block is correspondingly modified from the original data block 10 to data block 20.
  • the associated data block (or associated node) of the selection will be modified from the original "A1" to "B1" ".
  • the associated data block of the selection area S is A1, and the range is the closed interval [0,1].
  • the associated data block (or associated node) of the selection is first determined from the original "A1" to "B1", and then, based on the referenced data, The relative positional relationship between the block under the data block B1 and other sub-data blocks of the data block B1 re-determines the scope of the selection.
  • the range of the selection area can still be [0,1].
  • the dragged referenced data block with the largest number can be used as the selected area.
  • New associated data block, and based on the relative position relationship between the referenced data block and other sub-data blocks under the new associated data block, the range of the selection area is re-determined.
  • the associated data block of the selection S can be A1, and the range can be [0,2], when the user drags the sub-data blocks A2 and B2 to the second data block B1, and drags the sub-data block C2 to the third data block C1, the associated data block of the selection can be The original first data block A1 is modified into the second data block B1. If the second data block B1 originally has no sub-data blocks, the range of the selection is [0,1], which means the first data block under the second data block B1.
  • the data block (i.e., the sub-data block A2 after dragging) and the second data block (i.e., the sub-data block B2 after dragging) are referenced data blocks; if the second data block B1 originally has sub-data blocks D4 and E4, and the referenced sub-data blocks A2 and B2 are dragged before sub-data blocks D4 and E4, the range of the selection is still [0,1], which means the first two sub-data blocks under the second data block B1 is the referenced data block; if the sub-data blocks A2 and B2 are dragged after the original sub-data blocks D4 and E4 of the second data block B1, the left and right interval values of the range of the selection will be increased by 2 accordingly and updated to [2,3 ], that is, it can mean that the third and fourth sub-data blocks under the second data block B1 are referenced data blocks; if sub-data blocks A2 and B2 are dragged between sub-data blocks D4 and E4, the left and right sides of the selection range
  • the target operation moves the referenced data block within the first data block
  • the associated data block of the selection remains unchanged; based on the moved referenced data block
  • the relative positional relationship with other sub-data blocks of the first data block re-determines the range of the selection area.
  • the referenced data block can be changed based on the movement of the referenced data block. Just reposition the selection range.
  • the real-time citation function provided by the relevant online document technology is not perfect, and it is easy for the cited part to be lost. For example, when a user moves or drags content referenced by other online documents in an online document, the referenced content will be lost in the other online document. This is because a continuous piece of content that is dragged is often considered to be in the original text. been deleted.
  • the location and range of the referenced data block are described by the associated data block of the selection and the range of the selection, and when the target operation is performed on the associated data block of the selection, according to the The above target operation redetermines the associated data block and/or range of the selection, so that by synchronously updating the associated data block and/or range of the selection to update the reference relationship between the data block and the reference document, the referenced data block can be realized. Synchronization Update.
  • the target operation includes a first operation instruction, or a first operation instruction and a second operation instruction; the first operation instruction is used to edit the first data block, and the second operation instruction is used to edit For data blocks other than the first data block, the first operation instruction is implemented before the second operation instruction.
  • the first operation instruction is used to delete at least one sub-data block of the first data block
  • the second operation instruction is used to insert at least one sub-data block into other data blocks other than the first data block. sub-data block.
  • the target operation includes a drag operation, which is used to drag one or more sub-data blocks from under the first data block to other data blocks other than the first data block.
  • the drag operation can delete one or more sub-data blocks in the first data block and insert the one or more sub-data blocks under other data blocks.
  • step S140 includes:
  • Step A10 Determine the initial update range of the selection area based on the first operation instruction
  • Step A21 If it is determined based on the first operation instruction that the initial update range of the selection area is empty, and it is determined that the initial update range from the first data If the parent data block of the referenced data block deleted under the data block is changed to a data block other than the first data block, the parent data of the referenced data block deleted from the first data block will contain the largest number. block as a new associated data block of the selected area, and the final range of the selected area is determined according to the second operation instruction for the new associated data block.
  • the first operation instruction deletes all referenced data blocks under the first data block; if further Determining that the parent data block of the referenced data block deleted from the first data block is changed to another data block other than the first data block indicates that the referenced data block deleted from the first data block may actually be Dragged by the user to other data blocks, therefore, by further redefining the parent data block containing the largest number of deleted referenced data blocks as the new associated data block of the selection, and based on the new associated data block
  • the second operation instruction of the associated data block can determine the final range of the selection. For example, the range of the selection area may be re-determined based on the relative positional relationship between the deleted referenced data block under the new associated data block and other sub-data blocks of the new associated data block.
  • step S140 includes:
  • Step A22 If it is determined based on the first operation instruction that the initial update range of the selection is not empty, or it is determined that the parent data block of the referenced data block deleted from the first data block has not been changed to the first data block. For data blocks other than data blocks, the initial update range will be used as the final range of the selection.
  • the initial update range of the selection is not empty, or it is determined that the parent data block of the referenced data block deleted from the first data block has not changed to the If there are other data blocks other than the first data block, it means that the referenced data block under the first data block has not been dragged and dropped by the user, but may have been directly deleted by the user. In this case, the referenced data block can be directly determined based on the first operation instruction.
  • the initial update range of the selection is used as the final range of the selection.
  • the "referenced data block deleted from the first data block" in steps A21 and A22 may further be "the last continuously deleted referenced data block from the first data block".
  • the operation instructions generated by the user's drag operation will involve two data blocks in succession. For example, when the user drags multiple sub-data blocks from data block A to data block B, the drag operation will trigger the data block in succession.
  • the last data block of data block A The implemented operation instruction must be used to continuously delete one or more of its sub-data blocks, because the next operation instruction is a data block insertion instruction for data block B. Therefore, in this embodiment, by determining whether the parent data block of the last continuously deleted referenced data block under the first data block has changed, it can be more accurately determined whether these referenced data blocks have been dragged by the user. Drag operation.
  • the operation instructions for the data blocks can be recorded according to the time sequence, and it can be determined whether the last consecutive one or more operation instructions for the first data block are deletion operation instructions, and the deletion operation instructions can be determined. Whether the parent data block of the deleted referenced data block is changed to a data block other than the first data block, so that it can be determined whether the parent data block of the last continuously deleted referenced data block under the first data block is changed. are other data blocks other than the first data block.
  • Figure 5 shows a flow chart of a method 500 for controlling data blocks provided by an embodiment of the present disclosure.
  • the method 500 includes:
  • Step S501 Record the data block on which the target operation is performed and the child data block where the parent data block is changed;
  • Step S502 Determine whether the data block on which the target operation is performed is an associated data block of the selection
  • step S503 is executed: update the range of the selection based on the target operation of the current related data block of the selection.
  • Step S504 Determine whether the update to the selection range in step S503 is an update based on the first operation instruction, and whether the update result is empty, and whether the parent data block of the last continuously deleted sub-data block has changed;
  • step S505 is executed: select the parent data block containing the largest number of deleted referenced data blocks as the new associated data block of the selection.
  • step S503 can be performed again.
  • step S503 when step S503 is executed for the first time, the range of the selection is updated based on the first operation instruction of the initial associated data block of the selection, and when step S503 is executed again, the range of the selection is updated based on A target operation (eg, a second operation instruction) for a new associated data block of the selection updates the range of the selection.
  • a target operation eg, a second operation instruction
  • step S506 determine the selection update information based on the re-determined associated data block and/or range of the selection zone;
  • Step S507 The selection update is completed
  • Step S508 Broadcast the constituency update information.
  • step S140 includes: if the target operation is to add an item to the left of the left endpoint under the current associated data block of the selection area. Or delete N data blocks, then the values corresponding to the left endpoint and right endpoint of the selection area will increase or decrease by N; or, if the target operation is used under the current associated data block of the selection area, at the right end Add or delete N data blocks to the right of the point, then the values corresponding to the left endpoint and the right endpoint remain unchanged; or, if the target operation is used to add or delete N data blocks under the current associated data block of the selection area, under all If N data blocks are added or deleted between the left endpoint and the right endpoint, the value corresponding to the right endpoint of the selection area increases or decreases by N, and the value corresponding to the left endpoint remains unchanged; where N is a positive integer. .
  • data block A1 has sub-data blocks A2, B2, C2 and D2, which correspond to the index value array ⁇ 0,1,2,3 ⁇ respectively. If data blocks B2 and C2 are referenced data blocks, then the associated data block of selection S is A1, and the range of selection S is [1,2]. If the user inserts or deletes N data blocks to the left of the left endpoint of the selection, that is, before data block B2, the entire selection will be moved backward or forward by N positions.
  • the left and right endpoint values of the selection area add N or subtract N; if the user inserts or deletes N data blocks to the right of the right endpoint of the selection area, that is, after data block C2, the left and right endpoint values of the selection area remain unchanged; if the user Add or delete N data blocks between the left and right endpoints, and the range of the selection is [1,2 ⁇ N].
  • step S140 also includes: if the target operation is used to add N data blocks at any endpoint of the selection within the original text, the range of the selection remains unchanged; or, if the target operation Used to add N data blocks within the quotation at the right endpoint of the selection, then the values corresponding to the right endpoints of the selection are increased by N; the values corresponding to the left endpoint remain unchanged; or, if the The target operation is used to add N data blocks in the quotation at the left endpoint of the selection, then the values corresponding to the left endpoint and the right endpoint of the selection are increased by N; wherein the quotation is a reference to the original text Online documentation for one or more data blocks.
  • the user who edited the original text may not be the user who quoted the data block. Therefore, according to one or more embodiments of the present disclosure, when the user inserts a data block at the endpoint of the selection in the citation, the scope of the selection is correspondingly expanded, and when the user adds a data block at the endpoint of the selection in the original text, This data block is not used as a new referenced data block, so that synchronous reference updates that are more in line with user intentions can be achieved.
  • the associated nodes and range of the selection will not be changed, that is, the referenced data block in the original text remains unchanged; if the user inserts the referenced data block within the citation or in the selection, Data block, you can change the range of the selection, that is, the referenced data block in the original text will also change accordingly.
  • FIG. 6 shows a flowchart of a method for determining the range of a selection based on a target operation according to an embodiment of the present disclosure.
  • Method 600 includes steps S601 to S610.
  • Step S601 Determine whether the target operation on the associated data block of the selection includes a data block deletion instruction, where the data block deletion instruction is used to delete the data block at an index value (index).
  • the data block insertion instruction can be the instruction ⁇ p:[path,idx],ld:obj ⁇ , and the index value can be the value corresponding to "idx" in the instruction.
  • Step S602 Determine whether the index value is less than or equal to the end index value of the selection.
  • step S606 is executed: the update of the selection range is completed.
  • the deletion instruction of the data block is used to delete the data block on the right side of the right boundary of the selection, without affecting the range of the selection, and there is no need to update the selection.
  • Step S604 Determine whether the index value is smaller than the starting index value of the selection area.
  • the deletion instruction of the data block is used to delete the data block on the left side of the left boundary of the selection, which is equivalent to reducing the data block on the left side of the selection.
  • One bit, so the entire selection needs to be moved one bit to the left, that is, the starting index value and the ending index value of the selection are both reduced by one.
  • step S606 is executed: the update of the selection range is completed.
  • the index value corresponding to the deletion instruction is greater than or equal to the start index value of the selection and less than or equal to the end index value of the selection (i.e. start ⁇ index ⁇ end)
  • start ⁇ index ⁇ end it means that the deletion instruction of the data block is for the data block in the selection
  • the deletion command is executed, so the starting index value of the selection remains unchanged and only the ending index value decreases by one, that is, the selection range eventually becomes smaller.
  • the data block deletion instruction in one or more of the foregoing embodiments is to delete one data block.
  • multiple data blocks can be deleted sequentially through multiple deletion instructions (for example, looping the above Steps S601-S606), or by deleting multiple data blocks through one deletion instruction, the disclosure is not limited here.
  • FIG. 7 shows a flowchart of a method for determining the range of a selection based on a target operation according to an embodiment of the present disclosure.
  • the method 700 includes steps S701 to S710.
  • Step S701 Determine whether the target operation on the associated data block of the selection includes a data block insertion instruction, where the data block insertion instruction is used to insert a data block at an index value (index).
  • the data block insertion instruction can be the instruction ⁇ p:[path,idx],li:obj ⁇ , and the index value can be the value corresponding to "idx" in the instruction.
  • Step S702 Determine whether the range of the selection area is empty. For example, when the end index value of the selection is less than the start index value, it means that the range of the selection is empty.
  • step S7021 determine whether the data block inserted by the insertion instruction is a referenced data block dragged from the previous associated data block of the selection; wherein, The previous associated data block of the above selection is The associated data block before the associated data block of the selection area is updated. That is, this step is used to determine that the inserted data block is a data block dragged from the previous selection.
  • step S710 the update of the selection range is completed.
  • the judgment is no, it means that the data block inserted by the current insertion instruction is not the referenced data block dragged by the user from the previous associated data block of the selection, and there is no need to update the range of the selection.
  • step S703 determine whether the data block inserted by the insertion instruction is a referenced data block dragged from the previous associated data block of the selection, or, Determine whether the data block insertion instruction is for an associated data block in the citation.
  • the citation is an online document that refers to the cited data block.
  • the sub-data blocks 11 and 12 under the first data block 10 of the first online document 210 are referenced by the second online document 220, and the second online document is the one in step S703. "Citation", and step S703 is used to determine whether the data block insertion instruction is an instruction acting on the parent data block where the referenced data block in the second online document is located.
  • Step S706 Determine whether the index value (index) is less than or equal to the right threshold.
  • step S710 the selection range update is completed.
  • the insertion instruction is considered to insert the data block to the right of the right endpoint of the selection, and there is no need to update the selection range.
  • Step S708 Determine whether the index value is less than the left threshold.
  • the insertion instruction is considered to insert the data block to the left of the left endpoint of the selection, so the final left and right interval values of the selection are increased by 1 accordingly.
  • the insertion instruction is considered to insert a data block within the selection range, so the left interval value of the final selection remains unchanged and the right interval value is increased by 1.
  • Step S710 The selection range update is completed.
  • the left and right thresholds can represent the "fictitious" selection range (the left and right thresholds can respectively correspond to the left and right intervals).
  • the left and right thresholds corresponding to the former form an interval range (i.e. [start,end+1])
  • the interval range formed by the left and right thresholds formed by the latter ie [start+1,end]
  • step S140 includes:
  • Step C1 If the target operation is used to drag the referenced data block under the first data block to be parallel to the first data block, create a new data block as the dragged data block. Reference the parent data block of the data block; the new data block and the parent data block of the first data block have a common parent data block;
  • Step C2 Update the associated data block of the selection area to the new data block
  • Step C3 Update the range of the selection based on the number of referenced data blocks dragged to the new data block by the target operation.
  • the user can use the column splitting operation to juxtapose the sub-data blocks A2 and B2 below the data block A1 with the data block A1, so that the data blocks A2 and B2 and the data block A1 belong to two different columns.
  • the data block 41 may be created as a parent data block of the columnar data blocks A2 and B2, and the parent data block 42 of the data block 41 and A1 has a common parent data block 40. If sub-data blocks A2 and B2 are referenced data blocks, the associated data block of the selection can be updated from data block A1 to data block 41, and the range of the selection can be updated based on the number of referenced data blocks under data block 41.
  • the range of the selection was originally [0,1], and the range is still [0,1] after the selection is updated.
  • the user can drag the data blocks A2 and B2 to the left or right side of their parent data blocks to realize the left and right columns of the dragged data blocks and their original parent data blocks.
  • a method of controlling data blocks including:
  • Step B1 Determine the referenced data block in the first document, which has a reference relationship with the second document.
  • Step B2 In response to the target operation being performed on the referenced data block, change the location of the referenced data block in the first document;
  • Step B3 In response to changing the location of the referenced data block in the first document, maintain the reference relationship between the second document and the referenced block.
  • the reference relationship between the referenced data block and the second document is that the second document references the referenced data block.
  • the referenced data block is a data block or a group of continuous data blocks.
  • the target operation includes a drag operation for moving the data block.
  • the drag operation can move its sub-data blocks within the data block, or move the sub-data blocks between data blocks.
  • the drag-and-drop operation can delete one or more sub-data blocks in the first data block, and The one or more sub-data blocks are inserted under other data blocks.
  • the real-time citation function provided by the relevant online document technology is not perfect, and it is easy for the cited part to be lost.
  • the referenced content will often be lost in the other online document. This is because a continuous piece of content being dragged is often considered to be the content in the online document. Deleted from the original article.
  • the location and range of the referenced data block are described by the associated data block of the selection and the range of the selection; the associated data block of the selection is the parent data block of the referenced data block.
  • step B3 includes: re-determining the associated data block and/or range of the selection based on the target operation.
  • a method for controlling data blocks including:
  • Step S920 Receive the constituency update information sent by the server; the constituency update information is determined by the server based on the following steps: in response to the target operation being performed on the first data block, determining whether the first data block is an associated data block of the constituency ; In response to determining that the first data block is an associated data block of the selection area, re-determine the associated data block and/or range of the selection area based on the target operation; based on the re-determined associated data block and/or range of the selection area; or scoped constituency update information; wherein the constituency is organized To describe the location and range of the referenced data block through the associated data block of the selection and the range of the selection; the referenced data block is a data block referenced by at least one online document;
  • Step S940 Update the selection area based on the selection area update information.
  • a method for controlling data blocks including steps S1001 to S1003:
  • Step S1001 Determine whether the associated data block of the selection has been changed.
  • step S1002 is executed: update the selection based on the selection update information sent by the server.
  • the selection update information may be pulled from the server and the selection may be updated based on the selection update information.
  • step S1003 is executed: re-determine the range of the selection based on the target operation for the associated data block, and update the selection based on the re-determined range of the selection.
  • step S1002 is executed. That is, when the client determines that the selection range is empty based on the target operation, it directly pulls the server's selection update information to update the selection.
  • the target operation when the target operation does not change the associated data block of the selection, it means that the target operation is only editing within the associated data block, such as inserting, deleting sub-data blocks, etc.
  • the client does not need to completely
  • the range of the selection can be updated by relying on the selection update information pushed by the server, thereby improving the timeliness and consistency of synchronized references.
  • an apparatus 1100 for controlling data blocks including:
  • Determining unit 1120 configured to respond to a target operation being performed on the first data block in the first document and determine whether the first data block has a reference relationship with the second document; wherein the target operation is used to perform the target operation under the data block. Insert, delete, move or replace sub-blocks of data;
  • Update unit 1140 configured to, in response to determining that the first data block and the second document have a reference relationship, update the reference relationship between at least one data block in the first document and the second document based on the target operation.
  • apparatus 1100 further includes:
  • an information generation unit configured to determine the constituency update information based on the redetermined associated data block and/or range of the constituency
  • An information sending unit configured to send the constituency update information to the client, so that the client can update the constituency based on the constituency update information.
  • an apparatus for controlling data blocks including:
  • the referenced data block determination unit is used to determine the referenced data block in the first document, and the referenced data block has a reference relationship with the second document;
  • a position changing unit configured to change the position of the referenced data block in the first document in response to the referenced data block being executed with a target operation
  • a reference unit configured to maintain a reference relationship between the second document and the referenced block in response to changing the location of the referenced data block in the first document.
  • an apparatus 1200 for controlling data blocks including:
  • Information receiving unit 1220 configured to receive constituency update information sent by the server; the constituency update information is determined by the server based on the following steps: in response to the target operation being performed on the first data block, determining whether the first data block is a constituency The associated data block; in response to determining that the first data block is an associated data block of the selection area, re-determining the associated data block and/or range of the selection area based on the target operation; based on the re-determined association of the selection area The data block and/or range determines the selection update information; wherein the selection is organized to describe the location and range of the referenced data block through the associated data block of the selection and the range of the selection; the referenced data block is a referenced data block that is referenced by at least one Data blocks referenced by online documents;
  • the selection updating unit 1240 is configured to update the selection based on the selection update information.
  • the device embodiment since it basically corresponds to the method embodiment, please refer to the partial description of the method embodiment for relevant details.
  • the device embodiments described above are only illustrative, and the modules described as separate modules may or may not be separate. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Persons of ordinary skill in the art can understand and implement the method without any creative effort.
  • a system including: a server having a device 1100 for controlling data blocks; and at least one terminal having a device 1200 for controlling data blocks.
  • terminals include but are not limited to mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PAD (tablet computers), PMP (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc. mobile terminals as well as fixed terminals such as digital TVs, desktop computers, etc.
  • the terminal is connected to the server 402 through a local area network, a wide area network or the Internet, and a wired connection or a wireless connection is established between the terminal and the server.
  • the wired connection includes but is not limited to PoE, coaxial cable, optical fiber, and USB data connection.
  • an electronic device including:
  • the memory is used to store program codes
  • the processor is used to call the program codes stored in the memory to cause the electronic device to execute the method of controlling the data block provided according to one or more embodiments of the present disclosure.
  • a non-transitory computer storage medium stores program code, and the program code can be executed by a computer device to cause the computer device to execute
  • a method for controlling data blocks is provided according to one or more embodiments of the present disclosure.
  • Terminal devices in embodiments of the present disclosure may include, but are not limited to, mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablets), PMPs (Portable Multimedia Players), vehicle-mounted terminals (such as Mobile terminals such as car navigation terminals) and fixed terminals such as digital TVs, desktop computers, etc.
  • the electronic device shown in FIG. 13 is only an example and should not bring any limitations to the functions and scope of use of the embodiments of the present disclosure.
  • the electronic device 1300 may include a processing device (eg, central processing unit, graphics processor, etc.) 1301, which may be loaded into a random access device according to a program stored in a read-only memory (ROM) 1302 or from a storage device 1308.
  • the program in the memory (RAM) 1303 executes various appropriate actions and processes.
  • various programs and data required for the operation of the electronic device 1300 are also stored.
  • the processing device 1301, ROM 1302 and RAM 1303 are connected to each other via a bus 1304.
  • An input/output (I/O) interface 1305 is also connected to bus 1304.
  • the following devices may be connected to the I/O interface 1305: input devices 1306 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speaker, vibration An output device 1307 such as a computer; a storage device 1308 including a magnetic tape, a hard disk, etc.; and a communication device 1309.
  • the communication device 1309 may allow the electronic device 1300 to communicate wirelessly or wiredly with other devices to exchange data.
  • FIG. 13 illustrates electronic device 1300 with various means, it should be understood that implementation or availability of all illustrated means is not required. More or fewer means may alternatively be implemented or provided.
  • embodiments of the present disclosure include a computer program product including a computer program carried on a computer-readable medium, the computer program containing program code for performing the method illustrated in the flowchart.
  • the computer program may be downloaded and installed from the network via communication device 1309, or from storage device 1308, or from ROM 1302.
  • the processing device 1301 the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
  • the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable medium. storage media or any combination of the above.
  • the computer-readable storage medium may be, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any combination thereof. More specific examples of computer readable storage media may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard drive, random access memory (RAM), read only memory (ROM), removable Programmd read-only memory (EPROM or flash memory), fiber optics, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device .
  • Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wire, optical cable, RF (radio frequency), etc., or any suitable combination of the above.
  • the client and server can communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and can communicate with digital data in any form or medium.
  • Communications e.g., communications network
  • communications networks include local area networks (“LAN”), wide area networks (“WAN”), the Internet (e.g., the Internet), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or developed in the future network of.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; it may also exist independently without being assembled into the electronic device.
  • the above-mentioned computer-readable medium carries one or more programs.
  • the electronic device When the above-mentioned one or more programs are executed by the electronic device, the electronic device is caused to perform the above-mentioned method of the present disclosure.
  • Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional Procedural programming language—such as "C" or a similar programming language.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
  • the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as an Internet service provider through Internet connection).
  • LAN local area network
  • WAN wide area network
  • Internet service provider such as an Internet service provider through Internet connection
  • each block in the flowchart or block diagram may represent a module, segment, or portion of code that contains one or more logic functions that implement the specified executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown one after another may actually execute substantially in parallel, or they may sometimes execute in the reverse order, depending on the functionality involved.
  • each block of the block diagram and/or flowchart illustration, and combinations of blocks in the block diagram and/or flowchart illustration can be implemented by special purpose hardware-based systems that perform the specified functions or operations. , or can be implemented using a combination of specialized hardware and computer instructions.
  • the units involved in the embodiments of the present disclosure can be implemented in software or hardware. Among them, the name of a unit does not constitute a limitation on the unit itself under certain circumstances.
  • FPGAs Field Programmable Gate Arrays
  • ASICs Application Specific Integrated Circuits
  • ASSPs Application Specific Standard Products
  • SOCs Systems on Chips
  • CPLD Complex Programmable Logical device
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with an instruction execution system, apparatus, or device.
  • the machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any suitable combination of the foregoing.
  • machine-readable storage media would include one or more wire-based electrical connections, laptop disks, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • RAM random access memory
  • ROM read only memory
  • EPROM or flash memory erasable programmable read only memory
  • CD-ROM portable compact disk read-only memory
  • magnetic storage device or any suitable combination of the above.
  • a method of controlling a data block including: in response to a target operation being performed on a first data block in a first document, determining whether the first data block is consistent with a second data block.
  • the document has a reference relationship; wherein the target operation is used to insert, delete, move or replace a sub-data block under the data block; in response to determining that the first data block has a reference relationship with the second document, based on the target Operation: update the reference relationship between at least one data block in the first document and the second document.
  • updating a reference relationship between at least one data block in the first document and the second document based on the target operation includes: updating the The reference relationship between the first data block and the second document; if the target operation moves all or the largest number of referenced data blocks under the first data block that are referenced by the second document to the under the second data block in the first document, then based on the target operation, updating the reference relationship between at least one data block in the first document and the second document further includes: based on the target operation, Determine a reference relationship between the second data block and the second document.
  • updating the reference relationship between the first data block and the second document based on the target operation includes: based on the location of the data block targeted by the target operation.
  • the relative position relationship between the first data block and other sub-data blocks of the first data block is updated, and the reference relationship between the first data block and the second document is updated.
  • determining a reference relationship between the second data block and the second document based on the target operation includes: moving to the second document based on the target operation.
  • the relative positional relationship between the referenced data block under the data block and other sub-data blocks of the second data block determines the reference relationship between the second data block and the second document.
  • determining whether the first data block has a reference relationship with the second document includes: determining whether the first data block is an associated data block of the selection;
  • the target operation is to determine the reference relationship between at least one data block in the first document and the second document, including: in response to determining that the first data block is an associated data block of the selection, re-starting based on the target operation.
  • re-determining the associated data blocks of the selection based on the target operation includes: if the target operation removes all or the largest number of the first data block When the referenced data block is moved to the second data block, the associated data block of the selected area is changed from the first data block to the second data block.
  • redetermining the range of the selection based on the target operation includes: based on the difference between the referenced data block moved under the second data block by the target operation and the The relative positional relationship of other sub-data blocks of the second data block is used to re-determine the range of the selection area.
  • redetermining the associated data block and/or range of the selection based on the target operation includes: if the target operation is used to move within the first data block The referenced data block, then the associated data block of the selection remains unchanged; based on the relative positional relationship between the moved referenced data block and other sub-data blocks of the first data block, re-determine the Describe the scope of the electorate.
  • the target operation is used to trigger a first operation instruction, or is used to trigger a first operation instruction. and a second operation instruction; the first operation instruction is used to edit the first data block, and the second operation instruction is used to edit other data blocks other than the first data block.
  • redetermining the associated data block and/or range of the selection based on the target operation includes: determining an initial update range of the selection based on the first operation instruction; If it is determined based on the first operation instruction that the initial update range of the selection is empty, and it is determined that the parent data block of the referenced data block deleted from the first data block is changed to another data block other than the first data block. data block, then the parent data block containing the largest number of referenced data blocks deleted from the first data block will be used as the new associated data block of the selection, and the parent data block will be used according to all the parameters for the new associated data block.
  • the second operation instruction is used to determine the final range of the selection area.
  • re-determining the associated data block and/or range of the selection based on the target operation includes: if the initial update range of the selection is determined based on the first operation instruction is not empty, or it is determined that the parent data block of the referenced data block deleted from the first data block has not been changed to another data block other than the first data block, then the initial update range is used as the selection area. the final scope.
  • the first operation instruction is used to delete at least one sub-data block of the first data block
  • the second operation instruction is used to delete data outside the first data block. Insert at least one sub-data block into other data blocks.
  • the target operation includes a drag operation on the data block.
  • the range of the selection area has a left endpoint and a right endpoint
  • redetermining the range of the selection area based on the target operation includes: if the target operation is used in the selection area If N data blocks are added or deleted to the left of the left endpoint, the values corresponding to the left endpoint and the right endpoint of the selection area will both increase or decrease by N; or, if the target operation is used to operate on the right side of the right endpoint of the selection area, If N data blocks are added or deleted on the side, the values corresponding to the left endpoint and the right endpoint remain unchanged; or, if the target operation is used to add or delete N data blocks between the left endpoint and the right endpoint of the selection area, data block, then the value corresponding to the right endpoint of the selection area increases or decreases by N, and the value corresponding to the left endpoint remains unchanged; where N is a positive integer.
  • redetermining the range of the selection based on the target operation includes: if the target operation is used to add N data blocks at any endpoint of the selection within the original text , then the range of the selection area remains unchanged; or, if the target operation is used to add N data blocks at the right endpoint of the selection area within the citation, then the values corresponding to the right endpoints of the selection area are increased by N , and the value corresponding to the left endpoint remains unchanged; or, if the target operation is used to add N data blocks within the quotation at the left endpoint of the selection, then the left endpoint and right end of the selection The values corresponding to the points are increased by N; where the citation is an online document that references one or more data blocks of the original text.
  • redetermining the associated data block and/or range of the selection based on the target operation includes: if the target operation is used to convert the data block under the first data block. If the referenced data block is dragged to be parallel to the first data block, a new data block will be created as the parent data block of the dragged referenced data block; the associated data block of the selection area will be updated to the The new data block, wherein the new data block and the first data block have a common parent data block; based on the number of referenced data blocks dragged under the parent data block by the target operation, update The scope of the constituency.
  • the target operation is a column operation.
  • the method further includes: determining constituency update information based on the redetermined associated data block and/or range of the constituency; sending the constituency update information to the client, so that the client The terminal can update the selected area based on the selected area update information.
  • a method of controlling data blocks including: determining a referenced data block in a first document, the referenced data block having a reference relationship with a second document; responding to The referenced data block is subjected to a target operation, and the location of the referenced data block is changed in the first document; in response to the location of the referenced data block being changed in the first document, the location of the referenced data block is maintained.
  • the reference relationship between the second document and the referenced block is provided, including: determining a referenced data block in a first document, the referenced data block having a reference relationship with a second document; responding to The referenced data block is subjected to a target operation, and the location of the referenced data block is changed in the first document; in response to the location of the referenced data block being changed in the first document, the location of the referenced data block is maintained.
  • the reference relationship between the second document and the referenced block in response to the location of the referenced data block being changed in the first document.
  • the location and range of the referenced data block are described by the associated data block of the selection and the range of the selection; the associated data block of the selection is the parent of the referenced data block. data block.
  • maintaining the reference relationship between the second document and the referenced block includes: re-determining the associated data block and/or range of the selection based on the target operation, To maintain the reference relationship between the second document and the referenced block.
  • the target operation includes a drag operation.
  • a method for controlling data blocks is provided, which is applied to a client and includes: receiving constituency update information sent by a server; the constituency update information is determined by the server based on the following steps: In response to the target operation being performed on the first data block, determine whether the first data block is an associated data block of the selection; in response to determining that the first data block is an associated data block of the selection, re-determine based on the target operation associated data blocks and/or ranges of the selection; determining selection update information based on the redetermined associated data blocks and/or ranges of the selection; wherein the selection is organized into associated data blocks and ranges of the selection To describe the location and range of the referenced data block; the referenced data block is a data block referenced by at least one online document; the selection is updated based on the selection update information.
  • the method before updating the selection based on the selection update information, the method further includes: determining whether the associated node of the selection has changed; if the associated node of the selection If the associated node has not changed, then the range of the selected area is re-determined based on the target operation for the associated node, and the selected area is updated based on the re-determined range of the associated data block of the selected area; if If the associated node is changed, the step of updating the selection based on the selection update information is performed.
  • the method further includes: if the range of the associated data block redetermined based on the target operation is empty, performing the step of updating the selection based on the selection update information. Steps for updating.
  • an apparatus for controlling a data block including: a determining unit configured to determine the first data in response to a target operation being performed on the first data block in the first document. Whether the block has a reference relationship with the second document; wherein the target operation is used to insert, delete, move or replace sub-data blocks under the data block; the update unit is used to respond to determining whether the first data block is consistent with the second document. If the document has a reference relationship, based on the target operation, the reference relationship between at least one data block in the first document and the second document is updated.
  • a device for controlling data blocks including: a referenced data block determining unit configured to determine a referenced data block in the first document, the referenced data block being the same as The second document has a reference relationship; a position change unit is used to perform a target operation in response to the referenced data block, and change the position of the referenced data block in the first document; a reference unit is used to respond to The position of the referenced data block in the first document is changed, and the reference relationship between the second document and the referenced block is maintained.
  • a device for controlling data blocks including: an information receiving unit configured to receive constituency update information sent by a server; the constituency update information is determined by the server based on the following steps : In response to the target operation being performed on the first data block, determine whether the first data block is an associated data block of the selection area; in response to determining that the first data block is an associated data block of the selection area, re-start based on the target operation.
  • Determining associated data blocks and/or ranges of the selection area Determining associated data blocks and/or ranges of the selection area; determining selection update information based on the redetermined associated data blocks and/or ranges of the selection area; wherein the selection area is organized into associated data blocks of the selection area and The range is used to describe the location and range of the referenced data block; the referenced data block is a data block referenced by at least one online document; and a selection update unit is used to update the selection based on the selection update information.
  • an electronic device including: at least one memory and at least one processor; wherein the memory is used to store program code, and the processor is used to call the memory.
  • the program code is stored to cause the electronic device to execute the method of controlling the data block provided in accordance with one or more embodiments of the present disclosure.
  • a non-transitory computer storage medium stores program code, and when the program code is executed by a computer device, the computer device causes A method of controlling a data block provided in accordance with one or more embodiments of the present disclosure is executed.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • General Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Library & Information Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本公开涉及计算机技术领域,具体涉及控制数据块的方法、装置、系统、电子设备和存储介质。根据本公开实施例提供的控制数据块的方法,包括:响应于第一文档中的第一数据块被执行目标操作,确定第一数据块是否与第二文档具有引用关系;其中,目标操作用于在数据块下插入、删除、移动或替换子数据块,引用关系包括数据块的一个或多个子数据块被文档引用;响应于确定第一数据块与第二文档具有引用关系,则基于目标操作,更新第一文档中至少一个数据块与第二文档的引用关系。

Description

控制数据块的方法、装置、系统、电子设备和存储介质
相关申请的交叉引用
本申请基于申请号为202210515870.7、申请日为2022年05月11日、名称为“控制数据块的方法、装置、系统、电子设备和存储介质”的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
技术领域
本公开涉及计算机技术领域,具体涉及一种控制数据块的方法、装置、系统、电子设备和存储介质。
背景技术
相关在线文档技术可以提供实时引用功能,即用户可以在一篇在线文档中引用另一篇在线文档中的一段连续内容,且被引用的内容在原文/引文中被修改时,其在对应的引文/原文中亦可以进行相应的更新。这样,一段内容支持在多篇文档里出现并实时同步,这在一定程度上能提高文档的利用率。然而,相关在线文档技术提供的实时引用功能并不完善,容易出现被引用部分丢失的问题,给用户带来不便。
发明内容
提供该发明内容部分以便以简要的形式介绍构思,这些构思将在后面的具体实施方式部分被详细描述。该发明内容部分并不旨在标识要求保护的技术方案的关键特征或必要特征,也不旨在用于限制所要求的保护的技术方案的范围。
第一方面,根据本公开的一个或多个实施例,提供了一种控制数据块的方法,包括:
响应于第一文档中的第一数据块被执行目标操作,确定所述第一数据块是否与第二文档具有引用关系;其中,所述目标操作用于在数据块下插入、删除、移动或替换子数据块;
响应于确定所述第一数据块与第二文档具有引用关系,则基于所述目标操作,更新所述第一文档中至少一个数据块与所述第二文档的引用关系。
第二方面,根据本公开的一个或多个实施例,提供了一种控制数据块的方法,包括:
确定第一文档中的被引用数据块,所述被引用数据块与第二文档具有引用关系;
响应于所述被引用数据块被执行目标操作,在所述第一文档中变更所述被引用数据块的位置;
响应于在所述第一文档中变更所述被引用数据块的位置,保持所述第二文档与所述被引用块的引用关系。
第三方面,根据本公开的一个或多个实施例,提供了一种控制数据块的方法,包括:
接收服务器发送的选区更新信息;所述选区更新信息由所述服务器基于以下步骤确定:响应于第一数据块被执行目标操作,确定所述第一数据块是否为选区的关联数据块;响应于确定所述第一数据块为选区的关联数据块,则基于所述目标操作重新确定所述选区的关联数据块和/或范围;基于重新确定的所述选区的关联数据块和/或范围确定选区更新信息;其中,所述选区被组织成通过选区的关联数据块和选区的范围来描述被引用数据块的位置和范围;所述被引用数据块为被至少一个在线文档引用的数据块;
基于所述选区更新信息对所述选区进行更新。
第四方面,根据本公开的一个或多个实施例,提供了一种控制数据块的装置,包括:
确定单元,用于响应于第一文档中的第一数据块被执行目标操作,确定所述第一数据块是否与第二文档具有引用关系;其中,所述目标操作用于在数据块下插入、删除、移动或替换子数据块;
更新单元,用于响应于确定所述第一数据块与第二文档具有引用关系,则基于所述目标操作,更新所述第一文档中至少一个数据块与所述第二文档的引用关系。
第五方面,根据本公开的一个或多个实施例,提供了一种控制数据块的装置,包括:
被引用数据块确定单元,用于确定第一文档中的被引用数据块,所述被引用数据块与第二文档具有引用关系;
位置变更单元,用于响应于所述被引用数据块被执行目标操作,在所述第一文档中变更所述被引用数据块的位置;
引用单元,用于响应于在所述第一文档中变更被引用数据块的位置,保持所述第二文档与所述被引用块的引用关系。
第六方面,根据本公开的一个或多个实施例,提供了一种控制数据块的装置,包括:
信息接收单元,用于接收服务器发送的选区更新信息;所述选区更新信息由所述服务器基于以下步骤确定:响应于第一数据块被执行目标操作,确定所述第一数据块是否为选区的关联数据块;响应于确定所述第一数据块为选区的关联数据块,则基于所述目标操作重新确定所述选区的关联数据块和/或范围;基于重新确定的所述选区的关联数据块和/或范围确定选区更新信息;其中,所述选区被组织成通过选区的关联数据块和选区的范围来描述被引用数据块的位置和范围;所述被引用数据块为被至少一个在线文档引用的数据块;
选区更新单元,用于基于所述选区更新信息对所述选区进行更新。
第七方面,根据本公开的一个或多个实施例,提供了一种控制数据块的系统,包括:
具有上述第四方面提供的控制数据块的装置的服务器;以及
至少一个具有上述第六方面提供的控制数据块的装置的终端。
第八方面,根据本公开的一个或多个实施例,提供了一种电子设备,包括:至少一个存储器和至少一个处理器;其中,所述存储器用于存储程序代码,所述处理器用于调用所述存储器所存储的程序代码以使所述电子设备执行根据本公开的一个或多个实施例提供的控制数据块的方法。
第九方面,根据本公开的一个或多个实施例,提供了一种非暂态计算机存储介质,所述非暂态计算机存储介质存储有程序代码,所述程序代码被计算机设备执行时,使得所述计算机设备执行根据本公开的一个或多个实施例提供的控制数据块的方法。
附图说明
结合附图并参考以下具体实施方式,本公开各实施例的上述和其他特征、优点及方面将变得更加明显。贯穿附图中,相同或相似的附图标记表示相同或相似的元素。应当理解附图是示意性的,原件和元素不一定按照比例绘制。
图1为根据本公开一实施例提供的控制数据块的方法的流程图;
图2为根据本公开一实施例提供的在线文档的示意图;
图3为根据本公开另一实施例提供的在线文档的示意图;
图4为根据本公开一实施例提供的数据块的节点关系的示意图;
图5为根据本公开一实施例提供的控制数据块的方法的流程图;
图6为根据本公开一实施例提供的基于目标操作确定选区的范围的方法的流程图;
图7为根据本公开一实施例提供的基于目标操作确定选区的范围的方法的流程图;
图8为根据本公开一实施例提供的分栏的示意图;
图9为根据本公开又一实施例提供的控制数据块的方法的流程图;
图10为根据本公开又一实施例提供的控制数据块的方法的流程图;
图11为根据本公开一实施例提供的控制数据块的装置的结构示意图;
图12为根据本公开另一实施例提供的控制数据块的装置的结构示意图;
图13为根据本公开一实施例提供的电子设备的结构示意图。
具体实施方式
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。
应当理解,本公开的实施方式中记载的步骤可以按照不同的顺序执行,和/或并行执行。此外,实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。术语“响应于”以及有关的术语是指一个信号或事件被另一个信号或事件影响到某个程度,但不一定是完全地或直接地受到影响。如果事件x“响应于”事件y而发生,则x可以直接或间接地响应于y。例如,y的出现最终可能导致x的出现,但可能存在其它中间事件和/或条件。在其它情形中,y可能不一定导致x的出现,并且即使y尚未发生,x也可能发生。此外,术语“响应于”还可以意味着“至少部分地响应于”。
术语“确定”广泛涵盖各种各样的动作,可包括获取、演算、计算、处理、推导、调研、查找(例如,在表、数据库或其他数据结构中查找)、探明、和类似动作,还可包括接收(例如,接收信息)、访问(例如,访问存储器中的数据)和类似动作,以及解析、选择、选取、建立和类似动作等等。其他术语的相关定义将在下文描述中给出。其他术语的相关定义将在下文描述中给出。
需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。
需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。
为了本公开的目的,短语“A和/或B”意为(A)、(B)或(A和B)。
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。
参考图1,图1示出了本公开一实施例提供的控制数据块的方法,包括步骤S12和步骤S14。
步骤S12:响应于第一文档中的第一数据块被执行目标操作,确定所述第一数据块是否与第二文档具有引用关系;其中,所述目标操作用于在数据块下插入、删除、移动或替换子数据块。
在一些实施例中,数据块(Block)作为对在线文档进行编辑的基本单元,数据块可以用于显示文字信息、图像信息或多媒体信息等信息。一个数据块可以用于显示一段文字或多段文字,多个数据块可以是另一个数据块的子数据块。
在一些实施例中,第二文档为第一文档以外的其他文档。在一个实施方式中,第二文档可以为第一文档以外的任意一个或多个在线文档。在另一个实施方式中,第二文档可以为第一文档以外特定的一个或多个在线文档。
需要说明的是,除非另有说明,本实施例中数据块与文档之间的引用关系包括该数据块的一个或多个子数据块被该文档引用,或者,该数据块的一个或多个子数据块引用自该文档。
参见图2,图2示出了根据本公开一实施例的在线文档的示意图。在第一在线文档210中,数 据块10、11、12、13和20依次分别显示有“文本内容A1”“文本内容A2”“文本内容B2”“文本内容C2”和“文本内容B1”等文本信息。其中,数据块11、12和13为第一数据块10的子数据块,第一数据块10和第二数据块20为数据块30的子数据块。此外数据块30还可以为其他数据块的子数据块,本实施例在此不做限制。第二在线文档220引用了第一在线文档210的数据块11和12,即,第二在线文档220与第一数据块10之间存在引用关系。
图4示出了根据本公开一实施例提供的数据块的节点关系的示意图。在图4中,每个节点可以对应一个数据块,根节点R下有节点A0、B0和C0,即表示根节点是节点A0、B0和C0的父节点;节点A0下有节点A1和B1,即节点A0是节点A1和B1的父节点;节点A1下有节点A2、B2和C2,即表示节点A1是节点A2、B2和C2的父节点;节点A2下有节点A3和B3,即表示节点A2是节点A3和B3的父节点;节点B2下有节点C3,即表示节点B2是节点C3的父节点。
在一个具体实施方式中,目标操作可以支持在列表中插入、删除、移动或替换项目,并根据需要对相邻的列表项目进行洗牌(Shuffling)。例如,指令“{p:[path,idx],li:obj}”可以用于在列表中索引值为“idx”处的项目之前插入对象“obj”;指令“{p:[path,idx],ld:obj}”可以用于在列表中删除索引值为“idx”的对象“obj”;指令“{p:[path,key],oi:obj}”可以用于将对象“obj”插入到[path]处的对象中;指令“{p:[path,key],od:before,oi:after}”可以用于将对象“after”替换对象“before”。
下面以图4为例进行说明,如果想要从数据块A1下删除数据块B2,则可以采用指令{p:["children",1],ld:"B2"};如果想要在数据块A2与数据块B2之间插入数据块D2,则可以采用指令{p:["children",1],li:"D2"};如果想要将数据块A2和B2替换为数据块D2和E2,则可以使用{p:[path,key],od:before,oi:after}指令。
步骤S14:响应于确定所述第一数据块与第二文档具有引用关系,则基于所述目标操作,确定所述第一文档中至少一个数据块与所述第二文档的引用关系。
在一些实施例中,步骤S14包括:基于所述目标操作,更新所述第一数据块与所述第二文档的引用关系。若所述目标操作使所述第一数据块下的全部的或数量最多的被所述第二文档引用的被引用数据块移动至所述第一文档中第二数据块下,则步骤S14还包括:基于所述目标操作,确定所述第二数据块与所述第二文档的引用关系。
在一些实施例中,可以基于所述目标操作所针对的数据块在所述第一数据块下与所述第一数据块的其他子数据块的相对位置关系,更新所述第一数据块与所述第二文档的引用关系。
在一些实施例中,可以基于被所述目标操作移动到所述第二数据块下的所述被引用数据块与所述第二数据块的其他子数据块的相对位置关系,确定所述第二数据块与所述第二文档的引用关系。
下面进行示例性说明。
假设第一文档的数据块A1下依次有A2、B2、C2这三个子数据块,第二文档引用了数据块A1下的第2-3个子数据块(即B2和C2),如果用户在C2后插入或删除了1个子数据块,则第二文档引用的数据块仍为数据块A1下的第2-3个子数据块(即B2和C2);如果用户在B2前插入了1个子数据块,则第二文档引用的数据块变更为数据块A1下的第3-4个子数据块(即仍为B2和C2);如果用户删除了子数据块A2,则第二文档引用的数据块变更为数据块A1下的第1-2个子数据块(即仍为B2和C2);如果用户在B2和C2之间插入了1个子数据块X2,则第二文档引用的数据块变更为数据块A1下的第2-4个子数据块(即变更为B2、X2、C2)。
假设第一文档的第一数据块A1的子数据块A2、B2和C2均一同被第二文档引用,若用户将子数据块A2、B2拖拽至第一文档的第二数据块B1下,并将子数据块C2拖拽至第一文档的第三数据块C1下,则可以创建第二文档与第二数据块B1之间的引用关系。进一步地,若第二数据块B1原本无子数据块,则该引用关系可以进一步确定为第二文档引用数据块B1下的第1-2个数据块;若第二数据块B1原本依次具有子数据块D4和E4,而被引用的子数据块A2、B2被拖拽至子数据块D4、 E4之前,则该引用关系可以进一步确定为第二文档引用数据块B1下的第1-2个数据块;若子数据块A2、B2被拖拽至第二数据块B1原本的子数据块D4、E4之后,则该引用关系可以进一步确定为第二文档引用数据块B1下的第3-4个数据块;若子数据块A2、B2被拖拽至子数据块D4与E4之间,则该引用关系可以进一步确定为第二文档引用数据块B1下的第2-3个数据块。
这样,根据本公开的一个或多个实施例,通过响应于第一文档中的第一数据块被执行目标操作,确定所述第一数据块是否与第二文档具有引用关系,并响应于确定所述第一数据块与第二文档具有引用关系,则基于所述目标操作,更新所述第一文档中至少一个数据块与所述第二文档的引用关系,从而可以实现被引用的数据块的同步更新。
根据本公开的一个或多个实施例,提供了一种控制数据块的方法,包括:
步骤S120:响应于第一数据块被执行目标操作,确定所述第一数据块是否为选区的关联数据块。其中,所述选区被组织成通过选区的关联数据块和选区的范围来描述被引用数据块的位置和范围;所述被引用数据块为被至少一个在线文档引用的数据块;
步骤S140:响应于确定所述第一数据块为选区的关联数据块,则基于所述目标操作重新确定所述选区的关联数据块和/或范围。
根据本公开的一个或多个实施例,可以通过设置选区来描述被引用的数据块的位置和范围。以图4为例进行示意性说明,假设数据块A2、B2和C2的索引值依次为0、1、2,且数据块A2、B2为被引用的数据块,则可以设置选区S的关联数据块(或关联节点)为A1以及选区S的范围为[0,1],其表示节点A1下的索引值为0的节点(即节点A2)和索引值为“1”的子节点(即节点B2)及其二者之间的子节点(如有)所对应的数据块为被引用的数据块。其中,“0”为起始索引值,“1”为结束索引值,选区的范围为闭区间。
需要说明的是,选区的范围还可以采用其他数值、数值范围以及数值间隔,本实施例在此不做限制。本实施例中的第一数据块可以位于原文中,也可以位于引文中,其中,引文为引用原文的一个或多个数据块的在线文档,本实施例在此不做限制。
在一些实施例中,一个选区用于描述一个数据块或者一组连续的数据块。在一些实施例中,若所述目标操作将所述第一数据块下的全部的或数量最多的所述被引用数据块移动到第二数据块下,将所述选区的关联数据块由所述第一数据块变更为所述第二数据块。
需要说明的是,除非另有说明,本公开提及的“数据块A下/内的数据块”是指数据块A的子数据块,本公开提及的“将数据块A移动到数据块B下/内”是指将数据块A移动到数据块B下/内以使数据块A成为数据块B的子数据块。
在一个具体实施方式中,例如参考图2-3,若用户在第一在线文档210中,将被引用数据块11和12由数据块10下拖拽至数据块20下,则可以将选区的关联数据块由原本的数据块10相应地修改为数据块20。参考图4,若用户将节点A2、B2对应的被引用数据块拖拽至节点B1对应的数据块下,则将选区的关联数据块(或关联节点)由原先的“A1”修改为“B1”。
进一步地,在一些实施例中,基于被所述目标操作移动到所述第二数据块下的所述被引用数据块与所述第二数据块的其他子数据块的相对位置关系,重新确定所述选区的范围。
在一个具体实施方式中,参考图4,选区S的关联数据块为A1,范围为闭区间[0,1]。当用户将被引用数据块A2、B2拖拽数据块B1下时,则先将选区的关联数据块(或关联节点)由原先的“A1”确定为“B1”,然后,可以基于被引用数据块在数据块B1下与数据块B1的其他子数据块的相对位置关系重新确定选区的范围。在本实施方式中,因B1原本无其他子数据块,则选区的范围仍可以为[0,1]。
在另一个具体实施方式中,若数据块B1下原本有其他的子数据块,例如数据块D2,当数据块A2、B2对应的被引用数据块拖拽至数据块D2之后时,则可以将选区的范围的左右区间值相应加1, 更新为[1,2],其表示节点B1下的索引值(index)为1的节点(即拖拽后的A2)和索引值为“2”的子节点(即拖拽后的A2)及其二者之间的子节点(如有)所对应的数据块为被引用的数据块;当数据块A2、B2对应的被引用数据块拖拽至数据块D2对应的数据块之前,即数据块A2、B2在数据块B1下仍位列前两位时,则选区的范围仍可以为[0,1]。
在一个具体实施方式中,如用户将第一数据块的被引用数据块分别拖拽到其他不同的数据块中,则可以将具有数量最多的被拖拽的被引用数据块作为所述选区的新的关联数据块,并基于所述新的关联数据块下的被引用数据块与其他子数据块的相对位置关系,重新确定所述选区的范围。例如,若第一数据块A1的全部子数据块A2、B2和C2(分别对应索引值0、1、2)均为被引用数据块,则选区S的关联数据块可以为A1、范围可以为[0,2],当用户将子数据块A2、B2拖拽至第二数据块B1下,并将子数据块C2拖拽至第三数据块C1下,则可以将选区的关联数据块由原先的第一数据块A1修改为第二数据块B1,若第二数据块B1原本无子数据块,则选区的范围为[0,1],即表示第二数据块B1下的第一个数据块(即拖拽后的子数据块A2)和第二个数据块(即拖拽后的子数据块B2)为被引用的数据块;若第二数据块B1原本具有子数据块D4和E4,而被引用的子数据块A2、B2被拖拽至子数据块D4、E4之前,则选区的范围仍为[0,1],即表示第二数据块B1下的前两个子数据块为被引用的数据块;若子数据块A2、B2被拖拽至第二数据块B1原本的子数据块D4、E4之后,则选区的范围的左右区间值相应加2,更新为[2,3],即可以表示第二数据块B1下的第三、四个子数据块为被引用数据块;若子数据块A2、B2被拖拽至子数据块D4与E4之间,则选区的范围的左右区间值相应加1,更新为[1,2],即可以表示第二数据块B1下的第二、三个子数据块为被引用的数据块。
在一些实施例中,若所述目标操作在所述第一数据块内移动所述被引用数据块,则将所述选区的关联数据块保持不变;基于移动后的所述被引用数据块与所述第一数据块的其他子数据块的相对位置关系,重新确定所述选区的范围。在本实例中,若用户在第一数据块内移动被引用数据块,因没有改变被引用数据块的父数据块,则无需变更选区的关联数据块,并可以基于被引用数据块移动后的位置重新确定选区的范围即可。
根据发明人调查发现,相关在线文档技术提供的实时引用功能并不完善,容易出现被引用部分丢失的问题。例如当用户在线文档中移动或拖拽被其他在线文档引用的内容时,会导致被引用的内容在该其他在线文档中丢失,这是因为一段连续的内容被拖拽往往会被认为其在原文中被删除。
对此,根据本公开的一个或多个实施例,通过选区的关联数据块和选区的范围来描述被引用数据块的位置和范围,并当选区的关联数据块被执行目标操作时,根据所述目标操作重新确定选区的关联数据块和/或范围,从而通过同步更新选区的关联数据块和/或范围,以更新数据块与引用文档之间的引用关系,可以实现被引用的数据块的同步更新。
在一些实施例中,所述目标操作包括第一操作指令,或者第一操作指令和第二操作指令;所述第一操作指令用于编辑第一数据块,所述第二操作指令用于编辑所述第一数据块以外的其他数据块,所述第一操作指令实施于所述第二操作指令之前。
示例性地,所述第一操作指令用于删除所述第一数据块的至少一个子数据块,所述第二操作指令用于往所述第一数据块之外的其他数据块插入至少一个子数据块。
在一个具体实施例中,目标操作包括拖拽操作,该拖拽操作用于将一个或多个子数据块从第一数据块下,拖拽至第一数据块之外的其他数据块下。该拖拽操作可以在第一数据块中删除一个或多个子数据块,并将该一个或多个子数据块插入至其他的数据块下。
在一些实施例中,步骤S140包括:
步骤A10:基于所述第一操作指令确定所述选区的初始更新范围;
步骤A21:若基于所述第一操作指令确定所述选区的初始更新范围为空,且确定从所述第一数 据块下删除的被引用数据块的父数据块变更为所述第一数据块以外的其他数据块,则将包含数量最多的从所述第一数据块下删除的被引用数据块的父数据块作为所述选区的新的关联数据块,并根据针对所述新的关联数据块的所述第二操作指令,确定所述选区的最终范围。
在本实施例中,若基于所述第一操作指令确定所述选区的初始更新范围为空,则意味着第一操作指令将所述第一数据块下的所有被引用数据块删除;若进一步确定从所述第一数据块下删除的被引用数据块的父数据块变更为所述第一数据块以外的其他数据块,则表明第一数据块下被删除的被引用数据块实际上可能被用户拖拽至其他数据块下,因此,通过进一步将包含数量最多的被删除的被引用数据块的父数据块重新确定为作为所述选区的新的关联数据块,并基于针对该新的关联数据块的第二操作指令,可以确定出选区的最终范围。示例性地,可以根据所述新的关联数据块下的所述被删除的被引用数据块与所述新的关联数据块的其他子数据块的相对位置关系,重新确定所述选区的范围。
在一些实施例中,步骤S140包括:
步骤A22:若基于所述第一操作指令确定所述选区的初始更新范围不为空,或确定从所述第一数据块下删除的被引用数据块的父数据块未变更为所述第一数据块以外的其他数据块,则将所述初始更新范围作为所述选区的最终范围。
在本实施例中,若基于所述第一操作指令确定所述选区的初始更新范围不为空,或确定从所述第一数据块下删除的被引用数据块的父数据块未变更为所述第一数据块以外的其他数据块,则意味着第一数据块下的被引用数据块没有被用户执行拖拽操作,而可能是被用户直接删除,则可以直接将基于第一操作指令确定的选区的初始更新范围作为选区最终范围。
优选地,步骤A21和步骤A22中的“从所述第一数据块下删除的被引用数据块”可以进一步为“从所述第一数据块下最后连续被删除的被引用数据块”。通常,用户的拖拽操作产生的操作指令会接连涉及两个数据块,例如,当用户从数据块A下拖拽一个多个子数据块至数据块B时,该拖拽操作会接连触发在数据块A下连续删除一个或多个子数据块的指令,以及在数据块B下连续插入一个或多个子数据块的指令,因而如果数据块A的子数据块被执行拖拽操作,数据块A最后被实施的操作指令必然是用于连续删除其一个或多个子数据块,因为下一个操作指令系针对数据块B的数据块插入指令。因此,在本实施例中,通过确定从所述第一数据块下最后连续被删除的被引用数据块的父数据块是否变更,可以更准确地确定这些被引用数据块是否被用户进行了拖拽操作。
在一个具体实施方式中,可以根据时间顺序记录对数据块的操作指令,并确定针对第一数据块的最后连续的一个或多个操作指令是否为删除操作指令,并确定所述删除操作指令所删除的被引用数据块的父数据块是否变更为第一数据块之外的其他数据块,从而可以确定从所述第一数据块下最后连续被删除的被引用数据块的父数据块是否变更为所述第一数据块以外的其他数据块。
参考图5,图5示出了本公开一实施例提供的控制数据块的方法500的流程图,方法500包括:
步骤S501:记录被执行目标操作的数据块和发生父数据块变更的子数据块;
步骤S502:确定被执行目标操作的数据块是否为选区的关联数据块;
若被执行目标操作的数据块为选区的关联数据块,则执行步骤S503:根据针对所述选区当前的关联数据块的目标操作,更新选区的范围。
若被执行目标操作的数据块不为选区的关联数据块,则可以无需对选区的关联节点和范围进行更新,并处理下一个数据块。
步骤S504:判断步骤S503对选区范围的更新是否是基于第一操作指令进行的更新,且更新结果是否为空,且最后连续被删除的子数据块是否发生了父数据块变更;
若步骤S504判断结果均为是,则执行步骤S505:选取包含数量最多的被删除的被引用数据块的父数据块,作为选区的新的关联数据块。
步骤S505完成后,可以再次执行步骤S503。本领域技术人员可以理解,在本实施例中,第一次执行步骤S503时,是基于针对选区的初始的关联数据快的第一操作指令更新选区的范围,而再次执行步骤S503时,是基于针对选区的新的关联数据块的目标操作(例如第二操作指令)更新选区的范围。
再次执行步骤S503后,步骤S504的判断结果将为否,则执行步骤S506:基于重新确定的所述选区的关联数据块和/或范围确定选区更新信息;
步骤S507:选区更新完成;
步骤S508:广播选区更新信息。
在一些实施例中,所述选区的范围由左端点和右端点描述;步骤S140包括:若所述目标操作用于在所述选区当前的关联数据块下、在所述左端点的左侧增加或删除N个数据块,则所述选区的左端点和右端点对应的数值均增加或减少N;或者,若所述目标操作用于在所述选区当前的关联数据块下、在所述右端点的右侧增加或删除N个数据块,则所述左端点和右端点对应的数值均保持不变;或者,若所述目标操作用于在所述选区当前的关联数据块下、在所述左端点与右端点之间增加或删除N个数据块,则所述选区的右端点对应的数值增加或减少N,且所述左端点对应的数值均保持不变;其中,N为正整数。
下面进行示例性说明。假设数据块A1有子数据块A2、B2、C2和D2,分别对应索引值数组{0,1,2,3},若数据块B2和C2为被引用数据块,则选区S的关联数据块为A1,选区S的范围为[1,2],若用户在选区的左端点的左侧,即在数据块B2之前,插入或删除N个数据块,则选区整体后移或前移N位,即选区的左右端点值加N或减N;若用户在选区的右端点的右侧,即在数据块C2之后,插入或删除N个数据块,则选区的左右端点值不变;若用户在左、右端点之间增加或删除N个数据块,则选区的范围为[1,2±N]。
在一些实施例中,步骤S140还包括:若所述目标操作用于在原文内、在所述选区的任意端点处增加N个数据块,则所述选区的范围不变;或者,若目标操作用于在引文内、在所述选区的右端点处增加N个数据块,则所述选区的右端点对应的数值均增加N;所述左端点对应的数值保持不变;或者,若所述目标操作用于在引文内、在所述选区的左端点处侧增加N个数据块,则所述选区的左端点和右端点对应的数值均增加N;其中,所述引文为引用所述原文的一个或多个数据块的在线文档。
参考图2,当某一用户在作为引文的第二在线文档220中在选区的左右端点处增加新的数据块时,该用户的意图往往是在临界点增加被引用数据块的范围,尤其是编辑引文的用户往往也是对数据块进行引用的用户。然而,当某一用户在作为原文的第一在线文档210中在选区的左右端点处(即数据块11、12)增加新的数据块时,因原文中被引用数据块的前后通常还邻接他数据块,因而该用户此时的意图可能并非增加被引用数据块,而是对其他数据块进行处理,尤其是编辑原文的用户可能并非引用数据块的用户。因此,根据本公开的一个或多个实施例,当用户在引文中在选区的端点处插入数据块时,相应扩大选区的范围,而当用户在原文中在选区的端点处增加数据块时,该数据块不作为新增的被引用数据块,从而可以实现更符合用户意图的同步引用更新。
在一些实施例中,如果用户在引文内拖动被引用数据块,则不改变选区的关联节点和范围,即原文内的被引用数据块保持不变;如果用户在引文内、在选区中插入数据块,则可以改变选区的范围,即原文内的被引用数据块也相应反生改变。如图2所示,若用户在第二在线文档220内拖动数据块A2和B2,则第一在线文档210中的数据块A2和B2不发生变化;若用户在第二在线文档220内、在数据块A2和B2之间插入新的数据块X2,则在第一在线文档210中,数据块A2和B2之间亦相应插入新的数据块。
参考图6,图6示出了本公开一实施例提供基于目标操作确定选区的范围的方法的流程图,方 法600包括步骤S601-步骤S610。
步骤S601:确定对选区的关联数据块的目标操作是否包括数据块删除指令,所述数据块删除指令用于在索引值(index)处删除数据块。示例性地,数据块插入指令可以为指令{p:[path,idx],ld:obj},索引值可以为该指令中“idx”对应的数值。
步骤S602:确定所述索引值是否小于等于选区的结束索引值。
若所述索引值小于等于选区的结束索引值(即index≤end,其中end表示选区的结束索引值),则执行步骤S603:将所述选区的结束索引值减1(即end=end-1)
若所述索引值大于选区的结束索引值(即index>end),则执行步骤S606:选区范围更新完成。在本步骤中,因删除指令对应的索引值大于选区的结束索引值,意味着数据块的删除指令用于在选区的右边界的右侧删除数据块,不影响选区的范围,无需更新选区。
步骤S604:确定所述索引值是否小于选区的起始索引值。
若所述索引值小于选区的起始索引值(即index<start,其中start表示选区的起始索引值),则执行步骤S605:选区的起始索引值减1(即start=start-1)。在本步骤中,因删除指令对应的索引值小于选区的起始索引值,意味着数据块的删除指令用于在选区的左边界的左侧删除数据块,相当于选区左侧的数据块减少一位,因而选区整体需向左侧挪一位,即选区的起始索引值和结束索引值最终均减一。
若所述索引值大于等于选区的起始索引值(即index≥start),则执行步骤S606:选区范围更新完成。在本步骤中,因删除指令对应的索引值大于等于选区的起始索引值小于等于选区的结束索引值(即start≤index≤end),意味着数据块的删除指令是对选区内的数据块进行的删除指令,因而选区的起始索引值不变而仅结束索引值减一,即选区范围最终变小。
下面进行示例性说明。假设数据块A1有子数据块A2、B2、C2和D2,分别对应索引值数组{0,1,2,3},若数据块B2和C2为被引用数据块,则选区S的关联数据块为A1,选区S的范围为[1,2],即选区的起始索引值为1(即start=1,对应数据块B2),结束索引值为2(即end=2,对应数据块C2)。若数据块删除指令的索引值为0(即index=0),即该删除指令用于删除数据块A2,因index≤end且index<start,则选区整体前移,范围更新为[0,1],分别对应前移后的数据块B2和C2;若数据块删除指令的索引值为1(即index=1),即该删除指令用于删除被引用数据块B2,因start≤index≤end,则选区范围更新为[1,1],对应前移后的数据块C2;若数据块删除指令的索引值为2(即index=2),即该删除指令用于删除被引用数据块C2,因start≤index≤end,则选区范围更新为[1,1],对应未移动的数据块B2;若数据块删除指令的索引值为3(即index=3),即该删除指令用于删除数据块D2,因index>end,则选区的范围无需更新,范围仍为[0,1]。
需要说明是,前述一个或多个实施例中的数据块删除指令是就删除一个数据块而言的,本领域技术人员可以理解,可以通过多个删除指令依次删除多个数据块(例如循环上述步骤S601-S606)、或者通过一个删除指令删除多个数据块等方式实现删除多个数据块,本公开在此不做限制。
参考图7,图7示出了本公开一实施例提供基于目标操作确定选区的范围的方法的流程图,方法700包括步骤S701-步骤S710。
步骤S701:确定对选区的关联数据块的目标操作是否包括数据块插入指令,所述数据块插入指令用于在索引值(index)处插入数据块。示例性地,数据块插入指令可以为指令{p:[path,idx],li:obj},索引值可以为该指令中“idx”对应的数值。
步骤S702:确定选区的范围是否为空。示例性地,当选区的结束索引值小于起始索引值时,表示选区的范围为空。
若步骤S702确定所述选区为空,则执行步骤S7021:确定所述插入指令所插入的数据块是否为从所述选区的前一个关联数据块中被拖拽的被引用数据块;其中,所述选区的前一个关联数据块为 所述选区的关联数据块更新前的关联数据块。即,在本步骤用于判断所插入的数据块是从之前的选区内拖拽过来的数据块。
若步骤S7021判断为是,则执行步骤S7022:选区的起始索引值为所述索引值(即start=index),选区的结束索引值为所述索引值(end=index)。
若步骤S7021判断为否,则步骤S710:选区范围更新完成。在本例中,若判断为否,则表明当前插入指令所插入的数据块并非被用户从选区的前一个关联数据块中拖拽的被引用的数据块,则无需对选区的范围进行更新。
若步骤S702确定选区的范围不为空,则执行步骤S703:确定所述插入指令所插入的数据块是否为从所述选区的前一个关联数据块中被拖拽的被引用数据块,或者,确定所述数据块插入指令是否为针对引文中的关联数据块。
其中,所述引文为引用所述被引用数据块的在线文档。在一些实施例中,以图2为例进行说明,第一在线文档210的第一数据块10下的子数据块11和12被第二在线文档220引用,第二在线文档即为步骤S703中所述的“引文”,而步骤S703用于确定所述数据块插入指令是否为作用于第二在线文档中的所述被引用数据块所在的父数据块的指令。
若步骤S703的判断结果为是,则执行步骤S704:设左阈值left等于所述选区的起始索引值start(即left=start),并设右阈值right等于所述选区的结束索引阈值加一(即right=end+1)。
若步骤S703的判断结果为否,则执行步骤S705:设左阈值left等于所述选区的起始索引阈值start加1(即left=start+1),并设右阈值right等于所述选区的结束索引阈值(即right=end)。
步骤S706:确定索引值(index)是否小于等于右阈值。
若索引值小于等于右阈值(即index≤right),则执行步骤S707:选区的结束索引值加1(即end=end+1);
若索引值大于右阈值(即index>right),则可以跳过其他步骤直接执行步骤S710:选区范围更新完成。在本例中,因索引值大于右阈值,则该插入指令被认为是在选区右端点的右侧插入数据块,则可以无需对选区范围进行更新。
步骤S708:确定索引值是否小于左阈值。
若索引值小于左阈值(即index<left),则执行步骤S709:选区的起始索引值加1(即start=start+1)。在本例中,如果索引值小于左阈值,该插入指令则被认为是在选区左端点的左侧插入数据块,因而选区最终的左右区间值均加相应加1。
若插入指令的索引值大于等于左阈值(即index≥left),则执行步骤S709:选区的起始索引值加1(即start=start+1)。在本步骤中,如果索引值大于等于左阈值,则该插入指令被认为是在选区范围内插入数据块,因而最终选区的左区间值不变,右区间值加1。
步骤S710:选区范围更新完成。
根据本公开的一个或多个实施例,通过对于不同类型的数据块插入指令设置不同的左、右阈值,该左、右阈值可以表示“拟制地”选区范围(左右阈值可以分别对应左右区间),对于针对引文中的关联数据块的插入指令(或者在选区的端点处插入被拖拽的被引用数据块)与针对原文中的插入指令相比,前者对应的左右阈值形成区间范围(即[start,end+1])与后者形成的左右阈值形成的区间范围(即[start+1,end])相比,左右均扩大了一个单位。这样,当用户在引文中在选区的端点处插入数据块(或者在选区的端点处插入被拖拽的被引用数据块)时,被认为是在选区内进行的插入,从而可以相应扩大选区的范围,而当用户在原文中在选区的端点处增加数据块时,该数据块不作为新增的被引用数据块,从而可以实现更符合用户意图的被引用数据块的同步更新。
在一些实施例中,步骤S140包括:
步骤C1:若所述目标操作用于将所述第一数据块下的所述被引用数据块拖拽至与所述第一数据块并列,则创建新数据块作为所述被拖拽的被引用数据块的父数据块;所述新数据块与所述第一数据块的父数据块具有共同的父数据块;
步骤C2:将所述选区的关联数据块更新为所述新数据块;
步骤C3:基于被所述目标操作拖拽至所述新数据块下的被引用数据块的数量,更新所述选区的范围。
参考图8,用户可以通过分栏操作将数据块A1下方的子数据块A2和B2与所述数据块A1并列,从而实现数据块A2和B2与数据块A1分属于不同的两栏。根据本公开的一个或多个实施例,可以创建数据块41作为分栏后的数据块A2和B2的父数据块,数据块41和A1的父数据块42具有共同的父数据块40。若子数据块A2和B2为被引用的数据块,则可以将选区的关联数据块由数据块A1更新为数据块41,并基于数据块41下被引用数据块的数量更新选区的范围。在本例中,选区的范围原为[0,1],选区更新后范围仍为[0,1]。在一个具体实施方式中,用户可以通过将数据块A2、B2拖拽至其父数据块的左侧或右侧,实现被拖拽的数据块与其原父数据块左右分栏。
根据本公开的一个或多个实施例,提供了一种控制数据块的方法,包括:
步骤B1:确定第一文档中的被引用数据块,所述被引用数据块与第二文档具有引用关系。
步骤B2:响应于所述被引用数据块被执行目标操作,在所述第一文档中变更所述被引用数据块的位置;
步骤B3:响应于在所述第一文档中变更被引用数据块的位置,保持第二文档与所述被引用块的引用关系。
在本实施例中,被引用数据块与第二文档之间的引用关系为第二文档引用了被引用数据块。
在一些实施例中,所述被引用数据块为一个数据块或者一组连续的数据块。
在一些实施例中,所述目标操作包括拖拽操作,该拖拽操作用于移动数据块。示例性地,拖拽操作可以在数据块内移动其子数据块,或者在数据块间移动子数据块,例如,拖拽操作可以在第一数据块中删除一个或多个子数据块,并将该一个或多个子数据块插入至其他的数据块下。
根据发明人调查发现,相关在线文档技术提供的实时引用功能并不完善,容易出现被引用部分丢失的问题。例如当用户在线文档中移动或拖拽被其他在线文档引用的内容时,往往会导致被引用的内容在该其他在线文档中丢失,这是因为一段连续的内容被拖拽往往会被认为是其在原文中被删除。
对此,根据本公开的一个或多个实施例,通过因目标操作变更被引用数据块位置的同时,保持第二文档与所述被引用块的引用关系,从而可以避免数据块与文档的引用关系因数据块的移动而中断。
在一些实施例中,通过选区的关联数据块和选区的范围来描述所述被引用数据块的位置和范围;所述选区的关联数据块为所述被引用数据块的父数据块。
在一些实施例中,步骤B3包括:基于所述目标操作重新确定所述选区的关联数据块和/或范围。
关于选区的设置方式或基于目标操作重新确定所述选区的关联数据块和/或范围的具体实施方式,可以参见上文的描述,此处不再赘述。
相应地,如图9所示,根据本公开的一实施例提供了一种控制数据块的方法,包括:
步骤S920:接收服务器发送的选区更新信息;所述选区更新信息由所述服务器基于以下步骤确定:响应于第一数据块被执行目标操作,确定所述第一数据块是否为选区的关联数据块;响应于确定所述第一数据块为选区的关联数据块,则基于所述目标操作重新确定所述选区的关联数据块和/或范围;基于重新确定的所述选区的关联数据块和/或范围确定选区更新信息;其中,所述选区被组织 成通过选区的关联数据块和选区的范围来描述被引用数据块的位置和范围;所述被引用数据块为被至少一个在线文档引用的数据块;
步骤S940:基于所述选区更新信息对所述选区进行更新。
参见图10,根据本公开一实施例提供了一种控制数据块的方法,包括步骤S1001-步骤S1003:
步骤S1001:确定选区的关联数据块是否发生变更。
若选区的关联数据块发生变更,则执行步骤S1002:基于服务器发送的选区更新信息对所述选区进行更新。示例性地,可以向服务器拉取所述选区更新信息并基于所述选区更新信息对所述选区进行更新。
若选区的关联数据块未发生变更,则执行步骤S1003:基于针对所述关联数据块的目标操作重新确定所述选区的范围,并基于重新确定的选区的范围对选区进行更新。
在一些实施例中,若步骤S1003判断结果为空,则执行步骤S1002,即,当客户端基于目标操作确定选区范围为空时,则直接拉去服务器的选区更新信息以更新选区。
根据本公开的一个或多个实施例,当目标操作未改变选区的关联数据块,意味着目标操作仅仅只是关联数据块内进行编辑,例如插入、删除子数据块等,此时客户端无需完全依赖服务器推送的选区更新信息即可对选区的范围进行更新,从而可以提高同步引用的及时性和一致性。
需要说明的是,对于客户端的实施例而言,由于其基本对应于服务器的实施例,所以相关之处参见方法实施例的部分说明即可,在此不再赘述。
相应地,如图11所示,根据本公开的一实施例提供了一种控制数据块的装置1100,包括:
确定单元1120,用于响应于第一文档中的第一数据块被执行目标操作,确定所述第一数据块是否与第二文档具有引用关系;其中,所述目标操作用于在数据块下插入、删除、移动或替换子数据块;
更新单元1140,用于响应于确定所述第一数据块与第二文档具有引用关系,则基于所述目标操作,更新所述第一文档中至少一个数据块与所述第二文档的引用关系。
在一些实施例中,装置1100还包括:
信息生成单元,用于基于重新确定的所述选区的关联数据块和/或范围确定选区更新信息;
信息发送单元,用于向客户端发送所述选区更新信息,以使客户端能够基于所述选区更新信息对所述选区进行更新。
在一些实施例中,提供了一种控制数据块的装置,包括:
被引用数据块确定单元,用于确定第一文档中的被引用数据块,所述被引用数据块与第二文档具有引用关系;
位置变更单元,用于响应于所述被引用数据块被执行目标操作,在所述第一文档中变更所述被引用数据块的位置;
引用单元,用于响应于在所述第一文档中变更被引用数据块的位置,保持所述第二文档与所述被引用块的引用关系。
相应地,如图12所示,根据本公开的一实施例提供了一种控制数据块的装置1200,包括:
信息接收单元1220,用于接收服务器发送的选区更新信息;所述选区更新信息由所述服务器基于以下步骤确定:响应于第一数据块被执行目标操作,确定所述第一数据块是否为选区的关联数据块;响应于确定所述第一数据块为选区的关联数据块,则基于所述目标操作重新确定所述选区的关联数据块和/或范围;基于重新确定的所述选区的关联数据块和/或范围确定选区更新信息;其中,所述选区被组织成通过选区的关联数据块和选区的范围来描述被引用数据块的位置和范围;所述被引用数据块为被至少一个在线文档引用的数据块;
选区更新单元1240,用于基于所述选区更新信息对所述选区进行更新。
对于装置的实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中作为分离模块说明的模块可以是或者也可以不是分开的。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
相应地,根据本公开的一个或多个实施例,提供了一种系统,包括:具有控制数据块的装置1100的服务器;以及至少一个具有控制数据块的装置1200的终端。其中,终端包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。终端通过局域网、广域网或者互联网与服务器402连接,终端和服务器之间建立有线连接或无线连接,其中有线连接包括但不限于PoE、同轴电缆、光纤、USB数据连接。
对于系统的实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。
相应地,根据本公开的一个或多个实施例,提供了一种电子设备,包括:
至少一个存储器和至少一个处理器;
其中,存储器用于存储程序代码,处理器用于调用存储器所存储的程序代码以使所述电子设备执行根据本公开一个或多个实施例提供的控制数据块的方法。
相应地,根据本公开的一个或多个实施例,提供了一种非暂态计算机存储介质,非暂态计算机存储介质存储有程序代码,程序代码可被计算机设备执行来使得所述计算机设备执行根据本公开一个或多个实施例提供的控制数据块的方法。
下面参考图13,其示出了适于用来实现本公开实施例的电子设备(例如终端设备或服务器)1300的结构示意图。本公开实施例中的终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图13示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图13所示,电子设备1300可以包括处理装置(例如中央处理器、图形处理器等)1301,其可以根据存储在只读存储器(ROM)1302中的程序或者从存储装置1308加载到随机访问存储器(RAM)1303中的程序而执行各种适当的动作和处理。在RAM1303中,还存储有电子设备1300操作所需的各种程序和数据。处理装置1301、ROM 1302以及RAM 1303通过总线1304彼此相连。输入/输出(I/O)接口1305也连接至总线1304。
通常,以下装置可以连接至I/O接口1305:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置1306;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置1307;包括例如磁带、硬盘等的存储装置1308;以及通信装置1309。通信装置1309可以允许电子设备1300与其他设备进行无线或有线通信以交换数据。虽然图13示出了具有各种装置的电子设备1300,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置1309从网络上被下载和安装,或者从存储装置1308被安装,或者从ROM 1302被安装。在该计算机程序被处理装置1301执行时,执行本公开实施例的方法中限定的上述功能。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读 存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备执行上述的本公开的方法。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
根据本公开的一个或多个实施例,提供了一种控制数据块的方法,包括:响应于第一文档中的第一数据块被执行目标操作,确定所述第一数据块是否与第二文档具有引用关系;其中,所述目标操作用于在数据块下插入、删除、移动或替换子数据块;响应于确定所述第一数据块与第二文档具有引用关系,则基于所述目标操作,更新所述第一文档中至少一个数据块与所述第二文档的引用关系。
根据本公开的一个或多个实施例,所述基于所述目标操作,更新所述第一文档中至少一个数据块与所述第二文档的引用关系,包括:基于所述目标操作,更新所述第一数据块与所述第二文档的引用关系;若所述目标操作将所述第一数据块下的全部的或数量最多的被所述第二文档引用的被引用数据块移动至所述第一文档中第二数据块下,则所述基于所述目标操作,更新所述第一文档中至少一个数据块与所述第二文档的引用关系,还包括:基于所述目标操作,确定所述第二数据块与所述第二文档的引用关系。
根据本公开的一个或多个实施例,所述基于所述目标操作,更新所述第一数据块与所述第二文档的引用关系,包括:基于所述目标操作所针对的数据块在所述第一数据块下与所述第一数据块的其他子数据块的相对位置关系,更新所述第一数据块与所述第二文档的引用关系。
根据本公开的一个或多个实施例,所述基于所述目标操作,确定所述第二数据块与所述第二文档的引用关系,包括:基于被所述目标操作移动到所述第二数据块下的所述被引用数据块与所述第二数据块的其他子数据块的相对位置关系,确定所述第二数据块与所述第二文档的引用关系。
根据本公开的一个或多个实施例,所述确定所述第一数据块是否与第二文档具有引用关系,包括:确定所述第一数据块是否为选区的关联数据块;所述基于所述目标操作,确定所述第一文档中至少一个数据块与所述第二文档的引用关系,包括:响应于确定所述第一数据块为选区的关联数据块,则基于所述目标操作重新确定所述选区的关联数据块和/或范围;其中,所述选区被组织成通过选区的关联数据块和选区的范围来描述被引用数据块的位置和范围;所述被引用数据块为被至少一个在线文档引用的数据块。
根据本公开的一个或多个实施例,基于所述目标操作重新确定所述选区的关联数据块,包括:若所述目标操作将所述第一数据块下的全部的或数量最多的所述被引用数据块移动至第二数据块下,则将所述选区的关联数据块由所述第一数据块变更为所述第二数据块。
根据本公开的一个或多个实施例,基于所述目标操作重新确定所述选区的范围,包括:基于被所述目标操作移动到所述第二数据块下的所述被引用数据块与所述第二数据块的其他子数据块的相对位置关系,重新确定所述选区的范围。
根据本公开的一个或多个实施例,所述基于所述目标操作重新确定所述选区的关联数据块和/或范围,包括:若所述目标操作用于在所述第一数据块内移动所述被引用数据块,则将所述选区的关联数据块保持不变;基于移动后的所述被引用数据块与所述第一数据块的其他子数据块的相对位置关系,重新确定所述选区的范围。
根据本公开的一个或多个实施例,所述目标操作用于触发第一操作指令,或者用于触发第一操 作指令和第二操作指令;所述第一操作指令用于编辑第一数据块,所述第二操作指令用于编辑所述第一数据块以外的其他数据块。
根据本公开的一个或多个实施例,所述基于所述目标操作重新确定所述选区的关联数据块和/或范围,包括:基于所述第一操作指令确定所述选区的初始更新范围;若基于所述第一操作指令确定所述选区的初始更新范围为空,且确定从所述第一数据块下删除的被引用数据块的父数据块变更为所述第一数据块以外的其他数据块,则将包含数量最多的从所述第一数据块下删除的被引用数据块的父数据块作为所述选区的新的关联数据块,并根据针对所述新的关联数据块的所述第二操作指令,确定所述选区的最终范围。
根据本公开的一个或多个实施例,所述基于所述目标操作重新确定所述选区的关联数据块和/或范围,包括:若基于所述第一操作指令确定所述选区的初始更新范围不为空,或确定从所述第一数据块下删除的被引用数据块的父数据块未变更为所述第一数据块以外的其他数据块,则将所述初始更新范围作为所述选区的最终范围。
根据本公开的一个或多个实施例,所述第一操作指令用于删除所述第一数据块的至少一个子数据块,所述第二操作指令用于往所述第一数据块之外的其他数据块插入至少一个子数据块。
根据本公开的一个或多个实施例,所述目标操作包括对数据块的拖拽操作。
根据本公开的一个或多个实施例,所述选区的范围具有左端点和右端点,所述基于所述目标操作重新确定选区的范围,包括:若所述目标操作用于在所述选区的左端点的左侧增加或删除N个数据块,则所述选区的左端点和右端点对应的数值均增加或减少N;或者,若所述目标操作用于在所述选区的右端点的右侧增加或删除N个数据块,则所述左端点和右端点对应的数值均保持不变;或者,若所述目标操作用于在所述选区的左端点与右端点之间增加或删除N个数据块,则所述选区的右端点对应的数值增加或减少N,且所述左端点对应的数值均保持不变;其中,N为正整数。
根据本公开的一个或多个实施例,所述基于所述目标操作重新确定选区的范围,包括:若所述目标操作用于在原文内、在所述选区的任意端点处增加N个数据块,则所述选区的范围不变;或者,若所述目标操作用于在引文内、在所述选区的右端点处增加N个数据块,则所述选区的右端点对应的数值均增加N,且所述左端点对应的数值保持不变;或者,若所述目标操作用于在引文内、在所述选区的左端点处侧增加N个数据块,则所述选区的左端点和右端点对应的数值均增加N;其中,所述引文为引用所述原文的一个或多个数据块的在线文档。
根据本公开的一个或多个实施例,所述基于所述目标操作重新确定所述选区的关联数据块和/或范围,包括:若所述目标操作用于将所述第一数据块下的所述被引用数据块拖拽至与所述第一数据块并列,则创建新数据块作为所述被拖拽的被引用数据块的父数据块;将所述选区的关联数据块更新为所述新数据块,其中,所述新数据块与所述第一数据块具有共同的父数据块;基于被所述目标操作拖拽至所述父数据块下的被引用数据块的数量,更新所述选区的范围。
根据本公开的一个或多个实施例,所述目标操作为分栏操作。
根据本公开的一个或多个实施例,所述方法还包括:基于重新确定的所述选区的关联数据块和/或范围确定选区更新信息;向客户端发送所述选区更新信息,以使客户端能够基于所述选区更新信息对所述选区进行更新。
根据本公开的一个或多个实施例,提供了一种控制数据块的方法,包括:确定第一文档中的被引用数据块,所述被引用数据块与第二文档具有引用关系;响应于所述被引用数据块被执行目标操作,在所述第一文档中变更所述被引用数据块的位置;响应于在所述第一文档中变更所述被引用数据块的位置,保持所述第二文档与所述被引用块的引用关系。
根据本公开的一个或多个实施例,通过选区的关联数据块和选区的范围来描述所述被引用数据块的位置和范围;所述选区的关联数据块为所述被引用数据块的父数据块。
根据本公开的一个或多个实施例,所述保持所述第二文档与所述被引用块的引用关系,包括:基于所述目标操作重新确定所述选区的关联数据块和/或范围,以保持所述第二文档与所述被引用块的引用关系。
根据本公开的一个或多个实施例,所述目标操作包括拖拽操作。
根据本公开的一个或多个实施例,提供了一种控制数据块的方法,应用于客户端,包括:接收服务器发送的选区更新信息;所述选区更新信息由所述服务器基于以下步骤确定:响应于第一数据块被执行目标操作,确定所述第一数据块是否为选区的关联数据块;响应于确定所述第一数据块为选区的关联数据块,则基于所述目标操作重新确定所述选区的关联数据块和/或范围;基于重新确定的所述选区的关联数据块和/或范围确定选区更新信息;其中,所述选区被组织成通过选区的关联数据块和选区的范围来描述被引用数据块的位置和范围;所述被引用数据块为被至少一个在线文档引用的数据块;基于所述选区更新信息对所述选区进行更新。
根据本公开的一个或多个实施例,在所述基于所述选区更新信息对所述选区进行更新之前,所述方法还包括:确定所述选区的关联节点是否发生变更;若所述选区的关联节点未发生变更,则基于针对所述关联节点的目标操作重新确定所述选区的范围,并基于重新确定的所述选区的关联数据块的范围对所述选区进行更新;若所述选区的关联节点发生了变更,则执行所述基于所述选区更新信息对所述选区进行更新的步骤。
根据本公开的一个或多个实施例,所述方法还包括:若基于所述目标操作重新确定的所述关联数据块的范围为空,则执行所述基于所述选区更新信息对所述选区进行更新的步骤。
根据本公开的一个或多个实施例,提供了一种控制数据块的装置,包括:确定单元,用于响应于第一文档中的第一数据块被执行目标操作,确定所述第一数据块是否与第二文档具有引用关系;其中,所述目标操作用于在数据块下插入、删除、移动或替换子数据块;更新单元,用于响应于确定所述第一数据块与第二文档具有引用关系,则基于所述目标操作,更新所述第一文档中至少一个数据块与所述第二文档的引用关系。
根据本公开的一个或多个实施例,提供了一种控制数据块的装置,包括:被引用数据块确定单元,用于确定第一文档中的被引用数据块,所述被引用数据块与第二文档具有引用关系;位置变更单元,用于响应于所述被引用数据块被执行目标操作,在所述第一文档中变更所述被引用数据块的位置;引用单元,用于响应于在所述第一文档中变更被引用数据块的位置,保持所述第二文档与所述被引用块的引用关系。
根据本公开的一个或多个实施例,提供了一种控制数据块的装置,包括:信息接收单元,用于接收服务器发送的选区更新信息;所述选区更新信息由所述服务器基于以下步骤确定:响应于第一数据块被执行目标操作,确定所述第一数据块是否为选区的关联数据块;响应于确定所述第一数据块为选区的关联数据块,则基于所述目标操作重新确定所述选区的关联数据块和/或范围;基于重新确定的所述选区的关联数据块和/或范围确定选区更新信息;其中,所述选区被组织成通过选区的关联数据块和选区的范围来描述被引用数据块的位置和范围;所述被引用数据块为被至少一个在线文档引用的数据块;选区更新单元,用于基于所述选区更新信息对所述选区进行更新。
根据本公开的一个或多个实施例,提供了一种电子设备,包括:至少一个存储器和至少一个处理器;其中,所述存储器用于存储程序代码,所述处理器用于调用所述存储器所存储的程序代码以使所述电子设备执行根据本公开的一个或多个实施例提供的控制数据块的方法。
根据本公开的一个或多个实施例,提供了一种非暂态计算机存储介质,所述非暂态计算机存储介质存储有程序代码,所述程序代码被计算机设备执行时,使得所述计算机设备执行根据本公开的一个或多个实施例提供的控制数据块的方法。
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理 解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。

Claims (31)

  1. 一种控制数据块的方法,其特征在于,包括:
    响应于第一文档中的第一数据块被执行目标操作,确定所述第一数据块是否与第二文档具有引用关系;其中,所述目标操作用于在数据块下插入、删除、移动或替换子数据块;
    响应于确定所述第一数据块与第二文档具有引用关系,则基于所述目标操作,更新所述第一文档中至少一个数据块与所述第二文档的引用关系。
  2. 根据权利要求1所述的方法,其特征在于,所述基于所述目标操作,更新所述第一文档中至少一个数据块与所述第二文档的引用关系,包括:基于所述目标操作,更新所述第一数据块与所述第二文档的引用关系;
    若所述目标操作将所述第一数据块下的全部的或数量最多的被所述第二文档引用的被引用数据块移动至所述第一文档中第二数据块下,则所述基于所述目标操作,更新所述第一文档中至少一个数据块与所述第二文档的引用关系,还包括:基于所述目标操作,确定所述第二数据块与所述第二文档的引用关系。
  3. 根据权利要求2所述的方法,其特征在于,所述基于所述目标操作,更新所述第一数据块与所述第二文档的引用关系,包括:
    基于所述目标操作所针对的数据块在所述第一数据块下与所述第一数据块的其他子数据块的相对位置关系,更新所述第一数据块与所述第二文档的引用关系。
  4. 根据权利要求2所述的方法,其特征在于,所述基于所述目标操作,确定所述第二数据块与所述第二文档的引用关系,包括:
    基于被所述目标操作移动到所述第二数据块下的所述被引用数据块与所述第二数据块的其他子数据块的相对位置关系,确定所述第二数据块与所述第二文档的引用关系。
  5. 根据权利要求1-4中任一项所述的方法,其特征在于,
    所述确定所述第一数据块是否与第二文档具有引用关系,包括:确定所述第一数据块是否为选区的关联数据块;
    所述基于所述目标操作,确定所述第一文档中至少一个数据块与所述第二文档的引用关系,包括:响应于确定所述第一数据块为选区的关联数据块,则基于所述目标操作重新确定所述选区的关联数据块和/或范围;
    其中,所述选区被组织成通过选区的关联数据块和选区的范围来描述被引用数据块的位置和范围;所述被引用数据块为被至少一个在线文档引用的数据块。
  6. 根据权利要求5所述的方法,其特征在于,基于所述目标操作重新确定所述选区的关联数据块,包括:
    若所述目标操作将所述第一数据块下的全部的或数量最多的所述被引用数据块移动至第二数据块下,则将所述选区的关联数据块由所述第一数据块变更为所述第二数据块。
  7. 根据权利要求6所述的方法,其特征在于,基于所述目标操作重新确定所述选区的范围,包括:
    基于被所述目标操作移动到所述第二数据块下的所述被引用数据块与所述第二数据块的其他子数据块的相对位置关系,重新确定所述选区的范围。
  8. 根据权利要求5所述的方法,其特征在于,所述基于所述目标操作重新确定所述选区的关联数据块和/或范围,包括:
    若所述目标操作用于在所述第一数据块内移动所述被引用数据块,则将所述选区的关联数据块保持不变;
    基于移动后的所述被引用数据块与所述第一数据块的其他子数据块的相对位置关系,重新确定所述选区的范围。
  9. 根据权利要求5所述的方法,其特征在于,
    所述目标操作用于触发第一操作指令,或者用于触发第一操作指令和第二操作指令;所述第一操作指令用于编辑第一数据块,所述第二操作指令用于编辑所述第一数据块以外的其他数据块。
  10. 根据权利要求9所述的方法,其特征在于,所述基于所述目标操作重新确定所述选区的关联数据块和/或范围,包括:
    基于所述第一操作指令确定所述选区的初始更新范围;
    若基于所述第一操作指令确定所述选区的初始更新范围为空,且确定从所述第一数据块下删除的被引用数据块的父数据块变更为所述第一数据块以外的其他数据块,则将包含数量最多的从所述第一数据块下删除的被引用数据块的父数据块作为所述选区的新的关联数据块,并根据针对所述新的关联数据块的所述第二操作指令,确定所述选区的最终范围。
  11. 根据权利要求10所述的方法,其特征在于,所述基于所述目标操作重新确定所述选区的关联数据块和/或范围,包括:
    若基于所述第一操作指令确定所述选区的初始更新范围不为空,或确定从所述第一数据块下删除的被引用数据块的父数据块未变更为所述第一数据块以外的其他数据块,则将所述初始更新范围作为所述选区的最终范围。
  12. 根据权利要求9所述的方法,其特征在于,
    所述第一操作指令用于删除所述第一数据块的至少一个子数据块,所述第二操作指令用于往所述第一数据块之外的其他数据块插入至少一个子数据块。
  13. 根据权利要求9所述的方法,其特征在于,
    所述目标操作包括对数据块的拖拽操作。
  14. 根据权利要求5所述的方法,其特征在于,所述选区的范围具有左端点和右端点,所述基于所述目标操作重新确定选区的范围,包括:
    若所述目标操作用于在所述选区的左端点的左侧增加或删除N个数据块,则所述选区的左端点和右端点对应的数值均增加或减少N;或者,
    若所述目标操作用于在所述选区的右端点的右侧增加或删除N个数据块,则所述左端点和右端点对应的数值均保持不变;或者,
    若所述目标操作用于在所述选区的左端点与右端点之间增加或删除N个数据块,则所述选区的右端点对应的数值增加或减少N,且所述左端点对应的数值均保持不变;
    其中,N为正整数。
  15. 根据权利要求14所述的方法,其特征在于,所述基于所述目标操作重新确定选区的范围,包括:
    若所述目标操作用于在原文内、在所述选区的任意端点处增加N个数据块,则所述选区的范围不变;或者,
    若所述目标操作用于在引文内、在所述选区的右端点处增加N个数据块,则所述选区的右端点对应的数值均增加N,且所述左端点对应的数值保持不变;或者,
    若所述目标操作用于在引文内、在所述选区的左端点处侧增加N个数据块,则所述选区的左端点和右端点对应的数值均增加N;
    其中,所述引文为引用所述原文的一个或多个数据块的在线文档。
  16. 根据权利要求5所述的方法,其特征在于,所述基于所述目标操作重新确定所述选区的关联数据块和/或范围,包括:
    若所述目标操作用于将所述第一数据块下的所述被引用数据块拖拽至与所述第一数据块并列,则创建新数据块作为所述被拖拽的被引用数据块的父数据块;
    将所述选区的关联数据块更新为所述新数据块,其中,所述新数据块与所述第一数据块具有共同的父数据块;
    基于被所述目标操作拖拽至所述新数据块下的被引用数据块的数量,更新所述选区的范围。
  17. 根据权利要求16所述的方法,其特征在于,
    所述目标操作包括分栏操作。
  18. 根据权利要求5所述的方法,其特征在于,还包括:
    基于重新确定的所述选区的关联数据块和/或范围确定选区更新信息;
    向客户端发送所述选区更新信息,以使客户端能够基于所述选区更新信息对所述选区进行更新。
  19. 一种控制数据块的方法,其特征在于,包括:
    确定第一文档中的被引用数据块,所述被引用数据块与第二文档具有引用关系;
    响应于所述被引用数据块被执行目标操作,在所述第一文档中变更所述被引用数据块的位置;
    响应于在所述第一文档中变更所述被引用数据块的位置,保持所述第二文档与所述被引用块的引用关系。
  20. 根据权利要求19所述的方法,其特征在于,
    通过选区的关联数据块和选区的范围来描述所述被引用数据块的位置和范围;所述选区的关联数据块为所述被引用数据块的父数据块。
  21. 根据权利要求20所述的方法,其特征在于,所述保持所述第二文档与所述被引用块的引用关系,包括:
    基于所述目标操作重新确定所述选区的关联数据块和/或范围,以保持所述第二文档与所述被引用块的引用关系。
  22. 根据权利要求19所述的方法,其特征在于,所述目标操作包括拖拽操作。
  23. 一种控制数据块的方法,应用于客户端,其特征在于,包括:
    接收服务器发送的选区更新信息;所述选区更新信息由所述服务器基于以下步骤确定:响应于第一数据块被执行目标操作,确定所述第一数据块是否为选区的关联数据块;响应于确定所述第一数据块为选区的关联数据块,则基于所述目标操作重新确定所述选区的关联数据块和/或范围;基于重新确定的所述选区的关联数据块和/或范围确定选区更新信息;其中,所述选区被组织成通过选区的关联数据块和选区的范围来描述被引用数据块的位置和范围;所述被引用数据块为被至少一个在线文档引用的数据块;
    基于所述选区更新信息对所述选区进行更新。
  24. 根据权利要求23所述的方法,其特征在于,在所述基于所述选区更新信息对所述选区进行更新之前,所述方法还包括:
    确定所述选区的关联节点是否发生变更;
    若所述选区的关联节点未发生变更,则基于针对所述关联节点的目标操作重新确定所述选区的范围,并基于重新确定的所述选区的关联数据块的范围对所述选区进行更新;
    若所述选区的关联节点发生了变更,则执行所述基于所述选区更新信息对所述选区进行更新的步骤。
  25. 根据权利要求24所述的方法,其特征在于,还包括:
    若基于所述目标操作重新确定的所述关联数据块的范围为空,则执行所述基于所述选区更新信 息对所述选区进行更新的步骤。
  26. 一种控制数据块的装置,其特征在于,包括:
    确定单元,用于响应于第一文档中的第一数据块被执行目标操作,确定所述第一数据块是否与第二文档具有引用关系;其中,所述目标操作用于在数据块下插入、删除、移动或替换子数据块;
    更新单元,用于响应于确定所述第一数据块与第二文档具有引用关系,则基于所述目标操作,更新所述第一文档中至少一个数据块与所述第二文档的引用关系。
  27. 一种控制数据块的装置,其特征在于,包括:
    被引用数据块确定单元,用于确定第一文档中的被引用数据块,所述被引用数据块与第二文档具有引用关系;
    位置变更单元,用于响应于所述被引用数据块被执行目标操作,在所述第一文档中变更所述被引用数据块的位置;
    引用单元,用于响应于在所述第一文档中变更被引用数据块的位置,保持所述第二文档与所述被引用块的引用关系。
  28. 一种控制数据块的装置,其特征在于,包括:
    信息接收单元,用于接收服务器发送的选区更新信息;所述选区更新信息由所述服务器基于以下步骤确定:响应于第一数据块被执行目标操作,确定所述第一数据块是否为选区的关联数据块;响应于确定所述第一数据块为选区的关联数据块,则基于所述目标操作重新确定所述选区的关联数据块和/或范围;基于重新确定的所述选区的关联数据块和/或范围确定选区更新信息;其中,所述选区被组织成通过选区的关联数据块和选区的范围来描述被引用数据块的位置和范围;所述被引用数据块为被至少一个在线文档引用的数据块;
    选区更新单元,用于基于所述选区更新信息对所述选区进行更新。
  29. 一种控制数据块的系统,其特征在于,包括:
    具有如权利要求26所述的控制数据块的装置的服务器;或者,
    至少一个具有如权利要求28所述的控制数据块的装置的终端。
  30. 一种电子设备,其特征在于,包括:
    至少一个存储器和至少一个处理器;
    其中,所述存储器用于存储程序代码,所述处理器用于调用所述存储器所存储的程序代码以使所述电子设备执行权利要求1至25中任一项所述的方法。
  31. 一种非暂态计算机存储介质,其特征在于,
    所述非暂态计算机存储介质存储有程序代码,所述程序代码被计算机设备执行时,使得所述计算机设备执行权利要求1至25中任一项所述的方法。
PCT/CN2023/092714 2022-05-11 2023-05-08 控制数据块的方法、装置、系统、电子设备和存储介质 Ceased WO2023217074A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US18/864,817 US20250315597A1 (en) 2022-05-11 2023-05-08 Method for controlling a data block, electronic device, and storage medium
JP2024566544A JP2025516375A (ja) 2022-05-11 2023-05-08 データブロックの制御方法、装置及びシステム、電子機器、記憶媒体

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210515870.7A CN117094289A (zh) 2022-05-11 2022-05-11 控制数据块的方法、装置、系统、电子设备和存储介质
CN202210515870.7 2022-05-11

Publications (1)

Publication Number Publication Date
WO2023217074A1 true WO2023217074A1 (zh) 2023-11-16

Family

ID=88729750

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/092714 Ceased WO2023217074A1 (zh) 2022-05-11 2023-05-08 控制数据块的方法、装置、系统、电子设备和存储介质

Country Status (4)

Country Link
US (1) US20250315597A1 (zh)
JP (1) JP2025516375A (zh)
CN (1) CN117094289A (zh)
WO (1) WO2023217074A1 (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150363378A1 (en) * 2014-06-13 2015-12-17 International Business Machines Corporation Managing document unit references to improve collaborative document editing
CN112989773A (zh) * 2019-12-13 2021-06-18 北京庖丁科技有限公司 用于同步更新数据的方法、装置、设备和计算机可读介质
CN114417789A (zh) * 2021-12-23 2022-04-29 武汉金山办公软件有限公司 一种数据引用方法、装置、电子设备及存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0256669A (ja) * 1988-08-23 1990-02-26 Casio Comput Co Ltd 文書作成装置
JPH06119222A (ja) * 1992-10-06 1994-04-28 Matsushita Electric Ind Co Ltd 文書頁管理装置
JP2009223717A (ja) * 2008-03-18 2009-10-01 Nec Corp 文書管理装置、文書管理方法、及びプログラム
CN111858518B (zh) * 2020-07-09 2022-10-25 北京字节跳动网络技术有限公司 一种引用文档的更新方法、装置、电子设备及存储介质

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150363378A1 (en) * 2014-06-13 2015-12-17 International Business Machines Corporation Managing document unit references to improve collaborative document editing
CN112989773A (zh) * 2019-12-13 2021-06-18 北京庖丁科技有限公司 用于同步更新数据的方法、装置、设备和计算机可读介质
CN114417789A (zh) * 2021-12-23 2022-04-29 武汉金山办公软件有限公司 一种数据引用方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
JP2025516375A (ja) 2025-05-27
US20250315597A1 (en) 2025-10-09
CN117094289A (zh) 2023-11-21

Similar Documents

Publication Publication Date Title
JP6416894B2 (ja) プレゼンテーションスライドを編成するための自動化システム
JP7782938B2 (ja) ドキュメント処理方法、装置及び電子機器
US12554923B2 (en) Document processing method for online collaboration and apparatus, and device and medium
JP7722735B2 (ja) ドキュメント更新方法、装置、機器及び媒体
JP7812382B2 (ja) ドキュメントの編集方法、装置、デバイス及び記憶媒体
CN113239049B (zh) 信息的处理方法、装置、终端和存储介质
CN112363790B (zh) 表格的视图显示方法、装置和电子设备
WO2025087394A1 (zh) 素材展示方法、装置、设备及存储介质
CN115113861A (zh) 一种流程处理方法、装置及设备
CN114995690A (zh) 一种文档创建方法、装置、设备及存储介质
CN116226568A (zh) 一种信息展示方法、装置及设备
CN115695344A (zh) 信息处理方法、装置、终端和存储介质
CN114816144B (zh) 信息显示方法、装置和电子设备
WO2023217074A1 (zh) 控制数据块的方法、装置、系统、电子设备和存储介质
CN114707470A (zh) 一种文档编辑方法、装置、设备及存储介质
CN112507670A (zh) 一种文本编辑方法、装置、电子设备及存储介质
WO2024093576A1 (zh) 信息处理方法、装置、电子设备和存储介质
CN117608549A (zh) 一种流程节点的处理方法、装置、设备及介质
WO2024001434A1 (zh) 信息处理方法、装置、终端和存储介质
WO2018214987A1 (zh) 信息记录方法和装置
CN115079891B (zh) 文档内容展示方法、装置和电子设备
US20240338392A1 (en) Information processing method and device, electronic apparatus and storage medium
CN119903026A (zh) 文件管理方法、装置、介质、电子设备及程序产品
CN120223965A (zh) 一种视频编辑方法、装置、设备及存储介质
WO2024022472A1 (zh) 一种信息处理方法、装置、设备及介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23802844

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2024566544

Country of ref document: JP

Ref document number: 18864817

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 03.03.2025)

122 Ep: pct application non-entry in european phase

Ref document number: 23802844

Country of ref document: EP

Kind code of ref document: A1

WWP Wipo information: published in national office

Ref document number: 18864817

Country of ref document: US