A method for describing and applying the relationship between data using a multi-attribute mixed index
The construction of a ring structure through heterogeneous nodes and index table templates solves the complexity problem of multi-attribute hybrid index data relationship description, and realizes simple and efficient data maintenance and operation.
Patent Information
- Application Number
- CN202210425952.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-22
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-04-22
AI Technical Summary
When describing the relationship between data of multi-attribute hybrid indexes, as the amount of data increases, the structure becomes too complex, the operation efficiency is inefficient, and it is difficult to achieve effective data maintenance and operation.
The heterogeneous nodes, index tables and index table templates are used to build a ring structure through forward indexes and backward indexes, establish the relationship between entity nodes, and use the index table template to define the actual index relationship, simplify data operations and reduce the probability of errors.
It realizes a simple description and convenient maintenance of multi-attribute hybrid index data relationships, improves data processing efficiency, and reduces operational complexity and error rate.
Smart Images

Figure CN114691697B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer data processing technology, and in particular to a method for describing and applying the relationship between data of a multi-attribute mixed index. Background Art
[0002] In modern society, with the advancement of digital information technology, many scenarios require the association of diverse data to describe the connections between real-world entities. For example, in product traceability, it's necessary to associate various types of data, including origin, packaging, transportation, sales, and market. Another example is the need to track the whereabouts of specific individuals, requiring the association of diverse data such as family relationships, colleagues, co-passengers, restaurant and entertainment staff, and companions. Due to the diversity of entities and connections, this data is often distributed across different information platforms, each with its own unique design for representing and storing the entities of interest. Furthermore, each platform operates independently, making it difficult to discover connections between entities across multiple platforms. Representing real-world entities and their connections in a single data structure model makes it easier to discover connections between entities.
[0003] In the existing technology, when representing and storing entities and entity relationships, classic data structures such as queues, linked lists, numbers, and graphs are usually used to describe each entity. An entity itself has many attributes and also has various connections with other entities. In the technology used to build existing information platforms, it is usually necessary to design and create tables to describe entities and their relationships. Due to the diversity of entities and connections between entities in the real world, various tables are needed to support the description of entities and their relationships based on existing relational databases. When the relationships are too complex and the number of tables reaches a certain level, the definition of the tables and the design of the associations between tables will become very complicated, and the data operations such as adding, deleting, modifying, and querying based on these tables will also become very complicated, extremely inefficient, and even difficult to implement. Summary of the Invention
[0004] To address the existing problem of overly complex structures, low implementation efficiency, and difficulty in implementing relationships when describing relationships between data in a multi-attribute hybrid index, when the amount of data reaches a certain level, the present invention provides a method for describing relationships between data in a multi-attribute hybrid index. This method can describe relationships between data in a multi-attribute hybrid index based on real-world relationships, while also having a simple structure, easy implementation, and convenient subsequent data maintenance. The present invention also discloses an application method for describing relationships between data in a multi-attribute hybrid index.
[0005] The technical solution of the present invention is as follows: a method for describing the relationship between data of a multi-attribute mixed index, characterized in that it includes:
[0006] Heterogeneous nodes, index tables, and index table templates;
[0007] The heterogeneous nodes describe each entity node with the existing data logical structure and data physical structure of the entity node to which a relationship needs to be established;
[0008] The relationships between the heterogeneous nodes include: actual index relationship and basic index relationship;
[0009] The basic index relationship is the data connection between all heterogeneous nodes, and based on the basic index relationship, all the heterogeneous nodes participating in the mixed index are connected together to form a whole;
[0010] The actual index relationship defines a relationship between two nodes that are connected to each other and has actual significance beyond the basic index relationship.
[0011] The index table is set in each of the heterogeneous nodes, and the index table includes index entries, each of the index entries represents a relationship between the heterogeneous nodes;
[0012] The index entries include: forward index, backward index, and other indexes;
[0013] The basic index relationship of a ring structure is formed between all the heterogeneous nodes through the forward index and the backward index;
[0014] The index table template defines the index entry content of other indexes in the index table in the actual index relationship;
[0015] The index entry content includes: the entry type of the index entry, the data structure of the index entry, and the actual index relationship between the two associated parties represented by the index entry; the data structure of the index entry includes: the address pointing to other nodes;
[0016] The other indexes in the index table of each heterogeneous node are instances of an index template table.
[0017] It is further characterized by:
[0018] The implementation of the address pointing to other nodes in the data structure of the index entry includes: an address pointing to other nodes, or an address table pointing to multiple nodes;
[0019] The storage relationship between the index table and the heterogeneous nodes includes: common storage and separate storage;
[0020] When the index table is stored separately from the heterogeneous node, a node index entry is set in the index table, and an index table pointer is set in the heterogeneous node;
[0021] The node index entry points to the heterogeneous node; the index table pointer points to the index table;
[0022] The node index entry is set at the head position of the index table; the index table pointer is set at the head position of the heterogeneous node;
[0023] The index relationship between the heterogeneous nodes includes: a tree structure, a star structure, a mesh structure, a bus structure, a ring structure, and a network topology structure.
[0024] A method for describing the relationship between data using a multi-attribute mixed index, comprising the following steps:
[0025] S1: Obtain all entity nodes that need to establish relationships and the contents of the entity nodes;
[0026] S2: Based on all the relationships between all entity nodes, define different real index relationships and build an index table template;
[0027] S3: construct a heterogeneous node for each entity node, and record them as heterogeneous nodes to be processed;
[0028] At the same time, an index table is constructed for each heterogeneous node to be processed;
[0029] S4: Connect all the heterogeneous nodes to be processed one by one through the forward index and the backward index in the index table of each heterogeneous node to be processed to form a ring structure;
[0030] S5: Select one of the heterogeneous nodes to be processed, and record it as the first node;
[0031] S6: In the ring structure, find a heterogeneous node to be processed that needs to establish connections with all first nodes and record it as a second node;
[0032] S7: Determine the actual index relationship between the first node and the second node, and select an index table template used by the two nodes;
[0033] S8: Create an index entry of another index in the index table of the first heterogeneous node, and fill in the index entry content associated with the second heterogeneous node;
[0034] Create an index entry of another index in the index table of the second heterogeneous node, and fill in the index entry content associated with the first heterogeneous node;
[0035] S8: Loop through steps S6 to S8 to complete filling all other indexes of the first node;
[0036] S9: Select one of the related heterogeneous nodes to be processed that is related to the first node as the first node;
[0037] Repeat steps S6 to S9 until all relationships between the heterogeneous nodes to be processed are established.
[0038] It is further characterized by:
[0039] Step S3 also includes the following:
[0040] a1: setting the data physical structure of each entity node according to the data logical structure of each entity node, and storing each heterogeneous node to be processed according to the data physical structure of the entity node;
[0041] a2: Determine whether the entity node constructed this time needs to be stored separately from the index;
[0042] If the entity node needs to be stored separately from the index, the index table of the entity node and the heterogeneous node are stored separately, and a node index entry is set in the index table, and an index table pointer is set in the heterogeneous node; the node index entry points to the heterogeneous node; the index table pointer points to the index table;
[0043] It also includes a data processing method, which includes the following steps:
[0044] b1: Read all the heterogeneous nodes to be processed in the ring structure and the corresponding index tables into the memory;
[0045] If the physical node and index are stored separately, only the index table is read into the memory of the computing device. When the node content is used during the calculation process, the node content is read again;
[0046] b2: Use all index tables in the ring structure as the basis to add, delete, modify and query data.
[0047] The present invention provides a method for describing the relationship between data of a multi-attribute mixed index, which can establish the relationship between entity nodes through an index table without changing the original data storage structure of the entity node, and can realize the description of data with multi-attribute mixed index relationships in the real world and the relationship between data; at the same time, based on the index table template, the real index relationship is defined, and then the relationship entity is constructed through the index table to realize the relationship description of the data, which is not only simple in structure but also convenient to realize, and convenient for later data maintenance. If it is necessary to adjust the relationship between two entity nodes, it can be realized by modifying the index entries of the two. If it is necessary to modify the relationship between two types of data, it can be realized by adjusting the index template, which not only simplifies the operation but also reduces the probability of error. At the same time, the data relationship constructed based on this method and the processing of adding, deleting, modifying and checking the data relationship are all realized based on the index table, and the size of the index table constructed based on this method is limited, so the index table can be read into the memory at one time for data processing, thereby improving the implementation efficiency of data processing using this method. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 A schematic diagram of the structure of a doubly linked list connected end to end based on forward index and backward index;
[0049] Figure 2 This is a schematic diagram of the family relationship index structure;
[0050] Figure 3 Schematic diagram of the index structure for studying;
[0051] Figure 4 Index structure diagram for school work;
[0052] Figure 5 This is a schematic diagram of the school index structure;
[0053] Figure 6 This is a diagram of the class index structure;
[0054] Figure 7 An embodiment of presenting entity relationships in a data structure. DETAILED DESCRIPTION
[0055] The present invention includes a method for describing the relationship between data of a multi-attribute mixed index, which is characterized by comprising: heterogeneous nodes, an index table, and an index table template.
[0056] Heterogeneous nodes describe each entity node with the existing data logical structure and data physical structure of the entity node to which the relationship needs to be established. In specific applications, the data structure of the present invention can be combined with classic data structures to implement local functions, or it can use custom data structures to implement local functions.
[0057] The data structure of the present invention uses a bidirectional linked list as the basic structure of the entity node, which is connected end to end to form a ring structure. Each node can be traversed on the ring. The structure and stored entity type of each entity node can be different, so it is called a heterogeneous node.
[0058] The relationships between heterogeneous nodes include: actual index relationship and basic index relationship.
[0059] The basic index relationship connects the data between all heterogeneous nodes. Based on this basic index relationship, all heterogeneous nodes participating in the mixed index are connected together to form a whole. The setting of the basic index relationship determines the insertion position of newly added nodes. If nodes are clustered by type, they can be connected in a specified order, such as when inserting nodes representing people, they can be connected based on the numerical value of their ID numbers. Alternatively, they can be connected in an unordered, random manner, using the principle of proximity. The specific insertion method is set according to actual needs.
[0060] The real index relationship defines two nodes that are connected to each other and have a real-world connection beyond the basic index relationship.
[0061] An index table is set up in each heterogeneous node, which includes multiple index entries, each of which represents a relationship between heterogeneous nodes; the data structure of the index entry includes: addresses pointing to other nodes; the data structure of each index entry is designed as needed, and can include only one address pointing to other nodes, or it can be an address table pointing to multiple nodes.
[0062] Index entries include: forward index, backward index, and other indexes;
[0063] All heterogeneous nodes form a basic index relationship in a ring structure through forward index and backward index;
[0064] The index table template defines the index entry content of other indexes in the index table in the actual index relationship;
[0065] The index entry content includes: the entry type of the index entry, the data structure of the index entry, and the actual index relationship between the two parties represented by the index entry;
[0066] The other indexes in the index table of each heterogeneous node are instances of the index template table.
[0067] In specific implementation, the entries in the index table of each heterogeneous node can be exactly the same as the index table template structure, which is neat and uniform and relatively simple to implement. The entries in the index table can also be a subset of the index table template, which is more flexible but relatively complex to implement. The specific implementation should be determined according to actual needs.
[0068] The storage relationship between the index table and heterogeneous nodes includes: common storage and separate storage; when the index table and heterogeneous nodes are stored separately, the node index entry is set in the index table, and the index table pointer is set in the heterogeneous node; the node index entry points to the heterogeneous node; the index table pointer points to the index table. The node index entry is set at the head of the index table; the index table pointer is set at the head of the heterogeneous node to ensure the convenience of program implementation. Figure 1 ,is a schematic diagram of a bidirectional linked list connected end to end based on a forward index and a backward index. ,The storage relationship between the index table and the heterogeneous nodes shown in the figure is ,separate storage.
[0069] The index relationships between heterogeneous nodes defined by the index table template include classic structures such as tree structure, star structure, mesh structure, bus structure, ring structure, and network topology structure, but are not limited to classic structures and can also include other types of structures and custom structures.
[0070] In the present invention, index entries of other index types are indexes established according to actual needs. Each other index establishes a connection between two heterogeneous nodes. The way of connection, sorting and organization can be different and defined as needed. For example, the index defined according to blood relationship can be organized in a tree structure or a structure that transcends the tree; for example, if the index defined according to classmate relationship is too complicated to be represented in a network way, the classmate nodes can be connected by introducing heterogeneous class nodes; for example, the index defined according to the relationship of owning something can be represented in a star structure. The index design of the present invention is the core of realizing the data structure of the present invention. The selection and sorting methods of index attributes can be defined according to the node relationship requirements. In theory, as long as the computing power and storage capacity allow, any connection in the real world can be represented in the data structure of the present invention.
[0071] In the present invention, the nodes involved in a relationship can be a subset of the summary points. The nodes used between multiple relationships may or may not have intersections. The operation algorithm on a certain index is designed based on the logical structure generated by the index relationship. When it comes to node insertion and deletion, if there are other index relationships on the node, the operation algorithms corresponding to the other index relationships on the node are also needed to maintain the index relationship of the node. In the method of the present invention, the basic index relationship of heterogeneous nodes must be maintained, which is the basis for realizing all data operations.
[0072] Data structures can be divided into logical and physical structures. The logical structure reflects the logical relationships between data elements, while the physical structure represents the storage format of the logical structure in computer memory. This disclosure only describes the logical structure of data; the physical structure can be implemented based on storage characteristics and does not affect the technical solution of this disclosure.
[0073] The application method for describing the relationship between data of the multi-attribute mixed index mentioned above includes the following steps.
[0074] S1: Get all entity nodes that need to establish relationships and the contents of the entity nodes.
[0075] In this example, we illustrate the application of multi-attribute hybrid indexing to describe relationships between data by implementing family and classmate relationships within the data structure of the present invention. The original family and classmate relationship data is stored in different data sources (such as databases, information platforms, etc.). To trace the source, the two need to be linked. First, we need to find the data source storing the different entity data.
[0076] In this embodiment, the entity nodes that need to establish relationships include: P-type nodes representing people, C-type nodes representing classes, and S-type nodes representing schools. The present invention defines an index structure for each type of node to present the above relationships.
[0077] S2: Build the database used by this method on the server, define different real index relationships according to all the relationships between all the entity nodes, and build an index table template.
[0078] In this method, if the data of the entity node is small, the data stored together in the index table and the entity node is limited-size data, and both are read into the memory together during calculation; once an ultra-large-scale entity node appears, the index table and the entity node are saved separately by separate storage, and the size of the index table describing the data relationship is limited. During calculation, the index table is first read into the memory, and when the entity node is used, the entity node is read into the memory to participate in the calculation; therefore, this method does not have high requirements on the computing performance of the hardware, the size of the memory, and the read-write performance, ensuring that this method is suitable for different application scenarios.
[0079] By abstracting and synthesizing the index structure defined in the present invention, an index template can be formed, and a new node can select the required index structure from the index template. In specific applications, the node content format and the index template format need to be designed and planned in advance, and as a format specification, maintained and announced by a specialized organization. This embodiment does not involve the definition of the format specification, but only provides an implementation method and idea description. At the same time, this implementation description does not involve the definition of the node content format, but only defines the index on the node, nor does it define the storage location of the index. It can be stored together with the node or separately, which does not affect the description of the implementation method of the present invention.
[0080] At the same time, in order to show the clarity, Figures 2 to 7The basic index relationship is omitted in the figure, and the indexes in the following embodiments all refer to index entries of other index types that represent actual index relationships.
[0081] like Figure 2 The figure shows the design of the family relationship index structure, which includes specific index items such as parents, spouses, children, and siblings. The structures of different index items are different.
[0082] The parent item index has two pointers, pointing to the father and the mother respectively.
[0083] The spouse index consists of a pointer table consisting of one or more pointers, representing the marriage history. There must be at least one pointer. The last pointer points to the current spouse; if there is no spouse, the last pointer is NULL. If there are multiple pointers, the pointers before the last one point to previous spouses, preserving the historical relationship.
[0084] The child index consists of a pointer table consisting of one or more pointers, with at least one pointer. If there is only one pointer, and it is NULL, there are no children. If there are multiple children, a corresponding number of pointers are created. The order of the pointers corresponds to the order of the children's birth dates, and they point to the children in order of birth date.
[0085] The sibling index has two pointers, one pointing forward to the older sibling and the other pointing backward to the younger sibling. If the sibling is the oldest, the forward pointer is NULL; if the sibling is the youngest, the backward pointer is NULL.
[0086] like Figure 3 As shown in FIG, the index structure of the student's study experience is designed, and the study item is designed.
[0087] The study item index consists of a pointer table, which consists of one or more pointers. Each pointer points to a class according to the study experience. With the class, the school information can be obtained.
[0088] like Figure 4 The following is the index structure design for teachers’ work in school, which includes work unit items and teacher-led class items.
[0089] The work unit item index consists of a pointer table, which consists of one or more pointers, indicating the school where the work has been done. There is at least one pointer. The pointers are arranged in the order of work time.
[0090] The index of a teacher's classes consists of a pointer table consisting of one or more pointers, each representing a class taught. There must be at least one pointer. Pointers are arranged in chronological order, with the last pointer pointing to the most recent class taught. If there is only one pointer, and it is NULL, then no classes have been taught.
[0091] The class item index for a teacher includes a homeroom teacher flag, allowing for quick retrieval of the teacher's classes. This design demonstrates the use of additional data structures in the index to support categorical indexing and aid in information retrieval.
[0092] like Figure 5 The following shows the school index structure design, which includes staff items and class items in the school.
[0093] The employee entry index consists of a pointer table, consisting of one or more pointer entries. Each pointer entry includes an active / inactive flag and a pointer to the employee. The active / inactive flag allows for quick retrieval of information about current or former employees. This design demonstrates the use of additional data structures in the index to support categorical indexing and aid in information lookup.
[0094] The school class item index consists of a pointer table, which consists of one or more pointers, each of which points to a class in the school.
[0095] like Figure 6 The following shows the class index structure design, which includes the school item, class teacher item, and student list item.
[0096] The school item index has a pointer pointing to the school.
[0097] The head teacher item index consists of a pointer table, which consists of one or more pointers, each of which points to a former head teacher of the class.
[0098] The student list item index consists of a table of pointers, consisting of one or more pointers, each pointing to a student in the class.
[0099] S3: Construct a heterogeneous node for each entity node, which is recorded as a heterogeneous node to be processed;
[0100] At the same time, an index table is constructed for each heterogeneous node to be processed.
[0101] Step S3 also includes the following:
[0102] a1: setting the data physical structure of each entity node according to the data logical structure of each entity node, and storing each heterogeneous node to be processed according to the data physical structure of the entity node;
[0103] a2: Determine whether the entity node constructed this time needs to be stored separately from the index;
[0104] If the entity node needs to be stored separately from the index, the index table of the entity node and the heterogeneous node are stored separately, and a node index entry is set in the index table, and an index table pointer is set in the heterogeneous node; the node index entry points to the heterogeneous node; the index table pointer points to the index table.
[0105] S4: Connect all the heterogeneous nodes to be processed one by one through the forward index and the backward index in the index table of each heterogeneous node to be processed to form a ring structure.
[0106] S5: Select a heterogeneous node to be processed and record it as the first node.
[0107] S6: In the ring structure, a heterogeneous node to be processed that needs to establish connections with all first nodes is found and recorded as the second node.
[0108] S7: Determine the actual index relationship between the first node and the second node, and select an index table template used by the two nodes.
[0109] S8: Create an index entry of another index in the index table of the first heterogeneous node, and fill in the index entry content associated with the second heterogeneous node;
[0110] An index entry of another index is created in the index table of the second heterogeneous node, and the index entry content associated with the first heterogeneous node is filled in.
[0111] S8: Loop through steps S6 to S8 to complete filling all other indexes of the first node.
[0112] S9: Select one of the related to-be-processed heterogeneous nodes of the first node as the first node;
[0113] Repeat steps S6 to S9 until all relationships between the heterogeneous nodes to be processed are established.
[0114] like Figure 7 As shown, based on Figures 2 to 6 The heterogeneous nodes and index entries to be processed in record 1 family, which has 2 families (3 generations), 4 classes, and 1 school. Figure 7 The index entries used are shown in .
[0115] To simplify the index on the diagram and facilitate viewing, when representing family relationships, only the relationship between father and descendants is shown.
[0116] P13 and P14 are the great-grandparents and the patriarchs, P1 and P8 are their sons, and P1 and P8 have formed two families.
[0117] In the first family, P1 and P2 are grandparents, the first generation; P3 and P4 are peers, P3 is older, the second generation; P3 and P5 are father and mother, husband and wife; P6 and P7 are peers, P6 is older, the third generation.
[0118] In the second family, P8 and P9 are grandparents, the first generation; P10 and P11 are father and mother, husband and wife, the second generation; P12 is the third generation.
[0119] P4, P5 and P10 are classmates in Class C1, P3 and P10 are classmates in Class C2, P7 and P12 are classmates in Class C3, and P12 later transferred to Class C4. The head teacher of Class C4 is P5, and the school that Class C4 belongs to is S1.
[0120] The data processing method implemented based on this method includes the following steps:
[0121] b1: Read all the heterogeneous nodes to be processed in the ring structure and the corresponding index tables into memory;
[0122] If separate storage is used, only the index table can be read into the memory of the computing device, and the node content can be read on demand when used;
[0123] b2: Use all index tables in the ring structure as the basis to add, delete, modify and query data.
[0124] Because the size of the index table is limited, all index tables can be completely read into the memory of the computing device, the node content can be accessed on demand, and the addition, deletion, modification and query of data relationships can be completed in the memory, which greatly speeds up the data processing speed.
[0125] In this embodiment, Figures 2 to 7 As shown in the index structure and entity relationship in the figure, the index relationship is implemented in a pointer manner, and a bidirectional index is implemented between the relevant nodes at a macro level. The maintenance of nodes and their index relationships, as well as operations such as adding, searching, modifying, and deleting nodes, are similar to the maintenance of nodes and their link relationships in a bidirectional linked list. It is only the actual index relationship that needs to be processed on each node. The maintenance of the actual index relationship is similar to the index maintenance in classic data structures such as queues, singly linked lists, and doubly linked lists. These operations do not increase the difficulty of program implementation. The present invention will not further explain these basic operating methods in detail.
[0126] The data structure of this invention is generally a ring structure, and operations can be initiated from any node. Holding any node provides an entry point for operations. This design reflects the diversity of objects in the real world. Different users and terminal devices only need to store the most commonly used node indexes to use and operate this data structure.
[0127] Similarly, when different users and terminal devices newly join nodes to the ring, they should join the nearest holding node. After joining, the basic index relationship should be set immediately to ensure the correctness of the ring structure, and then other indexes can be set.
[0128] The technical solution of the present invention is not only concerned with the description and recording of one or several relationships, but rather represents various entities and their various relationships in real events. Using a structure to describe the real world, as long as you get a node, you can get all the connections of this node, and you can follow the clues through these connection indexes to explore the entity nodes that are directly or indirectly connected, and mine the information therein. Various algorithms, crawlers, and other applications can be applied to these connections to perform data mining. Therefore, using the data structure of the present invention, an information platform can be constructed, allowing a large number of terminals, including people and devices, to concurrently use the information platform constructed by the data structure of the present invention. Because each node is of equal status, there is no classification or restriction based on type, and each node is equally set on a data ring. Therefore, the information platform constructed based on this method has a data ring scale that is as large as the platform's concurrent capabilities.
Claims
1. A method for describing the relationship between data of a multi-attribute mixed index, characterized in that: It includes: Heterogeneous nodes, index tables, and index table templates; The heterogeneous nodes describe each entity node with the existing data logical structure and data physical structure of the entity node to which a relationship needs to be established; The relationships between the heterogeneous nodes include: actual index relationship and basic index relationship; The basic index relationship is the data connection between all heterogeneous nodes. Based on the basic index relationship, all heterogeneous nodes participating in the mixed index are connected together to form a whole, which is in the shape of a ring structure; The setting of basic index relationship determines the insertion position of newly added nodes; The basic index relationship includes: connection in a specified order and random connection without order; heterogeneous nodes are inserted into the ring at the nearest position, which constitutes random connection without order; If nodes are clustered by type, they can be connected in the specified order; The actual index relationship defines a relationship between two nodes that are connected to each other and has actual significance beyond the basic index relationship. The index table is set in each of the heterogeneous nodes, and the index table includes index entries, each of the index entries represents a relationship between the heterogeneous nodes; The index entries include: forward index, backward index, and other indexes; The forward index and the backward index are used to form the basic index relationship of the ring structure; The index entry contents of other indexes in the index table are used to represent the actual index relationship, and the actual index relationship is defined by the index table template; The index entry content of the other index includes: the entry type of the index entry, the data structure of the index entry, and the actual index relationship between the two associated parties represented by the index entry; the data structure of the index entry includes: the address pointing to the other node; The other indexes in the index table of each heterogeneous node are instances of an index template table; When the basic index relationship is an unordered random connection, the proximity principle is adopted, and the index of the node currently held is inserted near the node; After adding, immediately set up the basic index relationship to ensure the correctness of the ring structure, and then set up other indexes; Each node has equal status and is not divided into different levels or restricted by type. Each node is equally set on a data ring.
2. The method for describing the relationship between data of a multi-attribute mixed index according to claim 1, characterized in that: The implementation of the address pointing to other nodes in the data structure of the index entry includes: an address pointing to other nodes, or an address table pointing to multiple nodes.
3. The method for describing the relationship between data of a multi-attribute mixed index according to claim 1, characterized in that: The storage relationship between the index table and the heterogeneous nodes includes: common storage and separate storage; When the index table is stored separately from the heterogeneous node, a node index entry is set in the index table, and an index table pointer is set in the heterogeneous node; The node index entry points to the heterogeneous node; the index table pointer points to the index table.
4. The method for describing the relationship between data of a multi-attribute mixed index according to claim 3 is characterized by: The node index entry is set at the head position of the index table; the index table pointer is set at the head position of the heterogeneous node.
5. The method for describing the relationship between data of a multi-attribute mixed index according to claim 1, characterized in that: The structures described by the actual index relationship between the heterogeneous nodes include: tree structure, star structure, mesh structure, bus structure, ring structure, and network topology structure.
6. An application method of the method for describing the relationship between data of the multi-attribute mixed index according to claim 1, characterized in that: It includes the following steps: S1: Obtain all entity nodes that need to establish relationships and the contents of the entity nodes; S2: Based on all the relationships between all entity nodes, define different real index relationships and build an index table template; S3: construct a heterogeneous node for each entity node, and record them as heterogeneous nodes to be processed; At the same time, an index table is constructed for each heterogeneous node to be processed; S4: Connect all the heterogeneous nodes to be processed one by one through the forward index and the backward index in the index table of each heterogeneous node to be processed to form a ring structure, thereby completing the establishment of the basic index relationship; The setting of basic index relationship determines the insertion position of newly added nodes; The basic index relationship includes: connection in a specified order and random connection without order; in the ring structure formed by the basic index, each node has equal status, there is no classification or restriction based on type, and each node is part of the ring structure; S5: Select one of the heterogeneous nodes to be processed, and record it as the first node; S6: In the ring structure, find a heterogeneous node to be processed that needs to establish connections with all first nodes and record it as a second node; S7: Determine the actual index relationship between the first node and the second node, and select an index table template used by the two nodes; S8: Create an index entry of another index in the index table of the first heterogeneous node, and fill in the index entry content associated with the second heterogeneous node; Creating an index entry of another index in the index table of the second heterogeneous node, and filling in the index entry content associated with the first heterogeneous node; the real index defines the relationship between the nodes, and these relationships form a specific real relationship structure; S9: Loop through steps S6 to S8 to complete filling all other indexes of the first node; S10: Select one of the to-be-processed heterogeneous nodes related to the first node as the first node; Repeat steps S6 to S9 until all relationships between the heterogeneous nodes to be processed are established.
7. The method for describing the relationship between data using a multi-attribute mixed index according to claim 6, characterized in that: Step S3 also includes the following: a1: setting the data physical structure of each entity node according to the data logical structure of each entity node, and storing each heterogeneous node to be processed according to the data physical structure of the entity node; a2: Determine whether the entity node constructed this time needs to be stored separately from the index; If the entity node needs to be stored separately from the index, the index table of the entity node and the heterogeneous node are stored separately, and a node index entry is set in the index table, and an index table pointer is set in the heterogeneous node; The node index entry points to the heterogeneous node; the index table pointer points to the index table.
8. The method for describing the relationship between data using a multi-attribute mixed index according to claim 6, characterized in that: It also includes a data processing method, which includes the following steps: b1: Read all the heterogeneous nodes to be processed in the ring structure and the corresponding index tables into the memory; If the physical node and index are stored separately, only the index table is read into the memory of the computing device. When the node content is used during the calculation process, the node content is read again; b2: Use all index tables in the ring structure as the basis to add, delete, modify and query data.
Citation Information
Patent Citations
Method and device for deleting ES index
CN108959501A
A complex relationship data storage and retrieval method based on a graph structure
CN109726305A