CN114925074A - A data unloading method, device, device and medium - Google Patents
A data unloading method, device, device and medium Download PDFInfo
- Publication number
- CN114925074A CN114925074A CN202210706934.1A CN202210706934A CN114925074A CN 114925074 A CN114925074 A CN 114925074A CN 202210706934 A CN202210706934 A CN 202210706934A CN 114925074 A CN114925074 A CN 114925074A
- Authority
- CN
- China
- Prior art keywords
- unloading
- database table
- time
- mode
- database
- 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
Images
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/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
-
- 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/21—Design, administration or maintenance of 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/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
- G06F16/2228—Indexing structures
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)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
技术领域technical field
本发明涉及数据处理技术领域,具体涉及一种数据卸载方法、装置、设备及介质。The present invention relates to the technical field of data processing, in particular to a data unloading method, device, device and medium.
背景技术Background technique
近年来,随着信息量的迅猛增长,大量的数据伴随着日常生活产生。例如,在主办方开展营销活动的时候,有表示活动参与情况的数据、有表示活动开展情况的数据,还有表示奖品发放情况的数据等等。通常需要对这些数据进行统计分析。由于数据的来源不同,对这些数据做统计分析,一般是先将这些数据存储在数据库中,生成数据库表。将数据库表发送至数据分析系统进行分析。最常用的手段是使用Oracle生成用于卸载数据库表的卸载文件,再发送至数据分析系统。这样,数据分析系统接收该卸载文件,根据该卸载文件重新加载获得数据库表中的数据。In recent years, with the rapid growth of the amount of information, a large amount of data is generated along with daily life. For example, when the sponsor conducts a marketing campaign, there is data indicating the participation in the event, data indicating the development of the event, and data indicating the distribution of prizes, and so on. Statistical analysis of these data is usually required. Due to the different sources of data, for statistical analysis of these data, generally, these data are first stored in the database to generate database tables. Send the database table to the data analysis system for analysis. The most common method is to use Oracle to generate unload files for unloading database tables, and then send them to the data analysis system. In this way, the data analysis system receives the unloading file, and reloads the data in the database table according to the unloading file.
目前只支持对某一个数据库表进行卸载(也就是处理,例如抽取部分数据等),在多种数据源的场景中,一次只能卸载一个数据库表,卸载效率较低。且由于不同数据源具有不同的业务执行日期,对不同数据源统一卸载,可能会卸载不必要的数据。Currently, only one database table is supported for unloading (that is, processing, such as extracting partial data, etc.). In scenarios with multiple data sources, only one database table can be unloaded at a time, and the unloading efficiency is low. And since different data sources have different business execution dates, unloading different data sources uniformly may unload unnecessary data.
发明内容SUMMARY OF THE INVENTION
本发明实施例提供了一种数据卸载方法、装置、设备及介质,当存在不同数据源时,可以同时卸载不同数据源中的数据,提高数据卸载的效率。Embodiments of the present invention provide a data unloading method, apparatus, device and medium. When different data sources exist, data in different data sources can be unloaded at the same time, thereby improving the efficiency of data unloading.
第一方面,本发明实施例提供了一种数据卸载方法,该方法可以由具有计算处理能力的电子设备,例如个人计算机执行,该方法包括:In a first aspect, an embodiment of the present invention provides a data unloading method. The method can be executed by an electronic device with computing processing capability, such as a personal computer. The method includes:
电子设备根据多个数据库表生成待卸载的数据库表列表,该数据库表列表包括多个数据库表各自的索引和多个字段信息,多个字段信息又包括多个数据库表中的各个数据库表分别对应的字段信息。然后,电子设备根据数据库表列表的字段信息生成卸载参数,该卸载参数用于卸载多个数据库表。之后,电子设备将卸载参数导入卸载脚本生成卸载文件,其中,卸载脚本用于卸载多个数据库表。由于在多数据源的场景下,在卸载不同数据源中的数据时,不同数据源有不同的卸载日期,对不同数据源的统一卸载,可能会卸载不必要的数据。因此,在本发明实施例中,可以动态配置数据源的卸载时间,例如可对不同数据源的卸载时间相同。要卸载时,根据待卸载的不同数据源的数据库表生成数据库表列表,并根据数据库表列表生成的卸载参数生成卸载文件。从而运行卸载文件,可根据卸载参数依次卸载数据库表列表中的各个数据库表,即实现多数据源的同时卸载,提高了卸载的效率。The electronic device generates a list of database tables to be uninstalled according to a plurality of database tables, the database table list includes respective indexes of the plurality of database tables and a plurality of field information, and the plurality of field information also includes the corresponding database tables in the plurality of database tables respectively field information. Then, the electronic device generates an unloading parameter according to the field information of the database table list, where the unloading parameter is used to unload a plurality of database tables. After that, the electronic device imports the uninstallation parameters into an uninstallation script to generate an uninstallation file, where the uninstallation script is used to uninstall a plurality of database tables. In the scenario of multiple data sources, when uninstalling data from different data sources, different data sources have different uninstall dates, and unified uninstallation of different data sources may uninstall unnecessary data. Therefore, in this embodiment of the present invention, the unloading time of the data source may be dynamically configured, for example, the unloading time may be the same for different data sources. When uninstalling, a database table list is generated according to the database tables of different data sources to be uninstalled, and an uninstall file is generated according to the uninstall parameters generated by the database table list. Therefore, by running the uninstallation file, each database table in the database table list can be uninstalled in sequence according to the uninstallation parameters, that is, simultaneous uninstallation of multiple data sources is realized, and the uninstallation efficiency is improved.
可选的,数据库表列表的多个字段信息包括卸载模式信息,卸载模式信息包括卸载模式,卸载模式包括全量卸载模式或增量卸载模式,全量卸载模式指示卸载数据库表列表包括的所有数据库表中的数据,增量卸载模式指示卸载多个数据库表中预设时间间隔内增加的数据,根据数据库表列表的字段信息生成卸载参数包括:电子设备获取所述卸载模式信息,根据所述卸载模式信息生成所述卸载参数。这样,当数据库表列表中有多个数据库表时,用户可根据实际需求为各个数据库表配置不同的卸载模式,相应的,电子设备根据用户配置的卸载模式生成卸载参数,可实现数据库表的灵活卸载。Optionally, the multiple field information of the database table list includes uninstallation mode information, the uninstallation mode information includes the uninstallation mode, the uninstallation mode includes the full uninstallation mode or the incremental uninstallation mode, and the full uninstallation mode indicates that the uninstallation database table list includes all the database tables included. The incremental unloading mode indicates unloading data added within a preset time interval in multiple database tables, and generating the unloading parameters according to the field information of the database table list includes: the electronic device obtains the unloading mode information, and according to the unloading mode information The uninstall parameters are generated. In this way, when there are multiple database tables in the database table list, the user can configure different unloading modes for each database table according to actual needs. Correspondingly, the electronic device generates the unloading parameters according to the unloading mode configured by the user, which can realize the flexibility of the database table. Uninstall.
可选的,数据库表列表的多个字段信息还包括卸载时间信息,卸载时间信息指示在增量卸载模式下数据库表的卸载时间,根据所述数据库表列表的字段信息生成卸载参数,包括:电子设备获取卸载时间信息,根据卸载时间信息生成卸载参数,其中,卸载参数包括第i次卸载时间和预设时间间隔,预设时间间隔和第i次卸载时间用于确定第i+1次卸载时间。可以理解的是,相较于全量卸载模式来说,增量卸载模式即卸载预设时间间隔内的数据。因此,可动态配置各个数据库表的卸载时间。不同数据库表可以设置相同的卸载时间,从而同一段时间内可卸载多个数据库表。另外,所述卸载时间可包括第i次卸载时间和第i+1次卸载时间。其中,第i+1次卸载时间可以通过第i次卸载时间和预设时间间隔计算,即通过预设时间间隔间接配置第i+1次卸载时间,无需单独配置第i+1次卸载时间,可减少配置第i+1次卸载时间的次数,更为简便。Optionally, the multiple field information of the database table list also includes unloading time information, the unloading time information indicates the unloading time of the database table in the incremental unloading mode, and the unloading parameters are generated according to the field information of the database table list, including: electronic The device obtains the unloading time information, and generates the unloading parameters according to the unloading time information, wherein the unloading parameters include the ith unloading time and the preset time interval, and the preset time interval and the ith unloading time are used to determine the ith+1 th unloading time . It can be understood that, compared with the full offload mode, the incremental offload mode is to offload data within a preset time interval. Therefore, the unload time of individual database tables can be dynamically configured. Different database tables can be set to the same unload time, so that multiple database tables can be unloaded within the same period of time. In addition, the unloading time may include the i-th unloading time and the i+1-th unloading time. Among them, the i+1-th unloading time can be calculated by the i-th unloading time and the preset time interval, that is, the i+1-th unloading time is indirectly configured through the preset time interval, and there is no need to configure the i+1-th unloading time separately. It can reduce the number of times to configure the i+1 unloading time, which is more convenient.
可选的,将卸载参数导入卸载脚本生成卸载文件后,所述方法还包括:电子设备将第i+1次卸载时间更新为第i次卸载时间,然后,获取第i次卸载时间和预设时间间隔,生成新的第i+1次卸载时间。其中,不同的数据库表对应的预设时间间隔不同。该方案可将第i+1次卸载时间更新为第i次卸载时间,从而可实现循环设置数据库表的卸载时间的目的。即设置一次第i次卸载时间和预设时间间隔,就可实现循环设置第i次卸载时间和第i+1次卸载时间。同时,可实现每个数据库表的卸载随时间推进。Optionally, after the uninstallation parameters are imported into the uninstallation script to generate the uninstallation file, the method further includes: the electronic device updates the i+1th uninstallation time to the ith uninstallation time, and then obtains the ith uninstallation time and the preset time. Time interval to generate a new i+1 unloading time. The preset time intervals corresponding to different database tables are different. This solution can update the i+1 th unloading time to the i th unloading time, thereby realizing the purpose of cyclically setting the unloading time of the database table. That is, by setting the i-th unloading time and the preset time interval once, the i-th unloading time and the i+1-th unloading time can be set cyclically. At the same time, the unloading of each database table can be achieved over time.
可选的,数据库表列表的多个字段信息包括卸载标识,卸载标识用于指示数据库表是否卸载完成,所述方法还包括:电子设备获取第一数据库表对应的卸载标识,若该卸载标识指示第一数据库表卸载完成,则获取推送信息,该推送信息包括第一数据库表的存储路径以及目标文件路径。从而,电子设备从存储路径获取第一数据库表,并将第一数据库表推送至目标文件路径。在本发明实施例中,电子设备卸载数据库表之后,还可以推送卸载的数据库表。例如,电子设备根据卸载标识可确定哪些数据库表被卸载,进而根据需求选择推送时间,到达推送时间,就可以根据推送信息获取要推送的数据库表,并将该数据库表推送到目标文件路径。Optionally, the multiple field information of the database table list includes an uninstallation identifier, and the uninstallation identifier is used to indicate whether the uninstallation of the database table is completed, and the method further includes: the electronic device obtains the uninstallation identifier corresponding to the first database table, if the uninstallation identifier indicates After the unloading of the first database table is completed, push information is obtained, where the push information includes a storage path of the first database table and a target file path. Thus, the electronic device acquires the first database table from the storage path, and pushes the first database table to the target file path. In this embodiment of the present invention, after the electronic device unloads the database table, it can also push the unloaded database table. For example, the electronic device can determine which database tables are to be uninstalled according to the uninstall identifier, and then select the push time according to the requirements. When the push time is reached, the electronic device can obtain the database table to be pushed according to the push information, and push the database table to the target file path.
可选的,推送信息还包括推送模式标识,该推送模式标识指示推送模式,电子设备将第一数据库推送至目标文件路径,包括:电子设备获取推送模式标识,并根据推送模式标识指示的推送模式将第一数据库表推送至目标文件路径。在本发明实施例中,有多种推送模式,例如包括jfserver推送模式、ftp推送模式和httpclient推送模式。在不同的应用场景中,可选择匹配的推送模式,应用范围更广。Optionally, the push information further includes a push mode identification, the push mode identification indicates a push mode, and the electronic device pushes the first database to the target file path, including: the electronic device obtains the push mode identification, and according to the push mode identification indicates the push mode. Push the first database table to the target file path. In this embodiment of the present invention, there are multiple push modes, including, for example, a jfserver push mode, an ftp push mode, and an httpclient push mode. In different application scenarios, a matching push mode can be selected, and the application range is wider.
可选的,将卸载参数导入卸载脚本生成卸载文件后,所述方法还包括:电子设备接收输入的卸载次数,并根据该卸载次数对到达卸载时间的数据库表进行卸载。用户可以根据实际需求设置卸载次数,由于电子设备一次只卸载数据库表一个预设时间间隔内的数据,通过设置卸载次数,电子设备就可以卸载多个预设时间间隔内的数据,从而提高了电子设备的卸载效率。同时,通过设置卸载次数,在数据库表某次卸载失败时,下一次还可以进行卸载,有效避免卸载失败导致的数据遗漏。Optionally, after the uninstallation parameters are imported into the uninstallation script to generate the uninstallation file, the method further includes: the electronic device receives the input uninstallation times, and uninstalls the database table that reaches the uninstallation time according to the uninstallation times. Users can set the number of unloading according to actual needs. Since the electronic device only unloads the data within a preset time interval of the database table at a time, by setting the number of unloading, the electronic device can unload the data within multiple preset time intervals, thereby improving the electronic performance. The unloading efficiency of the device. At the same time, by setting the number of uninstalls, when a database table fails to be uninstalled at one time, it can be uninstalled next time, effectively avoiding data omission caused by the failure of uninstallation.
第二方面,本发明实施例提供了一种数据卸载装置,该数据变更装置可以用于实现第一方面提供的数据卸载方法。该数据卸载装置包括列表生成模块、参数生成模块、卸载模块。其中,列表生成模块用于根据多个数据库表生成待卸载的数据库表列表,所述数据库表列表包括所述多个数据库表各自的索引和多个字段信息,所述多个字段信息包括所述多个数据库表中的各个数据库表分别对应的字段信息。参数生成模块用于根据所述数据库表列表的字段信息生成卸载参数,所述卸载参数用于卸载所述多个数据库表。卸载模块用于将所述卸载参数导入卸载脚本生成卸载文件,所述卸载脚本用于卸载所述多个数据库表。In a second aspect, an embodiment of the present invention provides a data unloading apparatus, and the data changing apparatus can be used to implement the data unloading method provided in the first aspect. The data unloading device includes a list generating module, a parameter generating module, and an unloading module. The list generation module is configured to generate a list of database tables to be uninstalled according to multiple database tables, the database table list includes respective indexes of the multiple database tables and multiple field information, and the multiple field information includes the Field information corresponding to each database table in the multiple database tables. The parameter generation module is configured to generate an unloading parameter according to the field information of the database table list, where the unloading parameter is used to unload the plurality of database tables. The uninstallation module is configured to import the uninstallation parameters into an uninstallation script to generate an uninstallation file, and the uninstallation script is used to uninstall the multiple database tables.
可选的,参数生成模块具体用于:获取所述卸载模式信息,根据所述卸载模式信息生成所述卸载参数。Optionally, the parameter generation module is specifically configured to: acquire the uninstallation mode information, and generate the uninstallation parameter according to the uninstallation mode information.
可选的,参数生成模块还用于:获取卸载时间信息,根据卸载时间信息生成卸载参数,其中,卸载参数包括第i次卸载时间和预设时间间隔,预设时间间隔和第i次卸载时间用于确定第i+1次卸载时间。Optionally, the parameter generation module is further configured to: obtain the unloading time information, and generate the unloading parameters according to the unloading time information, wherein the unloading parameters include the ith unloading time and the preset time interval, and the preset time interval and the ith unloading time. Used to determine the i+1th unloading time.
可选的,参数生成模块还用于:将第i+1次卸载时间更新为第i次卸载时间。获取第i次卸载时间和预设时间间隔,生成新的第i+1次卸载时间,其中,不同的数据库表对应的预设时间间隔不同。Optionally, the parameter generation module is further configured to: update the i+1 th unloading time to the i th unloading time. Obtain the i-th unloading time and the preset time interval, and generate a new i+1-th unloading time, wherein the preset time intervals corresponding to different database tables are different.
可选的,数据卸载装置还用于:获取第一数据库表对应的卸载标识,若卸载标识指示第一数据库表卸载完成,获取推送信息,推送信息包括第一数据库表的存储路径以及目标文件路径。从存储路径获取所述第一数据库表,并将第一数据库表推送至目标文件路径。Optionally, the data unloading device is further configured to: obtain the unloading identifier corresponding to the first database table, and if the unloading identifier indicates that the unloading of the first database table is completed, obtain push information, where the push information includes the storage path of the first database table and the target file path. . Acquire the first database table from the storage path, and push the first database table to the target file path.
可选的,数据卸载装置还用于:获取推送模式标识,根据推送模式标识指示的推送模式将第一数据库表推送至目标文件路径。Optionally, the data unloading apparatus is further configured to: obtain the push mode identifier, and push the first database table to the target file path according to the push mode indicated by the push mode identifier.
可选的,参数生成模块还用于:接收输入的卸载次数,根据卸载次数对到达卸载时间的数据库表进行卸载。Optionally, the parameter generation module is further configured to: receive the input number of unloading, and unload the database table that reaches the unloading time according to the number of unloading.
第三方面,本发明还提供一种电子设备,包括存储器、处理器及存储在存储器上的可被处理器执行的计算机程序,该处理器执行计算机程序时实现如第一方面以及各个可选项的所述方法。In a third aspect, the present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored on the memory that can be executed by the processor. When the processor executes the computer program, the first aspect and various options are implemented. the method.
第四方面,本发明还提供一种计算机可读存储介质,计算机存储介质上存储有计算机程序,该计算机程序被处理器执行时实现如第一方面以及各个可选项所述的步骤。In a fourth aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, implements the steps described in the first aspect and various options.
第五方面,本发明还提供一种计算机程序产品,计算机程序产品包括:计算机程序代码,当计算机程序代码在计算机上运行时,使得计算机执行上述如第一方面方法以及各个可选项所述的步骤。In a fifth aspect, the present invention also provides a computer program product, the computer program product includes: computer program code, when the computer program code is run on the computer, the computer is made to execute the above-mentioned steps as described in the method of the first aspect and each optional item .
附图说明Description of drawings
图1为本发明实施例提供的一种数据卸载方法的流程示意图;1 is a schematic flowchart of a data unloading method according to an embodiment of the present invention;
图2为本发明实施例提供的数据卸载装置的结构示意图;2 is a schematic structural diagram of a data unloading apparatus provided by an embodiment of the present invention;
图3为本发明实施例提供的电子设备的结构示意图。FIG. 3 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明的实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例的附图,对本发明实施例的技术方案进行清楚、完整地描述。本发明技术方案中,对数据的采集、传输、使用等,均符合国家相关法律法规要求。In order to make the purposes, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. In the technical solution of the present invention, the collection, transmission, and use of data all meet the requirements of relevant national laws and regulations.
本发明实施例的目的在于实现多数据源卸载及推送的动态配置,为了更好地理解本发明实施例中的方案,下面首先介绍本发明实施例中涉及的一些概念。The purpose of the embodiments of the present invention is to realize the dynamic configuration of offloading and pushing multiple data sources. In order to better understand the solutions in the embodiments of the present invention, some concepts involved in the embodiments of the present invention are first introduced below.
1)数据库表,是按照数据结构来组织、存储和管理数据的仓库,是存储在计算机内的、有组织的、可共享的、统一管理的大量数据的集合。通常,一个或多个数据库表位于一个数据库中。一个数据库表对应一个数据源,例如,表示活动参与情况的数据、有表示活动开展情况的数据,还有表示奖品发放情况的数据等。来自不同数据源的数据库表可以属于一个数据库。每个数据库表包含多个字段信息(本文中也可以简称为字段),每个字段表示数据库表的一种属性。例如,一个数据库表包括卸载时间字段,那么该卸载时间字段表示该数据库表的卸载时间。1) The database table is a warehouse that organizes, stores and manages data according to the data structure. Typically, one or more database tables reside in a database. A database table corresponds to a data source, for example, data representing activity participation, data representing activity development, and data representing prize distribution. Database tables from different data sources can belong to one database. Each database table contains a plurality of field information (herein, it may also be referred to as a field for short), and each field represents an attribute of the database table. For example, a database table includes an unload time field, then the unload time field indicates the unload time of the database table.
2)数据卸载,是对数据处理的统称,例如,按照规则抽取数据库表中的数据,卸载后的数据以另一种形式存储。本发明实施例中,数据卸载是根据卸载参数导入卸载脚本生成卸载文件实现的。卸载脚本可以理解为是执行卸载过程所用到的工具,卸载参数是使用卸载脚本时的输入的参数。其中,卸载参数是通过数据库表中的字段信息生成的。也就是说,数据卸载的过程可以理解为根据数据库表中的字段信息生成卸载参数,将卸载参数导入卸载脚本,生成卸载文件,运行卸载文件实现数据的卸载。2) Data unloading is a general term for data processing. For example, the data in the database table is extracted according to the rules, and the unloaded data is stored in another form. In the embodiment of the present invention, the data unloading is realized by importing the unloading script according to the unloading parameters to generate the unloading file. The uninstall script can be understood as a tool used to execute the uninstall process, and the uninstall parameter is the input parameter when using the uninstall script. Among them, the uninstall parameter is generated through the field information in the database table. That is to say, the process of data unloading can be understood as generating unloading parameters according to the field information in the database table, importing the unloading parameters into the unloading script, generating the unloading file, and running the unloading file to realize the unloading of the data.
3)数据卸载的模式,包括全量卸载模式和增量卸载模式。全量卸载指的是一次卸载数据库表中的所有数据。可以理解为,不论数据库表的数据量是否增加或减少,在卸载时对数据库表中的所有数据进行卸载。增量卸载指的是卸载数据库表在预设时间间隔内的数据。可以理解的是,一段时间内,数据库表可能还会录入或删除一些数据,例如,一段时间内,可能会新增加奖品设置,那么会录入新增加的奖品数据。增量卸载可以实现对预设时间间隔内的数据进行处理,例如,可以对预设时间间隔内新录入的数据卸载,更为灵活。3) Data unloading mode, including full unloading mode and incremental unloading mode. Full unloading refers to unloading all the data in the database table at one time. It can be understood that, regardless of whether the data volume of the database table increases or decreases, all data in the database table is unloaded during unloading. Incremental unloading refers to unloading data from database tables at preset time intervals. It is understandable that, in a period of time, some data may be entered or deleted in the database table. For example, in a period of time, new prize settings may be added, and the newly added prize data will be entered. Incremental unloading can process data within a preset time interval, for example, it can unload newly entered data within a preset time interval, which is more flexible.
4)数据的推送,指的是将数据推送(发送)至数据分析系统,以通过数据分析系统对数据进行分析。举例来说,针对不同活动,可将一个或多个数据源的数据推送到数据分析系统,例如,将表示活动参与情况的数据发送到数据分析系统。由数据分析系统分析这些数据,得到活动参与的情况,从而后续根据当前活动参与的情况,调整活动策划。4) Data push refers to pushing (sending) the data to the data analysis system to analyze the data through the data analysis system. For example, for different activities, data from one or more data sources may be pushed to the data analysis system, eg, data indicative of activity participation is sent to the data analysis system. The data analysis system analyzes these data to obtain the activity participation situation, so as to adjust the activity plan according to the current activity participation situation.
根据数据的来源,对数据进行统计分析,通常是将同一数据源的数据以数据库表的形式存储。可通过数据库工具,例如,Oracle生成用于卸载数据库表的卸载文件,再发送至数据分析系统。这样,数据分析系统接收该卸载文件,根据该卸载文件重新加载获得数据库表中的数据。但是目前只支持对某一个数据库表进行卸载(也就是处理,例如抽取部分数据等),在多种数据源的场景中,一次只能卸载一个数据库表,卸载效率较低。且由于不同数据源具有不同的业务执行日期,对不同数据源统一卸载,可能会卸载不必要的数据。Statistical analysis is performed on the data according to the source of the data, usually by storing the data of the same data source in the form of a database table. An unload file for unloading database tables can be generated by a database tool, such as Oracle, and sent to the data analysis system. In this way, the data analysis system receives the unloading file, and reloads the data in the database table according to the unloading file. However, currently only one database table is supported for unloading (that is, processing, such as extracting partial data, etc.). In scenarios with multiple data sources, only one database table can be unloaded at a time, and the unloading efficiency is low. And since different data sources have different business execution dates, unloading different data sources uniformly may unload unnecessary data.
鉴于此,提供本发明实施例的方案,在该方案中,可动态配置各个数据库表(不同数据源的数据)的卸载时间,这样不同数据源的数据的卸载时间可能相同,从而一次可卸载多个数据库表,提高卸载效率。且,由于各个数据库表的卸载时间是根据需求动态配置的,因此,也避免同时卸载的多个数据库表中包括不需要卸载的数据库表。另外,数据库表卸载之后,还可以将卸载后的数据库表推送至数据分析系统,且推送时间也可以动态配置,更为灵活。In view of this, the solution of the embodiment of the present invention is provided, in which the unloading time of each database table (data of different data sources) can be dynamically configured, so that the unloading time of data of different data sources may be the same, so that more than one data can be unloaded at one time. A database table to improve unloading efficiency. Moreover, since the unloading time of each database table is dynamically configured according to requirements, it is also avoided that the multiple database tables to be unloaded at the same time include database tables that do not need to be unloaded. In addition, after the database table is unloaded, the unloaded database table can also be pushed to the data analysis system, and the push time can also be dynamically configured, which is more flexible.
为方便理解本发明实施例提供的方案,下面结合附图介绍本发明实施例提供的数据卸载方法。To facilitate understanding of the solutions provided by the embodiments of the present invention, the data unloading method provided by the embodiments of the present invention is described below with reference to the accompanying drawings.
请参见图1,为本发明实施例提供的数据卸载方法的流程示意图。该方法可由具有处理功能的电子设备,例如手机、平板电脑(PAD)、个人计算机(PC)等执行。当然,本发明实施例中的电子设备的类型不限于此。下文的介绍中,以该方法由电子设备执行为例。Referring to FIG. 1 , it is a schematic flowchart of a data unloading method according to an embodiment of the present invention. The method may be performed by an electronic device with processing functions, such as a mobile phone, a tablet computer (PAD), a personal computer (PC), and the like. Of course, the type of the electronic device in the embodiment of the present invention is not limited to this. In the following description, the method is performed by an electronic device as an example.
S101,电子设备根据多个数据库表生成待卸载的数据库表列表。S101, the electronic device generates a list of database tables to be uninstalled according to a plurality of database tables.
数据库表可表征来自一个数据源的数据,根据数据源的不同,数据库表的数量、类型也不同。以营销活动为例,数据源可包括表示活动参与情况的数据、表示活动开展情况的数据,表示奖品发放情况的数据等等。各个数据源的数据以数据库表的形式存在。各个数据库表可设置一个或多个字段(也称为字段信息)以标识对应的属性信息。例如,可为数据库表设置卸载时间字段,以指示卸载该数据库表的时间。又例如,可为数据库表设置卸载模式字段,以指示卸载该数据表采用的卸载模式。当然,数据库表还可以包括更多的字段,这里不再赘述。Database tables can represent data from a data source. Depending on the data source, the number and type of database tables vary. Taking a marketing campaign as an example, the data source may include data representing activity participation, data representing activity development, data representing prize distribution, and so on. The data of each data source exists in the form of database tables. Each database table may set one or more fields (also referred to as field information) to identify corresponding attribute information. For example, you can set an unload time field for a database table to indicate when the database table is unloaded. For another example, an unloading mode field can be set for a database table to indicate the unloading mode adopted for unloading the data table. Of course, the database table may also include more fields, which will not be repeated here.
根据实际需求,可能需要对部分数据源或全部数据源的数据进行分析。沿用上述的例子,可能需要对活动参与情况的数据(即某个数据库表)进行分析,以获得实际活动参与情况,便于后续根据该实际活动参与情况调整活动策略等。在分析数据之前,可将数据进行卸载,再将卸载的数据发送给数据分析系统。卸载数据,即按照规则抽取数据库表中的数据。例如,存在多个数据库表,电子设备可对这多个数据库表进行处理,以生成待卸载的数据库表列表。According to actual needs, it may be necessary to analyze the data of some or all of the data sources. Following the above example, it may be necessary to analyze the data of the activity participation (ie, a certain database table) to obtain the actual activity participation, so as to facilitate subsequent adjustment of the activity strategy according to the actual activity participation. Before analyzing the data, the data can be unloaded, and then the unloaded data can be sent to the data analysis system. Unloading data means extracting data from database tables according to rules. For example, there are multiple database tables, and the electronic device can process the multiple database tables to generate a list of database tables to be unloaded.
数据库表列表可包括卸载的多个数据库表,该数据库表列表包括多个字段信息,该多个字段信息包括所述多个数据库表的字段信息,以及更多的其他字段。例如,数据库表列表还包括多个数据库表的索引字段和多个字段信息,其中,多个字段信息包括数据库表名字段、卸载模式字段、增量卸载模式字段、卸载时间字段等。其中,卸载时间字段可包括上次卸载时间字段、下次卸载时间字段以及卸载时间间隔字段等。上次卸载时间字段指示上一次卸载数据库表的时间,下次卸载时间字段指示下一次卸载数据库表的时间,其中,下一次卸载数据库表的时间由上一次卸载数据库表的时间和卸载时间间隔字段指示的时间确定。需要说明的是,以上对数据库表列表包括的字段仅是举例,还可以包括更多字段,例如推送信息字段,将在下文中介绍。The database table list may include the unloaded plurality of database tables, the database table list including a plurality of field information including the field information of the plurality of database tables, and more other fields. For example, the database table list further includes index fields of multiple database tables and multiple field information, wherein the multiple field information includes a database table name field, an uninstallation mode field, an incremental uninstallation mode field, an uninstallation time field, and the like. The uninstallation time field may include a last uninstallation time field, a next uninstallation time field, an uninstallation time interval field, and the like. The last unloading time field indicates the time when the database table was last unloaded, and the next unloading time field indicates the time when the database table is unloaded next, where the next unloading time of the database table is determined by the last unloading time of the database table and the unloading interval field The indicated time is determined. It should be noted that the fields included in the database table list above are only examples, and more fields may also be included, such as push information fields, which will be described below.
S102,电子设备根据数据库表列表的字段信息生成卸载参数。S102, the electronic device generates an uninstall parameter according to the field information in the database table list.
电子设备生成待卸载的数据库表列表后,根据数据库表列表的字段信息进行卸载。电子设备可获取数据库表列表中部分字段信息或全部字段信息生成卸载参数,从而根据卸载参数卸载数据库表列表中的一个数据库表或者多个数据库表。After generating the list of database tables to be uninstalled, the electronic device performs the uninstallation according to the field information of the database table list. The electronic device may acquire some or all of the field information in the database table list to generate unloading parameters, so as to unload one database table or multiple database tables in the database table list according to the unloading parameters.
例如,电子设备可根据数据库表列表的卸载模式信息生成表征卸载模式的卸载参数。卸载模式信息可指示卸载数据的模式。在本发明实施例中,卸载数据的模式包括全量卸载模式和增量卸载模式。如果卸载模式为全量卸载模式,那么从采集数据的起始日期开始到卸载日期之间的所有数据都卸载。也可以理解为,到达设置的卸载时间,将数据库表中的数据全部卸载。不同的数据库表的卸载时间可以相同,从而可实现同一时间卸载多个数据库表的目的。相较于全量卸载模式,增量卸载模式指的是卸载数据库表在预设时间间隔内增加的数据。不同的数据库表可设置不同的预设时间间隔,从而各个数据库表的卸载时间相互独立。For example, the electronic device may generate the uninstallation parameter representing the uninstallation mode according to the uninstallation mode information in the database table list. The offload mode information may indicate a mode of offload data. In this embodiment of the present invention, the mode of offloading data includes a full offloading mode and an incremental offloading mode. If the unloading mode is full unloading mode, all data from the start date of collecting data to the unloading date will be unloaded. It can also be understood that when the set unloading time is reached, all the data in the database table is unloaded. The unloading time of different database tables can be the same, so that the purpose of unloading multiple database tables at the same time can be realized. Compared with the full offload mode, the incremental offload mode refers to offloading the data added to the database table within a preset time interval. Different preset time intervals can be set for different database tables, so that the unloading time of each database table is independent of each other.
预设时间间隔可以根据卸载需求动态设置,指从上一次卸载时间开始的预设时间间隔。为方便描述,将本次卸载时间记为第i次卸载时间,将下一次卸载时间记为第i+1次卸载时间。第i+1次卸载时间为第i次卸载时间和预设时间间隔之和。数据库表列表包括的字段信息可包括卸载时间信息,例如数据库表列表包括第i次卸载时间字段、第i+1次卸载时间字段和时间间隔字段。时间间隔字段可指示预设时间间隔。在增量卸载模式下,电子设备可获取卸载时间信息,并生成卸载参数。卸载参数包括第i次卸载时间和时间间隔。另外,电子设备还可以根据第i次卸载时间和时间间隔确定第i+1次的卸载参数,例如,第i+1次的卸载时间。The preset time interval can be dynamically set according to the unloading requirements, and refers to the preset time interval from the last unloading time. For convenience of description, the current unloading time is recorded as the i-th unloading time, and the next unloading time is recorded as the i+1-th unloading time. The i+1 unloading time is the sum of the ith unloading time and the preset time interval. The field information included in the database table list may include unloading time information, for example, the database table list includes an i-th unloading time field, an i+1-th unloading time field, and a time interval field. The time interval field may indicate a preset time interval. In the incremental unloading mode, the electronic device can obtain unloading time information and generate unloading parameters. The unloading parameters include the ith unloading time and time interval. In addition, the electronic device may also determine the i+1 th unloading parameter according to the ith unloading time and the time interval, for example, the i+1 th unloading time.
需要说明的是,在全量卸载模式下,由于与预设时间间隔没有关系,因此,在全量卸载模式下,电子设备无需根据时间间隔字段确定卸载时间。It should be noted that, in the full offloading mode, since there is no relationship with the preset time interval, in the full offloading mode, the electronic device does not need to determine the offloading time according to the time interval field.
S103,电子设备将所确定的卸载参数导入卸载脚本生成卸载文件。S103, the electronic device imports the determined uninstallation parameters into an uninstallation script to generate an uninstallation file.
电子设备根据字段信息生成卸载参数之后,可将待卸载数据库表列表中的一个或多个数据库表的卸载参数导入卸载脚本,生成这些数据库表对应的卸载文件。卸载脚本可以是Shell编辑的脚本,也可以是JAVA编辑的脚本等。After generating the uninstallation parameters according to the field information, the electronic device can import the uninstallation parameters of one or more database tables in the database table list to be uninstalled into the uninstallation script, and generate the uninstallation files corresponding to these database tables. The uninstall script can be a script edited by Shell or a script edited by JAVA.
运行卸载文件可根据卸载参数实现对数据库表列表中的一个或多个数据库表的卸载。以数据库表类别包括数据库表A、数据库表B和数据库表C,卸载参数包括卸载时间为例。数据库表A的第i次卸载时间为d1,预设时间间隔为t1;数据库表B的第i次卸载时间为d2,预设时间间隔为t2;数据库表C的第i次卸载时间为d3,预设时间间隔为t3。其中,d1、d2和d3可以相同,从而一次可以卸载数据库表A、数据库表B和数据库表C,相较于目前一次只能卸载一个数据库表来说,显然提高卸载效率。对于增量卸载模式来说,即使d1、d2和d3互不相同,d1+t1、d2+t2和d3+t3也可能相同,因此,对于增量卸载模式来说,也可以实现一次卸载多个数据库表。另外,t1、t2和t3可以相同,也可以不同,用户可根据实际卸载需求设置t1、t2和t3,更为灵活。即使数据库表的数量较多,通过动态配置第i次卸载时间和预设时间间隔,也能够实现各个数据库表独立、有序地卸载。Running the uninstall file can uninstall one or more database tables in the database table list according to the uninstall parameters. Take the database table category including database table A, database table B, and database table C, and the uninstallation parameter including the uninstallation time as an example. The ith unloading time of database table A is d1, and the preset time interval is t1; the ith unloading time of database table B is d2, and the preset time interval is t2; the ith unloading time of database table C is d3, The preset time interval is t3. Among them, d1, d2, and d3 can be the same, so that database table A, database table B, and database table C can be unloaded at one time. Compared with the current situation where only one database table can be unloaded at a time, the unloading efficiency is obviously improved. For the incremental unloading mode, even if d1, d2 and d3 are different from each other, d1+t1, d2+t2 and d3+t3 may be the same, so for the incremental unloading mode, it is also possible to unload multiple Database Table. In addition, t1, t2 and t3 can be the same or different, and users can set t1, t2 and t3 according to actual unloading requirements, which is more flexible. Even if the number of database tables is large, by dynamically configuring the i-th unloading time and the preset time interval, each database table can be unloaded independently and in an orderly manner.
电子设备可通过调度工具运行卸载文件。在本发明实施例中,可以设置多个调度工具,例如crontab、springbatch等。针对不同的应用场景,可选择使用匹配的调度工具,应用范围较广。具体而言,以crontab为例,一般来说,crontab工具的运行时间以小时为单位,可以将crontab工具的运行间隔称为调度间隔。针对任意一个数据库表,用户通过crontab可设置第i次卸载时间,crontab的调度间隔可以设置与预设时间间隔不同。例如,用户设置第i次卸载时间为d4,调度间隔为1个小时。那么电子设备执行crontab命令,到达d4,卸载对应的数据库表。在卸载完成之后,根据卸载时间d4与预设时间间隔更新卸载时间至d5。这样,电子设备就卸载完成数据库表d4与d5间的数据。之后,间隔1个小时,卸载数据库从d5开始的预设时间间隔内的数据。沿用上述的例子,假设d1=d2=d4,那么到达d4,卸载数据库表A和数据库表B。假设d3=d4+3天,那么在d4+3,卸载数据库表C。The electronic device can run the uninstall file through the scheduling tool. In this embodiment of the present invention, multiple scheduling tools, such as crontab, springbatch, etc., may be set. For different application scenarios, you can choose to use matching scheduling tools, which have a wide range of applications. Specifically, taking crontab as an example, generally speaking, the running time of the crontab tool is in hours, and the running interval of the crontab tool can be called the scheduling interval. For any database table, the user can set the i-th uninstall time through crontab, and the scheduling interval of crontab can be set to be different from the preset time interval. For example, the user sets the i-th unloading time as d4 and the scheduling interval as 1 hour. Then the electronic device executes the crontab command, reaches d4, and unloads the corresponding database table. After the unloading is completed, the unloading time is updated to d5 according to the unloading time d4 and the preset time interval. In this way, the electronic device unloads and completes the data between the database tables d4 and d5. After that, at an interval of 1 hour, unload the database data within the preset time interval starting from d5. Following the above example, assuming that d1=d2=d4, then when d4 is reached, database table A and database table B are unloaded. Assuming d3=d4+3 days, then on d4+3, database table C is unloaded.
电子设备运行卸载文件之后,可将第i+1次卸载时间更新为第i次卸载时间,再根据第i次卸载时间和预设时间间隔生成新的第i+1次卸载时间。不同的数据库表对应的预设时间间隔可不同。沿用上述的例子,用户通过crontab设置卸载次数为3,调度间隔为一小时。以数据库表A为例,首次卸载时间为d1,预设时间间隔为1天,在第一次卸载之前,第i次卸载时间为d1,第i+1次卸载时间为d1+1。到达d1,执行第一次卸载,第一次卸载之后,第i次卸载时间为d1+1,第i+1次卸载时间为d1+2;到达d1+1,执行第二次卸载。在第二次卸载之后,第i次卸载时间为d1+2,第i+1次卸载时间为d1+3;到达d1+2,执行第三次卸载。在第三次卸载之后,第i次卸载时间为d1+3,第i+1次卸载时间为d1+4。After the electronic device runs the uninstallation file, the i+1 th uninstall time can be updated to the i th uninstall time, and a new i+1 th uninstall time can be generated according to the i th uninstall time and the preset time interval. The preset time intervals corresponding to different database tables may be different. Following the above example, the user sets the number of uninstalls to 3 through crontab and the scheduling interval to one hour. Taking database table A as an example, the first unloading time is d1, and the preset time interval is 1 day. Before the first unloading, the i-th unloading time is d1, and the i+1-th unloading time is d1+1. When d1 is reached, the first unloading is performed. After the first unloading, the i-th unloading time is d1+1, and the i+1-th unloading time is d1+2; when d1+1 is reached, the second unloading is performed. After the second unloading, the i-th unloading time is d1+2, and the i+1-th unloading time is d1+3; when d1+2 is reached, the third unloading is performed. After the third unloading, the i-th unloading time is d1+3, and the i+1-th unloading time is d1+4.
可见,本发明实施例可动态配置卸载数据库表的卸载参数,例如卸载时间、卸载间隔时间等等,从而可实现一次卸载多个数据库表。另外,还可以动态配置卸载次数,可继续卸载在卸载周期内实际未卸载的数据库表,以避免漏卸载数据库表。It can be seen that the embodiment of the present invention can dynamically configure the unloading parameters of the unloading database table, such as the unloading time, the unloading interval time, etc., so that multiple database tables can be unloaded at one time. In addition, the number of unloading can be dynamically configured, and the database tables that are not actually unloaded during the unloading cycle can be continued to be unloaded, so as to avoid unloading the database tables.
在卸载数据库表之后,电子设备还可以推送该数据库表,即将数据库表发送给数据分析系统,通过数据分析系统实现对数据的分析。通常推送到数据分析系统的数据库表是卸载之后的数据库表,因此,电子设备在推送数据库表之前,可确定已经卸载完成的数据库表。After unloading the database table, the electronic device can also push the database table, that is, send the database table to the data analysis system, and analyze the data through the data analysis system. Usually, the database table pushed to the data analysis system is the database table after unloading. Therefore, before pushing the database table, the electronic device may determine that the unloading of the database table has been completed.
在可能的实现方式中,数据库表列表设置卸载标识,以指示对应数据库表是否卸载完成,例如,该卸载标识为“0”,指示卸载完成,该卸载标识为“1”,指示卸载未完成。应理解,针对任意数据库表,电子设备卸载完该数据库表可重置卸载标识。In a possible implementation manner, an uninstall flag is set in the database table list to indicate whether the corresponding database table is uninstalled. For example, the uninstall flag is "0", indicating that the uninstall is complete, and the uninstall flag is "1", indicating that the uninstall is not completed. It should be understood that, for any database table, the uninstallation flag can be reset by the electronic device after uninstalling the database table.
电子设备在推送数据库表之前,可获取数据库表中表示卸载标识的字段信息,进而确定卸载完成的数据库表。以卸载完成的数据库是第一数据库表为例。用户可获取第一数据库表的推送信息,并根据推送信息推送第一数据库表。推送信息包括存储路径及目标文件路径,存储路径指存储第一数据库表的路径,目标文件路径指第一数据库表要推送至的路径,例如,数据分析系统中存储第一数据库表的路径。其中,存储路径可以是存储卸载完成的数据库表对应的卸载文件。电子设备推送第一数据库表,也可以理解为,将存储第一数据库表对应的卸载文件发送至目标文件路径。Before pushing the database table, the electronic device may obtain field information representing the uninstallation identifier in the database table, and then determine the database table for which the uninstallation is completed. It is assumed that the database after uninstallation is the first database table as an example. The user can obtain the push information of the first database table, and push the first database table according to the push information. The push information includes a storage path and a target file path. The storage path refers to the path to store the first database table, and the target file path refers to the path to which the first database table is to be pushed, for example, the path to store the first database table in the data analysis system. Wherein, the storage path may be an uninstallation file corresponding to the database table where the uninstallation is completed. Pushing the first database table by the electronic device can also be understood as sending the uninstall file corresponding to the stored first database table to the target file path.
本发明实施例提供多种推送数据库表的模式,也可以理解为,推送数据库表的方式,简称为推送模式。推送模式,例如包括以jfserver、ftp或httpclient等方式推送数据库表的模式。针对数据分析系统的接口,电子设备可选择匹配的推送模式,适用范围更广。以预定义的推送模式包括jfserver推送模式、ftp推送模式和httpclient推送模式为例。不同的数据库表配置的推送模式可以相同,也可以不同。电子设备在推送第一数据库表之前,可获取与第一数据库表对应的推送模式标识,从而根据推送模式标识指示的推送模式推送第一数据库表。以推送模式标识指示ftp推送模式为例,电子设备根据存储路径获取数据库表A的卸载文件,然后以ftp推送模式将卸载文件发送至目标文件路径。The embodiments of the present invention provide a variety of modes for pushing database tables, which can also be understood as the modes for pushing database tables, which are referred to as push modes for short. The push mode, for example, includes the mode of pushing database tables by means of jfserver, ftp or httpclient. For the interface of the data analysis system, the electronic device can choose a matching push mode, which is applicable to a wider range. Take the predefined push modes including jfserver push mode, ftp push mode and httpclient push mode as an example. The push modes of different database table configurations can be the same or different. Before pushing the first database table, the electronic device may obtain the push mode identifier corresponding to the first database table, so as to push the first database table according to the push mode indicated by the push mode identifier. Taking the push mode identifier indicating the ftp push mode as an example, the electronic device obtains the uninstall file of the database table A according to the storage path, and then sends the uninstall file to the target file path in the ftp push mode.
与卸载时间类似,用户也可以设置数据库表的推送时间。不同数据库表的推送时间可不同。用户也可以设置数据库表的推送间隔,指示卸载完成之后不立即推送,而是间隔推送间隔之后再推送。不同数据库表推送间隔也可不同。同样,用户也可以设置数据库表的推送次数,以尽量避免漏推送数据库表。Similar to the uninstall time, the user can also set the push time of the database table. The push time can be different for different database tables. The user can also set the push interval of the database table, indicating that the push is not performed immediately after the uninstallation is completed, but after the push interval. The push interval for different database tables can also be different. Similarly, users can also set the push times of database tables to avoid missing pushes of database tables as much as possible.
下面结合附图介绍本发明实施例所提供的设备。The following describes the device provided by the embodiments of the present invention with reference to the accompanying drawings.
请参见图2,基于同一发明构思,本发明实施例提供了一种数据卸载装置200,该数据卸载装置200可以实现图1所示的流程。该数据卸载装置200包括列表生成模块201、参数生成模块202、卸载模块203。其中,列表生成模块201用于根据多个数据库表生成待卸载的数据库表列表,所述数据库表列表包括所述多个数据库表各自的索引和多个字段信息,所述多个字段信息包括所述多个数据库表中的各个数据库表分别对应的字段信息。参数生成模块202用于根据所述数据库表列表的字段信息生成卸载参数,所述卸载参数用于卸载所述多个数据库表。卸载模块203用于将所述卸载参数导入卸载脚本生成卸载文件,所述卸载脚本用于卸载所述多个数据库表。Referring to FIG. 2 , based on the same inventive concept, an embodiment of the present invention provides a
可选的,参数生成模块202根据数据库表列表的字段信息生成卸载参数,具体用于:获取所述卸载模式信息,根据所述卸载模式信息生成所述卸载参数。Optionally, the parameter generation module 202 generates the uninstallation parameter according to the field information of the database table list, and is specifically configured to: acquire the uninstallation mode information, and generate the uninstallation parameter according to the uninstallation mode information.
可选的,参数生成模块202根据数据库表列表的字段信息生成卸载参数,还用于:获取卸载时间信息,根据卸载时间信息生成卸载参数,其中,卸载参数包括第i次卸载时间和预设时间间隔,预设时间间隔和第i次卸载时间用于确定第i+1次卸载时间。Optionally, the parameter generation module 202 generates the unloading parameters according to the field information of the database table list, and is also used for: obtaining the unloading time information, and generating the unloading parameters according to the unloading time information, wherein the unloading parameters include the ith unloading time and the preset time. interval, the preset time interval and the i-th unloading time are used to determine the i+1-th unloading time.
可选的,卸载模块203将卸载参数导入卸载脚本生成卸载脚本后,还用于:将第i+1次卸载时间更新为第i次卸载时间,然后,获取第i次卸载时间和预设时间间隔,生成新的第i+1次卸载时间。其中,不同的数据库表对应的预设时间间隔不同。Optionally, after the uninstallation module 203 imports the uninstallation parameters into the uninstallation script to generate the uninstallation script, it is also used to: update the i+1th uninstallation time to the ith uninstallation time, and then obtain the ith uninstallation time and the preset time. interval to generate a new i+1 unloading time. The preset time intervals corresponding to different database tables are different.
可选的,数据卸载装置200还用于:获取第一数据库表对应的卸载标识,若该卸载标识指示第一数据库表卸载完成,则获取推送信息。需要说明的是,推送信息包括所述第一数据库表的存储路径以及目标文件路径。然后,电子设备从存储路径获取所述第一数据库表,并将第一数据库表推送至目标文件路径。Optionally, the
可选的,数据卸载装置200还用于:获取推送模式标识,并根据推送模式标识指示的推送模式将第一数据库表推送至目标文件路径。Optionally, the
可选的,数据卸载装置200还用于:接收输入的卸载次数,并根据该卸载次数对到达卸载时间的数据库表进行卸载。Optionally, the
请参见图3,基于同一发明构思,本发明一实施例提供一种电子设备300,该电子设备300可以实现图1所示的流程。该电子设备300包括至少一个处理器301及与该至少一个处理器301通信连接的存储器302,该处理器301执行计算机程序时实现上述任意的数据卸载的方法。Referring to FIG. 3 , based on the same inventive concept, an embodiment of the present invention provides an electronic device 300 , and the electronic device 300 can implement the process shown in FIG. 1 . The electronic device 300 includes at least one
其中,至少一个处理器301可用于根据多个数据库表生成待卸载的数据库表列表,该数据库表列表包括多个数据库表各自的索引和多个字段信息,多个字段信息包括多个数据库表中的各个数据库表分别对应的字段信息。并根据数据库表列表的字段信息生成卸载参数,该卸载参数用于卸载多个数据库表;将卸载参数导入卸载脚本生成卸载文件,卸载脚本用于卸载所述多个数据库表。Wherein, at least one
电子设备300可以用于执行图1所示的实施例所提供的方法,例如为前述的电子设备。因此关于该电子设备300中各功能模块所能够实现的功能,可参考图1所示的实施例中的相应描述,不多赘述。The electronic device 300 can be used to execute the method provided by the embodiment shown in FIG. 1 , such as the aforementioned electronic device. Therefore, regarding the functions that can be implemented by each functional module in the electronic device 300, reference may be made to the corresponding descriptions in the embodiment shown in FIG. 1, and details are not repeated here.
本发明实施例还提供一种计算机存储介质,其中,计算机存储介质存储有计算机指令,当计算机指令在计算机上运行时,使得计算机执行如图1所述的方法。An embodiment of the present invention further provides a computer storage medium, wherein the computer storage medium stores computer instructions, and when the computer instructions are executed on the computer, the computer is made to execute the method described in FIG. 1 .
本发明实施例还提供一种计算机程序产品,计算机程序产品包括:计算机程序代码,当计算机程序代码在计算机上运行时,使得计算机执行如图1所述的方法。An embodiment of the present invention also provides a computer program product, the computer program product includes: computer program code, when the computer program code is run on the computer, the computer is made to execute the method described in FIG. 1 .
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims (14)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210706934.1A CN114925074A (en) | 2022-06-21 | 2022-06-21 | A data unloading method, device, device and medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210706934.1A CN114925074A (en) | 2022-06-21 | 2022-06-21 | A data unloading method, device, device and medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN114925074A true CN114925074A (en) | 2022-08-19 |
Family
ID=82813754
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210706934.1A Pending CN114925074A (en) | 2022-06-21 | 2022-06-21 | A data unloading method, device, device and medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN114925074A (en) |
Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20030177146A1 (en) * | 2002-03-18 | 2003-09-18 | International Business Machines Corporation | Method, system, and program product for migrating data from one data base management system to another data base management system |
| US20050114404A1 (en) * | 2003-11-21 | 2005-05-26 | Bmc Software, Inc. | Database table version upload |
| CN102375891A (en) * | 2011-11-15 | 2012-03-14 | 山东浪潮金融信息系统有限公司 | Implementation tool for unloading and loading incremental data |
| CN107229721A (en) * | 2017-06-02 | 2017-10-03 | 泰华智慧产业集团股份有限公司 | A kind of method and device for changing data pick-up |
| CN109508355A (en) * | 2018-10-19 | 2019-03-22 | 平安科技(深圳)有限公司 | A kind of data pick-up method, system and terminal device |
| CN112687364A (en) * | 2020-12-24 | 2021-04-20 | 宁波金唐软件有限公司 | Hbase-based medical data management method and system |
| CN113641742A (en) * | 2021-08-05 | 2021-11-12 | 广东电网有限责任公司 | A data extraction method, device, device and storage medium |
-
2022
- 2022-06-21 CN CN202210706934.1A patent/CN114925074A/en active Pending
Patent Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20030177146A1 (en) * | 2002-03-18 | 2003-09-18 | International Business Machines Corporation | Method, system, and program product for migrating data from one data base management system to another data base management system |
| US20050114404A1 (en) * | 2003-11-21 | 2005-05-26 | Bmc Software, Inc. | Database table version upload |
| CN102375891A (en) * | 2011-11-15 | 2012-03-14 | 山东浪潮金融信息系统有限公司 | Implementation tool for unloading and loading incremental data |
| CN107229721A (en) * | 2017-06-02 | 2017-10-03 | 泰华智慧产业集团股份有限公司 | A kind of method and device for changing data pick-up |
| CN109508355A (en) * | 2018-10-19 | 2019-03-22 | 平安科技(深圳)有限公司 | A kind of data pick-up method, system and terminal device |
| CN112687364A (en) * | 2020-12-24 | 2021-04-20 | 宁波金唐软件有限公司 | Hbase-based medical data management method and system |
| CN113641742A (en) * | 2021-08-05 | 2021-11-12 | 广东电网有限责任公司 | A data extraction method, device, device and storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN109508355B (en) | A data extraction method, system and terminal device | |
| CN108280023B (en) | Task execution method and device and server | |
| CN109725995B (en) | Method, device and equipment for executing data extraction task and readable storage medium | |
| CN110083600A (en) | A kind of method, apparatus, calculating equipment and the storage medium of log collection processing | |
| CN110209732A (en) | Method of data synchronization and device of the relevant database to Hadoop database | |
| CN111104540A (en) | Image search method, apparatus, device, and computer-readable storage medium | |
| CN111158800A (en) | Method and device for constructing task DAG based on mapping relation | |
| CN112650777A (en) | Data warehouse manufacturing method and device, terminal equipment and computer storage medium | |
| CN110532559B (en) | Rule processing method and device | |
| CN118504706A (en) | Proxy model construction method, device, equipment and storage medium | |
| CN114925074A (en) | A data unloading method, device, device and medium | |
| CN110659295A (en) | Method, apparatus and medium for recording valid data based on HAWQ | |
| CN110222046A (en) | Processing method, device, server and the storage medium of table data | |
| CN120144259A (en) | Big data job scheduling method and system based on field lineage | |
| CN108959229A (en) | Planning report generation method, terminal and storage medium based on customer information | |
| CN104615763A (en) | Intermediate table updating method and device | |
| CN114662689B (en) | Pruning method, device, equipment and medium of neural network | |
| JPWO2018061219A1 (en) | Job scheduling system, job scheduling method, and job scheduling apparatus | |
| CN117874033A (en) | Database sub-table method and device, electronic equipment and storage medium | |
| CN111552561B (en) | Task processing method and device | |
| CN111061518B (en) | Data processing method, system, terminal equipment and storage medium based on drive node | |
| CN113076098A (en) | General ledger data processing method and device | |
| CN114969016A (en) | Data cleaning method and device | |
| CN112395365B (en) | Knowledge graph batch offline query solution | |
| CN114840586A (en) | Data conversion method, equipment, server and computer readable storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20220819 |
|
| RJ01 | Rejection of invention patent application after publication |