Node structure relationship maintenance and node update method, device, and electronic equipment
By constructing a structure tree to maintain the data set, and using pre-order traversal and post-order traversal methods, the problem of learning progress synchronization in complex node structures in online teaching and training courses is solved, and efficient and accurate node data updates are achieved.
Patent Information
- Application Number
- CN202311183014.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-13
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2043-09-13
AI Technical Summary
In the field of education and training, existing technologies make it difficult to efficiently and synchronously update learning progress data with complex node structures. Especially in online teaching and training courses, the same learning resource may be referenced in multiple course packages/projects/tasks, resulting in low efficiency, poor accuracy and consistency in node data updates.
By constructing a structure relationship maintenance data set of a structure tree, using pre-order traversal and post-order traversal methods, the node identification of each node is determined, the structure relationship maintenance data is generated, and it is filled into the data maintenance block to realize the linkage update of node data.
It improves the efficiency and accuracy of node data updates, ensures the synchronization and consistency of node data, and is particularly suitable for structure trees with many node levels and complex reference relationships.
Smart Images

Figure CN117236431B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method, device, electronic device and storage medium for maintaining node structure relationships and updating nodes. Background Art
[0002] In the field of education and training, statistics on users' learning progress and calculation of their learning completion rates are important reference data for evaluating users' mastery of knowledge points. In traditional offline teaching, learning progress is mainly calculated based on a single learning resource node. In comparison, online teaching and training courses have the following main differences:
[0003] First, learning progress statistics based on educational courses are usually not presented as a single learning resource, but rather as a combination of course packages, tasks, and projects. A course package can be divided into multiple learning stages and / or learning levels, and different learning stages and levels are referenced by different projects and tasks. A single task can also include multiple learning levels and hundreds of learning resources.
[0004] Furthermore, the same learning resource typically doesn't appear in just one course package / project / task; it's often referenced by multiple ones. Furthermore, the same course package can be referenced by multiple tasks. Therefore, when the learning progress data for a single learning resource changes, the learning progress data for hundreds of nodes across dozens of associated tasks may need to be updated simultaneously.
[0005] Therefore, there is an urgent need for a node update solution that is suitable for nodes with deep hierarchies and complex node reference relationships to improve the efficiency of node data updates. Summary of the Invention
[0006] In view of this, embodiments of the present disclosure provide a method, device, electronic device, and storage medium for maintaining node structure relationships and updating nodes to at least partially solve the above-mentioned problems.
[0007] According to a first aspect of an embodiment of the present disclosure, a method for maintaining a node structure relationship is provided, the method comprising: determining multiple node identifiers of each node based on the node position of each node in a structure tree; obtaining the own node information or associated node information of each node from the structure tree based on each node identifier of each node, thereby generating structure relationship maintenance data corresponding to each node identifier for each node; and filling each structure relationship maintenance data of each node into each data maintenance block of each node based on the correspondence between each structure relationship maintenance data and each data maintenance block, thereby generating a structure relationship maintenance data set of the structure tree.
[0008] According to a second aspect of an embodiment of the present disclosure, a node updating method is provided, the method comprising: determining each target updating node associated with the target updating resource from each node of the resource structure tree based on a structural relationship maintenance data set of a target updating resource and a resource structure tree; and updating each target updating node of the resource structure tree based on the target updating resource; wherein the structural relationship maintenance data set of the resource structure tree is generated using the method described in the first aspect.
[0009] According to a third aspect of an embodiment of the present disclosure, a node structure relationship maintenance device is provided, the device comprising: a node identification module for determining multiple node identifications of each node according to the node position of each node in a structure tree; a data generation module for obtaining the own node information or associated node information of each node from the structure tree according to each node identification of each node, and thereby generating structure relationship maintenance data corresponding to each node identification for each node; a data maintenance module for filling each structure relationship maintenance data of each node into each data maintenance block of each node according to the correspondence between each structure relationship maintenance data and each data maintenance block, and generating a structure relationship maintenance data set of the structure tree.
[0010] According to a fourth aspect of an embodiment of the present disclosure, a node updating device is provided, comprising: an analysis module for determining, from each node of the resource structure tree, each target update node associated with the target update resource based on a structural relationship maintenance data set of a target update resource and a resource structure tree; an update module for updating each target update node of the resource structure tree based on the target update resource; wherein the structural relationship maintenance data set of the resource structure tree is generated using the method described in the first aspect, or generated using the device described in the third aspect.
[0011] According to the fifth aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing a program, wherein the program comprises instructions which, when executed by the processor, cause the processor to execute the node structure relationship maintenance method described in the first aspect above, or to execute the node update method described in the second aspect.
[0012] According to the sixth aspect of an embodiment of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the node structure relationship maintenance method as described in the first aspect, or execute the node update method as described in the second aspect.
[0013] In summary, the node structure relationship maintenance and node update solutions provided by various aspects of the present disclosure utilize a simple data block structure to maintain the complex structural relationships between nodes in a structure tree by constructing a structure relationship maintenance dataset. Furthermore, based on this constructed structure relationship maintenance dataset, the synchronized update of multiple node data within the structure tree can be achieved. This not only ensures the accuracy of each node data, as well as the synchronization and consistency between node data, but also significantly reduces the computation time for node data updates. This approach is particularly suitable for node updates in structure trees with numerous node hierarchies and complex node reference relationships. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Further details, features and advantages of the present disclosure are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which:
[0015] Figure 1 A processing flow chart of a node structure relationship maintenance method according to an exemplary embodiment of the present disclosure is shown.
[0016] Figure 2 A schematic diagram of a structure tree applied to an educational application scenario is shown.
[0017] Figure 3 A schematic diagram showing a structural relationship maintenance data set of a structure tree according to an exemplary embodiment of the present disclosure is shown.
[0018] Figure 4 A processing flow chart of a node structure relationship maintenance method according to another exemplary embodiment of the present disclosure is shown.
[0019] Figure 5 A processing flow chart of a node updating method according to an exemplary embodiment of the present disclosure is shown.
[0020] Figure 6 A schematic diagram illustrating an application of a node updating method according to an exemplary embodiment of the present disclosure is shown.
[0021] Figure 7 A structural block diagram of a node structure relationship maintenance device according to an exemplary embodiment of the present disclosure is shown.
[0022] Figure 8 A structural block diagram of a node updating device according to an exemplary embodiment of the present disclosure is shown.
[0023] Figure 9 FIG. 1 is a schematic diagram of the architecture of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0024] The following describes embodiments of the present disclosure in more detail 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 limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0025] 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.
[0026] The term "including" and its variations used in this document are open inclusions, that is, "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 other embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc. mentioned in this 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.
[0027] It should be noted that the modifiers "one" and "plurality" mentioned in this disclosure are illustrative and non-restrictive. Those skilled in the art will understand that unless the context clearly indicates otherwise, they should be understood as "one or more." The names of the messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of these messages or information.
[0028] As described in the above background technology, since the learning progress statistics of teaching and training courses usually do not exist in the form of a single learning resource, but appear in the form of a combination of course packages, tasks, projects, etc., therefore, when the learning progress data of a single learning resource changes, there may be hundreds of hierarchical nodes under dozens of tasks associated with it that need to be updated synchronously.
[0029] There are two main learning progress synchronization methods in the prior art:
[0030] The first update solution is to create a learning profile for each task that each user is learning, as well as the learning resources included in each task. When the progress of a learning resource changes, the learning progress of the task to which the learning resource belongs is calculated synchronously. However, this learning progress synchronization solution may not be compatible with application scenarios where the same learning resource is referenced by multiple projects / tasks, or it may require frequent data synchronization updates between different tasks, resulting in high system performance consumption for data update processing and the risk of inconsistent data updates between different tasks.
[0031] The second update solution is to store only the learning progress of leaf node resources. When the entire learning progress needs to be displayed, the latest progress of the tasks to which the leaf node resources belong is calculated in real time. However, while this solution can solve the data consistency problem of different resource nodes, it suffers from poor data update performance for tasks with multiple node hierarchies and complex node reference relationships, and it cannot implement batch data update statistics.
[0032] refer to Figure 1 , which shows a schematic diagram of the resource structure tree in an educational application scenario. Among them, the root node of the resource structure tree can be set to "task", the child nodes under the root node can be "level", "course", "chapter", etc., and the leaf nodes of the structure tree can be set to "resource". The nodes can reference each other arbitrarily. For example, the child node of the task node can be a course node or a level node; for example, the child node of the "course" node can be a chapter node or a resource node. Furthermore, a child node can be referenced by one or more parent nodes. For example, "resource 1" can be referenced by "course 4" and "course 1" at the same time; "course 2" can be referenced by "task 1" and "task 2" at the same time.
[0033] Depend on Figure 1 As can be seen, the resource structure tree in educational application scenarios has structural characteristics such as deep node hierarchies and complex reference relationships between nodes. When the progress of a learning resource at a leaf node is updated, it triggers a chain reaction among multiple related nodes. Therefore, how to quickly and accurately update the overall learning progress while taking into account the accuracy, consistency, real-time performance, service stability, and concurrency of the data at each node is the technical problem to be solved in this disclosure.
[0034] Specific embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
[0035] Figure 2 This is a flowchart of a method for maintaining a node structure relationship according to an exemplary embodiment of the present disclosure. As shown in the figure, this embodiment mainly includes the following steps:
[0036] Step S202: determining multiple node identifiers of each node according to the node position of each node in the structure tree.
[0037] The structure tree of this embodiment can be applied to educational application scenarios.
[0038] In some embodiments, a pre-order traversal method may be used to sequentially obtain each node of the structure tree, and two node identifiers of each node may be determined based on the node position of each node in the structure tree.
[0039] Specifically, a node in the structure tree may be obtained in sequence by first visiting the root node, then traversing the left subtree, and finally traversing the right subtree.
[0040] In this embodiment, the two node identifiers of each node may include any one of a root node and a non-root node, and any one of a leaf node and a non-leaf node.
[0041] For example, in Figure 1 In the example shown, based on the node position of "Task 1" in the structure tree, it can be determined that the two nodes of "Task 1" are identified as "root node" and "non-leaf node"; based on the node position of "Level 1" in the structure tree, it can be determined that the two nodes of "Level 1" are identified as "non-root node" and "non-leaf node"; based on the node position of "Resource 1" in the structure tree, it can be determined that the two nodes of "Resource 1" are identified as "non-root node" and "leaf node".
[0042] In some embodiments, a two-digit digital code can be used to represent the two node identifiers of each node, wherein the first digit in the two-digit digital code is used to distinguish whether it belongs to a root node (for example, the "root node" identifier is "1", the "non-root node" identifier is "0"), and the second digit in the two-digit digital code is used to distinguish whether it belongs to a leaf node (for example, the "leaf node" identifier is "1", the "non-root node" identifier is "0").
[0043] For example, in Figure 1 In the illustrated embodiment, the two node identifiers of the "Task 1" node may be represented as the code "10"; the two node identifiers of the "Level 1" node may be represented as the code "00"; and the two node identifiers of the "Resource 1" node may be represented as the code "01".
[0044] Step S204 , acquiring the node information or associated node information of each node from the structure tree according to each node identifier of each node, and generating structural relationship maintenance data corresponding to each node identifier.
[0045] In some embodiments, if the multiple node identifiers of any target node among the nodes include a root node, the target node's own node information is obtained from the structure tree to generate the root node and node hierarchy of the target node.
[0046] refer to Figure 1 When the target node is "Task 2", based on the "root node" included in the multiple node identifiers of "Task 2", the node information of "Task 2" itself (for example, the node identification code or node address of "Task 2") can be obtained from the structure tree to generate the root node and node hierarchy of "Task 2".
[0047] Specifically, based on the node identifier of the "root node" of "Task 2", it can be determined that the parent node set of "Task 2" is "empty" (that is, "Task 2" does not have a parent node), and the node information of "Task 2" itself is the root node of "Task 2", and the node hierarchy of "Task 2" is generated, for example, the node hierarchy of the "root node" is set to "0".
[0048] In some embodiments, if the multiple node identifiers of any target node among the nodes include a non-root node, the associated node information of each node located in the upper layer of the target node is obtained from the structure tree, and each parent node, each root node, and the node hierarchy of the target node are generated accordingly.
[0049] Optionally, based on the node identifier of the "non-root node" of the target node, the associated node information of each node located in the upper layer of the target node can be obtained from the structure tree to generate each parent node of the target node, the root node of each parent node can be obtained from the structure tree to generate each root node of the target node, and the node level of each parent node of the target node can be obtained, and the node level of the target node can be generated based on the largest node level in each node level.
[0050] refer to Figure 1 In the case where the target node is "Course 2", based on the "non-root node" included in the multiple node identifiers of "Course 2", the associated node information of each node located in the upper layer of "Course 2" can be obtained from the structure tree to generate each parent node of "Course 2" (for example, the parent nodes of "Course 2" include "Task 1" and "Level 2"). The root node of each parent node of the target node can be obtained from the structure tree to generate each root node of "Course 2" (for example, the root node of "Task 1" is its own node, and the root node of "Level 2" is "Task 2"). The node level of each parent node of "Course 2" can be obtained, and the node level of the target node "Course 2" can be generated based on the maximum level of each node level corresponding to each parent node. For example, the node level of "Task 1" is "0" and the node level of "Level 2" is "1". Based on the maximum node level "1", the node level of the target node "Course 2" can be generated as "2".
[0051] In some cases, deduplication can be performed on each root node of the target node to simplify the structural relationship maintenance data. Figure 1In the example shown, the parent nodes of "Resource 5" include "Chapter 2" and "Level 3", where the root nodes of "Chapter 2" include "Task 1" and "Task 2", and the root node of "Level 3" includes "Task 2". Deduplication processing can be performed on the duplicate root node "Task 2" to generate the root nodes "Task 1" and "Task 2" of "Chapter 2".
[0052] In some embodiments, if the multiple node identifiers of the target node include leaf nodes, the target node's own node information may be obtained from the structure tree to generate the leaf nodes of the target node.
[0053] refer to Figure 1 When the target node is "resource 3", according to the "leaf node" contained in the multiple node identifiers of "resource 3", the node information of "resource 3" itself (for example, the node identification code or node address of "resource 3") can be obtained from the structure tree to generate the leaf node of "resource 3".
[0054] Specifically, based on the node identifier of the "leaf node" of "resource 3", it can be determined that the child node set of "resource 3" is "empty" (that is, "resource 3" has no child nodes), and the node information of "resource 3" itself is the leaf node of "resource 3".
[0055] In some embodiments, if the multiple node identifiers of the target node include non-leaf nodes, the associated node information of each node located at the next level of the target node is obtained from the structure tree to generate each child node of the target node.
[0056] refer to Figure 1 When the target node is "Course 2", based on the "non-leaf nodes" contained in the multiple node identifiers of "Course 2", the associated node information of each node located at the next layer of "Course 2" can be obtained from the structure tree to generate each child node of "Course 2" (for example, the child nodes of "Course 2" include "Chapter 2").
[0057] In some embodiments, after generating structural relationship maintenance data corresponding to each node identifier for each node, a post-order traversal method can be used based on each parent node of each node to determine multiple nodes to be processed with the same parent node from each node, and deduplication processing can be performed based on each leaf node of each node to be processed to determine each leaf node of the parent node.
[0058] For example, reference Figure 1, based on the parent node of each node, a post-order traversal method can be used to determine multiple nodes to be processed that have the same parent node from each node. For example, the parent node of both the to-be-processed nodes "Level 2" and "Level 3" is "Task 2". Among them, the leaf nodes of "Level 2" include "Resource 3, Resource 4, Resource 5", and the leaf node of "Level 3" includes "Resource 5". Then, deduplication processing can be performed on the repeated leaf node "Resource 5" to determine the leaf nodes "Resource 3, Resource 4, Resource 5" of the parent node "Task 2".
[0059] Step S206 , filling each structural relationship maintenance data of each node into each data maintenance block according to the correspondence between each structural relationship maintenance data and each data maintenance block, thereby generating a structural relationship maintenance data set of a structure tree.
[0060] Optionally, multiple data maintenance blocks can be generated for each node, and according to the correspondence between each structural relationship maintenance data and each data maintenance block, each structural relationship maintenance data of each node is filled into each data maintenance block of each node to generate a structural relationship maintenance data set of a structure tree.
[0061] In some embodiments, each node of the structure tree can be used as a primary key value, and each data maintenance block can be arranged in order in rows and columns to generate a structure relationship maintenance data table of the structure relationship maintenance data set (refer to Figure 3 ).
[0062] In summary, the node structure relationship maintenance method of the disclosed embodiment identifies the node position of each node in the structure tree to determine multiple node identifiers for each node. It then obtains the node information or associated node information corresponding to each node identifier from the structure tree to generate individual structure relationship maintenance data for each node. The data set for maintaining the node structure relationships of the structure tree is constructed by populating the individual structure relationship maintenance data for each node into corresponding data maintenance blocks. This allows the disclosed method to maintain complex structure relationships between nodes in the structure tree using a simple data block structure, improving the efficiency of maintaining node structure relationships in complex structure trees.
[0063] Figure 4 A processing flow chart of a node structure relationship maintenance method according to another exemplary embodiment of the present application is shown. Figure 1 The specific implementation scheme of the embodiment shown mainly includes the following steps:
[0064] Step S402: using a pre-order traversal method, sequentially obtain a target node from each node of the structure tree.
[0065] Specifically, a node in the structure tree may be obtained in sequence by first visiting the root node, then traversing the left subtree, and finally traversing the right subtree.
[0066] Step S404, determine whether the target node is a root node, if so, proceed to step S406, if not, proceed to step S408.
[0067] Specifically, according to the node position of the target node in the structure tree, it is determined whether the target node is a root node. If it is determined that the target node is a root node, step S406 is executed; if it is determined that the target node is a non-root node, step S408 is executed.
[0068] Step S406: Obtain the target node's own node information from the structure tree, and generate the target node's root node and node hierarchy accordingly.
[0069] For example, reference Figure 1 In the case where the target node "Task 2" belongs to the root node, the root node of "Task 2" is determined based on the node information of "Task 2" itself, and the node level of "Task 2" is generated (for example, "0").
[0070] Step S408: acquiring the associated node information of each node located in the upper layer of the target node from the structure tree, and generating each parent node, each root node, and node hierarchy of the target node accordingly.
[0071] Optionally, based on the node identifier of the non-root node of the target node, the associated node information of each node located in the upper layer of the target node can be obtained from the structure tree to generate each parent node of the target node, the root node of each parent node can be obtained from the structure tree to generate each root node of the target node, and the node level of each parent node of the target node can be obtained, and the node level of the target node can be generated based on the largest node level in each node level.
[0072] Optionally, deduplication processing may be performed on each root node of the target node.
[0073] refer to Figure 1In the case where the target node "Course 2" is a non-root node, the associated node information of each node located in the upper layer of "Course 2" is obtained from the structure tree to generate each parent node of "Course 2" (for example, the parent nodes of "Course 2" include "Task 1" and "Level 2"). The root node of each parent node of the target node is obtained from the structure tree to generate each root node of "Course 2" (for example, the root node of "Task 1" is its own node, and the root node of "Level 2" is "Task 2"). And based on the node level of each parent node of "Course 2" (for example, the node level of "Task 1" is "0" and the node level of "Level 2" is "1"), the node level of the target node "Course 2" is generated (for example, the node level of "Course 2" is "2").
[0074] Step S410, determine whether the target node is a leaf node, if so, proceed to step S412, if not, proceed to step S414.
[0075] Specifically, based on the node position of the target node in the structure tree, determine whether the target node is a leaf node. If the target node is determined to be a leaf node, execute step S412; if the target node is determined to be a non-leaf node, execute step S414.
[0076] Step S412: Obtain the root node information of the target node from the structure tree, and generate the leaf nodes of the target node accordingly.
[0077] refer to Figure 1 When the target node "resource 3" is a leaf node, it can be determined that the child node set of "resource 3" is "empty" (that is, "resource 3" has no child nodes), and the node information of "resource 3" itself is the leaf node of "resource 3".
[0078] Step S414: acquiring the associated node information of each node located at the next level of the target node from the structure tree, and generating the information of each child node of the target node accordingly.
[0079] refer to Figure 1 , when the target node "Course 2" is a non-leaf node, the associated node information of each node located at the next layer of "Course 2" is obtained from the structure tree, and each child node of "Course 2" is generated (for example, the child nodes of "Course 2" include "Chapter 2").
[0080] Step S416, determine whether each node in the structure tree has been traversed. If not, return to step S402. If so, execute step S418.
[0081] Specifically, it can be determined whether each node in the structure tree has been traversed. If not, return to step S402 to sequentially obtain the next target node in the structure tree in a pre-order traversal manner. If so, proceed to step S418.
[0082] In step S418, a post-order traversal method is used to determine all child nodes having the same parent node, and deduplication processing is performed on each leaf node of each child node of the same parent node.
[0083] Specifically, based on each parent node of each node, a post-order traversal method can be used to determine multiple nodes to be processed that have the same parent node from each node, and deduplication processing can be performed on each leaf node of each node to be processed to determine each leaf node of the parent node.
[0084] For example, reference Figure 1 , based on the parent node of each node, a post-order traversal method can be used to determine multiple nodes to be processed with the same parent node from each node. For example, the nodes to be processed "Level 2" and "Level 3" with the same parent node "Task 2" are determined, where the leaf nodes of "Level 2" include "Resource 3, Resource 4, Resource 5" and the leaf nodes of "Level 3" include "Resource 5". Then, deduplication processing can be performed on the repeated leaf node "Resource 5" to determine that the leaf nodes of "Task 2" include "Resource 3, Resource 4, Resource 5".
[0085] Step S420 , filling each structural relationship maintenance data of each node into each data maintenance block according to the correspondence between each structural relationship maintenance data and each data maintenance block, thereby generating a structural relationship maintenance data set of a structure tree.
[0086] In some embodiments, each node of the structure tree can be used as a primary key value, and each data maintenance block in the structure relationship maintenance data set can be arranged in rows and columns to generate a structure relationship maintenance data table (refer to Figure 3 ).
[0087] In summary, the node structure relationship maintenance method provided by the embodiment of the present disclosure utilizes a pre-order traversal method combined with a post-order traversal method to perform overall maintenance on each node in the structure tree, that is, the pre-order traversal method is used to sequentially maintain each target node in the structure tree, and after obtaining the structural relationship maintenance data of each target node, the post-order traversal method is used to perform deduplication processing on the leaf nodes of the same parent node, thereby improving the overall structural maintenance efficiency of the structure tree.
[0088] At the same time, for each target node in the structure tree, by first determining whether the target node belongs to the root node, the root node, parent node, child node and node hierarchy of each target node are maintained first, and then the maintenance process of determining whether the target node belongs to the leaf node is used to maintain the leaf node of the target node. Through this maintenance process, the accuracy of the structural relationship maintenance data of each target node can be ensured.
[0089] Figure 5 The flowchart of the node updating method according to the exemplary embodiment of the present disclosure is shown, which mainly includes the following steps:
[0090] Step S502: maintaining a data set according to the structural relationship between the target update resource and the resource structure tree, and determining each target update node associated with the target update resource from each node of the resource structure tree.
[0091] For example, in an embodiment of an educational application scenario, the student's resource update data may be collected to calculate the student's learning progress of each resource corresponding to each leaf node.
[0092] In some embodiments, a data dotting receiving method can be used to collect students' resource learning update data. For example, the student's resource update data (dotting data) corresponding to each leaf node is collected every 10 seconds and reported to the server every 1 minute. The server directly stores the resource update data of each leaf node and calculates the student's resource learning progress corresponding to each leaf node in an asynchronous manner based on the student's resource update data corresponding to each leaf node. Through this mechanism, the services of data collection, data storage, and data calculation can be decoupled from each other, maximizing the data processing concurrency and the independence of data services.
[0093] In some embodiments, this step can be triggered when the resource learning progress of any leaf node meets the preset trigger conditions (for example, when the resource learning progress of the leaf node increases by 10%, or when the resource learning progress of the leaf node reaches 50%).
[0094] In this embodiment, the structural relationship maintenance dataset of the resource structure tree can be obtained by executing the steps described in any of the above node structure relationship maintenance method embodiments.
[0095] Optionally, based on the target update resource, each leaf node in the structural relationship maintenance data set can be queried, and the target leaf node associated with the target update resource can be determined from each leaf node. Based on the target leaf node, each node in the structural relationship maintenance data set can be queried, and each impact node associated with the target leaf node can be determined from each node. Based on the structural relationship maintenance data set, each child node and each leaf node of each impact node can be queried to determine each target update node of the target update resource.
[0096] refer to Figure 3 , can update resources according to the target, query the structural relationship maintenance data set for each leaf node (i.e. Figure 3 ) and determine the target leaf node "Resource 5" associated with the target update resource from each leaf node. Based on the target leaf node "Resource 5", each node in the structural relationship maintenance data set can be queried to obtain the image nodes associated with "Resource 5", including "Task 1", "Task 2", "Level 2", "Level 3", "Course 2", and "Chapter 2". Based on the structural relationship maintenance data set, each child node and each leaf node of each influencing node can be queried to determine the target update nodes "Level 1", "Level 2", "Level 3", "Course 2", "Course 3", "Chapter 2", "Resource 1", "Resource 2", "Resource 3", "Resource 4", and "Resource 5" of "Resource 5".
[0097] Step S504: Based on the target update resource, each target update node in the resource structure tree is updated.
[0098] Optionally, each target update node can be arranged in descending order according to its node level (this is because the progress of the upper-level nodes depends on the completion of the lower-level nodes, so the progress of the lower-level nodes is calculated first), and the node data of each target update node can be updated in sequence according to the arrangement order of each target update node.
[0099] For example, when the target update nodes include "Task 1", "Task 2", "Level 2", "Level 3", "Course 2", and "Chapter 2", according to the node hierarchy of each target update node, the descending order of "Chapter 2" > "Course 2" > "Level 2" > "Level 3" > "Task 1" > "Task 2" can be obtained. Based on this order, the node data of each target update node can be updated in sequence (refer to Figure 6 Each target update node is shown with a dark background).
[0100] In some embodiments, each target update node of the target update resource can be stored in memory, and based on the target update resource, the updated data of each target update node is calculated, and the updated data of each target update node is used to replace the original data of each target update node in the memory, and the original data of each target update node is compared with the updated data. Based on the data comparison result of each target update node, a data update mark is generated for each target update node (for example, 0: data has not changed, 1: related node data in memory, a new node needs to be added, 2: data has changed and needs to be modified), and based on the data update mark of each target update node, batch update processing is performed on the node data in the resource structure tree (for example, batch adding data update data of each node marked as 1, batch modifying data update data of each node marked as 2, and ignoring data update data of each node marked as 0). By means of this data update mark design mechanism, different rule calculation models can be supported according to different pod node types, and a pluggable development model can be adopted to realize task combinations of different rules, which is convenient for the subsequent expansion of more calculation rules.
[0101] In summary, this embodiment maintains a dataset based on the structural relationships of the constructed resource structure tree and executes node data updates within the resource structure tree. This allows for rapid identification of all associated nodes linked to the target updated resource. Furthermore, through unified query, calculation, and update processing, the frequency of database queries can be effectively reduced (reducing the number of database operations from dozens or even hundreds to four or fewer), significantly improving service performance. Furthermore, through a mechanism for setting hierarchical attributes for each node, the accuracy and consistency of node data updates can be ensured even when the structure tree has a deep node hierarchy and complex reference relationships between nodes.
[0102] Figure 7 1 is a block diagram of a node structure relationship maintenance device according to an exemplary embodiment of the present disclosure. As shown in the figure, the node structure relationship maintenance device 700 of this embodiment mainly includes:
[0103] A node identification module 702 is configured to determine multiple node identifications of each node according to the node position of each node in the structure tree;
[0104] The data generation module 704 obtains the node information or associated node information of each node from the structure tree according to each node identifier of each node, and generates structural relationship maintenance data corresponding to each node identifier.
[0105] The data maintenance module 706 is used to fill each structural relationship maintenance data of each node into each data maintenance block according to the correspondence between each structural relationship maintenance data and each data maintenance block, thereby generating a structural relationship maintenance data set of the structure tree.
[0106] Optionally, the node identification module 702 is further used to obtain each node of the structure tree in sequence using a pre-order traversal method; determine two node identifications of each node based on the node position of each node in the structure tree; wherein the two node identifications of each node include any one of the root node and the non-root node, and any one of the leaf node and the non-leaf node.
[0107] The data generation module 704 is also used to, for any target node among the nodes, if the multiple node identifiers of the target node include a root node, obtain the target node's own node information from the structure tree, and generate the root node and node hierarchy of the target node accordingly; if the multiple node identifiers of the target node include a non-root node, obtain the associated node information of each node located in the upper layer of the target node from the structure tree, and generate each parent node, each root node, and the node hierarchy of the target node accordingly; if the multiple node identifiers of the target node include a leaf node, obtain the target node's own node information from the structure tree, and generate the leaf node of the target node accordingly; if the multiple node identifiers of the target node include a non-leaf node, obtain the associated node information of each node located in the lower layer of the target node from the structure tree, and generate each child node of the target node accordingly.
[0108] The data generation module 704 is further used to obtain the associated node information of each node located in the upper layer of the target node from the structure tree based on the node identifier of the non-root node, and generate each parent node of the target node; obtain the root node of each parent node from the structure tree and perform deduplication processing to generate each root node of the target node; obtain the node level of each parent node of the target node, and generate the node level of the target node based on the largest node level in each node level.
[0109] The data generation module 704 is also used to, after generating the structural relationship maintenance data corresponding to each node identifier, determine multiple nodes to be processed with the same parent node from each node using a post-order traversal method based on each parent node of each node; perform deduplication processing based on each leaf node of each node to be processed to determine each leaf node of the parent node.
[0110] Figure 8 FIG. 8 is a block diagram showing a node updating device 800 according to an exemplary embodiment of the present disclosure. As shown in the figure, the node updating device 800 mainly includes:
[0111] An analysis module 802 is configured to maintain a data set based on the structural relationship between the target update resource and the resource structure tree, and to determine each target update node associated with the target update resource from each node of the resource structure tree;
[0112] An updating module 804 updates each target update node of the resource structure tree based on the target update resource;
[0113] The structural relationship maintenance data set of the resource structure tree is generated by using the node structural relationship maintenance method described in any one of the above embodiments, or by using the node structural relationship maintenance device described in any one of the above embodiments.
[0114] Optionally, the analysis module 802 is also used to query each leaf node in the structural relationship maintenance data set based on the target update resource, and determine the target leaf node associated with the target update resource from each leaf node; query each node in the structural relationship maintenance data set based on the target leaf node, and determine each impact node associated with the target leaf node from each node; query each child node and each leaf node of each impact node based on the structural relationship maintenance data set to determine each target update node of the target update resource.
[0115] Optionally, the updating module 804 is further configured to arrange each target update node in descending order according to the node level of each target update node; and update the node data of each target update node in sequence according to the arrangement order of each target update node.
[0116] An embodiment of the present disclosure provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the node structure relationship maintenance method described in each exemplary embodiment of the present disclosure or the node update method described in each exemplary embodiment of the present disclosure.
[0117] The exemplary embodiments of the present disclosure provide an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor. The memory stores a computer program executable by the at least one processor, wherein the computer program, when executed by the at least one processor, causes the electronic device to perform the node structure relationship maintenance method or the node update method described in each exemplary embodiment of the present disclosure.
[0118] Please refer to Figure 9, a structural block diagram of an electronic device 900 that can serve as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0119] like Figure 9 As shown, the electronic device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. Various programs and data required for the operation of the device 900 can also be stored in the RAM 903. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0120] Multiple components within electronic device 900 are connected to I / O interface 905, including an input unit 906, an output unit 907, a storage unit 908, and a communication unit 909. Input unit 906 can be any type of device capable of inputting information into electronic device 900. Input unit 906 can receive input numeric or character information and generate key input signals related to user settings and / or function control of the electronic device. Output unit 907 can be any type of device capable of presenting information and may include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. Storage unit 908 may include, but is not limited to, a magnetic disk or an optical disk. Communication unit 909 allows electronic device 900 to exchange information / data with other devices via computer networks such as the Internet and / or various telecommunication networks and may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver and / or a chipset, such as a Bluetooth™ device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0121] The computing unit 901 can be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 901 performs the various methods and processes described above. For example, in some embodiments, the node structure relationship maintenance method or node update method described above can be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 908. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 900 via the ROM 902 and / or the communication unit 909. In some embodiments, the computing unit 901 can be configured to perform the node structure relationship maintenance method or node update method described above by any other appropriate means (e.g., by means of firmware).
[0122] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0123] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can 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.
[0124] As used in this disclosure, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and / or device (e.g., a magnetic disk, an optical disk, a memory, a programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including machine-readable media that receive machine instructions as machine-readable signals. The term "machine-readable signal" refers to any signal used to provide machine instructions and / or data to a programmable processor.
[0125] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0126] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., as an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by 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), and the Internet.
[0127] A computer system may include a client and a server. The client and the server are generally remote from each other and typically interact via a communication network. The client and the server relationship is established by computer programs running on the respective computers and having a client-server relationship with each other.
[0128] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present disclosure can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present disclosure.
[0129] The above implementation methods are only used to illustrate the embodiments of the present disclosure, and are not intended to limit the embodiments of the present disclosure. Ordinary technicians in the relevant technical field may make various changes and modifications without departing from the spirit and scope of the embodiments of the present disclosure. Therefore, all equivalent technical solutions also fall within the scope of the embodiments of the present disclosure, and the scope of patent protection of the embodiments of the present disclosure should be defined by the claims.
Claims
1. A method for maintaining node structure relationships, applied to teaching and training courses, comprising: Determine multiple node identifiers of each node according to the node position of each node in the structure tree; According to each node identifier of each node, the node information or associated node information of each node is obtained from the structure tree, thereby generating structural relationship maintenance data corresponding to each node identifier for each node; According to the correspondence between each structural relationship maintenance data and each data maintenance block, each structural relationship maintenance data of each node is correspondingly filled into each data maintenance block of each node to generate the structural relationship maintenance data set of the structure tree; The step of generating structural relationship maintenance data corresponding to each node identifier includes: For any target node in each node, If the multiple node identifiers of the target node include a root node, obtaining the node information of the target node from the structure tree, and generating the root node and node hierarchy of the target node accordingly; If the multiple node identifiers of the target node include a non-root node, obtaining associated node information of each node located in an upper layer of the target node from the structure tree, and generating each parent node of the target node, each root node, and a node hierarchy of the target node based on the associated node information; If the multiple node identifiers of the target node include a leaf node, obtaining the node information of the target node from the structure tree, and generating the leaf node of the target node accordingly; If the multiple node identifiers of the target node include non-leaf nodes, obtaining associated node information of each node located at a layer below the target node from the structure tree, and generating each child node of the target node accordingly; The root node of the structure tree includes the tasks in the teaching and training course, the child nodes under the root node include the levels, courses, and chapters in the teaching and training course, and the leaf nodes of the structure tree include the resources in the teaching and training course.
2. The method according to claim 1, wherein Determining multiple node identifiers of each node according to the node position of each node in the structure tree includes: Using a pre-order traversal method, each node of the structure tree is obtained in turn; Determine two node identifiers of each node according to the node position of each node in the structure tree; The two node identifiers of each node include any one of a root node and a non-root node, and any one of a leaf node and a non-leaf node.
3. The method according to claim 1, wherein If the multiple node identifiers of the target node include a non-root node, obtaining associated node information of each node located in an upper layer of the target node from the structure tree, and generating each parent node, each root node, and the node hierarchy of the target node based on the associated node information, including: According to the node identifier of the non-root node, the associated node information of each node located in the upper layer of the target node is obtained from the structure tree to generate each parent node of the target node; Obtaining the root node of each parent node from the structure tree and performing deduplication processing to generate each root node of the target node; The node level of each parent node of the target node is obtained, and the node level of the target node is generated according to the maximum node level among the node levels.
4. The method according to claim 1, wherein After generating the structural relationship maintenance data corresponding to each node identifier, the method further includes: According to each parent node of each node, a post-order traversal method is used to determine multiple nodes to be processed that have the same parent node from each node; Deduplication processing is performed on each leaf node of each node to be processed to determine each leaf node of the parent node.
5. A node updating method, the method comprising: Maintaining a data set according to the structural relationship between the target update resource and the resource structure tree, and determining each target update node associated with the target update resource from each node of the resource structure tree; Based on the target update resource, updating each target update node of the resource structure tree; The structural relationship maintenance data set of the resource structure tree is generated by using the method according to any one of claims 1 to 4.
6. The method according to claim 5, wherein: The step of maintaining a data set according to the structural relationship between the target update resource and the resource structure tree and determining each target update node associated with the target update resource from each node of the resource structure tree comprises: According to the target update resource, query each leaf node in the structural relationship maintenance data set, and determine the target leaf node associated with the target update resource from each leaf node; According to the target leaf node, query each node in the structural relationship maintenance data set, and determine each influencing node associated with the target leaf node from each node; Maintaining a data set according to the structural relationship, querying each child node and each leaf node of each influencing node, and determining each target update node of the target update resource.
7. The method according to claim 5 or 6, wherein: The method comprises: Sort each target update node in descending order according to its node level; According to the arrangement order of each target update node, the node data of each target update node is updated in sequence.
8. A node structure relationship maintenance device, applied to teaching and training courses, comprising: A node identification module is used to determine multiple node identifications of each node according to the node position of each node in the structure tree; A data generation module, which obtains the node information or associated node information of each node from the structure tree according to each node identifier of each node, and generates structural relationship maintenance data corresponding to each node identifier; A data maintenance module is used to fill each structural relationship maintenance data of each node into each data maintenance block according to the corresponding relationship between each structural relationship maintenance data and each data maintenance block, thereby generating a structural relationship maintenance data set of the structure tree; Wherein, the data generation module is further used for: For any target node in each node, If the multiple node identifiers of the target node include a root node, obtaining the node information of the target node from the structure tree, and generating the root node and node hierarchy of the target node accordingly; If the multiple node identifiers of the target node include a non-root node, obtaining associated node information of each node located in an upper layer of the target node from the structure tree, and generating each parent node of the target node, each root node, and a node hierarchy of the target node based on the associated node information; If the multiple node identifiers of the target node include a leaf node, obtaining the node information of the target node from the structure tree, and generating the leaf node of the target node accordingly; If the multiple node identifiers of the target node include non-leaf nodes, obtaining associated node information of each node located at a layer below the target node from the structure tree, and generating each child node of the target node accordingly; The root node of the structure tree includes the tasks in the teaching and training course, the child nodes under the root node include the levels, courses, and chapters in the teaching and training course, and the leaf nodes of the structure tree include the resources in the teaching and training course.
9. A node updating device, comprising: An analysis module, configured to maintain a data set according to a structural relationship between a target update resource and a resource structure tree, and to determine each target update node associated with the target update resource from each node of the resource structure tree; An updating module, which updates each target update node of the resource structure tree based on the target update resource; The structural relationship maintenance data set of the resource structure tree is generated by using the method according to any one of claims 1 to 4, or by using the device according to claim 8.
10. An electronic device comprising: processor; as well as Memory for storing programs, The program includes instructions, which, when executed by the processor, cause the processor to execute the node structure relationship maintenance method according to any one of claims 1 to 4, or execute the node update method according to any one of claims 5 to 7.
11. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable the computer to execute the node structure relationship maintenance method according to any one of claims 1 to 4, or to execute the node updating method according to any one of claims 5 to 7.
Citation Information
Patent Citations
Data organization structure, data acquisition method and device and readable storage medium
CN110618993A
Storing Hierarchical Data to Enable Paging
US20100250611A1