A method, apparatus, device, and storage medium for time-series data management.

By converting nodes or edges in a graph database to a preset time-series type and determining the storage path, the redundancy and complexity issues of graph databases when storing time-series data are resolved, improving management efficiency and performance.

CN115408546BActive Publication Date: 2026-03-10HENAN XINGHUAN ZHONGZHI INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-15
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing graph databases suffer from data redundancy, high modeling complexity, low performance, and narrow applicability when storing and managing time-series data, making it impossible to effectively mine data relationships and deeper information.

Method used

The system retrieves data to be processed from nodes or edges in a graph database, converts it into a preset time series type, and determines the target storage path for storage. The preset time series type is consistent with the storage structure of the graph database, simplifying the data type conversion and storage process.

Benefits of technology

It improves the management efficiency of time-series data in graph databases, simplifies data processing procedures, and enhances performance and the breadth of applicable scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115408546B_ABST
    Figure CN115408546B_ABST
Patent Text Reader

Abstract

The application discloses a kind of time series data management method, device, equipment and storage medium.The method comprises: obtaining to be processed data for node or edge in graph database;Convert the data containing time series information in to-be-processed data into preset time series type, and determine the converted data as target to-be-processed data;Determine the target storage path corresponding to target to-be-processed data, store target to-be-processed data;Wherein, preset time series type is the native data type based on the storage structure of graph database, and the data storage mode of other data types in graph database is the same.The technical scheme of the embodiment of the application converts the data type of the data with time series information obtained on node or edge by constructing the preset time series type based on the storage structure of graph database, guarantees the consistency of data storage process in node or edge, simplifies the time series data processing process, improves the time series data management efficiency, and improves the performance of graph database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a time-series data management method, apparatus, device, and storage medium. Background Technology

[0002] In the production and use of graph databases, users have increasingly demanded data with "time characteristics" in their usage scenarios, such as querying electricity records and stock price changes at different time periods, and calculating price changes within a certain time range. For the above application scenarios, graph databases need to be able to store multiple versions of certain data at different points in time, and these data have the characteristics of being frequently written but not frequently read.

[0003] Although non-graph databases such as relational databases and time-series databases have provided support for storing, querying, and computing data with time-series information, these databases do not have the ability to mine data relationships and deeper information within the data.

[0004] Some existing graph databases only support storing time-series data on edges, providing only limited functionality and failing to meet all the functional requirements of using time-series graphs. Furthermore, since time-series data cannot be stored on nodes, it is necessary to add time-series data to nodes by constructing self-loop edges, which increases the complexity of time-series graph modeling and may also increase the memory consumption of time-series data storage, reducing the performance of the graph database. Moreover, the application scope applicable to the storage of time-series data in existing graph databases is also relatively limited, the process is cumbersome, and there is no performance advantage. Summary of the Invention

[0005] This invention provides a time-series data management method, apparatus, device, and storage medium, which reduces data redundancy when managing time-series data in graph databases, simplifies the time-series data processing process, and improves the efficiency of time-series data management and the performance of graph databases.

[0006] In a first aspect, embodiments of the present invention provide a time-series data management method applied to a graph database, the method comprising:

[0007] Retrieve data to be processed from nodes or edges in a graph database;

[0008] Convert the data containing time series information into a preset time series type, and determine the converted data as the target data to be processed;

[0009] Determine the target storage path corresponding to the target data to be processed, and store the target data to be processed;

[0010] The preset time-series type is a native data type built on the storage structure of a graph database, and its data storage method is the same as that of other data types in the graph database.

[0011] Secondly, embodiments of the present invention also provide a time-series data management device applied to a graph database, the time-series data management device comprising:

[0012] The data acquisition module is used to acquire data to be processed for nodes or edges in the graph database;

[0013] The data type conversion module is used to convert data containing time series information into a preset time series type and to identify the converted data as the target data to be processed.

[0014] The data storage module is used to determine the target storage path corresponding to the target data to be processed and to store the target data to be processed.

[0015] The preset time-series type is a native data type built on the storage structure of a graph database, and its data storage method is the same as that of other data types in the graph database.

[0016] Thirdly, embodiments of the present invention also provide a time-series data management device, the time-series data management device comprising:

[0017] At least one processor; and

[0018] A memory that is communicatively connected to at least one processor; wherein,

[0019] The memory stores a computer program that can be executed by at least one processor, such that the at least one processor can implement the timing data management method of any embodiment of the present invention.

[0020] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing computer instructions that are used to cause a processor to execute the timing data management method of any embodiment of the present invention.

[0021] This invention provides a time-series data management method, apparatus, device, and storage medium applied to a graph database. The method involves: acquiring data to be processed from nodes or edges in the graph database; converting data containing time-series information into a preset time-series type and identifying the converted data as the target data to be processed; determining the target storage path corresponding to the target data to be processed; and storing the target data to be processed. The preset time-series type is a native data type built upon the storage structure of the graph database, and its data storage method is the same as other data types in the graph database. By adopting the above technical solution, for data to be processed acquired from nodes or edges stored in different graphs within the graph database, the data containing time-series information is converted to a preset time-series type, allowing the target data to be processed to be stored using the same storage method as other data types in the graph database. This invention addresses the issues of inability to directly process and store time-series data from nodes and edges in graph databases, the complexity of data relationship construction, and the narrow scope of applicable scenarios. By constructing a preset time-series type based on the storage structure of the graph database, the data type of time-series data obtained from nodes or edges is converted, ensuring the consistency of data storage in nodes or edges, simplifying the time-series data processing process, improving the efficiency of time-series data management, and thus enhancing the performance of the graph database.

[0022] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 This is a flowchart of a time-series data management method according to Embodiment 1 of the present invention;

[0025] Figure 2 This is a flowchart of a time-series data management method according to Embodiment 2 of the present invention;

[0026] Figure 3 This is an example diagram of a target data storage process in Embodiment 2 of the present invention;

[0027] Figure 4 This is a flowchart of a time-series data management method according to Embodiment 3 of the present invention;

[0028] Figure 5 This is an example diagram of a target data reading process in Embodiment 3 of the present invention;

[0029] Figure 6 This is a schematic diagram of the structure of a timing data management device according to Embodiment 4 of the present invention;

[0030] Figure 7 This is a schematic diagram of the structure of a time-series data management device according to Embodiment 5 of the present invention. Detailed Implementation

[0031] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0032] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention 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 the invention 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 a 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.

[0033] Example 1

[0034] Figure 1 This is a flowchart of a time-series data management method provided in Embodiment 1 of the present invention. The present invention is applicable to the management of data with time-series information in a graph database. The method can be executed by a time-series data management device, which can be implemented by software and / or hardware. The time-series data management device can be configured on a time-series data management device, such as a laptop, desktop computer, or smart tablet.

[0035] like Figure 1 As shown, the time-series data management method provided in Embodiment 1 of the present invention specifically includes the following steps:

[0036] S101: Obtain the data to be processed from the nodes or edges in the graph database.

[0037] In this embodiment, a graph database can be specifically understood as a data management system designed for efficient storage and retrieval of graph data, using nodes and edges as basic storage units. A node can be understood as a basic storage unit in a graph database that represents the entity portion of a graph structure expressing data. An edge can be understood as a basic storage unit that represents the association or relationship between two nodes in a graph database. The data to be processed can be understood as unprocessed data directly obtained from nodes or edges that needs to be stored in the graph database. It should be clarified that the data type of the data to be processed can be determined according to the actual application scenario and can be any general data type applicable to that scenario; this embodiment of the invention does not impose any limitations on this.

[0038] Specifically, when there is a need to store data in a graph database, nodes or edges related to the need are defined in the graph database. Unprocessed data related to the nodes or edges that need to be stored in the graph database are obtained from external sources and identified as data to be processed.

[0039] S102. Convert the data containing timing information in the data to be processed into a preset timing type, and determine the converted data as the target data to be processed.

[0040] The preset time-series type is a native data type built on the storage structure of a graph database, and its data storage method is the same as that of other data types in the graph database.

[0041] In this embodiment, data containing time-series information can be specifically understood as time-related data with the same attributes that can be repeatedly acquired at different times within the same usage scenario. For example, data containing time-series information may be electricity data obtained from an electricity meter at different times, liquid level data obtained from a liquid level gauge, and stock price data at different points in time, etc. This embodiment of the invention does not impose any limitations on this.

[0042] In this embodiment, the preset time series type can be understood as a data type that is pre-set based on the storage structure of the graph database, and is used to process and store values ​​with the same properties that can be stored in the graph database. The target data to be processed can be understood as data with time series information collected by nodes or edges that has undergone data type conversion and needs to be stored in the data set corresponding to the node or edge.

[0043] Specifically, since the data to be processed available at a node or edge can contain multiple different types, graph databases already have well-established data storage methods for general data types. At this point, for data containing time-series information, its data type is converted to a preset time-series type that can have the same data storage method as other data types in the graph database. This converted data is then identified as the target data to be processed.

[0044] In this embodiment of the invention, existing graph databases often require the construction of new nodes or edges to store data with temporal information. This makes it difficult to store data with temporal information obtained from the same node or edge into the same data set, resulting in complex structures and significant data redundancy. By constructing a preset temporal type based on the graph database's storage structure, the data containing temporal information is converted. This allows the converted target data to be stored using the same storage method as other data types in the graph database, reducing the difficulty of storing data with temporal information in the graph database and simplifying the data processing flow.

[0045] S103. Determine the target storage path corresponding to the target data to be processed, and store the target data to be processed.

[0046] In this embodiment, the target storage path can be specifically understood as the save path used to ultimately store the target data to be processed in a certain partition of the disk, or in a certain folder within the partition.

[0047] Specifically, based on the node or edge corresponding to the target data to be processed, the storage method of other data types in the graph database, and the historical storage status of data in the graph database, the target storage path of the target data to be processed in the graph database is determined. Then, the target data to be processed is stored sequentially according to the storage nodes in the target storage path until it is stored in the corresponding location on the disk.

[0048] The technical solution of this embodiment involves: acquiring data to be processed from nodes or edges in a graph database; converting data containing time-series information into a preset time-series type and determining the converted data as the target data to be processed; determining the target storage path corresponding to the target data to be processed and storing the target data to be processed; wherein, the preset time-series type is a native data type constructed based on the storage structure of the graph database, and its data storage method is the same as that of other data types in the graph database. By adopting the above technical solution, for the data to be processed acquired from nodes or edges stored in different graphs in the graph database, the data containing time-series information is converted into data types, so that the target data to be processed after conversion into the preset time-series type can be stored in the same storage method as other data types in the graph database. This solves the problems that nodes and edges in the graph database cannot be directly processed and stored for time-series data, and that the construction of data relationships is complex and the applicable scenarios are narrow. By constructing a preset time-series type based on the storage structure of the graph database, the data type conversion of data with time-series information acquired from nodes or edges ensures the consistency of data storage in nodes or edges, simplifies the time-series data processing process, improves the efficiency of time-series data management, and thus improves the performance of the graph database.

[0049] Example 2

[0050] Figure 2 This is a flowchart of a time-series data management method provided in Embodiment 2 of the present invention. The technical solution of the present invention is further optimized based on the above-mentioned optional technical solutions. First, a graph template containing time-series types is defined in the graph database. Then, the data to be processed obtained from the nodes or edges in the graph template can be converted into target data to be processed of a preset time-series type according to the applicable situation. Then, based on the ID of the corresponding node or edge and its corresponding attribute name, the target storage path in the graph database is determined and the storage is completed. This allows data with the same attribute obtained from the same node or edge at different time points to be stored in the same data set. When the stored target data to be processed contains a data deletion instruction, the data in the data set can be modified and deleted in a targeted manner. This improves the ease of managing time-series data and related data in the graph database and avoids excessive consumption of storage and computing resources.

[0051] like Figure 2 As shown in Embodiment 2 of the present invention, a time-series data management method specifically includes the following steps:

[0052] S201. Define a graph template in the graph database that contains a preset time series type.

[0053] The graph template defines the type information, attribute name, and data type corresponding to the attribute name of the node or edge corresponding to the graph template.

[0054] In this embodiment, a graph template (schema) can be understood as a data structure model set in a graph database, which defines the types of nodes or edges that may exist in a specific use case, as well as the attributes that may exist in the nodes or edges.

[0055] In this embodiment, type information can be specifically understood as information used to indicate the category of a node or edge in the graph template. For example, assuming the graph template is a template for statistical analysis of power grid information in a region, the category information of one node can be a single-household electricity meter, the category information of another node can be a collective electricity meter, and the category information of the edge connecting the single-household electricity meter and the collective electricity meter can be an edge representing a management relationship. This embodiment of the invention does not impose any limitations on this.

[0056] In this embodiment, the attribute name can be specifically understood as the name of the attribute type of the data collected by the node or edge in the graph template. Continuing with the above example, for a node whose category information is a single-household electricity meter, the attribute name of the data collected to indicate the voltage value can be recorded as voltage, and the attribute name of the data collected to indicate the total electricity consumption accumulated before the collection time can be recorded as electricity. This embodiment of the present invention does not impose any restrictions on this.

[0057] In this embodiment, the data type can be specifically understood as the data attribute corresponding to each attribute name collected from nodes or edges in the graph template, which is stored in the graph database. Continuing with the above example, assuming that the attribute name of a node is the meter name, it should be stored in the graph database in string form, and its corresponding data type is String. This embodiment of the present invention is only used as an example and does not limit the specific situation.

[0058] Specifically, for different use cases, the physical entities that may exist in the scenario and the relationships between them are defined. The type information of each physical entity and its relationships is determined, as well as the attribute types that may be included in each physical entity and its relationships, and the data type of each attribute type when stored. When defining data types, attribute types containing time-series information must be defined as preset time-series types. The defined physical entities are identified as nodes in the use case, and the defined relationships are identified as edges in the use case. The data structure model formed by the defined nodes and edges is identified as the graph template (schema) corresponding to the use case.

[0059] In this embodiment of the invention, by predefining a graph template containing a data type of a preset time sequence type, the data obtained from the nodes or edges in the graph template can be converted to the corresponding data type, thereby completing the management of this type of data in the graph database. This reduces the storage and computing resources required to manage data containing time sequence information.

[0060] S202: Obtain the data to be processed for the nodes or edges of the graph database.

[0061] S203. Convert the data containing timing information in the data to be processed into a preset timing type, and determine the converted data as the target data to be processed.

[0062] S204. Determine the target storage path based on the ID of the node or edge corresponding to the target data to be processed, and the attribute name of the target data to be processed.

[0063] In this embodiment, ID can be specifically understood as data information used to uniquely identify a node or edge within a graph in a graph database. Optionally, the row key can be used as the ID in the graph database to identify a node or edge.

[0064] Specifically, since data with the same attribute name have the same data type, and to ensure that data of the same type with time-series information obtained from the same node or edge can be stored in the same dataset for easy management, we can determine whether there is a dataset with the same ID and attribute name in the graph database by using the ID and attribute name corresponding to the target data to be processed. If it exists, the path to the dataset can be determined as the target storage path of the target data to be processed. Otherwise, a new dataset with an ID and attribute name that can be stored can be created, and the storage path of the dataset can be determined as the target storage path.

[0065] In this embodiment of the invention, by using the ID information contained in the target data to be processed and the attribute names contained therein, the storage location of data in the graph database that is the same as the target data to be processed in terms of acquisition method, attribute name and data type is determined. Then, the path to the storage location is determined as the target storage path of the target data to be processed, so that data of the same type collected from the same node or edge can be stored in the same dataset, so that subsequent management operations such as appending, modifying and deleting the same type of data can be performed in a simpler way, thereby improving the convenience of data management in the graph database.

[0066] S205. Store the target data to be processed.

[0067] For example, since the merged tree (LSM tree) structure is widely used in high-performance data storage, especially in database systems with higher data write performance requirements, this embodiment of the invention uses the merged tree structure storage method as an example to provide an example of a storage method for the target data to be processed. Figure 3 This is an example diagram of a target data storage process provided in Embodiment 2 of the present invention. It is assumed that the IDs of nodes or edges contained in the target data to be processed are represented in rowkey format, the time sequence information is represented in time format, the attribute names are represented in name format, and the values ​​corresponding to the time sequence information under the same attribute name are represented in value format. Figure 3 This demonstrates a process for writing data of a predefined time-series type into a graph database, such as... Figure 3 As shown, the rowkey of this data is 1, the time point (i.e., the time series information) is 8:00, the attribute name is Electric quantity, and the value is b. It should be noted that, for simplicity... Figure 3 The details of the time point, such as year, month, day, minute, and second, have been omitted, as have the attribute names. When writing the above data, write 1 is triggered first, causing the data to be written to the Write-Ahead Logging (WAL) system on disk for subsequent data maintenance and recovery purposes. Then, write 2 is triggered, causing the data to be written to the memTable in memory. When the memTable meets certain conditions, it will be immediately marked as an immutable memTable. New data will not be written to the immutable memTable, and a new memTable will be created in memory for writing new data. At this time, the data in the immutable memTable will be written from memory to the sstable in the disk file at level 0. Subsequently, according to the preset time nodes, the data at level 0 will be merged with the old data through a compaction process until the data is stored in the lowest-level data set with rowkey 1 and attribute name "Electric quantity" on disk.

[0068] S206. If the target data to be processed includes a complete data deletion instruction, then delete all data in the target storage path.

[0069] In this embodiment, the complete data deletion instruction can be understood as an instruction given externally and input through nodes or edges to completely delete the information in the graph database that corresponds to its acquisition method and attributes.

[0070] Specifically, if the target data to be processed obtained from a node or edge contains a complete data deletion instruction, it can be assumed that when the graph database stores this data, its purpose is to delete all data in the region of the graph database used to store the data obtained from the node or edge that has the same attribute name as the target data to be processed. Therefore, after the target data to be processed is stored to the lowest level of the disk according to the target storage path, the data containing the complete data deletion instruction that has the same ID and attribute name as the target data to be processed is deleted.

[0071] S207. If the target data to be processed includes a custom data deletion instruction, then the data to be deleted is determined according to the custom data deletion instruction, and the data to be deleted is deleted from the graph database.

[0072] In this embodiment, a custom data deletion instruction can be understood as an instruction designed according to actual conditions and provided externally, input via nodes or edges, used to partially modify or delete information in the graph database corresponding to its acquisition method and attributes. For example, a custom data deletion instruction can be an instruction to delete data within a preset time period, or it can be an instruction to delete other custom data types; this embodiment of the invention does not impose any limitations on this. The data to be deleted can be understood as the data in the graph database and the target storage path that needs to be deleted, as determined according to the custom data deletion instruction.

[0073] Specifically, if the target data to be processed obtained from a node or edge contains a custom data deletion instruction, it can be assumed that when the external user stores the data, the purpose is to delete part of the data in the region of the graph database used to store the data obtained from the node or edge. Therefore, after the target data to be processed is stored to the lowest level of the disk according to the target storage path, the data contained in each node in the target storage path is detected, and the data that meets the requirements of the custom data deletion instruction is determined as the data to be deleted, and the data to be deleted is deleted from the target storage path.

[0074] It should be clarified that, depending on the information contained in the target data to be processed, steps S206 and S207 are selectively executed, and only one operation can be performed on the data in the same target storage path at the same time.

[0075] Optionally, data processing strategies can be pre-configured in the graph database. For example, after a preset number of data storage operations are completed in the same target storage path, the earliest stored data in that target storage path that exceeds the preset number of operations can be deleted. Alternatively, data in all storage paths can be permanently retained by default. Alternatively, data of nodes or edges with preset type information in the graph database can be retained, or data with preset attribute names in the graph database can be retained within a preset time period. The above strategies are only examples of some data processing strategies in the graph database, and the embodiments of the present invention do not limit the specific data processing strategies in the graph database.

[0076] The technical solution of this embodiment first defines a graph template containing time-series types in the graph database. When obtaining data to be processed for nodes or edges in the graph template, the data with time-series information can be converted into target data to be processed of a preset time-series type. Based on the ID of the corresponding node or edge and its corresponding attribute name, the target storage path in the graph database is determined and the storage is completed. This allows data with the same attribute obtained from the same node or edge at different time points to be stored in the same data set. Furthermore, when the target data to be processed includes a complete data deletion instruction or a custom data deletion instruction, targeted modification and deletion operations can be performed on the data set. The lifecycle of nodes and edges can be flexibly controlled through the data obtained from nodes and edges, improving the ease of managing time-series data and related data in the graph database and avoiding excessive consumption of storage and computing resources.

[0077] Example 3

[0078] Figure 4 This is a flowchart of a time-series data management method provided in Embodiment 3 of the present invention. The technical solution of the present invention is further optimized based on the above optional technical solutions. After any target data to be processed is stored in the graph database, if a topology query operation is received for the graph database, the time to be queried can be determined according to the topology query operation. Then, the target query data containing the time-series information corresponding to that time can be read from the graph database, and the graph database model topology corresponding to that time can be determined according to the target query data. Since the edges related to the data of that node should also be deleted from the topology after the data in the node is deleted, the dynamic changes of the topology information of the corresponding graph can be clearly understood by querying the data at different times in the graph database. This enriches the user's ability to operate on the data and makes the changes of information contained in each graph in the graph database more intuitive and easy to understand.

[0079] like Figure 4 As shown in Embodiment 3 of the present invention, a time-series data management method specifically includes the following steps:

[0080] S301. Define a graph template in the graph database that contains a preset time sequence type.

[0081] S302: Obtain the data to be processed for the nodes or edges of the graph database.

[0082] S303. Convert the data containing timing information in the data to be processed into a preset timing type, and determine the converted data as the target data to be processed.

[0083] S304. Determine the target storage path corresponding to the target data to be processed, and store the target data to be processed.

[0084] S305. After receiving a topology query operation on the graph database, determine the target query time based on the topology query operation.

[0085] In this embodiment, a topology query operation can be understood as an externally provided instruction to query the relationships and structures between nodes and edges in one or more scene-corresponding graphs stored in a graph database. The target query time can be understood as the time at which data in the desired query topology is acquired. It should be clarified that the topology query operation can be performed on the topology of a single graph at a single time node in the graph database, or on the topology of multiple graphs at the same time node, or on the topology of multiple graphs at different time nodes. This embodiment of the invention does not impose any limitations on this.

[0086] Specifically, after receiving a topology query operation for one or more scene-corresponding graphs, the graph database determines the time information contained in the topology to be queried from the topology query operation, and uses this time information as the collection time of the data in the graph database to constitute the topology to be queried, and determines the collection time as the target query time.

[0087] S306. Read the target query data containing the time series information corresponding to the target query time from the graph database.

[0088] In this embodiment, the target query data can be specifically understood as all the data in the graph database used to construct the graph corresponding to the topology query operation, where the data type is a preset time series type and the time series information contained therein is the target query time.

[0089] Specifically, all data of the graph corresponding to the topology query operation is determined from the graph database, and the data to be queried with the data type of the preset time series type is determined from the above data. The data whose time series information in each data to be queried corresponds to the target query time is determined as the target query data.

[0090] S307. Determine the graph database model topology corresponding to the target query time based on the target query data.

[0091] Specifically, the topology is constructed based on the relationship between each node and edge in the target query data, and this topology is determined as the graph database model topology corresponding to the target query time.

[0092] Furthermore, in production use scenarios for graph databases, users also have the need to query data with time-series information, or to perform calculations and analyses on data collected from the same node or edge within a certain time period, showing changes in the same attribute name. In these cases, it is necessary to perform data read operations from the graph database. Therefore, after storing the target data to be processed, the process also includes:

[0093] If a data read operation is detected, the data to be read is retrieved from the target storage path according to the preset read order; the data to be read is processed according to the preset data processing method to determine the target data to be read.

[0094] The preset data processing methods include at least sorting and deduplication.

[0095] Furthermore, the data to be read is obtained from the target storage path according to the preset reading order, including: obtaining the data to be read from the target storage path according to the order in which the data was stored.

[0096] In this embodiment, the data read operation can be understood as an operation instruction given from the outside to read one or more types of data stored on nodes or edges in the graph database. The preset read order can be understood as the order in which data is read from the graph database according to the storage structure of the graph database.

[0097] Following the example above, the data storage process in a graph database is as follows: Figure 3 As shown in the example, Figure 5 This is an example diagram illustrating a target data reading process provided in Embodiment 3 of the present invention. Figure 5 As shown, when the graph database detects a data read operation, it determines the target storage path of the data the user needs to read in the graph database based on the data read operation, and then reads the corresponding data from the target storage path according to the storage order from newest to oldest. Figure 3 Taking the target storage path as an example, the process involves sequentially reading data from the memory table and the immutable memory table in memory, and then sequentially reading data from the SSTable in the disk file in order from level 0 to level 3. Figure 5The data in the target storage path is read in sequence from 1 to 6, and the read data is determined as the data to be read. Since the graph database storage occurs simultaneously during the data reading process, new data may overwrite old data. This embodiment of the invention provides a scheme using TreeMap to sort and deduplicate the acquired data to be read, ensuring the integrity and accuracy of the acquired data, and finally determining the processed data as the target data to be read.

[0098] In this embodiment of the invention, using the TreeMap method to process the data to be read is merely one optional implementation scheme provided by this embodiment. This method maintains the order and redundancy of data during reading, and has high efficiency. It should be noted that TreeMap is only one possible data processing method, and this embodiment of the invention does not limit the type of data processing method that can be used.

[0099] The technical solution of this embodiment defines a graph template containing a preset time series type in the graph database, so that subsequent graphs for different application scenarios contain data of the preset time series type. This allows changes in the topology of each graph in the graph database to be transformed into changes in data containing time series information. Users can perceive the dynamic changes of the preset time series type data by performing topology queries on the graph database, enriching users' ability to manipulate data and making the changes in the information contained in each graph in the graph database more intuitive and easy to understand.

[0100] Example 4

[0101] Figure 6 This is a schematic diagram of a time-series data management device provided in Embodiment 4 of the present invention. The time-series data management device includes: a data acquisition module 41, a data type conversion module 42, and a data storage module 43.

[0102] The data acquisition module 41 is used to acquire data to be processed for nodes or edges in the graph database; the data type conversion module 42 is used to convert data containing time sequence information into a preset time sequence type and determine the converted data as the target data to be processed; the data storage module 43 is used to determine the target storage path corresponding to the target data to be processed and store the target data to be processed; wherein, the preset time sequence type is a native data type built based on the storage structure of the graph database, and the data storage method is the same as that of other data types in the graph database.

[0103] The technical solution of this embodiment addresses the issue of time-series data in graph databases, obtained from nodes or edges within different graphs. It converts the data to a preset time-series type, allowing the converted data to be stored using the same storage method as other data types in the graph database. This solves the problems of inability to directly process and store time-series data from nodes and edges, complex data relationship construction, and a narrow range of applicable scenarios. By constructing a preset time-series type based on the graph database's storage structure, and converting the time-series data obtained from nodes or edges, the consistency of data storage in nodes or edges is ensured, the time-series data processing process is simplified, and the efficiency of time-series data management is improved, thereby enhancing the performance of the graph database.

[0104] Optionally, the time-series data management device also includes:

[0105] The graph template definition module is used to define a graph template containing a preset time sequence type in the graph database before obtaining the data to be processed for the nodes or edges in the graph database. The graph template defines the type information, attribute name, and data type corresponding to the attribute name of the node or edge corresponding to the graph template.

[0106] Optionally, the time-series data management device also includes:

[0107] The topology query module is used to determine the target query time based on the topology query operation after receiving a topology query operation to the graph database; read the target query data containing the time series information corresponding to the target query time from the graph database; and determine the graph database model topology corresponding to the target query time based on the target query data.

[0108] Optionally, a data storage module is used to determine the target storage path based on the ID of the node or edge corresponding to the target data to be processed, and the attribute name of the target data to be processed.

[0109] Optionally, the time-series data management device also includes:

[0110] The data deletion module is used to delete all data in the target storage path after storing the target data to be processed. If the target data to be processed includes a complete data deletion instruction, the module will delete the data to be deleted according to the custom data deletion instruction and delete the data to be deleted from the graph database.

[0111] Optionally, the time-series data management device also includes:

[0112] The data reading module is used to retrieve the data to be read from the target storage path according to a preset reading order after storing the target data to be processed. The data to be read is then processed according to a preset data processing method to determine the target data to be read. The preset data processing method includes at least sorting and deduplication.

[0113] Furthermore, the data to be read is retrieved from the target storage path according to a preset reading order, including:

[0114] The data to be read is retrieved from the target storage path according to the order in which the data is stored.

[0115] The timing data management device provided in this embodiment of the invention can execute the timing data management method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method execution.

[0116] Example 5

[0117] Figure 7 This is a schematic diagram of a time-series data management device according to Embodiment 5 of the present invention. The time-series data management device 50 can be an electronic device, intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0118] like Figure 7 As shown, the timing data management device 50 includes at least one processor 51 and a memory, such as a read-only memory (ROM) 52 and a random access memory (RAM) 53, communicatively connected to the at least one processor 51. The memory stores computer programs executable by the at least one processor. The processor 51 can perform various appropriate actions and processes based on the computer program stored in the ROM 52 or loaded from storage unit 58 into the RAM 53. The RAM 53 can also store various programs and data required for the operation of the timing data management device 50. The processor 51, ROM 52, and RAM 53 are interconnected via a bus 54. An input / output (I / O) interface 55 is also connected to the bus 54.

[0119] Multiple components in the timing data management device 50 are connected to the I / O interface 55, including: an input unit 56, such as a keyboard, mouse, etc.; an output unit 57, such as various types of displays, speakers, etc.; a storage unit 58, such as a disk, optical disk, etc.; and a communication unit 59, such as a network card, modem, wireless transceiver, etc. The communication unit 59 allows the timing data management device 50 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0120] Processor 51 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 51 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 51 performs the various methods and processes described above, such as timing data management methods.

[0121] In some embodiments, the timing data management method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 58. In some embodiments, part or all of the computer program may be loaded and / or installed onto the timing data management device 50 via ROM 52 and / or communication unit 59. When the computer program is loaded into RAM 53 and executed by processor 51, one or more steps of the timing data management method described above may be performed. Alternatively, in other embodiments, processor 51 may be configured to perform the timing data management method by any other suitable means (e.g., by means of firmware).

[0122] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0123] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0124] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0125] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0126] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0127] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0128] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0129] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A time-series data management method, characterized in that, Applied to a graph database, the method comprises: obtaining to-be-processed data for a node or an edge in the graph database; converting data containing time sequence information in the to-be-processed data into a preset time sequence type, and determining the converted data as target to-be-processed data; determining a target storage path corresponding to the target to-be-processed data, and storing the target to-be-processed data; wherein the preset time sequence type is a native data type constructed based on the storage structure of the graph database, and the data storage manner is the same as that of other data types in the graph database; wherein, before the to-be-processed data for the node or the edge in the graph database is obtained, it further comprises: defining a graph template containing a preset time sequence type in the graph database; wherein, the graph template defines type information of a node or an edge corresponding to the graph template, an attribute name, and a data type corresponding to the attribute name.

2. The method of claim 1, wherein, The method further comprises: after receiving a topology query operation on the graph database, determining a target query time according to the topology query operation; reading target query data containing time sequence information corresponding to the target query time from the graph database; determining a graph database model topology corresponding to the target query time according to the target query data.

3. The method of claim 1, wherein, The determination of the target storage path corresponding to the target to-be-processed data comprises: determining a target storage path according to the ID of the node or the edge corresponding to the target to-be-processed data and the attribute name of the target to-be-processed data.

4. The method of claim 1, wherein, After storing the target to-be-processed data, it further comprises: if the target to-be-processed data includes a complete data deletion instruction, delete all data in the target storage path; if the target to-be-processed data includes a custom data deletion instruction, determine to-be-deleted data according to the custom data deletion instruction, and delete the to-be-deleted data from the graph database.

5. The method of claim 1, wherein, After storing the target to-be-processed data, it further comprises: if a data reading operation is detected, obtaining to-be-read data from the target storage path in a preset reading order; processing the to-be-read data according to a preset data processing manner to determine target read data; wherein, the preset data processing manner at least includes sorting and deduplication.

6. The method of claim 5, wherein, The to-be-read data is obtained from the target storage path in a preset reading order, comprising: obtaining to-be-read data from the target storage path in a data storage order.

7. A timing data management apparatus characterized by comprising: Applied to a graph database, the device comprises: a data acquisition module for obtaining to-be-processed data for a node or an edge in the graph database; a data type conversion module for converting data containing time sequence information in the to-be-processed data into a preset time sequence type, and determining the converted data as target to-be-processed data; a data storage module for determining a target storage path corresponding to the target to-be-processed data, and storing the target to-be-processed data; wherein the preset time sequence type is a native data type constructed based on the storage structure of the graph database, and the data storage manner is the same as that of other data types in the graph database; wherein, the time sequence data management device, further comprises: The graph template definition module is configured to define a graph template containing a preset time sequence type in the graph database before the node or edge in the graph database acquires the to-be-processed data; wherein, the graph template defines type information of a node or edge corresponding to the graph template, an attribute name, and a data type corresponding to the attribute name.

8. A time-series data management device characterized by comprising: The time sequence data management device comprises: at least one processor; and a memory connected in communication with the at least one processor; wherein, the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the time sequence data management method in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for enabling the processor to execute the time sequence data management method in any one of claims 1-6.

Citation Information

Patent Citations

  • A fast storage and query method of time-varying graph data

    CN109145121A

  • System and method for recommending paths with consideration for condition and features of users

    KR1020180017637A