CN115408546A - Time sequence data management method, device, equipment and storage medium - Google Patents

Time sequence data management method, device, equipment and storage medium Download PDF

Info

Publication number
CN115408546A
CN115408546A CN202211124466.3A CN202211124466A CN115408546A CN 115408546 A CN115408546 A CN 115408546A CN 202211124466 A CN202211124466 A CN 202211124466A CN 115408546 A CN115408546 A CN 115408546A
Authority
CN
China
Prior art keywords
data
target
processed
time sequence
graph database
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211124466.3A
Other languages
Chinese (zh)
Inventor
冀思成
王志平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Henan Xinghuan Zhongzhi Information Technology Co ltd
Transwarp Technology Shanghai Co Ltd
Original Assignee
Henan Xinghuan Zhongzhi Information Technology Co ltd
Transwarp Technology Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Henan Xinghuan Zhongzhi Information Technology Co ltd, Transwarp Technology Shanghai Co Ltd filed Critical Henan Xinghuan Zhongzhi Information Technology Co ltd
Priority to CN202211124466.3A priority Critical patent/CN115408546A/en
Publication of CN115408546A publication Critical patent/CN115408546A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/53Querying
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9537Spatial or temporal dependent retrieval, e.g. spatiotemporal queries

Abstract

The invention discloses a time sequence data management method, a time sequence data management device, time sequence data management equipment and a storage medium. The method comprises the following steps: acquiring data to be processed for nodes or edges in a graph database; converting data containing time sequence information in the data to be processed into a preset time sequence type, and determining the converted data as target data to be processed; determining a target storage path corresponding to target data to be processed, and storing the target data to be processed; the preset time sequence type is a native data type constructed based on a storage structure of the graph database, and the preset time sequence type is the same as the data storage mode of other data types in the graph database. According to the technical scheme of the embodiment of the invention, the preset time sequence type of the storage structure based on the graph database is constructed, and the data type conversion is carried out on the data with the time sequence information acquired from the nodes or the edges, so that the consistency of the data storage process in the nodes or the edges is ensured, the time sequence data processing process is simplified, the time sequence data management efficiency is improved, and the graph database performance is improved.

Description

Time sequence data management method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for managing time series data.
Background
In the production and use process of the graph database, users have an increasing demand for data with time characteristics in use scenes, such as querying electric quantity records and stock price changes in different time periods, calculating price changes in a certain time range, and the like.
Non-graph databases, such as relational databases and time series databases, provide support for storing, querying, and calculating data with time series information, but the databases do not have the capability of mining data relationships and information at a deeper level in the data.
Some existing graph databases only support storing of time sequence data on the edge, only limited functional support can be provided, all functions of a time sequence graph cannot be used, and time sequence data cannot be stored on points, so that time sequence data need to be added to the points in a self-surrounding edge mode, complexity of modeling of the time sequence graph is increased, memory consumption of time sequence data storage may be increased, performance of the graph database is reduced, applicable application range of the existing graph databases is limited when the time sequence data are stored, and the process is complicated and has no performance advantages.
Disclosure of Invention
The invention provides a time sequence data management method, a time sequence data management device, a time sequence data management equipment and a storage medium, which reduce data redundancy in a database when the time sequence data is managed, simplify the time sequence data processing process and improve the time sequence data management efficiency and the database performance.
In a first aspect, an embodiment of the present invention provides a time series data management method, applied to a graph database, where the method includes:
acquiring data to be processed for nodes or edges in a graph database;
converting data containing time sequence information in the data to be processed into a preset time sequence type, and determining the converted data as target data to be processed;
determining a target storage path corresponding to target data to be processed, and storing the target data to be processed;
the preset time sequence type is a native data type constructed based on a storage structure of the graph database, and the preset time sequence type is the same as the data storage mode of other data types in the graph database.
In a second aspect, an embodiment of the present invention further provides a time series data management apparatus, which is applied to a graph database, and includes:
the data acquisition module is used for acquiring data to be processed for nodes or edges in the graph database;
the data type conversion module is used for converting data containing time sequence information in the data to be processed into a preset time sequence type and determining the converted data as target data to be processed;
the data storage module is used for determining a target storage path corresponding to the target data to be processed and storing the target data to be processed;
the preset time sequence type is a native data type constructed based on a storage structure of the graph database, and the preset time sequence type is the same as the data storage mode of other data types in the graph database.
In a third aspect, an embodiment of the present invention further provides a time series data management device, where the time series data management device includes:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to implement the method for time series data management of any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where computer instructions are stored, and the computer instructions are configured to, when executed, cause a processor to implement the time series data management method according to any embodiment of the present invention.
The time sequence data management method, the time sequence data management device, the time sequence data management equipment and the time sequence data management storage medium are applied to a graph database, and data to be processed are obtained for nodes or edges in the graph database; converting data containing time sequence information in the data to be processed into a preset time sequence type, and determining the converted data as target data to be processed; determining a target storage path corresponding to target data to be processed, and storing the target data to be processed; the preset time sequence type is a native data type constructed based on a storage structure of the graph database, and the preset time sequence type is the same as the data storage mode of other data types in the graph database. By adopting the technical scheme, the data with the time sequence information in the data to be processed, which is obtained by aiming at the nodes or edges in different graphs stored in the graph database, is subjected to data type conversion, so that the converted target data to be processed with the preset time sequence type can be stored in the same storage mode as the data of other data types in the graph database. The problem of in the picture data base node and limit can't directly carry out time sequence data processing and storage, data relation is found complicacy and is suitable for the scene scope narrowly is solved, through the predetermined time sequence type of establishing the storage structure based on picture data base, carry out data type conversion to the data that have the time sequence information that node or edge obtained, guaranteed the uniformity of node or limit data storage process, simplified time sequence data processing procedure, improved time sequence data management efficiency, and then promoted picture data base performance.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart illustrating a method for managing time series data according to one embodiment of the present invention;
FIG. 2 is a flowchart of a time series data management method according to a second embodiment of the present invention;
FIG. 3 is a diagram illustrating an exemplary process of storing target to-be-processed data according to a second embodiment of the present invention;
FIG. 4 is a flowchart of a time series data management method according to a third embodiment of the present invention;
FIG. 5 is a diagram illustrating a read flow of target read data according to a third embodiment of the present invention;
FIG. 6 is a schematic structural diagram of a timing data management apparatus according to a fourth embodiment of the present invention;
fig. 7 is a schematic structural diagram of a time-series data management apparatus in a fifth embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in other sequences than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
Fig. 1 is a flowchart of a time series data management method according to an embodiment of the present invention, where the time series data management method according to an embodiment of the present invention is applicable to a case where data with time series information in a graph database is managed, and the method may be executed by a time series data management apparatus, where the time series data management apparatus may be implemented by software and/or hardware, and the time series data management apparatus may be configured on a time series data management device, where the time series data management device may be a notebook, a desktop, an intelligent tablet, and the like.
As shown in fig. 1, a method for managing time series data according to an embodiment of the present invention includes the following steps:
s101, acquiring data to be processed for nodes or edges in a graph database.
In the present embodiment, the graph database may be specifically understood as a data management system based on node and edge-based storage units, and efficiently storing and querying graph data as a design principle. A node may be understood to be a base storage unit in a graph database that indicates a physical portion of a graph structure representing data. An edge may be specifically understood as a base storage unit used to indicate an association, or relationship, between two nodes in a graph database. The data to be processed is specifically understood to be unprocessed data directly acquired by a node or an edge, and needs to be stored in a graph database. It should be clear that the data type of the data to be processed may be determined according to an actual application scenario, and may be all general data types in the application scenario, which is not limited in this embodiment of the present invention.
Specifically, when there is a need to store data into a graph database, a node or an edge related to the need is defined in the graph database, and the unprocessed data, which is related to the node or the edge and needs to be stored into the graph database, is acquired from the outside and is determined as data to be processed.
S102, converting data containing time sequence information in the data to be processed into a preset time sequence type, and determining the converted data as target data to be processed.
The preset time sequence type is a native data type constructed based on a storage structure of the graph database, and the preset time sequence type is the same as the data storage mode of other data types in the graph database.
In this embodiment, the data including the timing information may be specifically understood as data having time characteristics, which have the same attribute and can be repeatedly acquired at different times in the same usage scenario. For example, the data including the time sequence information may be electric quantity data acquired from an electric meter at different times, liquid level data acquired from a liquid level meter, stock price data at different time points, and the like, which is not limited in this embodiment of the present invention.
In the present embodiment, the preset time sequence type may be specifically understood as a type of data that is preset based on the storage structure of the graph database, and that processes and stores values having the same property that can be stored into the graph database. The target data to be processed can be specifically understood as data which is acquired by a node or an edge, has time sequence information and needs to be stored in a data set corresponding to the node or the edge after data type conversion is completed.
In particular, since the data to be processed available at a node or edge may include a plurality of different types, a data database for general types has been provided with a sophisticated data storage method. And at this moment, converting the data type of the data containing the time sequence information in the data to be processed into a preset time sequence type which can have the same data storage mode with the data of other data types in the graph database, and determining the data to be processed converted into the preset time sequence type as target data to be processed.
In the embodiment of the invention, because a new node or edge is often required to be constructed and stored in the existing graph database aiming at the data with the time sequence information, the data with the time sequence information acquired by the same node or edge is difficult to be stored in the data set corresponding to the same node or edge, so that the structure in the graph database is complex, and greater data redundancy can be brought. The preset time sequence type of the storage structure based on the graph database is established, and the type conversion is carried out on the data containing the time sequence information in the data to be processed, so that the target data to be processed obtained through conversion can be stored in the storage mode the same as that of other data types in the graph database, the difficulty of storing the data with the time sequence information in the graph database is reduced, and the data processing flow of the graph database is simplified.
S103, determining a target storage path corresponding to the target data to be processed, and storing the target data to be processed.
In this embodiment, the target storage path may be specifically understood as a saving path for finally storing the target to-be-processed data to a certain partition of the disk or a certain folder of the partition.
Specifically, a target storage path of the target data to be processed in the graph database is determined according to nodes or edges corresponding to the target data to be processed, storage modes of other data types of the data in the graph database and historical storage conditions of the data in the graph database, and then the target data to be processed are sequentially stored according to the storage nodes in the target storage path until the target data to be processed are stored to corresponding positions in a magnetic disk.
According to the technical scheme of the embodiment, the data to be processed is obtained for the nodes or edges in the graph database; converting data containing time sequence information in the data to be processed into a preset time sequence type, and determining the converted data as target data to be processed; determining a target storage path corresponding to target data to be processed, and storing the target data to be processed; the preset time sequence type is a native data type constructed based on the storage structure of the graph database, and the data storage mode of the preset time sequence type is the same as that of other data types in the graph database. By adopting the technical scheme, the data with the time sequence information is subjected to data type conversion aiming at the data to be processed acquired by the nodes or edges in different graphs stored in the graph database, so that the converted data to be processed is the target data to be processed with the preset time sequence type, and the data to be processed can be stored in the same storage mode as the data of other data types in the graph database. The problem of in the picture data base node and limit can't directly carry out time sequence data processing and storage, data relation is found complicacy and is suitable for the scene scope narrowly is solved, through the predetermined time sequence type of establishing the storage structure based on picture data base, carry out data type conversion to the data that have the time sequence information that node or edge obtained, guaranteed the uniformity of node or limit data storage process, simplified time sequence data processing procedure, improved time sequence data management efficiency, and then promoted picture data base performance.
Example two
Fig. 2 is a flowchart of a time series data management method according to a second embodiment of the present invention, which is further optimized based on the optional technical solutions, and the technical solution according to the second embodiment of the present invention is that a graph template including a time series type is defined in a graph database, so that to-be-processed data obtained from a node or an edge in the graph template can be converted into target to-be-processed data of a preset time series type according to an application situation, and further a target storage path in the graph database is determined and storage is completed according to an ID of the node or the edge corresponding to the graph template and an attribute name corresponding to the graph template, so that data of the same attribute obtained from the same node or the edge at different time points can be stored in the same data set, and further when the stored target to-be-processed data includes a data deletion instruction, operations such as modifying and deleting data in the data set can be performed in a targeted manner, so that convenience in managing time series type data and related data in the graph database is improved, and consumption of excessive storage resources and calculation resources is avoided.
As shown in fig. 2, a time series data management method provided in the second embodiment of the present invention specifically includes the following steps:
s201, defining a graph template containing a preset time sequence type in a graph database.
The graph template defines type information and attribute names of nodes or edges corresponding to the graph template, and data types corresponding to the attribute names.
In this embodiment, a graph template (schema) may be specifically understood as a data structure model that is set in a graph database and defines types of nodes or edges that may exist in a specific usage scenario and attributes that may exist in the nodes or edges.
In the present embodiment, the type information is specifically understood as information indicating the category of the node or edge itself in the graph template. For example, assuming that the graph template is a template for performing statistics on grid information in a region, the category information of one node may be a single-household electric meter, the category information of another node may be a collective electric meter, and the category information of an edge connecting the single-household electric meter and the collective electric meter may be an edge representing a management relationship, which is not limited in this embodiment of the present invention.
In this embodiment, the attribute name may be specifically understood as a name of an attribute type of the node or the edge collected data in the graph template, and as described in the above example, for a node whose category information is a single household electricity meter, the attribute name of the collected data indicating the voltage value may be recorded as a voltage, and the attribute name of the collected data indicating the total amount of electricity consumed before the collection time may be recorded as an electricity amount.
In the present embodiment, the data type may be specifically understood as a data attribute corresponding to each attribute name collected in a node or edge in the graph template when the data is stored in the graph database. In the above example, it is assumed that the attribute name of a node is a spreadsheet name, which should be stored in the graph database in the form of a character String, and the corresponding data type is a String type, and this is only taken as an example, and the embodiment of the present invention is not limited to a specific situation.
Specifically, for different usage scenarios, physical entities possibly existing in the scenario and correlation among the physical entities are defined, type information of the physical entities and the correlation is determined, attribute types possibly included in the physical entities and the correlation are determined, data types of the attribute types during storage are determined, and when data types are defined, data attributes of the attribute types including time sequence information need to be defined as preset time sequence types. And determining the defined physical entities as nodes under the use scene, determining the defined correlation relations as edges under the use scene, and determining a data structure model formed by the defined nodes and edges as a graph template (schema) corresponding to the use scene.
In the embodiment of the invention, the graph template containing the data type of the preset time sequence type is predefined, so that the data acquired aiming at the nodes or edges in the graph template can be subjected to corresponding data type conversion, the management of the data of the type in the graph database is further completed, and the storage resource and the calculation resource which are required to be consumed for managing the data containing the time sequence information are reduced.
S202, acquiring data to be processed for nodes or edges of a graph database.
S203, converting the data containing the time sequence information in the data to be processed into a preset time sequence type, and determining the converted data as target data to be processed.
S204, determining a target storage path according to the ID of the corresponding node or edge of the target data to be processed and the attribute name of the target data to be processed.
In the present embodiment, ID is specifically understood as data information used to uniquely indicate the identity of a node or an edge in one graph in the graph database, and optionally, a row key (Rowkey) may be used as the ID used to indicate the node or the edge in the graph database.
Specifically, since the data types of the data with the same attribute name are the same, and to ensure that the data of the same type with the time sequence information can be stored in the same data set for management, the data of the same type with the time sequence information can be acquired from the same node or edge, it can be determined whether a data set with the same ID and attribute name exists in the graph database through the ID and attribute name corresponding to the target data to be processed, if so, the path stored in the data set can be determined as the target storage path of the target data to be processed, otherwise, a data set with the ID and attribute name can be newly established, and the storage path of the data set can be determined as the target storage path.
In the embodiment of the invention, the storage position of the data with the same acquisition mode, attribute name and data type as the target data to be processed in the graph database is determined for the target data to be processed through the ID information and the attribute name contained in the target data to be processed, and the path stored to the position is determined as the target storage path of the target data to be processed, so that the data of the same type collected by the same node or edge can be stored in the same data set, the follow-up management operations such as addition, modification, deletion and the like can be carried out on the data of the same type in a simpler and more convenient mode, and the convenience of data management in the graph database is improved.
And S205, storing the target data to be processed.
Exemplarily, since a merge Tree (LSM Tree) structure is widely applied to high-performance data storage, especially in a database system with a higher requirement on data writing performance, an embodiment of the present invention takes a merge Tree structure storage manner as an example to give an example of a storage manner of target to-be-processed data, and fig. 3 is an exemplary diagram of a target to-be-processed data storage flow provided by a second embodiment of the present invention. Assume that the ID of a node or an edge contained in target data to be processed is represented in a rowkey format, where the contained time information is represented in a time format, the attribute name is represented in a name format, and a value corresponding to the time information under the same attribute name is represented in a value format. Fig. 3 shows a process of writing a piece of data of a preset time sequence type into a graph database, as shown in fig. 3, a rowkey of the piece of data is 1, a time point, that is, time sequence information is 8. When the data is written, firstly, triggering Write-1 to enable the data to be written into a Write-Ahead Logging (WAL) system in a disk, so as to be used for the purposes of data maintenance and recovery and the like in the following; triggering the write-in 2 to write the data into a memory table (memTable) in the memory, marking the memory table as an Immutable memory table (Immutable memTable) immediately after the memory table meets a certain condition, not writing the new data into the Immutable memory table, and generating a new memory table in the memory for writing in the new data; at this time, the data in the invariant memory table is written into the sstable in the disk file from the memory, the level is 0, and then the data in the level 0 is merged with old data through a compact process according to a preset time node until the data is stored into a data set of the lowest layer of the disk, wherein the rowkey is 1 and the attribute name is Electric quality.
And S206, if the target data to be processed comprises a complete data deleting instruction, deleting all data in the target storage path.
In this embodiment, the complete data deleting instruction may be specifically understood as an instruction given from the outside, input via a node or an edge, and used for completely deleting the information corresponding to the obtaining manner and the attribute in the graph database.
Specifically, if the target to-be-processed data acquired by the node or the edge includes the complete data deletion instruction, it may be considered that the graph database is storing the data, and the purpose is to delete all data consistent with the attribute name of the target to-be-processed data in the area for storing the acquired data in the node or the edge in the graph database, so that after the target to-be-processed data is stored to the lowest layer in the disk according to the target storage path, the data before the target to-be-processed data includes the complete data deletion instruction and the data before the target to-be-processed data includes the same ID and the same attribute name as those included in the target to-be-processed data is deleted.
And S207, if the target data to be processed comprises a user-defined data deleting instruction, determining the data to be deleted according to the user-defined data deleting instruction, and deleting the data to be deleted from the database.
In this embodiment, the custom data deleting instruction may be specifically understood as an instruction that is designed according to actual situations, is given from the outside, and is input through a node or an edge to partially modify or delete the information of the corresponding obtaining manner and attribute in the graph database. For example, the user-defined data deleting instruction may be an instruction for deleting data within a preset time period, and may also be an instruction for deleting other user-defined types of data, which is not limited in this embodiment of the present invention. The data to be deleted can be specifically understood as data which is determined according to the user-defined data deletion instruction and needs to be deleted in the graph database and the target storage path.
Specifically, if the target data to be processed acquired by the node or the edge includes a custom data deletion instruction, it may be considered that when the external user stores the data, the external user deletes a part of data in an area for storing the data acquired by the node or the edge in the graph database, so after the target data to be processed is stored to the bottom layer in the disk according to the target storage path, the data included in each node in the target storage path is detected, the data meeting the requirement of the custom data deletion instruction is determined as the data to be deleted, and the data to be deleted is deleted in the target storage path.
It should be clear 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 executed on the data in the same target storage path at the same time.
Optionally, the graph database may also be configured with a data processing policy in advance, for example, after data storage for a preset number of times is completed in the same target storage path, data that exceeds the preset number of times in the target storage path and is stored first may be deleted; data in all storage paths can be set to be permanently reserved by default; the data of nodes or edges of preset type information in the reserved graph database can also be set in a user-defined mode, or the data in the preset time period of the preset attribute names in the reserved graph database can be set in a user-defined mode, all the strategies are only examples of partial data processing strategies in the graph database, and the embodiment of the invention does not limit the specific data processing strategies in the graph database.
According to the technical scheme, the graph template containing the time sequence type is defined in the graph database, so that when the to-be-processed data is obtained for the nodes or edges in the graph template, the data with the time sequence information can be converted into the target to-be-processed data of the preset time sequence type, according to the ID of the corresponding node or edge and the attribute name corresponding to the node or edge, a target storage path in the graph database is determined and stored, the data of the same attribute obtained by the same node or edge at different time points can be stored in the same data set, further, when the target to-be-processed data comprises a complete data deleting instruction or a custom data deleting instruction, the data in the data set can be modified and deleted in a targeted manner, the life cycle of the nodes and edges is controlled flexibly through the data obtained by the nodes and the edges, the convenience of managing the time sequence type data and the related data in the graph database is improved, and the consumption of excessive storage resources and calculation resources is avoided.
EXAMPLE III
Fig. 4 is a flowchart of a time series data management method provided in the third embodiment of the present invention, where the technical solution of the third embodiment of the present invention is further optimized based on the above optional technical solutions, and after any one time of storage of target data to be processed is completed in a graph database, if a topology query operation on the graph database is received, a time required to be queried can be determined according to the topology query operation, and then target query data including time series information corresponding to the time can be read from the graph database, and a graph database model topology corresponding to the time can be determined according to the target query data.
As shown in fig. 4, a time series data management method provided in the third embodiment of the present invention specifically includes the following steps:
s301, defining a graph template containing a preset time sequence type in a graph database.
S302, acquiring data to be processed for nodes or edges of the graph database.
And S303, converting data containing time sequence information in the data to be processed into a preset time sequence type, and determining the converted data as target data to be processed.
S304, determining a target storage path corresponding to the target data to be processed, and storing the target data to be processed.
S305, after receiving the topology query operation on the graph database, determining target query time according to the topology query operation.
In this embodiment, the topology query operation may be specifically understood as an operation instruction given by the outside for querying the relationship and structure between the node and the edge in one or more scene corresponding graphs stored in the graph database. The target query time may be specifically understood as the acquisition time of the data in the required query topology. It should be clear that, the topology query operation may query only for the topology on one time node of one graph in the graph database, may also query for the topology on the same time node of multiple graphs, and may also query for the topologies of multiple graphs on different time nodes, which is not limited in the embodiment of the present invention.
Specifically, after receiving topology query operation on one or more scene corresponding graphs, the graph database determines time information contained in the topology to be queried in the topology query operation, the time information is used as acquisition time of data which is used for forming the topology to be queried in the graph database, and the acquisition time is determined as target query time.
S306, target query data containing time sequence information corresponding to the target query time is read from the graph database.
In this embodiment, the target query data may be specifically understood as data of which the data type is a preset time sequence type and the time sequence information included in the data is the target query time, among all data in the graph database used for forming the graph corresponding to the topology query operation.
Specifically, all data of a graph corresponding to the topology query operation are determined from the graph database, the data to be queried are determined to be of a preset time sequence type from the data, and the data of which the time corresponding to the time sequence information in the data to be queried is the target query time are determined as the target query data.
S307, determining a graph database model topology corresponding to the target query time according to the target query data.
Specifically, a corresponding topological structure is constructed according to the relation between each node and each edge in the target query data, and the topological structure is determined as a graph database model topology corresponding to the target query time.
Furthermore, in the production and use scenario of the graph database, a user also has a need to query data with time sequence information, or perform calculation and analysis by using data which is collected by the same node or edge within a certain time period and has the same change as the attribute name, and at this time, the data in the graph database needs to be read. Therefore, after the target data to be processed is stored, the method further comprises the following steps:
if the data reading operation is detected, acquiring data to be read from the target storage path according to a preset reading sequence; and processing the data to be read according to a preset data processing mode, and determining target read data.
The preset data processing mode at least comprises sorting and duplicate removal.
Further, acquiring data to be read from the target storage path according to a preset reading sequence includes: and acquiring data to be read from the target storage path according to the data storage sequence.
In the present embodiment, the data reading operation is specifically understood to be an operation instruction given by the outside for reading one or more, nodes or a type of data stored on the side stored in the graph database. The preset reading sequence can be specifically understood as a sequence which is predetermined according to a graph database storage structure and is used for reading data from the graph database.
Referring to the above example, taking the data storage flow in the graph database as shown in fig. 3 as an example, fig. 5 is an example of a target read data reading flow provided by a third embodiment of the present invention. As shown in fig. 5, when a data reading operation is detected in the graph database, a target storage path of data in the graph database, which needs to be read by a user, is determined according to the data reading operation, and then corresponding data is read from the target storage path according to a sequence from new to old storage, taking the target storage path in fig. 3 as an example, after data in a memory table and an unchangeable memory table in a memory is sequentially read, data in a sstable in a disk file is sequentially read according to a sequence from level 0 to level 3, that is, data in the data target storage path is read according to a sequence from 1 to 6 in fig. 5, and the read data is determined as data to be read. Meanwhile, in the data reading process, the storage of the graph database is carried out at the same time, so that the operation of covering old data with new data can occur.
In the embodiment of the present invention, processing data to be read in a TreeMap manner is only an optional implementation scheme provided in the embodiment of the present invention, and the method maintains the data sequence and data redundancy during reading, thereby having higher efficiency. It should be noted that TreeMap is only one data processing method that can be used, and the type of the data processing method that can be used is not limited in the embodiment of the present invention.
According to the technical scheme, the graph template containing the preset time sequence type is defined in the graph database, so that the subsequent graphs aiming at different application scenes contain the data of the preset time sequence type, the topological structure change of each graph in the graph database can be converted into the change of the data containing the time sequence information, a user can sense the dynamic change of the data of the preset time sequence type by performing topological query operation on the graph database, the data operation capability of the user is enriched, and the change of the information contained in each graph in the graph database is more visual and easier to understand.
Example four
Fig. 6 is a schematic structural diagram of a timing data management apparatus according to a fourth embodiment of the present invention, where the timing data management apparatus includes: a data acquisition module 41, a data type conversion module 42 and a data storage module 43.
The data acquiring module 41 is configured to acquire data to be processed for a node or an edge in a graph database; the data type conversion module 42 is configured to convert data including time sequence information in the data to be processed into a preset time sequence type, and determine the converted data as target data to be processed; the data storage module 43 is configured to determine a target storage path corresponding to target data to be processed, and store the target data to be processed; the preset time sequence type is a native data type constructed based on a storage structure of the graph database, and the preset time sequence type is the same as the data storage mode of other data types in the graph database.
According to the technical scheme of the embodiment, data types of the data to be processed, which are acquired by the nodes or edges in different graphs stored in the graph database, are converted, so that the converted data to be processed is the target data to be processed with the preset time sequence type, and the target data to be processed can be stored in the same storage mode as the data of other data types in the graph database. The problem of in the picture data base node and limit can't directly carry out time sequence data processing and storage, data relation is found complicacy and is suitable for the scene scope narrowly is solved, through the predetermined time sequence type of establishing the storage structure based on picture data base, carry out data type conversion to the data that have the time sequence information that node or edge obtained, guaranteed the uniformity of node or limit data storage process, simplified time sequence data processing procedure, improved time sequence data management efficiency, and then promoted picture data base performance.
Optionally, the time sequence data management apparatus further includes:
the graph template definition module is used for defining a graph template containing a preset time sequence type in a graph database before acquiring data to be processed for nodes or edges in the graph database; the graph template defines the type information and the attribute name of the node or the edge corresponding to the graph template, and the data type corresponding to the attribute name.
Optionally, the time sequence data management apparatus further includes:
the topology query module is used for determining target query time according to topology query operation after receiving the topology query operation on the graph database; reading target query data containing time sequence information corresponding to target query time from a graph database; and determining the map database model topology corresponding to the target query moment according to the target query data.
Optionally, the data storage module is specifically configured to: and determining a target storage path according to the ID of the corresponding node or edge of the target data to be processed and the attribute name of the target data to be processed.
Optionally, the time series data management apparatus further includes:
the data deleting module is used for deleting all data in a target storage path if the target data to be processed comprises a complete data deleting instruction after the target data to be processed is stored; and if the target data to be processed comprises a user-defined data deleting instruction, determining the data to be deleted according to the user-defined data deleting instruction, and deleting the data to be deleted from the database.
Optionally, the time sequence data management apparatus further includes:
the data reading module is used for acquiring data to be read from the target storage path according to a preset reading sequence if a data reading operation is detected after the target data to be processed is stored; processing the data to be read according to a preset data processing mode, and determining target read data; the preset data processing mode at least comprises sorting and duplicate removal.
Further, the obtaining of the data to be read from the target storage path according to the preset reading sequence includes:
and acquiring data to be read from the target storage path according to the data storage sequence.
The time sequence data management device provided by the embodiment of the invention can execute the time sequence data management method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
EXAMPLE five
Fig. 7 is a schematic structural diagram of a time series data management apparatus according to a fifth embodiment of the present invention. The timing data management apparatus 50 can be an electronic device, intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 7, the time-series data management apparatus 50 includes at least one processor 51, and a memory communicatively connected to the at least one processor 51, such as a Read Only Memory (ROM) 52, a Random Access Memory (RAM) 53, and the like, in which a computer program executable by the at least one processor is stored, and the processor 51 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 52 or the computer program loaded from a storage unit 58 into the Random Access Memory (RAM) 53. In the RAM 53, various programs and data necessary for the operation of the timing data management apparatus 50 can also be stored. The processor 51, the ROM 52, and the RAM 53 are connected to each other via a bus 54. An input/output (I/O) interface 55 is also connected to bus 54.
A plurality of components in the time-series data management apparatus 50 are connected to the I/O interface 55, including: an input unit 56 such as a keyboard, a mouse, or the like; an output unit 57 such as various types of displays, speakers, and the like; a storage unit 58 such as a magnetic disk, optical disk, or the like; and a communication unit 59 such as a network card, modem, wireless communication transceiver, etc. The communication unit 59 allows the timing data management device 50 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
The processor 51 may be any of a variety of general purpose and/or special purpose processing components having processing and computing capabilities. Some examples of processors 51 include, but are not limited to, central Processing Units (CPUs), graphics Processing Units (GPUs), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processors, controllers, microcontrollers, and the like. The processor 51 performs the various methods and processes described above, such as the timing data management method.
In some embodiments, the timing data management method may be implemented as a computer program tangibly embodied 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 time-series data management apparatus 50 via the ROM 52 and/or the communication unit 59. When the computer program is loaded into the RAM 53 and executed by the processor 51, one or more steps of the time series data management method described above may be performed. Alternatively, in other embodiments, the processor 51 may be configured to perform the timing data management method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Computer programs for implementing the methods of the present invention can 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, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here 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 a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user may provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a 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 acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the Internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above, reordering, adding or deleting steps, may be used. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired result of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A time series data management method is applied to a graph database, and comprises the following steps:
acquiring data to be processed for nodes or edges in the graph database;
converting data containing time sequence information in the data to be processed into a preset time sequence type, and determining the converted data as target data to be processed;
determining a target storage path corresponding to the target data to be processed, and storing the target data to be processed;
the preset time sequence type is a native data type constructed on the basis of the storage structure of the graph database, and the preset time sequence type is the same as the data storage mode of other data types in the graph database.
2. The method according to claim 1, further comprising, prior to said obtaining data to be processed for a node or edge in said graph database:
defining a graph template containing a preset time sequence type in the graph database;
the graph template defines type information and attribute names of nodes or edges corresponding to the graph template, and data types corresponding to the attribute names.
3. The method of claim 2, further comprising:
after receiving topology query operation on the graph database, determining 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;
and determining a graph database model topology corresponding to the target query time according to the target query data.
4. The method according to claim 1, wherein the determining a target storage path corresponding to the target to-be-processed data comprises:
and determining a target storage path according to the ID of the corresponding node or edge of the target data to be processed and the attribute name of the target data to be processed.
5. The method of claim 1, further comprising, after the storing the target pending data:
if the target data to be processed comprises a complete data deleting instruction, deleting all data in the target storage path;
and if the target data to be processed comprises a user-defined data deleting instruction, determining the data to be deleted according to the user-defined data deleting instruction, and deleting the data to be deleted from the database.
6. The method of claim 1, further comprising, after the storing the target pending data:
if the data reading operation is detected, acquiring data to be read from the target storage path according to a preset reading sequence;
processing the data to be read according to a preset data processing mode, and determining target read data;
the preset data processing mode at least comprises sorting and duplicate removal.
7. The method of claim 6, wherein the obtaining the data to be read from the target memory path in the predetermined reading order comprises:
and acquiring data to be read from the target storage path according to the data storage sequence.
8. A time-series data management apparatus, applied to a graph database, comprising:
the data acquisition module is used for acquiring data to be processed for nodes or edges in the graph database;
the data type conversion module is used for converting data containing time sequence information in the data to be processed into a preset time sequence type and determining the converted data as target data to be processed;
the data storage module is used for determining a target storage path corresponding to the target data to be processed and storing the target data to be processed;
the preset time sequence type is a native data type constructed on the basis of the storage structure of the graph database, and the data storage mode of the preset time sequence type is the same as that of other data types in the graph database.
9. A time-series data management apparatus characterized by comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of time series data management of any one of claims 1-7.
10. A computer-readable storage medium storing computer instructions for causing a processor to perform the method of managing time series data according to any one of claims 1 to 7 when executed.
CN202211124466.3A 2022-09-15 2022-09-15 Time sequence data management method, device, equipment and storage medium Pending CN115408546A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211124466.3A CN115408546A (en) 2022-09-15 2022-09-15 Time sequence data management method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211124466.3A CN115408546A (en) 2022-09-15 2022-09-15 Time sequence data management method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115408546A true CN115408546A (en) 2022-11-29

Family

ID=84166556

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211124466.3A Pending CN115408546A (en) 2022-09-15 2022-09-15 Time sequence data management method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115408546A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117194732A (en) * 2023-11-07 2023-12-08 山东青鸟工业互联网有限公司 Industrial Internet trusted data communication method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117194732A (en) * 2023-11-07 2023-12-08 山东青鸟工业互联网有限公司 Industrial Internet trusted data communication method and system
CN117194732B (en) * 2023-11-07 2024-02-02 山东青鸟工业互联网有限公司 Industrial Internet trusted data communication method and system

Similar Documents

Publication Publication Date Title
CN112818013B (en) Time sequence database query optimization method, device, equipment and storage medium
US20210191921A1 (en) Method, apparatus, device and storage medium for data aggregation
CN113407649A (en) Data warehouse modeling method and device, electronic equipment and storage medium
CN115291806A (en) Processing method, processing device, electronic equipment and storage medium
CN114461644A (en) Data acquisition method and device, electronic equipment and storage medium
CN112328592A (en) Data storage method, electronic device and computer readable storage medium
CN115408546A (en) Time sequence data management method, device, equipment and storage medium
CN116955856A (en) Information display method, device, electronic equipment and storage medium
CN115905322A (en) Service processing method and device, electronic equipment and storage medium
CN116028517A (en) Fusion database system and electronic equipment
CN115840738A (en) Data migration method and device, electronic equipment and storage medium
CN115657968A (en) Storage method, device, equipment and medium of boundary representation model
CN115543428A (en) Simulated data generation method and device based on strategy template
CN115329150A (en) Method and device for generating search condition tree, electronic equipment and storage medium
CN116431698B (en) Data extraction method, device, equipment and storage medium
CN114595231B (en) Database table generation method and device, electronic equipment and storage medium
CN114820079B (en) Crowd determination method, device, equipment and medium
CN117667942A (en) Data synchronous integration method and device, electronic equipment and storage medium
CN117709902A (en) Material input method, device, equipment and medium based on BOM file
CN115454977A (en) Data migration method, device, equipment and storage medium
CN117493613A (en) Building information model storage and display method and device and electronic equipment
CN116304796A (en) Data classification method, device, equipment and medium
CN115601172A (en) Data processing method, device, equipment and storage medium
CN115408547A (en) Dictionary tree construction method, device, equipment and storage medium
CN115048393A (en) Resource management method, apparatus, system, device, medium, and program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination