Information updating method and device, readable medium, electronic equipment and program product
By caching drawing board states and operation messages in memory and updating only the changed node data in the database, the solution addresses the high database pressure and slow loading speeds by performing operations in the database, the technical solution reduces database access and speeds up the update process.
Patent Information
- Application Number
- CN202411392128.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-03
AI Technical Summary
Existing sketchpad systems face high database pressure and slow loading speeds due to frequent database access for editing operations, which are encapsulated as operation messages requiring sequential application and storage.
Cache the drawing board state and operation messages in memory, perform operations on node data and tree relationships there, and update only the changed node data in the database, reducing unnecessary database access and speeding up the update process.
Reduces database access pressure and improves page loading speed by performing operations in memory and updating only the necessary node data in the database.
Smart Images

Figure CN119248805A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular, to an information updating method, device, readable medium, electronic device and program product. Background Art
[0002] Sketchpad is a versatile visualization tool that is usually used by users to create, edit and display various visual contents, such as graphics, charts or mind maps, in an intuitive way.
[0003] In the related art, when creating and / or editing visual content on a drawing board, it is generally necessary to frequently access the database, resulting in problems such as high database pressure and slow loading speed. Summary of the invention
[0004] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0005] In a first aspect, the present disclosure provides an information updating method, comprising: Determine an operation message to be executed and a state of a drawing board in a database, wherein the state of the drawing board includes node data and a node tree relationship in the drawing board, and the operation message is generated when a user performs a target operation on the node data and / or the node tree relationship in an application; Cache the drawing board state and the operation message in a memory, and perform a target operation on the node data and / or the node tree relationship in the memory according to the operation message to obtain target node data, where the target node data is the node data of the target node whose node data and / or node tree relationship has changed; The target node data is read from the memory, and the node data of the target node in the database is updated to the target node data.
[0006] In a second aspect, the present disclosure provides an information updating device, comprising: A determination module, used to determine an operation message to be executed and a state of a drawing board in a database, wherein the state of the drawing board includes node data and a node tree relationship in the drawing board, and the operation message is generated when a user performs a target operation on the node data and / or the node tree relationship in an application program; a processing module, configured to cache the drawing board state and the operation message into a memory, and perform a target operation on the node data and / or the node tree relationship in the memory according to the operation message to obtain target node data, wherein the target node data is the node data of the target node whose node data and / or node tree relationship has changed; An updating module is used to read the target node data from the memory and update the node data of the target node in the database to the target node data.
[0007] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which implements the steps of any one of the methods described in the first aspect when the computer program is executed by a processing device.
[0008] In a fourth aspect, the present disclosure provides an electronic device, including: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of any one of the methods in the first aspect.
[0009] In a fifth aspect, the present disclosure provides a computer program product, comprising a computer program, which implements the steps of any one of the methods described in the first aspect when executed by a processor.
[0010] Through the above technical solution, the operation message to be executed and the drawing board status in the database can be cached in the memory, so that the target operation can be performed on the node data and / or the node tree relationship in the memory according to the operation message, and the target node data of the target node can be obtained, and then the node data of the target node in the database can be updated to the target node data. Therefore, the target operation can be performed on the node data and / or the node tree relationship in the memory according to the operation message, and the node data of the target node whose node data and / or the node tree relationship changes after executing all the operation messages can be obtained. Therefore, when updating the drawing board status in the database, it is only necessary to update the node data of the target node in the database, without updating the intermediate data. On the one hand, it can reduce the number of accesses to the database and reduce the access pressure on the database. On the other hand, it can speed up the update speed of the drawing board status in the database, thereby improving the page loading speed.
[0011] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings: Figure 1 It is a schematic diagram of updating the state of a drawing board in a database in the related art; Figure 2 It is a schematic diagram of updating the state of a drawing board in a database in the related art; Figure 3 is a flow chart of an information updating method according to an exemplary embodiment of the present disclosure; Figure 4 is an update schematic diagram of an information update method according to an exemplary embodiment of the present disclosure; Figure 5 is a schematic diagram showing a method of determining a target operation type according to an exemplary embodiment of the present disclosure; Figure 6 is a schematic diagram showing a method of determining a target operation type according to an exemplary embodiment of the present disclosure; Figure 7 is a schematic diagram showing different situations of performing multiple deletion and / or creation operations on the same node according to an exemplary embodiment of the present disclosure; Figure 8 is a schematic diagram of an information updating method according to an exemplary embodiment of the present disclosure; Fig. 9 is a flow chart of an information updating method according to an exemplary embodiment of the present disclosure; Fig.10 is a structural block diagram of another information updating device according to an exemplary embodiment of the present disclosure; Fig.11 It is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0013] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0014] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0015] The term "including" and its variations used herein are open inclusions, i.e., "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"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0016] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0017] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0018] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0019] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0020] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0021] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0022] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0023] At the same time, it is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0024] As mentioned in the background technology, in the related art, when creating and / or editing visual content on a drawing board, it is generally necessary to frequently access the database, resulting in problems such as high database pressure and slow page loading speed.
[0025] Specifically, in the related art, the sketchpad system is generally implemented based on the Event-Source architecture model, in which the editing operations performed by the user in the sketchpad are encapsulated as operation messages (Operation, op), each operation message contains a version number revision and specific operation data, and in the sketchpad system, in order to ensure the order and consistency of the operation, the version number of op is strictly continuously incremented. Therefore, when the user submits the editing operation, the editing operation is encapsulated as op and recorded in the preset operation message set Operations, and when op is recorded in Operations, op is deemed to have taken effect, and the sketchpad system then sends a confirmation message ack to the user's operating device to inform the user that the operation message has been successfully received and recorded, and the user can continue to send new editing operations after receiving the confirmation message.
[0026] In addition, in the Event-Source architecture pattern, the state snapshot of the artboard is the result of the op in the asynchronous application operations, such as Figure 1 and Figure 2 As shown, in order to apply the op in Operations to the artboard, the ops are usually applied one by one in the order of revision. When the op is applied, the Snapshot needs to be read from the database and updated according to the op. After the Snapshot is updated, on the one hand, the sequence number seq of the Snapshot needs to be updated to seq=revision+1, and on the other hand, the updated Snapshot needs to be stored in the database to reflect the latest artboard status.
[0027] However, since users frequently edit on the drawing board, many ops are generated. Applying the ops one by one will result in frequent reading, updating, and writing of data from the database, which increases the pressure on the database and slows down the application. On the other hand, since the Snapshot is the result of the asynchronous application of the ops in Operations, when the front-end page needs to load the Snapshot, the ops in Operations may not be fully applied. Therefore, in order to ensure that the front-end page can load the accurate Snapshot, the ops that are not applied in Operations and the latest Snapshot stored in the database need to be sent to the front-end for processing by the front-end to obtain an accurate Snapshot and display it. This reduces the speed of building the Snapshot, which in turn affects the page loading speed.
[0028] In view of this, the present disclosure provides an information updating method, device, readable medium, electronic device and program product to solve the above technical problems.
[0029] The embodiments of the present disclosure are further explained below with reference to the accompanying drawings.
[0030] Figure 3 is a flowchart of an information updating method according to an exemplary embodiment of the present disclosure, referring to Figure 3 , the method may include the following steps: S301: Determine the operation message to be executed and the state of the drawing board in the database. The drawing board state includes the node data and the node tree relationship in the drawing board. The operation message is generated when the user performs a target operation on the node data and / or the node tree relationship in the application.
[0031] It should be understood that in the drawing board system, the drawing board state information, such as the drawing board state and the version number of the drawing board state, is stored in the database, and when the user performs a target operation on the node data and / or the node tree relationship in the drawing board in the application, an operation message with a message number or version number is generated according to the user's operation sequence, and the generated operation message is stored in a preset operation message set. Therefore, when the drawing board state in the database needs to be updated later, the corresponding operation message to be executed can be determined from the operation message set according to the version number of the drawing board state stored in the current database.
[0032] The operation messages to be executed may be all the operation messages to be executed in the operation message set, or may be part of the operation messages to be executed, and the embodiments of the present disclosure do not impose any limitation on this.
[0033] For example, the number of operation messages that can be executed in the memory each time can be preset to g, where g is a positive integer. When the drawing board state in the database needs to be updated, the version number of the drawing board state can be obtained from the database, for example, the obtained version number is m, and thus, the operation messages with message numbers m to m+g can be selected from the operation message set according to the version number m.
[0034] S302: Cache the drawing board status and operation message into the memory, and perform the target operation on the node data and / or the node tree relationship in the memory according to the operation message to obtain the target node data, which is the node data of the target node whose node data and / or node tree relationship has changed.
[0035] For example, Figure 4 As shown, the state of the drawing board cached in the memory includes node a, node b and node c, where the color of node a is blue, the color of node b is green, the color of node c is red, and the parent node of node b is node a. The number of the operation messages cached in the memory is [m, n]. After all the operation messages are executed in the memory, the state of the drawing board in the memory is updated to: the color of node a is red, the color of node b is green, the color of node c is red, and the parent node of node b is node c. It can be seen that the node data of node a and the node tree relationship of node b have changed, so the target node data is: the color of node a is red, and the parent node of node b is node c.
[0036] S303: Read the target node data from the memory, and update the node data of the target node in the database to the target node data.
[0037] For example, continue to refer to the above example, such as Figure 4 As shown, since the artboard state cached in the memory is the artboard state in the database, the artboard state in the database includes node a, node b and node c, wherein the color of node a is blue, the color of node b is green, the color of node c is red, and the parent node of node b is node a. Since the target node data is: the color of node a is red, and the parent node of node b is node c, when updating the artboard state in the database, only the color of node a in the database can be changed to red, and the parent node of node b can be changed to node c, without the need to perform operations such as creating node d, moving node d, updating node d, and deleting node d in the database.
[0038] Through the above technical solution, the operation message to be executed and the drawing board status in the database can be cached in the memory, so that the target operation can be performed on the node data and / or the node tree relationship in the memory according to the operation message, and the target node data of the target node can be obtained, and then the node data of the target node in the database can be updated to the target node data. Therefore, the target operation can be performed on the node data and / or the node tree relationship in the memory according to the operation message, and the node data of the target node whose node data and / or the node tree relationship changes after executing all the operation messages can be obtained. Therefore, when updating the drawing board status in the database, it is only necessary to update the node data of the target node in the database, without updating the intermediate data. On the one hand, it can reduce the number of accesses to the database and reduce the access pressure on the database. On the other hand, it can speed up the update speed of the drawing board status in the database, thereby improving the page loading speed.
[0039] To facilitate understanding of the present solution, possible implementation methods in the present disclosure are described below.
[0040] In a possible manner, performing a target operation on node data and / or node tree relationship in memory according to the operation message to obtain node data of the target node may include: According to the operation message, the target operation is performed on the node data and / or the node tree relationship to obtain a first operation record and a second operation record, the first operation record is used to record at least the node identifier and the target operation type of the node on which the target operation is performed, the target operation type is used to characterize the operation type obtained by merging the operation types performed on the node, and the second operation record is used to record the target canvas state obtained after executing the operation message; according to the first operation record and the second operation record, the target node data is determined.
[0041] Through the above method, the node identifier and target operation type of the node on which the target operation is executed can be recorded in the first operation record. Since the target operation type is used to characterize the operation type obtained by merging the operation types executed on the node, the target node whose node data and / or node tree relationship changes after the operation message is executed can be determined based on the node identifier recorded in the first operation record. In addition, since the target canvas state obtained after the operation message is executed can be recorded in the second operation record, the corresponding node data can be read from the second operation record based on the target node, thereby realizing the rapid acquisition of the target node data.
[0042] In a possible manner, determining the target node data according to the first operation record and the second operation record may include: For each node identifier in the first operation record, corresponding node data is read from the second operation record according to the node identifier, and the node data is determined as target node data.
[0043] For example, the state of the drawing board recorded in the second operation record is: the color of node a is red, the color of node b is green, the color of node c is red, and the parent node of node b is node c. The node identifier and target operation type recorded in the first operation record are: change node data type: node identifier a; change parent node type: node identifier b. Therefore, the corresponding node data can be read from the second operation record according to node identifier a, that is, the color of node a is red; the corresponding node data can be read from the second operation record according to node identifier b, that is, the parent node of node b is node c.
[0044] It should be understood that this is only an illustrative explanation and does not constitute a limitation on the solution. In possible operation modes, when the operation type is to delete the node data type or when the operation type is to change the node data type, and the first operation record records the parent node identifier that needs to be mounted after the move, then only the node identifier in the first operation record can be used as the target node data.
[0045] In a possible manner, the operation message may include multiple ones, each operation message includes a message number and operation data. Accordingly, according to the operation message, the target operation is performed on the node data and / or the node tree relationship to obtain the operation record, which may include: The operation messages are traversed in the order of the message numbers, and the following steps are performed for each traversed operation message until all the operation messages are traversed to obtain the first operation record and the second operation record: According to the operation data, determine the node of the target operation to be performed and the operation type of the node; according to the operation type, operate the node data and / or the node tree relationship of the node to obtain the target canvas state after executing the operation message, and record the target canvas state in the second operation record; according to the operation type and the operation type performed on the node, determine the target operation type, the target operation type is used to characterize the operation type obtained after merging the operation types performed on the node, and at least the node identifier and the target operation type of the node are recorded in the first operation record.
[0046] In this embodiment, recording the target artboard state in the second operation record may be to use the target artboard state obtained after each execution of the operation message to overwrite and update the target artboard state recorded in the second operation record. Alternatively, the artboard state cached in the memory may be recorded in the second operation record in advance, so that when the operation message is subsequently executed, only the data that has changed in the second operation record may be updated, thereby reducing the amount of data processing and further improving the update speed.
[0047] In this embodiment, according to the operation type and the operation type that has been performed on the node, determining the target operation type may be: determining whether the target operation corresponding to the current operation type and the target operation corresponding to the executed operation type can be merged into one target operation; if they can be merged into one target operation, the operation type of the target operation obtained after the merger can be determined as the target operation type. If they cannot be merged into one target operation, it can be determined whether the target operation corresponding to the current operation type and the target operation corresponding to the executed operation type are mutually exclusive; if they are not mutually exclusive, the current operation type and the executed operation type can be determined as the target operation type; if they are mutually exclusive, one of the current operation type and the executed operation type can be determined as the target operation type according to actual conditions.
[0048] For example, the operation types for nodes in the drawing board system can generally include a first operation type for creating a new node, a second operation type for updating node data, a third operation type for changing the parent node, and a fourth operation type for deleting a node. The target operation corresponding to the first operation type and the target operation corresponding to the fourth operation type are mutually exclusive. Therefore, when the executed operation type is the fourth operation type and the current operation type is the first operation type, the first operation type can be determined as the target operation type; when the executed operation type is the first operation type and the current operation type is the fourth operation type, the fourth operation type can be determined as the target operation type. The target operation corresponding to the second operation type and the target operation corresponding to the third operation type are neither mutually exclusive nor can they be combined into one target operation. Therefore, when the executed operation type and the current operation type are the second operation type and the third operation type, the second operation type and the third operation type are determined as the target operation type. The target operation corresponding to the first operation type, the target operation corresponding to the second operation type, and the target operation corresponding to the third operation type can be combined into a target operation corresponding to the first operation type. Therefore, when the executed operation type is the first operation type and the current operation type is the second operation type or the third operation type, the first operation type can be determined as the target operation type. Figure 5 and Figure 6 shown.
[0049] Through the above method, multiple target operations for the same node can be merged, so that when the artboard status in the database is updated subsequently, at most one node creation, node deletion, node data update and parent node change operation is performed for the same node in the database, thereby reducing the access operations to the database, improving the updating efficiency of the artboard status, and thus improving the loading speed of the page.
[0050] In a possible manner, the first operation record may include multiple sub-records, each sub-record corresponds to a type of operation on the node, and accordingly, according to the operation message, the target operation is performed on the node data and / or the node tree relationship to obtain the first operation record, which may include: According to the operation message, determine the node of the target operation to be performed and the type of operation on the node; according to the operation type and the record information in the first operation record, determine the first target sub-record from multiple sub-records; at least record the node identifier in the first target sub-record to obtain the first operation record.
[0051] In this embodiment, the number of sub-records and the type of operation can be set according to actual conditions, and the embodiment of the present disclosure does not impose any restrictions on this.
[0052] For example, the operation types for nodes in the drawing board system generally include a first operation type for creating a new node, a second operation type for updating node data, a third operation type for changing the parent node, and a fourth operation type for deleting a node. However, when updating the node data and / or the node tree relationship according to the operation message, there are multiple deletion and / or creation operations for the same node, such as Figure 7 As shown. Figure 7 Situation 1 in the example: After caching the artboard status in the database into memory, node X is created first and then deleted. This indicates that node X does not exist in the artboard status in the database. This type of operation has no effect on the artboard status in the database. Figure 7 Situation 2 in the example: after caching the canvas state in the database into the memory, node X is first deleted, and then node X is created again, which indicates that node X exists in the canvas state in the database. Since when a node is deleted and then recreated, the created node data is inconsistent with the deleted node data, this type of operation affects the canvas state in the database. Therefore, to facilitate the distinction between the above two situations, this embodiment further defines the CreateAfterDeletes operation type and the DeleteAfterCreates operation type. The CreateAfterDeletes operation type is used to represent the operation of deleting and then recreating a node, and the DeleteAfterCreates operation type is used to represent the operation of creating and then deleting a node, so that the appropriate sub-record can be determined from multiple sub-records based on the operation of the node in the memory, and then the corresponding change operation can be performed on the canvas state in the database based on the operation type corresponding to the sub-record.
[0053] In a possible manner, determining the first target sub-record from multiple sub-records according to the operation type and the record information in the first operation record may include: Determine whether there is a node identifier in the first operation record based on the record information in the first operation record; when there is no node identifier in the first operation record, determine the sub-record corresponding to the operation type as the first target sub-record; when there is a node identifier in the first operation record, determine the second target sub-record where the node identifier is located, and determine the first target sub-record from multiple sub-records based on the operation type and the second target sub-record.
[0054] It should be understood that when the node identifier does not exist in the first operation record, it indicates that after the artboard state in the database is cached in the memory, no operation is performed on the node in the memory. Therefore, in order to facilitate the subsequent rapid update of the artboard state in the database, the sub-record corresponding to the operation type can be determined as the first target sub-record, so that the artboard state in the database can be quickly updated based on the first operation record and the second operation record, thereby improving the update speed.
[0055] For example, if the operation type determined according to the operation message is the first operation type for creating a node, the parent node identifier of the node can be first determined according to the operation message, and then the node identifier and the parent node identifier can be recorded in the child record corresponding to the first operation type, so that when the drawing board status in the database is subsequently updated, the corresponding data write operation can be performed directly in the database according to the node identifier, the parent node identifier in the child record corresponding to the first operation type, and the node data corresponding to the node identifier in the second operation record.
[0056] For example, if the operation type determined according to the operation message is the second operation type for updating node data, the node identifier can be recorded in the sub-record corresponding to the second operation type, so that when the drawing board status in the database is subsequently updated, the corresponding data update operation can be performed directly in the database according to the node identifier in the sub-record corresponding to the second operation type and the node data corresponding to the node identifier in the second operation record.
[0057] For example, if the operation type determined according to the operation message is the third operation type for changing the parent node, the changed parent node identifier can be first determined according to the operation message, and then the node identifier and the changed parent node identifier can be recorded in the child record corresponding to the third operation type. This allows for subsequent updating of the drawing board status in the database to directly perform the corresponding parent node change operation or node movement operation in the database based on the node identifier and the changed parent node identifier in the child record corresponding to the third operation type.
[0058] For example, if the operation type determined according to the operation message is the fourth operation type for deleting a node, the node identifier can be recorded in the sub-record corresponding to the fourth operation type, so that when the drawing board status in the database is subsequently updated, the corresponding data deletion operation can be directly performed in the database according to the node identifier in the sub-record corresponding to the fourth operation type.
[0059] It should be understood that when a node identifier exists in the first operation record, it indicates that after the canvas state in the database is cached in the memory, a related operation has been performed on the node in the memory. Therefore, in order to facilitate the subsequent rapid update of the canvas state in the database, the executed operation on the node in the memory can be determined according to the second target sub-record where the node identifier is located, so that it can be determined whether the current operation and the executed operation can be merged into one operation according to the executed operation and the current operation to be executed, thereby simplifying the subsequent update operation of the canvas state in the database and alleviating the access pressure on the database.
[0060] For example, if the operation type determined according to the operation message is the third operation type for changing the parent node, for example, the parent node of node c is updated from node a to node b. And before executing the operation, a creation operation has been performed on the node, for example, node c is created, and the parent node of node c is made node a. Thus, by merging the two operations, it is possible to obtain: an operation of creating node c and making the parent node of node c be node b, so that when the artboard status in the database is subsequently updated, only the operation of creating node c and making the parent node of node c be node b can be performed.
[0061] In a possible manner, determining the first target sub-record from the plurality of sub-records according to the operation type and the second target sub-record may include: When the operation type is the first operation type for creating a new node, if the second target sub-record is the second sub-record among multiple sub-records, the first sub-record is determined as the first target sub-record, and the second sub-record is used to record the node identifier of the node that is deleted after being created in the canvas state; if the second target sub-record is the third sub-record among multiple sub-records, the fourth sub-record among the multiple sub-records is determined as the first target sub-record, the third sub-record is used to record the node identifier of the deleted node, and the fourth sub-record is used to record the node identifier of the node that is recreated after being deleted in the canvas state; Accordingly, at least the node identifier is recorded in the first target sub-record, including: The node identifier in the second target sub-record is deleted, and according to the operation message, the parent node identifier of the node is determined, and the node identifier and the parent node identifier are recorded in the first target sub-record.
[0062] In this embodiment, when the node identifier exists in the second sub-record, it indicates that the node does not exist in the canvas state in the database, and when the operation type is the first operation type for creating a new node, it indicates that the node needs to be created in the canvas state in the database. Therefore, the node identifier in the second target sub-record can be deleted, and the parent node identifier of the node can be determined according to the operation message, and the node identifier and the parent node identifier can be stored in the first target sub-record, so that when the canvas state in the database is subsequently updated, the corresponding data write operation can be performed in the database directly according to the node identifier and the parent node identifier in the first target sub-record, and the node data corresponding to the node identifier in the second operation record.
[0063] When the node identifier exists in the third sub-record, it indicates that the node exists in the canvas state in the database, but because the operation of deleting the node is performed in the memory, the node does not exist in the target canvas state recorded in the second operation record. Therefore, when the operation type is the first operation type for creating a new node, it indicates that the node needs to be re-created in the target canvas state. In view of the fact that the created node data is inconsistent with the previous node data when the node is re-created, the node identifier is recorded in the fourth sub-record, so that when the canvas state in the database is subsequently updated, the relevant data of the node in the database can be deleted first, and then the relevant data of the node can be re-written, thereby ensuring the accuracy of the written data.
[0064] In a possible manner, determining the first target sub-record from the plurality of sub-records according to the operation type and the second target sub-record may include: When the operation type is the second operation type for updating node data, if the second target sub-record is the fifth sub-record among the multiple sub-records, the sixth sub-record and the fifth sub-record among the multiple sub-records are determined as the first target sub-records, the fifth sub-record is used to record the node identifier of the node whose parent node has been changed and the identifier of the parent node after the change, and the sixth sub-record is used to record the node identifier of the node whose node data has been updated; Accordingly, recording at least the node identifier in the first target operation record may include: The node identifier in the fifth sub-record is retained, and the node identifier is recorded in the sixth sub-record.
[0065] In this embodiment, since the fifth sub-record is used to record the node identifier of the node whose parent node has been changed and the parent node identifier after the change, that is to say, when the node identifier is recorded in the fifth sub-record, it indicates that the parent node change operation has been performed on the node in the memory. The second operation type is used to update the node data of the node. Since the node data update and the parent node change cannot be combined into one operation, the node identifier in the fifth sub-record is retained and the node identifier is recorded in the sixth sub-record, so that when the node in the database is subsequently updated, the corresponding parent node change operation and node data update operation can be performed according to the node identifier in the fifth sub-record, the corresponding parent node identifier, the node identifier in the sixth sub-record, and the target drawing board state in the second record.
[0066] For example, if the operation type determined according to the operation message is the second operation type for updating node data, for example, changing the color of the node from green to red, and before performing the operation, the parent node change operation has been performed on the node, for example, moving the parent node of the node from node a to node b, but since the two operations cannot be merged into one operation, the node identifier in the fifth child record can be retained and the node identifier can be recorded in the sixth child record, so that when the canvas status in the database is subsequently updated, the color of the node can be changed to red and the node can be moved to node b according to the operation record.
[0067] It should be understood that when the operation type is the second operation type, the node identifier can exist in the first sub-record, the fourth sub-record, and the sixth sub-record in addition to the fifth sub-record. When the node identifier exists in the first sub-record, it indicates that a create operation has been performed on the node in the memory. Since the create operation and the update operation can be combined into one create operation, the node identifier can continue to be retained in the first sub-record. When the node identifier exists in the fourth sub-record, it can also indicate that a create operation has been performed on the node in the memory. Since the create operation and the update operation can be combined into one create operation, the node identifier can continue to be retained in the fourth sub-record. When the node identifier exists in the sixth sub-record, it can indicate that an update operation has been performed on the node in the memory. Since the two update operations can be combined into one update operation, the node identifier can continue to be retained in the sixth sub-record.
[0068] In a possible manner, determining the first target sub-record from the plurality of sub-records according to the operation type and the second target sub-record may include: When the operation type is the third operation type for changing the parent node, if the second target sub-record is the sixth sub-record among the multiple sub-records, the sixth sub-record and the fifth sub-record are determined as the first target sub-record, the fifth sub-record is used to record the node identifier of the node whose parent node has been changed and the identifier of the parent node after the change, and the sixth sub-record is used to record the node identifier of the node whose node data has been updated; Accordingly, recording at least the node identifier in the first target operation record may include: According to the operation message, the target parent node identifier of the node after the parent node is changed is determined in the node tree relationship; the node identifier in the sixth child record is retained, and the node identifier and the target parent node identifier of the node are recorded in the fifth child record.
[0069] In this embodiment, since the sixth sub-record is used to record the node identifier of the node whose node data has been updated, that is to say, when the node identifier is recorded in the sixth sub-record, it indicates that the node data update operation has been performed on the node in the memory. The third operation type is used to change the parent node of the node, and since the node data update and the parent node change cannot be combined into one operation, the node identifier in the sixth sub-record is retained, and the node identifier and the target parent node identifier of the node are recorded in the fifth sub-record, so that when the node in the database is subsequently updated, the corresponding parent node change operation and node data update operation can be performed according to the node identifier in the fifth sub-record, the target parent node identifier, the node identifier in the sixth sub-record, and the node data of the node in the second record.
[0070] For example, if the operation type determined according to the operation message is the third operation type for changing the parent node, for example, moving the parent node of the node from node a to node b, and before performing the operation, a node data update operation has been performed on the node, for example, changing the color of the node from green to red, but since the two operations cannot be merged into one operation, the node identifier in the sixth child record can be retained, and the node identifier and the target parent node identifier of the node can be recorded in the fifth child record, so that when the canvas status in the database is subsequently updated, the color of the node can be changed to red and the node can be moved to node b according to the operation record.
[0071] Possible approaches may also include: If the second target sub-record is the first sub-record, the fourth sub-record or the fifth sub-record among the multiple sub-records, the first sub-record, the fourth sub-record or the fifth sub-record is determined as the first target sub-record, the first sub-record is used to record the node identifier of the created node, the fourth sub-record is used to record the node identifier of the node that is recreated after being deleted in the drawing board state, and the fifth sub-record is used to record the node identifier of the node whose parent node has been changed and the identifier of the parent node after the change; Accordingly, recording at least the node identifier in the first target sub-record may include: According to the operation message, determine the target parent node identifier of the node after the parent node is changed; retain the node identifier in the first child record, the fourth child record or the fifth child record, and add the target parent node identifier to the first child record or the fourth child record, or update the parent node identifier of the node identifier in the fifth child record to the target parent node identifier.
[0072] In this embodiment, when the second target child record is in the first child record, it indicates that a creation operation has been performed on the node in the memory. Since the creation operation and the parent node change operation can be merged into one creation operation, the node identifier can continue to be retained in the first child record, and based on the operation message, the target parent node identifier of the node after the parent node is changed is determined, and the target parent node identifier is added to the first child record or the parent node in the first child record is updated to the target parent node identifier.
[0073] When the second target child record is in the fourth child record, it may also indicate that a creation operation has been performed on the node in the memory. Since the creation operation and the parent node change operation can be merged into one creation operation, the node identifier can continue to be retained in the fourth child record, and based on the operation message, the target parent node identifier of the node after the parent node is changed is determined, and the target parent node identifier is added to the fourth child record or the parent node in the fourth child record is updated to the target parent node identifier.
[0074] When the second target child record is in the fifth child record, it can indicate that the parent node change operation has been performed on the node in the memory. Since the two parent node change operations can be merged into one parent node change operation, the node identifier can continue to be retained in the fifth child record, and according to the operation message, the target parent node identifier of the node after the parent node is changed is determined, and the parent node in the fifth child record is updated to the target parent node identifier.
[0075] In a possible manner, determining the first target sub-record from the plurality of sub-records according to the operation type and the second target sub-record may include: When the operation type is the fourth operation type for deleting a node, if the second target sub-record is the first sub-record among multiple sub-records, the second sub-record is determined as the first target sub-record, the first sub-record is used to record the node identifier of the created node, and the second sub-record is used to record the node identifier of the node that was deleted after creation in the drawing board state; if the second target sub-record is the fourth sub-record, the fifth sub-record or the sixth sub-record among multiple sub-records, the third sub-record among the multiple sub-records is determined as the first target sub-record, the third sub-record is used to record the node identifier of the deleted node, the fourth sub-record is used to record the node identifier of the node that was recreated after deletion in the drawing board state, the fifth sub-record is used to record the node identifier of the node whose parent node has been changed and the parent node identifier after the change, and the sixth sub-record is used to record the node identifier of the node whose node data has been updated; Accordingly, recording at least the node identifier in the first target sub-record may include: Accordingly, the node identifier is recorded in the second sub-record, or the node identifier in the fourth sub-record, the fifth sub-record or the sixth sub-record is deleted, and the node identifier is recorded in the third sub-record.
[0076] In this embodiment, when the second target sub-record is the first sub-record, it indicates that there is no node in the canvas state in the database, so the node identifier can be recorded in the second sub-record, so that when the canvas state in the database is subsequently updated, the node data corresponding to the node identifier in the second sub-record can be not deleted. When the second target sub-record is the fourth sub-record, the fifth sub-record or the sixth sub-record, it indicates that there is a node in the canvas state in the database, so the node identifier in the fourth sub-record, the fifth sub-record or the sixth sub-record can be deleted, and the node identifier can be recorded in the third sub-record, so that when the canvas state in the database is subsequently updated, the corresponding data deletion operation can be performed in the database according to the node identifier in the third sub-record.
[0077] In a possible manner, performing a target operation on node data and / or node tree relationship in memory according to the operation message to obtain target node data may include: According to the operation message, determine the node of the target operation to be performed and the type of operation on the node; determine the existence information of the node and / or related nodes related to the node in the canvas state, and the existence information is used to indicate whether the node and / or related nodes exist in the canvas state; according to the operation type and the existence information, operate on the node data and / or the node tree relationship of the node to obtain the target node data.
[0078] In this embodiment, the related node related to the node may refer to the parent node of the node, the child node of the node, or the parent node that needs to be mounted after the parent node is changed. The specific determination is based on actual conditions, and the embodiment of the present disclosure does not impose any restrictions on this.
[0079] In this embodiment, according to the operation type and existence information, the node data and / or the node tree relationship of the node can be operated. When the existence information indicates that the node and / or related nodes exist, the node data and / or the node tree relationship of the node can be operated according to the operation type; when the existence information indicates that the node and / or related nodes do not exist, an indication information can be generated to remind the user that the node and / or related nodes do not exist, or the operation message can be skipped and the next operation message can be executed. Of course, it can also be other, and the embodiments of the present disclosure do not impose any restrictions on this.
[0080] In possible ways, according to the operation type and the existence information, the node data and / or the node tree relationship of the node are operated, which may include: When the operation type is the first operation type for creating a new node, and there is information used to indicate that the node does not exist in the canvas state, the node data and / or the node tree relationship of the node are operated according to the operation type; when the operation type is the second operation type for updating the node data, the third operation type for changing the parent node, or the fourth operation type for deleting the node, and there is information used to indicate that the node and / or related nodes exist in the canvas state, the node data and / or the node tree relationship of the node are operated according to the operation type.
[0081] In the above manner, the existence information and operation type can be determined, so that the node data and / or node tree relationship of the node can be operated according to the existence information and the operation type, thereby avoiding invalid operations in the memory and further improving the update efficiency.
[0082] To facilitate understanding of the information updating method disclosed herein, a possible implementation of this solution is described below: For example, Figure 8 and Fig. 9 As shown, when the version number of the drawing board state read from the database is m, all operation messages with message numbers greater than or equal to m in the operation message set can be used as operation messages to be executed. Afterwards, the drawing board state with version number m and the operation messages to be executed are cached in the memory, and the operation messages are traversed in the order of the message numbers. For each traversed operation message, the following steps are performed until all the operation messages are traversed: Determine the node on which the target operation is to be performed, the type of operation on the node, and the existence information of the node, and then verify the node according to the existence information and the operation type to determine whether the target operation can be performed on the node. After passing the verification, that is, after determining that the target operation can be performed on the node, perform the corresponding target operation on the node according to the operation message, and update the node data and / or node tree relationship in the second operation record according to the execution situation, and at the same time, record or change the record position of the node identifier in the first operation record according to the operation type and the record information in the first operation record.
[0083] Finally, for each sub-record in the first operation record, the node identifier in the sub-record is read, and the corresponding node data is read from the second operation record according to the node identifier to obtain the target node data. At the same time, since each sub-record corresponds to an operation type on a node, after obtaining the target node data, the corresponding operation can be performed in the database according to the operation type corresponding to the sub-record, so that the node data of the target node in the database is updated to the target node data.
[0084] For example, Fig. 9As shown, when the operation type corresponding to the sub-record is the first operation type, the node identifier in the sub-record OperationRecord.Creates can be read, and the corresponding node data can be read from the second operation record according to the node identifier to obtain the target data createNodes that needs to be inserted into the database, and then the data insertion operation is performed in the database. When the operation type corresponding to the sub-record is the second operation type, the node identifier in the sub-record OperationRecord.Updates can be read, and the corresponding node data can be read from the second operation record according to the node identifier to obtain the target data updateNodes that needs to be updated in the database, and then the data update operation is performed in the database. When the operation type corresponding to the sub-record is the third operation type, the node identifier in the sub-record OperationRecord.Moves can be read to obtain the target node moveIDs that needs to perform parent node changes in the database, and then the parent node change operation or node move operation is performed in the database. When the operation type corresponding to the sub-record is the fourth operation type, the node identifier in the sub-record OperationRecord.Delete can be read to obtain the target node deletesIDs that needs to perform node deletion in the database, and then the deletion operation of the relevant data is performed in the database. When the operation type corresponding to the sub-record is the CreateAfterDeletes operation type, the node identifier in the sub-record OperationRecord.CreateAfterDelete can be read, and the corresponding node data can be read from the second operation record according to the node identifier to obtain the target data CreateAfterDeleteNodes that needs to be fully updated in the database. Then, after deleting the relevant data of the target node corresponding to the node identifier in OperationRecord.CreateAfterDelete in the database, the data inserted in CreateAfterDeleteNodes is inserted into the database.
[0085] Based on the same concept, the embodiment of the present disclosure also provides an information updating device, such as Fig.10 As shown, the information updating device 1000 may include: Determining module 1001, used to determine the operation message to be executed and the state of the artboard in the database, the artboard state includes the node data and the node tree relationship in the artboard, the operation message is generated when the user performs the target operation on the node data and / or the node tree relationship in the application; The processing module 1002 is used to cache the drawing board state and the operation message into a memory, and perform a target operation on the node data and / or the node tree relationship in the memory according to the operation message to obtain target node data, where the target node data is the node data of the target node whose node data and / or node tree relationship has changed; The updating module 1003 is used to read the target node data from the memory, and update the node data of the target node in the database to the target node data.
[0086] Through the above-mentioned information updating device 1000, the operation message to be executed and the drawing board status in the database can be cached in the memory, so that the target operation can be performed on the node data and / or the node tree relationship in the memory according to the operation message, and the target node data of the target node can be obtained, and then the node data of the target node in the database can be updated to the target node data. Thus, the target operation can be performed on the node data and / or the node tree relationship in the memory according to the operation message, and the node data of the target node whose node data and / or the node tree relationship has changed after all the operation messages are executed. Therefore, when updating the drawing board status in the database, it is only necessary to update the node data of the target node in the database, without updating the intermediate data. On the one hand, it can reduce the number of accesses to the database and reduce the access pressure on the database. On the other hand, it can speed up the update speed of the drawing board status in the database, thereby improving the page loading speed.
[0087] In a possible manner, the processing module 1002 may include: A first processing submodule is configured to perform a target operation on the node data and / or the node tree relationship according to the operation message to obtain a first operation record and a second operation record, wherein the first operation record is used to record at least a node identifier and a target operation type of the node on which the target operation is performed, the target operation type is used to characterize an operation type obtained by merging operation types performed on the node, and the second operation record is used to record a target artboard state obtained after executing the operation message; The first determination submodule is used to determine node data according to the first operation record and the second operation record.
[0088] In a possible manner, the operation message includes multiple ones, each of the operation messages includes a message number and operation data, and accordingly, the first processing submodule can be used to: The operation messages are traversed in the order of the message numbers, and the following steps are performed for each traversed operation message until all the operation messages are traversed to obtain a first operation record and a second operation record: Determine, according to the operation data, a node on which the target operation is to be performed and a type of operation on the node; Operate the node data and / or the node tree relationship of the node according to the operation type to obtain a target artboard state obtained after executing the operation message, and record the target artboard state in the second operation record; According to the operation type and the operation types that have been performed on the node in the memory, a target operation type is determined, and at least a node identifier of the node and the target operation type are recorded in the first operation record.
[0089] In a possible manner, the first operation record includes a plurality of sub-records, each of which corresponds to a type of operation on a node. Accordingly, the first processing submodule may include: A first determining unit, configured to determine, according to the operation message, a node on which the target operation is to be performed and a type of operation on the node; a second determining unit, configured to determine a first target sub-record from the plurality of sub-records according to the operation type and the record information in the first operation record; A recording unit is used to record at least the node identifier in the first target sub-record to obtain a first operation record.
[0090] In a possible manner, the second determining unit may include: A first determining subunit, configured to determine whether the node identifier exists in the first operation record according to the record information in the first operation record; a second determining sub-unit, configured to determine, when the node identifier does not exist in the first operation record, a sub-record corresponding to the operation type as a first target sub-record; The third determination sub-unit is used to determine the second target sub-record where the node identifier is located when the node identifier exists in the first operation record, and determine the first target sub-record from the multiple sub-records according to the operation type and the second target sub-record.
[0091] In a possible manner, the third determination subunit may be used to: When the operation type is a first operation type for creating a new node, if the second target sub-record is the second sub-record among the multiple sub-records, the first sub-record is determined as the first target sub-record, the first sub-record is used to record the node identifier of the created node, and the second sub-record is used to record the node identifier of the node that was deleted after being created in the drawing board state; If the second target sub-record is the third sub-record among the multiple sub-records, determining the fourth sub-record among the multiple sub-records as the first target sub-record, the third sub-record is used to record the node identifier of the deleted node, and the fourth sub-record is used to record the node identifier of the node that is recreated after being deleted in the drawing board state; Correspondingly, the recording unit is used to: delete the node identifier in the second target sub-record, and determine the parent node identifier of the node in the node tree relationship according to the operation message, and record the node identifier and the parent node identifier in the first target sub-record.
[0092] In a possible manner, the third determination subunit may be used to: When the operation type is a second operation type for updating node data, if the second target sub-record is the fifth sub-record among the multiple sub-records, the sixth sub-record and the fifth sub-record among the multiple sub-records are determined as the first target sub-record, the fifth sub-record is used to record the node identifier of the node whose parent node has been changed and the identifier of the parent node after the change, and the sixth sub-record is used to record the node identifier of the node whose node data has been updated; Correspondingly, the recording unit is used to: retain the node identifier in the fifth sub-record, and record the node identifier in the sixth sub-record.
[0093] In a possible manner, the third determination subunit may be used to: When the operation type is the third operation type for changing the parent node, if the second target sub-record is the sixth sub-record among the multiple sub-records, the sixth sub-record and the fifth sub-record are determined as the first target sub-record, the fifth sub-record is used to record the node identifier of the node whose parent node has been changed and the identifier of the parent node after the change, and the sixth sub-record is used to record the node identifier of the node whose node data has been updated; Correspondingly, the recording unit is used to: determine the target parent node identifier of the node after the parent node is changed in the node tree relationship according to the operation message; retain the node identifier in the sixth child record, and record the node identifier and the target parent node identifier of the node in the fifth child record.
[0094] In a possible manner, the third determining subunit is further used for: If the second target sub-record is the first sub-record, the fourth sub-record or the fifth sub-record among the multiple sub-records, the first sub-record, the fourth sub-record or the fifth sub-record is determined as the first target sub-record, the first sub-record is used to record the node identifier of the created node, the fourth sub-record is used to record the node identifier of the node that is recreated after being deleted in the drawing board state, and the fifth sub-record is used to record the node identifier of the node whose parent node has been changed and the identifier of the parent node after the change; Correspondingly, the recording unit is used to: determine the target parent node identifier of the node after the parent node is changed according to the operation message; retain the node identifier in the first child record, the fourth child record or the fifth child record, and add the target parent node identifier to the first child record or the fourth child record, or update the parent node identifier of the node identifier in the fifth child record to the target parent node identifier.
[0095] In a possible manner, the third determining subunit is further used for: When the operation type is a fourth operation type for deleting a node, if the second target sub-record is the first sub-record among the multiple sub-records, the second sub-record is determined as the first target sub-record, the first sub-record is used to record the node identifier of the created node, and the second sub-record is used to record the node identifier of the node that was deleted after being created in the drawing board state; If the second target sub-record is the fourth sub-record, the fifth sub-record or the sixth sub-record among the multiple sub-records, the third sub-record among the multiple sub-records is determined as the first target sub-record, the third sub-record is used to record the node identifier of the deleted node, the fourth sub-record is used to record the node identifier of the node that is recreated after being deleted in the drawing board state, the fifth sub-record is used to record the node identifier of the node whose parent node has been changed and the changed parent node identifier, and the sixth sub-record is used to record the node identifier of the node whose node data has been updated; Correspondingly, the recording unit is used to: record the node identifier in the second sub-record, or delete the node identifier in the fourth sub-record, the fifth sub-record or the sixth sub-record, and record the node identifier in the third sub-record.
[0096] In a possible manner, the processing module 1002 may include: A second determination submodule, configured to determine a node on which the target operation is to be performed according to the operation message; A third determination submodule is used to determine the existence information of the node and / or related nodes related to the node, wherein the existence information is used to indicate whether the node and / or the related nodes exist in the drawing board state; The second processing submodule is used to operate the node data and / or the node tree relationship of the node according to the operation type and the existence information to obtain the node and the corresponding node data and / or the node tree relationship.
[0097] In a possible manner, the second processing submodule may include: A first processing unit, configured to, when the operation type is a first operation type for creating a new node and the existence information is used to indicate that the node does not exist in the artboard state, operate the node data and / or the node tree relationship of the node according to the operation type; The second processing unit is used to operate the node data and / or the node tree relationship of the node according to the operation type when the operation type is the second operation type for updating node data, the third operation type for changing the parent node, or the fourth operation type for deleting a node, and the existence information is used to indicate that the node and / or the related nodes exist in the drawing board state.
[0098] In a possible manner, the first operation record includes multiple sub-records, each of which corresponds to a type of operation on a node. Accordingly, the first determination submodule can be used to: for each node identifier in each sub-record, read the corresponding node data from the second operation record according to the node identifier, and determine the node data as node data.
[0099] Based on the same concept, an embodiment of the present disclosure further provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processing device, the steps of any of the above-mentioned information updating methods are implemented.
[0100] Based on the same concept, the present disclosure also provides an electronic device, which may include: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of any of the above-mentioned information updating methods.
[0101] Based on the same concept, an embodiment of the present disclosure further provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned information updating methods when executed by a processor.
[0102] Reference below Fig.11, which shows a schematic diagram of the structure of an electronic device 1100 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.11 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0103] like Fig.11 As shown, the electronic device 1100 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1101, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1102 or a program loaded from a storage device 1108 to a random access memory (RAM) 1103. In the RAM 1103, various programs and data required for the operation of the electronic device 1100 are also stored. The processing device 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0104] Typically, the following devices may be connected to the I / O interface 1105: an input device 1106 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1107 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1108 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1109. The communication device 1109 may allow the electronic device 1100 to communicate with other devices wirelessly or by wire to exchange data. Although Fig.11 The electronic device 1100 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0105] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 1109, or installed from a storage device 1108, or installed from a ROM 1102. When the computer program is executed by the processing device 1101, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0106] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0107] In some embodiments, any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol) can be used for communication, and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0108] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0109] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: determines the operation message to be executed and the canvas state in the database, the canvas state includes the node data and the node tree relationship in the canvas, and the operation message is generated when the user performs a target operation on the node data and / or the node tree relationship in the application; caches the canvas state and the operation message in the memory, and performs the target operation on the node data and / or the node tree relationship in the memory according to the operation message to obtain the node data, and the node data is the node data of the node whose node data and / or the node tree relationship has changed; reads the node data from the memory, and updates the node data of the node in the database to the node data.
[0110] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0111] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0112] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a module does not, in some cases, limit the module itself.
[0113] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0114] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0115] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0116] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0117] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Claims
1. An information updating method, characterized in that: include: Determine an operation message to be executed and a state of a drawing board in a database, wherein the state of the drawing board includes node data and a node tree relationship in the drawing board, and the operation message is generated when a user performs a target operation on the node data and / or the node tree relationship in an application; Cache the drawing board state and the operation message in a memory, and perform a target operation on the node data and / or the node tree relationship in the memory according to the operation message to obtain target node data, where the target node data is the node data of the target node whose node data and / or node tree relationship has changed; The target node data is read from the memory, and the node data of the target node in the database is updated to the target node data.
2. The information updating method according to claim 1, characterized in that: The performing a target operation on the node data and / or the node tree relationship in the memory according to the operation message to obtain the node data of the target node includes: According to the operation message, a target operation is performed on the node data and / or the node tree relationship to obtain a first operation record and a second operation record, wherein the first operation record is used to record at least a node identifier and a target operation type of the node on which the target operation is performed, the target operation type is used to characterize an operation type obtained by merging operation types performed on the node, and the second operation record is used to record a target artboard state obtained after executing the operation message; Determine target node data according to the first operation record and the second operation record.
3. The information updating method according to claim 2, characterized in that: The operation message includes a plurality of operation messages, each of which includes a message number and operation data, and the target operation is performed on the node data and / or the node tree relationship in the memory according to the operation message to obtain a first operation record and a second operation record, including: The operation messages are traversed in the order of the message numbers, and the following steps are performed for each traversed operation message until all the operation messages are traversed to obtain a first operation record and a second operation record: Determine, according to the operation data, a node on which the target operation is to be performed and a type of operation on the node; Operate the node data and / or the node tree relationship of the node according to the operation type to obtain a target artboard state obtained after executing the operation message, and record the target artboard state in the second operation record; According to the operation type and the operation types that have been performed on the node in the memory, a target operation type is determined, and at least a node identifier of the node and the target operation type are recorded in the first operation record.
4. The information updating method according to claim 2 or 3, characterized in that: The first operation record includes a plurality of sub-records, each of which corresponds to a type of operation on a node. The target operation is performed on the node data and / or the node tree relationship according to the operation message to obtain the first operation record, including: Determine, according to the operation message, a node on which the target operation is to be performed and a type of operation on the node; Determine a first target sub-record from the multiple sub-records according to the operation type and the record information in the first operation record; At least the node identifier is recorded in the first target sub-record to obtain a first operation record.
5. The information updating method according to claim 4, characterized in that: The determining, according to the operation type and the record information in the first operation record, a first target sub-record from the multiple sub-records includes: Determining, according to the record information in the first operation record, whether the node identifier exists in the first operation record; When the node identifier does not exist in the first operation record, determining the sub-record corresponding to the operation type as the first target sub-record; When the node identifier exists in the first operation record, a second target sub-record where the node identifier is located is determined, and a first target sub-record is determined from the multiple sub-records according to the operation type and the second target sub-record.
6. The information updating method according to claim 5, characterized in that: The determining, according to the operation type and the second target sub-record, from the multiple sub-records, a first target sub-record includes: When the operation type is a first operation type for creating a new node, if the second target sub-record is the second sub-record among the multiple sub-records, the first sub-record is determined as the first target sub-record, the first sub-record is used to record the node identifier of the created node, and the second sub-record is used to record the node identifier of the node that was deleted after being created in the drawing board state; If the second target sub-record is the third sub-record among the multiple sub-records, determining the fourth sub-record among the multiple sub-records as the first target sub-record, the third sub-record is used to record the node identifier of the deleted node, and the fourth sub-record is used to record the node identifier of the node that is recreated after being deleted in the drawing board state; The step of recording at least the node identifier in the first target sub-record includes: The node identifier in the second target sub-record is deleted, and according to the operation message, the parent node identifier of the node is determined in the node tree relationship, and the node identifier and the parent node identifier are recorded in the first target sub-record.
7. The information updating method according to claim 4, characterized in that: The determining, according to the operation type and the second target sub-record, from the multiple sub-records, a first target sub-record includes: When the operation type is a second operation type for updating node data, if the second target sub-record is the fifth sub-record among the multiple sub-records, the sixth sub-record and the fifth sub-record among the multiple sub-records are determined as the first target sub-record, the fifth sub-record is used to record the node identifier of the node whose parent node has been changed and the identifier of the parent node after the change, and the sixth sub-record is used to record the node identifier of the node whose node data has been updated; The step of recording at least the node identifier in the first target operation record includes: The node identifier in the fifth sub-record is retained, and the node identifier is recorded in the sixth sub-record.
8. The information updating method according to claim 4, characterized in that: The determining, according to the operation type and the second target sub-record, from the multiple sub-records, a first target sub-record includes: When the operation type is the third operation type for changing the parent node, if the second target sub-record is the sixth sub-record among the multiple sub-records, the sixth sub-record and the fifth sub-record are determined as the first target sub-record, the fifth sub-record is used to record the node identifier of the node whose parent node has been changed and the identifier of the parent node after the change, and the sixth sub-record is used to record the node identifier of the node whose node data has been updated; The step of recording at least the node identifier in the first target operation record includes: According to the operation message, determining, in the node tree relationship, a target parent node identifier of the node after the parent node is changed; The node identifier in the sixth sub-record is retained, and the node identifier of the node and the target parent node identifier are recorded in the fifth sub-record.
9. The information updating method according to claim 8, characterized in that: Also includes: If the second target sub-record is the first sub-record, the fourth sub-record or the fifth sub-record among the multiple sub-records, the first sub-record, the fourth sub-record or the fifth sub-record is determined as the first target sub-record, the first sub-record is used to record the node identifier of the created node, the fourth sub-record is used to record the node identifier of the node that is recreated after being deleted in the drawing board state, and the fifth sub-record is used to record the node identifier of the node whose parent node has been changed and the identifier of the parent node after the change; The step of recording at least the node identifier in the first target sub-record includes: Determine, according to the operation message, a target parent node identifier of the node after the parent node is changed; The node identifier in the first sub-record, the fourth sub-record or the fifth sub-record is retained, and the target parent node identifier is added to the first sub-record or the fourth sub-record, or the parent node identifier of the node identifier in the fifth sub-record is updated to the target parent node identifier.
10. The information updating method according to claim 4, characterized in that: The determining, according to the operation type and the second target sub-record, from the multiple sub-records, a first target sub-record includes: When the operation type is a fourth operation type for deleting a node, if the second target sub-record is the first sub-record among the multiple sub-records, the second sub-record is determined as the first target sub-record, the first sub-record is used to record the node identifier of the created node, and the second sub-record is used to record the node identifier of the node that was deleted after being created in the drawing board state; If the second target sub-record is the fourth sub-record, the fifth sub-record or the sixth sub-record among the multiple sub-records, the third sub-record among the multiple sub-records is determined as the first target sub-record, the third sub-record is used to record the node identifier of the deleted node, the fourth sub-record is used to record the node identifier of the node that is recreated after being deleted in the drawing board state, the fifth sub-record is used to record the node identifier of the node whose parent node has been changed and the changed parent node identifier, and the sixth sub-record is used to record the node identifier of the node whose node data has been updated; The step of recording at least the node identifier in the first target sub-record includes: The node identifier is recorded in the second sub-record, or the node identifier in the fourth sub-record, the fifth sub-record or the sixth sub-record is deleted, and the node identifier is recorded in the third sub-record.
11. The information updating method according to any one of claims 1 to 3, characterized in that: The step of performing a target operation on the node data and / or the node tree relationship in the memory according to the operation message to obtain target node data includes: Determine, according to the operation message, a node on which the target operation is to be performed; Determine existence information of the node and / or related nodes related to the node, wherein the existence information is used to indicate whether the node and / or the related nodes exist in the drawing board state; According to the operation type and the existence information, the node data and / or the node tree relationship of the node are operated to obtain the target node data.
12. The information updating method according to claim 11, characterized in that: The operating the node data and / or the node tree relationship of the node according to the operation type and the existence information includes: When the operation type is a first operation type for creating a new node, and the existence information is used to indicate that the node does not exist in the drawing board state, operating the node data and / or the node tree relationship of the node according to the operation type; When the operation type is the second operation type for updating node data, the third operation type for changing the parent node, or the fourth operation type for deleting a node, and the existence information is used to indicate that the node and / or the related nodes exist in the drawing board state, the node data and / or the node tree relationship of the node are operated according to the operation type.
13. The information updating method according to claim 2 or 3, characterized in that: The determining the target node data according to the first operation record and the second operation record includes: For each node identifier in the first operation record, corresponding node data is read from the second operation record according to the node identifier, and the node data is determined as target node data.
14. An information updating device, characterized in that: include: A determination module, used to determine an operation message to be executed and a state of a drawing board in a database, wherein the state of the drawing board includes node data and a node tree relationship in the drawing board, and the operation message is generated when a user performs a target operation on the node data and / or the node tree relationship in an application program; a processing module, configured to cache the drawing board state and the operation message into a memory, and perform a target operation on the node data and / or the node tree relationship in the memory according to the operation message to obtain target node data, wherein the target node data is the node data of the target node whose node data and / or node tree relationship has changed; An updating module is used to read the target node data from the memory and update the node data of the target node in the database to the target node data.
15. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the steps of the method according to any one of claims 1 to 13 are implemented.
16. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 13.
17. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 13 are implemented.