A relationship data storage, reading and writing method and device

By optimizing the storage method of relational data, determining storage nodes and blocks based on the information of the active and passive parties, and storing them in timestamp order, the read/write amplification problem of the LSMT storage engine is solved, data storage and retrieval efficiency is improved, and the data structure is optimized.

CN117251506BActive Publication Date: 2026-05-22探探科技(北京)有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
探探科技(北京)有限公司
Filing Date
2023-09-21
Publication Date
2026-05-22

AI Technical Summary

Technical Problem

The existing LSMT storage engine suffers from read/write amplification issues when processing relational data, resulting in high response latency and low efficiency, which cannot meet the needs of massive data storage and read/write operations.

Method used

By determining storage nodes and storage blocks based on the active and passive party information of relational data, and storing data in timestamp order, the data structure is optimized. Data of the same active or passive party is stored in a continuous area. Basic information and relational values ​​are stored separately, and redundant data is generated to support multiple query methods.

Benefits of technology

It improves data storage and retrieval efficiency, avoids sequential lookups in random access storage, optimizes the data retrieval process, reduces write amplification issues, and enhances the overall performance of the data storage system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117251506B_ABST
    Figure CN117251506B_ABST
Patent Text Reader

Abstract

The application provides a relationship data storage, reading and writing method and device, a first storage node of the relationship data is determined according to active party information of the relationship data; a first storage block in the first storage node is determined at least according to the active party information and passive party information of the relationship data; a first storage position of the relationship data in the first storage block is determined at least according to basic information of the relationship data; and the relationship data and a relationship value are stored in the first storage position. The relationship data is stored in sequence, the amount of stored data is reduced, and the query efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data read / write control, and in particular to a relational data storage, read / write method, and apparatus. Background Technology

[0002] During application usage, a large amount of data is generated between users, also known as relational data. Each piece of relational data contains multiple user information and behavioral information. During data usage, a large number of concurrent storage and read / write requests are generated, placing high demands on the efficiency of the data storage system. Currently, there are social data storage solutions that use the LSMT data structure as the storage engine, employing LevelDB or RocksDB as the storage engine to store relational data.

[0003] However, during read and write operations, the LSMT data structure is prone to the following problems: During Minor Compaction, LSMT may block write requests; furthermore, when querying user data, the LSMT structure queries from top to bottom, returning a match if found and continuing to query lower levels if not, leading to read amplification and significantly increasing disk I / O, resulting in higher response latency or even timeouts. During Major Compaction, LSMT also exhibits write amplification. This not only affects the lifespan of the SSD disk but also significantly increases disk I / O during compaction, leading to higher latency or even timeouts for online read and write requests. Existing LSMT storage engines cannot meet the demands of massive relational data storage and read / write operations in terms of processing efficiency for either read or write requests. Summary of the Invention

[0004] In view of this, this application provides a relational data storage, read and write method and apparatus to solve the problems of severe read and write amplification, high read and write request response latency and low efficiency in the prior art storage system.

[0005] The first aspect of this invention provides a relational data storage method, the relational data storage method specifically comprising:

[0006] The first storage node of the relationship data is determined based on the initiator information of the relationship data;

[0007] The first storage block in the first storage node is determined based at least on the active party information and passive party information of the relationship data;

[0008] The first storage location of the relationship data in the first storage block is determined based on at least the basic information of the relationship data, wherein the basic information of the relationship data includes at least the active party information, the passive party information, and a timestamp;

[0009] The relation data and relation values ​​are stored in the first storage location.

[0010] Preferably, the initiating party information includes at least an initiating party identifier;

[0011] The passive party information includes at least the passive party identifier;

[0012] The basic information of the relational data also includes the relation type of the relational data;

[0013] In the first storage node, the data of the same active party and the same passive party are stored in the order of the timestamp.

[0014] Preferably, after storing the relation data and relation values ​​in the first storage location, the method further includes:

[0015] The active party information and passive party information in the basic information of the relation data are exchanged to generate redundant data of the relation data. The active party information in the basic information of the redundant data is the same as the passive party information in the basic information of the relation data. The passive party information in the basic information of the redundant data is the same as the active party information in the basic information of the relation data. Other information in the basic information of the redundant data is the same as the corresponding information in the basic information of the relation data. The relation value of the redundant data corresponds to the relation value of the relation data.

[0016] Store the redundant data.

[0017] Preferably, storing the relation data and relation values ​​in the first storage location includes:

[0018] Transformation information to obtain the basic information of the relational data;

[0019] The transformation information is stored in the first storage location, and the relationship value is stored in the associated location of the first storage location. The first storage location and the associated location are separate locations.

[0020] Preferably, the relational data is stored in a node cluster, which includes multiple nodes, each node including multiple storage blocks. The active party information stored in the relational data is different for each node, and the relational data stored in each node includes multiple active party information. The passive party information stored in the relational data is different for each storage block.

[0021] The relational data storage method further includes:

[0022] The working status of the first storage node storing relational data in the node cluster is detected. If the working status is abnormal, the processing method of the first storage node is determined according to the type of abnormality. The types of abnormality include at least offline and unhealthy.

[0023] A second aspect of the present invention provides a method for reading relational data, the method specifically comprising:

[0024] Obtain query conditions, which include information of the initiating party, information of the passive party, or information of both the initiating party and the passive party;

[0025] Determine the data storage location based on the query conditions;

[0026] Match target data from the data storage location, wherein the target data is stored according to the relational data storage method described above;

[0027] Display the target data.

[0028] Preferably, the relational data reading method specifically includes:

[0029] The query conditions include information of the initiating party, information of the passive party, or information of both the initiating party and the passive party.

[0030] The first storage block of the first storage node is determined based on the query conditions;

[0031] Determine the data storage location based on the query conditions;

[0032] Match target data from the data storage location, wherein the data storage location includes at least the first storage block, the first storage block, and the associated location.

[0033] Preferably, matching target data from the data storage location includes:

[0034] If the query conditions include information about the active party or the passive party; extract the target data from the first storage block and the associated location;

[0035] If the query conditions include information about the active party and information about the passive party, the target data is extracted from the first storage block.

[0036] A third aspect of the present invention provides a relational data storage device, the relational data storage device specifically comprising:

[0037] The client is used to issue storage requests for relational data;

[0038] The middleware server is used to determine the first storage node of the relationship data based on the initiator information of the relationship data;

[0039] The storage node management module is used to determine the first storage block in the first storage node based at least on the active party information and passive party information of the relationship data;

[0040] The positioning module is used to determine the first storage location of the relationship data in the first storage block based at least on the basic information of the relationship data, wherein the basic information of the relationship data includes at least the active party information, the passive party information, and a timestamp.

[0041] The storage module stores the relationship data and relationship values ​​in the first storage location.

[0042] A fourth aspect of the present invention provides a relational data reading device, the relational data reading device specifically comprising:

[0043] A client is used to issue a relational data read request, the read request including query conditions;

[0044] The middleware server is used to determine the data storage location based on the query conditions;

[0045] An extraction module is used to match target data from the data storage location, wherein the target data is stored according to the aforementioned relational data storage method;

[0046] The output module is used to display the target data.

[0047] This invention provides a relational data storage, reading, and writing method and apparatus. The relational data storage method modifies the basis for relational data storage location, using users as the core of data storage. Data from the same active party or the same passive party is stored in a contiguous area, and the data is stored sequentially within the area. This optimizes the data storage structure and ultimately achieves the effect of storing data on a user-by-user basis at nodes. By centralizing a user's data together, data storage across multiple nodes can be performed in parallel, improving data storage efficiency. Furthermore, it avoids the need for sequential lookups required by random access methods, improving the efficiency of subsequent data retrieval. Similarly, the data retrieval method uses user information as the core for location, directly extracting the entire database associated with a user, avoiding sequential lookups and further improving data retrieval efficiency. Attached Figure Description

[0048] Figure 1 A flowchart illustrating a relational data storage method as shown in an exemplary embodiment of this application;

[0049] Figure 2 A flowchart illustrating a relational data reading method as shown in an exemplary embodiment of this application;

[0050] Figure 3 The content of basic information of relational data shown in an exemplary embodiment of this application;

[0051] Figure 4This is a schematic diagram illustrating the structure of a relational data storage device, as shown in an exemplary embodiment of this application.

[0052] Figure 5 This is a schematic diagram of a relational data reading device structure, which is an exemplary embodiment of this application. Detailed Implementation

[0053] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0054] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

[0055] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0056] The first embodiment of the present invention provides a relational data storage method, such as... Figure 1 As shown, the relational data storage method specifically includes:

[0057] The first storage node of the relationship data is determined based on the initiator information of the relationship data;

[0058] The first storage block in the first storage node is determined based at least on the active party information and passive party information of the relationship data;

[0059] The first storage location of the relationship data in the first storage block is determined based on at least the basic information of the relationship data, wherein the basic information of the relationship data includes at least the active party information, the passive party information, and a timestamp;

[0060] The relation data and relation values ​​are stored in the first storage location.

[0061] This invention provides a relational data storage method that modifies the basis for relational data storage location. It uses the user as the core of data storage, storing data from the same active or passive party in a continuous area. Furthermore, the data is stored sequentially within the area, optimizing the data storage structure. Ultimately, it achieves the effect of storing data on a user-by-user basis at nodes. By centralizing a user's data, data storage across multiple nodes can be performed in parallel, improving data storage efficiency. This further avoids the need for sequential lookups required by random access methods, thus improving the efficiency of subsequent data retrieval.

[0062] A second embodiment of the present invention provides a relational data storage method, the relational data storage method specifically including:

[0063] The first storage node of the relation data is determined based on the information of the active party in the relation data.

[0064] Relationship data specifically includes data about two users, their relationship, and their actions. The party initiating the action is called the active party, and the party receiving the action is called the passive party. Relationship information includes at least the relationship type and relationship value, and the relationship data also includes a timestamp. During application use, a large amount of relationship data is generated. Taking Tantan as an example, if user A clicks the "like" button on user B, a relationship data entry is generated, with A as the active party, B as the passive party, the relationship type being "like," and the relationship value being "like." Similarly, taking following as an example, if user C follows user D, a relationship data entry is generated, with C as the active party, D as the passive party, the relationship type being "follow," and the relationship value being "follow." In summary, relationship data includes basic information, relationship values, and additional information. The basic information includes at least the active party information, the passive party information, and a timestamp. The first storage location of the relationship data is determined based on the basic information. The relationship value represents the relationship between the active and passive parties. The additional information includes other information related to the relationship's creation, which may include user actions, the scenario in which the relationship data was generated, and additional content generated by the relationship, such as private message content.

[0065] As an optional embodiment, such as Figure 2As shown, the active party information includes at least an active party identifier, such as an active party ID; the passive party information includes at least a passive party identifier, such as a passive party ID; the basic information of the relationship data also includes the relationship type of the relationship data; the first storage node of the relationship data is determined based on the active party information of the relationship data, that is, the first storage node in the storage node cluster is first determined using the active party information in the basic information, and the first storage node stores data of multiple active parties. Before determining the first storage node of the relationship data based on the active party information of the relationship data, it may further include: pre-setting the correspondence between the active party information and each storage node in the storage node cluster.

[0066] The relational data storage method provided by this invention uses user information that generates a relationship as the storage location identifier, stores data of the same users together, avoids random storage or storage in chronological order, optimizes the data location in the memory, facilitates data management, and thus improves the efficiency of data reading.

[0067] The relational data is stored in a node cluster, which includes multiple nodes, each node containing multiple storage blocks. The active party information stored in the relational data is different for each node, and the relational data stored in each node includes multiple active party information. The passive party information stored in the relational data is different for each storage block.

[0068] After determining the first storage node, at least the first storage block in the first storage node is determined based on the active party information and passive party information of the relationship data.

[0069] The first storage node stores relational data from multiple active parties. The storage blocks for each active party are unique. The first storage block for storing the current relational data is determined based on the active party identifier and the passive party identifier. The relational data reading method further includes: dividing each storage node into N storage blocks, where a storage block stores the same active party information, but adjacent storage blocks store slightly different active party information; and selecting a blank storage block to store data based on the generation time of the relational data. Preferably, 32 LevelDB databases are connected to each storage node to perform block-based storage of user data.

[0070] The first storage location of the relationship data in the first storage block is determined based on at least the basic information of the relationship data, which includes at least the information of the active party, the information of the passive party, and a timestamp.

[0071] Furthermore, a storage order still exists within the first storage block. After locating the first storage node in the storage node cluster that stores the current active party's data, the first storage node includes relational data for multiple active parties, and the current active party has relational data with multiple passive parties. Therefore, it is further necessary to determine the first storage block based on the active party information and passive party information. Within the first storage block, the most recently generated relational data is stored in the order of timestamps. This ultimately ensures that data for the same active party and the same passive party in the first storage node are stored in the order of the timestamps. In summary, the storage location of relational data is determined comprehensively based on three pieces of information: active party information, passive party information, and timestamps, with these three pieces of information having a priority from high to low. The relational data storage method provided by this invention improves the traditional hash value addressing method for obtaining variable-length location key values ​​to fixed-length basic information, effectively utilizing storage space and improving query efficiency.

[0072] The relation data and relation values ​​are stored in the first storage location.

[0073] The relational data storage method provided by this invention transforms the random write of the LSMT data storage architecture into sequential write, thereby improving data storage efficiency. At the same time, it optimizes the data storage structure, further improving data reading efficiency.

[0074] As an optional embodiment, storing the relationship data and relationship value in the first storage location includes: obtaining transformation information of the basic information of the relationship data; storing the transformation information in the first storage location, and storing the relationship value in an associated location of the first storage location, wherein the first storage location and the associated location are separate locations. The storage location stores transformation information of the basic information, rather than the identifier of the active party, adding a fetch interface to the relationship data so that the data of the matching target active party can be directly queried through the transformation information, avoiding many invalid iterator comparisons. As an optional embodiment, the additional information of the relationship data is stored together with the relationship value in the associated location. Furthermore, this invention uses separate storage of basic information and relationship value to reduce write amplification problems during aggregation.

[0075] The relational data storage method provided by this invention stores the basic information and relational values ​​of the relational data separately. On the one hand, it saves storage space for massive amounts of basic information. On the other hand, for query requests that only need to obtain basic information, a small amount of data matching and sending is sufficient for the requesting client to obtain the required information. For query requests that need to obtain relational values ​​or additional information, it still supports the sending of the full amount of data. The improved data storage structure ensures both the efficiency and quality of data reading.

[0076] As an optional embodiment, the relational data storage method further includes: detecting the working status of the first storage node storing relational data in the node cluster; if the working status is abnormal, determining the processing method of the first storage node according to the type of abnormality, wherein the types of abnormality include at least offline and unhealthy. The relational data storage method provided by this invention, since multiple storage nodes need to be managed, employs a heartbeat mechanism to monitor the working status of each storage node in the node cluster. Specifically, when the node storing the relational data is determined to be the first storage node, the heartbeat mechanism is used to obtain the working status of the first storage node, which includes an online normal state, an offline state, and an unhealthy state. In the offline state, the storage node cannot perform read / write operations, but can be switched to the online normal state after being woken up. In the unhealthy state, the storage node cannot perform read / write operations, and a backup node needs to be found. The processing method includes at least waking up and starting a backup node. If the type of abnormality is offline, the processing method is waking up; if the type of abnormality is unhealthy, the processing method is starting a backup node.

[0077] After storing the relation data and relation values ​​in the first storage location, the method further includes:

[0078] The active and passive information in the basic information of the relationship data are exchanged to generate redundant data of the relationship data. A relationship value for the redundant data is generated based on the relationship value of the original relationship data. The active information in the basic information of the redundant data is the same as the passive information in the basic information of the original relationship data. The passive information in the basic information of the redundant data is the same as the active information in the basic information of the original relationship data. Other information in the basic information of the redundant data is the same as the corresponding information in the basic information of the original relationship data. The relationship value of the redundant data corresponds to the relationship value of the original relationship data. Preferably, the relationship value of the redundant data and the relationship value of the original relationship data have a passive relationship, such as like-being liked, dislike-being disliked, follow-being followed, unfollow-being unfollowed.

[0079] The redundant data is stored in the following ways: a second storage node is located based on the active party information of the redundant data. The first storage node and the second storage node may be the same or different. A second storage block in the second storage node is located based on the active party information and the passive party information of the redundant data. The redundant data is stored in the second storage block based on the basic information of the redundant data.

[0080] The relational data storage method provided by this invention, while storing relational data, also generates corresponding redundant data. This ensures that whether querying stored data using passive or active party information, the target data can be obtained by querying the storage space with the active party information as the query condition. For example, the relational data {A, B, like, 20230902-12:30, like} is stored, along with the corresponding redundant data {B, A, like, 20230902-12:30, liked}. If a user needs to query who A likes, querying the storage space with A as the active party will yield the target data {A, B, like, 20230902-12:30, like}; similarly, if a user needs to query who B is liked, querying the storage space with B as the active party will yield the target data {B, A, like, 20230902-12:30, liked}.

[0081] It is not difficult to see that this embodiment is a method example further described in the first embodiment, and this embodiment can be implemented in conjunction with the first embodiment. The relevant technical details mentioned in the first embodiment are still valid in this embodiment, and will not be repeated here to reduce repetition. Correspondingly, the relevant technical details mentioned in this embodiment can also be applied to the first embodiment.

[0082] The third embodiment of the present invention provides a method for reading relational data, such as... Figure 3 As shown, the relational data reading method specifically includes:

[0083] Obtain query conditions, which include information of the initiating party, information of the passive party, or information of both the initiating party and the passive party.

[0084] Specifically, the client sends a relationship data read request to the middleware server. This request includes query conditions, which can be active party information, passive party information, or both. If the query condition is active party information or passive party information, the system queries for passive parties associated with the same active party information and their relationship values ​​based on the active party information query condition. If the query condition is both active party information and passive party information, the system queries for the relationship values ​​of the same active party and the same passive party based on the query condition. The data stored in this invention supports multiple types of data queries. For example, for the stored data {A, B, like, 20230902-12:30, like} and {A, C, like, 20230902-16:30, liked}, one can query who A likes, where A's identifier is the active party information, and query A's identifier; the relationship value is the passive party information B of the data that A likes. Alternatively, one can query who A is liked, where the query condition is A's identifier as the passive party information, and further, using A's identifier as the active party information, one can query the passive party information C of the data that A likes.

[0085] The data storage location is determined according to the query conditions; target data is matched from the data storage location, wherein the target data is stored according to the relational data storage method described in Embodiment 1 or 2; and the target data is displayed.

[0086] The query conditions include information of the active party, information of the passive party, or information of both the active party and the passive party; the first storage block of the first storage node is determined according to the query conditions; the data storage location is determined according to the query conditions; the target data is matched from the data storage location, wherein the data storage location includes at least the first storage block, the first storage block, and the associated location.

[0087] If the query conditions include either active party information or passive party information, the target data is matched from the first storage block and the associated location. If the query conditions include both active party information and passive party information, the target data is matched from the first storage block. Preferably, matching the target data includes converting the query conditions into matching transformation information, and matching the matching transformation information with the transformation information of the active party information in the stored relationship data to obtain the target data. The relationship data reading method provided by this invention directly determines the target data by comparing matching transformation information and transformation information when reading data. It adds a fetch interface, avoids numerous invalid iterator comparisons, and improves the efficiency of data reading.

[0088] As an optional embodiment, displaying the target data includes: determining the display effect of the target data based on the relationship value of the target data. Preferably, active relationship values ​​and passive relationship values ​​have different display effects, and the display effect can be font, color, animation, etc.

[0089] A fourth aspect of the present invention provides a relational data storage device, such as... Figure 4 As shown, the relational data storage device specifically includes:

[0090] The client is used to issue storage requests for relational data;

[0091] The middleware server is used to determine the first storage node of the relationship data based on the initiator information of the relationship data;

[0092] The storage node management module is used to determine the first storage block in the first storage node based at least on the active party information and passive party information of the relationship data;

[0093] The positioning module is used to determine the first storage location of the relationship data in the first storage block based at least on the basic information of the relationship data, wherein the basic information of the relationship data includes at least the active party information, the passive party information, and a timestamp.

[0094] The storage module stores the relationship data and relationship values ​​in the first storage location.

[0095] It is not difficult to see that this embodiment is a device embodiment corresponding to the first and second embodiments, and this embodiment can be implemented in conjunction with the first and second embodiments. The relevant technical details mentioned in the first and second embodiments are still valid in this embodiment, and will not be repeated here to reduce repetition. Accordingly, the relevant technical details mentioned in this embodiment can also be applied to the first embodiment.

[0096] The fifth aspect of the present invention provides a relational data reading device, such as... Figure 5 As shown, the relational data reading device specifically includes:

[0097] A client is used to issue a relational data read request, the read request including query conditions;

[0098] The middleware server is used to determine the data storage location based on the query conditions;

[0099] An extraction module is used to match target data from the data storage location, wherein the target data is stored according to the relational data storage method described in Embodiment 1 or 2;

[0100] The output module is used to display the target data.

[0101] It is not difficult to see that this embodiment is a device embodiment corresponding to the third embodiment, and this embodiment can be implemented in conjunction with the third embodiment. The relevant technical details mentioned in the third embodiment are still valid in this embodiment, and will not be repeated here to reduce repetition. Accordingly, the relevant technical details mentioned in this embodiment can also be applied to the third embodiment.

[0102] It is worth mentioning that all modules involved in this embodiment are logical modules. In practical applications, a logical unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. Furthermore, to highlight the innovative aspects of this invention, this embodiment does not introduce units that are not closely related to solving the technical problem proposed by this invention; however, this does not mean that other units are absent from this embodiment.

[0103] For ease of description, the above devices are described in terms of function, divided into various units. Of course, in implementing this specification, the functions of each unit can be implemented in one or more software and / or hardware components.

[0104] Those skilled in the art will understand that the embodiments described herein can be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects.

[0105] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0106] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0107] The above description is merely an embodiment of this specification and is not intended to limit this specification. Various modifications and variations can be made to this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims of this specification.

Claims

1. A relational data storage method, characterized in that, The relational data storage method specifically includes storing data of users with the same data together: The first storage node of the relationship data is determined based on the initiator information of the relationship data; The first storage block in the first storage node is determined based at least on the active party information and passive party information of the relationship data, and the active party information stored in a storage block is the same. The first storage location of the relationship data in the first storage block is determined based on at least the basic information of the relationship data, wherein the basic information of the relationship data includes at least the active party information, the passive party information, and a timestamp; The relation data and relation values ​​are stored in the first storage location.

2. The relational data storage method according to claim 1, characterized in that, The initiating party information includes at least the initiating party identifier; The passive party information includes at least the passive party identifier; The basic information of the relational data also includes the relation type of the relational data; In the first storage node, the data of the same active party and the same passive party are stored in the order of the timestamp.

3. The relational data storage method according to claim 1, characterized in that, After storing the relation data and relation values ​​in the first storage location, the method further includes: The active party information and passive party information in the basic information of the relation data are exchanged to generate redundant data of the relation data. The active party information in the basic information of the redundant data is the same as the passive party information in the basic information of the relation data. The passive party information in the basic information of the redundant data is the same as the active party information in the basic information of the relation data. Other information in the basic information of the redundant data is the same as the corresponding information in the basic information of the relation data. The relation value of the redundant data corresponds to the relation value of the relation data. Store the redundant data.

4. The relational data storage method according to claim 1, characterized in that, Storing the relation data and relation values ​​in the first storage location includes: Transformation information to obtain the basic information of the relational data; The transformation information is stored in the first storage location, and the relationship value is stored in the associated location of the first storage location. The first storage location and the associated location are separate locations.

5. The relational data storage method according to claim 1, characterized in that, The relational data is stored in a node cluster, which includes multiple nodes, each node including multiple storage blocks. The active party information stored in the relational data is different for each node, and the relational data stored in each node includes multiple active party information. The passive party information stored in the relational data is different for each storage block. The relational data storage method further includes: The working status of the first storage node storing relational data in the node cluster is detected. If the working status is abnormal, the processing method of the first storage node is determined according to the type of abnormality. The types of abnormality include at least offline and unhealthy.

6. A method for reading relational data, characterized in that, The method for reading relational data specifically includes: Obtain query conditions, which include information of the initiating party, information of the passive party, or information of both the initiating party and the passive party; Determine the data storage location based on the query conditions; Match target data from the data storage location, wherein the target data is stored according to the relational data storage method as described in any one of claims 1-5; Display the target data.

7. The relational data reading method according to claim 6, characterized in that, The method for reading relational data specifically includes: The query conditions include information of the initiating party, information of the passive party, or information of both the initiating party and the passive party. The first storage block of the first storage node is determined based on the query conditions; Determine the data storage location based on the query conditions; Match target data from the data storage location, wherein the data storage location includes at least the first storage block, the first storage block, and the associated location.

8. The relational data reading method according to claim 6, characterized in that, The step of matching target data from the data storage location includes: If the query conditions include information about the active party or the passive party; extract the target data from the first storage block and the associated location; If the query conditions include information about the active party and information about the passive party, the target data is extracted from the first storage block.

9. A relational data storage device, characterized in that, The relational data storage device specifically includes: The client is used to issue storage requests for relational data; The middleware server is used to determine the first storage node of the relationship data based on the initiator information of the relationship data; The storage node management module is used to determine the first storage block in the first storage node based at least on the active party information and passive party information of the relationship data; The positioning module is used to determine the first storage location of the relationship data in the first storage block based at least on the basic information of the relationship data, wherein the basic information of the relationship data includes at least the active party information, the passive party information, and a timestamp. The storage module stores the relationship data and relationship values ​​in the first storage location.

10. A relational data reading device, characterized in that, The relational data reading device specifically includes: A client is used to issue a relational data read request, the read request including query conditions; The middleware server is used to determine the data storage location based on the query conditions; An extraction module is configured to match target data from the data storage location, wherein the target data is stored according to the relational data storage method as described in any one of claims 1-5; The output module is used to display the target data.