Page processing methods, devices, electronic devices and media
By acquiring and comparing the structure tree encoding of the pages, the difference content display page is synthesized, which solves the problem of low page content comparison efficiency in intelligent question answering systems and achieves efficient page difference display and improved user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-18
- Publication Date
- 2026-03-10
AI Technical Summary
In existing technologies, intelligent question-and-answer systems struggle to efficiently compare and display differences in page content during after-sales knowledge maintenance, leading to information discrepancies and low reading efficiency.
By obtaining the structure trees and their codes of the two pages, the difference codes are determined and a third structure tree is synthesized to display the differences between the pages. The page comparison is performed using JSON or XML tree structures, simplifying data processing.
It improves the efficiency of comparing and displaying page content differences, simplifies data processing, and enhances the accuracy and user experience of the intelligent question-and-answer system.
Smart Images

Figure CN115630243B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more particularly to the fields of page processing and intelligent question answering, specifically to a page processing method, apparatus, electronic device, computer-readable storage medium, and computer program product. Background Technology
[0002] In recent years, intelligent question-answering technology in the field of artificial intelligence has made significant progress and applications. With the growth of cloud services and the rapid increase in the scale of after-sales issues, intelligent question-answering technology provides 24 / 7 uninterrupted service support and is widely used in after-sales, alleviating some of the pressure on after-sales support. Knowledge maintenance, as an effective means of improving the accuracy of intelligent assistants, is a core daily task for after-sales personnel, involving the addition, deletion, modification, and querying of question-answering knowledge.
[0003] The methods described in this section are not necessarily methods that had been previously conceived or adopted. Unless otherwise specified, no method described in this section should be assumed to be prior art simply because it is included in this section. Similarly, unless otherwise specified, the issues mentioned in this section should not be considered to be accepted in any prior art. Summary of the Invention
[0004] This disclosure provides a page processing method, apparatus, electronic device, computer-readable storage medium, and computer program product.
[0005] According to one aspect of this disclosure, a page processing method is provided, comprising: obtaining a first structure tree of a first page and a second structure tree of a second page, wherein at least one first node of the first structure tree corresponds to at least one first code, and at least one second node of the second structure tree corresponds to at least one second code, the second page is obtained by updating the first page based on at least one edit operation on the first page, and at least one second code is obtained by updating at least one first code based on at least one edit operation; determining at least one difference code between at least one first code and at least one second code to mark at least one difference node between the first structure tree and the second structure tree based on at least one difference code; synthesizing a third structure tree based on at least one of the first structure tree and the second structure tree and at least one difference node; and obtaining a third page based on page data corresponding to each node in the third structure tree, wherein the third page is used to display the difference content between the first page and the second page.
[0006] According to another aspect of this disclosure, a page processing apparatus is provided, comprising: a first acquisition unit configured to acquire a first structure tree of a first page and a second structure tree of a second page, wherein at least one first node of the first structure tree corresponds to at least one first code, and at least one second node of the second structure tree corresponds to at least one second code, the second page is obtained by updating the first page based on at least one edit operation on the first page, and at least one second code is obtained by updating at least one first code based on at least one edit operation; a first determination unit configured to determine at least one difference code between at least one first code and at least one second code, to mark at least one difference node between the first structure tree and the second structure tree based on at least one difference code; a synthesis unit configured to synthesize a third structure tree based on at least one of the first structure tree and the second structure tree and at least one difference node; and a second acquisition unit configured to obtain a third page based on page data corresponding to each node in the third structure tree, wherein the third page is used to display the difference content between the first page and the second page.
[0007] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the page processing method described above.
[0008] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause a computer to perform the page processing method described above.
[0009] According to another aspect of this disclosure, a computer program product is provided, including a computer program, wherein the computer program implements the above-described page processing method when executed by a processor.
[0010] According to one or more embodiments of this disclosure, the processing efficiency of comparing page content differences between two versions of a page and generating a page for displaying the revised page content can be improved.
[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0012] The accompanying drawings exemplify embodiments and form part of the specification, serving together with the textual description to explain exemplary implementations of the embodiments. The illustrated embodiments are for illustrative purposes only and do not limit the scope of the claims. Throughout the drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0013] Figure 1 A schematic diagram of an exemplary system in which the various methods described herein may be implemented according to embodiments of the present disclosure is shown;
[0014] Figure 2 A flowchart of a page processing method according to an embodiment of the present disclosure is shown;
[0015] Figure 3 A schematic diagram of a structure tree according to an exemplary embodiment of the present disclosure is shown;
[0016] Figure 4 A flowchart illustrating at least one difference node between a first structure tree and a second structure tree according to an embodiment of the present disclosure is shown;
[0017] Figure 5 A schematic diagram of a first structure tree and a second structure tree according to an exemplary embodiment of the present disclosure is shown;
[0018] Figure 6 A schematic diagram of a third structure tree according to an exemplary embodiment of the present disclosure is shown;
[0019] Figure 7 A structural block diagram of a page processing apparatus according to an embodiment of the present disclosure is shown;
[0020] Figure 8 A structural block diagram of an exemplary electronic device that can be used to implement embodiments of the present disclosure is shown. Detailed Implementation
[0021] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0022] In this disclosure, unless otherwise stated, the use of terms such as "first," "second," etc., to describe various elements is not intended to limit the positional, temporal, or importance relationships of these elements; such terms are merely used to distinguish one element from another. In some examples, the first element and the second element may refer to the same instance of that element, while in other cases, based on the context, they may refer to different instances.
[0023] The terminology used in the description of the various examples described in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context explicitly indicates otherwise, an element may be one or more unless the number of elements is specifically limited. Furthermore, the term "and / or" as used in this disclosure covers any one of the listed items and all possible combinations thereof.
[0024] Knowledge maintenance is an effective means to improve the accuracy of intelligent assistants. The core work of after-sales personnel every day is to maintain the addition, deletion, modification and query of question and answer knowledge. In the approval process after the operation, it is necessary to provide reviewers with a more efficient and convenient way to determine the content of the changes, understand the relevant personnel's modifications to the page, avoid information gaps, improve reading efficiency and make the page display method more intelligent, humanized and efficient, thereby improving service efficiency and quality and reducing operating costs.
[0025] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.
[0026] Figure 1 A schematic diagram of an exemplary system 100 in which the various methods and apparatus described herein can be implemented according to embodiments of this disclosure is shown. Reference Figure 1 The system 100 includes one or more client devices 101, 102, 103, 104, 105 and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105 and 106 can be configured to execute one or more applications.
[0027] In embodiments of this disclosure, server 120 may run one or more services or software applications that enable the execution of the page processing methods described above.
[0028] In some embodiments, server 120 may also provide other services or software applications, which may include non-virtual and virtual environments. In some embodiments, these services may be provided as web-based services or cloud services, such as to users of client devices 101, 102, 103, 104, 105, and / or 106 under a Software as a Service (SaaS) model.
[0029] exist Figure 1 In the configuration shown, server 120 may include one or more components that implement the functions performed by server 120. These components may include software components, hardware components, or combinations thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 can sequentially interact with server 120 using one or more client applications to utilize the services provided by these components. It should be understood that various different system configurations are possible and may differ from system 100. Therefore, Figure 1 This is an example of a system used to implement the various methods described herein, and is not intended to be limiting.
[0030] Users can use client devices 101, 102, 103, 104, 105, and / or 106 to edit the page. The client devices can provide an interface that allows users to interact with the client devices. The client devices can also output information to the user through this interface. Although... Figure 1 Only six client devices are described, but those skilled in the art will understand that this disclosure can support any number of client devices.
[0031] Client devices 101, 102, 103, 104, 105, and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptops), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, gaming systems, thin clients, various messaging devices, sensors, or other sensing devices. These computer devices can run various types and versions of software applications and operating systems, such as Microsoft Windows, Apple iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as Google Chrome OS); or include various mobile operating systems, such as Microsoft Windows Mobile OS, iOS, Windows Phone, and Android. Portable handheld devices may include cellular phones, smartphones, tablets, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Gaming systems may include various handheld gaming devices, internet-enabled gaming devices, etc. Client devices are capable of executing various applications, such as various internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and can use various communication protocols.
[0032] Network 110 can be any type of network well known to those skilled in the art, and can use any of a variety of available protocols (including but not limited to TCP / IP, SNA, IPX, etc.) to support data communication. By way of example only, one or more networks 110 can be a local area network (LAN), an Ethernet-based network, a token ring network, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.
[0033] Server 120 may include one or more general-purpose computers, special-purpose server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running a virtual operating system, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that can be virtualized to maintain virtual storage devices for servers). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.
[0034] The computing unit in server 120 can run one or more operating systems, including any of the aforementioned operating systems and any commercially available server operating system. Server 120 can also run any of a variety of additional server applications and / or middleware applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.
[0035] In some implementations, server 120 may include one or more applications to analyze and merge data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105 and / or 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105 and / or 106.
[0036] In some implementations, server 120 can be a server for a distributed system or a server integrated with blockchain. Server 120 can also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in the cloud computing service system, designed to address the shortcomings of traditional physical hosts and Virtual Private Server (VPS) services, such as high management difficulty and weak business scalability.
[0037] System 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. Databases 130 may reside in various locations. For example, a database used by server 120 may be local to server 120, or it may be located away from server 120 and may communicate with server 120 via a network-based or dedicated connection. Databases 130 may be of different types. In some embodiments, the database used by server 120 may be, for example, a relational database. One or more of these databases may store, update, and retrieve data from and from the databases in response to commands.
[0038] In some embodiments, one or more of the databases 130 may also be used by an application to store application data. The databases used by the application may be of different types, such as key-value stores, object stores, or regular stores supported by a file system.
[0039] Figure 1The system 100 can be configured and operated in various ways to enable the application of the various methods and apparatus described in this disclosure.
[0040] According to some embodiments, such as Figure 2 As shown, a page processing method is provided, including: step S201, obtaining a first structure tree of a first page and a second structure tree of a second page, wherein at least one first node of the first structure tree corresponds to at least one first code, and at least one second node of the second structure tree corresponds to at least one second code, the second page is obtained by updating the first page based on at least one editing operation on the first page, and at least one second code is obtained by updating at least one first code based on at least one editing operation; step S202, determining at least one difference code between at least one first code and at least one second code, so as to mark at least one difference node between the first structure tree and the second structure tree based on at least one difference code; step S203, synthesizing a third structure tree based on at least one of the first structure tree and the second structure tree and at least one difference node; and step S204, obtaining a third page based on the page data corresponding to each node in the third structure tree, wherein the third page is used to display the difference content between the first page and the second page.
[0041] This improves the efficiency of comparing the differences in page content between two versions of a page and generating a page to display the revised content.
[0042] According to some embodiments, the first and second tree structures are JSON tree structures or XML tree structures.
[0043] Since JSON and XML data structures are lightweight data exchange formats, applying JSON tree structures or XML tree structures for page comparison processing can further simplify the data to be processed, thereby improving processing efficiency.
[0044] In some embodiments, the extraction of the JSON tree structure or XML tree structure of a page can first be performed by extracting the DOM (Document Object Model) tree of the page based on the page code, and then transforming the DOM tree to obtain the structure tree in this embodiment of the disclosure.
[0045] In some exemplary embodiments, the document object in the DOM tree can be extracted first using the getElementsByClassName() or getElementById() methods provided in HTML (Hypertext Markup Language). Then, an empty object can be created, containing attributes such as tag name, class name, attributes, and child nodes. The extracted document object is then recursively traversed, and the attributes of each document object are determined accordingly. If the child node attribute of a traversed document object is not empty, then that child node is used as the object to be traversed, and its attribute values are determined. This process is repeated recursively until all attributes of the document object are determined.
[0046] Then, a new empty object is created, and the above traversal process is performed on another document object until all document objects have been traversed. Finally, the extracted object data can be processed using the JSON.stringify() method to obtain a JSON tree structure, which is the structure tree in the embodiments of this disclosure.
[0047] In some exemplary embodiments, the structure tree in the embodiments of this disclosure may include a node, namely the root node of the page.
[0048] In some exemplary embodiments, the structure tree in the embodiments of this disclosure may include multiple nodes, including a root node and at least one branch node under the root node.
[0049] In some embodiments, each branch node may correspond to a block component, a block component attribute, or content within a block component on the page.
[0050] In some embodiments, page components may include, for example, image components, table components, code display components, to-do list components, etc.
[0051] Figure 3 A schematic diagram of a structure tree according to an exemplary embodiment of the present disclosure is shown.
[0052] Among them, such as Figure 3As shown, root node 301 corresponds to the root component of this page. The root node includes three child nodes: child node 302 and child node 303. Child node 302 can be, for example, an image component. This child node 302 can include further child nodes, namely child nodes 304 and 305. Child node 304 can correspond to the size attribute of the image component, and child node 305 can correspond to the content of the image component (e.g., a link to the image). Child node 303 can be, for example, a table component. This table component can include further child nodes, namely child nodes 306 and 307. Child nodes 306 and 307 can be cell components, and the further child nodes of each cell component can correspond to cell content and cell color attributes, respectively (as shown by child nodes 308, 309, 310, and 311).
[0053] In some embodiments, after the page is initially built, its initial structure tree can be extracted using the method described above, and a unique encoding identifier can be set for each branch node of the initial structure tree. In some embodiments, a corresponding encoding identifier can also be set for the root node and each branch node.
[0054] Subsequently, when maintenance personnel edit the page, they can update the corresponding node codes based on the edited page data, thus laying the foundation for subsequent comparison of page content and generation and display of page revisions.
[0055] In some embodiments, in response to maintenance personnel editing the page, while updating the node codes, relevant information about the editing (such as the identity ID of the entity performing the editing and the editing time) can also be recorded, and the mapping relationship between the above information and the corresponding node codes can be recorded accordingly, thereby laying the foundation for the subsequent display of relevant information.
[0056] In some embodiments, at least one editing operation may include at least one of adding, deleting, modifying, and moving.
[0057] According to some embodiments, updating at least one first code based on at least one edit operation includes at least one of the following: in response to receiving an operation to add page data in a first page, adding a new node code corresponding to the added page data in at least one first code; in response to receiving an operation to delete first page data in the first page, deleting the original node code corresponding to the first page data in at least one first code; and in response to receiving an operation to modify or move second page data in the first page, deleting the original node code corresponding to the second page data in at least one first code, and adding a new node code corresponding to the edited second page data in at least one first code, wherein the new node code corresponding to the edited second page data is different from the original node code corresponding to the second page data.
[0058] In some embodiments, when a user deletes a block component or block component content in the original page, the original node code corresponding to the block component or block component content can be deleted from the original code set.
[0059] In some embodiments, in response to a user adding a block component or block component content at a certain location on the original page, a new node code can be added at the corresponding location in the original code set. This new node code is different from the original node codes.
[0060] In some embodiments, for a user's modification operation on a block component, quick component attribute, or block component content in the original page, the original node code corresponding to the block component, quick component attribute, or block component content can first be deleted from the original code set. At the same time, a new node code can be added at the corresponding position, which is different from the original node code that was deleted.
[0061] In some embodiments, for a user's movement operation on a block component or block component content in the original page, the original node code corresponding to the block component or block component content can be deleted from the original code set first. At the same time, a new node code can be added at the corresponding position, which is different from the original node code that was deleted.
[0062] Therefore, by equating moving and modifying operations with the deletion of old codes and the addition of new codes, the comparison process can be further simplified and comparison efficiency improved.
[0063] In some embodiments, the second page may be obtained by editing the first page once or multiple times by one or more users.
[0064] After obtaining at least one first code from the first page and at least one second code from the second page, the difference codes between the two can be determined by comparing the at least one first code and the at least one second code. Based on the difference codes and the correspondence between each code and a node, the difference nodes are marked in the first and / or second structure trees, thereby determining at least one difference node. Subsequently, a third structure tree can be synthesized based on the first structure tree, the second structure tree, and the at least one difference node.
[0065] According to some embodiments, such as Figure 4 As shown, in response to at least one editing operation satisfying at least one of the following: at least one editing operation includes a deletion operation and an addition operation; at least one editing operation includes a modification operation; and at least one editing operation includes a move operation; marking at least one difference node between the first structure tree and the second structure tree based on at least one difference code includes: step S401, obtaining at least one first difference code from at least one first code based on at least one second code to mark a first difference node corresponding to the at least one first difference code in the first structure tree, each of the at least one first difference code being the original node code of the corresponding page data before the editing operation; step S402, obtaining at least one second difference code from at least one first code from at least one second code to mark a second difference node corresponding to the at least one second difference code in the second structure tree, each of the at least one second difference code being a newly added node code of the corresponding page data after the editing operation; and step S403, obtaining at least one difference node based on at least one first difference node and at least one second difference node.
[0066] Therefore, when an editing operation involves both deleting and adding nodes on the first page, the differences between the corresponding node codes on the two pages are compared. Deleted nodes in the first tree structure relative to the second tree structure, and newly added nodes in the second tree structure relative to the first tree structure, are marked respectively, thus obtaining all differences between the two tree structures. Marking these differences in the tree structures of both versions allows for efficient acquisition of the nodes corresponding to each difference code, facilitating the subsequent insertion of page data for the corresponding nodes and the display of the editing history on the same page.
[0067] In some embodiments, when the editing operation from the first page to the second page involves both the deletion and addition of nodes in the first page, there are difference codes in at least one first code and at least one second code. Accordingly, when determining at least one difference node, the difference node needs to be marked in the first structure tree and the second structure tree respectively.
[0068] Figure 5 A schematic diagram of a first structure tree and a second structure tree according to an exemplary embodiment of the present disclosure is shown.
[0069] In some exemplary embodiments, such as Figure 5 As shown, after comparison, the difference codes between the first structure tree 510 and the second structure tree 520 include 3, 4, 3-1, and 6, respectively. Then, based on the difference codes and the correspondence between each code and a node, the difference nodes (including nodes 511, 512, 521, and 522) can be marked in both the first and second structure trees, thus obtaining the marked first and second structure trees. Specifically, nodes 511 and 512 marked in the first structure tree 510 are previously deleted nodes, while nodes 521 and 522 marked in the second structure tree 520 are newly added nodes.
[0070] According to some embodiments, composing a third structure tree based on at least one of a first structure tree and a second structure tree, and at least one difference node, includes: inserting at least one first difference node into a corresponding position in a marked second structure tree to obtain a third structure tree, wherein the corresponding position in the marked second structure tree is determined based on the position of at least one first difference node in the first structure tree; or inserting at least one second difference node into a corresponding position in a marked first structure tree to obtain a third structure tree, wherein the corresponding position in the marked first structure tree is determined based on the position of at least one second difference node in the second structure tree.
[0071] Therefore, by obtaining the difference nodes in each structure tree separately, and inserting the corresponding difference nodes in the other structure tree into the structure tree based on one of the structure trees, the third structure tree can be obtained efficiently.
[0072] In some embodiments, the process of composing the third structure tree can use one of the first structure tree and the second structure tree as the base structure tree, and insert the difference nodes from the other into the corresponding positions in the base structure tree, thereby completing the synthesis of the third structure tree.
[0073] In some exemplary embodiments, for example, it can be used as Figure 5 The first structure tree 510 shown is used as the base structure tree, and the difference nodes (nodes 521 and 522) in the second structure tree 520 are inserted into the corresponding positions of the first structure tree 510.
[0074] In some embodiments, for a node to be inserted, the sibling nodes of the node to be inserted can be determined first based on the position of the node to be inserted in its own tree structure, and it can be determined whether the sibling nodes also include a common node that exists in both the first tree structure and the second tree structure. If so, the common sibling node that exists in both the first tree structure and the second tree structure determines the relative position of the node to be inserted and attaches it to the corresponding position under its parent node.
[0075] In some embodiments, if the node to be inserted has no common sibling node that can be referenced, the parent node corresponding to the node to be inserted can be determined according to the position of the node to be inserted in its tree structure, and the node to be inserted can be directly attached to the corresponding parent node in the base tree structure.
[0076] In some exemplary embodiments, see Figure 5 When the first structure tree 510 is used as the base structure tree, when inserting node 522 into the first structure tree 510, its sibling node, namely node 523, can first be obtained. Based on the previous encoding comparison, it can be determined that node 523 is a common node contained in both the first and second structure trees. Therefore, the insertion position of node 522 can be determined based on node 513 in the first structure tree corresponding to this node, that is, the node after node 513. Similarly, node 521 can also be inserted into the corresponding position in the first structure tree 510, thereby obtaining... Figure 6 The composite structure tree shown is 600.
[0077] According to some embodiments, in response to determining that each of the at least one editing operations is a deletion operation, marking at least one difference node between the first and second structure trees based on at least one difference code includes: obtaining at least one first difference code in at least one first code based on at least one second code to mark the first difference node corresponding to the at least one first difference code in the first structure tree, wherein each of the at least one first difference code is the original node code of the corresponding page data before the editing operation; and synthesizing a third structure tree based on at least one of the first and second structure trees and at least one difference node includes: determining the marked first structure tree as the third structure tree.
[0078] Therefore, when it is determined that the editing operation only involves the deletion of nodes in the first page, the scheme can be further simplified and the comparison efficiency improved by using the marked first structure tree as the third structure tree.
[0079] In some embodiments, when the editing operation from the first page to the second page involves only the deletion of nodes on the first page, this is reflected in the encoding by the existence of at least one differential encoding corresponding to the deleted node in at least one first encoding. Accordingly, when determining at least one differential node, it is only necessary to mark the corresponding differential node in the first structure tree.
[0080] Since there are no difference nodes in the second structure tree that need to be inserted into the first structure tree, the already labeled first structure tree can be directly used as the third structure tree.
[0081] According to some embodiments, in response to determining that each of the at least one editing operations is a deletion operation, marking at least one difference node between the first and second structure trees based on at least one difference code in a first structure tree and a second structure tree includes: obtaining at least one second difference code in at least one second code based on at least one first code to mark a second difference node corresponding to the at least one second difference code in the second structure tree, each of the at least one second difference code being a newly added node code after the corresponding page data has been edited; and synthesizing a third structure tree based on at least one of the first and second structure trees and at least one difference node includes: determining the marked second structure tree as the third structure tree.
[0082] Therefore, when it is determined that the editing operation only involves adding nodes in the first page, the scheme can be further simplified and the comparison efficiency improved by using the marked second structure tree as the third structure tree.
[0083] In some embodiments, when the editing operation from the first page to the second page involves only the addition of nodes on the first page, this is reflected in the encoding by the existence of at least one differential encoding corresponding to the newly added node in at least one second encoding. Accordingly, when determining at least one differential node, it is only necessary to mark the corresponding differential node in the second structure tree.
[0084] Since there are no difference nodes in the first structure tree that need to be inserted into the second structure tree, the already labeled second structure tree can be directly used as the third structure tree.
[0085] After obtaining the third structure tree, the third page, which displays the differences between the first and second pages, can be obtained based on the page data corresponding to each node in the third structure tree.
[0086] In some embodiments, the structure tree can be first converted into a DOM tree so that the corresponding page data can be inserted into the original page data, thereby completing the rendering of the third page.
[0087] In some exemplary embodiments, converting a JSON structure tree into a DOM tree can be achieved using the following methods. First, an array can be created to store objects that have been added to the DOM tree. This array can also be used to store newly generated secondary parent nodes. This array can be denoted as `childRoot` for example. At the same time, an array can be created to store copies of the original data. This array can be denoted as `cloneAllJson` for example.
[0088] Subsequently, leveraging the characteristic that the root node has no parent node, all nodes are traversed to find the root node, which is then added to the DOM tree and the `childRoot` array. Simultaneously, this node object is removed from the `cloneAllJson` array object. This further reduces redundant traversals and improves processing efficiency. Then, by traversing the `cloneAllJson` array, among the remaining node objects in the array, all child nodes of the current first object in the `childRoot` array are found based on their parent node properties. These child nodes are then added to the DOM tree and the `childRoot` array respectively, and removed from the `cloneAllJson` array object accordingly. After adding all child nodes of the first element, the first `childRoot` object is removed, and the above operation is repeated for the next object until all objects have been traversed.
[0089] Then, the corresponding DOM tree of the third structure tree can be obtained and rendered accordingly to obtain the third page.
[0090] According to some embodiments, each difference node in at least one difference node includes a corresponding edit category, which includes an add category and a delete category. Obtaining a third page based on the page data corresponding to each node in the third structure tree includes: obtaining a fourth page by rendering the page data corresponding to each node in the third structure tree; in response to determining that the third structure tree includes at least one first difference node, adding a first tag to each first difference content in at least one first difference content corresponding to the first difference node in the fourth page, wherein the edit category of each first difference node in the at least one first difference node is a delete category; in response to determining that the third structure tree includes at least one second difference node, adding a second tag to each second difference content in at least one second difference content corresponding to the second difference node in the fourth page, wherein the edit category of each second difference node in the at least one second difference node is an add category; obtaining a third page based on the fourth page and at least one tag corresponding to at least one difference content in the fourth page, wherein the at least one difference content includes at least one of the first difference content and the second difference content.
[0091] Therefore, during page rendering, the corresponding page content is marked based on the editing category of each difference node. This allows the revised content on the page to be displayed in conjunction with the corresponding marks, thus improving the user experience.
[0092] In some embodiments, each difference node is marked with a corresponding editing category, and each editing category corresponds to a different mark when displayed on the page.
[0093] In some exemplary embodiments, for page content whose edit category is "delete," this content can be marked during rendering using crossout symbols, highlighting with a certain color, etc.; for page content whose edit category is "add," this content can be marked during rendering using underline symbols, highlighting with a certain color, etc. Thus, based on the correspondence between difference nodes and corresponding edit categories, the page content that needs to be annotated and the annotation type for each page content can be efficiently determined, improving page rendering efficiency.
[0094] According to some embodiments, each of the at least one difference codes has a mapping relationship with the first information corresponding to the difference code. The first information includes the executing entity and execution time of the corresponding editing operation. Furthermore, the above method may further include: obtaining the first information corresponding to the difference code based on the difference code corresponding to each of the at least one difference content in the fourth page; and updating the third page based on the fourth page and one or more of the first information corresponding to one or more of the at least one difference content, wherein each of the one or more pieces of first information is displayed in response to the user's first operation.
[0095] In some embodiments, the first information may be displayed in response to receiving a preset operation from the user. The preset operation could be, for example, the user hovering the mouse over the corresponding page content or the user clicking on the corresponding page content. In some embodiments, the first information may also be directly displayed in a preset area on the page corresponding to the page content.
[0096] Therefore, based on node encoding, information related to the user's editing operations is recorded. When displaying the page, the user who performed the revision and the revision time can be shown based on the mapping relationship between node encoding and corresponding information, further improving the user experience. At the same time, based on this mapping relationship, the revision history of multiple versions of the page can be recorded, so that any two versions of the page can be compared based on the above method, and the revision records between any two versions can be intuitively displayed to the user without the need for the user to trace back to the source by flipping through each historical version.
[0097] According to some embodiments, such as Figure 7 As shown, a page processing apparatus 700 is provided, comprising: a first acquisition unit 710 configured to acquire a first structure tree of a first page and a second structure tree of a second page, wherein at least one first node of the first structure tree corresponds to at least one first code, and at least one second node of the second structure tree corresponds to at least one second code, the second page is obtained by updating the first page based on at least one editing operation on the first page, and at least one second code is obtained by updating at least one first code based on at least one editing operation; a first determination unit 720 configured to determine at least one difference code between at least one first code and at least one second code, to mark at least one difference node between the first structure tree and the second structure tree based on at least one difference code; a synthesis unit 730 configured to synthesize a third structure tree based on at least one of the first structure tree and the second structure tree and at least one difference node; and a second acquisition unit 740 configured to obtain a third page based on page data corresponding to each node in the third structure tree, wherein the third page is used to display the difference content between the first page and the second page.
[0098] The operations performed by units 710-740 in the page processing device 700 are similar to those of steps S201-S204 in the page processing method described above, and will not be described in detail here.
[0099] This improves the efficiency of comparing the differences in page content between two versions of a page and generating a page to display the revised content.
[0100] According to some embodiments, at least one editing operation includes at least one of adding, deleting, modifying, and moving. The first acquisition unit is configured to perform at least one of the following operations: in response to receiving an add operation for page data in the first page, adding a new node code corresponding to the added page data in at least one first code; in response to receiving a delete operation for the first page data in the first page, deleting the original node code corresponding to the first page data in at least one first code; and in response to receiving a modify or move operation for the second page data in the first page, deleting the original node code corresponding to the second page data in at least one first code, and adding a new node code corresponding to the edited second page data in at least one first code, wherein the new node code corresponding to the edited second page data is different from the original node code corresponding to the second page data.
[0101] Therefore, by equating moving and modifying operations with the deletion of old codes and the addition of new codes, the comparison process can be further simplified and comparison efficiency improved.
[0102] According to some embodiments, in response to at least one editing operation satisfying at least one of the following: at least one editing operation includes a deletion operation and an addition operation; at least one editing operation includes a modification operation; and at least one editing operation includes a move operation; a first determining unit is configured to: based on at least one second encoding, obtain at least one first difference encoding in at least one first encoding to mark a first difference node corresponding to the at least one first difference encoding in a first structure tree, each of the at least one first difference encoding being the original node encoding of the corresponding page data before the editing operation; based on at least one first encoding, obtain at least one second difference encoding in at least one second encoding to mark a second difference node corresponding to the at least one second difference encoding in a second structure tree, each of the at least one second difference encoding being a newly added node encoding of the corresponding page data after the editing operation; and based on at least one first difference node and at least one second difference node, obtain at least one difference node.
[0103] Therefore, when an editing operation involves both deleting and adding nodes on the first page, the differences between the corresponding node codes on the two pages are compared. Deleted nodes in the first tree structure relative to the second tree structure, and newly added nodes in the second tree structure relative to the first tree structure, are marked respectively, thus obtaining all differences between the two tree structures. Marking these differences in the tree structures of both versions allows for efficient acquisition of the nodes corresponding to each difference code, facilitating the subsequent insertion of page data for the corresponding nodes and the display of the editing history on the same page.
[0104] According to some embodiments, the synthesis unit is configured to: insert at least one first difference node into a corresponding position in a labeled second structure tree to obtain a third structure tree, wherein the corresponding position in the labeled second structure tree is determined based on the position of at least one first difference node in the first structure tree; or insert at least one second difference node into a corresponding position in a labeled first structure tree to obtain a third structure tree, wherein the corresponding position in the labeled first structure tree is determined based on the position of at least one second difference node in the second structure tree.
[0105] Therefore, by obtaining the difference nodes in each structure tree separately, and inserting the corresponding difference nodes in the other structure tree into the structure tree based on one of the structure trees, the third structure tree can be obtained efficiently.
[0106] According to some embodiments, in response to determining that each of the at least one editing operations is a deletion operation, a first determining unit is configured to: obtain at least one first difference code in at least one first code based on at least one second code, to mark a first difference node corresponding to the at least one first difference code in a first structure tree, wherein each of the at least one first difference code is the original node code of the corresponding page data before the editing operation; and a synthesis unit is configured to: determine the marked first structure tree as a third structure tree.
[0107] Therefore, when it is determined that the editing operation only involves the deletion of nodes in the first page, the scheme can be further simplified and the comparison efficiency improved by using the marked first structure tree as the third structure tree.
[0108] According to some embodiments, in response to determining that each of the at least one editing operations is a deletion operation, a first determining unit is configured to: obtain at least one second difference code in at least one second code based on at least one first code, to mark a second difference node corresponding to the at least one second difference code in a second structure tree, wherein each of the at least one second difference code is a newly added node code after the corresponding page data has been edited; and a synthesis unit is configured to: determine the marked second structure tree as a third structure tree.
[0109] Therefore, when it is determined that the editing operation only involves adding nodes in the first page, the scheme can be further simplified and the comparison efficiency improved by using the marked second structure tree as the third structure tree.
[0110] According to some embodiments, each of the at least one difference node includes a corresponding edit category, the edit category including a new category and a delete category. The second acquisition unit includes: a first acquisition subunit configured to acquire a fourth page by rendering the page data corresponding to each node in the third structure tree; a first addition subunit configured to, in response to determining that the third structure tree includes at least one first difference node, add a first tag to each of the at least one first difference content corresponding to the first difference node in the fourth page, wherein the edit category of each of the at least one first difference node is a delete category; a second addition subunit configured to, in response to determining that the third structure tree includes at least one second difference node, add a second tag to each of the at least one second difference content corresponding to the second difference node in the fourth page, wherein the edit category of each of the at least one second difference node is a new category; and a second acquisition subunit configured to acquire a third page based on the fourth page and at least one tag corresponding to at least one difference content in the fourth page, wherein the at least one difference content includes at least one of the first difference content and the second difference content.
[0111] Therefore, during page rendering, the corresponding page content is marked based on the editing category of each difference node. This allows the revised content on the page to be displayed in conjunction with the corresponding marks, thus improving the user experience.
[0112] According to some embodiments, each of the at least one difference codes has a mapping relationship with the first information corresponding to the difference code. The first information includes the executing entity and execution time of the corresponding editing operation. Furthermore, the above-mentioned apparatus may further include: a third acquisition unit configured to acquire the first information corresponding to the difference code based on the difference code corresponding to each of the at least one difference content in the fourth page; and an update unit configured to update the third page based on the fourth page and one or more of the first information corresponding to one or more of the at least one difference content, wherein each of the one or more pieces of first information is displayed in response to a user's first operation.
[0113] Therefore, based on node encoding, information related to the user's editing operations is recorded. When displaying the page, the user who performed the revision and the revision time can be shown based on the mapping relationship between node encoding and corresponding information, further improving the user experience. At the same time, based on this mapping relationship, the revision history of multiple versions of the page can be recorded, so that any two versions of the page can be compared based on the above method, and the revision records between any two versions can be intuitively displayed to the user without the need for the user to trace back to the source by flipping through each historical version.
[0114] According to embodiments of this disclosure, an electronic device, a readable storage medium, and a computer program product are also provided.
[0115] refer to Figure 8 The present invention describes a structural block diagram of an electronic device 800 that can serve as a server or client of the present disclosure, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0116] like Figure 8 As shown, the electronic device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. The RAM 803 may also store various programs and data required for the operation of the electronic device 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0117] Multiple components in electronic device 800 are connected to I / O interface 805, including: input unit 806, output unit 807, storage unit 808, and communication unit 809. Input unit 806 can be any type of device capable of inputting information to electronic device 800. Input unit 806 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of electronic device, and can include, but is not limited to, a mouse, keyboard, touchscreen, trackpad, trackball, joystick, microphone, and / or remote control. Output unit 807 can be any type of device capable of presenting information, and can include, but is not limited to, a monitor, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 808 can include, but is not limited to, a hard disk and an optical disk. Communication unit 809 allows electronic device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and can include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth™ devices, 802.11 devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.
[0118] The computing unit 801 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as the page processing method described above. For example, in some embodiments, the page processing method described above can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the page processing method described above can be performed. Alternatively, in other embodiments, the computing unit 801 can be configured to perform the page processing method described above by any other suitable means (e.g., by means of firmware).
[0119] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0120] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0121] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, 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 devices, magnetic storage devices, or any suitable combination of the foregoing.
[0122] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0123] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0124] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0125] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0126] While embodiments or examples of this disclosure have been described with reference to the accompanying drawings, it should be understood that the methods, systems, and devices described above are merely exemplary embodiments or examples, and the scope of the invention is not limited by these embodiments or examples, but only by the granted claims and their equivalents. Various elements in the embodiments or examples may be omitted or replaced by their equivalents. Furthermore, the steps may be performed in a different order than that described in this disclosure. Further, various elements in the embodiments or examples may be combined in various ways. Importantly, as the technology evolves, many elements described herein can be replaced by equivalents that appear after this disclosure.
Claims
1. A page processing method, the method comprising: obtaining a first structure tree of a first page and a second structure tree of a second page, wherein at least one first node of the first structure tree respectively corresponds to at least one first encoding, at least one second node of the second structure tree respectively corresponds to at least one second encoding, the second page is obtained based on at least one editing operation on the first page, and the at least one second encoding is obtained based on the at least one editing operation updating the at least one first encoding; determining at least one difference encoding between the at least one first encoding and the at least one second encoding, to mark at least one difference node between the first structure tree and the second structure tree based on the at least one difference encoding in the first structure tree and the second structure tree; synthesizing a third structure tree based on at least one of the first structure tree and the second structure tree and the at least one difference node; and obtaining a third page based on page data corresponding to each node in the third structure tree, wherein the third page is used to show difference content between the first page and the second page, each difference node in the at least one difference node comprises a corresponding editing category, and the obtaining of the third page based on the page data corresponding to each node in the third structure tree comprises: obtaining a fourth page by rendering the page data corresponding to each node in the third structure tree; adding a mark to difference content corresponding to each difference node in the at least one difference node in the fourth page according to the editing category corresponding to the difference node; and obtaining the third page based on the fourth page and at least one mark corresponding to at least one difference content in the fourth page.
2. The method of claim 1, wherein, The at least one editing operation comprises at least one of adding, deleting, modifying and moving, and the updating of the at least one first encoding based on the at least one editing operation comprises at least one of: adding a new node encoding corresponding to new page data in the at least one first encoding in response to receiving an adding operation on the page data in the first page; deleting an original node encoding corresponding to first page data in the first page in the at least one first encoding in response to receiving a deleting operation on the first page data; and deleting an original node encoding corresponding to second page data in the first page in the at least one first encoding and adding a new node encoding corresponding to the edited second page data in the at least one first encoding in response to receiving a modifying operation or a moving operation on the second page data, wherein the new node encoding corresponding to the edited second page data and the original node encoding corresponding to the second page data are different.
3. The method of claim 2, wherein, In response to the at least one editing operation satisfying at least one of: the at least one editing operation comprises a deleting operation and an adding operation; the at least one editing operation comprises a modifying operation; and the at least one editing operation comprises a moving operation. The marking, based on the at least one difference encoding, of at least one difference node between the first structure tree and the second structure tree comprises: obtaining, based on the at least one second encoding, at least one first difference encoding in the at least one first encoding to mark a first difference node corresponding to the at least one first difference encoding in the first structure tree, each of the at least one first difference encoding being an original node encoding of corresponding page data before an editing operation; obtaining, based on the at least one first encoding, at least one second difference encoding in the at least one second encoding to mark a second difference node corresponding to the at least one second difference encoding in the second structure tree, each of the at least one second difference encoding being a new node encoding of corresponding page data after the editing operation; and obtaining the at least one difference node based on the at least one first difference node and the at least one second difference node.
4. The method of claim 3, wherein, The synthesizing, based on at least one of the first structure tree and the second structure tree and the at least one difference node, of a third structure tree comprises: inserting the at least one first difference node into a corresponding position in the marked second structure tree to obtain the third structure tree, wherein the corresponding position in the marked second structure tree is determined based on a position of the at least one first difference node in the first structure tree; or inserting the at least one second difference node into a corresponding position in the marked first structure tree to obtain the third structure tree, wherein the corresponding position in the marked first structure tree is determined based on a position of the at least one second difference node in the second structure tree.
5. The method of claim 2, wherein, In response to determining that each of the at least one editing operation is a deletion operation, the marking, based on the at least one difference encoding, of at least one difference node between the first structure tree and the second structure tree comprises: obtaining, based on the at least one second encoding, at least one first difference encoding in the at least one first encoding to mark a first difference node corresponding to the at least one first difference encoding in the first structure tree, each of the at least one first difference encoding being an original node encoding of corresponding page data before an editing operation; and The synthesizing, based on at least one of the first structure tree and the second structure tree and the at least one difference node, of a third structure tree comprises: determining the marked first structure tree as the third structure tree.
6. The method of claim 2, wherein, In response to determining that each of the at least one editing operation is a deletion operation, the marking, based on the at least one difference encoding, of at least one difference node between the first structure tree and the second structure tree comprises: based on the at least one first encoding, obtaining at least one second difference encoding in the at least one second encoding to mark a second difference node corresponding to the at least one second difference encoding in the second structure tree, each of the at least one second difference encoding being a newly added node encoding after the corresponding page data is subjected to an editing operation; and the synthesizing the third structure tree based on at least one of the first structure tree and the second structure tree and the at least one difference node comprises: determining the marked second structure tree as the third structure tree.
7. The method of any one of claims 1-6, wherein, the editing category comprises an adding category and a deleting category, and the adding the mark to the difference content corresponding to the difference node in the fourth page according to the editing category of each difference node in the at least one difference node comprises: in response to determining that the third structure tree comprises at least one first difference node, adding a first mark to each of at least one first difference content corresponding to the first difference node in the fourth page, the editing category of each of the at least one first difference node being the deleting category; and in response to determining that the third structure tree comprises at least one second difference node, adding a second mark to each of at least one second difference content corresponding to the second difference node in the fourth page, the editing category of each of the at least one second difference node being the adding category.
8. The method of claim 7, wherein, each of the at least one difference encoding has a mapping relationship with first information corresponding to the difference encoding, the first information comprising an execution subject and an execution time of the corresponding editing operation, and the method further comprises: based on the difference encoding corresponding to each of the at least one difference content in the fourth page, obtaining the first information corresponding to the difference encoding; and based on one or more first information corresponding to one or more of the at least one difference content in the fourth page and the fourth page, updating the third page, wherein each of the one or more first information is displayed in response to a first operation of a user.
9. The method of any one of claims 1-6, wherein, the first structure tree and the second structure tree are Json tree structures or XML tree structures.
10. A page processing apparatus, the apparatus comprising: a first obtaining unit configured to obtain a first structure tree of a first page and a second structure tree of a second page, wherein at least one first node of the first structure tree corresponds to at least one first encoding respectively, at least one second node of the second structure tree corresponds to at least one second encoding respectively, the second page is obtained by updating the first page based on at least one editing operation on the first page, and the at least one second encoding is obtained by updating the at least one first encoding based on the at least one editing operation; a first determining unit configured to determine at least one difference encoding between the at least one first encoding and the at least one second encoding, to mark at least one difference node between the first structure tree and the second structure tree based on the at least one difference encoding in the first structure tree and the second structure tree; a synthesizing unit configured to synthesize a third structure tree based on at least one of the first structure tree and the second structure tree and the at least one difference node; and a second obtaining unit configured to obtain a third page based on page data corresponding to each node in the third structure tree, wherein the third page is used to display difference content between the first page and the second page, each difference node in the at least one difference node comprises a corresponding edit category, and the second obtaining unit comprises: a first obtaining sub-unit configured to obtain a fourth page by rendering the page data corresponding to each node in the third structure tree; a sub-unit configured to add a mark to difference content corresponding to the difference node in the fourth page according to the edit category corresponding to each difference node in the at least one difference node; and a second obtaining sub-unit configured to obtain the third page based on the fourth page and at least one mark corresponding to at least one difference content in the fourth page.
11. The apparatus of claim 10, wherein, The at least one edit operation comprises at least one of adding, deleting, modifying, and moving, and the first obtaining unit is configured to perform at least one of the following operations: in response to receiving an adding operation on page data in the first page, adding an adding node encoding corresponding to the added page data in the at least one first encoding; in response to receiving a deleting operation on first page data in the first page, deleting original node encoding corresponding to the first page data in the at least one first encoding; and in response to receiving a modifying operation or a moving operation on second page data in the first page, deleting original node encoding corresponding to the second page data in the at least one first encoding and adding adding node encoding corresponding to the edited second page data in the at least one first encoding, wherein the adding node encoding corresponding to the edited second page data and the original node encoding corresponding to the second page data are different.
12. The apparatus of claim 11, wherein, in response to the at least one edit operation satisfying at least one of the following conditions: the at least one edit operation comprises a deleting operation and an adding operation; the at least one edit operation comprises a modifying operation; and the at least one edit operation comprises a moving operation; the first determining unit is configured to: obtain at least one first difference encoding in the at least one first encoding based on the at least one second encoding, to mark first difference nodes corresponding to the at least one first difference encoding in the first structure tree, and each first difference encoding in the at least one first difference encoding is original node encoding of corresponding page data before an edit operation. based on the at least one first encoding, obtain at least one second difference encoding in the at least one second encoding, so as to mark a second difference node corresponding to the at least one second difference encoding in the second structure tree, each of the at least one second difference encoding being a newly added node encoding after an editing operation on corresponding page data; and based on the at least one first difference node and the at least one second difference node, obtain the at least one difference node.
13. The apparatus of claim 12, wherein, The synthesis unit is configured to: insert the at least one first difference node into a corresponding position in the marked second structure tree to obtain the third structure tree, wherein the corresponding position in the marked second structure tree is determined based on the position of the at least one first difference node in the first structure tree; or insert the at least one second difference node into a corresponding position in the marked first structure tree to obtain the third structure tree, wherein the corresponding position in the marked first structure tree is determined based on the position of the at least one second difference node in the second structure tree.
14. The apparatus of claim 11, wherein, In response to determining that each of the at least one editing operation is a deletion operation, the first determination unit is configured to: based on the at least one second encoding, obtain at least one first difference encoding in the at least one first encoding, so as to mark a first difference node corresponding to the at least one first difference encoding in the first structure tree, each of the at least one first difference encoding being an original node encoding before an editing operation on corresponding page data; and The synthesis unit is configured to: determine the marked first structure tree as the third structure tree.
15. The apparatus of claim 11, wherein, In response to determining that each of the at least one editing operation is a deletion operation, the first determination unit is configured to: based on the at least one first encoding, obtain at least one second difference encoding in the at least one second encoding, so as to mark a second difference node corresponding to the at least one second difference encoding in the second structure tree, each of the at least one second difference encoding being a newly added node encoding after an editing operation on corresponding page data; and The synthesis unit is configured to: determine the marked second structure tree as the third structure tree.
16. The apparatus of any one of claims 10-15, wherein, The editing category includes an addition category and a deletion category, and the subunit for adding a mark to difference content corresponding to the difference node in the fourth page according to the editing category of each of the at least one difference node includes: a first adding subunit configured to, in response to determining that the third structure tree includes at least one first difference node, add a first mark to each of at least one first difference content corresponding to the first difference node in the fourth page, the editing category of each of the at least one first difference node being a deletion category; and a second adding subunit configured to, in response to determining that the third structure tree includes at least one second difference node, add a second mark to each of at least one second difference content corresponding to the second difference node in the fourth page, the editing category of each of the at least one second difference node being an addition category. The second adding sub-unit is configured to add a second mark in each of at least one second difference content corresponding to the second difference node in the fourth page in response to determining that the third structure tree comprises at least one second difference node, and an edit category of each of the at least one second difference node is a new addition category.
17. The apparatus of claim 16, wherein, Each of the at least one difference encoding has a mapping relationship with first information corresponding to the difference encoding, the first information comprises an execution subject and an execution time of a corresponding edit operation, and the device further comprises: A third obtaining unit is configured to obtain first information corresponding to a difference encoding based on each of the at least one difference content in the fourth page; and An updating unit is configured to update the third page based on one or more first information corresponding to one or more difference contents in the fourth page and the at least one difference content, wherein each of the one or more first information is displayed in response to a first operation of a user.
18. An electronic device comprising: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-9.
19. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to perform the method according to any one of claims 1-9.
20. A computer program product comprising a computer program, wherein, The computer program, when executed by the processor, implements the method of any one of claims 1-9. The computer program, when executed by the processor, implements the method of any one of claims 1-9.
Citation Information
Patent Citations
Map Update Scripts with Tree Edit Operations
US20140108462A1