A data relationship processing method, device, electronic device and storage medium
By building pointer maps and target index tables, the problem of uncontrollable data depth caused by unlimited tree structures is solved, and efficient data query and accurate discussion data management are achieved.
Patent Information
- Application Number
- CN202210430236.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-22
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2042-04-22
AI Technical Summary
In the prior art, unlimited tree structures lead to uncontrollable data depth, increasing the cost of search and traversal time, and the data relationship misleading data statistics after deletion operations, and unable to achieve effective management.
By building a pointer map and target index table, determine the data level of the discussion data, establish the data node and pointer relationship, add new identification information table elements, and realize nested reply relationships and quantity statistics of the discussion data.
It improves data query efficiency, reduces the time cost of search and traversal, and realizes effective management and accurate statistics of the discussion data.
Smart Images

Figure CN116975367B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, device, electronic device and storage medium for processing data relations. Background Art
[0002] With the development of information technology, people can initiate discussions on the same multimedia content. Therefore, how to effectively manage the discussion data of each object on the multimedia content has become an urgent problem to be solved. The discussion data may include comment data directly generated on the multimedia content, as well as reply data indirectly generated on the multimedia content when replying to the comment data.
[0003] In related technologies, in order to process data relationships between data, a tree structure with unlimited levels is usually established to present various discussion data related to multimedia content.
[0004] However, for an unlimited-level tree structure, the unlimited-level nested structure will lead to uncontrollable data depth. When pulling and counting data according to the viewing needs of the target object, it will greatly increase the time cost of searching and traversing, and reduce the efficiency of data query.
[0005] In addition, when performing data deletion operations, the operation is only performed on the currently deleted data itself, so that although the individual data that respond to the deleted data cannot be displayed, the saved data relationship is still included in the data statistical results, misleading the normal browsing of the target object, and thus unable to achieve effective management of the data. Summary of the Invention
[0006] The embodiments of the present application provide a method, device, electronic device and storage medium for processing data relationships to solve the problem that the existing technology cannot achieve efficient and accurate processing of discussion data based on data relationships determined based on analysis.
[0007] First, a method for processing data relationships is proposed, including:
[0008] Obtaining discussion data associated with target content, and determining a data hierarchy of the discussion data with respect to the target content, wherein the data hierarchy is used to characterize a nested reply relationship between the discussion data;
[0009] According to the data level of the discussion data, a data node corresponding to the discussion data is created in a preset pointer map, and a table element corresponding to the identification information of the discussion data is added to the target index table corresponding to the data level, wherein each data node is associated with a pointer to other discussion data of the specified data level, and the target index table includes at least a statistical subtable for counting the total number of discussion data of a specified type, and a clustering subtable for clustering discussion data of a specified level;
[0010] Based on the pointer map and the target index table, the data relationship corresponding to the target content is represented.
[0011] Secondly, a method for processing data relationships is proposed, including:
[0012] After receiving a deletion instruction for target discussion data associated with target content, deleting a target table element corresponding to the target discussion data in an index table associated with the target content;
[0013] According to the tree structure diagram associated with the target content, the linked discussion data under the target discussion data is determined, and in the order of data hierarchy from high to low, the content corresponding to the linked discussion data of each data level is deleted in the index table and the tree structure diagram respectively, wherein the data hierarchy represents the nested reply relationship between the discussion data.
[0014] In a third aspect, a data relationship processing device is proposed, comprising:
[0015] an obtaining unit, configured to obtain discussion data associated with target content, and determine a data hierarchy of the discussion data with respect to the target content, wherein the data hierarchy is used to characterize a nested reply relationship between the discussion data;
[0016] A creation unit, configured to create, in accordance with the data level of the discussion data, data nodes corresponding to the discussion data in a preset pointer map, and to add table elements corresponding to the identification information of the discussion data in a target index table corresponding to the data level, wherein each data node is associated with a pointer to other discussion data of a specified data level, and the target index table includes at least a statistical subtable for counting the total number of discussion data of a specified type, and a clustering subtable for clustering discussion data of a specified level;
[0017] A representation unit is used to represent the data relationship corresponding to the target content based on the pointer map and the target index table.
[0018] Optionally, when creating the data node corresponding to the discussion data in the preset pointer map, the creating unit is configured to:
[0019] Establishing a data node corresponding to the discussion data in a preset pointer map;
[0020] According to the set pointer pointing relationship, other discussion data that have the pointer pointing relationship with the discussion data are determined, and pointers between corresponding data nodes are created in the pointer graph, wherein the pointer pointing relationship is used to characterize the reply relationship between discussion data at different data levels.
[0021] Optionally, when creating pointers between corresponding data nodes, the creation unit is used to: point to a root comment pointer pointing to the first-level discussion data of the traceability, a direct reply pointer pointing to the parent discussion data of the reply, and a root reply pointer pointing to the second-level discussion data of the traceability; wherein, the first-level discussion data is historical discussion data that directly replies to the target content, the second-level discussion data is historical discussion data that replies to the first-level discussion data, and the parent discussion data is historical discussion data for targeted replies.
[0022] Optionally, when adding a table element corresponding to the identification information of the discussion data to the target index table corresponding to the data level, the creation unit is configured to:
[0023] Determine the statistical sub-table and clustering sub-table corresponding to the data level of the discussion data according to the predefined data level range corresponding to the table elements in each sub-table;
[0024] The identification information of the discussion data is added to the statistical subtable as the terminal table element in the statistical subtable, and corresponding table elements are added to the corresponding clustering subtable based on the temporal relationship between the discussion data and other discussion data belonging to the same parent discussion data.
[0025] Optionally, before determining the statistical sub-table and the clustering sub-table corresponding to the data level of the discussion data according to the predefined data level range corresponding to the table elements in each sub-table, the creating unit is further configured to:
[0026] Pre-defining a corresponding designated-level clustering sub-table for discussion data of a designated data level associated with the target content;
[0027] A corresponding total amount statistics sub-table is defined in advance for the discussion data associated with the target content, and a corresponding designated level statistics sub-table is defined in advance for the discussion data of a designated data level associated with the target content.
[0028] Optionally, upon receiving a request to present each historical discussion data associated with the target content, the apparatus further comprises a processing unit configured to:
[0029] Obtaining an index table associated with the target content, and determining, based on the index table, table elements at each data level associated with the target content, and determining the total number of historical discussion data belonging to the specified level, wherein the index table is created based on reply relationships between the discussion data;
[0030] The historical discussion data content corresponding to the table elements under each data level is obtained respectively, and the historical discussion data content and the total number of historical discussion data under each data level are displayed according to a preset data display format.
[0031] Optionally, when determining the data level of the discussion data with respect to the target content, the obtaining unit is configured to:
[0032] According to the reply relationship between the discussion data and the acquired historical discussion data, tracing back to determine the total number of nested reply levels of the discussion data relative to the target content;
[0033] If it is determined that the total number of nested reply levels is higher than a set reply level threshold, determining the data level of the discussion data with respect to the target content based on the reply level threshold;
[0034] If it is determined that the total number of nested reply levels is not higher than the reply level threshold, the data level of the discussion data with respect to the target content is determined based on the total number of nested reply levels.
[0035] Optionally, after receiving a deletion instruction for the target discussion data, the processing unit in the apparatus is further configured to:
[0036] Obtaining an index table created for each historical discussion data associated with the target content, and obtaining a tree structure diagram associated with the target content established based on the pointer map;
[0037] In the index table, deleting the target table element corresponding to the target discussion data, and in the tree structure diagram, deleting the tree node corresponding to the target discussion data;
[0038] According to the pointer map, the linkage discussion data under the target discussion data is determined, and the linkage table element corresponding to each linkage discussion data is deleted in the index table, and the linkage tree node corresponding to each linkage discussion data is deleted in the tree structure.
[0039] Optionally, when deleting the linkage table element corresponding to each linkage discussion data in the index table, the processing unit is configured to:
[0040] According to the historical discussion data of a specified level associated with the target content, the index table is stored in pages, wherein the storage content of each page includes the content of a sub-table associated with at least one historical discussion data of the specified level;
[0041] For each page of stored content, the linkage table element corresponding to the linkage discussion data included in the stored content is deleted.
[0042] Optionally, when deleting the linkage table element corresponding to the linkage discussion data included in the stored content, the processing unit is configured to:
[0043] Determining target linkage discussion data associated with the target discussion data and having a higher data level than the target discussion data based on the pointer map, wherein a higher data level indicates that the corresponding discussion data has more nested reply levels relative to the target content;
[0044] In the order of data levels from high to low, the linkage table elements corresponding to each target linkage discussion data are deleted in sequence in the storage content.
[0045] Optionally, when deleting the linkage tree node corresponding to each linkage discussion data in the tree structure diagram, the processing unit is configured to:
[0046] For each page of stored content, perform the following operations:
[0047] determining target linkage discussion data included in the stored content;
[0048] In the tree structure diagram, the linkage tree nodes corresponding to the target linkage discussion data at each depth value are deleted in turn in descending order of the corresponding depth values, wherein the depth value of the tree node corresponds to the data level of the corresponding discussion data.
[0049] In a fourth aspect, a data relationship processing device is proposed, comprising:
[0050] A receiving unit, configured to, after receiving a deletion instruction for target discussion data associated with target content, delete a target table element corresponding to the target discussion data in an index table associated with the target content;
[0051] A deletion unit is used to determine the linked discussion data under the target discussion data according to the tree structure diagram associated with the target content, and to delete the content corresponding to the linked discussion data of each data level in the index table and the tree structure diagram in order from high to low data levels, wherein the data level represents the nested reply relationship between the discussion data.
[0052] Optionally, three data levels are set for the discussion data associated with the target content, and the index table includes statistical sub-tables of discussion data of other levels traceable to the same first-level discussion data, clustering sub-tables of second-level discussion data traceable to the same first-level discussion data, clustering sub-tables of third-level discussion data traceable to the same second-level discussion data, first-level discussion data clustering sub-tables, and statistical sub-tables of discussion data associated with the target content.
[0053] Optionally, the target discussion data is first-level discussion data; when deleting the content corresponding to the linkage discussion data of each data level in the index table and the tree structure diagram in descending order of the data levels, the deleting unit is used to:
[0054] According to the historical discussion data of the specified level, the index table after deleting the target table element is stored in pages, wherein the storage content of each page includes the sub-table content associated with at least one historical discussion data of the specified level;
[0055] For the storage content of each page, delete the linkage table elements belonging to the third-level discussion data, and delete the corresponding linkage tree nodes in the tree structure diagram, then delete the linkage table elements belonging to the second-level discussion data, and delete the corresponding linkage tree nodes in the tree structure diagram.
[0056] Optionally, when deleting the linkage table element belonging to the third-level discussion data, the deleting unit is used to:
[0057] Traversing the secondary discussion data clustering subtable corresponding to the target discussion data to determine the secondary discussion data below the target discussion data, and traversing the tertiary discussion data clustering subtable corresponding to each secondary discussion data to determine the tertiary discussion data traceable to the target discussion data;
[0058] Delete the linkage table elements corresponding to the third-level discussion data in the discussion data statistics sub-table, the other-level discussion data clustering sub-table corresponding to the target discussion data, and the corresponding third-level discussion data clustering sub-table respectively.
[0059] Optionally, when deleting the linkage table element belonging to the secondary discussion data, the deleting unit is configured to:
[0060] Delete the linkage table elements corresponding to the secondary discussion data below the target discussion data in the discussion data statistics subtable, the other level discussion data clustering subtable corresponding to the target discussion data, and the corresponding secondary discussion data clustering subtable respectively.
[0061] Optionally, the target discussion data is secondary discussion data; when deleting the content corresponding to the linkage discussion data of each data level in the index table and the tree structure diagram in descending order of the data levels, the deleting unit is used to:
[0062] According to the historical discussion data of the specified level, the index table after deleting the target table element is stored in pages, wherein the storage content of each page includes the sub-table content associated with at least one historical discussion data of the specified level;
[0063] For each page of stored content, the linkage table elements belonging to the third-level discussion data are deleted, and the corresponding linkage tree nodes are deleted in the tree structure diagram.
[0064] Optionally, when deleting the linkage table element belonging to the third-level discussion data, the deleting unit is used to:
[0065] Determine the third-level discussion data under the target discussion data, and delete the linkage table elements corresponding to the third-level discussion data in the other-level discussion data clustering subtable containing the target discussion data and the discussion data statistical subtable.
[0066] In the fifth aspect, an electronic device is proposed, comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor, wherein when the processor executes the program, the method for processing the data relationship described in any one of the first and second aspects is implemented.
[0067] In a sixth aspect, a computer-readable storage medium is proposed, on which a computer program is stored. When the computer program is executed by a processor, the method for processing the data relationship described in any one of the first and second aspects is implemented.
[0068] In a seventh aspect, a computer program product is proposed, comprising a computer program, which, when executed by a processor, implements the method for processing the data relationship described in any one of the first and second aspects.
[0069] The beneficial effects of this application are as follows:
[0070] In an embodiment of the present application, a method, device, electronic device and storage medium for processing data relationships are proposed. First, discussion data associated with the target content is obtained, and the data hierarchy of the discussion data for the target content is determined, wherein the data hierarchy is used to characterize the nested reply relationship between the discussion data; then, according to the data hierarchy of the discussion data, data nodes corresponding to the discussion data are created in a preset pointer map, and table elements corresponding to the identification information of the discussion data are added to the target index table corresponding to the data hierarchy, wherein each data node is associated with a pointer to other discussion data of a specified data hierarchy, and the target index table includes at least a statistical subtable for counting the total number of discussion data of a specified type, and a clustering subtable for clustering discussion data of a specified hierarchy; then, based on the pointer map and the target index table, the data relationship corresponding to the target content is characterized.
[0071] In this way, with the help of the constructed pointer map, while establishing the pointing relationship between the discussion data, it is possible to characterize the nested reply relationship between the discussion data of different data levels, so that the mutual reply situation between the discussion data of different data levels can be extracted, and the order and attribution relationship between the discussion data can be indicated. In addition, with the help of the statistical subtable and clustering subtable included in the target index table, it is possible to realize the counting statistics of the discussion data of the specified type and the index clustering of the discussion data of the specified type, thereby effectively realizing the quantitative statistics of various types of discussion data and effectively determining the clustering content corresponding to various types of discussion data, which not only provides a processing basis for the detailed analysis of the discussion data of the specified level, but also provides a processing basis for the effective number statistics of various types of discussion data. Furthermore, the joint action of the pointer map and the target index table brings convenience to the linkage processing of the related discussion data. According to the pointer pointing indicated in the pointer map and the table element content included in the target index table, the target content that needs to be linked adjusted and searched can be quickly found, which will greatly reduce the time cost of searching and traversing and improve the efficiency of data query. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] Figure 1a This is a schematic diagram of the storage structure of the data discussed in the embodiments of this application;
[0073] Figure 1b This is a tree structure diagram with no limit on the level in the embodiment of the present application;
[0074] Figure 2 A schematic diagram of a possible application scenario in an embodiment of the present application;
[0075] Figure 3a Schematic diagram of the processing flow of data relationship in the embodiment of this application;
[0076] Figure 3bA logical diagram for tracing back and determining the total number of nested reply layers in an embodiment of the present application;
[0077] Figure 3c As shown, it is a schematic diagram of a method for determining data levels in an embodiment of the present application;
[0078] Figure 3d A schematic diagram of the process of adding data nodes and pointers to the pointer map in the implementation of this application;
[0079] Figure 3e This is a schematic diagram of the process of updating the pointer map and constructing the index table in the embodiment of the present application;
[0080] Figure 4a Schematic diagram of the data relationship deletion process in an embodiment of the present application;
[0081] Figure 4b This is a schematic diagram of the contents in the index table after a synchronous deletion operation is performed in an embodiment of the present application;
[0082] Figure 4c This is a schematic diagram of paging storage content in an embodiment of the present application;
[0083] Figure 4d This is a schematic diagram of the process of deleting the first page of linkage discussion data in this embodiment;
[0084] Figure 4e Schematic diagram of the pruning process of the tree structure diagram in the embodiment of the present application;
[0085] Figure 4f This is a schematic diagram of the process of deleting the second page of linkage discussion data in an embodiment of the present application;
[0086] Figure 4g A schematic diagram of the process of deleting secondary discussion data in an embodiment of the present application;
[0087] Figure 5a This is a schematic diagram showing historical discussion data in an embodiment of the present application;
[0088] Figure 5b This is a schematic diagram showing historical discussion data in an embodiment of the present application;
[0089] Figure 6 A schematic diagram of the logical structure of a data relationship processing device in an embodiment of the present application;
[0090] Figure 7 A schematic diagram of the logical structure of a data relationship processing device in an embodiment of the present application;
[0091] Figure 8 A schematic diagram of the hardware structure of an electronic device to which an embodiment of the present application is applied;
[0092] Figure 9 The figure is a schematic diagram of the hardware structure of another electronic device in accordance with the embodiment of the present application. DETAILED DESCRIPTION
[0093] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of the technical solutions of this application, but not all of them. Based on the embodiments described in this application document, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the technical solutions of this application.
[0094] The terms "first," "second," and the like in the specification and claims of this application and in the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequential sequence. It should be understood that the terms used in this manner are interchangeable where appropriate, such that the embodiments of the invention described herein can be practiced in sequences other than those illustrated or described herein.
[0095] The following explains some of the terms used in the embodiments of the present application to facilitate understanding by those skilled in the art.
[0096] Target content: refers to multimedia content published on public platforms that can be browsed and commented on. The target content may exist in forms including but not limited to articles, songs, long videos, short videos, etc.
[0097] Discussion data: refers to content published for the same target content with the subjective opinions of the browsing object. In the embodiment of the present application, discussion data may exist in multiple forms, including but not limited to text, voice, and video; discussion data can be divided into discussion data that directly comments on the target content and discussion data that indirectly replies to the target content according to the nested reply relationship relative to the target content. Among them, discussion data that indirectly replies to the target content refers to: other discussion data that replies to discussion data associated with the target content.
[0098] Parent discussion data: is a concept existing between two discussion data. When one discussion data replies to another discussion data, the replied discussion data is called the parent discussion data of the other discussion data.
[0099] The data hierarchy is used to analyze the reply relationship between various discussion data that have an associated relationship, that is, by grading each discussion data, the nested reply relationship between the discussion data is characterized, wherein the higher the data hierarchy, the more reply layers the corresponding discussion data has nested relative to the target content. In an embodiment of the present application, the discussion data divided into the same data hierarchy will be presented in the same presentation method. For example, when the data hierarchy is represented by numerical sorting, the discussion data that directly comments on the target data can be regarded as zero-level discussion data, and the discussion data that replies to the zero-level discussion data can be referred to as first-level discussion data, and the discussion data that replies to the first-level discussion data can be referred to as second-level discussion data, and so on, wherein the zero-level discussion data is referred to as the parent discussion data of the first-level discussion data and the second-level discussion data.
[0100] Nested reply relationship: used to characterize the reply and reply relationship between various discussion data. In the embodiment of the present application, it is said that there are nested replies between the discussion data and its corresponding parent discussion data, and the same analogy can be applied to the various discussion data associated with the target content. The layer-by-layer reply relationship between the upper discussion data and the lower discussion data is called the existence of a nested reply relationship; for example, assuming that discussion data A is the discussion data that directly comments on the target content, discussion data B is the discussion data that replies to discussion data A, and discussion data C is the discussion data that replies to discussion data B, then there is a nested reply relationship between discussion data A, discussion data B, and discussion data C, and discussion data A is the parent discussion data of discussion data B, and discussion data B is the parent discussion data of discussion data C; discussion data A is the upper discussion data relative to discussion data B and C, and discussion data B and C are the lower discussion data relative to discussion data A.
[0101] Index table: refers to a collection of table elements with the same or similar attributes. In the embodiment of the present application, each table element included in the index table is the identification information (identity, ID) of the discussion data. The index table contains data IDs that meet certain conditions. For example, for an index table of products with a price less than 50 yuan, the index table stores product IDs that meet the conditions. It should be noted that, according to actual processing needs, the actual data content is usually not stored in the index table. Instead, when the data content is actually needed, the corresponding data content is obtained through the data ID.
[0102] Pointer map: In an embodiment of the present application, the pointer map includes data nodes and pointers, wherein one data node corresponds to one discussion data, and each data node is associated with pointers pointing to other data nodes, wherein the number of pointers that each data node points to other data nodes is determined according to the actual processing needs of the device. For example, each data node is provided with three pointers, which respectively point to the discussion data that directly comments on the target content determined by tracing back, the parent discussion data determined by tracing back, and the first-level discussion data, wherein the first-level discussion data is: the discussion data that directly comments on the target content. It should be noted that, in an embodiment of the present application, the pointer map may include data nodes and pointer relationships constructed for discussion data associated with different target contents, and the content in the pointer map will not be deleted when the discussion data is deleted, and thus can indicate the data relationship between the discussion data.
[0103] Historical discussion data is a concept relative to the currently obtained discussion data. In the embodiment of the present application, other discussion data released before the currently obtained discussion data is referred to as historical discussion data.
[0104] The following is a brief introduction to the design concept of the embodiment of this application:
[0105] In related technologies, in order to effectively represent the data relationship between discussion data, it is usually possible to directly process the stored content, or to represent the relationship between discussion data by constructing a tree structure with unlimited levels.
[0106] However, the method of representing the relationship between discussion data based on relevant technologies can only meet the needs of a single discussion data presentation method, and cannot make global adjustments when the data relationship changes, resulting in inaccurate statistical results such as the total amount of various discussion data, causing misleading browsing of related objects; in addition, in the case of being unable to provide effective data relationships, it is impossible to efficiently and accurately pull discussion data in the actual processing process, which requires a lot of time to search and find data, thereby increasing the consumption of search and traversal resources.
[0107] For example, see Figure 1a As shown, it is a schematic diagram of the storage structure of discussion data in an embodiment of the present application. The comments and replies for each article are stored in the storage table shown in 1a, wherein the reply data and comment data are collectively referred to as discussion data for the article, the comment refers to the information and remarks published on the article, and the reply refers to the remarks published in response to the comment and other replies.
[0108] like Figure 1aAs shown, for each entity (reply or comment), relevant topic and other information are saved, and for the reply data, a pointer to the parent discussion data (parent_id) is maintained, pointing to other data that the reply data is specifically replying to, which is used to expand the object and traceability of the reply data when displayed. As for the number of comments and replies used for statistics, digital storage is usually used separately. When the discussion data is deleted or added, a simple addition or subtraction operation is performed directly on the stored digital content. When pulling comment data or reply data, the corresponding topic information (article ID) is usually searched in the storage; then, the comment data associated with the article ID is pulled, and the ID information of the pulled comment data or reply data is used as parent_id to pull the corresponding subordinate replies.
[0109] exist Figure 1a The proposed storage structure diagram can support the presentation of discussion data in two data levels, where the first-level presentation data corresponds to the discussion data that directly comments on the article, and the second-level presentation data corresponds to other discussion data that can be traced back to the same first-level presentation data.
[0110] In this way, on the one hand, it is impossible to effectively count the number of comment data or reply data when discussion data is added or deleted. On the other hand, it is necessary to continuously jump and search according to the pointer in the storage table, so it is impossible to efficiently pull the content that needs to be viewed, and thus it is impossible to effectively manage the discussion data.
[0111] For example, see Figure 1b As shown, it is a tree structure diagram with no limit on the level in the embodiment of the present application. Figure 1b A tree structure with parent-child relationships and hierarchical layers is stored in the data structure, and the tree structure is used to represent the data relationship between the discussion data associated with the target content, wherein the discussion data includes comment data and reply data.
[0112] exist Figure 1b In the established tree structure, the root node corresponds to the target content ID. The first-level reply nodes under the root node correspond to the comments directly targeting the target content. The second-level reply nodes represent the replies to the first-level reply nodes. The same logic applies to the N-level reply nodes, which represent the replies to the N-1-level reply nodes. The total amount of discussion data is then stored through separately stored digital content.
[0113] In this way, an unlimited-level tree structure diagram will greatly increase the difficulty of maintenance. Since the depth value of the tree structure is uncontrollable, the established data relationship is extremely complex, and it takes a lot of time and resources to traverse the tree structure. Therefore, it is impossible to achieve efficient management of discussion data based on the established data relationship; in addition, the complex tree structure diagram is not convenient for adjusting discussion data, and it is impossible to efficiently and accurately count the total amount of discussion data at different levels. When it is necessary to pull deeper discussion data, it is necessary to go through a complex downward traversal search process, which makes the operation time uncontrollable; moreover, when performing operations such as deletion on the upper-level discussion data, it will only affect itself, which makes the lower-level discussion data still appear in the statistical results of the discussion data when it loses its display meaning, greatly affecting the accuracy of data statistics and causing misleading of the presented content; therefore, it is impossible to achieve efficient management of discussion data based on the established data relationship. Figure 1b The proposed data relationship representation method enables effective management of discussion data.
[0114] In view of this, in an embodiment of the present application, a method, device, electronic device and storage medium for processing data relationships are proposed. First, discussion data associated with the target content is obtained, and the data hierarchy of the discussion data for the target content is determined, wherein the data hierarchy is used to characterize the nested reply relationship between the discussion data; then, according to the data hierarchy of the discussion data, data nodes corresponding to the discussion data are created in a preset pointer map, and table elements corresponding to the identification information of the discussion data are added to the target index table corresponding to the data hierarchy, wherein each data node is associated with a pointer to other discussion data of a specified data hierarchy, and the target index table includes at least a statistical subtable for counting the total number of discussion data of a specified type, and a clustering subtable for clustering discussion data of a specified hierarchy; then, based on the pointer map and the target index table, the data relationship corresponding to the target content is characterized.
[0115] In this way, with the help of the constructed pointer map, while establishing the pointing relationship between the discussion data, it is possible to characterize the nested reply relationship between the discussion data of different data levels, so that the mutual reply situation between the discussion data of different data levels can be extracted, and the order and attribution relationship between the discussion data can be indicated. In addition, with the help of the statistical subtable and clustering subtable included in the target index table, it is possible to realize the counting statistics of the discussion data of the specified type and the index clustering of the discussion data of the specified type, thereby effectively realizing the quantitative statistics of various types of discussion data and effectively determining the clustering content corresponding to various types of discussion data, which not only provides a processing basis for the detailed analysis of the discussion data of the specified level, but also provides a processing basis for the effective number statistics of various types of discussion data. Furthermore, the joint action of the pointer map and the target index table brings convenience to the linkage processing of the related discussion data. According to the pointer pointing indicated in the pointer map and the table element content included in the target index table, the target content that needs to be linked adjusted and searched can be quickly found, which will greatly reduce the time cost of searching and traversing and improve the efficiency of data query.
[0116] The preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application and are not used to limit the present application. In addition, the embodiments of the present application and the features in the embodiments may be combined with each other if there is no conflict.
[0117] See Figure 2 FIG2 is a schematic diagram of a possible application scenario in an embodiment of the present application, which includes an object device 210 (including an object device 2101 , an object device 2102 . . . , an object device 210n ) and a processing device 220 .
[0118] In an embodiment of the present application, the object device 210 is used to publish discussion data for the target content, wherein the object device 210 includes but is not limited to personal computers, mobile phones, computers, notebooks, intelligent voice interaction devices, e-book readers, smart home appliances, vehicle-mounted terminals, aircraft, etc.
[0119] The processing device 220 is used to analyze and store the discussion data published by each object device 210, and process the objective data relationship between each discussion data, wherein the objective data relationship is specifically the reply and reply relationship between different discussion data. The processing device 220 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. In some possible embodiments, the processing device 220 can also be an electronic device with processing capabilities, such as a notebook, mobile phone, tablet computer, etc.
[0120] In the embodiment of the present application, a wired connection or a wireless connection may be used to establish a communication connection between the object device 210 and the processing device 220 via a communication network.
[0121] In an embodiment of the present application, the processing device 220 may directly obtain the discussion data sent by the object device 210, or, after the object device 210 sends the discussion data to the data device, the processing device 220 obtains the discussion data from the data device. This application does not impose any specific restrictions on this.
[0122] The technical solution proposed in this application can realize the processing of data relationships in various application scenarios. The following is a schematic illustration of several possible application scenarios:
[0123] Application scenario 1: Processing the data relationship between various discussion data related to multimedia content.
[0124] Specifically, the processing device can obtain discussion data for multimedia content releases, wherein the discussion data includes comment data and reply data for multimedia content releases. The multimedia content can specifically be articles, videos, audio, and other content released on a designated platform.
[0125] Furthermore, the processing device analyzes the nested reply relationship between the discussion comment data and the reply data, and establishes data nodes corresponding to the discussion data in the pointer map, as well as pointers for each data node to other discussion data at a specified data level, so as to characterize the reply relationship between different discussion data and the upper and lower discussion data determined by traceability; at the same time, the processing device adds a table element corresponding to the identification information of the discussion data in the corresponding target index table to realize clustered indexing for different types of discussion data.
[0126] On this basis, the objectively existing data relationships can be effectively represented, and effective management of the discussion data can be achieved. For example, in response to a deletion operation on the discussion data, the represented data relationships can be adjusted.
[0127] Application scenario 2: Processing the data relationship between various discussion data related to the game.
[0128] Specifically, it can be applied in a forum for sharing game experiences, or a platform that can realize game downloads, where the processing device obtains discussion data posted by different experience objects on the forum or platform, where the discussion data includes comment data directly on the game and reply data indirectly on the game.
[0129] Furthermore, the processing device creates data nodes and pointers corresponding to each experience discussion data in the pointer map, and adds corresponding table elements to the corresponding target index table for each experience discussion data. In this way, it can effectively represent the objective nested reply relationship between the experience comment data and the experience reply data.
[0130] On this basis, effective management of the experience discussion data can be achieved based on the established data relationships. For example, in response to a deletion operation on the experience discussion data, the represented data relationships can be adjusted.
[0131] The following first describes the data relationship processing process in detail with reference to the accompanying drawings:
[0132] See Figure 3a As shown, it is a schematic diagram of the processing flow of data relationship in the embodiment of this application. Figure 3a , the processing process of data relationship is explained:
[0133] Step 301: The processing device obtains discussion data associated with target content and determines the data level of the discussion data with respect to the target content.
[0134] In an embodiment of the present application, after the relevant object publishes discussion data for the target content, the processing device obtains the discussion data, and then determines the data hierarchy of the discussion data for the target content based on the reply status of the discussion data relative to the previously obtained historical discussion data, wherein the data hierarchy is used to characterize the nested reply relationship between the discussion data.
[0135] It should be noted that, in the embodiment of the present application, different naming methods can be used to name the divided data levels. The following description only uses numbers to identify different data levels as an example. In addition, in the embodiment of the present application, the higher the data level value corresponding to the default discussion data, the more complex the corresponding nested reply relationship. When tracing back from the discussion data to the parent discussion data until tracing back to other discussion data that directly reply to the target content, the more discussion data is experienced.
[0136] For example, in an embodiment of the present application, when naming the data hierarchy, the discussion data that directly comments on the target content can be set to the zero level; for other discussion data that uses the zero-level discussion data as the parent discussion data, the data hierarchy is set to the first level; for other discussion data that uses the first-level discussion data as the parent discussion data, the data hierarchy is set to the second level, and so on; or, the discussion data that directly comments on the target content can be set to the first level, and the other discussion data that uses the first-level discussion data as the parent discussion data can be set to the second level, and so on.
[0137] In the following description of this application, only the discussion data that directly comments on the target content is set as the first-level discussion data as an example for explanation.
[0138] In an embodiment of the present application, in order to avoid the problem of uncontrollable data search time due to too many data levels, the total number of divided data levels can be set according to actual processing needs while taking into account the browsing habits of the data; on this basis, in order to ensure that the set data levels do not exceed the total number of data levels, a reply level threshold can be set for the total number of nested reply levels, so that in some possible embodiments, the data levels are constrained based on the total number of nested reply levels.
[0139] For example, assuming that some objects, when browsing discussion data associated with target content, are accustomed to displaying all first-level discussion data that directly comment on the target content in a flat format, and folding and displaying other discussion data that directly or indirectly reply to the first-level discussion data in a flat format, then dividing the discussion data associated with the target content into two data levels can meet the presentation needs; other objects, when browsing discussion data associated with target content, are accustomed to displaying all first-level discussion data that directly comment on the target content in a flat format, and folding and displaying the second-level discussion data that directly reply to the first-level discussion data in a flat format, and based on the second-level discussion data, folding and displaying other discussion data that directly or indirectly reply to the second-level discussion data in a flat format, then dividing the discussion data associated with the target content into three data levels can meet the presentation needs. Therefore, in order to be compatible with the above two presentation requirements, the discussion data can be divided into three data levels.
[0140] When determining the data level corresponding to the discussion data, the processing device determines the nested reply relationship between the discussion data and the historical discussion data based on the reply of the discussion data to the obtained historical discussion data, and then determines the data level corresponding to the currently obtained discussion data based on the existence of the parent discussion data and the data level of the parent discussion data.
[0141] In some possible implementations, the processing device can trace back and determine the total number of nested replies of the discussion data relative to the target content based on the reply relationship between the discussion data and the acquired historical discussion data; further, if it is determined that the total number of nested replies is higher than the set reply layer threshold, the data level of the discussion data with respect to the target content is determined based on the reply layer threshold; if it is determined that the total number of nested replies is not higher than the reply layer threshold, the data level of the discussion data with respect to the target content is determined based on the total number of nested replies.
[0142] Specifically, when tracing back to determine the total number of nested replies in discussion data relative to the target content, and then determining the data hierarchy, the following possible situations exist based on the reply relationship between the currently acquired discussion data and historical discussion data:
[0143] Case 1: There is no reply relationship between the discussion data and the acquired historical discussion data.
[0144] Specifically, when the acquired discussion data is discussion data that directly comments on the target content, there is no historical discussion data to which the discussion data is specifically replied. In other words, the currently acquired discussion data does not have parent discussion data.
[0145] Therefore, the total nesting level of the currently acquired discussion data relative to the target content is 1, and the data level of the currently acquired discussion data can be directly determined as level one.
[0146] Case 2: There is a reply relationship between the discussion data and the acquired historical discussion data.
[0147] In an embodiment of the present application, when the historical discussion data obtained contains parent discussion data of the currently obtained discussion data, that is, the currently obtained discussion data is reply data to a historical discussion data, the processing device needs to trace the source to determine the data level corresponding to the discussion data.
[0148] Specifically, the processing device may adopt the following possible methods including but not limited to:
[0149] Method 1: Directly determine the total number of nested reply levels of the discussion data for the target content.
[0150] Specifically, when the obtained discussion data is associated with information of other discussion data at a higher level, the processing device may directly determine the total number of nested reply levels corresponding to the discussion data based on the other discussion data at a higher level.
[0151] For example, assume that the obtained discussion data is associated with the following schematic relationship: discussion data A@user 1 discussion data B@user 2 discussion data C@target content ID, and the meaning of the existence of this schematic relationship is defined as follows: discussion data A directly replies to discussion data B posted by user 1, and discussion data B posted by user 1 replies to discussion data C posted by user 2, and discussion data C posted by user 2 directly comments on the target content (corresponding to the target content ID). In this case, the total number of nested replies of discussion data A relative to the target content is 3, the total number of nested replies of discussion data B relative to the target content is 2, and the total number of nested replies of discussion data C relative to the target content is 1.
[0152] Then, based on the relationship between the total number of nested reply levels and the set reply level threshold, the data level corresponding to the currently obtained discussion data is determined, wherein the set reply level threshold and the total number of divided data levels can take the same value.
[0153] For another example, assume that the total number of data hierarchies is 3, namely level 1 (corresponding to a total number of nested replies of 1), level 2 (corresponding to a total number of nested replies of 2), and level 3 (corresponding to a total number of nested replies >= 3), and the reply level threshold set for the total number of nested replies is 3. Continuing with the above example, the data level set for discussion data A is level 3, the data level set for discussion data B is level 2, and the data level set for discussion data C is level 1.
[0154] In this way, after determining the total number of nested reply levels of the discussion data for the target content, the reply status of the discussion data relative to the target content can be determined within the scope of all discussion data associated with the target content; and with the help of the set reply level threshold, the presented data level can be indirectly constrained, so that the discussion data above the reply level threshold is restricted to the same data level, providing a processing basis for the subsequent hierarchical presentation of the nested reply relationship between the discussion data.
[0155] Method 2: Determine the total number of nested reply levels of the discussion data for the target content based on a preset pointer map.
[0156] Specifically, the processing device can directly determine the data level corresponding to the discussion data based on a preset pointer map, wherein the pointer map includes data nodes corresponding to each previously obtained historical discussion data, and each data node is associated with a pointer to other discussion data of the specified data level. The specified data level constraint can be at least one item or combination of parent discussion data, child discussion data, and specific level discussion data.
[0157] Then, when tracing back to determine the total number of nested reply layers corresponding to the discussion data, the processing device can obtain a preset pointer map, and determine the parent discussion data corresponding to the discussion data, and determine the data node corresponding to the parent discussion data in the pointer map.
[0158] Furthermore, the processing device gradually traces upward the data nodes corresponding to the parent discussion data in the pointer graph until the determined parent discussion data corresponds to the historical discussion data that directly comments on the target content; then, based on the total number of parent discussion data determined in the tracing process, the total number of nested replies of the currently obtained discussion data relative to the target content is determined.
[0159] For example, see Figure 3b As shown, it is a logical diagram of tracing back to determine the total number of nested replies in the embodiment of this application. Figure 3b As shown in the content, assuming that the currently acquired discussion data is: discussion data D, then when tracing back to determine the total number of nested replies of discussion data D relative to the target content, first determine the parent discussion data (determined by the pointer parent_id) that discussion data D specifically replies to: discussion data k1 corresponding to data node k1; then, determine the parent discussion data corresponding to discussion data k1 in the pointer graph: discussion data j1 corresponding to data node j1; and determine the parent discussion data corresponding to discussion data j1: discussion data i corresponding to data node i. At this time, since discussion data i is the discussion data that directly replies to the target content, the tracing back stops. Therefore, the upper-level data nodes determined after the tracing back are: k1-j1-i, then the total number of nested replies of discussion data D to the target content is 4 layers.
[0160] For another example, if the total number of nested replies determined for discussion data D is 4, and the data hierarchy is divided into 3 levels, namely level 1 (corresponding to a total number of nested replies of 1), level 2 (corresponding to a total number of nested replies of 2), and level 3 (corresponding to a total number of nested replies greater than or equal to 3), and the reply level threshold set for the total number of nested replies is 3, then the data hierarchy determined for discussion data D is level 3.
[0161] It should be noted that, in the embodiment of the present application, the process of updating the pointer map and the process of creating a tree structure diagram corresponding to the pointer map will be described in detail in the description of step 302, and will not be further described in this application.
[0162] In this way, on the basis of realizing effective traceability of discussion data with the help of pointer graphs, the nested reply relationship between discussion data can be constrained according to the set reply layer threshold, and then the presentation of different discussion data can be divided into levels, which is equivalent to realizing the classification of discussion data; in addition, by dividing the corresponding data levels, the various discussion data displayed in the same way are determined, which provides a processing basis for the subsequent effective presentation of discussion data.
[0163] In other possible embodiments, when a corresponding tree structure diagram is created for the pointer map, the processing device can determine the corresponding data level corresponding to the discussion data directly based on the parent discussion data and the tree structure diagram of the discussion data.
[0164] Specifically, when a corresponding tree structure diagram is created for the pointer map, the processing device determines the parent discussion data corresponding to the currently acquired discussion data, and then obtains the created tree structure diagram, wherein the tree structure diagram is used to intuitively present the parent-child relationship and the upper and lower hierarchical relationship between historical discussion data. The tree structure diagram includes tree nodes, and there are connecting edges between the tree nodes with parent-child relationships. The tree nodes with parent-child relationships correspond to historical discussion data and the corresponding parent historical discussion data. One tree node corresponds to one historical discussion data, and the corresponding tree node can be identified by the ID of the historical discussion data.
[0165] It should be noted that in the embodiment of the present application, the depth value of the tree structure diagram corresponds to the data level. The depth value can be configured according to the total number of data levels based on actual processing needs, so that when the depth value in the tree structure diagram is the same as the data level, the depth value of the tree node in the tree structure diagram can also be understood as the data level of the historical discussion data corresponding to the tree node.
[0166] For example, the set maximum depth value = the total number of divided data levels = the reply level threshold set for the total number of nested replies = 3, each tree node with a depth value of 1 corresponds to each historical discussion data with a data level of 1, and each historical discussion data with a total nested reply level of 1; each tree node with a depth value of 2 corresponds to each historical discussion data with a data level of 2, and each historical discussion data with a total nested reply level of 2; each tree node with a depth value of 3 corresponds to each historical discussion data with a data level of 3, and each historical discussion data with a total nested reply level of not less than 3.
[0167] Furthermore, after determining the parent discussion data of the currently obtained discussion data, the processing device determines the data level corresponding to the parent discussion data in the tree structure diagram; then, when it is determined that the data level is not the highest value of the data level, the data level is added by one to obtain the data level corresponding to the discussion data; and when it is determined that the data level corresponding to the parent discussion data is the highest value of the data level, the data level of the discussion data is set to the highest value of the data level.
[0168] In summary, in possible embodiments of the present application, there is the following corresponding relationship: maximum depth value in the tree structure diagram = total number of divided data levels = reply level threshold set for the total number of nested replies.
[0169] In this way, with the help of the constructed tree structure diagram, the parent relationship and the superior-subordinate relationship between the discussion data can be intuitively presented, and at the same time, the data hierarchy relationship can be assisted in determining, so that the parent discussion data based on the currently obtained discussion data, the depth value in the tree structure diagram can determine the data hierarchy corresponding to the parent discussion data; and then the data hierarchy corresponding to the current discussion data can be indirectly determined, so that based on the reply situation between the discussion data and the parent discussion data, as well as the reply situation between the parent discussion data and other historical discussion data, the nested reply relationship between each discussion data can be quickly determined; thereby determining the data hierarchy corresponding to the discussion data, and at the same time, the presentation level corresponding to each discussion data can be characterized.
[0170] The following is a specific example to illustrate the process of determining the data level. Figure 3c As shown, it is a schematic diagram of the method of determining the data level in the embodiment of the present application. Figure 3c As shown, when the discussion data A posted by user 2 is the reply data to "Polar bears are so cute" posted by user 1, the discussion data A obtained by the processing device has a reference relationship to "Polar bears are so cute" posted by user 1. Therefore, "Polar bears are so cute" posted by user 1 can be determined as the parent discussion data of discussion data A.
[0171] Furthermore, the data level corresponding to the discussion data A can be determined by using any of the following implementation methods when parent discussion data exists: directly determine the total number of nested reply layers of the discussion data relative to the target content based on the data reference format of the discussion data, and then determine the corresponding data level based on the total number of nested reply layers; trace the upper-level discussion data associated with the parent discussion data in the pointer map, and then determine the data level corresponding to the discussion data A; determine the depth information corresponding to the parent discussion data in the tree structure diagram corresponding to the pointer map, and then determine the data level corresponding to the discussion data A based on the depth information.
[0172] Continue reading Figure 3cAs shown, assuming that discussion data A is posted by user 3, and discussion data A is discussion data that directly comments on the target content, then discussion data A does not have parent discussion data, so the data level of discussion data A can be directly determined as level 1.
[0173] Step 302: The processing device creates a data node corresponding to the discussion data in a preset pointer map according to the data level of the discussion data, and adds a table element corresponding to the identification information of the discussion data in the target index table corresponding to the data level.
[0174] In an embodiment of the present application, after the processing device determines the data level corresponding to the discussion data, it creates a data node corresponding to the discussion data in a preset pointer map, and adds a table element corresponding to the identification information of the discussion data in the target index table corresponding to the data level, wherein each data node is associated with a pointer to other discussion data of the specified data level, and the target index table includes at least a statistical sub-table for counting the total number of discussion data of a specified type, and a clustering sub-table for clustering discussion data of a specified level.
[0175] When updating the currently obtained discussion data into the pointer map, the processing device establishes a data node corresponding to the discussion data in the preset pointer map; then, based on the set pointer pointing relationship, it determines other discussion data that have a pointer pointing relationship with the discussion data, and creates pointers between corresponding data nodes in the pointer map, wherein the pointer pointing relationship is used to characterize the reply relationship between discussion data at different data levels.
[0176] Specifically, after the processing device obtains the preset pointer map, it creates a data node corresponding to the discussion data in the pointer map; then, according to the set pointer pointing relationship, it defines a pointer from the data node to other data nodes.
[0177] In an embodiment of the present application, the pointer pointing relationship is used to describe some objectively existing data relationships, and can also be understood as a relationship used to characterize the reply relationship between discussion data at different data levels. The objectively existing data relationships between discussion data include parent-child relationships and superior-subordinate relationships; the parent-child relationship is relative to two discussion data, and is used to characterize the reply and reply situations between the two discussion data. The discussion data to be replied to is regarded as the parent discussion data of the other discussion data, and the discussion data that replies to the parent discussion data is referred to as the child discussion data of the parent discussion data; the reply relationship represented by the superior-subordinate relationship is relative. For one discussion data, other discussion data determined by tracing back to the parent discussion data are the superior discussion data of the discussion data, and correspondingly, other discussion data determined by tracing back to the child discussion data are the subordinate discussion data of the discussion data.
[0178] In an embodiment of the present application, for the pointer pointing relationship set according to actual processing needs, multiple pointers may be set corresponding to each data node. The specific number of pointers and the type of data nodes pointed to by the pointers are set according to actual processing needs.
[0179] Optionally, three pointers can be set for each data node, including a root comment pointer pointing to the first-level discussion data of the traceability, a direct reply pointer pointing to the parent discussion data of the reply, and a root reply pointer pointing to the second-level discussion data of the traceability, wherein the first-level discussion data is the historical discussion data that directly replies to the target content, the second-level discussion data is the historical discussion data that replies to the first-level discussion data, and the parent discussion data is the historical discussion data for targeted replies.
[0180] Specifically, when the pointer pointing relationship corresponds to the maintenance of the above three pointers, the processing device defines a three-pointer structure for each discussion data to facilitate traceability and related data storage operations. The defined three-pointer structure is as follows:
[0181]
[0182]
[0183] Among them, the root comment pointer (denoted as root_id) is used to point to the first-level discussion data to which the current discussion data is traced back. Among them, the first-level discussion data refers to the historical discussion data that directly replies to the target content. In particular, for the first-level discussion data, the first-level discussion data itself has no root_id, because in the tree structure diagram created according to the pointer map, the tree node corresponding to the first-level discussion data is the root node, so the pointer "root_id" of the first-level discussion data is defined as pointing to "null (none)".
[0184] The direct reply pointer (denoted as parent_id) is used to point to the parent discussion data to which the current discussion data directly replies, and is used to clarify which historical discussion data the currently acquired discussion data specifically replies to. Specifically, for first-level discussion data, there is no parent discussion data for first-level discussion data, so the pointer "parent_id" of the first-level discussion data is defined as pointing to "none"; for second-level discussion data, the second-level discussion data replies to the first-level discussion data, so the pointer "parent_id" of the second-level discussion data points to the first-level discussion data determined by tracing back to the source; for third-level discussion data and above, the pointer "parent_id" of the N-level discussion data points to the N-1-level discussion data determined by its tracing back to the source.
[0185] The root reply pointer (denoted as first_level_id) is used to point to the second-level discussion data to which the current discussion data is traced. In particular, for first-level discussion data, there is no second-level discussion data to which it belongs, so the pointer "first_level_id" of the first-level discussion data is defined as pointing to "none"; for each discussion data under a certain second-level discussion data, regardless of which discussion data the subordinate discussion data is replying to, the pointer "first_level_id" corresponding to each discussion data under the second-level discussion data points to the second-level discussion data.
[0186] In this way, under the restriction of pointer pointing relationship, according to the various pointers constrained by the pointer pointing relationship, the various pointers corresponding to the data level where the currently discussed data is located can be determined, and the addition of new data nodes and the creation of pointers in the pointer map can be guided, which provides a processing basis for the maintenance and update of the pointer map and helps to fully characterize the objectively existing data relationships.
[0187] Furthermore, after determining the pointer constrained by the pointer pointing relationship, the processing device creates a new data node and a pointer between the data node and other data nodes in the pointer map, which is equivalent to adding a data relationship associated with the current discussion data in the pointer map.
[0188] For example, see Figure 3d As shown, it is a schematic diagram of the process of adding data nodes and pointers in the pointer map in the implementation of this application. Figure 3d As shown, for the currently obtained discussion data D, assuming that based on the data reference relationship corresponding to discussion data D, the parent discussion data of discussion data D is determined to be historical discussion data k1, and based on the current pointer map, it can be traced back to determine that the first-level discussion data to which historical discussion data k1 belongs is: historical discussion data i, and the second-level discussion data to which historical discussion data k1 belongs is traced back to determine that it belongs is: historical discussion data j1. Then, in the three-pointer result defined for discussion data D, the root comment pointer of discussion data D is defined to point to historical discussion data i; the root reply pointer of discussion data D is defined to point to historical discussion data j1; and the direct reply pointer of discussion data D is defined to point to historical discussion data k1.
[0189] Continue reading Figure 3d As shown, based on the definition of the three-pointer structure for the discussion data D, continue to refer to Figure 3d As shown, the processing device adds a data node D corresponding to the discussion data D in the pointer map, and establishes three pointers from the data node D to the data node i, the data node k1, and the data node j1.
[0190] Furthermore, the processing device adds a table element corresponding to the representation information of the discussion data in the target index table corresponding to the data level of the discussion data based on the constructed pointer map.
[0191] In an embodiment of the present application, the processing device determines the statistical sub-table and clustering sub-table corresponding to the data level of the discussion data based on a pre-defined data level range corresponding to the table elements in each sub-table; then, the identification information of the discussion data is added to the statistical sub-table as the terminal table element in the statistical sub-table, and corresponding table elements are added to the corresponding clustering sub-table based on the temporal relationship between the discussion data and other discussion data belonging to the same parent discussion data.
[0192] It should be noted that, in an embodiment of the present application, according to actual processing needs, the processing device can pre-define sub-table categories for data statistics needs and clustering needs; and for each type of sub-table, determine the type of table elements included in the sub-table. In an embodiment of the present application, the defined sub-tables include at least a statistical sub-table for performing quantitative statistics on discussion data, and a clustering sub-table for clustering discussion data at a specified data level. In addition, in an embodiment of the present application, the specific form of expression of each sub-table can be a list, or a linked list, or a combination of a list and a linked list, which is not specifically explained in this application.
[0193] Specifically, the processing device can pre-define a corresponding designated level clustering sub-table for the discussion data of the designated data level associated with the target content; at the same time, pre-define a corresponding total statistics sub-table for the discussion data associated with the target content, and pre-define a corresponding designated level statistics sub-table for the discussion data of the designated data level associated with the target content.
[0194] In an embodiment of the present application, when the data hierarchy is divided into three levels, in order to achieve effective pulling and indexing of the three-level discussion data, five types of sub-tables can be specifically defined, including three types of clustering sub-tables and two types of statistical sub-tables. The three types of clustering sub-tables defined are respectively used for: clustering all first-level discussion data associated with the target content, clustering each second-level discussion data traced back to the same first-level discussion data, and clustering each lower-level discussion data traced back to the same second-level discussion data; the two types of statistical sub-tables defined are respectively used for: counting all discussion data associated with the target content, and counting the total number of each lower-level discussion data traced back to the same first-level discussion data. The five types of sub-tables involved are explained below:
[0195] It should be noted that in the implementation of this application, with regard to the principle of adding table elements to the clustering sub-table and the statistical sub-table, the table elements of the same data level in the clustering sub-table are usually arranged in the order of the time of publication, and since the function of the statistical sub-table is to count the total number of discussion data, new table elements can be added directly to the end of the table elements in the sub-table.
[0196] In particular, when the data hierarchy is divided into three levels, and the relationship between the data hierarchy and the total number of nested replies is: data hierarchy level 1 (relative to the target content, the total number of nested replies is 1 layer), data hierarchy level 2 (relative to the target content, the total number of nested replies is 2 layers), and data hierarchy level 3 (relative to the target content, the total number of nested replies is >= 3 layers). Then, in the embodiment of the present application, for the three-level discussion data, although the three-level discussion data covers each discussion data with a total number of nested replies of not less than 3 layers, since the highest data hierarchy is set to level 3, it is equivalent to setting each discussion data with a total number of nested replies of not less than 3 layers to be displayed flatly. Therefore, table elements can also be added to the corresponding subtable according to the chronological order in which the discussion data is released.
[0197] The clustering subtable used to index all the first-level discussion data associated with the target content can be recorded as "key=${ItemID}", which indicates that the title of the clustering subtable is the ID of the target content. It is used to cluster all the first-level discussion data generated for a certain target content (corresponding to the ItemID). Corresponding to different application scenarios, the ItemID can be any one of the contents such as article_id of the article, video_id of the video, and music_id of the audio. The clustering subtable can aggregate the first-level discussion data generated for the same target content.
[0198] The clustering subtable used to index and trace back to the same first-level discussion data for each second-level discussion data can be recorded as "key = ${first-level discussion data ID}", which represents that the title of the clustering subtable is the ID of a first-level discussion data, and is used to aggregate all the second-level discussion data whose parent discussion data is the first-level discussion data.
[0199] The clustering subtable used to index and trace back to the same first-level discussion data and each subordinate discussion data can be recorded as "key = ${first-level discussion data ID}", which represents that the title of the clustering subtable is the ID of a first-level discussion data, and is used to aggregate all subordinate discussion data of the first-level discussion data.
[0200] The statistical sub-table used to count all discussion data associated with the target content can be recorded as "key=${ItemID}", which represents that the title of the statistical sub-table is the ID of a target content and is used to count all discussion data associated with the target content. In this way, all discussion data generated for the same target content can be aggregated, and then a total discussion degree, number of discussions and other statistical information can be provided.
[0201] The statistical sub-table used to count the total number of subordinate discussion data that can be traced back to the same secondary discussion data can be recorded as "key=${secondary discussion data ID}", which represents an aggregate sub-table with the title being a secondary discussion data ID, and is used to count the total number of all subordinate discussion data that can be traced back to the secondary discussion data.
[0202] It should be noted that in the embodiments of the present application, the total number of pointers set for each data node in the pointer map, and the number of sub-table types constructed, can be set according to actual processing needs. For example, as determined in the above description of the present application, the divided data hierarchy is 3 levels, the total number of pointers corresponding to each data node can be 3, and the index table can include 5 types of sub-tables; the total number of pointers and sub-table types can be adaptively adjusted according to actual processing needs. For example, when the data hierarchy is set to 4 levels, pointers pointing to the third-level discussion data for traceability can be added in a targeted manner, as well as a statistical sub-table for statistically tracing the total number of fourth-level discussion data to the same third-level discussion data, etc. This application does not impose specific restrictions.
[0203] In this way, with the help of various configured sub-tables, it is possible to index discussion data related to the target content from the two perspectives of discussion data statistics and discussion data clustering. Moreover, based on the statistical sub-table created separately for data statistics, it can be expected that accurate quantity statistics can be achieved with the help of table elements in the statistical sub-table, avoiding misleading displays caused by inconsistencies between the presentable data and the data quantity statistics results.
[0204] The following is a specific example to illustrate the update process of the pointer map and the process of adding table elements in the index table. In this example, each data node includes three pointers, there are 5 types of sub-tables pre-defined, and the data hierarchy is divided into 3 levels. Figure 3e As shown in FIG, it is a schematic diagram of the process of updating the pointer map and constructing the index table in the embodiment of the present application. Figure 3e The specific processing process is described in detail.
[0205] according to Figure 3e As shown, when object 1 (actor) publishes the first-level discussion data i1 for the target content, the processing device adds a root data node corresponding to i1 in the pointer map, and then creates a target index table according to the sub-table type corresponding to i1. The target index table includes a clustering sub-table for clustering all the first-level discussion data associated with the target content, and a statistical sub-table for counting all the discussion data associated with the target content; thus, Figure 3e The pointer map and target index table shown in the first part.
[0206] Furthermore, after object 2 replies to i1 (the first-level discussion data that directly comments on the target content), the replied discussion data will be used as the second-level discussion data. The second-level discussion data is the lower-level discussion data belonging to the target content and the first-level discussion data i1. Therefore, the processing device adds data nodes corresponding to j1 and j2 in the pointer map, and adds a direct reply pointer and a root comment pointer pointing to i1 respectively; and then corresponding to the second-level discussion data, determines that the corresponding target index table includes: a statistical sub-table of all discussion data associated with the target content, a clustering sub-table of the second-level discussion data traced back to i1, and each lower-level discussion data clustering sub-table traced back to i1. Therefore, corresponding to the second-level discussion data j1 and j2, a cluster subtable of each second-level discussion data that is traced back to the same first-level discussion data, as well as a cluster subtable of each lower-level discussion data that is traced back to the same first-level discussion data, is added; on this basis, it can be determined that the target index table corresponding to the second-level discussion data includes 3 subtables. At this time, the index table corresponding to the target object includes 4 subtables, and then the table elements corresponding to j1 and j2 are added to the target index tables (3 subtables) of j1 and j2. In addition, the reason why j1 and j2 are processed at the same time may be that the release of j1 and j2 is within the same processing cycle. The processing device can periodically obtain the newly added discussion data for processing according to actual processing needs.
[0207] Then, when object 3 publishes the third-level discussion data k1 for replying to the second-level discussion data j1, the processing device adds a data node corresponding to k1 in the pointer map, and creates a direct reply pointer pointing to j1, a root comment pointer pointing to i1, and a root reply pointer pointing to j1; and then for the third-level discussion data, the target index table is determined to include: a statistical subtable for counting all discussion data associated with the target content, a clustering subtable of each subordinate discussion data traced back to i1, and a statistical subtable for counting the total number of each subordinate discussion data traced back to the same j1. Therefore, on the basis of the existing index table, a statistical subtable for counting the total number of each subordinate discussion data traced back to the same second-level discussion data is added. Moreover, the target index table currently determined for the third-level discussion data includes 3 subtables, and the index table currently created for the target content includes 5 subtables. Therefore, after adding the table element corresponding to k1 to the corresponding 3 subtables (target index table of k1), we get Figure 3e The pointer diagram and index table shown in the third part.
[0208] Afterwards, for the discussion data k2 published by object 4 to reply to the third-level discussion data k1, since the total number of data levels is 3, although k2 is the reply data of k1, the discussion data k3 is considered to belong to the same data level as k2. After the processing device obtains the discussion data k2, it adds a data node corresponding to the discussion data k2 in the pointer map, and establishes a direct reply pointer pointing to k1, a root comment pointer pointing to i1, and a root reply pointer pointing to j1. Then, corresponding to the discussion data k2, it is determined that the corresponding target index table includes: a statistical subtable for all discussion data associated with the target content, a clustering subtable of each subordinate discussion data traced back to i1, and a statistical subtable for the total number of each subordinate discussion data traced back to the same j1. Therefore, there is no need to add a new subtable at present. The target index table corresponding to the discussion data k2 includes 3 subtables, and the index table corresponding to the target content includes 5 index tables. Therefore, a table element corresponding to k2 is added to the corresponding 3 subtables (target index table of k2).
[0209] In this way, by adding table elements corresponding to discussion data in various sub-tables, classified indexing of discussion data can be achieved; in addition, since the established statistical sub-table and clustering sub-table respectively store table elements corresponding to discussion data, it is possible to achieve clustering of various types of discussion data while providing a processing basis for quickly pulling specified types of discussion data.
[0210] Step 303: The processing device characterizes the data relationship corresponding to the target content based on the pointer map and the target index table.
[0211] Specifically, the processing device adds corresponding data nodes and pointers in the pointer map based on the obtained discussion data, and adds corresponding table elements in the target index table. Then, based on the updated pointer map and index table, it represents the data relationship corresponding to the target content, that is, it represents the data relationship between the various discussion data associated with the target content. The various sub-tables included in the target index table are included in the index table corresponding to the target content. The target index table of the discussion data can be understood as: a collection of various sub-tables to which table elements corresponding to the discussion data need to be added. The index table of the target content can be understood as: a collection of various sub-tables with the discussion data associated with the target content as table elements.
[0212] In particular, when supporting the deletion of published discussion data, when the processing device receives a deletion instruction for the target discussion data, it is necessary to delete the corresponding content in the target index table corresponding to the target discussion data and the tree structure diagram created for the pointer map, wherein the received deletion operation may be initiated by the publishing object of the target discussion data, or may be initiated by the relevant management object when it determines that the target discussion data is abnormal.
[0213] It should be noted that in the embodiment of the present application, in order to maintain the integrity and data accuracy of the target discussion data deletion process, when a target discussion data is deleted, the final effect achieved is: the target discussion data and the subordinate discussion data that responds to the target discussion data are all deleted, among which other discussion data that needs to be deleted due to the deletion of the target discussion data is called linkage discussion data.
[0214] In an embodiment of the present application, in order to reduce the time consumption caused by the deletion of target discussion data and reduce the operation time during the data deletion process, data deletion can be jointly implemented by combining synchronous deletion operations and asynchronous deletion operations. Among them, the synchronous deletion operation refers to immediately deleting the corresponding data node in the tree structure diagram and deleting the corresponding table element in the target index table when a deletion instruction for the target discussion data is received; the asynchronous deletion operation refers to asynchronously deleting the subordinate discussion data belonging to this target discussion data relative to the received deletion instruction.
[0215] For example, the response time corresponding to a synchronous delete operation may be a few tenths of a millisecond after receiving the delete instruction, and the response time corresponding to an asynchronous delete operation may be several hundred milliseconds after receiving the delete instruction.
[0216] Specifically, the processing device obtains an index table created for each historical discussion data associated with the target content, and obtains a tree structure diagram associated with the target content established based on the pointer map; then, in the index table, the target table element corresponding to the target discussion data is deleted, and in the tree structure diagram, the tree node corresponding to the target discussion data is deleted; then, based on the pointer map, the linkage discussion data of the target discussion data is determined, and in the index table, the linkage table element corresponding to each linkage discussion data is deleted, and in the tree structure, the linkage tree node corresponding to each linkage discussion data is deleted.
[0217] In an embodiment of the present application, after the processing device receives a deletion instruction for the target discussion data, it obtains the index table currently created based on the various historical discussion data that have been acquired, and obtains a tree structure diagram established based on the updated pointer map. Among them, the processing device determines the corresponding target index table when obtaining each historical discussion data, and adds corresponding table elements to the corresponding target index table. Finally, each sub-table with added table elements can be obtained, and then based on the obtained each sub-table, an index table created for each historical discussion data associated with the target content is formed.
[0218] Furthermore, the processing device deletes the target table element corresponding to the target discussion data in the index table, and deletes the tree node corresponding to the target discussion data in the tree structure diagram, and then performs targeted deletion on the linkage discussion data affected by the target discussion data, wherein, when the linkage discussion data is traced back to the parent discussion data, it can be traced back to the target discussion data.
[0219] In this way, in the index table and tree structure diagram, when deleting the data relationship related to the target discussion data, the content related to the target discussion data is deleted first, and then the linked discussion data affected by the target discussion data is deleted, so that it is possible to quickly respond to the deletion instruction of the target discussion data and realize the deletion of the index relationship related to the target discussion data, so that the target discussion data will not be pulled when the discussion data is presented, thereby realizing a quick response to the deletion of the target discussion data.
[0220] In the embodiment of the present application, abstractly speaking, the presentation structure of the discussion data is similar to a multi-branch tree, but the index relationship is stored in the form of an index table, wherein the index table in the embodiment of the present application can specifically be an index list, or it can be an index linked list.
[0221] On this basis, when performing asynchronous deletion operations and deleting the data relationships corresponding to the linkage discussion data, the table elements that need to be deleted can be obtained through the page-turning operation. The page-turning operation refers to the process of storing data in pages and then processing the stored content page by page, and performing operations on the stored content of each page separately. The page-turning operation can split the deletion of large data into several subtasks, thereby better controlling the time and space resources consumed by the execution of each task.
[0222] Specifically, the processing device can store the index table in pages according to the historical discussion data of a specified level associated with the target content, wherein the storage content of each page includes the sub-table content associated with at least one specified level of historical discussion data; and then, for the storage content of each page, delete the linkage table elements corresponding to the linkage discussion data included in the storage content.
[0223] When the index table is stored in pages, the processing device splits the index table into different pages for storage according to each secondary historical discussion data associated with the target content, wherein the storage content of each page includes the sub-table content associated with at least one specified level of historical discussion data, and the storage content included in different pages does not have any intersection.
[0224] When performing paging processing, there are several paging methods including but not limited to the following:
[0225] Method 1: Complete paging operations based on the specified level.
[0226] After the processing device receives a deletion instruction for the target discussion data, when performing an asynchronous deletion operation, when the index table is stored in pages, the processing device can configure the number of discussion data of the specified level included in each page after determining the specified level referenced by the paging. The specified level on which the paging is based is set according to actual processing needs, and this application does not impose specific restrictions.
[0227] For example, assuming that the total number of data levels is set to 3, paging storage can be set based on the second-level discussion data, and each sub-table content can be set to include two related second-level discussion data.
[0228] Method 2: Complete multiple paging operations based on the specified level and number of table elements.
[0229] After the processing device receives a deletion instruction for the target discussion data, during the asynchronous deletion operation, on the basis of paging the index table according to the number of discussion data at the specified data level, the storage content can be further paginated according to the number of table elements of the specified sub-table included in the storage content of each page to obtain the content of each sub-page.
[0230] It should be noted that, in an embodiment of the present application, when performing a paging operation, after determining the data level on which the paging is based, the sub-table contents associated with the single discussion data belonging to the data level can be stored in one page.
[0231] In specific implementation, whether to perform further paging processing can be determined based on the relationship between the number of table elements included in the storage content and the set threshold. When it is determined that the number of table elements included in the sub-table specified by the current page reaches the set threshold, the paging level based on which the sub-page paging is performed can be selectively determined in the storage content of the current page; and then the sub-page is configured to include sub-table content associated with discussion data of at least one classification level.
[0232] For example, assuming that the total number of data levels is set to 3, paging storage is first implemented based on the second-level discussion data, and the storage content of each page is set to include the sub-table content associated with two second-level discussion data; after determining that the total number of table elements of the N specified sub-tables of the current page exceeds the set threshold, or the total number of all table elements included in the current page exceeds the set threshold, where N is a positive integer not less than 1; then further paging operations can be performed on the storage content of the current page based on the second-level discussion data, or other specified levels of discussion data.
[0233] Method 3: Complete the paging operation based on the total number of table elements in the index table.
[0234] Specifically, the processing device can determine whether to perform a paging operation based on the total number of table elements included in the index table, wherein the purpose of the paging operation is to split the deletion task of the linkage discussion data to reduce the difficulty of processing the deletion task.
[0235] When the processing device determines that the total number of table elements included in the index table is lower than the set value, paging operation may not be performed. Otherwise, processing methods one and two may be used, or paging may be performed simply based on the number of elements.
[0236] For example, the processing device may set each sub-table of each page to include M elements. Then, the index table may be directly split according to the number of table elements to obtain individual index tables.
[0237] In this way, by means of the paging methods proposed in methods 1 to 3, paging storage of the content in the index table can be achieved, reducing the processing pressure when performing subsequent asynchronous deletion operations.
[0238] Then, the processing device gradually deletes the linkage discussion data of each data level involved in the storage content of each page in a bottom-up manner according to the corresponding data level based on the storage content of each page.
[0239] When operating on the stored content of each page, the processing device determines the target linkage discussion data associated with the target discussion data and having a higher data level than the target discussion data based on the pointer map, wherein a higher data level indicates that the corresponding discussion data has more nested reply levels relative to the target content; then, in the stored content, the linkage table elements corresponding to each target linkage discussion data are deleted in turn in the order of data level from high to low.
[0240] Specifically, the processing device determines the target linkage discussion data with a higher data level than the target discussion data in the storage content of the current page based on the pointer map, the data level corresponding to the target discussion data, and the storage content of the current page; and then deletes the table elements corresponding to the target linkage discussion data at each data level in the storage content of the current page in order of data levels from high to low.
[0241] In this way, with the help of page turning operations and the method of deleting linkage discussion data from high to low, the storage content of each page can be deleted starting from the bottom-level nested linkage discussion data, which is equivalent to deleting the linkage discussion data in sequence from high to low according to the data hierarchy corresponding to the linkage discussion data. The order in which the linkage discussion data is deleted conforms to the clustering rules of each discussion data identifier in the index table, which facilitates the rapid positioning of the table elements that need to be deleted and improves the deletion efficiency of the discussion data.
[0242] In addition, in an embodiment of the present application, when the processing device deletes the linkage tree node corresponding to each linkage discussion data in the tree structure diagram, it performs the following operations for the storage content of each page: determines the target linkage discussion data included in the storage content; and then deletes the linkage tree nodes corresponding to the target linkage discussion data at each depth value in the tree structure diagram in descending order of the corresponding depth values, wherein the depth value of the tree node corresponds to the same data level of the corresponding discussion data.
[0243] Specifically, when deleting the data relationship in the tree structure diagram, the processing device determines the data level corresponding to each target linkage discussion data, and then determines the tree node corresponding to the target linkage discussion data and the depth value in the tree structure diagram according to the correspondence between the data level and the depth value; then, the processing device deletes the linkage tree nodes corresponding to the target linkage discussion data under each depth value in order from high to low depth values.
[0244] It should be noted that, in the embodiment of the present application, taking the data hierarchy with three levels as an example, the three-level discussion data limited by the three-level data hierarchy corresponds to a total number of nested replies that is not less than the reply level threshold. For the three-level discussion data, when deleting the discussion data, only the discussion data itself is deleted. Since there is no discussion data at the next level, the corresponding linkage discussion data is not considered.
[0245] In this way, the deletion operation of the data relationship in the tree structure diagram is equivalent to paging. As the table elements in the index table are deleted, the corresponding tree nodes are also deleted, which is equivalent to splitting the tree structure diagram, so that only a small range of the tree structure needs to be processed separately each time, which reduces the processing scope of the deletion task. The gradual deletion of tree nodes is equivalent to pruning the tree structure diagram, reducing the scale of the tree structure diagram. In addition, since the depth and scale of the tree structure diagram directly affect the number of operations of the deletion task, the number of operations of the deletion task can be greatly reduced. At the same time, the risk of re-performing all deletion tasks due to sudden failures can be avoided, so that sudden failures will only affect the deletion operations of a small part of the tree structure, but will not affect the completed deletion operations.
[0246] Based on the above invention, Figure 4a As shown, it is a schematic diagram of the deletion process of the data relationship in the embodiment of the present application. Figure 4a , further explains the process of deleting data relationships:
[0247] Step 401: After receiving a deletion instruction for target discussion data associated with target content, the processing device deletes the target table element corresponding to the target discussion data in the index table associated with the target content.
[0248] Specifically, after the processing device receives a deletion instruction for the target discussion data associated with the target content, it immediately deletes the target table element corresponding to the target discussion data in the index table, where the table element may exist in the index table in the form of the ID of the discussion data, which is used to represent the discussion data.
[0249] In some possible embodiments of the present application, when executing the deletion operation of the target table element, the processing device can determine the data level corresponding to the target discussion data based on the tree structure diagram constructed for the pointer map, and then determine the sub-table associated with the target discussion data in the index table, and then directly delete the corresponding target table element in the corresponding sub-table.
[0250] In some other possible embodiments of the present application, when executing a deletion operation on target discussion data, the processing device may directly search for the target table element in the index table and delete the corresponding target table element.
[0251] In this way, for the quick deletion of the target table element, the operation of deleting the target table element can be regarded as being carried out synchronously with the target discussion data deletion instruction initiated by the relevant object, so that in the presentation process of the relevant object perspective, the deleted target discussion data will not be presented immediately.
[0252] Step 402: The processing device determines the linked discussion data under the target discussion data based on the tree structure diagram associated with the target content, and deletes the content corresponding to the linked discussion data of each data level in the index table and the tree structure diagram in descending order of the data levels.
[0253] Specifically, after the processing device deletes the target discussion data in the index table, it can determine the linked discussion data under the target discussion data based on the tree structure diagram associated with the target content, wherein the data hierarchy is used to characterize the nested reply relationship between the discussion data. The process of determining the data hierarchy and establishing the tree structure diagram based on the pointer map has been described in detail in the above content and will not be repeated here.
[0254] Furthermore, the processing device deletes the content corresponding to the linkage discussion data of each data level in the index table and the tree structure diagram in descending order of the data levels.
[0255] It should be noted that, in combination with actual processing needs, when presenting discussion data related to the target content in the future, displaying the discussion data in three data levels is in line with the browsing habits of the relevant objects. Therefore, in the following description of this application, the relevant deletion process will be explained using a total of three data levels as an example. The reason for deleting the linked discussion data in order from high to low data levels is that by performing the deletion operation data level by data level, the deletion task can be completed regularly and progressively.
[0256] In addition, in the following description, only the five sub-tables included in the index table are used as an example to illustrate the deletion process of the linked discussion data, wherein the five sub-tables include: statistical sub-tables of discussion data of other levels traceable to the same first-level discussion data, clustering sub-tables of second-level discussion data traceable to the same first-level discussion data, clustering sub-tables of third-level discussion data traceable to the same second-level discussion data, clustering sub-tables of first-level discussion data, and statistical sub-tables of discussion data associated with the target content.
[0257] In this way, with the help of the five types of sub-tables configured in the index table, on the one hand, it can meet the statistical needs of discussion data in the case of three-layer data hierarchy, and on the other hand, it can realize the clustering of discussion data at a specified level, so that effective quantity statistics and content pulling can be carried out based on the index table later.
[0258] Considering that in the scenario where a deletion operation is performed on different target discussion data, the target discussion data to be deleted may belong to different data hierarchies, the following possible situations exist when the deletion operation is performed asynchronously on the linked discussion data:
[0259] Case 1: The target discussion data is first-level discussion data.
[0260] After the processing device determines that the target discussion data is the first-level discussion data, when performing a deletion operation on the linkage discussion data, the processing device will store the index table after deleting the target table element in pages according to the historical discussion data of the specified level, wherein the storage content of each page includes the sub-table content associated with at least one specified level of historical discussion data; for the storage content of each page, after deleting the linkage table elements belonging to the third-level discussion data and deleting the corresponding linkage tree nodes in the tree structure diagram, delete the linkage table elements belonging to the second-level discussion data and delete the corresponding linkage tree nodes in the tree structure diagram.
[0261] It should be noted that the method of paging the index table after deleting the target table element has been described in detail in the above processing process and will not be repeated here.
[0262] Specifically, when the processing device deletes the linkage table elements belonging to the third-level discussion data, it traverses the second-level discussion data clustering subtable corresponding to the target discussion data to determine the second-level discussion data below the target discussion data, and traverses the third-level discussion data clustering subtable corresponding to each second-level discussion data to determine the third-level discussion data traceable to the target discussion data; then, it deletes the linkage table elements corresponding to the third-level discussion data in the discussion data statistics subtable, the other-level discussion data clustering subtable corresponding to the target discussion data, and the corresponding third-level discussion data clustering subtable.
[0263] Furthermore, when the processing device deletes the linkage table elements belonging to the secondary discussion data, it deletes the linkage table elements corresponding to the secondary discussion data below the target discussion data in the discussion data statistics subtable, the other level discussion data clustering subtable corresponding to the target discussion data, and the corresponding secondary discussion data clustering subtable.
[0264] The following describes the deletion process when the target discussion data i0 is first-level discussion data with reference to the accompanying drawings:
[0265] See Figure 4b As shown, it is a schematic diagram of the content in the index table after the synchronous deletion operation in the embodiment of the present application. When the processing device receives the deletion instruction for the target discussion data i0, the processing device synchronously removes the target discussion data i0 from each sub-table and initiates the process of deleting the lower-level linkage discussion data of the target discussion data i0, and obtains Figure 4b The tree structure diagram and index table are shown.
[0266] Furthermore, in order to achieve efficient deletion operations, the contents of the index table are processed in batches to obtain paged storage contents. Figure 4c As shown, it is a schematic diagram of the paging storage content in the embodiment of the present application. Figure 4c As shown, the processing device divides the specified number of secondary discussion data into one page according to the number of secondary discussion data under the target discussion data i0, obtaining two pages of content, and then splits the contents of each sub-table included in the index table according to the secondary discussion data corresponding to each page, so that the storage content of each page after the split does not include any content related to the secondary discussion data of another page. Figure 4c As shown, assuming that the sub-table contents corresponding to j1 and j2 are divided into one page, and the sub-table contents corresponding to j3 are divided into one page, there are Figure 4c The indicated pagination content.
[0267] Then, see Figure 4d As shown in FIG, it is a schematic diagram of the process of deleting the first page of linkage discussion data in this embodiment. Figure 4d As can be seen from the illustrated content, when the processing device determines that the current page (denoted as page1) includes the sub-table content corresponding to the second-level discussion data j1 and j2, the processing device traverses the third-level discussion data clustering sub-table under j1 and j2 to determine the third-level discussion data k1 and k2 under j1; thereafter, the processing device deletes k1 and k2 from the "all discussion data statistical sub-table associated with ItemID", and then deletes k1 and k2 from the "lower-level discussion data clustering sub-table of i0". After completing the above two steps of removal operations, k1 and k2 can be removed from the statistical count and external related sub-tables, and then k1 and k2 can be deleted from the "three-level discussion data clustering sub-table under j1".
[0268] Based on the above removal operations, on page 1, the third-level discussion data associated with i0 is removed, and then the second-level discussion data j1 and j2 are removed in descending order of data hierarchy. Specifically, the processing device removes j1 and j2 from the "All Discussion Data Statistics Subtable Associated with ItemID," then removes j1 and j2 from the "Sub-level Discussion Data Clustering Sub-table of i0," and then, on this basis, removes j1 and j2 from the "Second-level Discussion Data Sub-table Under i0." In this way, the removal of the second-level discussion data on page 1 is completed.
[0269] In this way, after the removal of historical discussion data of each data level in page1 is completed in descending order of data level, historical discussion data i1 only exists in the "all discussion data statistics subtable associated with ItemID" in page1.
[0270] With attached Figure 4d For corresponding reference, see Figure 4e As shown, it is a schematic diagram of the pruning process of the tree structure diagram in the embodiment of the present application, which is similar to the attached Figure 4d Corresponding to the process of gradually removing the target linkage discussion data, for the tree structure diagram, the processing device prunes the contents of the tree structure diagram in descending order of depth value. Specifically, tree nodes k1 and k2 with a depth value of 3 will be pruned first, followed by j1 and j2 with a depth value of 2. The tree node corresponding to the target discussion data will be deleted after all other lower-level tree nodes have been deleted, based on actual processing needs.
[0271] Same as the above process, see Figure 4f As shown, it is a schematic diagram of the process of deleting the second page linkage discussion data in the embodiment of the present application. Figure 4f As shown in the content, when the processing device determines that the current page (denoted as page2) includes the sub-table content corresponding to the second-level discussion data j3, the processing device traverses the third-level discussion data clustering sub-table under j3 to determine the third-level discussion data k3 under j1; thereafter, the processing device deletes k3 from the "all discussion data statistical sub-table associated with ItemID", and then deletes k3 from the "lower-level discussion data clustering sub-table of i0". After completing the above two steps of removal operations, k3 can be removed from the statistical count and external related sub-tables, and then k3 can be deleted from the "three-level discussion data clustering sub-table under j3".
[0272] Based on the above removal operations, the third-level discussion data associated with i0 on page 2 can be removed, and then the second-level discussion data j3 can be removed in descending order of data hierarchy. Specifically, the processing device removes j3 from the "All Discussion Data Statistics Subtable Associated with ItemID," then from the "Sub-Discussion Data Clustering Sub-Table for i0," and then from the "Second-Level Discussion Data Sub-Table Under i0." In this way, the removal of the second-level discussion data on page 2 is complete.
[0273] In this way, when the target discussion data is the first-level discussion data, the linkage table elements in each page can be deleted step by step by first deleting the third-level discussion data under the target discussion data and then deleting the second-level discussion data under the target discussion data.
[0274] Case 2: The target discussion data is secondary discussion data.
[0275] After the processing device determines that the target discussion data is the first-level discussion data, when performing a deletion operation on the linkage discussion data, the index table after deleting the target table element is stored in pages according to the historical discussion data of the specified level, wherein the storage content of each page includes the sub-table content associated with at least one specified level of historical discussion data; then, for the storage content of each page, the linkage table elements belonging to the third-level discussion data are deleted, and the corresponding linkage tree nodes are deleted in the tree structure diagram.
[0276] Specifically, the processing device determines the third-level discussion data under the target discussion data, and deletes the linkage table elements corresponding to the third-level discussion data in the other-level discussion data clustering subtable and the discussion data statistics subtable containing the target discussion data.
[0277] The following is combined with Figure 4g , for an explanation of the process of deleting secondary discussion data, see Figure 4g As shown, it is a schematic diagram of the process of deleting the secondary discussion data in the embodiment of the present application. After completing the synchronous deletion operation of the secondary discussion data j1, the processing device determines the third-level discussion data k1 and k2 under j1, and then deletes k1 and k2 from the "lower-level discussion data clustering subtable of i0"; then, the processing device deletes k1 and k2 from the "all discussion data statistics subtable associated with ItemID"; and then, the processing device deletes k1 and k2 from the "third-level discussion data clustering subtable under j1". It can then be obtained Figure 4g The tree structure diagram and the processed sub-table content are shown, wherein the tree node corresponding to the target discussion data can be deleted in the end according to the actual processing needs.
[0278] Case 3: The target discussion data is the third-level discussion data.
[0279] In this case, since the target table element corresponding to the target discussion data has been deleted during the synchronous deletion process, and there is no discussion data below the third-level discussion data, there is no corresponding linkage discussion data, and the relevant linkage table element deletion operation will not be performed.
[0280] Based on the above-mentioned invention content, when the processing device receives a presentation request for each discussion data associated with the target content, the processing device obtains the index table associated with the target content, and determines the table elements under each data level associated with the target content based on the index table, and determines the total number of historical discussion data belonging to the specified level, wherein the index table is created based on the reply relationship between each discussion data; then the historical discussion data content corresponding to the table elements under each data level is obtained respectively, and the historical discussion data content and the total number of historical discussion data under each data level are displayed according to the preset data display format.
[0281] Specifically, in the embodiment of the present application, the index table only stores identification information for historical discussion data, while the specific content of the historical discussion data, the corresponding publisher information, and the publisher information corresponding to the parent discussion data are all stored separately in a separate storage area. When the processing device needs to pull historical discussion data, it needs to obtain detailed information about the historical discussion data based on the index information in the index table according to actual display needs, and then present it to the relevant access objects in a targeted manner.
[0282] It should be noted that when the target content and discussion data involved in the embodiments of this application are published on a public platform, since they do not involve the relevant privacy content of the publishing object, and in order to provide a basis for data recovery and compliance review, the corresponding tree nodes in the tree structure diagram can be deleted, and the corresponding table elements in the index table can be deleted. In addition, in some possible application scenarios, other content related to the discussion data can also be deleted according to actual processing needs, and this application does not impose specific restrictions.
[0283] For example, see Figure 5a As shown, it is a schematic diagram showing a historical discussion data in an embodiment of the present application. Figure 5a The display format shown can be applied to video playback scenarios including short video playback. Assuming that the display mode is set to secondary display, that is, the comment posts with direct comments are used as a display data level, so that each comment post is displayed flatly; the first-level reply data of the comment post, the second-level reply data for the first-level reply data, and the third-level reply data for the second-level reply data are used as a display data level, so that the reply data at each level are displayed flatly, then the following can be displayed: Figure 5aAssume that the data level set in this application is 3 levels, with 5 types of sub-tables. For comment posts, it is equivalent to the first-level discussion data; for the first-level reply data, it is equivalent to the second-level discussion data; for the second-level reply data and the reply data above the second level, it is equivalent to the third-level discussion data.
[0284] Then, in the presentation Figure 5a When the content indicated is displayed, the processing device first determines the clustering subtable representing all the first-level discussion data under the target content from the index table, and obtains the statistical subtable of the total number of all discussion data under the statistical target content, determines the total number of current comment replies to the video, and determines the first-level discussion data (comment posts) to be displayed in a tiled manner; when it is determined to send a reply data pull request for a first-level discussion data, the index determines the second-level discussion data under the first-level discussion data, and pulls the third-level discussion data of each second-level discussion data information, and displays the second-level discussion data and the third-level discussion data in a tiled manner, wherein each discussion data is marked with the object of the targeted reply when displayed.
[0285] For example, see Figure 5b As shown, it is a schematic diagram showing a historical discussion data in an embodiment of the present application. Figure 5b The display format shown can be applied to video playback scenarios including medium and long videos. Assuming the display method is set to three-level display, the comment posts that are directly commented on are used as a display data level, and the comment posts are displayed flatly; the first-level reply data of the reply to the comment post is used as a display data level, and the first-level reply data for the same comment post is set to be displayed flatly; the n-level replies, including the second-level reply data that replies to the first-level reply data and the third-level reply data that replies to the second-level reply data, are used as a display data level, so that the reply data of the second level and above are set to be displayed flatly.
[0286] Assuming that the data level set in this application is level 3, there are 5 types of sub-tables. For comment posts, it is equivalent to level 1 discussion data; for level 1 reply data, it is equivalent to level 2 discussion data; for level 2 replies and reply data above level 2, it is equivalent to level 3 discussion data.
[0287] Then, in the presentation Figure 5bWhen the content of the illustration is displayed, the processing device pulls the first-level discussion data from the index table and displays it in a tiled manner. When it is determined that a display request for the second-level discussion data under the first-level discussion data is received, the corresponding second-level discussion data under the first-level discussion data recorded in the index table are pulled for tiled display. When discussion data with multiple reply levels is to be displayed, the third-level discussion data under the second-level discussion data is continued to be pulled according to the index table. The discussion data is marked with the objects of the targeted replies when it is presented.
[0288] In this way, the index table proposed in this application can be applied to a variety of display scenarios, providing index support for pulling discussion data, greatly ensuring the validity of the pulled data and the validity of the presented statistical results.
[0289] Based on the technical solution proposed in this application, it is necessary to understand that, in the actual processing process, the existence form and content coverage of the index table can be configured according to the display structure of the discussion data, so that the construction of the index table is adapted to the actual processing needs. For example, the current three-level data hierarchy can meet the demand for presenting discussion data in a tree structure, and the sub-table types included in the index table can be configured for the three-level data hierarchy. The storage of the index table is convenient and can be completed with the help of conventional storage middleware with lists or databases that support index lists, ensuring the feasibility and convenience of storing objectively existing data relationships. In addition, with the help of the structure of the index linked list or index list, the operation time for the data can be greatly reduced, the complexity of adding, deleting, modifying and checking is reduced, and it has the advantages of less time consumption and high efficiency.
[0290] In addition, the index table proposed in this application not only supports the common pull-list needs, that is, expanding the lower-level comments through the reply or comment ID of the upper level; but also takes into account that the total number of discussion data for the target content can reflect the popularity of the target content, and the total number of discussion data obtained needs to be displayed. Therefore, by constructing an index of all discussion data under the target content, it is possible to better manage the total number of discussion data and aggregate related discussion data. In scenarios where discussion data statistics are required, the total number of discussion data can be based on a basis, rather than simply maintaining a number.
[0291] At the same time, at the deletion level of discussion data, compared with the existing technical defects in which the recursive downward traversal in storage design has a large time complexity and can only delete itself but cannot remove the lower-level discussion data affected by the linkage, this application ensures the accuracy of the total number and external data, rather than simply performing a simple subtraction operation, thereby ensuring the consistency between the external number and the number of contents displayed in the list.
[0292] Furthermore, in this application, for the maintained index table and tree structure diagram, when it comes to adding and deleting discussion data, especially deleting discussion data, for deleting the tree nodes corresponding to the discussion data in the tree structure diagram, it is essentially a process of traversing and executing deletion operations in batches for the underlying storage. When faced with the deletion of some large tree structures, this application proposes to use a page-turning operation to divide the tree structure process into the deletion of multiple sub-tree structures. This makes the time and space occupied by batch deletion operations relatively controllable, ensuring the success rate of the deletion operation.
[0293] Secondly, for the page turning + bottom-up deletion scheme proposed in this application, it is possible to simplify the deletion of the tree structure, reduce the repeated execution consumption of the deletion operation, and improve the success rate. For example, in the process of deleting discussion data, after traversing the tree structure and deleting the tree nodes corresponding to the three-level discussion data, an error occurs in a certain link of the deletion process or a problem occurs in the server, and the deletion process needs to be restarted. At this time, when the relevant discussion data is pulled again, since the tree nodes corresponding to the three-level discussion data have been deleted and extracted from the storage, it is equivalent to reducing the scale of the tree structure and reducing the level of the tree structure. Since the size of the tree structure is related to the scale of the deletion task and the number of operations, considering that in the process of turning the page and traversing the first-level replies, the first-level replies that have been traversed and their replies have been deleted from the storage, it is not conducive to the deletion operation. On this basis, the present application adopts a bottom-up + page turning deletion processing method, which is equivalent to reducing the tree structure by pruning or reducing the level. Assuming that some deletion operations fail, repeated deletion operations can be performed on the unfinished deletion tasks without reprocessing them all.
[0294] Based on the same inventive concept, see Figure 6 As shown, it is a logical structure diagram of a data relationship processing device in an embodiment of the present application. The data relationship processing device 600 includes an obtaining unit 601, a creating unit 602, and a characterizing unit 603, wherein:
[0295] An obtaining unit 601 is configured to obtain discussion data associated with target content and determine a data hierarchy of the discussion data with respect to the target content, wherein the data hierarchy is used to represent a nested reply relationship between the discussion data;
[0296] A creation unit 602 is used to create data nodes corresponding to the discussion data in a preset pointer map according to the data hierarchy of the discussion data, and to add table elements corresponding to the identification information of the discussion data in a target index table corresponding to the data hierarchy, wherein each data node is associated with a pointer to other discussion data of the specified data hierarchy, and the target index table includes at least a statistical subtable for counting the total number of discussion data of a specified type, and a clustering subtable for clustering discussion data of the specified hierarchy;
[0297] The representation unit 603 is used to represent the data relationship corresponding to the target content based on the pointer map and the target index table.
[0298] Optionally, when creating a data node corresponding to the discussion data in the preset pointer map, the creating unit 602 is configured to:
[0299] Establishing data nodes corresponding to discussion data in a preset pointer graph;
[0300] According to the set pointer pointing relationship, other discussion data that have a pointer pointing relationship with the discussion data are determined, and pointers between corresponding data nodes are created in the pointer map, where the pointer pointing relationship is used to represent the reply relationship between discussion data at different data levels.
[0301] Optionally, when creating pointers between corresponding data nodes, the creation unit 602 is used to: point to a root comment pointer pointing to the first-level discussion data of the traceability, a direct reply pointer pointing to the parent discussion data of the reply, and a root reply pointer pointing to the second-level discussion data of the traceability; wherein, the first-level discussion data is the historical discussion data that directly replies to the target content, the second-level discussion data is the historical discussion data that replies to the first-level discussion data, and the parent discussion data is the historical discussion data for targeted replies.
[0302] Optionally, when adding a table element corresponding to the identification information of the discussion data to the target index table corresponding to the data level, the creating unit 602 is configured to:
[0303] According to the predefined data level range corresponding to the table elements in each sub-table, determine the statistical sub-table and clustering sub-table corresponding to the data level of the discussion data;
[0304] The identification information of the discussion data is added to the statistical subtable as the terminal table element in the statistical subtable, and corresponding table elements are added to the corresponding clustering subtable based on the temporal relationship between the discussion data and other discussion data belonging to the same parent discussion data.
[0305] Optionally, before determining the statistical sub-table and clustering sub-table corresponding to the data level of the discussion data according to the predefined data level range corresponding to the table elements in each sub-table, the creating unit 602 is further configured to:
[0306] Predefine the corresponding designated level clustering sub-table for the discussion data of the designated data level associated with the target content;
[0307] A corresponding total amount statistics sub-table is defined in advance for the discussion data associated with the target content, and a corresponding designated level statistics sub-table is defined in advance for the discussion data of the designated data level associated with the target content.
[0308] Optionally, upon receiving a request to present each historical discussion data associated with the target content, the apparatus further includes a processing unit 604 configured to:
[0309] Obtaining an index table associated with the target content, and determining, based on the index table, table elements at each data level associated with the target content, and determining the total number of historical discussion data belonging to the specified level, wherein the index table is created based on reply relationships between the discussion data;
[0310] The historical discussion data content corresponding to the table elements under each data level is obtained respectively, and the historical discussion data content and the total number of historical discussion data under each data level are displayed according to the preset data display format.
[0311] Optionally, when determining the data level of the discussion data with respect to the target content, the obtaining unit 601 is configured to:
[0312] Based on the reply relationship between the discussion data and the acquired historical discussion data, the total number of nested reply layers of the discussion data relative to the target content is determined by tracing back to the source;
[0313] If it is determined that the total number of nested reply levels is higher than the set reply level threshold, determining the data level of the discussion data with respect to the target content based on the reply level threshold;
[0314] If it is determined that the total number of nested reply levels is not higher than the reply level threshold, the data level of the discussion data with respect to the target content is determined based on the total number of nested reply levels.
[0315] Optionally, after receiving a deletion instruction for the target discussion data, the processing unit 604 in the device is further configured to:
[0316] Obtaining an index table created for each historical discussion data associated with the target content, and obtaining a tree structure diagram associated with the target content established based on the pointer map;
[0317] In the index table, delete the target table element corresponding to the target discussion data, and in the tree structure diagram, delete the tree node corresponding to the target discussion data;
[0318] According to the pointer map, the linkage discussion data under the target discussion data is determined, and the linkage table element corresponding to each linkage discussion data is deleted in the index table, and the linkage tree node corresponding to each linkage discussion data is deleted in the tree structure.
[0319] Optionally, when deleting the linkage table element corresponding to each linkage discussion data in the index table, the processing unit 604 is configured to:
[0320] According to the historical discussion data of a specified level associated with the target content, the index table is stored in pages, wherein the storage content of each page includes the content of a sub-table associated with at least one historical discussion data of the specified level;
[0321] For each page of stored content, the linkage table element corresponding to the linkage discussion data included in the stored content is deleted.
[0322] Optionally, when deleting the linkage table element corresponding to the linkage discussion data included in the stored content, the processing unit 604 is configured to:
[0323] According to the pointer graph, target linkage discussion data associated with the target discussion data and having a higher data level than the target discussion data is determined, wherein a higher data level indicates that the corresponding discussion data has more nested reply levels relative to the target content;
[0324] In the order of data levels from high to low, the linkage table elements corresponding to each target linkage discussion data are deleted in sequence in the storage content.
[0325] Optionally, when deleting the linkage tree node corresponding to each linkage discussion data in the tree structure diagram, the processing unit 604 is configured to:
[0326] For each page of stored content, perform the following operations:
[0327] determining target linkage discussion data included in the stored content;
[0328] In the tree structure diagram, the linkage tree nodes corresponding to the target linkage discussion data at each depth value are deleted in sequence according to the corresponding depth values from high to low, wherein the depth value of the tree node corresponds to the data level of the corresponding discussion data.
[0329] Based on the same inventive concept, see Figure 7 As shown, it is a logical structure diagram of a data relationship processing device in an embodiment of the present application. The data relationship processing device 700 includes a receiving unit 701 and a deleting unit 702, wherein:
[0330] The receiving unit 701 is configured to, after receiving a deletion instruction for target discussion data associated with target content, delete a target table element corresponding to the target discussion data in an index table associated with the target content;
[0331] The deletion unit 702 is used to determine the linked discussion data under the target discussion data according to the tree structure diagram associated with the target content, and to delete the content corresponding to the linked discussion data of each data level in the index table and the tree structure diagram in order from high to low data levels, wherein the data level represents the nested reply relationship between the discussion data.
[0332] Optionally, three data levels are set for the discussion data associated with the target content, and the index table includes statistical sub-tables of discussion data of other levels traceable to the same first-level discussion data, clustering sub-tables of second-level discussion data traceable to the same first-level discussion data, clustering sub-tables of third-level discussion data traceable to the same second-level discussion data, first-level discussion data clustering sub-tables, and statistical sub-tables of discussion data associated with the target content.
[0333] Optionally, the target discussion data is first-level discussion data; when deleting the content corresponding to the linkage discussion data of each data level in the index table and the tree structure diagram in descending order of the data levels, the deleting unit 702 is used to:
[0334] According to the historical discussion data of the specified level, the index table after deleting the target table element is stored in pages, wherein the storage content of each page includes the sub-table content associated with at least one historical discussion data of the specified level;
[0335] For the storage content of each page, delete the linkage table elements belonging to the third-level discussion data, and delete the corresponding linkage tree nodes in the tree structure diagram, then delete the linkage table elements belonging to the second-level discussion data, and delete the corresponding linkage tree nodes in the tree structure diagram.
[0336] Optionally, when deleting the linkage table element belonging to the third-level discussion data, the deleting unit 702 is used to:
[0337] Traversing the secondary discussion data clustering subtable corresponding to the target discussion data to determine the secondary discussion data below the target discussion data, and traversing the tertiary discussion data clustering subtable corresponding to each secondary discussion data to determine the tertiary discussion data traceable to the target discussion data;
[0338] Delete the linkage table elements corresponding to the third-level discussion data in the discussion data statistics sub-table, the other-level discussion data clustering sub-table corresponding to the target discussion data, and the corresponding third-level discussion data clustering sub-table respectively.
[0339] Optionally, when deleting the linkage table element belonging to the secondary discussion data, the deleting unit 702 is configured to:
[0340] Delete the linkage table elements corresponding to the secondary discussion data below the target discussion data in the discussion data statistics subtable, the other level discussion data clustering subtable corresponding to the target discussion data, and the corresponding secondary discussion data clustering subtable respectively.
[0341] Optionally, the target discussion data is secondary discussion data; when deleting the content corresponding to the linkage discussion data of each data level in the index table and the tree structure diagram in descending order of the data levels, the deleting unit 702 is used to:
[0342] According to the historical discussion data of the specified level, the index table after deleting the target table element is stored in pages, wherein the storage content of each page includes the sub-table content associated with at least one historical discussion data of the specified level;
[0343] For each page of stored content, the linkage table elements belonging to the third-level discussion data are deleted, and the corresponding linkage tree nodes are deleted in the tree structure diagram.
[0344] Optionally, when deleting the linkage table element belonging to the third-level discussion data, the deleting unit 702 is used to:
[0345] Determine the third-level discussion data under the target discussion data, and delete the linkage table elements corresponding to the third-level discussion data in the other-level discussion data clustering subtable containing the target discussion data and the discussion data statistical subtable.
[0346] After introducing the method and apparatus for processing data relations according to an exemplary embodiment of the present application, an electronic device according to another exemplary embodiment of the present application is introduced next.
[0347] Those skilled in the art will appreciate that various aspects of the present application can be implemented as systems, methods, or program products. Therefore, various aspects of the present application can be specifically implemented in the following forms: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation that combines hardware and software aspects, which may be collectively referred to herein as a "circuit," "module," or "system."
[0348] Based on the same inventive concept as the above method embodiment, an electronic device is also provided in the embodiment of the present application, Figure 8, which is a schematic diagram of a hardware structure of an electronic device to which an embodiment of the present application is applied, wherein the electronic device 800 may include at least a processor 801 and a memory 802. The memory 802 stores program code, which, when executed by the processor 801, causes the processor 801 to perform the steps of processing any of the above-mentioned data relationships.
[0349] In some possible implementations, the computing device according to the present application may include at least one processor and at least one memory. The memory stores program code, and when the program code is executed by the processor, the processor executes the processing steps of the data relationship according to various exemplary embodiments of the present application described above in this specification. For example, the processor may execute the following steps: Figure 3a 、 4a Follow the steps shown in .
[0350] Refer to the following Figure 9 900 according to this embodiment of the present application. Figure 9 , which is a schematic diagram of the hardware structure of another electronic device in accordance with an embodiment of the present application, wherein the computing device 900 is implemented as a general-purpose computing device. Components of the computing device 900 may include, but are not limited to, the at least one processing unit 901 described above, the at least one storage unit 902 described above, and a bus 903 connecting different system components (including the storage unit 902 and the processing unit 901).
[0351] Bus 903 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, and a processor or local bus using any of a variety of bus architectures.
[0352] The storage unit 902 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 9021 and / or a cache memory unit 9022 , and may further include a read-only memory (ROM) 9023 .
[0353] The storage unit 902 may also include a program / utility 9025 having a set (at least one) of program modules 9024, such program modules 9024 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0354] Computing device 900 may also communicate with one or more external devices 904 (e.g., a keyboard, pointing device, etc.), one or more devices that enable objects to interact with computing device 900, and / or any device that enables computing device 900 to communicate with one or more other computing devices (e.g., a router, modem, etc.). Such communication may occur via input / output (I / O) interface 905. Furthermore, computing device 900 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via network adapter 906. As shown, network adapter 906 communicates with other modules of computing device 900 via bus 903. It should be understood that, although not shown, other hardware and / or software modules may be used in conjunction with computing device 900, including but not limited to microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0355] Based on the same inventive concept as the above-mentioned method embodiment, various aspects of the processing of data relationships provided by the present application can also be implemented in the form of a program product, which includes program code. When the program product is run on an electronic device, the program code is used to enable the electronic device to execute the steps in the processing of data relationships according to various exemplary embodiments of the present application described above in this specification. For example, the electronic device can execute the following steps: Figure 3a 、 4a Follow the steps shown in .
[0356] The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable 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 thereof.
[0357] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application.
[0358] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A method for processing data relations, characterized in that: include: Obtaining discussion data associated with target content, and determining a data hierarchy of the discussion data with respect to the target content, wherein the data hierarchy is used to characterize a nested reply relationship between the discussion data; According to the data level of the discussion data, a data node corresponding to the discussion data is created in a preset pointer map, and a table element corresponding to the identification information of the discussion data is added to the target index table corresponding to the data level, wherein each data node is associated with a pointer to other discussion data of the specified data level, and the target index table includes at least a statistical subtable for counting the total number of discussion data of a specified type, and a clustering subtable for clustering discussion data of a specified level; Based on the pointer map and the target index table, the data relationship corresponding to the target content is represented.
2. The method according to claim 1, wherein The step of creating a data node corresponding to the discussion data in a preset pointer graph includes: Establishing a data node corresponding to the discussion data in a preset pointer map; According to the set pointer pointing relationship, other discussion data that have the pointer pointing relationship with the discussion data are determined, and pointers between corresponding data nodes are created in the pointer graph, wherein the pointer pointing relationship is used to characterize the reply relationship between discussion data at different data levels.
3. The method according to claim 2, wherein Create pointers between corresponding data nodes, including: a root comment pointer pointing to the traceable first-level discussion data, a direct reply pointer pointing to the parent discussion data of the reply, and a root reply pointer pointing to the traceable second-level discussion data; wherein, the first-level discussion data is the historical discussion data that directly replies to the target content, the second-level discussion data is the historical discussion data that replies to the first-level discussion data, and the parent discussion data is the historical discussion data for targeted replies.
4. The method according to claim 1, wherein In the target index table corresponding to the data level, a table element corresponding to the identification information of the discussion data is added, including: Determine the statistical sub-table and clustering sub-table corresponding to the data level of the discussion data according to the predefined data level range corresponding to the table elements in each sub-table; The identification information of the discussion data is added to the statistical subtable as the terminal table element in the statistical subtable, and corresponding table elements are added to the corresponding clustering subtable based on the temporal relationship between the discussion data and other discussion data belonging to the same parent discussion data.
5. The method according to claim 4, wherein Before determining the statistical sub-table and the clustering sub-table corresponding to the data level of the discussion data according to the predefined data level range corresponding to the table elements in each sub-table, the method further includes: Pre-defining a corresponding designated-level clustering sub-table for discussion data of a designated data level associated with the target content; A corresponding total amount statistics sub-table is defined in advance for the discussion data associated with the target content, and a corresponding designated level statistics sub-table is defined in advance for the discussion data of a designated data level associated with the target content.
6. The method according to claim 1, wherein When a request for presenting each historical discussion data associated with the target content is received, the method further includes: Obtaining an index table associated with the target content, and determining, based on the index table, table elements at each data level associated with the target content, and determining the total number of historical discussion data belonging to the specified level, wherein the index table is created based on reply relationships between the discussion data; The historical discussion data content corresponding to the table elements under each data level is obtained respectively, and the historical discussion data content and the total number of historical discussion data under each data level are displayed according to a preset data display format.
7. The method according to any one of claims 1 to 6, wherein: Determining the data level of the discussion data with respect to the target content includes: According to the reply relationship between the discussion data and the acquired historical discussion data, tracing back to determine the total number of nested reply levels of the discussion data relative to the target content; If it is determined that the total number of nested reply levels is higher than a set reply level threshold, determining the data level of the discussion data with respect to the target content based on the reply level threshold; If it is determined that the total number of nested reply levels is not higher than the reply level threshold, the data level of the discussion data with respect to the target content is determined based on the total number of nested reply levels.
8. The method according to any one of claims 1 to 6, wherein: After receiving the deletion instruction for the target discussion data, it also includes: Obtaining an index table created for each historical discussion data associated with the target content, and obtaining a tree structure diagram associated with the target content established based on the pointer map; In the index table, deleting the target table element corresponding to the target discussion data, and in the tree structure diagram, deleting the tree node corresponding to the target discussion data; According to the pointer map, the linkage discussion data under the target discussion data is determined, and the linkage table element corresponding to each linkage discussion data is deleted in the index table, and the linkage tree node corresponding to each linkage discussion data is deleted in the tree structure diagram.
9. The method according to claim 8, wherein Deleting the linkage table element corresponding to each linkage discussion data in the index table includes: According to the historical discussion data of a specified level associated with the target content, the index table is stored in pages, wherein the storage content of each page includes the content of a sub-table associated with at least one historical discussion data of the specified level; For each page of stored content, the linkage table element corresponding to the linkage discussion data included in the stored content is deleted.
10. The method according to claim 9, wherein The deleting the linkage table element corresponding to the linkage discussion data included in the stored content includes: Determining target linkage discussion data associated with the target discussion data and having a higher data level than the target discussion data based on the pointer map, wherein a higher data level indicates that the corresponding discussion data has more nested reply levels relative to the target content; In the order of data levels from high to low, the linkage table elements corresponding to each target linkage discussion data are deleted in sequence in the storage content.
11. The method according to claim 9, wherein Deleting the linkage tree node corresponding to each linkage discussion data in the tree structure diagram includes: For each page of stored content, perform the following operations: determining target linkage discussion data included in the stored content; In the tree structure diagram, the linkage tree nodes corresponding to the target linkage discussion data at each depth value are deleted in turn in descending order of the corresponding depth values, wherein the depth value of the tree node corresponds to the data level of the corresponding discussion data.
12. A method for processing data relations, characterized in that: include: After receiving a deletion instruction for target discussion data associated with target content, deleting a target table element corresponding to the target discussion data in an index table associated with the target content; According to the tree structure diagram associated with the target content, the linked discussion data under the target discussion data is determined, and in the order of data hierarchy from high to low, the content corresponding to the linked discussion data of each data level is deleted in the index table and the tree structure diagram respectively, wherein the data hierarchy represents the nested reply relationship between the discussion data.
13. The method according to claim 12, wherein: Three data levels are set for the discussion data associated with the target content. The index table includes statistical sub-tables of discussion data of other levels traceable to the same first-level discussion data, clustering sub-tables of second-level discussion data traceable to the same first-level discussion data, clustering sub-tables of third-level discussion data traceable to the same second-level discussion data, first-level discussion data clustering sub-tables, and statistical sub-tables of discussion data associated with the target content.
14. The method according to claim 13, wherein The target discussion data is first-level discussion data; in descending order of data levels, in the index table and the tree structure diagram, the contents corresponding to the linkage discussion data of each data level are deleted, including: According to the historical discussion data of the specified level, the index table after deleting the target table element is stored in pages, wherein the storage content of each page includes the sub-table content associated with at least one historical discussion data of the specified level; For the storage content of each page, delete the linkage table elements belonging to the third-level discussion data, and delete the corresponding linkage tree nodes in the tree structure diagram, then delete the linkage table elements belonging to the second-level discussion data, and delete the corresponding linkage tree nodes in the tree structure diagram.
15. The method according to claim 14, wherein The deletion of linkage table elements belonging to the third-level discussion data includes: Traversing the secondary discussion data clustering subtable corresponding to the target discussion data to determine the secondary discussion data below the target discussion data, and traversing the tertiary discussion data clustering subtable corresponding to each secondary discussion data to determine the tertiary discussion data traceable to the target discussion data; Delete the linkage table elements corresponding to the third-level discussion data in the discussion data statistics sub-table, the other-level discussion data clustering sub-table corresponding to the target discussion data, and the corresponding third-level discussion data clustering sub-table respectively.
16. The method according to claim 14, wherein The deletion of linkage table elements belonging to the secondary discussion data includes: Delete the linkage table elements corresponding to the secondary discussion data below the target discussion data in the discussion data statistics subtable, the other level discussion data clustering subtable corresponding to the target discussion data, and the corresponding secondary discussion data clustering subtable respectively.
17. The method according to claim 13, wherein The target discussion data is secondary discussion data; and in descending order of the data levels, in the index table and the tree structure diagram, the contents corresponding to the linkage discussion data of each data level are deleted, including: According to the historical discussion data of the specified level, the index table after deleting the target table element is stored in pages, wherein the storage content of each page includes the sub-table content associated with at least one historical discussion data of the specified level; For each page of stored content, the linkage table elements belonging to the third-level discussion data are deleted, and the corresponding linkage tree nodes are deleted in the tree structure diagram.
18. The method according to claim 17, wherein The deletion of linkage table elements belonging to the third-level discussion data includes: Determine the third-level discussion data under the target discussion data, and delete the linkage table elements corresponding to the third-level discussion data in the other-level discussion data clustering subtable containing the target discussion data and the discussion data statistical subtable.
19. A data relationship processing device, characterized in that: include: an obtaining unit, configured to obtain discussion data associated with target content, and determine a data hierarchy of the discussion data with respect to the target content, wherein the data hierarchy is used to characterize a nested reply relationship between the discussion data; A creation unit, configured to create, in accordance with the data level of the discussion data, data nodes corresponding to the discussion data in a preset pointer map, and to add table elements corresponding to the identification information of the discussion data in a target index table corresponding to the data level, wherein each data node is associated with a pointer to other discussion data of a specified data level, and the target index table includes at least a statistical subtable for counting the total number of discussion data of a specified type, and a clustering subtable for clustering discussion data of a specified level; A representation unit is used to represent the data relationship corresponding to the target content based on the pointer map and the target index table.
20. A data relationship processing device, characterized in that: include: A receiving unit, configured to, after receiving a deletion instruction for target discussion data associated with target content, delete a target table element corresponding to the target discussion data in an index table associated with the target content; A deletion unit is used to determine the linked discussion data under the target discussion data according to the tree structure diagram associated with the target content, and to delete the content corresponding to the linked discussion data of each data level in the index table and the tree structure diagram in order from high to low data levels, wherein the data level represents the nested reply relationship between the discussion data.
21. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method for processing data relations according to any one of claims 1 to 18 is implemented.
22. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for processing data relations according to any one of claims 1 to 18 is implemented.
23. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method for processing data relations according to any one of claims 1 to 18 is implemented.
Citation Information
Patent Citations
Internet-based discussion system and method thereof, record media recorded discussion method
CN101080735A
Determining access to comments
CN104487967A