CN116680295A - Method, system and device for multi-database processing data - Google Patents
Method, system and device for multi-database processing data Download PDFInfo
- Publication number
- CN116680295A CN116680295A CN202310653188.9A CN202310653188A CN116680295A CN 116680295 A CN116680295 A CN 116680295A CN 202310653188 A CN202310653188 A CN 202310653188A CN 116680295 A CN116680295 A CN 116680295A
- Authority
- CN
- China
- Prior art keywords
- data
- queried
- target
- query
- target object
- 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
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/245—Query processing
-
- 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/25—Integrating or interfacing systems involving database management systems
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
技术领域technical field
本申请涉及数据处理领域,具体而言,涉及一种多数据库处理数据的方法、系统及装置。The present application relates to the field of data processing, in particular, to a method, system and device for processing data with multiple databases.
背景技术Background technique
电信运营商网络中,网络设备运行产生的性能数据通常具有数据量大、并发性高、实时性强的特点,数据增长的速度极快,此类数据存储和处理时,对数据库的吞吐量和可扩展性有较高的要求,传统的关系型数据库很难满足。但随着设备纳管的范围增大,数据库的读写压力与日俱增,单纯依赖OpenTSDB的存储方式逐渐到达了性能瓶颈,主要存在以下问题:In the telecom operator network, the performance data generated by the operation of network equipment usually has the characteristics of large data volume, high concurrency, and strong real-time performance. The data growth rate is extremely fast. When such data is stored and processed, the throughput and There are high requirements for scalability, which are difficult for traditional relational databases to meet. However, with the expansion of the scope of device management, the pressure of reading and writing of the database is increasing day by day, and the storage method that relies solely on OpenTSDB has gradually reached the performance bottleneck. The main problems are as follows:
1、现网设备规模庞大,端口、子接口、管理域等逻辑资源众多,每日产生的数据量超过数十亿,同时兼顾高并发的数据写入和查询,服务器CPU处理速度达到性能瓶颈,QPS只能达到几十,查询响应速度变慢;1. The scale of existing network equipment is huge, there are many logical resources such as ports, sub-interfaces, and management domains, and the amount of data generated every day exceeds billions. At the same time, taking into account highly concurrent data writing and querying, the processing speed of the server CPU reaches the performance bottleneck. QPS can only reach dozens, and the query response speed becomes slower;
2、在OpenTSDB中,设备IP和端口名称是作为tagv存储在元数据中的,但是由于tagv中无法存储设备和端口的关联关系,查询指定设备的指定端口时,程序会从所有设备IP和端口名称的笛卡尔积中逐条匹配合适的数据,查询范围指数级增长,极大的影响了数据查询效率;2. In OpenTSDB, the device IP and port names are stored in the metadata as tagv, but since the relationship between the device and the port cannot be stored in the tagv, when querying the specified port of the specified device, the program will search from all device IPs and ports The Cartesian product of the name matches the appropriate data one by one, and the query range increases exponentially, which greatly affects the data query efficiency;
3、设备性能数据的使用场景中,用户一般更关心最近产生的实时数据,用于监测设备当前的运行情况,对于热数据的查询响应速度要求也更高。对于存储时间较长的历史数据,用户的查询频率一般很低,且历史数据主要用于可视化或预测分析,对查询的响应速度要求不高。但当前的OpenTSDB并没有针对冷热数据的分级存储机制,冷热数据共享同一套查询存储机制,降低了热数据的查询性能,对于冷数据的查询存储也造成了不必要的存储成本和资源浪费。3. In the usage scenario of device performance data, users generally pay more attention to the recently generated real-time data, which is used to monitor the current operation of the device, and have higher requirements for query response speed of hot data. For historical data stored for a long time, the query frequency of users is generally very low, and historical data is mainly used for visualization or predictive analysis, and the requirements for query response speed are not high. However, the current OpenTSDB does not have a hierarchical storage mechanism for hot and cold data. Hot and cold data share the same query storage mechanism, which reduces the query performance of hot data and also causes unnecessary storage costs and waste of resources for query storage of cold data. .
针对上述的问题,目前尚未提出有效的解决方案。For the above problems, no effective solution has been proposed yet.
发明内容Contents of the invention
本申请实施例提供了一种多数据库处理数据的方法、系统及装置,以至少解决由于相关技术中传统的关系型数据库的吞吐量较差,可扩展性较低,造成的数据查询效率较低,查询响应速度较慢的技术问题。The embodiment of the present application provides a method, system and device for multi-database processing data, to at least solve the problem of low data query efficiency due to the poor throughput and low scalability of traditional relational databases in the related art , technical issues with slow query response times.
根据本申请实施例的一个方面,提供了一种多数据库处理数据的方法,包括:接收目标对象的数据查询请求,其中,数据查询请求至少携带待查询数据的标识信息;根据标识信息确定待查询数据所属的目标数据类型,其中,数据类型包括以下之一:热数据,冷数据;确定目标数据类型对应的数据查询接口,将数据查询接口查询到的结果数据以统一的数据格式返回至目标对象,其中,目标数据类型与数据查询接口一一对应。According to an aspect of an embodiment of the present application, a method for processing data in multiple databases is provided, including: receiving a data query request of a target object, wherein the data query request carries at least identification information of the data to be queried; and determining the data to be queried according to the identification information The target data type to which the data belongs, where the data type includes one of the following: hot data, cold data; determine the data query interface corresponding to the target data type, and return the result data queried by the data query interface to the target object in a unified data format , where the target data type is in one-to-one correspondence with the data query interface.
可选地,根据标识信息确定待查询数据所属的目标数据类型,包括:确定标识信息对应的待查询数据在历史时段的查询频率或时间范围,其中,时间范围用于指示上次接收待查询数据的历史数据查询请求,与本次接收到数据查询请求之间的间隔时长;在查询频率大于预定频率,或者时间范围小于预设时长的情况下,确定待查询数据为热数据;在查询频率小于预定频率,或者时间范围大于预设时长的情况下,确定待查询数据为冷数据。Optionally, determining the target data type to which the data to be queried belongs according to the identification information includes: determining the query frequency or time range of the data to be queried corresponding to the identification information in a historical period, wherein the time range is used to indicate the last time the data to be queried is received The interval between the historical data query request and the data query request received this time; when the query frequency is greater than the predetermined frequency, or the time range is less than the preset time period, it is determined that the data to be queried is hot data; when the query frequency is less than If the predetermined frequency or the time range is greater than the preset time period, it is determined that the data to be queried is cold data.
可选地,确定目标数据类型对应的数据查询接口,将数据查询接口查询到的数据返回至目标对象,包括:在目标数据类型为冷数据的情况下,调用OpenTSDB数据库的数据查询接口;根据目标对象传入的指标,以及所选中的时间范围,从OpenTSDB数据库中,获取该指标在时间范围内的所有分表信息,其中,OpenTSDB数据库中的scan函数用于向起始时间start参数和结束时间end参数中赋值目标对象对应的设备IP;判断来自目标对象输入的参数中是否存在函数计算要求,根据计算要求进行逻辑运算,将计算结果返回至目标对象。Optionally, determine the data query interface corresponding to the target data type, and return the data queried by the data query interface to the target object, including: calling the data query interface of the OpenTSDB database when the target data type is cold data; The index passed in by the object and the selected time range are used to obtain all sub-table information of the index within the time range from the OpenTSDB database. Assign the device IP corresponding to the target object in the end parameter; judge whether there is a function calculation requirement in the parameters input from the target object, perform logical operations according to the calculation requirement, and return the calculation result to the target object.
可选地,在获取该指标在时间范围内的所有分表信息之前,方法还包括:将设备IP利用filter的正则匹配进行查询赋值,改为在start参数和end参数中赋值,其中,filter只用于匹配端口名称。Optionally, before obtaining all sub-table information of the indicator within the time range, the method also includes: assigning the IP of the device to query and assign values using the regular matching of the filter, and instead assigning values in the start parameter and end parameter, where the filter only Used to match port names.
可选地,确定目标数据类型对应的数据查询接口,将数据查询接口查询到的数据返回至目标对象,包括:在目标数据为热数据的情况下,调用Redis数据库的数据查询接口;判断来自目标对象输入的参数中是否存在函数计算要求,根据计算要求进行逻辑运算,将计算结果返回至目标对象对应的终端。Optionally, determine the data query interface corresponding to the target data type, and return the data queried by the data query interface to the target object, including: calling the data query interface of the Redis database when the target data is hot data; Whether there are function calculation requirements in the parameters input by the object, perform logical operations according to the calculation requirements, and return the calculation results to the terminal corresponding to the target object.
可选地,在调用Redis数据库的数据查询接口之前,方法还包括:确定Redis数据库的存储周期;获取历史时段写入Redis数据库的历史数据,删除在Redis数据库中除存储周期以外的其他数据。Optionally, before invoking the data query interface of the Redis database, the method also includes: determining the storage period of the Redis database; obtaining historical data written in the Redis database in historical periods, and deleting other data in the Redis database except for the storage period.
可选地,在删除在Redis数据库中除存储周期以外的其他数据之后,方法还包括:确定各个对象在历史时段内请求查询的数据,基于页面置换算法对历史时段之内请求查询的数据进行分析,筛选出新的热数据写入Redis数据库。Optionally, after deleting other data in the Redis database except the storage period, the method further includes: determining the data requested by each object within the historical period, and analyzing the requested data within the historical period based on the page replacement algorithm , filter out new hot data and write it to the Redis database.
根据本申请实施例的另一方面,还提供了一种多数据库处理数据的系统,包括:数据写入模块,设置有用于存储热数据对应的Redis数据库,以及用于存储冷数据的OpenTSDB数据库;数据查询模块,用于接收目标对象的数据查询请求,其中,数据查询请求至少携带待查询数据的标识信息,并根据标识信息确定待查询数据所属的目标数据类型,其中,数据类型包括以下之一:热数据,或者冷数据;确定目标数据类型对应的数据查询接口,将数据查询接口查询到的结构数据以统一的数据格式返回至目标对象,其中,目标数据类型与数据查询结口一一对应。According to another aspect of the embodiment of the present application, there is also provided a multi-database data processing system, including: a data writing module, provided with a Redis database corresponding to storing hot data, and an OpenTSDB database used to store cold data; A data query module, configured to receive a data query request from a target object, wherein the data query request carries at least identification information of the data to be queried, and determine the target data type to which the data to be queried belongs according to the identification information, wherein the data type includes one of the following : hot data, or cold data; determine the data query interface corresponding to the target data type, and return the structured data queried by the data query interface to the target object in a unified data format, where the target data type corresponds to the data query interface one by one .
可选地,OpenTSDB数据库中的scan函数在start和end参数中赋值目标对象对应的设备IP。Optionally, the scan function in the OpenTSDB database assigns the device IP corresponding to the target object in the start and end parameters.
根据本申请实施例的另一方面,还提供了一种多数据库处理数据的装置,包括:接收模块,用于接收目标对象的数据查询请求,其中,数据查询请求至少携带待查询数据的标识信息;查询模块,用于根据标识信息确定待查询数据所属的目标数据类型,其中,数据类型包括以下之一:热数据,冷数据;确定模块,用于确定目标数据类型对应的数据查询接口,将数据查询接口查询到的结果数据以统一的数据格式返回至目标对象,其中,目标数据类型与数据查询接口一一对应。According to another aspect of the embodiment of the present application, there is also provided an apparatus for processing data with multiple databases, including: a receiving module, configured to receive a data query request of a target object, wherein the data query request carries at least identification information of the data to be queried ; The query module is used to determine the target data type of the data to be queried according to the identification information, wherein the data type includes one of the following: hot data, cold data; the determination module is used to determine the data query interface corresponding to the target data type. The result data queried by the data query interface is returned to the target object in a unified data format, wherein the target data type is in one-to-one correspondence with the data query interface.
根据本申请实施例的另一方面,还提供了一种非易失性存储介质,存储介质包括存储的程序,其中,在程序运行时控制存储介质所在设备执行任意一种多数据库处理数据的方法。According to another aspect of the embodiment of the present application, there is also provided a non-volatile storage medium, the storage medium includes a stored program, wherein, when the program is running, the device where the storage medium is located is controlled to execute any method for processing data with multiple databases .
根据本申请实施例的另一方面,还提供了一种电子设备,包括:处理器;其中,处理器被配置为执行指令,以实现任意一种多数据库处理数据的方法。According to another aspect of the embodiments of the present application, there is also provided an electronic device, including: a processor; wherein, the processor is configured to execute instructions to implement any method for processing data with multiple databases.
在本申请实施例中,采用将冷热数据分开存储的方式,通过接收目标对象的数据查询请求,其中,数据查询请求至少携带待查询数据的标识信息;根据标识信息确定待查询数据所属的目标数据类型,其中,数据类型包括以下之一:热数据,冷数据;确定目标数据类型对应的数据查询接口,将数据查询接口查询到的结果数据以统一的数据格式返回至目标对象,其中,目标数据类型与数据查询接口一一对应,达到了基于不同类型的数据库对冷热数据进行分类存储的目的,从而实现了提高数据库的数据处理吞吐量,提高数据查询效率以及响应速度的技术效果,进而解决了由于相关技术中传统的关系型数据库的吞吐量较差,可扩展性较低,造成的数据查询效率较低,查询响应速度较慢的技术问题。In this embodiment of the application, the hot and cold data are stored separately, and by receiving the data query request of the target object, wherein the data query request carries at least the identification information of the data to be queried; according to the identification information, the target to which the data to be queried belongs is determined Data type, where the data type includes one of the following: hot data, cold data; determine the data query interface corresponding to the target data type, and return the result data queried by the data query interface to the target object in a unified data format, where the target One-to-one correspondence between data types and data query interfaces achieves the purpose of classifying and storing hot and cold data based on different types of databases, thereby achieving the technical effect of improving the data processing throughput of the database, improving data query efficiency and response speed, and further It solves the technical problems of low data query efficiency and slow query response speed due to poor throughput and low scalability of traditional relational databases in related technologies.
附图说明Description of drawings
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described here are used to provide a further understanding of the application and constitute a part of the application. The schematic embodiments and descriptions of the application are used to explain the application and do not constitute an improper limitation to the application. In the attached picture:
图1是根据本申请实施例的多数据库处理数据的方法的流程示意图;1 is a schematic flow diagram of a method for processing data in multiple databases according to an embodiment of the present application;
图2是根据本申请实施例的一种多数据库处理数据的系统的结构示意图;FIG. 2 is a schematic structural diagram of a system for processing data with multiple databases according to an embodiment of the present application;
图3是本申请一实施例中,多数据库处理数据的系统的结构示意图;FIG. 3 is a schematic structural diagram of a system for processing data with multiple databases in an embodiment of the present application;
图4是本申请一实施例中多数据库处理数据的方法流程示意图;4 is a schematic flow diagram of a method for processing data in multiple databases in an embodiment of the present application;
图5是本申请实施例中设备运行数据实时分集存储流程示意图;Fig. 5 is a schematic diagram of a flow diagram of real-time diversity storage of equipment operating data in an embodiment of the present application;
图6是本申请实施例中设备运行数据的实时查询流程图;Fig. 6 is a real-time query flowchart of equipment operation data in the embodiment of the present application;
图7是根据本申请实施例的一种多数据库处理数据的装置的结构示意图;FIG. 7 is a schematic structural diagram of an apparatus for processing data with multiple databases according to an embodiment of the present application;
图8是根据本申请实施例的一种电子设备的结构框图。Fig. 8 is a structural block diagram of an electronic device according to an embodiment of the present application.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiment of the application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiment of the application. Obviously, the described embodiment is only It is an embodiment of a part of the application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without creative efforts shall fall within the scope of protection of this application.
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first" and "second" in the description and claims of the present application and the above drawings are used to distinguish similar objects, but not necessarily used to describe a specific sequence or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances such that the embodiments of the application described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion, for example, a process, method, system, product or device comprising a sequence of steps or elements is not necessarily limited to the expressly listed instead, may include other steps or elements not explicitly listed or inherent to the process, method, product or apparatus.
为了本领域技术人员更好地理解本申请相关实施例,现对本申请实施例可能涉及的技术术语或者名词进行解释:In order for those skilled in the art to better understand the relevant embodiments of the present application, the technical terms or nouns that may be involved in the embodiments of the present application are now explained:
1.QPS:Queries Per Second意思是“每秒查询率”,是一台服务器每秒能够相应的查询次数,是对一个特定的查询服务器在规定时间内所处理流量多少的衡量标准。1.QPS: Queries Per Second means "query rate per second", which is the number of queries that a server can perform per second, and is a measure of how much traffic a specific query server handles within a specified time.
2.LRU是Least Recently Used的缩写,即最近最少使用,是一种常用的页面置换算法,选择最近最久未使用的页面予以淘汰。该算法赋予每个页面一个访问字段,用来记录一个页面自上次被访问以来所经历的时间t,当须淘汰一个页面时,选择现有页面中其t值最大的,即最近最少使用的页面予以淘汰。2. LRU is the abbreviation of Least Recently Used, that is, the least recently used. It is a commonly used page replacement algorithm, and the page that has not been used for the longest time is selected to be eliminated. This algorithm gives each page an access field, which is used to record the time t that has elapsed since a page was last accessed. When a page needs to be eliminated, choose the one with the largest t value among the existing pages, that is, the least recently used The page is eliminated.
根据本申请实施例,提供了一种多数据库处理数据的方法实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。According to an embodiment of the present application, an embodiment of a method for processing data with multiple databases is provided. It should be noted that the steps shown in the flow chart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and , although a logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in an order different from that shown or described herein.
图1是根据本申请实施例的多数据库处理数据的方法,如图1所示,该方法包括如下步骤:Fig. 1 is the method for processing data according to the multi-database embodiment of the present application, as shown in Fig. 1, this method comprises the following steps:
S102,接收目标对象的数据查询请求,其中,数据查询请求至少携带待查询数据的标识信息;S102. Receive a data query request from the target object, where the data query request at least carries identification information of the data to be queried;
S104,根据标识信息确定待查询数据所属的目标数据类型,其中,数据类型包括以下之一:热数据,冷数据;S104. Determine the target data type of the data to be queried according to the identification information, wherein the data type includes one of the following: hot data, cold data;
S106,确定目标数据类型对应的数据查询接口,将数据查询接口查询到的结果数据以统一的数据格式返回至目标对象,其中,目标数据类型与数据查询接口一一对应。S106. Determine the data query interface corresponding to the target data type, and return the result data queried by the data query interface to the target object in a unified data format, wherein the target data type corresponds to the data query interface one by one.
该多数据库处理数据的方法中,采用将冷热数据分开存储的方式,通过接收目标对象的数据查询请求,其中,数据查询请求至少携带待查询数据的标识信息;根据标识信息确定待查询数据所属的目标数据类型,其中,数据类型包括以下之一:热数据,冷数据;确定目标数据类型对应的数据查询接口,将数据查询接口查询到的结果数据以统一的数据格式返回至目标对象,其中,目标数据类型与数据查询接口一一对应,达到了基于不同类型的数据库对冷热数据进行分类存储的目的,从而实现了提高数据库的数据处理吞吐量,提高数据查询效率以及响应速度的技术效果,进而解决了由于相关技术中传统的关系型数据库的吞吐量较差,可扩展性较低,造成的数据查询效率较低,查询响应速度较慢的技术问题。In the multi-database data processing method, the cold and hot data are stored separately, and by receiving the data query request of the target object, wherein the data query request at least carries the identification information of the data to be queried; The target data type, wherein the data type includes one of the following: hot data, cold data; determine the data query interface corresponding to the target data type, and return the result data queried by the data query interface to the target object in a unified data format, where , the target data type corresponds to the data query interface one by one, and achieves the purpose of classifying and storing hot and cold data based on different types of databases, thereby achieving the technical effect of improving the data processing throughput of the database, improving the efficiency of data query and the response speed , and further solve the technical problems of low data query efficiency and slow query response speed due to poor throughput and low scalability of traditional relational databases in related technologies.
本申请一些实施例中,根据标识信息确定待查询数据所属的目标数据类型,可以通过如下方式实现:可确定标识信息对应的待查询数据在历史时段的查询频率或时间范围,其中,时间范围用于指示上次接收待查询数据的历史数据查询请求,与本次接收到数据查询请求之间的间隔时长;在查询频率大于预定频率,或者时间范围小于预设时长的情况下,确定待查询数据为热数据;在查询频率小于预定频率,或者时间范围大于预设时长的情况下,确定待查询数据为冷数据。In some embodiments of the present application, determining the target data type of the data to be queried according to the identification information can be achieved in the following manner: the query frequency or time range of the data to be queried corresponding to the identification information in the historical period can be determined, wherein the time range is used Indicates the interval between the historical data query request that received the data to be queried last time and the data query request received this time; when the query frequency is greater than the predetermined frequency, or the time range is less than the preset duration, determine the data to be queried It is hot data; when the query frequency is less than the predetermined frequency, or the time range is greater than the preset duration, it is determined that the data to be queried is cold data.
为了提升对冷数据的处理效率,作为一种可选的实施方式,确定目标数据类型对应的数据查询接口,将数据查询接口查询到的数据返回至目标对象,包括:在目标数据类型为冷数据的情况下,调用OpenTSDB数据库的数据查询接口;根据目标对象传入的指标,以及所选中的时间范围,从OpenTSDB数据库中,获取该指标在时间范围内的所有分表信息,其中,OpenTSDB数据库中的scan函数用于向起始时间start参数和结束时间end参数中赋值目标对象对应的设备IP;判断来自目标对象输入的参数中是否存在函数计算要求,根据计算要求进行逻辑运算,将计算结果返回至目标对象。In order to improve the processing efficiency of cold data, as an optional implementation, determine the data query interface corresponding to the target data type, and return the data queried by the data query interface to the target object, including: when the target data type is cold data In the case of , call the data query interface of the OpenTSDB database; according to the indicators passed in by the target object and the selected time range, all sub-table information of the indicator within the time range is obtained from the OpenTSDB database. Among them, in the OpenTSDB database The scan function is used to assign the device IP corresponding to the target object to the start time start parameter and the end time end parameter; judge whether there is a function calculation requirement in the parameters input from the target object, perform logical operations according to the calculation requirement, and return the calculation result to the target audience.
在本申请一些实施例中,为了避免笛卡尔积问题,在获取该指标在时间范围内的所有分表信息之前,可将将设备IP利用filter的正则匹配进行查询赋值,改为在start参数和end参数中赋值,其中,filter只用于匹配端口名称。In some embodiments of the present application, in order to avoid the Cartesian product problem, before obtaining all sub-table information of the indicator within the time range, the device IP can be queried and assigned using regular matching of the filter, and changed to the start parameter and end parameter, where filter is only used to match port names.
为了提升对热数据的查询效率,确定目标数据类型对应的数据查询接口,将数据查询接口查询到的数据返回至目标对象,包括:在目标数据为热数据的情况下,调用Redis数据库的数据查询接口;判断来自目标对象输入的参数中是否存在函数计算要求,根据计算要求进行逻辑运算,将计算结果返回至目标对象对应的终端。In order to improve the query efficiency of hot data, determine the data query interface corresponding to the target data type, and return the data queried by the data query interface to the target object, including: when the target data is hot data, call the data query of the Redis database Interface; determine whether there is a function calculation requirement in the parameters input from the target object, perform logical operations according to the calculation requirement, and return the calculation result to the terminal corresponding to the target object.
为了减少对Redis数据库的占用,在调用Redis数据库的数据查询接口之前,还可确定Redis数据库的存储周期;获取历史时段写入Redis数据库的历史数据,删除在Redis数据库中除存储周期以外的其他数据。In order to reduce the occupation of the Redis database, before calling the data query interface of the Redis database, the storage period of the Redis database can also be determined; obtain the historical data written to the Redis database in the historical period, and delete other data in the Redis database except for the storage period .
可选地,在删除在Redis数据库中除存储周期以外的其他数据之后,方法还包括:确定各个对象在历史时段内请求查询的数据,基于页面置换算法对历史时段之内请求查询的数据进行分析,筛选出新的热数据写入Redis数据库。Optionally, after deleting other data in the Redis database except the storage period, the method further includes: determining the data requested by each object within the historical period, and analyzing the requested data within the historical period based on the page replacement algorithm , filter out new hot data and write it to the Redis database.
图2是根据本申请实施例的一种多数据库处理数据的系统,如图2所示,该系统包括:Fig. 2 is a kind of multi-database processing data system according to the embodiment of the present application, as shown in Fig. 2, the system includes:
数据写入模块20,设置有用于存储热数据对应的Redis数据库,以及用于存储冷数据的OpenTSDB数据库;Data writing module 20 is provided with a Redis database for storing hot data, and an OpenTSDB database for storing cold data;
数据查询模块22,用于接收目标对象的数据查询请求,其中,数据查询请求至少携带待查询数据的标识信息,并根据标识信息确定待查询数据所属的目标数据类型,其中,数据类型包括以下之一:热数据,或者冷数据;确定目标数据类型对应的数据查询接口,将数据查询接口查询到的结构数据以统一的数据格式返回至目标对象,其中,目标数据类型与数据查询结口一一对应。The data query module 22 is configured to receive a data query request from a target object, wherein the data query request at least carries identification information of the data to be queried, and determines the target data type to which the data to be queried belongs according to the identification information, wherein the data type includes the following One: hot data or cold data; determine the data query interface corresponding to the target data type, and return the structural data queried by the data query interface to the target object in a unified data format, where the target data type and the data query interface are one by one correspond.
在多数据库处理数据的系统中,数据写入模块20,设置有用于存储热数据对应的Redis数据库,以及用于存储冷数据的OpenTSDB数据库;数据查询模块22,用于接收目标对象的数据查询请求,其中,数据查询请求至少携带待查询数据的标识信息,并根据标识信息确定待查询数据所属的目标数据类型,其中,数据类型包括以下之一:热数据,或者冷数据;确定目标数据类型对应的数据查询接口,将数据查询接口查询到的结构数据以统一的数据格式返回至目标对象,其中,目标数据类型与数据查询结口一一对应,达到了基于不同类型的数据库对冷热数据进行分类存储的目的,从而实现了提高数据库的数据处理吞吐量,提高数据查询效率以及响应速度的技术效果,进而解决了由于相关技术中传统的关系型数据库的吞吐量较差,可扩展性较低,造成的数据查询效率较低,查询响应速度较慢的技术问题。In a multi-database system for processing data, the data writing module 20 is provided with a corresponding Redis database for storing hot data and an OpenTSDB database for storing cold data; the data query module 22 is used to receive the data query request of the target object , wherein the data query request at least carries the identification information of the data to be queried, and determines the target data type to which the data to be queried belongs according to the identification information, wherein the data type includes one of the following: hot data or cold data; The data query interface of the data query interface returns the structural data queried by the data query interface to the target object in a unified data format. Among them, the target data type corresponds to the data query interface one by one, which achieves hot and cold data based on different types of databases. The purpose of classified storage, thereby achieving the technical effect of improving the data processing throughput of the database, improving the efficiency of data query and response speed, and then solving the problem of poor throughput and low scalability of traditional relational databases in related technologies. , resulting in low data query efficiency and slow query response speed.
可选地,OpenTSDB数据库中的scan函数在start和end参数中赋值目标对象对应的设备IP。Optionally, the scan function in the OpenTSDB database assigns the device IP corresponding to the target object in the start and end parameters.
图3是本申请一实施例中,多数据库处理数据的系统,如图3所示,该系统包括:Fig. 3 is in an embodiment of the present application, the system of multi-database processing data, as shown in Fig. 3, this system comprises:
数据写入模块:数据解析入库后,同时写入OpenTSDB和Redis,进行双写存储;Data writing module: After the data is parsed into the database, it is simultaneously written to OpenTSDB and Redis for double-write storage;
OpenTSDB改造模块:根据查询/写入的指标和时间,获取不同的分表,若该分表不存在则获取全局锁,创建对应分表,优化HBASE底层的Rowkey索引,改造scan函数,将设备IP从filter的正则匹配查询,改为在start和end赋值,filter只匹配端口名称,从而优化笛卡尔积问题;OpenTSDB自带的api/query接口也根据上述规则做出对应改造;OpenTSDB transformation module: According to the query/write index and time, obtain different sub-tables, if the sub-table does not exist, obtain the global lock, create the corresponding sub-table, optimize the Rowkey index at the bottom of HBASE, transform the scan function, and set the device IP From the regular matching query of the filter, to assigning values at start and end, the filter only matches the port name, thereby optimizing the Cartesian product problem; the api/query interface that comes with OpenTSDB is also modified according to the above rules;
Redis改造模块:基于zset数据集改造Redis数据结构,消除OpenTSDB与Redis数据查询输出的结构差异;制定数据淘汰策略,根据数据写入时间删除Redis中的历史数据,并用LRU算法删除查询次数不多的数据;根据OpenTSDB返回数据的特性,定义Redis数据查询接口,包括性能数据查询接口、多指标项查询接口、多时间段查询接口,并支持sum、avg函数计算;Redis Transformation Module: Transform the Redis data structure based on the zset data set, eliminate the structural difference between OpenTSDB and Redis data query output; formulate a data elimination strategy, delete the historical data in Redis according to the data writing time, and use the LRU algorithm to delete the few query times Data: According to the characteristics of the data returned by OpenTSDB, define the Redis data query interface, including performance data query interface, multi-index item query interface, multi-time period query interface, and support sum and avg function calculations;
数据查询模块:封装查询接口,根据用户查询数据的时间范围和查询频率,判断本次查询属于冷数据还是热数据,分别从OpenTSDB或Redis获取数据,提供实时数据查询服务。Data query module: encapsulates the query interface, judges whether the query belongs to cold data or hot data according to the time range and query frequency of user query data, obtains data from OpenTSDB or Redis respectively, and provides real-time data query services.
图4是本申请一实施例中多数据库处理数据的方法流程示意图,如图4所示,该过程包括:Fig. 4 is a schematic flow chart of a method for processing data by multiple databases in an embodiment of the present application. As shown in Fig. 4, the process includes:
S1,将采集、解析后的数据进行双写操作,同时写入OpenTSDB和Redis。S1, double-write the collected and analyzed data, and write it into OpenTSDB and Redis at the same time.
S2.1,根据写入指标以及写入时间来入表,若对应的表不存在则获取全局锁创建该分表。S2.1, enter the table according to the write index and write time, if the corresponding table does not exist, acquire the global lock to create the sub-table.
S2.2,优化HBASE底层的Rowkey索引,改造scan函数,将设备IP从filter的正则匹配查询,改为在start和end赋值,filter只匹配端口名称,从而避免笛卡尔积问题的出现。S2.2, optimize the Rowkey index at the bottom of HBASE, modify the scan function, change the device IP from the regular matching query of the filter to the assignment of start and end, and the filter only matches the port name, thereby avoiding the occurrence of the Cartesian product problem.
S2.2,OpenTSDB自带的api/query接口,根据S2.1中的规则做出对应改造。S2.2, the api/query interface that comes with OpenTSDB, is modified according to the rules in S2.1.
S3.1,基于zset数据集改造Redis数据结构,消除OpenTSDB与Redis数据查询输出的结构差异。S3.1, transform the Redis data structure based on the zset data set, and eliminate the structural difference between OpenTSDB and Redis data query output.
S3.2,制定数据淘汰策略,根据数据写入时间删除Redis中的历史数据,并用LRU算法删除查询次数不多的数据。S3.2, formulate a data elimination strategy, delete the historical data in Redis according to the data writing time, and use the LRU algorithm to delete the data with a small number of queries.
S3.3,根据OpenTSDB返回数据的特性,定义Redis数据查询接口,包括性能数据查询接口、多指标项查询接口、多时间段查询接口,并支持sum、avg函数计算。S3.3, according to the characteristics of the data returned by OpenTSDB, define the Redis data query interface, including performance data query interface, multi-index item query interface, multi-time period query interface, and support sum and avg function calculations.
S4,将OpenTSDB和Redis的查询接口统一封装。S4, uniformly encapsulates the query interfaces of OpenTSDB and Redis.
S5,收到用户的数据查询请求时,根据查询数据的时间和所查内容的查询频率,判断是热数据还是冷数据。S5. When receiving the user's data query request, it is judged whether it is hot data or cold data according to the time of querying data and the query frequency of the content being searched.
S5.1,如果是热数据,则调用Redis的查询接口。S5.1, if it is hot data, call the query interface of Redis.
S5.2,如果是冷数据,则调用OpenTSDB的查询接口。S5.2, if it is cold data, call the query interface of OpenTSDB.
S5.3,查询可能涉及多张分表,则多表并发同时查询,获取所有返回数据之后再作聚合或其他处理逻辑处理S5.3, the query may involve multiple sub-tables, then multiple tables are queried concurrently, and after all the returned data is obtained, aggregation or other processing logic is processed
S6,将查询结果以统一的数据格式返回给用户。S6, returning the query result to the user in a unified data format.
现结合具体实施例,对本申请上述技术方案做进一步说明:Now in conjunction with specific embodiment, the above-mentioned technical scheme of the present application is described further:
图5是本申请实施例中设备运行数据实时分集存储流程示意图,如图5所示:从电信运营商网络获取设备运行数据后,利用上述系统进行双写操作并自动完成分级存储,具体过程如下:Figure 5 is a schematic diagram of the real-time diversity storage process of equipment operating data in the embodiment of the present application, as shown in Figure 5: after obtaining the equipment operating data from the telecom operator network, use the above-mentioned system to perform double-writing operations and automatically complete hierarchical storage. The specific process is as follows :
1、完成设备运行数据的采集与解析之后,本系统将该数据同时、实时写入OpenTSDB和Redis,进行数据双写操作。1. After the collection and analysis of equipment operation data is completed, the system writes the data to OpenTSDB and Redis simultaneously and in real time to perform data double-writing operations.
2、其中OpenTSDB会持续分表写入,存储最长存储周期的数据,提供冷数据的存储与查询服务。2. Among them, OpenTSDB will continue to write into tables, store the data with the longest storage period, and provide cold data storage and query services.
3、Redis会根据配置的存储周期,定期删除历史数据,只存储近期的热数据。3. Redis will periodically delete historical data according to the configured storage period, and only store recent hot data.
4、在Redis中删除历史数据后,使用LRU算法,将用户查询次数较多的数据添加至Redis,最终实现热数据的存储与冷数据的淘汰,完成冷热数据的分级存储。4. After deleting the historical data in Redis, use the LRU algorithm to add the data with more user queries to Redis, and finally realize the storage of hot data and the elimination of cold data, and complete the hierarchical storage of hot and cold data.
图6是本申请实施例中设备运行数据的实时查询流程图,如图6所示,该流程包括:Fig. 6 is a real-time query flowchart of equipment operation data in the embodiment of the present application, as shown in Fig. 6, the process includes:
应用层从系统获取数据调用权限后,即可获取设备运行进行设备运行数据的实时查询。接收到用户的数据调用请求后,具体的程序响应流程如下:After the application layer obtains the data call permission from the system, it can obtain the device operation and perform real-time query of the device operation data. After receiving the user's data call request, the specific program response process is as follows:
1、根据查询请求的时间范围和查询内容,判断所查数据属于冷数据还是热数据。1. According to the time range and query content of the query request, it is judged whether the data to be queried is cold data or hot data.
2.1、若时间范围大于所设的热数据存储周期,则本次查询为冷数据,将调用OpenTSDB的查询接口。2.1. If the time range is greater than the set hot data storage period, this query is cold data, and the query interface of OpenTSDB will be called.
2.2、根据用户传入的指标和时间范围获取所有的分表信息,发起并发查询2.2. Obtain all sub-table information according to the indicators and time range passed in by the user, and initiate concurrent queries
2.3、调用改造后的scan函数,从HBASE获取符合条件的数据。2.3. Call the modified scan function to obtain qualified data from HBASE.
2.4、判断入参中是否存在函数计算要求,对结果进行求和、求平均或直接返回结果。2.4. Determine whether there is a function calculation requirement in the input parameter, and sum, average or return the result directly.
3.1、若时间范围小于所设的热数据存储周期,或查询内容属于近期常见的查询数据,则本次查询为热数据,将调用Redis的查询接口。3.1. If the time range is less than the set hot data storage period, or the query content belongs to recent common query data, then this query is hot data, and the query interface of Redis will be called.
3.2、从Redis中获取符合条件的数据。3.2. Obtain qualified data from Redis.
3.3、判断入参中是否存在函数计算要求,对结果进行求和、求平均或直接返回结果。3.3. Determine whether there is a function calculation requirement in the input parameters, and sum, average or return the result directly.
4、将查询结果以统一的数据格式返回给用户。4. Return the query results to the user in a unified data format.
图7是根据本申请实施例的一种多数据库处理数据的装置,如图7所示,该装置包括:Fig. 7 is a device for processing data with multiple databases according to an embodiment of the present application. As shown in Fig. 7, the device includes:
接收模块70,用于接收目标对象的数据查询请求,其中,数据查询请求至少携带待查询数据的标识信息;The receiving module 70 is configured to receive a data query request of a target object, wherein the data query request carries at least identification information of the data to be queried;
查询模块72,用于根据标识信息确定待查询数据所属的目标数据类型,其中,数据类型包括以下之一:热数据,冷数据;The query module 72 is configured to determine the target data type of the data to be queried according to the identification information, wherein the data type includes one of the following: hot data, cold data;
确定模块74,用于确定目标数据类型对应的数据查询接口,将数据查询接口查询到的结果数据以统一的数据格式返回至目标对象,其中,目标数据类型与数据查询接口一一对应。The determination module 74 is configured to determine the data query interface corresponding to the target data type, and return the result data queried by the data query interface to the target object in a unified data format, wherein the target data type corresponds to the data query interface one by one.
该装置中,接收模块70,用于接收目标对象的数据查询请求,其中,数据查询请求至少携带待查询数据的标识信息;查询模块72,用于根据标识信息确定待查询数据所属的目标数据类型,其中,数据类型包括以下之一:热数据,冷数据;确定模块74,用于确定目标数据类型对应的数据查询接口,将数据查询接口查询到的结果数据以统一的数据格式返回至目标对象,其中,目标数据类型与数据查询接口一一对应,达到了基于不同类型的数据库对冷热数据进行分类存储的目的,从而实现了提高数据库的数据处理吞吐量,提高数据查询效率以及响应速度的技术效果,进而解决了由于相关技术中传统的关系型数据库的吞吐量较差,可扩展性较低,造成的数据查询效率较低,查询响应速度较慢的技术问题。In this device, the receiving module 70 is used to receive the data query request of the target object, wherein the data query request carries at least the identification information of the data to be queried; the query module 72 is used to determine the target data type to which the data to be queried belongs according to the identification information , wherein, the data type includes one of the following: hot data, cold data; the determination module 74 is used to determine the data query interface corresponding to the target data type, and return the result data queried by the data query interface to the target object in a unified data format , where the target data type corresponds to the data query interface one by one, achieving the purpose of classifying and storing hot and cold data based on different types of databases, thereby achieving the goal of improving the data processing throughput of the database, improving the efficiency of data query and the response speed The technical effect further solves the technical problems of low data query efficiency and slow query response speed due to poor throughput and low scalability of traditional relational databases in related technologies.
根据本申请实施例的另一方面,还提供了一种非易失性存储介质,存储介质包括存储的程序,其中,在程序运行时控制存储介质所在设备执行任意一种多数据库处理数据的方法。According to another aspect of the embodiment of the present application, there is also provided a non-volatile storage medium, the storage medium includes a stored program, wherein, when the program is running, the device where the storage medium is located is controlled to execute any method for processing data with multiple databases .
具体地,上述存储介质用于存储以下功能的程序指令,实现以下功能:Specifically, the above-mentioned storage medium is used to store program instructions for the following functions, so as to realize the following functions:
接收目标对象的数据查询请求,其中,数据查询请求至少携带待查询数据的标识信息;根据标识信息确定待查询数据所属的目标数据类型,其中,数据类型包括以下之一:热数据,冷数据;确定目标数据类型对应的数据查询接口,将数据查询接口查询到的结果数据以统一的数据格式返回至目标对象,其中,目标数据类型与数据查询接口一一对应。Receiving a data query request from a target object, wherein the data query request carries at least identification information of the data to be queried; determining the target data type to which the data to be queried belongs according to the identification information, wherein the data type includes one of the following: hot data, cold data; Determine the data query interface corresponding to the target data type, and return the result data queried by the data query interface to the target object in a unified data format, wherein the target data type corresponds to the data query interface one by one.
可选地,在本实施例中,上述存储介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。上述存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。Optionally, in this embodiment, the aforementioned storage medium may include, but not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. More specific examples of the aforementioned storage media would include one or more wire-based electrical connections, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM) or flash memory), optical fiber, compact disc read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
在本申请一示例性实施例中,还提供了一种计算机程序产品,包括计算机程序,计算机程序在被处理器执行时实现上述任一项的多数据库处理数据的方法。In an exemplary embodiment of the present application, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, any one of the methods for processing data with multiple databases described above is implemented.
可选地,该计算机程序在被处理器执行时可实现如下步骤:Optionally, when the computer program is executed by the processor, the following steps can be realized:
接收目标对象的数据查询请求,其中,数据查询请求至少携带待查询数据的标识信息;根据标识信息确定待查询数据所属的目标数据类型,其中,数据类型包括以下之一:热数据,冷数据;确定目标数据类型对应的数据查询接口,将数据查询接口查询到的结果数据以统一的数据格式返回至目标对象,其中,目标数据类型与数据查询接口一一对应。Receiving a data query request from a target object, wherein the data query request carries at least identification information of the data to be queried; determining the target data type to which the data to be queried belongs according to the identification information, wherein the data type includes one of the following: hot data, cold data; Determine the data query interface corresponding to the target data type, and return the result data queried by the data query interface to the target object in a unified data format, wherein the target data type corresponds to the data query interface one by one.
根据本申请的实施例提供了一种电子设备,该电子设备包括:至少一个处理器;以及与至少一个处理器通信连接的存储器;其中,存储器存储有可被至少一个处理器执行的指令,指令被至少一个处理器执行,以使至少一个处理器能够执行上述任一项的多数据库处理数据的方法。According to an embodiment of the present application, an electronic device is provided, and the electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions that can be executed by the at least one processor, and the instructions Executed by at least one processor, so that the at least one processor can execute any one of the methods for processing data in multiple databases described above.
可选地,上述电子设备还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入设备输出设备和上述处理器连接。Optionally, the electronic device may further include a transmission device and an input and output device, wherein the transmission device is connected to the processor, and the input device and output device are connected to the processor.
图8示出了可以用来实施本申请的实施例的示例电子设备800的示意性框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本申请的实现。FIG. 8 shows a schematic block diagram of an example electronic device 800 that may be used to implement embodiments of the present application. Electronic device is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are by way of example only, and are not intended to limit implementations of the applications described and/or claimed herein.
如图8所示,设备800包括计算单元801,其可以根据存储在只读存储器(ROM)802中的计算机程序或者从存储单元808加载到随机访问存储器(RAM)803中的计算机程序,来执行各种适当的动作和处理。在RAM 803中,还可存储设备800操作所需的各种程序和数据。计算单元801、ROM 802以及RAM 803通过总线804彼此相连。输入/输出(I/O)接口805也连接至总线804。As shown in FIG. 8, the device 800 includes a computing unit 801 that can execute according to a computer program stored in a read-only memory (ROM) 802 or loaded from a storage unit 808 into a random access memory (RAM) 803. Various appropriate actions and treatments. In the RAM 803, various programs and data necessary for the operation of the device 800 can also be stored. The computing unit 801 , ROM 802 , and RAM 803 are connected to each other through a bus 804 . An input/output (I/O) interface 805 is also connected to the bus 804 .
设备800中的多个部件连接至I/O接口805,包括:输入单元806,例如键盘、鼠标等;输出单元807,例如各种类型的显示器、扬声器等;存储单元808,例如磁盘、光盘等;以及通信单元809,例如网卡、调制解调器、无线通信收发机等。通信单元809允许设备800通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据。Multiple components in the device 800 are connected to the I/O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a magnetic disk, an optical disk, etc. ; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, and the like. The communication unit 809 allows the device 800 to exchange information/data with other devices over a computer network such as the Internet and/or various telecommunication networks.
计算单元801可以是各种具有处理和计算能力的通用和/或专用处理组件。计算单元801的一些示例包括但不限于中央处理单元(CPU)、图形处理单元(GPU)、各种专用的人工智能(AI)计算芯片、各种运行机器学习模型算法的计算单元、数字信号处理器(DSP)、以及任何适当的处理器、控制器、微控制器等。计算单元801执行上文所描述的各个方法和处理,例如多数据库处理数据的方法。例如,在一些实施例中,多数据库处理数据的方法可被实现为计算机软件程序,其被有形地包含于机器可读介质,例如存储单元808。在一些实施例中,计算机程序的部分或者全部可以经由ROM 802和/或通信单元809而被载入和/或安装到设备800上。当计算机程序加载到RAM 803并由计算单元801执行时,可以执行上文描述的多数据库处理数据的方法的一个或多个步骤。备选地,在其他实施例中,计算单元801可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行多数据库处理数据的方法。The computing unit 801 may be various general-purpose and/or special-purpose processing components having processing and computing capabilities. Some examples of computing units 801 include, but are not limited to, central processing units (CPUs), graphics processing units (GPUs), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processing processor (DSP), and any suitable processor, controller, microcontroller, etc. The calculation unit 801 executes various methods and processes described above, such as a method for processing data by multiple databases. For example, in some embodiments, the method for multi-database processing data may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 808 . In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 800 via the ROM 802 and/or the communication unit 809 . When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the above-described method for processing data with multiple databases can be performed. Alternatively, in other embodiments, the computing unit 801 may be configured in any other appropriate way (for example, by means of firmware) to execute the method for processing data with multiple databases.
本文中以上描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、芯片上系统的系统(SOC)、负载可编程逻辑设备(CPLD)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips Implemented in a system of systems (SOC), load programmable logic device (CPLD), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include being implemented in one or more computer programs executable and/or interpreted on a programmable system including at least one programmable processor, the programmable processor Can be special-purpose or general-purpose programmable processor, can receive data and instruction from storage system, at least one input device, and at least one output device, and transmit data and instruction to this storage system, this at least one input device, and this at least one output device an output device.
用于实施本申请的方法的程序代码可以采用一个或多个编程语言的任何组合来编写。这些程序代码可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器或控制器,使得程序代码当由处理器或控制器执行时使流程图和/或框图中所规定的功能/操作被实施。程序代码可以完全在机器上执行、部分地在机器上执行,作为独立软件包部分地在机器上执行且部分地在远程机器上执行或完全在远程机器或服务器上执行。Program codes for implementing the methods of the present application may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special purpose computer, or other programmable data processing devices, so that the program codes, when executed by the processor or controller, make the functions/functions specified in the flow diagrams and/or block diagrams Action is implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
在本申请的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include one or more wire-based electrical connections, portable computer discs, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。To provide for interaction with the user, the systems and techniques described herein can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user. ); and a keyboard and pointing device (eg, a mouse or a trackball) through which a user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and can be in any form (including Acoustic input, speech input or, tactile input) to receive input from the user.
可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., as a a user computer having a graphical user interface or web browser through which a user can interact with embodiments of the systems and techniques described herein), or including such backend components, middleware components, Or any combination of front-end components in a computing system. The components of the system can be interconnected by any form or medium of digital data communication, eg, a communication network. Examples of communication networks include: Local Area Network (LAN), Wide Area Network (WAN) and the Internet.
计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。服务器可以是云服务器,也可以为分布式系统的服务器,或者是结合了区块链的服务器。A computer system may include clients and servers. Clients and servers are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, a server of a distributed system, or a server combined with a blockchain.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the above embodiments of the present application are for description only, and do not represent the advantages and disadvantages of the embodiments.
在本申请的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments of the present application, the descriptions of each embodiment have their own emphases, and for parts not described in detail in a certain embodiment, reference may be made to relevant descriptions of other embodiments.
在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,可以为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed technical content can be realized in other ways. Wherein, the device embodiments described above are only illustrative. For example, the division of the units may be a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or may be Integrate into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of units or modules may be in electrical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions for enabling a computer device (which may be a personal computer, server or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes. .
以上所述仅是本申请的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。The above description is only the preferred embodiment of the present application. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present application, some improvements and modifications can also be made. These improvements and modifications are also It should be regarded as the protection scope of this application.
Claims (12)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310653188.9A CN116680295A (en) | 2023-06-02 | 2023-06-02 | Method, system and device for multi-database processing data |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310653188.9A CN116680295A (en) | 2023-06-02 | 2023-06-02 | Method, system and device for multi-database processing data |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN116680295A true CN116680295A (en) | 2023-09-01 |
Family
ID=87784906
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202310653188.9A Pending CN116680295A (en) | 2023-06-02 | 2023-06-02 | Method, system and device for multi-database processing data |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN116680295A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117194298A (en) * | 2023-09-18 | 2023-12-08 | 上海鸿翼软件技术股份有限公司 | Control method, device, equipment and storage medium |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108268217A (en) * | 2018-01-10 | 2018-07-10 | 北京航天云路有限公司 | A kind of bedding storage method based on the cold and hot classification of time series data |
| CN108874806A (en) * | 2017-05-09 | 2018-11-23 | 广东神马搜索科技有限公司 | Data query method, apparatus and data-storage system |
| CN113515545A (en) * | 2021-06-30 | 2021-10-19 | 北京百度网讯科技有限公司 | Data query method, device, system, electronic equipment and storage medium |
| CN113626449A (en) * | 2021-07-02 | 2021-11-09 | 上海硬通网络科技有限公司 | Data storage method, data query method and related equipment |
-
2023
- 2023-06-02 CN CN202310653188.9A patent/CN116680295A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108874806A (en) * | 2017-05-09 | 2018-11-23 | 广东神马搜索科技有限公司 | Data query method, apparatus and data-storage system |
| CN108268217A (en) * | 2018-01-10 | 2018-07-10 | 北京航天云路有限公司 | A kind of bedding storage method based on the cold and hot classification of time series data |
| CN113515545A (en) * | 2021-06-30 | 2021-10-19 | 北京百度网讯科技有限公司 | Data query method, device, system, electronic equipment and storage medium |
| CN113626449A (en) * | 2021-07-02 | 2021-11-09 | 上海硬通网络科技有限公司 | Data storage method, data query method and related equipment |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117194298A (en) * | 2023-09-18 | 2023-12-08 | 上海鸿翼软件技术股份有限公司 | Control method, device, equipment and storage medium |
| CN117194298B (en) * | 2023-09-18 | 2024-05-31 | 上海鸿翼软件技术股份有限公司 | Control method, device, equipment and storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN103177055B (en) | Hybrid database tables stored as both row store and column store | |
| US11119742B2 (en) | Cache efficient reading of result values in a column store database | |
| CN112925859B (en) | Data storage method and device | |
| CN109240946A (en) | The multi-level buffer method and terminal device of data | |
| CN113886434A (en) | Database cluster-based query and storage method, device and equipment | |
| WO2023103338A1 (en) | Data processing method and apparatus, and device and storage medium | |
| CN108363741B (en) | Big data unified interface method, device, equipment and storage medium | |
| US9646048B2 (en) | Declarative partitioning for data collection queries | |
| CN114398520A (en) | Data retrieval method, system, device, electronic equipment and storage medium | |
| CN114491253B (en) | Method and device for processing observation information, electronic equipment and storage medium | |
| CN114722264A (en) | A data query method, device, electronic device and storage medium | |
| WO2024187996A1 (en) | Data management method and computing device | |
| CN116680295A (en) | Method, system and device for multi-database processing data | |
| CN116594962A (en) | Access request processing method and device and forward index system | |
| CN114942955A (en) | A data export method, device, export node, medium and system | |
| CN115393095A (en) | Page data display method, device and equipment based on cloud computing | |
| CN114416414A (en) | Fault information positioning method, device, equipment and storage medium | |
| EP3818451B1 (en) | Index data structures and graphical user interface | |
| CN110427377A (en) | Data processing method, device, equipment and storage medium | |
| CN118051498A (en) | Hbase-based data management method, hbase-based data management device, hbase-based data management equipment and Hbase-based data management medium | |
| CN116303610A (en) | Database data query method, device, electronic equipment and storage medium based on state dictionary | |
| CN116955394A (en) | Data query method, device, equipment and medium | |
| CN113127496B (en) | Method and device for determining change data in database, medium and equipment | |
| CN116226251A (en) | A data export method, device, electronic equipment and storage medium | |
| US20060230020A1 (en) | Improving Efficiency in processing queries directed to static data sets |
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 |