WO2020206952A1 - 一种图数据库的数据导入方法及装置 - Google Patents

一种图数据库的数据导入方法及装置 Download PDF

Info

Publication number
WO2020206952A1
WO2020206952A1 PCT/CN2019/109096 CN2019109096W WO2020206952A1 WO 2020206952 A1 WO2020206952 A1 WO 2020206952A1 CN 2019109096 W CN2019109096 W CN 2019109096W WO 2020206952 A1 WO2020206952 A1 WO 2020206952A1
Authority
WO
WIPO (PCT)
Prior art keywords
spark
graph database
data
importing
database
Prior art date
Application number
PCT/CN2019/109096
Other languages
English (en)
French (fr)
Inventor
王波
Original Assignee
苏宁云计算有限公司
苏宁易购集团股份有限公司
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 苏宁云计算有限公司, 苏宁易购集团股份有限公司 filed Critical 苏宁云计算有限公司
Priority to CA3176758A priority Critical patent/CA3176758A1/en
Publication of WO2020206952A1 publication Critical patent/WO2020206952A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/53Querying

Definitions

  • the present invention relates to the technical field of data processing, in particular to a data import method and device for a graph database.
  • Spark is a cluster and memory-based data processing technology. It can process large amounts of data through a combination of many machines, and it can also be integrated with the graph computing framework to perform data computing operations. Spark can not only integrate in different ways, but also can preprocess the data (including aggregation, filtering, transformation, etc.), and then import the preprocessed data into the graph database.
  • the embodiments of the present invention provide a method and device for importing graph database data to overcome the need to import the data into csv format and import the data in real time when importing data into the graph database in the prior art.
  • the speed is not adjustable and other issues.
  • the technical solution adopted by the present invention is:
  • a data import method for a graph database includes the following steps:
  • the method further includes:
  • the customized spark udf function with the graph database program it also includes:
  • the method further includes:
  • the query of the hive database by using the spark resource includes:
  • a data import device for a graph database includes:
  • connection module is used to register a custom spark udf function with the graph database program, so that the graph database establishes a connection with spark resources through the spark udf function;
  • the query module is used to query the hive database by using the spark resource to obtain the queried data
  • the partition module is used to repartition the queried data and register it as a temporary data table
  • the import module is used to import the temporary data table into the graph database through the spark udf function and the node attribute index.
  • the device further includes:
  • the driver connection module is used to set the driver for connecting the graph database in the spark udf function to be written in a static method.
  • the device further includes:
  • the configuration module is used to define the input and output parameters of the spark udf function.
  • the device further includes:
  • Close module used to close the driver of the graph database and the spark resource
  • the query of the hive database by using the spark resource includes:
  • the method and device for importing graph database data provided by the embodiment of the present invention can realize real-time import of data by combining spark and graph database without exporting the data into csv format;
  • the method and device for importing graph database data provided by the embodiments of the present invention utilize spark technology to facilitate spark performance tuning and adjust the speed of data import;
  • the method and device for importing graph database data provided by the embodiments of the present invention utilize the concurrent feature of spark to speed up the import of data without losing data.
  • Fig. 1 is a flow chart showing a method for importing data from a graph database according to an exemplary embodiment
  • Fig. 2 is a schematic structural diagram of a data importing device for a graph database according to an exemplary embodiment.
  • Fig. 1 is a flowchart showing a method for importing data from a graph database according to an exemplary embodiment. Referring to Fig. 1, the method includes the following steps:
  • the graph database is combined with spark resources through a custom spark udf function (even if the graph database is connected to the spark resource), so that the data can be imported into the graph database in real time without the need to
  • the data is exported to csv format.
  • custom spark udf functions you can use Java language for development, or use other computer programming languages for development.
  • the written custom spark udf function must be registered in the graph database program, because in the Java class method, the written custom udf must be registered before it can be used.
  • the spark udf function can be used to facilitate spark performance tuning, such as how many zones are re-divided from the data queried from hive, how to set the parallelism of spark, and how to allocate how many calculations to spark tasks Node (executor), how much memory is allocated for each executor, how large is the number of cores for each executor, and how much memory is allocated for the driver, etc.
  • Node executor
  • Spark udf means that if some of the functions provided by spark itself cannot satisfy users, you can implement your own business logic through custom functions. for example:
  • a node attribute index is created in the graph database, that is, for each node in the graph database. Property index. If the attribute index is not established, the speed of data insertion will be significantly slower.
  • importing hive table data into a graph database is taken as an example.
  • you can first use spark resources to query the hive database specifically, you can query the data in the hive database through the written spark sql statement) to obtain the queried data.
  • the data in the hive database queried by spark sql is repartitioned.
  • RDD Resilient Distributed Data Set
  • each partition will start a task, so the number of RDD partitions determines the total number of tasks, so that it can coordinate with spark performance tuning .
  • RDD Resilient Distributed Dataset
  • RDD has the characteristics of a data flow model: automatic fault tolerance, location-aware scheduling, and scalability. RDD allows users to explicitly cache data in memory when executing multiple queries, and subsequent queries can reuse these data, which greatly improves the query speed. And because Spark has concurrent computing features, each task executes part of the data without causing data loss.
  • the basis of partitioning is: if partitioning is not used, the number of partitions in the query hive table is the same as the number of partitions in the table itself, which cannot improve the degree of parallelism, that is, it cannot improve concurrent execution.
  • the number of tasks After repartitioning, the number of concurrent execution tasks can be increased, so that the execution speed can be accelerated.
  • the above-mentioned custom spark udf function is used in combination with the node attribute index created in the graph database to import the temporary data table into the graph database.
  • the hive database is connected through Spark, data can be directly imported into the graph database without the need to export the data into a csv file format, and real-time insertion can be achieved.
  • the method before registering the custom spark udf function with the graph database program, the method further includes:
  • the driver to connect to the graph database (taking neo4j as an example) in the custom spark udf function must be written in a static method. This setting can reduce the number of times the spark udf function connects to the graph database, thereby Can reduce resource consumption.
  • the method further includes:
  • the input and output parameters of the spark udf function that is, it is necessary to define how many parameters are input and what are the parameter types, what is the output parameter type, and the main return value needs to be set.
  • the value cannot be null.
  • the method further includes:
  • the driver of the graph database and spark resources need to be shut down to save resource consumption.
  • the query of the hive database using the spark resource includes:
  • the action operator of spark in order to trigger the execution of spark, the action operator of spark must be used, because only the action operator can perform calculations.
  • the reduce operator in the action operator is selected to be used instead of operators such as collect and show. Because operators such as collect and show will affect performance, and operators like show cannot calculate all the data. That is to say, in the embodiment of the present invention, the use of a reduce operator to trigger the execution of spark can speed up the data import and ensure that no data is lost.
  • Fig. 2 is a schematic structural diagram of an apparatus for importing graph database data according to an exemplary embodiment.
  • the apparatus includes:
  • connection module is used to register a custom spark udf function with the graph database program, so that the graph database establishes a connection with spark resources through the spark udf function;
  • the query module is used to query the hive database by using the spark resource to obtain the queried data
  • the partition module is used to repartition the queried data and register it as a temporary data table
  • the import module is used to import the temporary data table into the graph database through the spark udf function and the node attribute index.
  • the device further includes:
  • the driver connection module is used to set the driver for connecting the graph database in the spark udf function to be written in a static method.
  • the device further includes:
  • the configuration module is used to define the input and output parameters of the spark udf function.
  • the device further includes:
  • the closing module is used to close the driver of the graph database and the resource.
  • the query of the hive database using the spark resource includes:
  • the method and device for importing graph database data provided by the embodiment of the present invention can realize real-time import of data by combining spark and graph database without exporting the data into csv format;
  • the method and device for importing graph database data provided by the embodiments of the present invention utilize spark technology to facilitate spark performance tuning and adjust the speed of data import;
  • the method and device for importing graph database data provided by the embodiments of the present invention utilize the concurrent feature of spark to speed up the import of data without losing data.
  • the data import device of the graph database provided in the above embodiment only uses the division of the above functional modules as an example for data import services. In actual applications, the above functions can be assigned to different functions according to needs. Module completion means dividing the internal structure of the device into different functional modules to complete all or part of the functions described above.
  • the data importing device of the graph database provided by the above embodiment belongs to the same concept as the data importing method of the graph database, that is, the device is based on the data importing method of the graph database, and the specific implementation process is described in the method embodiments. I won't repeat it here.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

一种图数据库的数据导入方法及装置,该方法包括:向图数据库程序注册自定义的spark udf函数,使得所述图数据库通过所述spark udf函数与spark资源建立连接(S1);在所述图数据库中创建节点属性索引(S2);利用所述spark资源查询hive数据库,获取查询到的数据(S3);将所述查询到的数据重新分区后注册成临时数据表(S4);通过所述spark udf函数以及所述节点属性索引,将所述临时数据表导入到所述图数据库中(S5)。通过利用spark和图数据库结合,能够实现实时导入数据,且不需要将数据导出成csv格式,通过利用spark技术,可以方便spark性能调优,调节数据导入的速度,通过利用spark的并发特性,能够在加快导入数据的同时,不会出现丢失数据。

Description

一种图数据库的数据导入方法及装置 技术领域
本发明涉及数据处理技术领域,特别涉及一种图数据库的数据导入方法及装置。
背景技术
Spark是集群和基于内存的数据处理技术,它能够通过很多台机器组合在一起处理大量的数据,也能够和图计算框架整合在一起进行数据的计算操作。Spark不仅可以以不同的方式进行整合,而且可以对数据进行预处理(包括聚合、过滤、转换等),然后将预处理之后的数据导入图数据库。
现有技术中心,将数据导入到图数据库通常有以下几种方式:编写create语句、Load CSV语句、Batch inserter、Batch import、Neo4j-import。这几种方式除了create语句,其共同的特点就是需要先将文件导出成csv格式,而这在真实的生产开发环境中,非常麻烦(例如,由于在生产环境中,数据处于保密状态,将数据从生产环境中导出成csv文件,在很多公司都不太能够实现,而且这种方式也不能做到实时插入),而且当数据量特别大的时候,实现起来并不现实。而且后三种方式不能实现实时导入,就是说在导入数据的时候必须停止neo4j(图数据库的一种)服务器,所以不能够满足实时导入的需求。
因此,如何将数据快速导入到图数据库中,是构建图谱的前提,也是目前亟需解决的一种问题。
发明内容
为了解决现有技术的问题,本发明实施例提供了一种图数据库的数据导入 方法及装置,以克服现有技术中实时将数据导入图数据库时,需要先将数据导成csv格式以及数据导入的速度不可调等问题。
为解决上述一个或多个技术问题,本发明采用的技术方案是:
一方面,提供了一种图数据库的数据导入方法,该方法包括如下步骤:
向图数据库程序注册自定义的spark udf函数,使得所述图数据库通过所述spark udf函数与spark资源建立连接;
在所述图数据库中创建节点属性索引;
利用所述spark资源查询hive数据库,获取查询到的数据;
将所述查询到的数据重新分区后注册成临时数据表;
通过所述spark udf函数以及所述节点属性索引,将所述临时数据表导入到所述图数据库中。
进一步的,所述在向图数据库程序注册自定义的spark udf函数前还包括:
设置所述spark udf函数中连接所述图数据库的驱动写在静态方法中。
进一步的,所述向图数据库程序注册自定义的spark udf函数前还包括:
定义所述spark udf函数的输入与输出的参数。
进一步的,所述将所述临时数据表导入到所述图数据库中后还包括:
将所述图数据库的驱动与所述spark资源关闭。
进一步的,所述利用所述spark资源查询hive数据库包括:
使用所述spark资源的reduce算子对所述查询到的数据进行相应计算。
另一方面,提供了一种图数据库的数据导入装置,所述装置包括:
连接模块,用于向图数据库程序注册自定义的spark udf函数,使得所述图数据库通过所述spark udf函数与spark资源建立连接;
创建模块,用于在所述图数据库中创建节点属性索引;
查询模块,用于利用所述spark资源查询hive数据库,获取查询到的数据;
划分模块,用于将所述查询到的数据重新分区后注册成临时数据表;
导入模块,用于通过所述spark udf函数以及所述节点属性索引,将所述 临时数据表导入到所述图数据库中。
进一步的,所述装置还包括:
驱动连接模块,用于设置所述spark udf函数中连接所述图数据库的驱动写在静态方法中。
进一步的,所述装置还包括:
配置模块,用于定义所述spark udf函数的输入与输出的参数。
进一步的,所述装置还包括:
关闭模块,用于将所述图数据库的驱动与所述spark资源关闭
进一步的,所述利用所述spark资源查询hive数据库包括:
使用所述spark资源的reduce算子对所述查询到的数据进行相应计算。
本发明实施例提供的技术方案带来的有益效果是:
1、本发明实施例提供的图数据库的数据导入方法及装置,利用spark和图数据库结合,能够实现实时导入数据,且不需要将数据导出成csv格式;
2、本发明实施例提供的图数据库的数据导入方法及装置,利用spark技术,可以方便spark性能调优,调节数据导入的速度;
3、本发明实施例提供的图数据库的数据导入方法及装置,利用spark的并发特性,能够在加快导入数据的同时,不会出现丢失数据。
附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是根据一示例性实施例示出的图数据库的数据导入方法的流程图;
图2是根据一示例性实施例示出的图数据库的数据导入装置的结构示意图。
具体实施方式
为使本发明的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
图1是根据一示例性实施例示出的图数据库的数据导入方法的流程图,参照图1所示,该方法包括如下步骤:
S1:向图数据库程序注册自定义的spark udf函数,使得所述图数据库通过所述spark udf函数与spark资源建立连接。
具体的,在本发明实施例中,通过自定义的spark udf函数,将图数据库与spark资源结合(即使图数据库与spark资源建立连接),使得数据能够实时导入到图数据库中,且不需要将数据导出成csv格式。在编写自定义的spark udf函数时,可以利用Java语言来做开发,也可以利用其他计算机编程语言来做开发。另外,必须先把编写的自定义的spark udf函数在图数据库程序中注册,因为,在Java类方法中,编写的自定义udf必须先注册后才能使用。这里需要说明的是,本发明实施例中,利用spark udf函数可以便于spark性能调优,比如从hive查询出来的数据重新分多少区,如何设置spark的并行度、如何给spark任务分配多少个计算节点(executor)、每个executor的内存分配多大、每个executor的core个数设置多大、driver内存分配多少等。
这里需要说明的是,Spark udf指的是如果spark自身提供的一些函数无法满足用户使用时,可以通过自定义函数来实现自己的业务逻辑。举个例子:
Figure PCTCN2019109096-appb-000001
Figure PCTCN2019109096-appb-000002
S2:在所述图数据库中创建节点属性索引。
具体的,在导入大规模数据数据的时候,为了保证节点和关系不重复,同时保证查找的速度,在本发明实施例中,在图数据库中创建节点属性索引,即为图数据库每个节点创建属性索引。如果不建立属性索引,数据插入的速度会明显的变慢。
举例如下:
Figure PCTCN2019109096-appb-000003
S3:利用所述spark资源查询hive数据库,获取查询到的数据。
具体的,本发明实施例中,以将hive表数据导入到图数据库中为示例。在将hive表数据导入到图数据库中时,可以先利用spark资源查询hive数据库(具 体可以通过编写的spark sql语句将hive数据库中的数据先查询出来),获取查询到的数据。
S4:将所述查询到的数据重新分区后注册成临时数据表;
具体的,在本发明实施例中,会将利用spark sql查询到的hive数据库中的数据重新分区。spark在进行RDD(弹性分布式数据集)计算的时候,每个分区都会起一个任务(task),所以RDD的分区数目决定了总的任务(task)的数目,这样就可以配合spark性能调优,即可通过设置RDD的分区数目设置总的任务(task)的数目。设置申请的计算节点(Executor)数目和每个计算节点核数,从而能够在同一时刻可以并行执行这些任务(task),这样就可以加快数据导入图数据库的速度。这里需要说明的是,RDD(Resilient Distributed Dataset)叫做弹性分布式数据集,是Spark中最基本的数据抽象,它代表一个不可变、可分区、里面的元素可并行计算的集合。RDD具有数据流模型的特点:自动容错、位置感知性调度和可伸缩性。RDD允许用户在执行多个查询时显式地将数据缓存在内存中,后续的查询能够重用这些数据,这极大地提升了查询速度。而且由于Spark具有并发计算特性,每个task执行一部分数据,不会导致数据丢失。
这里需要说明的是,本发明实施例中,分区的依据在于:如果不采用分区,则查询出来hive表中的partition数目和本身的表partition数目一样,无法提高并行度,也就是无法提高并发执行task的数目。而重新分区之后就可以提高并发执行task的数目,这样就可以加快执行的速度。
S5:通过所述spark udf函数以及所述节点属性索引,将所述临时数据表导入到所述图数据库中。
具体的,使用上述自定义的spark udf函数,并结合在图数据库中创建的节点属性索引,将临时数据表导入到图数据库中。本发明实施例中,由于通过Spark连接hive数据库,可以直接将数据导入到图数据库中,不需要将数据导出成csv文件格式,并且可以做到实时插入。
作为一种较优的实施方式,本发明实施例中,所述在向图数据库程序注册 自定义的spark udf函数前还包括:
设置所述spark udf函数中连接所述图数据库的驱动写在静态方法中。
具体的,在本发明实施例中,自定义spark udf函数中连接图数据库(以neo4j为例)的驱动必须写在静态方法中,这样设置,可以减少spark udf函数与图数据库连接的次数,从而可以减少资源的消耗。
作为一种较优的实施方式,本发明实施例中,所述向图数据库程序注册自定义的spark udf函数前还包括:
定义所述spark udf函数的输入与输出的参数。
具体的,本发明实施例中,需要定义spark udf函数的输入与输出的参数,即必须要定义好输入有几个参数以及参数的类型是什么,输出的参数类型是什么,且需设置主要返回值不能为null。
作为一种较优的实施方式,本发明实施例中,所述将所述临时数据表导入到所述图数据库中后还包括:
将所述图数据库的驱动与所述spark资源关闭。
具体的,将在临时数据表导入到图数据库中后,需要将图数据库的驱动与spark资源关闭,从而节省资源的消耗。
作为一种较优的实施方式,本发明实施例中,所述利用所述spark资源查询hive数据库包括:
使用所述spark资源的reduce算子对所述查询到的数据进行相应计算。
具体的,为了触发spark的执行,必须使用spark的action算子,因为只有action算子才能执行计算。而对于算子的选择,本发明实施例中,选择使用action算子中的reduce算子,而不选择使用collect、show等算子。因为collect、show等这些算子都会影响性能,而且像show这样的算子,也没有办法计算所有数据。也就是说,本发明实施例中,采用reduce算子触发spark的执行,能够加快数据导入的速度,而且保证不会丢失数据。
图2是根据一示例性实施例示出的图数据库的数据导入装置的结构示意图, 参照图2所示,该装置包括:
连接模块,用于向图数据库程序注册自定义的spark udf函数,使得所述图数据库通过所述spark udf函数与spark资源建立连接;
创建模块,用于在所述图数据库中创建节点属性索引;
查询模块,用于利用所述spark资源查询hive数据库,获取查询到的数据;
划分模块,用于将所述查询到的数据重新分区后注册成临时数据表;
导入模块,用于通过所述spark udf函数以及所述节点属性索引,将所述临时数据表导入到所述图数据库中。
作为一种较优的实施方式,本发明实施例中,所述装置还包括:
驱动连接模块,用于设置所述spark udf函数中连接所述图数据库的驱动写在静态方法中。
作为一种较优的实施方式,本发明实施例中,所述装置还包括:
配置模块,用于定义所述spark udf函数的输入与输出的参数。
作为一种较优的实施方式,本发明实施例中,所述装置还包括:
关闭模块,用于将所述图数据库的驱动与所述资源关闭。
作为一种较优的实施方式,本发明实施例中,所述利用所述spark资源查询hive数据库包括:
使用所述spark资源的reduce算子对所述查询到的数据进行相应计算。
综上所述,本发明实施例提供的技术方案带来的有益效果是:
1、本发明实施例提供的图数据库的数据导入方法及装置,利用spark和图数据库结合,能够实现实时导入数据,且不需要将数据导出成csv格式;
2、本发明实施例提供的图数据库的数据导入方法及装置,利用spark技术,可以方便spark性能调优,调节数据导入的速度;
3、本发明实施例提供的图数据库的数据导入方法及装置,利用spark的并发特性,能够在加快导入数据的同时,不会出现丢失数据。
需要说明的是:上述实施例提供的图数据库的数据导入装置在数据导入业 务时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的图数据库的数据导入装置与图数据库的数据导入方法实施例属于同一构思,即该装置是基于该图数据库的数据导入方法的,其具体实现过程详见方法实施例,这里不再赘述。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
以上所述仅为本发明的较佳实施例,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。

Claims (10)

  1. 一种图数据库的数据导入方法,其特征在于,所述方法包括如下步骤:
    向图数据库程序注册自定义的spark udf函数,使得所述图数据库通过所述spark udf函数与spark资源建立连接;
    在所述图数据库中创建节点属性索引;
    利用所述spark资源查询hive数据库,获取查询到的数据;
    将所述查询到的数据重新分区后注册成临时数据表;
    通过所述spark udf函数以及所述节点属性索引,将所述临时数据表导入到所述图数据库中。
  2. 根据权利要求1所述的图数据库的数据导入方法,其特征在于,所述在向图数据库程序注册自定义的spark udf函数前还包括:
    设置所述spark udf函数中连接所述图数据库的驱动写在静态方法中。
  3. 根据权利要求1或2所述的图数据库的数据导入方法,其特征在于,所述向图数据库程序注册自定义的spark udf函数前还包括:
    定义所述spark udf函数的输入与输出的参数。
  4. 根据权利要求2所述的图数据库的数据导入方法,其特征在于,所述将所述临时数据表导入到所述图数据库中后还包括:
    将所述图数据库的驱动与所述spark资源关闭。
  5. 根据权利要求1或2所述的图数据库的数据导入方法,其特征在于,所述利用所述spark资源查询hive数据库包括:
    使用所述spark资源的reduce算子对所述查询到的数据进行相应计算。
  6. 一种图数据库的数据导入装置,其特征在于,所述装置包括:
    连接模块,用于向图数据库程序注册自定义的spark udf函数,使得所述图数据库通过所述spark udf函数与spark资源建立连接;
    创建模块,用于在所述图数据库中创建节点属性索引;
    查询模块,用于利用所述spark资源查询hive数据库,获取查询到的数据;
    划分模块,用于将所述查询到的数据重新分区后注册成临时数据表;
    导入模块,用于通过所述spark udf函数以及所述节点属性索引,将所述临时数据表导入到所述图数据库中。
  7. 根据权利要求6所述的图数据库的数据导入装置,其特征在于,所述装置还包括:
    驱动连接模块,用于设置所述spark udf函数中连接所述图数据库的驱动写在静态方法中。
  8. 根据权利要求6或7所述的图数据库的数据导入方法,其特征在于,所述装置还包括:
    配置模块,用于定义所述spark udf函数的输入与输出的参数。
  9. 根据权利要求7所述的图数据库的数据导入方法,其特征在于,所述装置还包括:
    关闭模块,用于将所述图数据库的驱动与所述资源关闭。
  10. 根据权利要求6或7所述的图数据库的数据导入方法,其特征在于,所述利用所述spark资源查询hive数据库包括:
    使用所述spark资源的reduce算子对所述查询到的数据进行相应计算。
PCT/CN2019/109096 2019-04-09 2019-09-29 一种图数据库的数据导入方法及装置 WO2020206952A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CA3176758A CA3176758A1 (en) 2019-04-09 2019-09-29 Method and apparatus for introducing data to a graph database

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910282923.3A CN110110108B (zh) 2019-04-09 2019-04-09 一种图数据库的数据导入方法及装置
CN201910282923.3 2019-04-09

Publications (1)

Publication Number Publication Date
WO2020206952A1 true WO2020206952A1 (zh) 2020-10-15

Family

ID=67485283

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/109096 WO2020206952A1 (zh) 2019-04-09 2019-09-29 一种图数据库的数据导入方法及装置

Country Status (3)

Country Link
CN (1) CN110110108B (zh)
CA (1) CA3176758A1 (zh)
WO (1) WO2020206952A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108596561A (zh) * 2018-03-29 2018-09-28 客如云科技(成都)有限责任公司 一种基于大数据架构的人效服务系统及方法

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110110108B (zh) * 2019-04-09 2021-03-30 苏宁易购集团股份有限公司 一种图数据库的数据导入方法及装置
CN112905854A (zh) * 2021-03-05 2021-06-04 北京中经惠众科技有限公司 数据处理方法、装置、计算设备及存储介质
CN112925952A (zh) * 2021-03-05 2021-06-08 北京中经惠众科技有限公司 数据查询方法、装置、计算设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104391957A (zh) * 2014-12-01 2015-03-04 浪潮电子信息产业股份有限公司 一种针对混合型大数据处理系统的数据交互分析方法
CN105528367A (zh) * 2014-09-30 2016-04-27 华东师范大学 基于开源大数据对时间敏感数据的存储和近实时查询方法
CN106528773A (zh) * 2016-11-07 2017-03-22 山东首讯信息技术有限公司 一种基于Spark平台支持空间数据管理的图计算系统及方法
CN109460416A (zh) * 2018-12-12 2019-03-12 成都四方伟业软件股份有限公司 一种数据处理方法、装置、电子设备及存储介质
CN110110108A (zh) * 2019-04-09 2019-08-09 苏宁易购集团股份有限公司 一种图数据库的数据导入方法及装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105468671B (zh) * 2015-11-12 2019-04-02 杭州中奥科技有限公司 实现人员关系建模的方法
US10409782B2 (en) * 2016-06-15 2019-09-10 Chen Zhang Platform, system, process for distributed graph databases and computing
CN106815353B (zh) * 2017-01-20 2020-02-21 星环信息科技(上海)有限公司 一种数据查询的方法及设备
CN109344268A (zh) * 2018-08-14 2019-02-15 北京奇虎科技有限公司 图形数据库写入的方法、电子设备及计算机可读存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105528367A (zh) * 2014-09-30 2016-04-27 华东师范大学 基于开源大数据对时间敏感数据的存储和近实时查询方法
CN104391957A (zh) * 2014-12-01 2015-03-04 浪潮电子信息产业股份有限公司 一种针对混合型大数据处理系统的数据交互分析方法
CN106528773A (zh) * 2016-11-07 2017-03-22 山东首讯信息技术有限公司 一种基于Spark平台支持空间数据管理的图计算系统及方法
CN109460416A (zh) * 2018-12-12 2019-03-12 成都四方伟业软件股份有限公司 一种数据处理方法、装置、电子设备及存储介质
CN110110108A (zh) * 2019-04-09 2019-08-09 苏宁易购集团股份有限公司 一种图数据库的数据导入方法及装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108596561A (zh) * 2018-03-29 2018-09-28 客如云科技(成都)有限责任公司 一种基于大数据架构的人效服务系统及方法

Also Published As

Publication number Publication date
CN110110108A (zh) 2019-08-09
CA3176758A1 (en) 2020-10-15
CN110110108B (zh) 2021-03-30

Similar Documents

Publication Publication Date Title
WO2020206952A1 (zh) 一种图数据库的数据导入方法及装置
US11468103B2 (en) Relational modeler and renderer for non-relational data
US7984043B1 (en) System and method for distributed query processing using configuration-independent query plans
Tao et al. Minimal mapreduce algorithms
US8725707B2 (en) Data continuous SQL process
US20170083573A1 (en) Multi-query optimization
Ali et al. The extensibility framework in Microsoft StreamInsight
CN103324765B (zh) 一种基于列存储的多核并行数据查询优化方法
CN102426582B (zh) 数据操作管理装置和数据操作管理方法
US11693912B2 (en) Adapting database queries for data virtualization over combined database stores
US11615076B2 (en) Monolith database to distributed database transformation
US11442934B2 (en) Database calculation engine with dynamic top operator
US10339040B2 (en) Core data services test double framework automation tool
CN107977446A (zh) 一种基于数据分区的内存网格数据加载方法
CN109902117A (zh) 业务系统分析方法和装置
Tatemura et al. Partiqle: An elastic SQL engine over key-value stores
Ivanov et al. On the inequality of the 3V's of Big Data Architectural Paradigms: A case for heterogeneity
Imran et al. Fast datalog evaluation for batch and stream graph processing
CN108710640B (zh) 一种提高Spark SQL的查询效率的方法
CN112667598B (zh) 基于业务需求变化的数据模型快速构建系统
Ge et al. LSShare: an efficient multiple query optimization system in the cloud
CN116431635A (zh) 基于湖仓一体的配电物联网数据实时处理系统及方法
Hüske Specification and optimization of analytical data flows
CN114064655A (zh) 一种可配置化数据查询及数据关系的自动发现方法
Sax Performance optimizations and operator semantics for streaming data flow programs

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19924609

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19924609

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 22/04/2022)

ENP Entry into the national phase

Ref document number: 3176758

Country of ref document: CA

122 Ep: pct application non-entry in european phase

Ref document number: 19924609

Country of ref document: EP

Kind code of ref document: A1