Method and device for realizing online data definition language operation of graph database
By introducing multi-version mode and multi-version data mechanisms into the graph database, combined with delayed update and lazy conversion mechanisms, the problem that graph databases are difficult to support Online DDL operations is solved, and the performance and reliability of large-scale graph data processing is significantly improved.
Patent Information
- Application Number
- CN202510663071.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2045-05-22
AI Technical Summary
The graph database is difficult to support online data definition language (Online DDL) operations, resulting in reduced performance when schema changes, high storage space requirements and limited complex DDL support.
By receiving online data definition language operations, determine the version of the data to be updated, and introduce multi-version mode and multi-version data mechanism to ensure data consistency. Identify database operation types, generate schema update tasks, and reduce the impact on business access through delayed updates and lazy conversion mechanisms.
It realizes continuous business operations during the mode change process, reduces system downtime, reduces redundant storage and storage costs, supports gradual changes in complex DDLs and takes effect, and enhances the ability to recover and diagnose problems.
Smart Images

Figure CN120179668A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of graph database data processing, and in particular, to a method and device for implementing online data definition language operations on a graph database. Background Art
[0002] As an emerging data storage solution, graph databases have significant advantages in processing highly correlated data. With the continuous change of business requirements, the evolution of database schemas has become a common need. Traditional database schema changes usually require downtime for maintenance, which is unacceptable for modern application systems that need to run continuously. In the field of graph databases, Online DDL (online data definition language operations) faces unique challenges. The data model of graph databases is very different from that of traditional relational databases. It mainly consists of nodes, edges, and attributes, which greatly increases the complexity of schema changes. In addition, graph databases are usually used to process large-scale, highly correlated data, which further increases the difficulty of making schema changes without affecting performance and consistency. Existing graph database Online DDL technologies usually adopt a tight integration of a schema manager and a DDL execution engine. When a DDL request is received, the schema manager updates the schema definition and notifies the DDL execution engine to start executing the operation; a data converter is connected to the DDL execution engine and is responsible for converting the affected data according to the requirements of the DDL operation; a concurrency control manager is connected to the DDL execution engine and the transaction management system of the database to coordinate DDL operations and concurrent DML operations; a rollback mechanism is connected to the entire system to monitor the execution status of DDL operations. There are some limitations in the existing technologies: the data conversion process may cause significant performance degradation, has high requirements for storage space, and has limited support for complex DDLs; existing methods are often transplanted from relational databases and do not fully utilize the characteristics of graph databases. Summary of the Invention
[0003] The present invention provides a method and device for implementing online data definition language operations on a graph database to solve the technical problem that it is difficult for existing graph databases to support Online DDL.
[0004] According to one aspect of the present invention, there is provided a method for implementing online data definition language operations on a graph database, including:
[0005] Receiving an online data definition language operation on the graph database, executing the online data definition language operation, and determining a graph data version to be updated corresponding to the online data definition language operation;
[0006] Identify the database operation type corresponding to the online data definition language operation. When the graph database is detected by the database operation type or version control system to meet the preset graph database update conditions, a schema update task is generated;
[0007] Update the version of the graph data to be updated to the graph database according to the schema update task.
[0008] According to another aspect of the present invention, there is provided an implementation device for online data definition language operations of a graph database, including:
[0009] A graph database online change module, configured to receive an online data definition language operation on the graph database, execute the online data definition language operation, and determine the version of the graph data to be updated corresponding to the online data definition language operation;
[0010] A graph schema update module, configured to identify the database operation type corresponding to the online data definition language operation. When the graph database is detected by the database operation type or version control system to meet the preset graph database update conditions, a schema update task is generated;
[0011] A namespace update module, configured to update the version of the graph data to be updated to the graph database according to the schema update task.
[0012] According to another aspect of the present invention, there is provided an electronic device, where the electronic device includes:
[0013] At least one processor; and
[0014] A memory communicatively connected to the at least one processor; wherein,
[0015] The memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, the at least one processor is enabled to execute the implementation method of the online data definition language operation of the graph database according to any embodiment of the present invention.
[0016] According to another aspect of the present invention, there is provided a computer-readable storage medium, where the computer-readable storage medium stores computer instructions, and when the computer instructions are used by a processor, the implementation method of the online data definition language operation of the graph database according to any embodiment of the present invention is implemented.
[0017] The technical solution of the embodiment of the present invention receives an online data definition language operation on a graph database, executes the online data definition language operation, determines the graph data version to be updated corresponding to the online data definition language operation, and ensures data consistency by introducing a multi-version mode and a multi-version data mechanism, while avoiding the traditional lock mechanism; identifies the database operation type corresponding to the online data definition language operation, and generates a schema update task when the database operation type or the version control system detects that the graph database meets the preset graph database update conditions. Through the delayed update and lazy conversion mechanisms, the online data definition language operation does not immediately affect all data, greatly reducing the impact on normal business access and significantly reducing resource occupancy; updates the graph data version to be updated to the graph database according to the schema update task, maps complex DDL operations to changes in the graph structure, and then performs more complex operations in the background, while reducing the need for manual intervention, realizing the coexistence of old and new version data and incremental migration, and supporting the gradual change and gray-scale effect of complex DDL. It solves the technical problem that it is difficult for a graph database in the prior art to support Online DDL. The present invention significantly improves the performance of large-scale graph data processing, supports continuous business operations during schema changes, minimizes system downtime, reduces redundant storage, reduces storage costs, provides strong support for fault recovery and problem diagnosis through a version control mechanism, and supports more efficient distributed synchronization, reducing network overhead and computing resource consumption.
[0018] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings without creative efforts based on these drawings.
[0020] Figure 1 It is a flowchart of an implementation method for an online data definition language operation of a graph database provided by an embodiment of the present invention;
[0021] Figure 2 Disclosed is an example graph for concurrent backfilling of a namespace to be updated to a target namespace;
[0022] Figure 3 It is a flowchart of an implementation method for an online data definition language operation of a graph database provided by an embodiment of the present invention;
[0023] Figure 4 A flowchart example of generating a first data update version through a first update operation provided by an embodiment of the present invention;
[0024] Figure 5 A flowchart of an implementation method for online data definition language operations of a graph database provided by an embodiment of the present invention;
[0025] Figure 6 A flowchart example of generating a third update graph pattern version through a third update operation provided by an embodiment of the present invention;
[0026] Figure 7 A flowchart of an implementation method for online data definition language operations of a graph database provided by an embodiment of the present invention;
[0027] Figure 8 A schematic structural diagram of an implementation device for online data definition language operations of a graph database provided by an embodiment of the present invention;
[0028] Figure 9 A schematic structural diagram of an electronic device 10 that can be used to implement the embodiments of the present invention is shown. Detailed implementation manners
[0029] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present invention.
[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0031] Figure 1The embodiment of the present invention provides a flowchart of an implementation method for online data definition language operations of a graph database. This embodiment is applicable to the situation of performing online operations on a graph database through online DDL. This method can be executed by an implementation device for online data definition language operations of the graph database. The implementation device for online data definition language operations of the graph database can be implemented in the form of hardware and / or software, and the implementation device for online data definition language operations of the graph database can be configured in an electronic device. As Figure 1 shown, the method includes:
[0032] S110. Receive an online data definition language operation on the graph database, execute the online data definition language operation, and determine the version of the graph data to be updated corresponding to the online data definition language operation.
[0033] Among them, the online data definition language operation (Online Data Definition Language) refers to performing a data definition language (Data Definition Language) operation in the running state of the database. Exemplarily, in a graph database, the online data definition language operation can create, modify, or delete a graph schema, can also modify the attributes of vertices and edges in the graph database, and can also add new relationships between vertices and edges.
[0034] Among them, the version of the graph data to be updated can be the version of the graph database after performing the online data definition language operation on the graph database. It should be noted that when the online data definition language operation is performed on the graph database, it is necessary to pause the online function support of the graph database to the outside, and it is impossible to support high-concurrency database-related operations, resulting in limited online change capabilities of the system. The version of the graph data to be updated by the version control mechanism of the present invention can support the online data definition language operation of the graph database and does not affect the online function support of the graph database to the outside. The version of the graph data to be updated in the present invention includes a graph schema version and a graph data version, and multiple graph schemas and graph data versions can exist simultaneously in the graph database.
[0035] Optionally, the online data definition language operations include a first update operation, a second update operation, and a third update operation; the graph data version to be updated includes a first data update version, a second data update version, and a third data update version. The first update operation can be to update the graph schema and graph data of the graph database simultaneously to generate a new graph schema version and graph data version; the second update operation can be a reconstruction operation for the graph database to generate a new graph model version and graph data version; the third update operation can be a graph schema version update operation for modifying the graph schema of the graph database. Exemplarily, the first update operation for graph schema version change and graph data version change operations can be to modify points and edges: add and delete attributes, modify attribute values, types, and default values; add or delete edges between points; the second update operation for data re-Rebuild can be to create new points, edges, and indexes on the basis of the graph database; the third update operation can be used to modify the attribute names of points and edges in the graph database, modify the schema name, delete graphs, vertices, edges, and indexes, and truncate graphs, vertices, and edges.
[0036] Specifically, when the graph data is in an online state or an offline state, an online data definition language operation on the graph database is received, the online data definition language operation is executed, and the graph data version to be updated corresponding to the online data definition language operation is determined.
[0037] S120. Identify the database operation type corresponding to the online data definition language operation. If the graph database meets the preset graph database update conditions detected by the database operation type or the version control system, a schema update task is generated.
[0038] Among them, the database operation type can be the operation type of the online data definition language for modifying the graph database. It should be noted that the database operation type includes graph schema version change, graph database version change, and graph database reconstruction. The graph schema version change is used to represent that the online data definition language operation is an operation for changing the graph schema version; the graph database version change is used to represent that the online data definition language operation is an operation for changing both the graph schema version and the graph data version of the graph database; the graph database reconstruction is used to represent that the online data definition language operation is a schema and data reconstruction operation for the graph database.
[0039] Among them, the version control system can be a control system in the graph database for controlling the graph schema version update of the graph database. It should be noted that the version control system (Schema GC) can delay the update of the graph schema version and graph data version of the graph database, so that when the graph database supports online data definition language operations, it simultaneously supports the online functions of the graph database and high-concurrency database-related operations.
[0040] Among them, the preset graph database update condition can be a condition pre-set for detecting updates to the graph mode version and / or the graph data version of the graph database. It should be noted that when the version control system detects that the graph database meets the preset graph database update condition, the version control system can be started to update the graph mode version and / or the graph data version of the graph database; when the database operation type corresponding to the online data definition language operation meets the preset graph database update condition, the version control system can be started to update the graph mode version and / or the graph data version of the graph database.
[0041] Optionally, the version control system can detect the number of graph mode versions, the update time of the graph database, and / or the graph data requirements; in the case where the number of graph mode versions is greater than the preset graph mode threshold, it is considered that the graph database meets the preset graph database update condition; in the case where the update time of the graph database meets the background scheduled update, it is considered that the graph database meets the preset graph database update condition; in the case where the graph data version of the graph database does not support the data requirements of the outside world for the graph database, it is considered that the graph database meets the preset graph database update condition. Exemplarily, the preset graph mode threshold can be 8, and if the version control system detects that the number of graph model versions is 9, it is considered that the graph database meets the preset graph database update condition; the background scheduled update can be set to update every 24 hours. When the number of graph model versions is not greater than 8 and it is detected that the time since the last update is 24 hours, it is considered that the graph database meets the preset graph database update condition; when the number of graph model versions is not greater than 8 and the time since the last update is also less than 24 hours, but the current graph data version of the graph database cannot meet the external data requirements, it is considered that the graph database meets the preset graph database update condition.
[0042] Among them, the mode update task can be an instruction generated by the task manager of the version control system; the mode update task is used to update the graph data version and the graph mode version of the graph database.
[0043] Optionally, when the database operation type corresponding to the online data definition language operation meets the preset graph database update condition or the version control system detects that the graph database meets the preset graph database update condition, the version control system generates a mode update task through the task manager.
[0044] Specifically, identify the database operation type corresponding to the online data definition language operation. When the database operation type or the version control system detects that the graph database meets the preset graph database update condition, a mode update task is generated through the version control system.
[0045] S130. Update the to-be-updated graph data version to the graph database according to the mode update task.
[0046] Specifically, after the version control system generates a schema update task, scan the original graph data version and graph schema version of the graph database according to the schema update task, and perform data conversion on the original graph data version and graph schema version of the graph database based on the graph data version to be updated, so as to update the graph database.
[0047] Optionally, in another optional embodiment of the present invention, updating the graph data version to be updated to the graph database according to the schema update task includes:
[0048] Identify the namespace to be updated that is in the active state in the graph database;
[0049] Determine the target namespace and at least one graph data version to be updated according to the schema update task;
[0050] Identify each graph data version to be updated and determine the target update information set;
[0051] Scan the graph data to be updated and the graph schema to be updated corresponding to the namespace to be updated,
[0052] Concurrently backfill the graph data to be updated into the target namespace according to the target update information set, and determine the target graph data and target graph schema;
[0053] Set the target namespace to the active state, and delete the graph data to be updated and the graph schema to be updated in the namespace to be updated.
[0054] Among them, the namespace to be updated can be the data storage space currently in the active state of the graph database, and the namespace to be updated can be the namespace before the graph database is updated. It should be noted that the namespace is used to control the data visibility of the storage layer of the graph database. The graph database can support at least one namespace, and each namespace has a corresponding state. Only the data in the active namespace is visible externally and can support the external data services of the graph database; there is at most one active namespace for the graph database to support external data services. The namespace can solve the concurrent control of the external data services of the graph database, can realize the coexistence of old and new version data and incremental migration, and support complex online data definition language operations for gradual change and gray-scale effect.
[0055] Optionally, when the graph database stops supporting external data services, there can be more than one namespace in the active state.
[0056] Among them, the graph pattern to be updated can be the corresponding graph pattern version in the namespace to be updated; the graph data to be updated can be the graph data running in the namespace to be updated. It should be noted that when the namespace of the graph database is not updated, the graph pattern version of the graph database is the graph pattern to be updated, and the graph data version of the graph database is the graph data to be updated.
[0057] Among them, the target namespace can be the namespace created by the graph database based on the schema update task. It should be noted that when performing the schema update task, the graph database creates a new namespace as the target namespace, which is used to update the graph pattern to be updated and the graph data to be updated in the namespace to be updated of the graph database to the target namespace based on the graph data version to be updated.
[0058] Among them, the target update information set can be the data set of the graph data version and the graph pattern version that the graph database needs to update. It should be noted that the schema update task corresponds to at least one graph data version to be updated. Identify each graph data version to be updated, determine the changes in the graph pattern version and the changes in the graph data version in turn, determine the final graph pattern version and graph data version, and determine the final graph pattern version and graph data version as the target update information set.
[0059] Optionally, since the graph database can store multiple graph pattern versions and graph data versions, identify the creation time of each graph pattern version, and use the graph pattern version with the shortest creation time as the graph pattern version that the graph database needs to update; identify the creation time of each graph data version, and use the graph data version with the shortest creation time as the graph data version that the graph database needs to update, and construct the target update information set in turn according to the size of the creation time of each graph pattern version and graph data version. Exemplarily, there are 3 versions of the graph pattern, namely graph pattern version 1, graph pattern version 2, and graph pattern version 3. Since the creation time of graph pattern version 3 is the shortest, graph pattern version 3 is determined as the finally updated graph pattern version. There are 2 versions of the graph data, namely graph data version 1 corresponding to graph pattern version 1 and graph data version 2 corresponding to graph pattern version 3. Optionally, graph data version 2 is selected as the finally updated graph data version, and then graph pattern version 3 and graph data version 2 corresponding to graph pattern version 3 are determined as the target update information set.
[0060] Among them, the target graph data can be the graph data version in the target namespace after the target namespace of the graph database is updated; the target graph pattern can be the graph pattern version corresponding to the target namespace after the target namespace is updated.
[0061] Specifically, identify the namespace to be updated in the graph database that is in the active state; determine the target namespace and at least one graph data version to be updated according to the schema update task; identify each graph data version to be updated and determine the target update information set; scan the graph data to be updated and the graph schema to be updated corresponding to the namespace to be updated, and concurrently backfill the graph data to be updated into the target namespace according to the target update information set to determine the target graph data and the target graph schema; set the target namespace to the active state, and delete the graph data to be updated and the graph schema to be updated in the namespace to be updated.
[0062] Optionally, in another alternative embodiment of the present invention, the identifying each graph data version to be updated and determining the target update information set includes;
[0063] In the case where the second updated data version does not exist in the graph data version to be updated, determine the target update information set from at least one of the first data update versions and / or the third updated graph schema versions;
[0064] In the case where the second updated data version exists in the graph data version to be updated, then determine the second updated data version as the target update information set.
[0065] Optionally, identify whether there is a second updated data version in the graph data version to be updated. If there is a second updated data version, it is determined that the update of the graph database is a graph database reconstruction, and directly use the second updated graph schema version and the second updated data version corresponding to the second updated data version as the target update information set.
[0066] Optionally, identify whether there is a second updated data version in the graph data version to be updated. If there is no second updated data version, it is determined that the update of the graph database is not a graph database reconstruction. Identify at least one first data update version and / or third updated graph schema version existing in the data version to be updated, and use the graph schema version and the graph data version with the latest creation time corresponding to at least one first data update version and / or third updated graph schema version existing in the data version to be updated as the target update information set.
[0067] Figure 2 An example graph for concurrent backfilling of a namespace to be updated into a target namespace is disclosed. As Figure 2As shown below: When the DDL operator executes and updates the graph data based on the schema update task, data backfilling is performed from the namespace to be updated to the target namespace. The specific process of data backfilling is as follows: Phase 1: Concurrent backfilling. The graph database starts multiple background tasks to concurrently scan the data of the graph schema to be updated, convert the data of the graph schema to be updated into the format of the target graph schema, and write it into the new target graph schema. Phase 2: Incremental processing. During the concurrent backfilling process, if the graph database receives a write operation from the external business, the new write operation will be directly written into the new target graph schema. If the write operation cannot be executed in real time, the write operation is recorded through the log system of the graph database, and when the graph database detects that the write operation can be executed, the write operation is executed. During the implementation of concurrent backfilling, since there are multiple graph data schemas and graph data versions between the data conversion of the graph schema to be updated and the target graph schema, and there are delete and update operations between each graph data schema and graph data version, conflicts may occur when directly converting the graph data from the data of the graph schema to be updated to the target graph schema. For example: there are invalid vertex, edge, and attribute data. Through Phase 3: Conflict handling, handle the conflicts during the concurrent backfilling process. For example: delete the attribute data of invalid vertices and edges. Phase 4: Switching and cleaning. Add an exclusive lock to the graph schema to be updated, convert the target namespace to the active state (activated state), and clean the data and lock resources of the namespace to be updated.
[0068] Optionally, since there may be conflicts in directly converting the data of the graph pattern to be updated into the target graph pattern during the concurrent backfill process, during the concurrent backfill process, at least one graph data version to be updated between the graph pattern to be updated and the target graph pattern is determined as the stage updated graph pattern version and the stage updated graph data version in sequence based on the creation time of the graph data version to be updated; the process of concurrent backfill can be selected as follows: based on the creation time of each stage updated graph pattern version and stage updated graph data version, the graph pattern to be updated and the graph data to be updated are gradually updated to each stage updated graph pattern version and stage updated graph data version, and then the last stage updated graph pattern version and stage updated graph data version are updated to the target graph data and the target graph pattern. And during each update process, the existing conflicts are directly processed to improve the accuracy of graph database update. Exemplarily, there are 3 stage updated graph pattern versions and 2 stage updated graph data versions between the graph pattern to be updated and the target graph pattern, which are stage updated graph pattern version 1, stage updated graph pattern version 2, and stage updated graph pattern version 3, and stage updated graph data version 1 corresponding to stage updated graph pattern version 1, and stage updated graph data version 2 corresponding to stage updated graph pattern version 2. By first updating the graph pattern to be updated and the graph data to be updated to stage updated graph pattern version 1 and stage updated graph data version 1, then updating stage updated graph pattern version 1 and stage updated graph data version 1 to stage updated graph pattern version 2 and stage updated graph data version 2, then updating stage updated graph pattern version 2 to stage updated graph pattern version 3, and finally updating stage updated graph pattern version 3 and stage updated graph data version 2 to the target graph pattern and the target graph data.
[0069] The technical solution of the embodiment of the present invention receives an online data definition language operation on a graph database, executes the online data definition language operation, determines the to-be-updated graph data version corresponding to the online data definition language operation, ensures data consistency by introducing a multi-version mode and a multi-version data mechanism, and avoids the traditional lock mechanism at the same time; identifies the database operation type corresponding to the online data definition language operation, and generates a schema update task when the database operation type or the version control system detects that the graph database meets the preset graph database update condition. Through the delayed update and lazy conversion mechanisms, the online data definition language operation does not immediately affect all data, greatly reducing the impact on normal business access and significantly reducing resource occupancy; updates the to-be-updated graph data version to the graph database according to the schema update task, maps complex DDL operations to changes in the graph structure, and then performs more complex operations in the background, while reducing the need for manual intervention, realizing the coexistence of old and new version data and incremental migration, and supporting the gradual change and gray-scale effect of complex DDL. It solves the technical problem that it is difficult for a graph database in the prior art to support Online DDL. The present invention significantly improves the performance of large-scale graph data processing, supports continuous business operations during schema changes, minimizes system downtime, reduces redundant storage, reduces storage costs, provides strong support for fault recovery and problem diagnosis through a version control mechanism, and supports more efficient distributed synchronization, reducing network overhead and computing resource consumption.
[0070] Figure 3 It is a flowchart of an implementation method for an online data definition language operation of a graph database provided by an embodiment of the present invention. The relationship between this embodiment and the above embodiment introduces the update process of the graph database when the online data definition language operation is a first update operation. As Figure 3 shown, the method includes:
[0071] S310. Receive an online data definition language operation on the graph database. When the online data definition language operation is the first update operation, execute the first update operation and determine the first data update version corresponding to the first update operation.
[0072] Among them, the first data update version may be the graph schema version and the graph data version generated by the graph database when executing the first update operation; the first data update version includes a first updated graph schema version and a first updated data version; the first updated graph schema version may be the graph schema version generated by the graph database when executing the first update operation; the first updated data version may be the graph data version generated by the graph database when executing the first update operation.
[0073] Optionally, the first updated graph schema version and the first updated data version generated by the graph database performing the first update operation are stored in the Cache (cache) of the running memory.
[0074] Specifically, an online data definition language operation on the graph database is received. When the online data definition language operation is the first update operation, the first update operation is executed to determine the first updated data version corresponding to the first update operation.
[0075] Figure 4 This is a flowchart example of generating a first data update version through a first update operation provided by an embodiment of the present invention; as Figure 4 shown, the first update operation can be "add age" and "drop name"; during the process of performing the first update operation on the graph data Person, the schema version Schema Version +1 is obtained to get the first updated graph schema version; the data version Data Version +1 is obtained to get the first updated data version.
[0076] S320. Identify the database operation type of the first update operation, and determine that the database operation type of the first update operation is a graph database version change.
[0077] Specifically, identify the database operation type of the first update operation, and determine that the database operation type of the first update operation is a graph database version change.
[0078] S330. If the version number of the graph schema version of the graph database detected by the version control system is greater than the graph schema threshold, it is considered that the version control system meets the preset graph database update condition.
[0079] Among them, the graph schema threshold can be a data threshold set in advance for judging whether the graph database needs to be updated. It should be noted that the graph schema threshold can be set by the version control system itself and freely adjusted according to the business requirements of different graph databases.
[0080] Specifically, if the graph database detects through the version control system that the version number of the graph schema version of the graph database is greater than the graph schema threshold, it is considered that the version control system meets the preset graph database update condition.
[0081] Optionally, since the graph schema version of the graph data is stored in the Cache of the running memory, the graph database can detect, through the version control system, the Cache of the running memory occupied by at least one graph schema version. By setting the space upper limit of the Cache of the running memory, when the Cache of the running memory occupied by the graph schema version reaches the space upper limit, a schema update task is directly generated through the version control system.
[0082] S340. Generate a schema update task through a version control system.
[0083] S350. Update the version of the graph data to be updated to the graph database according to the schema update task.
[0084] Optionally, identify the namespace to be updated in the graph database that is in the active state; determine the target namespace and at least one version of the graph data to be updated according to the schema update task; identify each version of the graph data to be updated and determine the target update information set; scan the graph data to be updated and the graph schema to be updated corresponding to the namespace to be updated, and perform concurrent backfilling of the graph data to be updated into the target namespace according to the target update information set to determine the target graph data and the target graph schema; set the target namespace to the active state, and delete the graph data to be updated and the graph schema to be updated in the namespace to be updated.
[0085] Optionally, identify whether there is a second updated data version for the version of the graph data to be updated. If there is no second updated data version, it is determined that the update of the graph database is not a graph database reconstruction. Identify at least one first data update version and / or a third updated graph schema version existing in the version of the data to be updated. According to the creation time corresponding to at least one first data update version and / or a third updated graph schema version existing in the version of the data to be updated, use the graph schema version and the graph data version with the latest creation time as the target update information set.
[0086] The technical solution of the embodiment of the present invention receives an online data definition language operation on a graph database, executes the online data definition language operation, determines the version of the graph data to be updated corresponding to the online data definition language operation. By introducing a multi-version mode and a multi-version data mechanism, data consistency is ensured while avoiding the traditional lock mechanism. Identify the type of database operation corresponding to the online data definition language operation. When the database operation type or the version control system detects that the graph database meets the preset graph database update conditions, a schema update task is generated. Through the delayed update and lazy conversion mechanisms, the online data definition language operation does not immediately affect all data, greatly reducing the impact on normal business access and significantly reducing resource occupancy. Update the version of the graph data to be updated to the graph database according to the schema update task, map complex DDL operations to changes in the graph structure, and then perform more complex operations in the background while reducing the need for manual intervention, realizing the coexistence of old and new version data and incremental migration, and supporting the gradual change and gray-scale effect of complex DDL. Solve the technical problem that it is difficult for a graph database in the prior art to support Online DDL. The present invention significantly improves the performance of large-scale graph data processing, supports continuous business operations during schema changes, minimizes system downtime, reduces redundant storage, and reduces storage costs. It provides strong support for fault recovery and problem diagnosis through a version control mechanism, and supports more efficient distributed synchronization, reducing network overhead and computing resource consumption.
[0087] Figure 5 FIG. is a flowchart of an implementation method for an online data definition language operation of a graph database provided by an embodiment of the present invention. The relationship between this embodiment and the above embodiment introduces the update process of the graph database when the online data definition language operation is a third update operation. As Figure 5 shown, the method includes:
[0088] S510. Receive an online data definition language operation on the graph database. When the online data definition language operation is the third update operation, execute the third update operation and determine the third updated graph schema version corresponding to the third update operation.
[0089] Among them, the third graph schema version may be the graph schema version generated by the graph database when executing the third update operation. It should be noted that the third update operation only updates the graph schema version of the graph database and does not update the graph data version of the graph database. Optionally, the third updated graph schema version and the third updated data version generated by the graph database when executing the third update operation are stored in the Cache (cache) of the running memory.
[0090] Specifically, upon receiving an online data definition language operation for the graph database, when the online data definition language operation is a third update operation, execute the third update operation and determine the third updated graph schema version corresponding to the third update operation.
[0091] Figure 6 This is a flowchart example of generating a third updated graph schema version through a third update operation provided by an embodiment of the present invention; as Figure 6 shown, the third update operation is an "alter comment" operation to modify the comment information of the Person node; during the process of performing the third update operation on the graph data Person, the graph schema version Schema Version +1 is obtained to get the third updated graph schema version; the data version Data Version remains unchanged, and the graph data Person is updated from comment: version 1 to comment: version 2.
[0092] S520. Identify the database operation type of the third update operation and determine that the database operation type of the third update operation is a graph schema version change.
[0093] Specifically, identify the database operation type of the third update operation and determine that the database operation type of the third update operation is a graph schema version change.
[0094] S530. If it is detected through the version control system that the number of versions of the graph schema of the graph database is greater than the graph schema threshold, it is considered that the version control system meets the preset graph database update condition.
[0095] Specifically, if the graph database detects through the version control system that the number of versions of the graph schema of the graph database is greater than the graph schema threshold, it is considered that the version control system meets the preset graph database update condition.
[0096] S540. Generate a schema update task through the version control system.
[0097] S550. Update the version of the graph data to be updated to the graph database according to the schema update task.
[0098] Optionally, identify the namespace to be updated in the active state of the graph database; determine the target namespace and at least one version of the graph data to be updated according to the schema update task; identify each version of the graph data to be updated and determine the target update information set; scan the graph data to be updated and the graph schema to be updated corresponding to the namespace to be updated, and perform concurrent backfilling of the graph data to be updated into the target namespace according to the target update information set to determine the target graph data and the target graph schema; set the target namespace to the active state, and delete the graph data to be updated and the graph schema to be updated in the namespace to be updated.
[0099] Optionally, identify whether there is a second updated data version for the graph data version to be updated. If there is no second updated data version, it is determined that the update of the graph database is not a graph database reconstruction. Identify at least one first data update version and / or third updated graph schema version existing in the data version to be updated, and use the graph schema version and graph data version with the latest creation time as the target update information set according to the creation time corresponding to at least one first data update version and / or third updated graph schema version existing in the data version to be updated.
[0100] The technical solution of the embodiment of the present invention, by receiving an online data definition language operation on the graph database, executing the online data definition language operation, determining the graph data version to be updated corresponding to the online data definition language operation, through the introduction of a multi-version schema and multi-version data mechanism, ensures data consistency and avoids the traditional lock mechanism at the same time; identifies the database operation type corresponding to the online data definition language operation, and generates a schema update task when the database operation type or version control system detects that the graph database meets the preset graph database update conditions. Through the lazy update and lazy conversion mechanism, the online data definition language operation does not immediately affect all data, greatly reducing the impact on normal business access and significantly reducing resource occupancy; updates the graph data version to be updated to the graph database according to the schema update task, maps complex DDL operations to changes in the graph structure, and then performs more complex operations in the background, while reducing the need for manual intervention, realizing the coexistence of old and new version data and incremental migration, and supporting the gradual change and gray-scale effect of complex DDL. Solve the technical problem that it is difficult for the graph database in the prior art to support Online DDL. The present invention significantly improves the performance of large-scale graph data processing, supports continuous business operations during schema changes, minimizes system downtime, reduces redundant storage, reduces storage costs, provides strong support for fault recovery and problem diagnosis through the version control mechanism, and supports more efficient distributed synchronization, reducing network overhead and computing resource consumption.
[0101] Figure 7 It is a flowchart of an implementation method for an online data definition language operation of a graph database provided by an embodiment of the present invention. The relationship between this embodiment and the above embodiment introduces the update process of the graph database when the online data definition language operation is a second update operation. As Figure 7 shown, the method includes:
[0102] S710. Receive an online data definition language operation on the graph database. When the online data definition language operation is the second update operation, execute the second update operation and determine the second updated data version corresponding to the second update operation.
[0103] Among them, the second updated data version can be the graph schema version and graph data version generated by the graph database when performing the second update operation; the second updated data version includes the second updated graph schema version and the second updated data version; the second updated graph schema version can be the graph schema version generated by the graph database when performing the second update operation; the second updated data version can be the graph data version generated by the graph database when performing the second update operation.
[0104] Optionally, the second updated graph schema version and the second updated data version generated by the graph database when performing the second update operation are stored in the Cache (cache) of the running memory.
[0105] Specifically, an online data definition language operation on the graph database is received. When the online data definition language operation is the second update operation, the second update operation is executed to determine the second updated data version corresponding to the second update operation.
[0106] S720. Identify the second update operation and determine that the database operation type of the second update operation is graph database reconstruction.
[0107] Specifically, identify the second update operation and determine that the database operation type of the second update operation is graph database reconstruction.
[0108] S730. When the database operation type is the graph database reconstruction, it is considered that the database operation type meets the preset graph database update condition.
[0109] Optionally, graph database reconstruction is used to represent that the online data definition language operation performs schema and data reconstruction operations on the graph database. When the online data definition language operation is graph database reconstruction, the graph database needs to be updated immediately, and thus it is considered that the database operation type of the online data definition language operation meets the preset graph database update condition.
[0110] S740. Generate a schema update task according to the second update operation.
[0111] Optionally, when the database operation type of the online data definition language operation is graph database reconstruction, the online data definition language operation is immediately executed to determine the second updated graph schema version and the second updated data version, and the second updated graph schema version is stored in the Cache (cache) of the running memory. A schema update task is established by the second update operation.
[0112] S750. Update the graph data version to be updated to the graph database according to the schema update task.
[0113] Optionally, identify the namespace to be updated where the graph database is in an active state; determine the target namespace and at least one graph data version to be updated according to the schema update task; identify each graph data version to be updated and determine the target update information set; scan the graph data to be updated and the graph schema to be updated corresponding to the namespace to be updated, and concurrently backfill the graph data to be updated into the target namespace according to the target update information set to determine the target graph data and the target graph schema; set the target namespace to the active state, and delete the graph data to be updated and the graph schema to be updated in the namespace to be updated.
[0114] Optionally, identify whether there is a second updated data version for the graph data version to be updated. If there is a second updated data version, it is determined that the update of the graph database is a graph database reconstruction, and directly use the second updated graph schema version and the second updated data version corresponding to the second updated data version as the target update information set.
[0115] The technical solution of the embodiment of the present invention, by receiving an online data definition language operation on the graph database, executing the online data definition language operation, and determining the graph data version to be updated corresponding to the online data definition language operation, ensures data consistency and avoids the traditional lock mechanism by introducing a multi-version schema and a multi-version data mechanism; identifies the database operation type corresponding to the online data definition language operation. When the database operation type or the version control system detects that the graph database meets the preset graph database update conditions, a schema update task is generated. Through the delayed update and lazy conversion mechanism, the online data definition language operation does not immediately affect all data, greatly reducing the impact on normal business access and significantly reducing resource occupancy; updates the graph data version to be updated to the graph database according to the schema update task, maps complex DDL operations to changes in the graph structure, and then performs more complex operations in the background, while reducing the need for manual intervention, realizing the coexistence of old and new version data and incremental migration, and supporting the gradual change and gray-scale effect of complex DDL. Solve the technical problem that it is difficult for the graph database in the prior art to support Online DDL. The present invention significantly improves the performance of large-scale graph data processing, supports continuous business operations during schema changes, minimizes system downtime, reduces redundant storage, and reduces storage costs. It provides strong support for fault recovery and problem diagnosis through a version control mechanism, and supports more efficient distributed synchronization, reducing network overhead and computing resource consumption.
[0116] Figure 8 It is a schematic structural diagram of an implementation device for an online data definition language operation of a graph database provided by an embodiment of the present invention. As Figure 8 shown, the device includes: a graph database online change module 810, a graph schema update module 820, and a namespace update module 830; wherein,
[0117] The graph database online change module 810 is used to receive online data definition language operations on the graph database, execute the online data definition language operations, and determine the graph data version to be updated corresponding to the online data definition language operations;
[0118] The graph schema update module 820 is used to identify the database operation type corresponding to the online data definition language operation. When the database operation type or the version control system detects that the graph database meets the preset graph database update conditions, a schema update task is generated;
[0119] The namespace update module 830 is used to update the graph data version to be updated to the graph database according to the schema update task.
[0120] The technical solution of the embodiment of the present invention, by receiving online data definition language operations on the graph database, executing the online data definition language operations, and determining the graph data version to be updated corresponding to the online data definition language operations, ensures data consistency and avoids the traditional lock mechanism by introducing a multi-version schema and a multi-version data mechanism; identifying the database operation type corresponding to the online data definition language operation, and generating a schema update task when the database operation type or the version control system detects that the graph database meets the preset graph database update conditions. Through the delayed update and lazy conversion mechanisms, the online data definition language operations do not immediately affect all data, greatly reducing the impact on normal business access and significantly reducing resource occupancy; updating the graph data version to be updated to the graph database according to the schema update task, mapping complex DDL operations to changes in the graph structure, and then performing more complex operations in the background, while reducing the need for manual intervention, realizing the coexistence of old and new versions of data and incremental migration, and supporting the gradual change and gray-scale effect of complex DDL. Solve the technical problem that the graph database in the prior art is difficult to support Online DDL. The present invention significantly improves the performance of large-scale graph data processing, supports continuous business operations during schema changes, minimizes system downtime, reduces redundant storage, reduces storage costs, provides strong support for fault recovery and problem diagnosis through the version control mechanism, and supports more efficient distributed synchronization, reducing network overhead and computing resource consumption.
[0121] Optionally, the graph database online change module 810 is specifically used for:
[0122] The online data definition language operations include a first update operation, a second update operation, and a third update operation; the graph data versions to be updated include a first data update version, a second data update version, and a third data update version;
[0123] Optionally, the graph database online change module 810 is specifically further used for:
[0124] When the online data definition language operation is the first update operation, execute the first update operation and determine the first data update version corresponding to the first update operation; the first data update version includes a first update graph pattern version and a first update data version;
[0125] When the online data definition language operation is the second update operation, execute the second update operation and determine the second update data version corresponding to the second update operation; the second update data version includes a second update graph pattern version and a second update data version;
[0126] When the online data definition language operation is the third update operation, execute the third update operation and determine the third update graph pattern version corresponding to the third update operation.
[0127] Optionally, the graph pattern update module 820 is specifically configured to:
[0128] The database operation types include graph pattern version change, graph database version change, and graph database reconstruction;
[0129] Identify the database operation type of the first update operation or the third update operation, and determine that the database operation type of the first update operation is the graph database version change and the database operation type of the third update operation is the graph pattern version change;
[0130] If the number of versions of the graph pattern version of the graph database detected by the version control system is greater than the graph pattern threshold, it is considered that the version control system meets the preset graph database update condition;
[0131] Generate the pattern update task through the version control system.
[0132] Optionally, the graph pattern update module 820 is specifically further configured to:
[0133] Identify the second update operation and determine that the database operation type of the second update operation is graph database reconstruction;
[0134] If the database operation type is graph database reconstruction, it is considered that the database operation type meets the preset graph database update condition;
[0135] Generate the pattern update task according to the second update operation.
[0136] Optionally, the namespace update module 830 is specifically configured to:
[0137] Identify the namespace to be updated in the active state of the graph database;
[0138] Determine a target namespace and at least one version of graph data to be updated according to the task updated by the said pattern;
[0139] Identify each version of the graph data to be updated and determine a target update information set;
[0140] Scan the graph data to be updated and the graph schema to be updated corresponding to the namespace to be updated,
[0141] Backfill the graph data to be updated into the target namespace concurrently according to the target update information set, and determine the target graph data and the target graph schema;
[0142] Set the target namespace to the active state, and delete the graph data to be updated and the graph schema to be updated in the namespace to be updated.
[0143] Optionally, the namespace update module 830 is further specifically configured to:
[0144] In the case that the second updated data version does not exist in the versions of the graph data to be updated, determine the target update information set from at least one of the first data update versions and / or the third updated graph schema versions;
[0145] In the case that the second updated data version exists in the versions of the graph data to be updated, determine the second updated data version as the target update information set.
[0146] The implementation device for the online data definition language operation of the graph database provided by the embodiments of the present invention can execute the implementation method for the online data definition language operation of the graph database provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0147] Figure 9 FIG. shows a schematic structural diagram of an electronic device 10 that can be used to implement the embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, a personal digital processor, a cellular phone, a smart phone, a wearable device (such as a helmet, glasses, a watch, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their patterns are only examples and are not intended to limit the implementation of the present invention described herein and / or claimed.
[0148] Such as Figure 9As shown, the electronic device 10 includes at least one processor 11 and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. The memory stores a computer program executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0149] Multiple components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disc, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0150] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the implementation method of the online data definition language operation of the graph database.
[0151] In some embodiments, the implementation method of the online data definition language operation of the graph database can be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the implementation method of the online data definition language operation of the graph database described above can be executed. Alternatively, in other embodiments, the processor 11 can be configured to execute the implementation method of the online data definition language operation of the graph database by any other appropriate means (such as, by means of firmware).
[0152] The various embodiments of the systems and techniques described above in this specification can be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems-on-chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being 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 a special-purpose or general-purpose programmable processor that receives data and instructions from, and transmits data and instructions to, a storage system, at least one input device, and at least one output device.
[0153] The 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 can 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 / operations specified in the flowchart and / or block diagram to be implemented. The computer programs may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
[0154] 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. The 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 of the foregoing. Alternatively, the computer-readable storage medium may be a machine-readable signal medium. More specific examples of the 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 portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0155] 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 a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can also be used to provide interaction with the user; for example, the 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 input, voice input, or tactile input).
[0156] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), blockchain network, and the Internet.
[0157] A computing system can include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The client-server relationship is created by computer programs running on 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 a cloud host, which is a host product in the cloud computing service system and solves the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.
[0158] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is imposed herein.
[0159] This embodiment provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method steps for implementing the online data definition language operations of the graph database as provided in any embodiment of the present invention. The method includes:
[0160] Receive online data definition language operations on a graph database, execute the online data definition language operations, and determine a graph data version to be updated corresponding to the online data definition language operations;
[0161] Identify the database operation type corresponding to the online data definition language operation. If the graph database meets the preset graph database update conditions detected by the database operation type or version control system, generate a schema update task;
[0162] Update the graph data version to be updated to the graph database according to the schema update task.
[0163] The computer storage medium of the embodiments of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the computer-readable storage medium include: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer-readable storage medium may be any tangible medium that contains or stores a program, which can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0164] The computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries the computer-readable program code. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0165] The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0166] Computer program code for performing the operations of the present invention can be written in one or more programming languages or combinations thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and also including conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or, it can be connected to an external computer (e.g., by connecting through the Internet using an Internet service provider).
[0167] Those of ordinary skill in the art should understand that the above-mentioned modules or steps of the present invention can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. Optionally, they can be implemented with program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0168] It should be understood that various forms of the flow shown above can be used, reordering, adding, or deleting steps. For example, the steps recited in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and this is not limited herein.
[0169] The above specific embodiments do not constitute a limitation on the protection scope of the present 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 principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. An implementation method for online data definition language operations of a graph database, characterized in that, Including: Receiving an online data definition language operation on a graph database, executing the online data definition language operation, and determining a graph data version to be updated corresponding to the online data definition language operation; Identifying a database operation type corresponding to the online data definition language operation, and generating a schema update task when the database operation type or the version control system detects that the graph database meets a preset graph database update condition; Updating the graph data version to be updated to the graph database according to the schema update task.
2. The method according to claim 1, characterized in that, The online data definition language operation includes a first update operation, a second update operation, and a third update operation; the graph data version to be updated includes a first data update version, a second data update version, and a third data update version.
3. The method according to claim 2, characterized in that, The executing the online data definition language operation and determining the graph data version to be updated corresponding to the online data definition language operation includes: When the online data definition language operation is the first update operation, executing the first update operation and determining a first data update version corresponding to the first update operation; the first data update version includes a first updated graph schema version and a first updated data version; When the online data definition language operation is the second update operation, executing the second update operation and determining a second updated data version corresponding to the second update operation; When the online data definition language operation is the third update operation, executing the third update operation and determining a third updated graph schema version corresponding to the third update operation.
4. The method according to claim 3, characterized in that, The database operation type includes graph schema version change, graph database version change, and graph database reconstruction; The identifying the database operation type corresponding to the online data definition language operation and generating a schema update task when the database operation type or the version control system detects that the graph database meets a preset graph database update condition includes; Identifying the database operation type of the first update operation or the third update operation, and determining that the database operation type of the first update operation is the graph database version change and the database operation type of the third update operation is the graph schema version change; Detecting, through the version control system, that the number of versions of the graph schema version of the graph database is greater than a graph schema threshold, and then considering that the version control system meets the preset graph database update condition; Generating the schema update task through the version control system.
5. The method according to claim 4, characterized in that, The identifying the database operation type corresponding to the online data definition language operation and generating a schema update task when the database operation type or the version control system detects that the graph database meets a preset graph database update condition includes; Identifying the second update operation and determining that the database operation type of the second update operation is graph database reconstruction; When the database operation type is graph database reconstruction, then considering that the database operation type meets the preset graph database update condition; Generating the schema update task according to the second update operation.
6. The method according to claim 3, characterized in that, Updating the to-be-updated graph data version to the graph database according to the pattern update task includes: Identifying the to-be-updated namespace in the graph database that is in an active state; Determining a target namespace and at least one to-be-updated graph data version according to the pattern update task; Identifying each to-be-updated graph data version and determining a target update information set; Scanning the to-be-updated graph data and to-be-updated graph pattern corresponding to the to-be-updated namespace; Performing concurrent backfilling of the to-be-updated graph data into the target namespace according to the target update information set to determine target graph data and a target graph pattern; Setting the target namespace to an active state and deleting the to-be-updated graph data and to-be-updated graph pattern of the to-be-updated namespace.
7. The method according to claim 6, characterized in that, The identifying each to-be-updated graph data version and determining a target update information set includes: In the case where the second updated data version does not exist in the to-be-updated graph data version, determining the target update information set in at least one of the first data update versions and / or the third updated graph pattern versions; In the case where the second updated data version exists in the to-be-updated graph data version, determining the second updated data version as the target update information set.
8. An implementation device for online data definition language operations of a graph database, characterized in that, Including: A graph database online change module, configured to receive an online data definition language operation on the graph database, execute the online data definition language operation, and determine a to-be-updated graph data version corresponding to the online data definition language operation; A graph pattern update module, configured to identify a database operation type corresponding to the online data definition language operation, and generate a pattern update task when the graph database is detected to meet a preset graph database update condition in the database operation type or version control system; A namespace update module, configured to update the to-be-updated graph data version to the graph database according to the pattern update task.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to 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 so that the at least one processor can execute the implementation method of the online data definition language operation of the graph database according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a processor to execute the implementation method of the online data definition language operation of the graph database according to any one of claims 1-7 when executed.
Citation Information
Patent Citations
Method and device for online DDL table structure modification of relational database
CN110909087A
Incremental data storage method for different regions and different versions
CN114443644A
Transaction execution method and device, computing equipment and storage medium
CN115113989A
Database version management method and device, computing equipment and storage medium
CN117349258A
Methods and systems for changing a database schema
US20250077494A1