CN110717050A - Method and device for accessing knowledge map database - Google Patents

Method and device for accessing knowledge map database Download PDF

Info

Publication number
CN110717050A
CN110717050A CN201910878270.5A CN201910878270A CN110717050A CN 110717050 A CN110717050 A CN 110717050A CN 201910878270 A CN201910878270 A CN 201910878270A CN 110717050 A CN110717050 A CN 110717050A
Authority
CN
China
Prior art keywords
data source
database
target
configuration
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910878270.5A
Other languages
Chinese (zh)
Other versions
CN110717050B (en
Inventor
刘南吉
陈阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Golden Panda Co Ltd
Original Assignee
Golden Panda Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Golden Panda Co Ltd filed Critical Golden Panda Co Ltd
Priority to CN201910878270.5A priority Critical patent/CN110717050B/en
Publication of CN110717050A publication Critical patent/CN110717050A/en
Application granted granted Critical
Publication of CN110717050B publication Critical patent/CN110717050B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Animal Behavior & Ethology (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses an access method of a knowledge map database, which comprises the following steps: the connection pool acquires a database operation instruction; the connection pool determines target data source configuration data corresponding to the database operation instruction according to the database operation instruction; and the connection pool generates data source connection according to the target data source configuration data so as to execute the database operation instruction on the target database through the data source connection. Therefore, no matter the target database to be accessed is a relational database or a non-relational database, the data source configuration data corresponding to the target database can be acquired, and the data source connection used for being connected with the target database is generated through the data source configuration data, so that various types of knowledge map databases can be operated, the diversity of the accessible knowledge map databases is improved, and the development efficiency of the knowledge maps is improved.

Description

Method and device for accessing knowledge map database
Technical Field
The invention relates to the technical field of databases, in particular to a method and a device for accessing a knowledge map database.
Background
Knowledge Graph (Knowledge Graph) is called Knowledge domain visualization or Knowledge domain mapping map in the book intelligence world, and is a series of various graphs for displaying the relationship between the Knowledge development process and the structure. The knowledge map describes knowledge resources and carriers thereof by using a visualization technology, and mines, analyzes, constructs, draws and displays knowledge and mutual relations among the knowledge resources and the carriers. The graph database is a non-relational database which is realized by efficiently processing a complex relational network based on thought and algorithm of mathematical graph theory, stores relational information between entities by applying graph theory, is good at efficiently processing a large amount of complex, interconnected and changeable data, and has far higher calculation efficiency than the traditional relational database. Therefore, relational databases are mostly used for data and relational storage of knowledge maps.
In the prior art, in the application development of knowledge graphs, various types of databases, such as a relational database and a non-relational database, are used, however, because the types of databases supported by the current knowledge graph database are fixed, most of the databases are relational databases such as Mysql, SQLServer and the like, and cannot be extended to non-relational databases such as Mongodb, Neo4j, elastic search and the like. Accordingly, a need exists for a method that can support access to multiple types of knowledge graph databases, including relational and non-relational databases.
Disclosure of Invention
The invention provides a method and a device for accessing a knowledge graph database, which are used for accessing various knowledge graph databases including a relational database and a non-relational database, so that the diversity of the accessible knowledge graph databases is improved, and the development efficiency of knowledge graphs is improved.
In a first aspect, the present invention provides a method for accessing a knowledge-map database, the method comprising:
the connection pool acquires a database operation instruction;
the connection pool determines target data source configuration data corresponding to the database operation instruction according to the database operation instruction; the target data source configuration data is data source configuration data to be operated in a plurality of data source configuration data respectively corresponding to different types of databases and included in the connection pool;
and the connection pool generates data source connection according to the target data source configuration data so as to execute the database operation instruction on a target database through the data source connection, wherein the target database is a database corresponding to the target data source configuration data.
In a second aspect, the present invention provides an apparatus for accessing a knowledge-graph database, the apparatus comprising:
the acquisition module is used for connecting the pool to acquire a database operation instruction;
the determining module is used for determining target data source configuration data corresponding to the database operation instruction according to the database operation instruction by the connection pool; the target data source configuration data is data source configuration data to be operated in a plurality of data source configuration data respectively corresponding to different types of databases and included in the connection pool;
and the generation module is used for generating data source connection by the connection pool according to the target data source configuration data so as to execute the database operation instruction on a target database through the data source connection, wherein the target database is a database corresponding to the target data source configuration data.
In a third aspect, the invention provides a readable medium comprising executable instructions which, when executed by a processor of an electronic device, cause the electronic device to perform the method as described in the first aspect.
In a fourth aspect, the present invention provides an electronic device comprising a processor and a memory storing execution instructions, wherein when the processor executes the execution instructions stored in the memory, the processor performs the method according to the first aspect.
According to the technical scheme, after the connection pool acquires the database operation instruction, the connection pool can determine the target data source configuration data corresponding to the database operation instruction according to the database operation instruction; the target data source configuration data is data source configuration data to be operated in a plurality of data source configuration data respectively corresponding to different types of databases and included in the connection pool, so that the connection pool can generate data source connection by acquiring the target data source configuration data corresponding to the target database and according to the target data source configuration data, so as to execute the database operation instruction on the target database through the data source connection. Therefore, no matter the target database to be operated is a relational database or a non-relational database, the configuration data of the target data source corresponding to the target database can be obtained, and the data source connection for accessing the target database of the user is generated through the configuration data of the data source, so that various knowledge spectrum databases including the relational database and the non-relational database can be accessed, the diversity of the accessible knowledge spectrum databases is improved, and the development efficiency of the knowledge spectrum is improved.
Further effects of the above-mentioned unconventional preferred modes will be described below in conjunction with specific embodiments.
Drawings
In order to more clearly illustrate the embodiments or the prior art solutions of the present invention, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments described in the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive labor.
Fig. 1 is a schematic flowchart illustrating an access method of a knowledge graph database according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating another method for accessing a knowledge graph database according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating another method for accessing a knowledge graph database according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an access system of a knowledge graph database according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating another method for accessing a knowledge graph database according to an embodiment of the present invention;
FIG. 6 is a flowchart illustrating another method for accessing a knowledge graph database according to an embodiment of the present invention;
FIG. 7 is a flowchart illustrating another method for accessing a knowledge graph database according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an access device for a knowledge graph database according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be described in detail and completely with reference to the following embodiments and accompanying drawings. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The method aims to solve the problem that in the prior art, because the types of databases supported by the current knowledge graph database are fixed and cannot be expanded to non-relational databases such as Mongobb, Neo4j and elastic search, the knowledge graph database cannot support the access of various types of knowledge graph databases including relational databases and non-relational databases, and further the development efficiency of the knowledge graph database is greatly reduced. The invention provides an access method of a knowledge graph database, in the method, after a connection pool acquires a database operation instruction, the connection pool can determine target data source configuration data corresponding to the database operation instruction according to the database operation instruction; the target data source configuration data is data source configuration data to be operated in a plurality of data source configuration data respectively corresponding to different types of databases and included in the connection pool, so that the connection pool can generate data source connection by acquiring the target data source configuration data corresponding to the target database and according to the target data source configuration data, so as to execute the database operation instruction on the target database through the data source connection. Therefore, the method and the system realize the access to various knowledge map databases including the relational database and the non-relational database, further improve the diversity of the accessible knowledge map databases and improve the development efficiency of the knowledge map.
Various non-limiting embodiments of the present invention are described in detail below with reference to the accompanying drawings.
Referring to fig. 1, a method for accessing a knowledge graph database in an embodiment of the present invention is shown, and in this embodiment, the method may include the following steps:
s101: and the connection pool acquires a database operation instruction.
In this embodiment, the connection pool may be understood as a module that creates and manages a buffer pool of at least one connection, for example, the connection pool may store data for creating or managing at least one connection.
A database operation instruction is understood to be an instruction for triggering an operation on a database, such as accessing the database, switching the database, adding the database, etc. For convenience of description, the database that needs to be operated may be referred to as a target database.
S102: and the connection pool determines target data source configuration data corresponding to the database operation instruction according to the database operation instruction.
In this embodiment, a corresponding relationship between each database operation instruction and each data source configuration data may be preset, so that after the connection pool acquires a database operation instruction for the target database, the data source configuration data corresponding to the database operation instruction may be determined, where the data source configuration data corresponding to the database operation instruction may be referred to as target data source configuration data.
It should be noted that the data source configuration data may be various types of information used for accessing the data source corresponding to the target database, and may include, for example, data required for establishing a data source connection.
It should be further noted that the connection pool may include a plurality of data source configuration data respectively corresponding to different types of databases, for example, the connection pool may include data source configuration data of a MySql type database, data source configuration data of a Mongodb type database, data source configuration data of an ElasticSearch type database, and data source configuration data of a Neo4j type database, and the target data source configuration data may be understood as a data source configuration data to be operated in the plurality of data source configuration data respectively corresponding to different types of databases.
S103: and the connection pool generates data source connection according to the target data source configuration data so as to execute the database operation instruction on a target database through the data source connection, wherein the target database is a database corresponding to the target data source configuration data.
After obtaining the target data source configuration data corresponding to the database operation instruction, the connection pool may generate a data source connection according to the target data source configuration data, where the data source connection may be understood as a path through which the connection pool connects to the database. In this way, the connection pool can be connected with the target database through the data source connection generated according to the target data source configuration data, so that the connection pool can respond to the database operation instruction to execute the database operation instruction on the target database, namely, execute the operation corresponding to the database operation instruction.
According to the technical scheme, after the connection pool acquires the database operation instruction, the connection pool can determine the target data source configuration data corresponding to the database operation instruction according to the database operation instruction; the target data source configuration data is data source configuration data to be operated in a plurality of data source configuration data respectively corresponding to different types of databases and included in the connection pool, so that the connection pool can generate data source connection by acquiring the target data source configuration data corresponding to the target database and according to the target data source configuration data, so as to execute the database operation instruction on the target database through the data source connection. Therefore, no matter the target database to be operated is a relational database or a non-relational database, the configuration data of the target data source corresponding to the target database can be obtained, and the data source connection for accessing the target database of the user is generated through the configuration data of the data source, so that various knowledge spectrum databases including the relational database and the non-relational database can be accessed, the diversity of the accessible knowledge spectrum databases is improved, and the development efficiency of the knowledge spectrum is improved.
Fig. 1 shows only a basic embodiment of the method of the present invention, and based on this, certain optimization and expansion can be performed, and other preferred embodiments of the method can also be obtained.
Fig. 2 shows another embodiment of the method for accessing a knowledge-graph database according to the present invention. In this embodiment, S102 is further described on the basis of the embodiment corresponding to fig. 1. In this embodiment, the database operation instruction may be a database access instruction, and the database access instruction may include a target data source configuration file, and specifically, the method specifically includes the following steps:
s201: the connection pool acquires a database access instruction.
The database access instruction may be understood as an instruction for triggering an access operation on a target database.
It should be noted that S201 in this embodiment is the same as S101 in the embodiment corresponding to fig. 1, and therefore, in this embodiment, S201 is not described again, and reference may be specifically made to the description of S101.
S202: and the connection pool acquires a target data source configuration file in the database access instruction.
In this embodiment, the data source configuration file corresponding to the database to be accessed may be referred to as a target data source configuration file. It will be appreciated that the target data source profile may be any of a variety of information for accessing the corresponding data source of the target database.
S203: and the connection pool acquires target data source configuration data corresponding to the target data source configuration file according to the target data source configuration file.
In this embodiment, the target data source configuration data may be understood as one of a plurality of data source configuration data included in the database for accessing the target database. Since the target data source profile is determined according to the target database, for example, the user wishes to access a Neo4j type database, the target data source profile may be a data source profile corresponding to a Neo4j type database, so that the target data source profile corresponding to a Neo4j type database may be determined according to the target data source profile.
It is understood that S102 includes S202-S203.
S204: and the connection pool generates data source connection according to the target data source configuration data so as to execute the database access instruction on the target database through the data source connection.
It will be appreciated that the database access instructions are executed on the target database, i.e., the access operations corresponding to the database access instructions are executed.
It should be noted that S203 in this embodiment is the same as S103 in the embodiment corresponding to fig. 1, and therefore, in this embodiment, S203 is not described again, and reference may be specifically made to the description of S103.
Therefore, the embodiment realizes the switching process of accessing the database by combining with a specific application scene. Of course, the above scenario is only an exemplary scenario and is not intended to limit the method provided by the present invention. The method provided by the invention can be applied to the processing process of the access method of the knowledge graph database with the same principle.
Fig. 2 shows only a basic embodiment of the method of the present invention, and based on this, certain optimization and expansion can be performed, and other preferred embodiments of the method can also be obtained.
Fig. 3 shows another embodiment of the method for accessing a knowledge graph database according to the present invention. In this embodiment, S202-S204 are further described on the basis of the corresponding embodiment shown in fig. 2. In this embodiment, the connection pool may include an interface program and a data source, and the connection pool may obtain a target data source configuration file in the database access instruction, specifically, the method specifically includes the following steps:
s301: the connection pool acquires a database access instruction.
It should be noted that S301 in this embodiment is the same as S201 in the embodiment corresponding to fig. 2, and therefore, in this embodiment, S301 is not described again, and reference may be specifically made to the description of S201.
S302: and the interface program acquires a target data source configuration file in the database access instruction.
S303: and the interface program generates default data source connection according to the default data source in the target data source configuration file.
In this embodiment, the interface program may be understood as a logic program for processing the data source related information and the database related information. When a user needs to access a type of database in the knowledge gallery, a data source configuration file corresponding to the database can be stored in the interface program. For convenience of description, in this embodiment, a database to be accessed is referred to as a target database, and a data source configuration file corresponding to the database to be accessed is referred to as a target data source configuration file. It will be appreciated that the target data source profile may be any of a variety of information for accessing the corresponding data source of the target database.
The target data source configuration file may include a default data source, and after the interface program acquires the target data source configuration file, the interface program may generate a default data source connection according to the default data source in the target data source configuration file. The default data source connection may be understood as a path for the interface program to access the data source, and the default data source may be a device or original media that provides configuration information of the default data source connection and stores all information for establishing the default data source connection.
Next, S301 will be described by way of example, taking the knowledge map database access system corresponding to fig. 4 as an example. In the system, the interface program and the data source can be arranged in a connection pool; assuming that a user stores a target data source profile into a connection configuration interface of an interface program through a knowledge-graph service, the connection configuration interface may generate a default data source connection from a default data source in the target data source profile.
It should be noted that, in an implementation, the target data source configuration file may be obtained according to the data source configuration information, for example, the data source configuration information may be used as a default data source in the target data source configuration file and the data source configuration information. The data source configuration information may be configuration data of an instance of a target database stored in a target data source configuration file, and the data source configuration information may include data source information and target database information, for example, may include data source information such as a data source identifier, a data source URI address, and a port of a data source, and may also include target database information such as a type of the target database.
S304: and the interface program is connected through the default data source to acquire target data source configuration data in the data source.
In this embodiment, after the interface program generates the default data source connection, the data source may be accessed through the default data source connection, and the target data source configuration data in the data source is acquired. The data source may be understood as a device or raw media that provides information related to a default data source connection (for example, including information for establishing the default data source connection) and information related to a data source configuration parameter (for example, a data source configuration parameter, and a default usage data source identifier and a data source configuration parameter identifier corresponding to the data source configuration parameter), and the information related to the default data source connection and the information related to the data source configuration parameter may be stored in the data source.
It should be noted that the data source may include a plurality of data source configuration data respectively corresponding to different types of databases, and the target data source configuration data may be one of the plurality of data source configuration data.
And target data source configuration data may be understood as configuration data stored in the data source and used for data source connections accessing the target database. The default data source of the target data source configuration data is the same as the default data source in the data source configuration file, so that the target data source configuration data including the default data source which is the same as the default data source can be identified according to the default data source connection generated by the default data source in the target data source configuration file, and therefore the interface program can access the target data source configuration data according to the default data source connection. It is understood that the data source is the data source corresponding to the target database, for example, the type of the target database is Neo4j, and the data source accessed by the interface program through the default data source connection is the data source corresponding to the database type of Neo4 j.
S102 will be explained by taking the system corresponding to fig. 4 as an example. The type of the target database is Neo4j, and after the interface program generates a default data source connection corresponding to the type of Neo4j, the data source corresponding to the database type of Neo4j can be accessed through the default data source connection, and target data source configuration data Neo4j in the data source is acquired.
It should be noted that, in this embodiment, if the interface program is started for the first time, it is stated that the target data source configuration data corresponding to the target data source configuration file does not exist in the data source. Therefore, the target data source configuration file in the interface program may be saved as the target data source configuration data to the data source, and then the interface program may obtain the target data source configuration data in the data source through the default data source connection. If the interface program is not started for the first time, it indicates that target data source configuration data corresponding to the target data source configuration file exists in the data source, and the interface program can be connected through the default data source to acquire the target data source configuration data in the data source.
S305: and the interface program generates a data source connection according to the target data source configuration data so as to access the target database through the data source connection.
The configuration information of the data source connection for connecting the target database is stored in the target data source configuration data in advance, and the type corresponding to the target data source configuration data is the same as that of the target database. Thus, the interface program may generate a data source connection based on the target data source configuration data. A data source connection is understood to be a path through which an interface program accesses a database via a data source. In this way, the interface program can access the target database through the data source connection.
S305 is illustrated by taking the system corresponding to fig. 4 as an example. The type of the target database is Neo4j, and after the interface program obtains the target data source configuration data Neo4j in the data source, the interface program may generate a data source connection Neo4j according to the target data source configuration data Neo4j, so as to access the target database Neo4j through the data source connection Neo4 j.
According to the technical scheme, after the interface program acquires the target data source configuration file corresponding to the target database to be accessed, the default data source connection for accessing the data source can be generated through the default data source in the target data source configuration file; because the data source comprises a plurality of data source configuration data respectively corresponding to different types of databases, the interface program can generate data source connection by acquiring target data source configuration data corresponding to the target data source configuration file in the data source and according to the target data source configuration data, so as to access the target database through the data source connection. Therefore, no matter the target database to be accessed is a relational database or a non-relational database, the data source configuration data corresponding to the accessed target database can be obtained, and the data source connection for accessing the target database is generated through the data source configuration data, so that various types of knowledge spectrum databases including the relational database and the non-relational database can be accessed, the diversity of the accessible knowledge spectrum databases is improved, and the development efficiency of the knowledge spectrum is improved.
Fig. 3 shows only a basic embodiment of the method of the present invention, and based on this, certain optimization and expansion can be performed, and other preferred embodiments of the method can also be obtained.
Fig. 5 shows another embodiment of the method for accessing a knowledge graph database according to the present invention. In this embodiment, S305 is further described on the basis of the embodiment corresponding to fig. 1. In this embodiment, the method specifically includes the following steps:
s501: the connection pool acquires a database access instruction.
S502: the interface program obtains a target data source configuration file.
S503: and the interface program generates default data source connection according to the default data source in the target data source configuration file.
S504: and the interface program is connected through the default data source to acquire target data source configuration data in the data source.
It should be noted that S501 to S504 in this embodiment are the same as S301 to S304 in the embodiment corresponding to fig. 3, and therefore, in this embodiment, descriptions of S501 to S504 are omitted, and specific reference may be made to descriptions of S301 to S304.
S505: and the interface program reads the target data source identification in the default data source of the target data source configuration data.
After the interface program obtains the target data source configuration data in the data source, the target data source identifier in the default data source of the target data source configuration data can be read. The target data source identifier is identification information of the data source, and it should be noted that each data source corresponds to one identifier, and the identifiers corresponding to different data sources are different.
S506: and the interface program acquires target data source configuration parameters corresponding to the target data source identification in the target data source configuration data according to the target data source identification.
In this embodiment, a corresponding relationship between the data source identifier and the data source configuration parameter may be stored in advance, where the data source configuration parameter may be understood as configuration information of a data source connection for connecting the database. Therefore, after the interface program obtains the target data source identifier, the interface program may configure parameters according to the target data source corresponding to the target data source identifier, where the target data source configuration parameters may be understood as configuration information of data source connection for connecting to the target database.
As an example, the interface program may first obtain, according to the target data source identifier, a default usage data source identifier corresponding to the target data source identifier in the target data configuration data, where the default usage data source identifier may be an identifier of a default usage data source corresponding to the target data source, and it is understood that the target data source identifier and the default usage data source identifier may be the same. For example, assuming that the target data source identification is "mongodb 1", the target data source identification may correspond to a default usage data source identification of "mongodb 1".
Then, the interface program may obtain, according to the default used data source identifier, a data source configuration parameter identifier corresponding to the default used data source identifier in the target data configuration data. The data source configuration parameter identifier may be understood as an identifier corresponding to the data source configuration parameter, and the data source configuration parameter may be obtained according to the data source configuration parameter identifier. For example, assuming that the default usage data source identification is "mongoDb 1," the default usage data source identification may correspond to a data source configuration parameter identification of "mongoDb.
Then, the interface program may obtain, according to the data source configuration parameter identifier, the data source configuration parameter corresponding to the data source configuration parameter identifier in the target data configuration data. For example, the interface program may determine that the data source configuration parameter identification "mongoddb" corresponds to the data source configuration parameter based on the data source configuration parameter identification "mongoddb".
S507: and the interface program generates data source connection according to the target data source configuration parameters.
The interface program may generate the data source connection based on the target data source configuration data. In this way, the interface program can access the target database through the data source connection. For example, the interface program may generate a data source connection for accessing the target database "mongoDb" according to the data source configuration parameter identification "mongoddb" corresponding to the data source configuration parameter.
It should be noted that S305 may include S505 to S507. So far, the embodiment implements a processing procedure for accessing the knowledge graph database in combination with a specific application scenario. Of course, the above scenario is only an exemplary scenario and is not intended to limit the method provided by the present invention. The method provided by the invention can be applied to the processing process of the access method of the knowledge graph database with the same principle.
Fig. 6 shows another embodiment of the method for accessing a knowledge graph database according to the present invention. On the basis of the embodiment corresponding to fig. 1, in this embodiment, on the premise that the server does not need to be restarted, the data source connection may be switched, that is, the data source connection is dynamically switched, so that the accessed database is switched from the target database to the database to be switched. In this embodiment, the database operation instruction is a database switching instruction, the database switching instruction includes a database to be switched, and the method specifically includes the following steps:
s601: and the connection pool acquires a database operation instruction.
When the connection pool includes the interface program and the data source, the step may acquire a target data source configuration file for the interface program, and generate a default data source connection according to a default data source in the target data source configuration file.
When the accessed database needs to be switched from the target database to the database to be switched, a database switching instruction can be sent to the interface program, wherein the database switching instruction can include the identifier of the data source to be switched corresponding to the database to be switched.
Continuing with the system example corresponding to fig. 4, S601 is illustrated. The interface program may further include a data switching interface, and when the accessed database needs to be switched from the target database to the database to be switched, the data switching interface in the interface program may send a database switching instruction.
S602: and the connection pool determines target data source configuration data corresponding to the data switching instruction according to the database switching instruction.
Wherein the target data source configuration data may be a data source configuration data to be switched among the plurality of data source configuration data,
when the connection pool includes an interface program and a data source, the steps may be:
the interface program determines target data source configuration data corresponding to the data switching instruction according to the identifier of the data source to be switched in the database switching instruction;
and the interface program acquires target data source configuration parameters corresponding to the to-be-switched data source identification in the target data source configuration data.
When the interface program obtains a database switching instruction, the interface program can respond to the database switching instruction and obtain the configuration parameters of the data source to be switched corresponding to the identifier of the data source to be switched according to the identifier of the data source to be switched in the database switching instruction.
In this embodiment, the correspondence between the data source identifier and the data source configuration parameter may be stored in advance. Therefore, after the interface program acquires the identifier of the data source to be switched, the interface program can configure parameters according to the data source to be switched corresponding to the identifier of the data source to be switched, and the configuration parameters of the data source to be switched can be understood as configuration information of data source connection for connecting the database to be switched.
As an example, the interface program may first obtain, according to the identifier of the data source to be switched, a default data source identifier corresponding to the identifier of the data source to be switched in the target data configuration data, where the default data source identifier may be an identifier of a default data source corresponding to the data source to be switched, and it may be understood that the identifier of the data source to be switched and the default data source identifier may be the same. For example, assuming that the data source identifier to be switched is "Neo 4 j", the default used data source identifier corresponding to the target data source identifier may be "Neo 4j 4".
Then, the interface program may obtain, according to the default used data source identifier, a data source configuration parameter identifier corresponding to the default used data source identifier in the target data configuration data. The data source configuration parameter identifier may be understood as an identifier corresponding to a data source configuration parameter to be switched, and the data source configuration parameter to be switched may be obtained according to the data source configuration parameter identifier. For example, assuming that the default usage data source identification is "Neo 4j4," the default usage data source identification may correspond to a data source configuration parameter identification of "Neo 4 j.
Then, the interface program can obtain the data source configuration parameter to be switched corresponding to the data source configuration parameter identifier in the target data configuration data according to the data source configuration parameter identifier. For example, the interface program may determine the data source configuration parameter to be switched corresponding to the data source configuration parameter identifier "Neo 4 j" according to the data source configuration parameter identifier "Neo 4 j".
S603: and the connection pool generates data source connection according to the target data source configuration data so as to switch the currently accessed database into the database to be switched through the data source connection.
When the connection pool includes an interface program and a data source, the steps may include: and the interface program generates data source connection according to the target data source configuration parameters so as to switch the currently accessed database into the database to be switched through the data source connection.
After the interface program obtains the configuration parameters of the data source to be switched, the interface program can firstly generate the connection of the data source to be switched according to the configuration parameters of the data source to be switched; the database to be switched can then be accessed through the data source connection to be switched. That is, the interface program causes the accessed database to be switched to the database to be switched by switching the current data source connection to the data source connection to be switched.
For example, assuming that the currently accessed database is the database "MySql", after the interface program generates the data source connection to be switched according to the data source configuration parameter corresponding to the data source configuration parameter identifier "Neo 4 j", the interface program may switch the data source connection corresponding to the target database "MySql" to the data source connection to be switched, so as to switch the accessed database from the database "MySql" to the database "Neo 4 j" to complete the switching of the accessed database.
It can be seen that, in this embodiment, the data source connection currently accessing the database can be switched to the data source connection to be switched in response to the database switching instruction, so that the data source connection can be dynamically switched on the premise that the server does not need to be restarted, and the accessed database can be switched from the target database to the database to be switched.
Therefore, the embodiment realizes the switching process of accessing the database by combining with a specific application scene. Of course, the above scenario is only an exemplary scenario and is not intended to limit the method provided by the present invention. The method provided by the invention can be applied to the processing process of the access method of the knowledge graph database with the same principle.
Fig. 7 shows another embodiment of the method for accessing a knowledge graph database according to the present invention. In this embodiment, on the basis of the embodiment corresponding to fig. 1, it may also be implemented that new data source configuration data is added to the data source without restarting the server in the process of accessing the target data source. In this embodiment, the database operation instruction is a database addition instruction, where S101 includes S701, S102 includes S702 to S703, and S103 includes S704, and the method specifically includes the following steps:
s701: the connection pool acquires a database increase instruction.
The database adding instruction comprises configuration information of a data source to be added corresponding to the database to be added. When the connection pool includes an interface program and a data source, the steps may include: the interface program obtains a database addition instruction.
Continuing with the system example corresponding to fig. 4, S701 is illustrated. The interface program may further include a data source configuration interface, and if the user needs to access the database "Neo 4 j" and the target data source configuration data does not include the data source configuration data corresponding to the database "Neo 4 j", the data source configuration information corresponding to the database "Neo 4 j" may be sent to the data source configuration interface as a database addition instruction.
S702: and the connection pool reads the configuration information of the data source to be added in the database adding instruction.
When the connection pool includes an interface program and a data source, the steps may include: and the interface program reads the configuration information of the data source to be added in the database adding instruction.
When new data source configuration data needs to be added, a database addition instruction may be sent to the interface program, where the database addition instruction includes configuration information of a data source to be added corresponding to the data source to be added, that is, configuration information of a data source corresponding to the newly added database. It should be noted that the data source configuration data before the data source configuration information to be added is added does not include the data source configuration data corresponding to the data source configuration information to be added.
S703: and the connection pool takes the configuration information of the data source to be added as a configuration parameter of the target data source, and adds the configuration parameter to the configuration data of the data source of the database to be added to obtain the configuration data of the target data source corresponding to the database adding instruction.
Wherein, when the connection pool includes the interface program and the data source, the step may include: and the interface program takes the configuration information of the data source to be added as a configuration parameter of a target data source, and adds the configuration parameter to the configuration data of the data source to obtain the configuration data of the target data source corresponding to the database adding instruction.
After the interface program obtains the database adding instruction, the interface program can respond to the database adding instruction, firstly read the data source configuration information corresponding to the database to be added in the database adding instruction, and then add the data source configuration information as the data source configuration parameters corresponding to the data source to be added to the data source configuration data of the data source, so that the target data source configuration data corresponding to the database adding instruction is obtained. In an implementation manner, a default used data source identifier and a data source configuration parameter identifier may be set for a data source configuration parameter corresponding to a database to be added, and then, the data source configuration parameter, the default used data source identifier and the data source configuration parameter identifier corresponding to the data source configuration parameter are stored in data source configuration data corresponding to the database to be added. Therefore, the interface program can acquire the data source configuration parameters according to the default use data source identification and/or the data source configuration parameter identification of the data source configuration parameters corresponding to the data source to be added, so as to generate the data source connection corresponding to the data source configuration parameters, and further access the newly added database.
For example, assuming that a user needs to access the database "Neo 4 j" and the target data source configuration data does not include the data source configuration data corresponding to the database "Neo 4 j", when the data source configuration interface receives a database addition instruction including the data source configuration information corresponding to the database "Neo 4 j", the data source configuration information may be added to the data source configuration data corresponding to the database to be added as the data source configuration parameters corresponding to the data source to be added, so as to obtain the target data source configuration data; thus, when the database "Neo 4 j" needs to be accessed, the interface program may obtain the data source configuration parameters corresponding to the database "Neo 4 j" from the target data source configuration data, generate the data source connections corresponding to the data source configuration parameters according to the data source configuration parameters, and further access the database "Neo 4 j" according to the data source connections.
S704: and the connection pool generates data source connection according to the target data source configuration parameters in the target data source configuration data so as to access the database to be added through the data source connection.
When the connection pool includes an interface program and a data source, the steps may include: and the interface program generates data source connection according to the target data source configuration parameters in the target data source configuration data so as to access the database to be added through the data source connection.
It should be noted that S704 in this embodiment is similar to S103 in the corresponding embodiment of fig. 1, and therefore, in this embodiment, S704 is not described again, and reference may be specifically made to the description of S103.
It can be seen that, in this embodiment, in response to the database addition instruction, the data source configuration information corresponding to the database to be added is used as the data source configuration parameter corresponding to the data source to be added, and is added to the data source configuration data corresponding to the database to be added, so that in the process of accessing the database, new data source configuration data can be added to the data source in the connection pool without restarting the server.
Therefore, the embodiment realizes that the data source configuration data is newly added in the process of accessing the database by combining with a specific application scene. Of course, the above scenario is only an exemplary scenario and is not intended to limit the method provided by the present invention. The method provided by the invention can be applied to the processing process of the access method of the knowledge graph database with the same principle.
Fig. 8 shows an embodiment of an access device for a knowledge graph database according to the present invention. The apparatus of this embodiment is a physical apparatus for executing the method of the above embodiment. The technical solution is essentially the same as that in the above embodiment, and the corresponding description in the above embodiment is also applicable to this embodiment.
The device in this embodiment includes:
an obtaining module 801, configured to connect a pool to obtain a database operation instruction;
a determining module 802, configured to determine, by the connection pool, target data source configuration data corresponding to the database operation instruction according to the database operation instruction; the target data source configuration data is data source configuration data to be operated in a plurality of data source configuration data respectively corresponding to different types of databases and included in the connection pool;
a generating module 803, configured to generate, by the connection pool, a data source connection according to the target data source configuration data, so as to execute the database operation instruction on a target database through the data source connection, where the target database is a database corresponding to the target data source configuration data.
Optionally, the database operation instruction is a database access instruction, and the database access instruction includes a target data source configuration file; the determining module 802 is configured to:
the connection pool acquires a target data source configuration file in the database access instruction;
the connection pool acquires target data source configuration data corresponding to the target data source configuration file according to the target data source configuration file; the target data source configuration data is data source configuration data to be used for accessing the target database in the plurality of data source configuration data.
Optionally, the connection pool includes an interface program and a data source; the determining module 802 is specifically configured for
The obtaining, by the connection pool, a target data source configuration file in the database access instruction includes:
the interface program acquires a target data source configuration file in the database access instruction;
the connection pool obtains target data source configuration data corresponding to the target data source configuration file according to the target data source configuration file, and the method comprises the following steps:
the interface program generates default data source connection according to the default data source in the target data source configuration file;
the interface program is connected through the default data source to acquire target data source configuration data in the data source; the data source comprises a plurality of data source configuration data respectively corresponding to different types of databases;
accordingly, the generating module 803 is specifically configured to:
and the interface program generates data source connection according to the target data source configuration data so as to access a target database through the data source connection, wherein the target database is a database corresponding to the target data source configuration data.
Optionally, the target data source configuration file is obtained according to data source configuration information, where the data source configuration information includes data source information and target database information.
Optionally, the determining module 802 is specifically configured to:
if the interface program is started for the first time, a target data source configuration file in the interface program is used as the target data source configuration data to be stored in the data source;
the interface program is connected through the default data source to acquire target data source configuration data in the data source;
and if the interface program is not started for the first time, the interface program is connected through the default data source to acquire target data source configuration data in the data source.
Optionally, the generating module 803 is specifically configured to:
the interface program reads a target data source identifier in a default data source of the target data source configuration data;
the interface program acquires target data source configuration parameters corresponding to the target data source identification in the target data source configuration data according to the target data source identification;
and the interface program generates data source connection according to the target data source configuration parameters.
Optionally, the generating module 803 is further specifically configured to:
the interface program acquires a default using data source identifier corresponding to the target data source identifier in the target data configuration data according to the target data source identifier;
the interface program acquires a data source configuration parameter identifier corresponding to the default using data source identifier in the target data configuration data according to the default using data source identifier;
and the interface program acquires the data source configuration parameters corresponding to the data source configuration parameter identification in the target data configuration data according to the data source configuration parameter identification.
Optionally, the database operation instruction is a database switching instruction, and the database switching instruction includes a database to be switched; the determining module 802 is specifically configured to:
the connection pool determines target data source configuration data corresponding to the data switching instruction according to the database switching instruction; the target data source configuration data is data source configuration data to be switched in the data source configuration data;
accordingly, the generating module 803 is specifically configured to:
and the connection pool generates data source connection according to the target data source configuration data so as to switch the currently accessed database into the database to be switched through the data source connection.
Optionally, the connection pool includes an interface program and a data source; the obtaining module 801 is specifically configured to:
the interface program acquires a database switching instruction, wherein the database switching instruction comprises a to-be-switched data source identifier corresponding to the target database;
accordingly, the determining module 802 is specifically configured to:
the interface program determines target data source configuration data corresponding to the data switching instruction according to the identifier of the data source to be switched in the database switching instruction;
the interface program acquires target data source configuration parameters corresponding to the to-be-switched data source identification in the target data source configuration data;
accordingly, the generating module 803 is specifically configured to:
and the interface program generates data source connection according to the target data source configuration parameters so as to switch the currently accessed database into the database to be switched through the data source connection.
Optionally, the database operation instruction is a database addition instruction, and the determining module 802 is specifically configured to:
the connection pool reads the configuration information of the data source to be added in the database adding instruction;
the connection pool takes the configuration information of the data source to be added as a configuration parameter of a target data source, and adds the configuration parameter to the configuration data of the data source of the database to be added to obtain the configuration data of the target data source corresponding to the database adding instruction;
accordingly, the generating module 803 is specifically configured to:
and the connection pool generates data source connection according to the target data source configuration parameters in the target data source configuration data so as to access the database to be added through the data source connection.
Optionally, the connection pool includes an interface program and a data source;
the determining module 802 is further specifically configured to:
the step of reading the configuration information of the data source to be added in the database adding instruction by the connection pool comprises the following steps:
the interface program reads the configuration information of the data source to be added in the database adding instruction;
the step of adding the configuration information of the data source to be added into the configuration data of the data source by using the connection pool as a configuration parameter of the target data source to obtain the configuration data of the target data source corresponding to the database adding instruction, which comprises the following steps:
the interface program takes the configuration information of the data source to be added as a configuration parameter of a target data source, and adds the configuration parameter to the configuration data of the data source to obtain the configuration data of the target data source corresponding to the database adding instruction;
correspondingly, the generating module 803 is further specifically configured to:
and the interface program generates data source connection according to the target data source configuration parameters in the target data source configuration data so as to access the database to be added through the data source connection.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. On the hardware level, the electronic device comprises a processor and optionally an internal bus, a network interface and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (peripheral component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 7, but this does not indicate only one bus or one type of bus.
And the memory is used for storing the execution instruction. In particular, a computer program that can be executed by executing instructions. The memory may include both memory and non-volatile storage and provides execution instructions and data to the processor.
In a possible implementation manner, the processor reads corresponding execution instructions from the nonvolatile memory into the memory and then runs the corresponding execution instructions, and corresponding execution instructions can also be obtained from other devices so as to form an access device of the knowledge graph database on a logic level. The processor executes the execution instructions stored in the memory, so that the access method of the knowledge graph database provided by any embodiment of the invention is realized through the executed execution instructions.
The method performed by the access device of the knowledge graph database according to the embodiments of the present invention shown in fig. 1-3 and 5-7 can be applied to or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The embodiment of the present invention further provides a readable storage medium, where the readable storage medium stores an execution instruction, and when the stored execution instruction is executed by a processor of an electronic device, the electronic device can execute the method for accessing a knowledge graph database provided in any embodiment of the present invention, and is specifically configured to execute the method for accessing the knowledge graph database.
The electronic device described in the foregoing embodiments may be a computer.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects.
The embodiments of the present invention are described in a progressive manner, and the same and similar parts among the embodiments can be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above description is only an example of the present invention, and is not intended to limit the present invention. Various modifications and alterations to this invention will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.

Claims (14)

1. A method of accessing a knowledge-graph database, the method comprising:
the connection pool acquires a database operation instruction;
the connection pool determines target data source configuration data corresponding to the database operation instruction according to the database operation instruction; the target data source configuration data is data source configuration data to be operated in a plurality of data source configuration data respectively corresponding to different types of databases and included in the connection pool;
and the connection pool generates data source connection according to the target data source configuration data so as to execute the database operation instruction on a target database through the data source connection, wherein the target database is a database corresponding to the target data source configuration data.
2. The method of claim 1, wherein the database operation instruction is a database access instruction, and the database access instruction comprises a target data source configuration file; the connection pool determines target data source configuration data corresponding to the database operation instruction according to the database operation instruction, and the determination comprises the following steps:
the connection pool acquires a target data source configuration file in the database access instruction;
the connection pool acquires target data source configuration data corresponding to the target data source configuration file according to the target data source configuration file; the target data source configuration data is data source configuration data to be used for accessing the target database in the plurality of data source configuration data.
3. The method of claim 2, wherein the connection pool comprises an interface program and a data source; the obtaining, by the connection pool, a target data source configuration file in the database access instruction includes:
the interface program acquires a target data source configuration file in the database access instruction;
correspondingly, the step of obtaining, by the connection pool, target data source configuration data corresponding to the target data source configuration file according to the target data source configuration file includes:
the interface program generates default data source connection according to the default data source in the target data source configuration file;
the interface program is connected through the default data source to acquire target data source configuration data in the data source; the data source comprises a plurality of data source configuration data respectively corresponding to different types of databases;
correspondingly, the connection pool generates a data source connection according to the target data source configuration data, so as to execute the database operation instruction on the target database through the data source connection, including:
and the interface program generates data source connection according to the target data source configuration data so as to access a target database through the data source connection, wherein the target database is a database corresponding to the target data source configuration data.
4. The method of claim 3, wherein the target data source configuration file is derived from data source configuration information, the data source configuration information comprising data source information and target database information.
5. The method of claim 3, wherein the interface program obtains target data source configuration data in the data source through the default data source connection, including:
if the interface program is started for the first time, a target data source configuration file in the interface program is used as the target data source configuration data to be stored in the data source;
the interface program is connected through the default data source to acquire target data source configuration data in the data source;
and if the interface program is not started for the first time, the interface program is connected through the default data source to acquire target data source configuration data in the data source.
6. The method of claim 3, wherein the interface program generates a data source connection based on the target data source configuration data, comprising:
the interface program reads a target data source identifier in a default data source of the target data source configuration data;
the interface program acquires target data source configuration parameters corresponding to the target data source identification in the target data source configuration data according to the target data source identification;
and the interface program generates data source connection according to the target data source configuration parameters.
7. The method according to claim 6, wherein the interface program obtains, according to the target data source identifier, a target data source configuration parameter corresponding to the target data source identifier in the target data source configuration data, including:
the interface program acquires a default using data source identifier corresponding to the target data source identifier in the target data configuration data according to the target data source identifier;
the interface program acquires a data source configuration parameter identifier corresponding to the default using data source identifier in the target data configuration data according to the default using data source identifier;
and the interface program acquires the data source configuration parameters corresponding to the data source configuration parameter identification in the target data configuration data according to the data source configuration parameter identification.
8. The method according to claim 1, wherein the database operation instruction is a database switching instruction, and the database switching instruction comprises a database to be switched; the connection pool determines target data source configuration data corresponding to the database operation instruction according to the database operation instruction, and the determination comprises the following steps:
the connection pool determines target data source configuration data corresponding to the data switching instruction according to the database switching instruction; the target data source configuration data is data source configuration data to be switched in the data source configuration data;
correspondingly, the connection pool generates a data source connection according to the target data source configuration data, so as to execute the database operation instruction on the target database through the data source connection, and the method includes:
and the connection pool generates data source connection according to the target data source configuration data so as to switch the currently accessed database into the database to be switched through the data source connection.
9. The method of claim 8, wherein the connection pool comprises an interface program and a data source; the connection pool obtains a database operation instruction, and the method comprises the following steps:
the interface program acquires a database switching instruction, wherein the database switching instruction comprises a to-be-switched data source identifier corresponding to the target database;
correspondingly, the determining, by the connection pool, the target data source configuration data corresponding to the data switching instruction according to the database switching instruction includes:
the interface program determines target data source configuration data corresponding to the data switching instruction according to the identifier of the data source to be switched in the database switching instruction;
the interface program acquires target data source configuration parameters corresponding to the to-be-switched data source identification in the target data source configuration data;
correspondingly, the step of generating data source connection by the connection pool according to the target data source configuration data so as to switch the currently accessed database to the database to be switched through the data source connection includes:
and the interface program generates data source connection according to the target data source configuration parameters so as to switch the currently accessed database into the database to be switched through the data source connection.
10. The method according to claim 1, wherein the database operation instruction is a database addition instruction, and the database addition instruction includes configuration information of a data source to be added corresponding to a database to be added; the connection pool determines target data source configuration data corresponding to the database operation instruction according to the database operation instruction, and the determination comprises the following steps:
the connection pool reads the configuration information of the data source to be added in the database adding instruction;
the connection pool takes the configuration information of the data source to be added as a configuration parameter of a target data source, and adds the configuration parameter to the configuration data of the data source of the database to be added to obtain the configuration data of the target data source corresponding to the database adding instruction;
correspondingly, the connection pool generates a data source connection according to the target data source configuration data, so as to execute the database operation instruction on the target database through the data source connection, and the method comprises the following steps:
and the connection pool generates data source connection according to the target data source configuration parameters in the target data source configuration data so as to access the database to be added through the data source connection.
11. The method of claim 10, wherein the connection pool comprises an interface program and a data source;
the step of reading the configuration information of the data source to be added in the database adding instruction by the connection pool comprises the following steps:
the interface program reads the configuration information of the data source to be added in the database adding instruction;
correspondingly, the adding the configuration information of the data source to be added into the configuration data of the data source by the connection pool as the configuration parameter of the target data source to obtain the configuration data of the target data source corresponding to the database adding instruction, and the method comprises the following steps:
the interface program takes the configuration information of the data source to be added as a configuration parameter of a target data source, and adds the configuration parameter to the configuration data of the data source to obtain the configuration data of the target data source corresponding to the database adding instruction;
correspondingly, the generating, by the connection pool, a data source connection according to the target data source configuration parameter in the target data source configuration data, so as to access the database to be added through the data source connection, includes:
and the interface program generates data source connection according to the target data source configuration parameters in the target data source configuration data so as to access the database to be added through the data source connection.
12. An apparatus for accessing a knowledge graph database, the apparatus comprising:
the acquisition module is used for connecting the pool to acquire a database operation instruction;
the determining module is used for determining target data source configuration data corresponding to the database operation instruction according to the database operation instruction by the connection pool; the target data source configuration data is data source configuration data to be operated in a plurality of data source configuration data respectively corresponding to different types of databases and included in the connection pool;
and the generation module is used for generating data source connection by the connection pool according to the target data source configuration data so as to execute the database operation instruction on a target database through the data source connection, wherein the target database is a database corresponding to the target data source configuration data.
13. A readable medium comprising executable instructions which, when executed by a processor of an electronic device, cause the electronic device to perform the method of any of claims 1 to 11.
14. An electronic device comprising a processor and a memory storing execution instructions, the processor performing the method of any of claims 1-11 when the processor executes the execution instructions stored by the memory.
CN201910878270.5A 2019-09-17 2019-09-17 Knowledge graph database access method and device Active CN110717050B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910878270.5A CN110717050B (en) 2019-09-17 2019-09-17 Knowledge graph database access method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910878270.5A CN110717050B (en) 2019-09-17 2019-09-17 Knowledge graph database access method and device

Publications (2)

Publication Number Publication Date
CN110717050A true CN110717050A (en) 2020-01-21
CN110717050B CN110717050B (en) 2023-09-29

Family

ID=69210549

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910878270.5A Active CN110717050B (en) 2019-09-17 2019-09-17 Knowledge graph database access method and device

Country Status (1)

Country Link
CN (1) CN110717050B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111427901A (en) * 2020-03-23 2020-07-17 浪潮通用软件有限公司 Interactive knowledge graph data editing method, computer device and storage medium
CN111585809A (en) * 2020-04-29 2020-08-25 北京润通丰华科技有限公司 Method for auditing network equipment configuration by utilizing big data statistical analysis
CN112596785A (en) * 2021-01-14 2021-04-02 江苏徐工信息技术股份有限公司 Multi-data-source management method based on annotation

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101408899A (en) * 2008-11-21 2009-04-15 北京中企开源信息技术有限公司 Method and apparatus for switching website multiple data sources
US20150095343A1 (en) * 2013-09-27 2015-04-02 Oracle International Corporation Cloud database connection multiplexing
CN104503751A (en) * 2014-12-16 2015-04-08 深圳中兴网信科技有限公司 SOA-based data source switching method and system
CN105701163A (en) * 2015-12-31 2016-06-22 山东中创软件工程股份有限公司 Database connection acquisition method and device based on ThreadLocal connection container
WO2017161956A1 (en) * 2016-03-22 2017-09-28 北京京东尚科信息技术有限公司 Database expansion system, equipment, and method of expanding database
CN107357831A (en) * 2017-06-21 2017-11-17 信雅达系统工程股份有限公司 Configurable flow instance data distribution formula storage method and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101408899A (en) * 2008-11-21 2009-04-15 北京中企开源信息技术有限公司 Method and apparatus for switching website multiple data sources
US20150095343A1 (en) * 2013-09-27 2015-04-02 Oracle International Corporation Cloud database connection multiplexing
CN104503751A (en) * 2014-12-16 2015-04-08 深圳中兴网信科技有限公司 SOA-based data source switching method and system
CN105701163A (en) * 2015-12-31 2016-06-22 山东中创软件工程股份有限公司 Database connection acquisition method and device based on ThreadLocal connection container
WO2017161956A1 (en) * 2016-03-22 2017-09-28 北京京东尚科信息技术有限公司 Database expansion system, equipment, and method of expanding database
CN107357831A (en) * 2017-06-21 2017-11-17 信雅达系统工程股份有限公司 Configurable flow instance data distribution formula storage method and system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111427901A (en) * 2020-03-23 2020-07-17 浪潮通用软件有限公司 Interactive knowledge graph data editing method, computer device and storage medium
CN111427901B (en) * 2020-03-23 2023-10-31 浪潮通用软件有限公司 Interactive knowledge graph data editing method, computer equipment and storage medium
CN111585809A (en) * 2020-04-29 2020-08-25 北京润通丰华科技有限公司 Method for auditing network equipment configuration by utilizing big data statistical analysis
CN112596785A (en) * 2021-01-14 2021-04-02 江苏徐工信息技术股份有限公司 Multi-data-source management method based on annotation

Also Published As

Publication number Publication date
CN110717050B (en) 2023-09-29

Similar Documents

Publication Publication Date Title
US10999060B2 (en) Data processing method and apparatus
US10812566B2 (en) Distributed steam processing
CN110717050A (en) Method and device for accessing knowledge map database
US9977598B2 (en) Electronic device and a method for managing memory space thereof
KR20170123336A (en) File manipulation method and apparatus
WO2018040270A1 (en) Method and device for loading linux-system elf file in windows system
CN110427386B (en) Data processing method, device and computer storage medium
CN104268229A (en) Resource obtaining method and device based on multi-process browser
CN112416964A (en) Data processing method, device and system, computer equipment and computer readable storage medium
CN113204345A (en) Page generation method and device, electronic equipment and storage medium
CN110515631B (en) Method for generating application installation data packet, server and computer storage medium
CN111694639A (en) Method and device for updating address of process container and electronic equipment
CN108712486B (en) Workload proving method and device
CN108776665B (en) Data processing method and device
CN114268538A (en) Configuration method and device of front-end route
EP4012573A1 (en) Graph reconstruction method and apparatus
CN111800511A (en) Processing method, system, equipment and readable storage medium for synchronous login state
CN114124524B (en) Cloud platform permission setting method and device, terminal equipment and storage medium
CN113467823B (en) Configuration information acquisition method, device, system and storage medium
CN116304079A (en) Timing-based profile data management method, apparatus, and readable storage medium
CN109635175B (en) Page data splicing method and device, readable storage medium and electronic equipment
WO2020233093A1 (en) Association graph generation method and apparatus, computer device, and storage medium
US10158711B2 (en) Website framework
CN114564250B (en) Reading configuration method and device
CN112333482B (en) List processing method, device, equipment and storage medium

Legal Events

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