CN116821155A - Network asset data storage and query method, device and storage medium - Google Patents

Network asset data storage and query method, device and storage medium Download PDF

Info

Publication number
CN116821155A
CN116821155A CN202310767450.2A CN202310767450A CN116821155A CN 116821155 A CN116821155 A CN 116821155A CN 202310767450 A CN202310767450 A CN 202310767450A CN 116821155 A CN116821155 A CN 116821155A
Authority
CN
China
Prior art keywords
data
network asset
query
asset data
nodes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310767450.2A
Other languages
Chinese (zh)
Inventor
王昊天
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Dragon Technology Co ltd
Original Assignee
Shanghai Dragon Technology 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 Shanghai Dragon Technology Co ltd filed Critical Shanghai Dragon Technology Co ltd
Priority to CN202310767450.2A priority Critical patent/CN116821155A/en
Publication of CN116821155A publication Critical patent/CN116821155A/en
Pending legal-status Critical Current

Links

Classifications

    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24—Querying
    • G06F16/242—Query formulation
    • G06F16/2433—Query languages
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22—Indexing; Data structures therefor; Storage structures
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28—Databases characterised by their database models, e.g. relational or object models
    • G06F16/284—Relational databases
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/54—Browsing; Visualisation therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请公开了一种网络资产数据存储和查询方法、装置及存储介质,包括:将包括若干个第二文档的第一文档存储至非关系型数据库中;第二文档包括时间数据及与时间数据对应的网络资产数据,时间数据为网络资产数据生成和/或修改的时间;根据属性数据建立查询索引然后建立倒排索引表,以使搜索引擎并行查询存储于若干个节点内的若干个数据组。本申请实现了自动化的网络资产管理和监控,提高管理效率和精度,具有良好的横向扩展性和分布式处理能力,可以满足大规模数据的存储和处理需求,提高数据存储和查询的速度和可扩展性。

This application discloses a network asset data storage and query method, device and storage medium, which includes: storing a first document including several second documents in a non-relational database; the second document includes time data and time data Corresponding network asset data, the time data is the time when the network asset data is generated and/or modified; establish a query index based on the attribute data and then create an inverted index table to enable the search engine to query several data groups stored in several nodes in parallel . This application realizes automated network asset management and monitoring, improves management efficiency and accuracy, has good horizontal scalability and distributed processing capabilities, can meet the storage and processing needs of large-scale data, and improves the speed and availability of data storage and query. Scalability.

Description

一种网络资产数据存储和查询方法、装置及存储介质A network asset data storage and query method, device and storage medium

技术领域Technical field

本申请涉及网络资产数据存储技术领域,尤其是涉及一种网络资产数据存储和查询方法、装置及存储介质。The present application relates to the field of network asset data storage technology, and in particular to a network asset data storage and query method, device and storage medium.

背景技术Background technique

在网络资产数据存储和查询领域,存在的一些现有的方法,比如:In the field of network asset data storage and query, there are some existing methods, such as:

关系型数据库:传统的关系型数据库采用基于行和列的二维表存储结构,其中每行表示一个记录,每列表示一个字段。关系型数据库使用SQL作为查询语言,支持关系运算、聚合函数等多种操作。相对于其他数据库,关系型数据库在数据一致性、数据完整性、事务处理等方面具有很强的优势。Relational database: Traditional relational database uses a two-dimensional table storage structure based on rows and columns, where each row represents a record and each column represents a field. Relational databases use SQL as the query language and support various operations such as relational operations and aggregate functions. Compared with other databases, relational databases have strong advantages in data consistency, data integrity, transaction processing, etc.

非关系型数据库:非关系型数据库通常采用键-值、列族、文档等不同的数据模型来存储数据。非关系型数据库在横向扩展和分布式架构方面具有很强的优势,因此在大数据处理、互联网应用、实时数据处理等领域得到广泛应用。Non-relational databases: Non-relational databases usually use different data models such as key-value, column family, and document to store data. Non-relational databases have strong advantages in horizontal expansion and distributed architecture, so they are widely used in big data processing, Internet applications, real-time data processing and other fields.

基于索引的存储:基于索引的存储可以通过对文本数据建立倒排索引等方式提高查询效率。在基于索引的存储中,数据被分为一个个文档,每个文档都有自己的词汇表和倒排索引。用户可以通过查询词汇表和倒排索引来快速地查找文档。这种技术通常用于全文搜索、数据挖掘等场景。Index-based storage: Index-based storage can improve query efficiency by establishing an inverted index for text data. In index-based storage, data is divided into documents, each with its own vocabulary and inverted index. Users can quickly find documents by querying the vocabulary and inverted index. This technology is usually used in scenarios such as full-text search and data mining.

虽然存在许多针对网络资产的查询和存储的数据库方案,但是现有的处理方式都存在一定的缺陷。针对于关系型数据库,关系型数据库在数据结构和查询方式上具有一定的局限性,无法直接表达和查询复杂的关系网络,也无法高效地处理大量的网络资产图数据。同时,在大规模分布式环境下,关系型数据库的性能和可扩展性也存在瓶颈;而对于一般的非关系型数据库,虽然非关系型数据库在分布式存储和横向扩展方面具有很强的优势,但是对于复杂的关系网络的存储和查询能力较弱,也不太适合网络资产图数据处理;而基于索引的存储可以通过建立倒排索引等方式提高查询效率,但是对于大规模的图数据处理还是存在一定的局限性。在复杂的网络资产存储和查询场景下,基于索引的存储的查询速度和效率都比较低。Although there are many database solutions for querying and storing network assets, existing processing methods have certain flaws. For relational databases, relational databases have certain limitations in data structure and query methods. They cannot directly express and query complex relationship networks, and cannot efficiently process large amounts of network asset graph data. At the same time, in large-scale distributed environments, there are also bottlenecks in the performance and scalability of relational databases; for general non-relational databases, although non-relational databases have strong advantages in distributed storage and horizontal expansion , but its storage and query capabilities for complex relationship networks are weak, and it is not suitable for network asset graph data processing; while index-based storage can improve query efficiency by establishing inverted indexes, etc., but it is not suitable for large-scale graph data processing There are still certain limitations. In complex network asset storage and query scenarios, the query speed and efficiency of index-based storage are relatively low.

发明内容Contents of the invention

本申请提供了一种网络资产数据存储和查询方法、装置及存储介质,能够满足大量复杂的网络资产数据的存储和快捷的查询。This application provides a network asset data storage and query method, device and storage medium, which can meet the storage and fast query of a large amount of complex network asset data.

第一方面,本申请提供一种网络资产数据存储方法,采用如下的技术方案:In the first aspect, this application provides a network asset data storage method, adopting the following technical solution:

一种网络资产数据存储方法,包括以下步骤:A method for storing network asset data, including the following steps:

将包括若干个第二文档的第一文档存储至非关系型数据库中;所述第二文档包括时间数据及与所述时间数据对应的网络资产数据,所述时间数据为所述网络资产数据生成和/或修改的时间。Store a first document including several second documents in a non-relational database; the second document includes time data and network asset data corresponding to the time data, and the time data is generated for the network asset data and/or the time of modification.

进一步地,上述非关系型数据库为图数据库。Furthermore, the above-mentioned non-relational database is a graph database.

进一步地,上述网络资产数据包括组织数据、域名数据、子域名数据、IP数据、端口数据和组件数据以及不同数据之间的关系;所述组织数据、域名数据、子域名数据、IP数据、端口数据和组件数据在所述图数据库中存储为节点,不同数据之间的关系在所述图数据库中存储为边向量,所述节点之间通过所述边向量连接。Further, the above-mentioned network asset data includes organizational data, domain name data, sub-domain name data, IP data, port data and component data, as well as the relationship between different data; the organizational data, domain name data, sub-domain name data, IP data, port Data and component data are stored as nodes in the graph database, relationships between different data are stored as edge vectors in the graph database, and the nodes are connected through the edge vectors.

进一步地,上述节点和所述边向量还包括属性数据,所述属性数据为所述网络资产数据的属性。Further, the above-mentioned nodes and the edge vectors also include attribute data, and the attribute data are attributes of the network asset data.

进一步地,上述方法还包括计算所述网络资产数据的热度值,将所述网络资产数据中热度值大于预设的热度阈值的资产热数据,对所述资产热数据优先进行预处理并缓存。Further, the above method also includes calculating the popularity value of the network asset data, and prioritizing preprocessing and caching the asset hot data whose popularity value is greater than a preset popularity threshold in the network asset data.

进一步地,上述方法还包括将所述时间数据及与所述时间数据对应的网络资产数据划分为若干个数据组,并将若干个所述数据组分别存储于不同的节点内。Further, the above method also includes dividing the time data and the network asset data corresponding to the time data into several data groups, and storing the several data groups in different nodes respectively.

第二方面,本申请还提供了一种网络资产数据查询方法,应用上述的网络资产数据存储方法,包括以下步骤:In the second aspect, this application also provides a network asset data query method, which applies the above network asset data storage method and includes the following steps:

根据属性数据建立查询索引;Establish query index based on attribute data;

根据所述查询索引建立倒排索引表,以使搜索引擎并行查询存储于若干个节点内的若干个数据组。An inverted index table is established according to the query index, so that the search engine can query several data groups stored in several nodes in parallel.

第三方面,本申请还提供了一种网络资产数据存储和查询装置,包括:In the third aspect, this application also provides a network asset data storage and query device, including:

存储模块,用于将包括若干个第二文档的第一文档存储至非关系型数据库中;A storage module, configured to store a first document including several second documents into a non-relational database;

查询模块,用于通过搜索引擎并行查询存储于若干个节点内的若干个数据组。The query module is used to query several data groups stored in several nodes in parallel through the search engine.

第四方面,本申请提供一种计算机设备,采用如下的技术方案:In the fourth aspect, this application provides a computer device that adopts the following technical solution:

一种计算机设备,包括存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述程序时实现如第一方面所述的方法。A computer device includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the method as described in the first aspect is implemented.

第五方面,本申请提供一种计算机可读存储介质,采用如下的技术方案:In the fifth aspect, this application provides a computer-readable storage medium, adopting the following technical solution:

一种计算机可读存储介质,存储有能够被处理器加载并执行如第一方面中任一种方法的计算机程序。A computer-readable storage medium stores a computer program that can be loaded by a processor and execute any one of the methods in the first aspect.

综上所述,本申请包括以下至少一种有益技术效果:To sum up, this application includes at least one of the following beneficial technical effects:

本申请提供的一种网络资产数据存储和查询方法、装置及存储介质,实现了自动化的网络资产管理和监控,提高管理效率和精度,具有良好的横向扩展性和分布式处理能力,可以满足大规模数据的存储和处理需求,提高数据存储和查询的速度和可扩展性。This application provides a network asset data storage and query method, device and storage medium, which realizes automated network asset management and monitoring, improves management efficiency and accuracy, has good horizontal scalability and distributed processing capabilities, and can meet the needs of large-scale users. Scale data storage and processing needs and improve the speed and scalability of data storage and query.

附图说明Description of the drawings

图1是本发明实施方式中网络资产数据库结构示意图。Figure 1 is a schematic structural diagram of a network asset database in an embodiment of the present invention.

图2是本发明实施方式中网络资产数据结构示意图。Figure 2 is a schematic diagram of the network asset data structure in the embodiment of the present invention.

图3是本发明实施方式中网络资产数据库数据同步方法流程示意图。Figure 3 is a schematic flowchart of a network asset database data synchronization method in an embodiment of the present invention.

具体实施方式Detailed ways

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application and are not used to limit the present application.

本申请实施方式为了满足大量的复杂的网络资产图数据的存储和快捷的查询,基于图数据库,提供了一种网络资产数据存储和查询方法、装置及存储介质,可以直接建模和查询复杂的关系网络,提高数据处理的效率和精度。图数据库是以点、边为基础存储单元,以高效存储、查询图数据为设计原理的数据管理系统,“点”表示实体,“边”表示实体间的关系。在图数据库中,数据间的关系和数据本身同样重要,它们被作为数据的一部分存储起来。这样的架构使图数据库能够快速响应复杂关联查询,因为实体间的关系已经提前存储到了数据库中。图数据库可以直观地可视化关系,是存储、查询、分析高度互联数据的最优办法,常见的图数据库包括如Neo4j、Galaxybase、GraphDB等。In order to satisfy the storage and quick query of a large amount of complex network asset graph data, the embodiment of the present application provides a network asset data storage and query method, device and storage medium based on the graph database, which can directly model and query complex network asset data. Relationship network improves the efficiency and accuracy of data processing. Graph database is a data management system based on points and edges as basic storage units and designed on the principle of efficient storage and query of graph data. "Points" represent entities and "edges" represent relationships between entities. In a graph database, the relationships between data are as important as the data itself, and they are stored as part of the data. Such an architecture enables the graph database to quickly respond to complex association queries because the relationships between entities have been stored in the database in advance. Graph databases can intuitively visualize relationships and are the best way to store, query, and analyze highly interconnected data. Common graph databases include Neo4j, Galaxybase, GraphDB, etc.

关系型数据库是指采用了关系模型来组织数据的数据库,其以行和列的形式存储数据,以便于用户理解,关系型数据库这一系列的行和列被称为表,一组表组成了数据库。用户通过查询来检索数据库中的数据,而查询是一个用于限定数据库中某些区域的执行代码。关系模型可以简单理解为二维表格模型,而一个关系型数据库就是由二维表及其之间的关系组成的一个数据组织。主流的关系型数据库包括Oracle、DB2、MySQL、Microsoft SQLServer、Microsoft Access等。A relational database refers to a database that uses a relational model to organize data. It stores data in the form of rows and columns to facilitate user understanding. The series of rows and columns in a relational database are called tables, and a set of tables constitutes database. Users retrieve data from a database through queries, which are executable codes that limit certain areas of the database. The relational model can be simply understood as a two-dimensional table model, and a relational database is a data organization composed of two-dimensional tables and the relationships between them. Mainstream relational databases include Oracle, DB2, MySQL, Microsoft SQLServer, Microsoft Access, etc.

如图2所示,网络资产数据整体上来说是具有层次关系和连接关系的图数据,例如:”域名->子域名->IP->组件”这样的一个数据,每个域名拥有多个子域名,每个子域名拥有对应的IP而每个IP代表的主机中拥有着不同的组件,这些域名、子域名等数据都可以称之为网络资产,网络资产自建拥有着层次关系,可以构建出这些网络资产之间的拓扑关系图,这些拓扑关系图数据是非常适合存储在图数据库中的,因为图数据库可以有效地表示和查询这种拓扑结构。As shown in Figure 2, network asset data as a whole is graph data with hierarchical relationships and connection relationships. For example, data such as "Domain name -> Subdomain name -> IP -> Component". Each domain name has multiple subdomain names. , each subdomain name has a corresponding IP, and the host represented by each IP has different components. These domain names, subdomain names and other data can be called network assets. Network assets have hierarchical relationships that can be constructed by themselves. Topological relationship graphs between network assets. These topological relationship graph data are very suitable for storage in graph databases, because graph databases can effectively represent and query this topology structure.

如图1所示,本申请实施例公开了一种网络资产数据存储方法,包括以下步骤:As shown in Figure 1, this embodiment of the present application discloses a network asset data storage method, which includes the following steps:

将包括若干个第二文档的第一文档存储至非关系型数据库中;所述第二文档包括时间数据及与所述时间数据对应的网络资产数据,所述时间数据为所述网络资产数据生成和/或修改的时间,上述非关系型数据库为图数据库。Store a first document including several second documents in a non-relational database; the second document includes time data and network asset data corresponding to the time data, and the time data is generated for the network asset data and/or modification time, the above non-relational database is a graph database.

在本实施方式中,由于关系型数据库在数据结构和查询方式上具有一定的局限性,无法直接表达和查询复杂的关系网络,也无法高效地处理大量的网络资产图数据,因此,本申请提供了一种基于图数据库的网络资产数据存储方法,首先,使用本申请的技术方案采集企业所有的网络资产数据,包括域名、IP地址、设备信息等,并将这些数据存储到图数据库中,其中,第一文档可以包括若干个第二文档,第二文档可以是将网络资产数据抽象为节点和有向边之后的一类网络资产数据,以及这些网络资产数据生成或存储的时间数据。其中,一类网络资产数据可以是一种网络资产数据在不同时间点的不同版本,或一个时间点下的各种网络资产数据,此处不设限制;In this implementation, since the relational database has certain limitations in data structure and query methods, it cannot directly express and query complex relationship networks, and it cannot efficiently process a large amount of network asset graph data. Therefore, this application provides A network asset data storage method based on a graph database is proposed. First, use the technical solution of this application to collect all network asset data of the enterprise, including domain names, IP addresses, device information, etc., and store these data in the graph database, where , the first document may include several second documents, and the second document may be a type of network asset data that abstracts network asset data into nodes and directed edges, as well as time data when these network asset data are generated or stored. Among them, a type of network asset data can be different versions of a network asset data at different points in time, or various network asset data at one point in time. There is no limit here;

在本发明的其中一种实施方式中,网络资产数据包括组织数据、域名数据、子域名数据、IP数据、端口数据和组件数据以及不同数据之间的关系;所述组织数据、域名数据、子域名数据、IP数据、端口数据和组件数据在所述图数据库中存储为节点,不同数据之间的关系在所述图数据库中存储为边向量,所述节点之间通过所述边向量连接,节点和边向量还包括属性数据,所述属性数据为所述网络资产数据的属性。In one embodiment of the present invention, network asset data includes organizational data, domain name data, sub-domain name data, IP data, port data and component data, as well as relationships between different data; the organizational data, domain name data, sub-domain name data, Domain name data, IP data, port data and component data are stored as nodes in the graph database. The relationships between different data are stored as edge vectors in the graph database. The nodes are connected through the edge vectors. The node and edge vectors also include attribute data, which are attributes of the network asset data.

在本实施方式中,对于网络资产数据,可以将其抽象为节点和边向量,节点表示网络资产,边向量表示不同网络资产之间的关系,如域名到子域名、子域名到 IP 地址等。在我们的图数据库存储引擎中,每个节点和边向量都有自己的属性列表,可以为节点和边添加任意数量的属性,基于这些属性数据,当存储大量节点和边时,图数据库存储引擎可以使用索引和缓存等优化技术来加速节点和边向量之间的查询和导航。In this implementation, network asset data can be abstracted into nodes and edge vectors. Nodes represent network assets, and edge vectors represent relationships between different network assets, such as domain names to subdomain names, subdomain names to IP addresses, etc. In our graph database storage engine, each node and edge vector has its own attribute list, and any number of attributes can be added to the nodes and edges. Based on these attribute data, when storing a large number of nodes and edges, the graph database storage engine Optimization techniques such as indexing and caching can be used to speed up queries and navigation between node and edge vectors.

在本申请的其中一种实施方式中,上述方法还包括计算所述网络资产数据的热度值,将所述网络资产数据中热度值大于预设的热度阈值的资产热数据,对所述资产热数据优先进行预处理并缓存。In one embodiment of the present application, the above method further includes calculating the popularity value of the network asset data, and calculating the asset thermal data whose popularity value is greater than a preset popularity threshold in the network asset data, and calculating the asset thermal data. Data is preprocessed and cached first.

在本实施方式中,本申请的技术方案首先采集企业所有的网络资产数据,包括域名、IP地址、设备信息等,并将这些数据存储到图数据库中。可以采用预处理和缓存的方式,将常用的查询结果预先计算并缓存,以便快速响应用户的查询请求。In this implementation mode, the technical solution of this application first collects all network asset data of the enterprise, including domain names, IP addresses, device information, etc., and stores these data in a graph database. Preprocessing and caching can be used to precompute and cache commonly used query results to quickly respond to user query requests.

在本申请的其中一种实施方式中,上述方法还包括将所述时间数据及与所述时间数据对应的网络资产数据划分为若干个数据组,并将若干个所述数据组分别存储于不同的节点内。In one embodiment of the present application, the above method further includes dividing the time data and the network asset data corresponding to the time data into several data groups, and storing the several data groups in different locations. within the node.

如图3所示,在本实施方式中,为了支持大规模数据的存储、同步、处理和查询,可以对网络资产数据进行分布式部署,将网络资产数据存储到多个节点上,使得数据库具有高可用性、可靠性和扩展性,为了保证多个数据库之间数据一致性和可靠性,本申请的技术方案使用了数据库同步工具,数据库同步工具使用消息队列技术,将数据源中的数据采集到一个消息队列中,并将该消息队列中的数据推送到目标数据库中,实现不同节点数据库信息的同步。As shown in Figure 3, in this embodiment, in order to support the storage, synchronization, processing and query of large-scale data, network asset data can be deployed in a distributed manner and the network asset data can be stored on multiple nodes, so that the database has High availability, reliability and scalability. In order to ensure data consistency and reliability between multiple databases, the technical solution of this application uses a database synchronization tool. The database synchronization tool uses message queue technology to collect data from the data source. A message queue, and push the data in the message queue to the target database to achieve synchronization of database information on different nodes.

如图1所示,为了满足更多的实际需求,本申请的技术方案还结合了关系型数据库的存储能力,用于存储一些不需要存储到图数据库中的一些少量信息,如用户信息等。这些信息可以采用关系型数据库的方式进行存储和查询,同时与图数据库中的节点和边建立关联关系,从而实现全面的数据管理和查询功能。As shown in Figure 1, in order to meet more practical needs, the technical solution of this application also combines the storage capabilities of a relational database to store a small amount of information that does not need to be stored in a graph database, such as user information. This information can be stored and queried using a relational database, and is associated with nodes and edges in the graph database to achieve comprehensive data management and query functions.

本申请实施例还公开了一种网络资产数据查询方法,应用上述的网络资产数据存储方法,包括以下步骤:The embodiment of the present application also discloses a network asset data query method, which applies the above network asset data storage method and includes the following steps:

根据属性数据建立查询索引;Establish query index based on attribute data;

根据所述查询索引建立倒排索引表,以使搜索引擎并行查询存储于若干个节点内的若干个数据组。An inverted index table is established according to the query index, so that the search engine can query several data groups stored in several nodes in parallel.

在本实施方式中,采用的图数据库存储引擎支持高效的节点和边查询,方便用户根据条件查询特定的网络资产,具体来说,本图数据库存储引擎使用基于Lucene的全文搜索索引技术来为节点和边的属性建立索引。这种索引技术可以将节点和边的属性值进行分词,并建立一个倒排索引表,用于记录每个属性值所属的节点和边的信息。通过使用这种倒排索引表,查询时可以根据用户提供的查询条件快速地定位到包含这些条件的节点和边。同时本专利还使用分片存储和并行查询的方式,将数据分成多个分片存储在不同的节点上,并行查询多个分片,从而提高查询效率。也采用预处理和缓存的方式,将常用的查询结果预先计算并缓存,以便快速响应用户的查询请求。In this implementation, the graph database storage engine used supports efficient node and edge queries, which facilitates users to query specific network assets based on conditions. Specifically, this graph database storage engine uses Lucene-based full-text search indexing technology to query nodes Create an index with the edge's attributes. This indexing technology can segment the attribute values of nodes and edges and create an inverted index table to record the information of the nodes and edges to which each attribute value belongs. By using this inverted index table, the nodes and edges containing the query conditions provided by the user can be quickly located according to the query conditions provided by the user. At the same time, this patent also uses sharded storage and parallel query methods to divide the data into multiple shards and store them on different nodes, and query multiple shards in parallel, thereby improving query efficiency. Preprocessing and caching are also used to pre-calculate and cache commonly used query results to quickly respond to user query requests.

本申请实施例还公开一种网络资产数据存储和查询装置,包括:The embodiment of the present application also discloses a network asset data storage and query device, including:

存储模块,用于将包括若干个第二文档的第一文档存储至非关系型数据库中;A storage module, configured to store a first document including several second documents into a non-relational database;

查询模块,用于通过搜索引擎并行查询存储于若干个节点内的若干个数据组。The query module is used to query several data groups stored in several nodes in parallel through the search engine.

本申请实施例的网络资产数据存储和查询装置能够实现上述网络资产数据存储方法和查询方法的任一种方法,且网络资产数据存储和查询装置中各个模块的具体工作过程可参考上述方法实施例中的对应过程。The network asset data storage and query device in the embodiment of the present application can implement any of the above-mentioned network asset data storage methods and query methods, and the specific working processes of each module in the network asset data storage and query device can refer to the above method embodiments. corresponding process.

在本申请所提供的几个实施例中,应该理解到,所提供的方法和系统,可以通过其它的方式实现。例如,以上所描述的系统实施例仅仅是示意性的;例如,某个模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。In the several embodiments provided in this application, it should be understood that the methods and systems provided can be implemented in other ways. For example, the system embodiments described above are only illustrative; for example, the division of a certain module is only a logical function division. In actual implementation, there may be other division methods, for example, multiple modules may be combined or integrated. to another system, or some features can be ignored, or not implemented.

本申请实施例还公开一种计算机设备。An embodiment of the present application also discloses a computer device.

计算机设备,包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,处理器执行计算机程序时实现如上述的xx方法。Computer equipment includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the above-mentioned xx method is implemented.

本申请实施例还公开一种计算机可读存储介质。An embodiment of the present application also discloses a computer-readable storage medium.

计算机可读存储介质,存储有能够被处理器加载并执行如上述的xx方法中任一种方法的计算机程序。A computer-readable storage medium stores a computer program that can be loaded by a processor and execute any one of the above xx methods.

其中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用;计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于无线、电线、光缆、RF等等,或者上述的任意合适的组合。Among them, the computer-readable storage medium can be any tangible medium that contains or stores a program, which can be used by or in combination with an instruction execution system, device or device; the program code contained on the computer-readable medium can be used in any appropriate medium. Transmission, including but not limited to wireless, wires, optical cables, RF, etc., or any suitable combination of the above.

实施例:Example:

若某个用户或者企业拥有大量的网络资产,需要对这些资产进行管理和监控,以保障网络的安全性和稳定性。传统的管理方式需要手动录入和管理,效率低下且容易出错。而采用本申请的技术方案可以实现自动化的网络资产管理和监控,提高管理效率和精度,具体步骤如下:If a user or enterprise owns a large number of network assets, these assets need to be managed and monitored to ensure the security and stability of the network. The traditional management method requires manual entry and management, which is inefficient and error-prone. The technical solution of this application can be used to realize automated network asset management and monitoring and improve management efficiency and accuracy. The specific steps are as follows:

S101. 数据采集:首先,使用本申请的技术方案采集企业所有的网络资产数据,包括域名、IP地址、设备信息等,并将这些数据存储到图数据库中。可以采用预处理和缓存的方式,将常用的查询结果预先计算并缓存,以便快速响应用户的查询请求。S101. Data collection: First, use the technical solution of this application to collect all network asset data of the enterprise, including domain names, IP addresses, device information, etc., and store these data in the graph database. Preprocessing and caching can be used to precompute and cache commonly used query results to quickly respond to user query requests.

S102. 数据建模:将采集到的网络资产数据抽象为节点和边的形式,使用图数据库将这些节点和边存储为图形结构。节点表示网络资产,边表示不同网络资产之间的关系,如域名到子域名、子域名到 IP 地址等。这种图形化建模方式可以更好地支持网络资产数据的查询和关系分析。S102. Data modeling: Abstract the collected network asset data into the form of nodes and edges, and use a graph database to store these nodes and edges as a graph structure. Nodes represent network assets, and edges represent relationships between different network assets, such as domain names to subdomain names, subdomain names to IP addresses, etc. This graphical modeling method can better support the query and relationship analysis of network asset data.

S103. 数据管理:同时将不需要存储到图数据库中的一些少量信息,如用户信息等,存储到关系型数据库中,并与图数据库中的节点和边建立关联关系,从而实现全面的数据管理和查询功能。S103. Data management: At the same time, some small amounts of information that do not need to be stored in the graph database, such as user information, are stored in the relational database, and are associated with the nodes and edges in the graph database to achieve comprehensive data management. and query functions.

S104. 数据查询:用户可以更具需求快速查询出想要的网络资产数据,比如某个域名相关的子域名,子域名下的IP等一系列的关系数据。S104. Data query: Users can quickly query the desired network asset data according to their needs, such as a series of relationship data such as subdomain names related to a certain domain name, IP under the subdomain name, etc.

S105. 数据安全:采用数据加密和身份验证等安全策略,保障数据的安全性。同时,使用多数据库同步功能,将数据同步到多个数据库中,并进行备份和恢复操作,从而提高数据的可靠性和可用性。S105. Data security: Use security strategies such as data encryption and identity verification to ensure data security. At the same time, use the multi-database synchronization function to synchronize data to multiple databases and perform backup and recovery operations, thereby improving data reliability and availability.

通过以上处理步骤,可以实现自动化的网络资产管理和监控,提高管理效率和精度。Through the above processing steps, automated network asset management and monitoring can be achieved, improving management efficiency and accuracy.

由上可见,本申请提供的一种网络资产数据存储和查询方法、装置及存储介质一方面采用图数据库作为核心存储引擎,将网络资产数据抽象为节点和边,并以图形结构存储,从而能够更快速地进行查询和关系分析,更好的支持网络资产数据的图形化建模和查询;另一方面,使用了基于Lucene的全文搜索索引技术来为节点和边的属性建立索引,方便用户查询时可以根据用户提供的查询条件快速地定位到包含这些条件的节点和边。采用了分片存储和并行查询的方式,对大规模网络资产数据进行存储和查询,可以提高查询效率。同时,采用预处理和缓存的方式,将常用的查询结果预先计算并缓存,以便快速响应用户的查询请求。提高存储和查询的效率;除了采用图数据库存储节点和边之外,还结合了关系型数据库的存储能力,用于存储一些不需要存储到图数据库中的一些少量信息。这些信息可以采用关系型数据库的方式进行存储和查询,与图数据库中的节点和边建立关联关系,从而实现全面的数据管理和查询功能;而以上的图数据库和关系型数据库采用多数据库同步功能,可以将数据同步到多个数据库中,并进行备份和恢复操作,从而提高数据的可靠性和可用性。采用数据加密和身份验证等安全策略,保障数据的安全性,提高数据的安全性和可用性。It can be seen from the above that the network asset data storage and query method, device and storage medium provided by this application use a graph database as the core storage engine on the one hand, abstract the network asset data into nodes and edges, and store it in a graph structure, so that it can Perform queries and relationship analysis more quickly, and better support graphical modeling and query of network asset data; on the other hand, full-text search indexing technology based on Lucene is used to index the attributes of nodes and edges to facilitate user queries. The nodes and edges containing these conditions can be quickly located based on the query conditions provided by the user. The method of sharded storage and parallel query is adopted to store and query large-scale network asset data, which can improve query efficiency. At the same time, pre-processing and caching are used to pre-calculate and cache commonly used query results to quickly respond to user query requests. Improve the efficiency of storage and query; in addition to using the graph database to store nodes and edges, it also combines the storage capabilities of the relational database to store a small amount of information that does not need to be stored in the graph database. This information can be stored and queried using a relational database, and is associated with nodes and edges in the graph database to achieve comprehensive data management and query functions; the above graph databases and relational databases use multi-database synchronization functions , you can synchronize data to multiple databases and perform backup and recovery operations, thereby improving data reliability and availability. Use security strategies such as data encryption and authentication to ensure data security and improve data security and availability.

需要说明的是,在上述实施例中,对各个实施例的描述各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。It should be noted that in the above-mentioned embodiments, each embodiment is described with different emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

以上均为本申请的较佳实施例,并非依此限制本申请的保护范围,本说明书(包括摘要和附图)中公开的任一特征,除非特别叙述,均可被其他等效或者具有类似目的的替代特征加以替换。即,除非特别叙述,每个特征只是一系列等效或类似特征中的一个例子而已。The above are all preferred embodiments of the present application, and are not intended to limit the scope of protection of the present application. Any feature disclosed in this specification (including the abstract and the drawings), unless specifically stated, can be replaced by other equivalent or similar features. Replace it with the alternative characteristics of the purpose. That is, unless otherwise stated, each feature is only one example in a series of equivalent or similar features.

Claims (10)

1. A method of storing network asset data, comprising the steps of:
storing a first document comprising a plurality of second documents in a non-relational database; the second document includes time data and network asset data corresponding to the time data, the time data being a time at which the network asset data was generated and/or modified.
2. The network asset data storage method of claim 1, wherein: the non-relational database is a graph database.
3. The network asset data storage method of claim 2, wherein: the network asset data includes organization data, domain name data, sub domain name data, IP data, port data, and relationships between component data; the organization data, the domain name data, the sub domain name data, the IP data, the port data and the component data are stored as nodes in the graph database, the relation between different data is stored as an edge vector in the graph database, and the nodes are connected through the edge vector.
4. A method of storing network asset data according to claim 3, characterized by: the nodes and the edge vectors further include attribute data, which is an attribute of the network asset data.
5. A network asset data storage method according to claim 1 or 3, characterized in that: and calculating the heat value of the network asset data, preprocessing and caching the asset heat data with priority, wherein the heat value of the asset heat data is larger than a preset heat threshold value.
6. The network asset data storage method of claim 5, further comprising dividing the time data and the network asset data corresponding to the time data into a plurality of data groups, and storing the plurality of data groups in different nodes, respectively.
7. A network asset data query method, applying a network asset data storage method according to any one of claims 1-6, comprising the steps of:
establishing a query index according to the attribute data;
and establishing an inverted index table according to the query index so that the search engine queries a plurality of data sets stored in a plurality of nodes in parallel.
8. A network asset data storage and querying device, comprising:
the storage module is used for storing a first document comprising a plurality of second documents into the non-relational database;
and the query module is used for querying a plurality of data sets stored in a plurality of nodes in parallel through a search engine.
9. A computing device, characterized by: comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method according to any of claims 1 to 7 when the program is executed.
10. A computer-readable storage medium, characterized by: a computer program being stored which can be loaded by a processor and which performs the method according to any one of claims 1 to 7.
CN202310767450.2A 2023-06-27 2023-06-27 Network asset data storage and query method, device and storage medium Pending CN116821155A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310767450.2A CN116821155A (en) 2023-06-27 2023-06-27 Network asset data storage and query method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310767450.2A CN116821155A (en) 2023-06-27 2023-06-27 Network asset data storage and query method, device and storage medium

Publications (1)

Publication Number Publication Date
CN116821155A true CN116821155A (en) 2023-09-29

Family

ID=88142418

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310767450.2A Pending CN116821155A (en) 2023-06-27 2023-06-27 Network asset data storage and query method, device and storage medium

Country Status (1)

Country Link
CN (1) CN116821155A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117290552A (en) * 2023-10-13 2023-12-26 深圳市深信服信息安全有限公司 A management method, management system and readable storage medium for Internet exposure
CN119938717A (en) * 2025-04-08 2025-05-06 中国科学院昆明植物研究所 A distributed storage and management system for field specimen data based on grid architecture

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110609904A (en) * 2019-09-11 2019-12-24 深圳众赢维融科技有限公司 Graph database data processing method and device, electronic equipment and storage medium
CN114297173A (en) * 2021-06-18 2022-04-08 北京大学 Knowledge graph construction method and system for large-scale mass data
CN115033722A (en) * 2022-08-10 2022-09-09 杭州悦数科技有限公司 Method, system, device and medium for accelerating data query of database
CN115185997A (en) * 2022-07-22 2022-10-14 北京天融信网络安全技术有限公司 Host information processing method and device, electronic equipment and storage medium
CN115297007A (en) * 2022-08-03 2022-11-04 山东天合网络空间安全技术研究院有限公司 Construction method and system of network space asset information map for cooperative network
CN115470279A (en) * 2022-09-20 2022-12-13 数字浙江技术运营有限公司 Data source conversion method, device, equipment and medium based on enterprise data
CN116028680A (en) * 2023-03-29 2023-04-28 北京锐服信科技有限公司 Asset map display method and device based on map database and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110609904A (en) * 2019-09-11 2019-12-24 深圳众赢维融科技有限公司 Graph database data processing method and device, electronic equipment and storage medium
CN114297173A (en) * 2021-06-18 2022-04-08 北京大学 Knowledge graph construction method and system for large-scale mass data
CN115185997A (en) * 2022-07-22 2022-10-14 北京天融信网络安全技术有限公司 Host information processing method and device, electronic equipment and storage medium
CN115297007A (en) * 2022-08-03 2022-11-04 山东天合网络空间安全技术研究院有限公司 Construction method and system of network space asset information map for cooperative network
CN115033722A (en) * 2022-08-10 2022-09-09 杭州悦数科技有限公司 Method, system, device and medium for accelerating data query of database
CN115470279A (en) * 2022-09-20 2022-12-13 数字浙江技术运营有限公司 Data source conversion method, device, equipment and medium based on enterprise data
CN116028680A (en) * 2023-03-29 2023-04-28 北京锐服信科技有限公司 Asset map display method and device based on map database and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117290552A (en) * 2023-10-13 2023-12-26 深圳市深信服信息安全有限公司 A management method, management system and readable storage medium for Internet exposure
CN119938717A (en) * 2025-04-08 2025-05-06 中国科学院昆明植物研究所 A distributed storage and management system for field specimen data based on grid architecture

Similar Documents

Publication Publication Date Title
Khan et al. SQL Database with physical database tuning technique and NoSQL graph database comparisons
CN109656958B (en) Data query method and system
CN103229173B (en) Metadata management method and system
CN104750681B (en) A kind of processing method and processing device of mass data
CN107729371B (en) Data index and query method, device, equipment and storage medium of blockchain
US9229960B2 (en) Database management delete efficiency
CN103366015A (en) OLAP (on-line analytical processing) data storage and query method based on Hadoop
CN103226608B (en) A kind of parallel file searching method based on directory level telescopic Bloom Filter bitmap table
CN102184222A (en) Quick searching method in large data volume storage
CN107783985A (en) A kind of distributed networks database query method, apparatus and management system
US20140019454A1 (en) Systems and Methods for Caching Data Object Identifiers
CN103678550A (en) Mass data real-time query method based on dynamic index structure
CN103823846A (en) Method for storing and querying big data on basis of graph theories
CN112434027A (en) Indexing method and device for multi-dimensional data, computer equipment and storage medium
Cheng et al. Efficient skew handling for outer joins in a cloud computing environment
CN115292322A (en) Data query method, device, equipment and medium
CN104391908A (en) Locality sensitive hashing based indexing method for multiple keywords on graphs
CN115794873A (en) A permission control method based on full-text retrieval technology
CN108804556B (en) Distributed processing framework system based on time travel and temporal aggregation query
Hua et al. SANE: Semantic-aware namespacein ultra-large-scale file systems
Li et al. Research on storage method for fuzzy RDF graph based on Neo4j
Mittal et al. Efficient random data accessing in MapReduce
US20140258264A1 (en) Management of searches in a database system
CN121542323A (en) A multi-source field-level lineage tracing method and system
Firth et al. TAPER: query-aware, partition-enhancement for large, heterogenous graphs

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20230929