Data updating method, data updating device, program product and electronic equipment

By obtaining the update information of the relational database and determining the object to be updated based on its association with the graph database, the problem of accurate and inefficient data migration between the relational database and the graph database is solved, and fast and accurate data migration is achieved. and a better graph database design process.

CN118939667APending Publication Date: 2024-11-12CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410978710.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

In the prior art, there is a lack of accurate and efficient data migration scheme between relational databases and graph databases, especially in complex mapping relationships, it is difficult to ensure the accuracy and efficiency of data migration.

Method used

By obtaining the update information of the relational database and based on its association relationship with the graph database (including one-to-one mapping and many-to-one mapping relationship), the objects to be updated in the graph database and update according to the update information. Implement data migration.

Benefits of technology

Improve the accuracy and efficiency of data migration between relational databases and graph databases, especially when multiple relational databases are mapped to one graph database, the relevant objects can be quickly identified and updated, avoiding update omissions, and improving graphs The business design process of database designers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939667A_ABST
    Figure CN118939667A_ABST
Patent Text Reader

Abstract

The invention provides a data updating method and device, a program product and electronic equipment, and relates to the technical field of data processing. The method comprises the steps of obtaining update information of a relational database; determining a to-be-updated object in the graph database based on an association relationship between the relational database and one or more graph databases and the updating information; wherein the association relationship comprises at least one of a one-to-one mapping relationship and a many-to-one mapping relationship; the one-to-one mapping relation indicates that one data table in the relational database is mapped to one graph database, and the many-to-one mapping relation indicates that a plurality of data tables in the relational database are mapped to one graph database; and updating the to-be-updated object according to the updating information. The data migration accuracy and efficiency between the relational database and the graph database are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to a data updating method, a data updating device, a computer program product and an electronic device. Background Art

[0002] With the development of computer and database technology, graph databases are being used more and more widely. Compared with traditional relational databases, graph databases have the advantages of more flexible data structures, higher query efficiency, and better support for knowledge graphs and artificial intelligence applications.

[0003] In the related art, it is often necessary to migrate data in a relational database to a graph database to meet the needs of data query analysis, etc. However, there is currently no accurate and efficient data migration solution between a relational database and a graph database. Summary of the invention

[0004] The present disclosure provides a data updating method, a data updating device, a computer program product and an electronic device, so as to at least to some extent solve the problems of low accuracy and efficiency of data migration in the related art.

[0005] According to a first aspect of the present disclosure, a data updating method is provided, the method comprising: obtaining update information of a relational database; determining an object to be updated in the graph database based on an association relationship between the relational database and one or more graph databases and the update information; wherein the association relationship comprises at least one of a one-to-one mapping relationship and a many-to-one mapping relationship; the one-to-one mapping relationship indicates that a data table in the relational database is mapped to a graph database, and the many-to-one mapping relationship indicates that multiple data tables in the relational database are mapped to a graph database; and updating the object to be updated according to the update information.

[0006] According to a second aspect of the present disclosure, a data updating device is provided, the device comprising: an update information acquisition module, configured to acquire update information of a relational database; a to-be-updated object determination module, configured to determine the to-be-updated object in the graph database based on an association relationship between the relational database and one or more graph databases and the update information; wherein the association relationship comprises at least one of a one-to-one mapping relationship and a many-to-one mapping relationship; the one-to-one mapping relationship indicates that a data table in the relational database is mapped to a graph database, and the many-to-one mapping relationship indicates that multiple data tables in the relational database are mapped to a graph database; a data update processing module, configured to update the to-be-updated object according to the update information.

[0007] According to a third aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the method of the first aspect and possible implementations thereof are implemented.

[0008] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the data update method of the above-mentioned first aspect and its possible implementation method by executing the executable instructions.

[0009] The technical solution disclosed in this disclosure has the following beneficial effects:

[0010] On the one hand, it improves the accuracy and efficiency of data migration between relational databases and graph databases, especially when multiple relational databases are mapped to one graph database, it can quickly identify the relevant objects to be updated in the graph database and update them, avoiding updates that are missed due to complex mapping relationships. On the other hand, it improves the applicable scenarios of graph databases and data migration, allowing graph database designers to better focus on business design and reduce constraints on the applicability of data migration. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 A flow chart showing a data updating method in this exemplary embodiment is shown.

[0012] Figure 2 A flowchart for determining an association relationship in this exemplary embodiment is shown.

[0013] Figure 3 Another flowchart for determining an association relationship in this exemplary embodiment is shown.

[0014] Figure 4 A flowchart for determining an object to be updated in this exemplary embodiment is shown.

[0015] Figure 5 A data update architecture diagram in this exemplary embodiment is shown.

[0016] Figure 6 A schematic structural diagram of a data updating device in this exemplary embodiment is shown.

[0017] Figure 7 A schematic structural diagram of an electronic device in this exemplary embodiment is shown. DETAILED DESCRIPTION

[0018] Exemplary embodiments of the present disclosure will be described more fully hereinafter with reference to the accompanying drawings.

[0019] The accompanying drawings are schematic diagrams of the present disclosure and are not necessarily drawn to scale. Some of the block diagrams shown in the accompanying drawings may be functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in hardware modules or integrated circuits, or in networks, processors or microcontrollers. The embodiments can be implemented in various forms and should not be construed as being limited to the examples set forth herein. The features, structures or characteristics described in the present disclosure may be combined in one or more embodiments in any suitable manner. In the description below, many specific details are provided to provide a full description of the embodiments of the present disclosure. However, those skilled in the art should appreciate that one or more specific details may be omitted when implementing the technical solution of the present disclosure, or one or more specific details may be replaced by other methods, components, devices, steps, etc.

[0020] Relational databases and graph databases use completely different data structures. Therefore, there may be complex mapping relationships between relational databases and graph databases, such as mapping multiple relational databases to one graph database. Related technologies are difficult to solve data migration problems under complex mapping relationships. Alternatively, customized development is required through dedicated point-of-use methods, which has the problems of low versatility and high implementation costs.

[0021] In view of one or more of the above problems, an exemplary embodiment of the present disclosure provides a data updating method. Figure 1 An exemplary process of the data updating method is shown, which may include the following steps S110 to S130:

[0022] Step S110, obtaining update information of the relational database;

[0023] Step S120, based on the association relationship between the relational database and one or more graph databases and the update information, determine the object to be updated in the graph database; wherein the association relationship includes at least one of a one-to-one mapping relationship and a many-to-one mapping relationship; the one-to-one mapping relationship indicates that a data table in the relational database is mapped to a graph database, and the many-to-one mapping relationship indicates that multiple data tables in the relational database are mapped to a graph database;

[0024] Step S130: updating the object to be updated according to the update information.

[0025] based on Figure 1The method improves the accuracy and efficiency of data migration between relational databases and graph databases, especially when multiple relational databases are mapped to one graph database. It can quickly identify the relevant objects to be updated in the graph database and update them, avoiding update omissions caused by complex mapping relationships. On the other hand, it improves the applicable scenarios of graph databases and data migration, allowing graph database designers to better focus on business design and reduce constraints on the applicability of data migration.

[0026] Below Figure 1 Provide detailed instructions for each step.

[0027] refer to Figure 1 In step S110, update information of the relational database is obtained.

[0028] The relational database is the source database in data migration, and the graph database is the target database in data migration. The purpose of data migration is to migrate the data updates in the relational database to the graph database so that the graph database remains consistent with the relational database.

[0029] The update information of a relational database may include but is not limited to: update objects, such as the updated data ID (or primary key), fields, etc.; update types, such as data addition, data deletion, data modification, etc., or the type of update object, whether it belongs to an entity or a relationship; update value, which may be the updated data value.

[0030] In one implementation, the above-mentioned obtaining update information of the relational database may include the following steps:

[0031] In response to monitoring data update of the relational database, the update information is added to a message queue, and the update information to be processed is obtained from the message queue.

[0032] Among them, the update log of the relational database can be monitored. If the update log generates new content, it means that the relational database has been updated. Alternatively, all logs of the relational database can be monitored. If update-related content is generated in the log, such as log records of data writing, it means that the relational database has been updated. Update information can be obtained from the monitored update log or all logs. The update information may include log records related to this data update. The update information is added to the message queue. The message queue can store all unsynchronized update information, that is, update information that has been executed in the relational database but not in the graph database.

[0033] The message queue can process the update information therein according to first-in-first-out or other mechanisms. For example, the newly added update information can be placed at the end of the queue, and each time an update information is taken from the head of the queue as the update information to be processed, and the subsequent data update process is executed.

[0034] Through the message queue, the data update status of the relational database can be asynchronously migrated to the graph database, reducing the data processing pressure when a large amount of data is updated in a short period of time. And the update information processing in the message queue can be reasonably arranged according to the pressure of the graph database. For example, in the period when the graph database is relatively idle, the update information can be taken out from the message queue at a higher frequency or concurrency rate for data update processing. In the period when the graph database is relatively busy, the update information can be taken out from the message queue at a lower frequency or concurrency rate for data update processing, and even the data update processing can be suspended. This makes the data migration process more flexible and controllable.

[0035] Continue to refer Figure 1 In step S120, based on the association relationship between the relational database and one or more graph databases and the update information, the object to be updated in the graph database is determined; wherein the association relationship includes at least one of a one-to-one mapping relationship and a many-to-one mapping relationship; the one-to-one mapping relationship indicates that a data table in the relational database is mapped to a graph database, and the many-to-one mapping relationship indicates that multiple data tables in the relational database are mapped to a graph database.

[0036] In this exemplary embodiment, the relational database may include one or more data tables. A graph database may refer to a data system corresponding to a graph. The association relationship between the relational database and the graph database may be a one-to-one mapping relationship or a many-to-one mapping relationship. In a one-to-one mapping relationship, a data table is mapped to a graph database, and the entities, relationships, etc. in the graph database have corresponding mapping objects in the data table. In a many-to-one mapping relationship, multiple data tables are mapped to a graph database, and the entities, relationships, etc. in the graph database may be mapped to different data tables, or mapped to data objects formed by combining multiple data tables.

[0037] The following is a detailed description of how to determine the association relationship.

[0038] In one embodiment, reference Figure 2 As shown, the data updating method may further include the following steps S210 and S220:

[0039] Step S210, obtaining configuration information of the graph database entity;

[0040] Step S220, determining the association relationship between the relational database and the graph database according to the configuration information of the ontology.

[0041] Among them, the ontology includes the concepts to which the entities in the graph database belong and the relationships between the concepts. The configuration information of the ontology can be the information configured by the designers of the graph database when designing the ontology, such as the ontology design information. According to the configuration information of the ontology, the corresponding relationship between the elements in the relational database and the elements in the graph database can be determined, thereby determining the association relationship between the relational database and the graph database.

[0042] In one embodiment, reference Figure 3 As shown, the above-mentioned determination of the association relationship between the relational database and the graph database according to the configuration information of the ontology may include the following steps S310 and S320:

[0043] Step S310, determining the correspondence between the ontology and the fields of the relational database according to the configuration information of the ontology of the graph database;

[0044] Step S320, determining the association relationship between the relational database and the graph database based on the correspondence between the ontology and the field.

[0045] The correspondence between the ontology and the fields of the relational database may include the correspondence between the concepts or relations in the ontology and the fields. Based on this correspondence, the correspondence between the entities under the concepts in the ontology and the relations between the entities and the field values ​​under the fields in the relational database can be obtained, thereby determining the association between the relational database and the graph database.

[0046] Exemplarily, the association relationship between the relational database and the graph database may include a mapping relationship between entities and relationships in the graph database and data tables in the relational database.

[0047] Objects to be updated refer to entities, relationships and other objects that need to be updated in the graph database. Due to the different data structures between relational databases and graph databases, it is difficult to directly determine the objects to be updated in the graph database based on the update information of the relational database in some cases. Therefore, the update information can be mapped to the graph database based on the association between the two databases to determine the objects to be updated.

[0048] In one embodiment, reference Figure 4 As shown, the above-mentioned determination of the to-be-updated object in the graph database based on the association relationship between the relational database and one or more graph databases and the update information may include the following steps S410 and S420:

[0049] Step S410, determining the update object and update type according to the update information;

[0050] Step S420, determining the object to be updated in the graph database based on the association relationship, update object and update type.

[0051] The update object refers to the updated data in the relational database, such as the updated row, column, specific data, etc. The update type can refer to the type of operation that occurs in the relational database, such as data addition, data deletion, data modification, etc. It can also refer to the update type corresponding to the graph database, such as whether the type of the update object belongs to an entity or a relationship. The corresponding update types can include adding entities, deleting entities, modifying entities, adding relationships, deleting relationships, modifying relationships, etc.

[0052] By parsing the update information, the update object and update type can be determined. Alternatively, based on the parsing of the update information, the update type can be determined in combination with the association between the relational database and the graph database.

[0053] Based on the above update objects and update types, and in combination with the association between the relational database and the graph database, the objects to be updated in the graph database are determined.

[0054] In one implementation, the above-mentioned determining the object to be updated in the graph database based on the association relationship, the update object and the update type may include the following steps:

[0055] In the case where the association relationship is a many-to-one mapping relationship between multiple data tables and a graph database, the object to be updated in the graph database is determined based on the update object, the update type, and the multiple data tables.

[0056] Exemplarily, the related objects may be determined in a full data table including multiple data tables according to an identifier of the updated object, and the objects to be updated corresponding to the related objects in the graph database may be determined based on the update type.

[0057] The full data table can be a data table formed by combining multiple data tables (such as a join operation), or a full data table containing all data information in a relational database. Related objects refer to all data objects in a relational database that are related to this update. In addition to the updated objects, they may also include objects that have not been directly updated. For example, the user name of user P in data table a is updated. In addition to the direct update of user P's data under the username field, all related tuples formed in combination with the username are updated and can be used as related objects.

[0058] After determining the related objects, the corresponding objects to be updated in the graph database can be determined based on the update type, and accurate and comprehensive supplementation of the objects to be updated can be achieved in combination with the association relationship.

[0059] Continue to refer Figure 1 In step S130, the object to be updated is updated according to the update information.

[0060] When the object to be updated is determined, the corresponding operations such as adding, deleting, and modifying can be performed in the graph database. When updating an entity, the relationship related to the entity can also be updated according to the specific situation. In this way, the update information in the relational database is migrated to the graph database.

[0061] Table 1 specifically shows the processing methods corresponding to different association relationships and different update types. It can be seen that under different association relationships and different update types, the specific processing methods for determining the object to be updated and the update data may be different.

[0062] Exemplarily, if the association relationship is a one-to-one mapping relationship, for example, data table a is mapped to graph database x separately. If the update type is adding a new entity, the entity to be added in x is determined based on the new data in a; if the update type is deleting an entity, the entity to be deleted in x is determined based on the new data in a; if the update type is modifying an entity, the entity to be modified in x is determined based on the new data in a; when determining the entity to be updated, the related relationship to be updated can also be determined. If the update type is adding a new relationship, the relationship to be added in x is determined based on the new data in a; if the update type is deleting a relationship, the relationship to be deleted in x is determined based on the new data in a; if the update type is modifying a relationship, the relationship to be deleted first and then added in x is determined based on the values ​​before and after the modification in a.

[0063] Exemplarily, if the association relationship is a many-to-one mapping relationship, such as the case where data tables a and b are jointly mapped to graph database x. If the update type is to add a new entity, then according to the new data ID in a or b, all related objects are determined through SQL query, and then the entity to be added in x is determined; if the update type is to delete an entity, then according to the deleted data ID in a or b, and according to whether the updated table a or b is the primary table or the secondary table, the entity to be deleted in x is determined, or the entity attribute value to be updated to null in x is determined; if the update type is to modify an entity, then according to the modified data ID in a or b, all related objects are determined through SQL query, and then the entity to be modified in x is determined; when determining the entity to be updated, the related relationship to be updated can also be determined. If the update type is to add a new relationship, then according to the new data ID in a or b, all related objects are determined through SQL query, and then the relationship to be added in x is determined; if the update type is to delete a relationship, then according to the deleted data ID in a or b, all related objects are determined through SQL query, and then the relationship to be deleted in x is determined; if the update type is to modify a relationship, then according to the modified data ID in a or b, SQL query is used to determine the old relationship to be deleted and the new relationship to be added in x.

[0064] Table 1

[0065]

[0066]

[0067] The above examples can solve the data update and migration problems from relational databases to graph databases in various scenarios.

[0068] In one implementation, the connection information of the relational database, the connection information of the graph database, and the association information between the relational database and the graph database (which may include the ontology configuration information of the graph database, the mapping relationship between the entities and relationships in the graph database and the data tables of the relational database) can be configured as an interface. The data incremental update migration task is created through the interface, and the task may include the data table of the data incremental update that needs to be paid attention to, the target graph database that needs to be migrated, etc. According to the data incremental update migration task, the data update message of the relational database is subscribed, and according to the update information and the association relationship, the object to be updated in the graph database is determined and finally updated to complete the data incremental update migration process.

[0069] Figure 5 The architecture diagram of this exemplary embodiment is shown. Among them, the relational database may include but is not limited to MySQL, Oracle and other databases. By capturing the database log of the relational database, the update information of the relational database is obtained and added to the message queue. The message queue takes out the update information in sequence, generates and executes the corresponding data incremental update migration task. When executing the data incremental update migration task, the incremental data can be determined. The ontology configuration information is obtained by graph management, and the association relationship between the ontology and the relational database is determined, and then the mapping relationship between the relational database and the graph database is determined. Based on the mapping relationship, the data in the source library (that is, the updated relational database) and the target library are queried to realize the incremental data supplementation processing, thereby determining all the objects to be updated related to the incremental data. Finally, through the incremental data processing, the incremental update data is written to the graph database to achieve the consistency of the data in the relational database and the graph database.

[0070] The exemplary embodiment of the present disclosure also provides a data updating device. Figure 6 As shown, the data updating device 600 may include the following program modules:

[0071] The update information acquisition module 610 is configured to acquire update information of the relational database;

[0072] The object to be updated determining module 620 is configured to determine the object to be updated in the graph database based on the association relationship between the relational database and one or more graph databases and the update information; wherein the association relationship includes at least one of a one-to-one mapping relationship and a many-to-one mapping relationship; the one-to-one mapping relationship indicates that a data table in the relational database is mapped to a graph database, and the many-to-one mapping relationship indicates that multiple data tables in the relational database are mapped to a graph database;

[0073] The data update processing module 630 is configured to update the object to be updated according to the update information.

[0074] In one implementation, the to-be-updated object determination module 620 is further configured to:

[0075] Obtaining configuration information of the graph database entity;

[0076] According to the configuration information of the ontology, the association relationship between the relational database and the graph database is determined.

[0077] In one implementation, determining the association relationship between the relational database and the graph database according to the configuration information of the ontology includes:

[0078] Determine the correspondence between the ontology and the fields of the relational database according to the configuration information of the ontology of the graph database;

[0079] The association relationship between the relational database and the graph database is determined based on the correspondence between the ontology and the field.

[0080] In one implementation, the determining the object to be updated in the graph database based on the association relationship between the relational database and one or more graph databases and the update information includes:

[0081] Determine an update object and an update type according to the update information;

[0082] Based on the association relationship, the update object and the update type, an object to be updated in the graph database is determined.

[0083] In one implementation, determining the object to be updated in the graph database based on the association relationship, the update object, and the update type includes:

[0084] In the case where the association relationship is a many-to-one mapping relationship from a plurality of data tables to the graph database, the object to be updated in the graph database is determined based on the update object, the update type, and the plurality of data tables.

[0085] In one implementation, determining the object to be updated in the graph database based on the update object, the update type, and the multiple data tables includes:

[0086] According to the identifier of the update object, a related object is determined in the full database including the multiple relational databases, and based on the update type, an object to be updated corresponding to the related object in the graph database is determined.

[0087] In one implementation, obtaining update information of a relational database includes:

[0088] In response to monitoring data update of the relational database, the update information is added to a message queue, and the update information to be processed is obtained from the message queue.

[0089] The specific details of each part of the above-mentioned device have been described in detail in the implementation method of the method part. The undisclosed details can be found in the implementation method of the method part, so they will not be repeated here.

[0090] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0091] The exemplary embodiments of the present disclosure also provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the game editing method is implemented.

[0092] In one embodiment, the computer program product may be a tangible product containing a computer program, such as a computer-readable storage medium storing a computer program. The readable storage medium may be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory (Flash), mechanical hard disk (HDD), solid-state drive (SSD), and the like. Exemplarily, the computer program product may be implemented as a non-volatile storage medium storing a computer program, such as a read-only memory, a NAND flash memory, and the like.

[0093] In one embodiment, the computer program product may be an intangible product including a computer program. Exemplarily, the computer program product may be implemented as a virtual digital product, such as a digital file storing an executable file, an installation package, etc. of the computer program.

[0094] The code of the computer program can be written in one or more programming languages. Programming languages ​​such as C language, Java, C++, etc. The program code can be executed entirely on the user computing device, or partially on the user computing device, or as a separate software package, or partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, such as a local area network (LAN), a wide area network (WAN), etc., or can be connected to an external computing device (e.g., an Internet connection provided by an operator).

[0095] Computer programs can be carried or transmitted through electrical, magnetic, optical, electromagnetic, infrared and other signals. Electronic devices can convert signals carrying computer programs into digital signals to run computer programs. When a computer program runs on an electronic device, its code is used to enable the electronic device to execute (more specifically, the processor of the electronic device can execute) the method steps of various exemplary embodiments of the present disclosure, such as the above-mentioned game editing method, which includes the following steps: Step S110, obtaining update information of a relational database; Step S120, based on the association relationship between the relational database and one or more graph databases and the update information, determining the object to be updated in the graph database; wherein the association relationship includes at least one of a one-to-one mapping relationship and a many-to-one mapping relationship; a one-to-one mapping relationship indicates that a data table in a relational database is mapped to a graph database, and a many-to-one mapping relationship indicates that multiple data tables in a relational database are mapped to a graph database; Step S130, updating the object to be updated according to the update information.

[0096] By implementing the above method steps through a computer program, on the one hand, the accuracy and efficiency of data migration between relational databases and graph databases are improved, especially when multiple relational databases are mapped to one graph database, the relevant objects to be updated in the graph database can be quickly determined and updated, avoiding update omissions caused by complex mapping relationships. On the other hand, the applicable scenarios of graph databases and data migration are improved, so that graph database designers can better focus on business design and reduce the constraints on the applicability of data migration.

[0097] The exemplary embodiments of the present disclosure also provide an electronic device. The electronic device may include a processor and a memory. The memory stores executable instructions of the processor, such as a computer program. The processor executes the method steps of various exemplary embodiments of the present disclosure by executing the executable instructions.

[0098] Reference below Figure 7, the electronic device is exemplarily described in the form of a general-purpose computing device. It should be understood that Figure 7 The electronic device 700 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0099] like Figure 7 As shown, the electronic device 700 may include: a processor 710 , a memory 720 , a bus 730 , an I / O (input / output) interface 740 , and a network adapter 750 .

[0100] The memory 720 may include a volatile memory, such as a RAM 721, a cache unit 722, and may also include a non-volatile memory, such as a ROM 723. The memory 720 may also include one or more program modules 724, such program modules 724 include but are not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or a combination thereof may include the implementation of a network environment. For example, the program module 724 may include each module in the above-mentioned device.

[0101] The processor 710 may include one or more processing units. For example, the processor 710 may include an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor and / or an NPU (Neural-Network Processing Unit), etc.

[0102] The processor 710 can be used to execute executable instructions stored in the memory 720, such as the above-mentioned game editing method, which includes the following steps: step S110, obtaining update information of the relational database; step S120, based on the association relationship between the relational database and one or more graph databases and the update information, determining the object to be updated in the graph database; wherein the association relationship includes at least one of a one-to-one mapping relationship and a many-to-one mapping relationship; the one-to-one mapping relationship indicates that a data table in the relational database is mapped to a graph database, and the many-to-one mapping relationship indicates that multiple data tables in the relational database are mapped to a graph database; step S130, updating the object to be updated according to the update information.

[0103] By executing the above method steps through the processor 710, on the one hand, the accuracy and efficiency of data migration between the relational database and the graph database are improved, especially for the case where multiple relational databases are mapped to one graph database, the relevant objects to be updated in the graph database can be quickly determined and updated, avoiding the update omission caused by complex mapping relationships. On the other hand, the applicable scenarios of graph databases and data migration are improved, so that graph database designers can better focus on business design and reduce the constraints on the applicability of data migration.

[0104] The bus 730 is used to realize the connection between different components of the electronic device 700, and may include a data bus, an address bus, and a control bus.

[0105] The electronic device 700 can communicate with one or more external devices 800 (eg, a keyboard, a mouse, an external controller, etc.) through the I / O interface 740 .

[0106] The electronic device 700 can communicate with one or more networks through the network adapter 750. For example, the network adapter 750 can provide mobile communication solutions such as 3G / 4G / 5G, or wireless communication solutions such as wireless LAN, Bluetooth, near field communication, etc. The network adapter 750 can communicate with other modules of the electronic device 700 through the bus 730.

[0107] although Figure 7 Not shown, other hardware and / or software modules may also be provided in the electronic device 700, including but not limited to: a display, a microcode, a device driver, a redundant processor, an external disk drive array, a RAID system, a tape drive, and a data backup storage system.

[0108] As can be seen from the above, the technical solution of the present disclosure can be implemented as a method, an apparatus, a system, a computer program product, a storage medium, an electronic device, etc. Those skilled in the art can understand that various aspects of the present disclosure can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software, such as being respectively referred to as a "circuit", "module" or "system".

[0109] It should be understood that the present disclosure is not limited to the specific method steps or structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from the scope thereof. Those skilled in the art will easily think of other embodiments based on the specific embodiments provided by the present disclosure. Therefore, the specific embodiments provided by the present disclosure are only exemplary, and the scope and spirit of the present disclosure are indicated by the claims, and any variations, uses or adaptive changes of the present disclosure should be covered, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the technical field that are not disclosed in the present disclosure.

Claims

1. A data updating method, characterized in that: The method comprises: Get updated information of relational database; Based on the association relationship between the relational database and one or more graph databases and the update information, determine the object to be updated in the graph database; wherein the association relationship includes at least one of a one-to-one mapping relationship and a many-to-one mapping relationship; the one-to-one mapping relationship indicates that a data table in the relational database is mapped to a graph database, and the many-to-one mapping relationship indicates that multiple data tables in the relational database are mapped to a graph database; The object to be updated is updated according to the update information.

2. The method according to claim 1, characterized in that The method further comprises: Obtaining configuration information of the graph database entity; According to the configuration information of the ontology, the association relationship between the relational database and the graph database is determined.

3. The method according to claim 2, characterized in that Determining the association relationship between the relational database and the graph database according to the configuration information of the ontology includes: Determine the correspondence between the ontology and the fields of the relational database according to the configuration information of the ontology of the graph database; The association relationship between the relational database and the graph database is determined based on the correspondence between the ontology and the field.

4. The method according to claim 1, characterized in that: The determining the object to be updated in the graph database based on the association relationship between the relational database and one or more graph databases and the update information includes: Determine an update object and an update type according to the update information; Based on the association relationship, the update object and the update type, an object to be updated in the graph database is determined.

5. The method according to claim 4, characterized in that The determining the object to be updated in the graph database based on the association relationship, the update object and the update type includes: In the case where the association relationship is a many-to-one mapping relationship from a plurality of data tables to the graph database, an object to be updated in the graph database is determined based on the update object, the update type, and the plurality of data tables.

6. The method according to claim 5, characterized in that The determining the object to be updated in the graph database based on the update object, the update type, and the multiple data tables includes: According to the identifier of the update object, a related object is determined in the full data table including the multiple data tables, and based on the update type, an object to be updated corresponding to the related object in the graph database is determined.

7. The method according to claim 1, characterized in that The obtaining of update information of the relational database includes: In response to monitoring data update of the relational database, the update information is added to a message queue, and the update information to be processed is obtained from the message queue.

8. A data updating device, characterized in that: The device comprises: An update information acquisition module is configured to acquire update information of a relational database; The module for determining an object to be updated is configured to determine an object to be updated in the graph database based on an association relationship between the relational database and one or more graph databases and the update information; wherein the association relationship includes at least one of a one-to-one mapping relationship and a many-to-one mapping relationship; the one-to-one mapping relationship indicates that a data table in the relational database is mapped to a graph database, and the many-to-one mapping relationship indicates that multiple data tables in the relational database are mapped to a graph database; The data update processing module is configured to update the object to be updated according to the update information.

9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

10. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.

Citation Information

Cited By

  • Database linkage operation method, medium and equipment

    CN119576944A